@senitix/ui 0.4.1 → 0.4.3
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.
- package/dist/accordion-BcwB0wwz.cjs +2 -0
- package/dist/accordion-BcwB0wwz.cjs.map +1 -0
- package/dist/accordion-BwnJKrKm.js +360 -0
- package/dist/accordion-BwnJKrKm.js.map +1 -0
- package/dist/appointment-scheduler-BoQQO51F.cjs +2 -0
- package/dist/appointment-scheduler-BoQQO51F.cjs.map +1 -0
- package/dist/appointment-scheduler-DHAs-mF_.js +192 -0
- package/dist/appointment-scheduler-DHAs-mF_.js.map +1 -0
- package/dist/arrow-right-CM3nmiZe.js +15 -0
- package/dist/arrow-right-CM3nmiZe.js.map +1 -0
- package/dist/arrow-right-vDxRZOfm.cjs +7 -0
- package/dist/arrow-right-vDxRZOfm.cjs.map +1 -0
- package/dist/avatar-BlEcWE7T.js +191 -0
- package/dist/avatar-BlEcWE7T.js.map +1 -0
- package/dist/avatar-Cl38Ye4J.cjs +2 -0
- package/dist/avatar-Cl38Ye4J.cjs.map +1 -0
- package/dist/badge-BZcdBG5J.cjs +23 -0
- package/dist/badge-BZcdBG5J.cjs.map +1 -0
- package/dist/badge-D0C_rP2l.js +157 -0
- package/dist/badge-D0C_rP2l.js.map +1 -0
- package/dist/button-BP_ug5gP.js +126 -0
- package/dist/button-BP_ug5gP.js.map +1 -0
- package/dist/button-CPuCii0R.cjs +2 -0
- package/dist/button-CPuCii0R.cjs.map +1 -0
- package/dist/{calendar-DgnhzEfp.js → calendar-86qoSnO7.js} +368 -433
- package/dist/calendar-86qoSnO7.js.map +1 -0
- package/dist/{calendar-D3RWU0_G.cjs → calendar-BH-AuyiB.cjs} +2 -2
- package/dist/{calendar-D3RWU0_G.cjs.map → calendar-BH-AuyiB.cjs.map} +1 -1
- package/dist/calendar-CSJ060ym.cjs +2 -0
- package/dist/calendar-CSJ060ym.cjs.map +1 -0
- package/dist/{calendar-CUxm1K7J.js → calendar-JUSWONQ0.js} +2 -2
- package/dist/{calendar-CUxm1K7J.js.map → calendar-JUSWONQ0.js.map} +1 -1
- package/dist/{card-DISL3sPJ.cjs → card-CToWUN1K.cjs} +2 -2
- package/dist/{card-DISL3sPJ.cjs.map → card-CToWUN1K.cjs.map} +1 -1
- package/dist/{card-fId5vof_.js → card-yxbWFvZ1.js} +2 -2
- package/dist/{card-fId5vof_.js.map → card-yxbWFvZ1.js.map} +1 -1
- package/dist/checkbox-BmugT50K.cjs +2 -0
- package/dist/checkbox-BmugT50K.cjs.map +1 -0
- package/dist/{checkbox-BY2zxQVv.js → checkbox-CTa9e4SG.js} +95 -97
- package/dist/checkbox-CTa9e4SG.js.map +1 -0
- package/dist/chevron-left-5h87iFo_.cjs +7 -0
- package/dist/chevron-left-5h87iFo_.cjs.map +1 -0
- package/dist/chevron-left-DD5mQuvf.js +14 -0
- package/dist/chevron-left-DD5mQuvf.js.map +1 -0
- package/dist/{chevron-right-Bxf8i4gi.cjs → chevron-right-D-TdAZ7l.cjs} +2 -2
- package/dist/{chevron-right-Bxf8i4gi.cjs.map → chevron-right-D-TdAZ7l.cjs.map} +1 -1
- package/dist/{chevron-right-BLyGmyaF.js → chevron-right-Di90aqSn.js} +2 -2
- package/dist/{chevron-right-BLyGmyaF.js.map → chevron-right-Di90aqSn.js.map} +1 -1
- package/dist/chevron-up-Bq55Db6X.cjs +7 -0
- package/dist/{chevron-up-C3RClqXD.cjs.map → chevron-up-Bq55Db6X.cjs.map} +1 -1
- package/dist/{chevron-up-BmYZUtrk.js → chevron-up-Dr7EIn9V.js} +2 -2
- package/dist/{chevron-up-BmYZUtrk.js.map → chevron-up-Dr7EIn9V.js.map} +1 -1
- package/dist/clock-BjJE8PGr.js +15 -0
- package/dist/clock-BjJE8PGr.js.map +1 -0
- package/dist/clock-CnxBAA_O.cjs +7 -0
- package/dist/clock-CnxBAA_O.cjs.map +1 -0
- package/dist/command-BEpaOk-5.cjs +2 -0
- package/dist/command-BEpaOk-5.cjs.map +1 -0
- package/dist/command-CYhMM7gX.js +404 -0
- package/dist/command-CYhMM7gX.js.map +1 -0
- package/dist/components/builders/index.cjs.js +2 -0
- package/dist/components/builders/index.cjs.js.map +1 -0
- package/dist/components/builders/index.es.js +42 -0
- package/dist/components/builders/index.es.js.map +1 -0
- package/dist/components/charts/index.cjs.js +1 -1
- package/dist/components/charts/index.es.js +7 -6
- package/dist/components/charts/index.es.js.map +1 -1
- package/dist/components/data-display/index.cjs.js +1 -1
- package/dist/components/data-display/index.es.js +43 -20
- package/dist/components/dnd/index.cjs.js +1 -1
- package/dist/components/dnd/index.es.js +1 -1
- package/dist/components/feedback/index.cjs.js +1 -1
- package/dist/components/feedback/index.es.js +1 -1
- package/dist/components/forms/index.cjs.js +1 -1
- package/dist/components/forms/index.es.js +24 -23
- package/dist/components/forms/index.es.js.map +1 -1
- package/dist/components/layouts/index.cjs.js +1 -1
- package/dist/components/layouts/index.es.js +45 -21
- package/dist/components/messaging/index.cjs.js +2 -0
- package/dist/components/messaging/index.cjs.js.map +1 -0
- package/dist/components/messaging/index.es.js +15 -0
- package/dist/components/messaging/index.es.js.map +1 -0
- package/dist/components/navigation/index.cjs.js +1 -1
- package/dist/components/navigation/index.es.js +1 -1
- package/dist/components/scheduling/index.cjs.js +2 -0
- package/dist/components/scheduling/index.cjs.js.map +1 -0
- package/dist/components/scheduling/index.es.js +6 -0
- package/dist/components/scheduling/index.es.js.map +1 -0
- package/dist/components/ui/index.cjs.js +1 -1
- package/dist/components/ui/index.es.js +168 -158
- package/dist/components/ui/index.es.js.map +1 -1
- package/dist/dialog-Cr9SYCaD.cjs +6 -0
- package/dist/dialog-Cr9SYCaD.cjs.map +1 -0
- package/dist/dialog-MYAx3Qrc.js +387 -0
- package/dist/dialog-MYAx3Qrc.js.map +1 -0
- package/dist/dropdown-menu-CkCCV_tw.js +969 -0
- package/dist/dropdown-menu-CkCCV_tw.js.map +1 -0
- package/dist/dropdown-menu-ejikFvg2.cjs +7 -0
- package/dist/dropdown-menu-ejikFvg2.cjs.map +1 -0
- package/dist/{ellipsis-6eUne95u.js → ellipsis-CKhpjj5H.js} +2 -2
- package/dist/{ellipsis-6eUne95u.js.map → ellipsis-CKhpjj5H.js.map} +1 -1
- package/dist/{ellipsis-DkM3GBF5.cjs → ellipsis-Dk7Wfc4i.cjs} +3 -3
- package/dist/{ellipsis-DkM3GBF5.cjs.map → ellipsis-Dk7Wfc4i.cjs.map} +1 -1
- package/dist/external-link-CGBqsrbm.cjs +7 -0
- package/dist/external-link-CGBqsrbm.cjs.map +1 -0
- package/dist/external-link-UeWW0ty3.js +16 -0
- package/dist/external-link-UeWW0ty3.js.map +1 -0
- package/dist/eye-Cved4eAo.cjs +7 -0
- package/dist/eye-Cved4eAo.cjs.map +1 -0
- package/dist/eye-KdCUpmO8.js +21 -0
- package/dist/eye-KdCUpmO8.js.map +1 -0
- package/dist/{file-Cw_u_aJB.js → file-CHbdXCWO.js} +2 -2
- package/dist/{file-Cw_u_aJB.js.map → file-CHbdXCWO.js.map} +1 -1
- package/dist/{file-Cp5UoYUZ.cjs → file-CqYRamm8.cjs} +3 -3
- package/dist/{file-Cp5UoYUZ.cjs.map → file-CqYRamm8.cjs.map} +1 -1
- package/dist/file-spreadsheet-CpySxI0-.cjs +7 -0
- package/dist/file-spreadsheet-CpySxI0-.cjs.map +1 -0
- package/dist/file-spreadsheet-EqZMR-mM.js +19 -0
- package/dist/file-spreadsheet-EqZMR-mM.js.map +1 -0
- package/dist/form-preview-Bm5xHtkw.js +12075 -0
- package/dist/form-preview-Bm5xHtkw.js.map +1 -0
- package/dist/form-preview-IPEZdspX.cjs +111 -0
- package/dist/form-preview-IPEZdspX.cjs.map +1 -0
- package/dist/full-calendar-4Ut52QNO.cjs +18 -0
- package/dist/full-calendar-4Ut52QNO.cjs.map +1 -0
- package/dist/full-calendar-DD_tBy69.js +2631 -0
- package/dist/full-calendar-DD_tBy69.js.map +1 -0
- package/dist/funnel-chart-Dfj1pOyV.cjs +6 -0
- package/dist/funnel-chart-Dfj1pOyV.cjs.map +1 -0
- package/dist/funnel-chart-o9qcEMgg.js +2952 -0
- package/dist/funnel-chart-o9qcEMgg.js.map +1 -0
- package/dist/global-search-DcBKVaM4.cjs +22 -0
- package/dist/global-search-DcBKVaM4.cjs.map +1 -0
- package/dist/global-search-Dul9CD6-.js +1331 -0
- package/dist/global-search-Dul9CD6-.js.map +1 -0
- package/dist/hooks/index.cjs.js +1 -1
- package/dist/hooks/index.es.js +9 -7
- package/dist/hooks/index.es.js.map +1 -1
- package/dist/{index-DtaLkIY8.js → index-BGUveO6l.js} +84 -79
- package/dist/{index-DtaLkIY8.js.map → index-BGUveO6l.js.map} +1 -1
- package/dist/{index-gVbM3K4f.cjs → index-Bhee6XHk.cjs} +2 -2
- package/dist/{index-gVbM3K4f.cjs.map → index-Bhee6XHk.cjs.map} +1 -1
- package/dist/index-CrSlyWAA.js +1090 -0
- package/dist/index-CrSlyWAA.js.map +1 -0
- package/dist/{index-Dk_Et2WJ.js → index-D8-pHJim.js} +2 -2
- package/dist/{index-Dk_Et2WJ.js.map → index-D8-pHJim.js.map} +1 -1
- package/dist/index-Dy_9oyP3.cjs +2 -0
- package/dist/{index-D2U2F80P.cjs.map → index-Dy_9oyP3.cjs.map} +1 -1
- package/dist/index-hnbbvGmb.cjs +21 -0
- package/dist/index-hnbbvGmb.cjs.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +434 -319
- package/dist/index.es.js.map +1 -1
- package/dist/input-Pfq8fkiV.js +2718 -0
- package/dist/input-Pfq8fkiV.js.map +1 -0
- package/dist/input-UBp7V7li.cjs +52 -0
- package/dist/input-UBp7V7li.cjs.map +1 -0
- package/dist/label-CExiitfO.js +50 -0
- package/dist/label-CExiitfO.js.map +1 -0
- package/dist/label-F0zGAiI2.cjs +2 -0
- package/dist/label-F0zGAiI2.cjs.map +1 -0
- package/dist/loader-circle-CBVYGIRp.js +14 -0
- package/dist/loader-circle-CBVYGIRp.js.map +1 -0
- package/dist/loader-circle-IaJKvYsP.cjs +7 -0
- package/dist/loader-circle-IaJKvYsP.cjs.map +1 -0
- package/dist/locale-provider-BHGNO4j7.js +1786 -0
- package/dist/locale-provider-BHGNO4j7.js.map +1 -0
- package/dist/locale-provider-BScpm-eC.cjs +2 -0
- package/dist/locale-provider-BScpm-eC.cjs.map +1 -0
- package/dist/locale-selector-CRC0VBKl.cjs +12 -0
- package/dist/locale-selector-CRC0VBKl.cjs.map +1 -0
- package/dist/locale-selector-HuzfE0zZ.js +1740 -0
- package/dist/locale-selector-HuzfE0zZ.js.map +1 -0
- package/dist/map-pin-CHh0xl6i.js +46 -0
- package/dist/map-pin-CHh0xl6i.js.map +1 -0
- package/dist/map-pin-DGObSZ40.cjs +17 -0
- package/dist/map-pin-DGObSZ40.cjs.map +1 -0
- package/dist/message-square-B_xLey5D.js +14 -0
- package/dist/message-square-B_xLey5D.js.map +1 -0
- package/dist/message-square-_69ua8rH.cjs +7 -0
- package/dist/message-square-_69ua8rH.cjs.map +1 -0
- package/dist/minus-BUFkTM0k.cjs +7 -0
- package/dist/{minus-C0uyaz70.cjs.map → minus-BUFkTM0k.cjs.map} +1 -1
- package/dist/{minus-CiwV65ZG.js → minus-DJ0tmymW.js} +2 -2
- package/dist/{minus-CiwV65ZG.js.map → minus-DJ0tmymW.js.map} +1 -1
- package/dist/multi-container-CytCGxsc.cjs +7 -0
- package/dist/multi-container-CytCGxsc.cjs.map +1 -0
- package/dist/multi-container-DmkgnCJN.js +799 -0
- package/dist/multi-container-DmkgnCJN.js.map +1 -0
- package/dist/multi-select-Bj_kIDHE.cjs +7 -0
- package/dist/multi-select-Bj_kIDHE.cjs.map +1 -0
- package/dist/multi-select-CPF7w871.js +224 -0
- package/dist/multi-select-CPF7w871.js.map +1 -0
- package/dist/pencil-BJULwaDl.cjs +12 -0
- package/dist/pencil-BJULwaDl.cjs.map +1 -0
- package/dist/pencil-HL0trGIs.js +31 -0
- package/dist/pencil-HL0trGIs.js.map +1 -0
- package/dist/permission-matrix-BRqw2RPb.js +6128 -0
- package/dist/permission-matrix-BRqw2RPb.js.map +1 -0
- package/dist/permission-matrix-CqE8q8Hi.cjs +93 -0
- package/dist/permission-matrix-CqE8q8Hi.cjs.map +1 -0
- package/dist/phone-B0J1dGIE.js +31 -0
- package/dist/phone-B0J1dGIE.js.map +1 -0
- package/dist/phone-DPA6vucM.cjs +12 -0
- package/dist/phone-DPA6vucM.cjs.map +1 -0
- package/dist/plus-Bcuujcqd.cjs +7 -0
- package/dist/{plus-BsV82JJ5.cjs.map → plus-Bcuujcqd.cjs.map} +1 -1
- package/dist/{plus-DxD6rofl.js → plus-D7DMDKb8.js} +2 -2
- package/dist/{plus-DxD6rofl.js.map → plus-D7DMDKb8.js.map} +1 -1
- package/dist/popover-Bba1ELMX.cjs +2 -0
- package/dist/popover-Bba1ELMX.cjs.map +1 -0
- package/dist/popover-CZWAuYUL.js +281 -0
- package/dist/popover-CZWAuYUL.js.map +1 -0
- package/dist/progress-BPpsmZ48.js +218 -0
- package/dist/progress-BPpsmZ48.js.map +1 -0
- package/dist/progress-BrzjVhWG.cjs +22 -0
- package/dist/progress-BrzjVhWG.cjs.map +1 -0
- package/dist/providers/index.cjs.js +1 -1
- package/dist/providers/index.es.js +1 -1
- package/dist/radio-group-B9RM_c7e.js +244 -0
- package/dist/radio-group-B9RM_c7e.js.map +1 -0
- package/dist/radio-group-_n8TTqNQ.cjs +2 -0
- package/dist/radio-group-_n8TTqNQ.cjs.map +1 -0
- package/dist/record-dialog-footer-DbH9A6eA.js +2577 -0
- package/dist/record-dialog-footer-DbH9A6eA.js.map +1 -0
- package/dist/record-dialog-footer-DpDxH5wX.cjs +37 -0
- package/dist/record-dialog-footer-DpDxH5wX.cjs.map +1 -0
- package/dist/scroll-area-CGNbDUBQ.js +889 -0
- package/dist/scroll-area-CGNbDUBQ.js.map +1 -0
- package/dist/scroll-area-HsTSI_58.cjs +22 -0
- package/dist/scroll-area-HsTSI_58.cjs.map +1 -0
- package/dist/select-CEsYpjPi.cjs +2 -0
- package/dist/select-CEsYpjPi.cjs.map +1 -0
- package/dist/{select-BJpZrtep.js → select-Ce2C2acZ.js} +184 -179
- package/dist/select-Ce2C2acZ.js.map +1 -0
- package/dist/send-DIkOd-pu.js +21 -0
- package/dist/send-DIkOd-pu.js.map +1 -0
- package/dist/send-H6HC-rS8.cjs +7 -0
- package/dist/send-H6HC-rS8.cjs.map +1 -0
- package/dist/shared-inbox-Bv0AgLew.js +702 -0
- package/dist/shared-inbox-Bv0AgLew.js.map +1 -0
- package/dist/shared-inbox-DWEKfDX3.cjs +22 -0
- package/dist/shared-inbox-DWEKfDX3.cjs.map +1 -0
- package/dist/sheet-DTimb4SJ.cjs +2 -0
- package/dist/sheet-DTimb4SJ.cjs.map +1 -0
- package/dist/sheet-DgpAPCAp.js +147 -0
- package/dist/sheet-DgpAPCAp.js.map +1 -0
- package/dist/{skeleton-Bl6FAxHT.js → skeleton-C_dwS3_6.js} +2 -2
- package/dist/{skeleton-Bl6FAxHT.js.map → skeleton-C_dwS3_6.js.map} +1 -1
- package/dist/{skeleton-Cb6MWerF.cjs → skeleton-D3YsjVWD.cjs} +2 -2
- package/dist/{skeleton-Cb6MWerF.cjs.map → skeleton-D3YsjVWD.cjs.map} +1 -1
- package/dist/sparkline-chart-BP4bk24J.js +15881 -0
- package/dist/sparkline-chart-BP4bk24J.js.map +1 -0
- package/dist/sparkline-chart-D6SLZVjp.cjs +79 -0
- package/dist/sparkline-chart-D6SLZVjp.cjs.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/switch-AEZvZSRV.cjs +2 -0
- package/dist/switch-AEZvZSRV.cjs.map +1 -0
- package/dist/switch-BF4LLvaU.js +147 -0
- package/dist/switch-BF4LLvaU.js.map +1 -0
- package/dist/table-2-Bn-YjZ9s.cjs +17 -0
- package/dist/table-2-Bn-YjZ9s.cjs.map +1 -0
- package/dist/table-2-C7E_N72K.js +52 -0
- package/dist/table-2-C7E_N72K.js.map +1 -0
- package/dist/textarea-4qZDuQ-C.js +206 -0
- package/dist/textarea-4qZDuQ-C.js.map +1 -0
- package/dist/textarea-Bq_zyt0L.cjs +2 -0
- package/dist/textarea-Bq_zyt0L.cjs.map +1 -0
- package/dist/tooltip-Dd7le9EO.cjs +2 -0
- package/dist/tooltip-Dd7le9EO.cjs.map +1 -0
- package/dist/tooltip-Dee-pNPI.js +338 -0
- package/dist/tooltip-Dee-pNPI.js.map +1 -0
- package/dist/trash-2-B3EP3JfM.js +18 -0
- package/dist/trash-2-B3EP3JfM.js.map +1 -0
- package/dist/trash-2-DWEeKlWT.cjs +7 -0
- package/dist/trash-2-DWEeKlWT.cjs.map +1 -0
- package/dist/{trending-up-BHFXgLWy.js → trending-up-ljWtN4pj.js} +2 -2
- package/dist/{trending-up-BHFXgLWy.js.map → trending-up-ljWtN4pj.js.map} +1 -1
- package/dist/{trending-up-BBjz_E69.cjs → trending-up-mLgmkp--.cjs} +2 -2
- package/dist/{trending-up-BBjz_E69.cjs.map → trending-up-mLgmkp--.cjs.map} +1 -1
- package/dist/upload-2tm-XihE.cjs +7 -0
- package/dist/upload-2tm-XihE.cjs.map +1 -0
- package/dist/upload-C_JDP8O0.js +16 -0
- package/dist/upload-C_JDP8O0.js.map +1 -0
- package/dist/use-controllable-state-3ATd6Fqd.cjs +2 -0
- package/dist/use-controllable-state-3ATd6Fqd.cjs.map +1 -0
- package/dist/use-controllable-state-CEa-Zlq6.js +23 -0
- package/dist/use-controllable-state-CEa-Zlq6.js.map +1 -0
- package/dist/use-formatters-Bb0fX1lW.cjs +2 -0
- package/dist/{use-formatters-CObUgipW.cjs.map → use-formatters-Bb0fX1lW.cjs.map} +1 -1
- package/dist/{use-formatters-Bgj3JA4i.js → use-formatters-xeMS4gdV.js} +1160 -1165
- package/dist/{use-formatters-Bgj3JA4i.js.map → use-formatters-xeMS4gdV.js.map} +1 -1
- package/dist/utils/index.cjs.js +1 -1
- package/dist/utils/index.es.js +1 -1
- package/dist/welcome-card-Ccbl_miQ.js +1007 -0
- package/dist/welcome-card-Ccbl_miQ.js.map +1 -0
- package/dist/welcome-card-D-ShMkaS.cjs +37 -0
- package/dist/welcome-card-D-ShMkaS.cjs.map +1 -0
- package/dist/x-BBkgEhUv.js +15 -0
- package/dist/x-BBkgEhUv.js.map +1 -0
- package/dist/x-D-El5XAY.cjs +7 -0
- package/dist/x-D-El5XAY.cjs.map +1 -0
- package/package.json +20 -2
- package/dist/avatar-BT_SPwFW.cjs +0 -18
- package/dist/avatar-BT_SPwFW.cjs.map +0 -1
- package/dist/avatar-C5-ZWIqT.js +0 -305
- package/dist/avatar-C5-ZWIqT.js.map +0 -1
- package/dist/calendar-BF5drX5u.cjs +0 -12
- package/dist/calendar-BF5drX5u.cjs.map +0 -1
- package/dist/calendar-DgnhzEfp.js.map +0 -1
- package/dist/checkbox-BY2zxQVv.js.map +0 -1
- package/dist/checkbox-CL6u7vL6.cjs +0 -2
- package/dist/checkbox-CL6u7vL6.cjs.map +0 -1
- package/dist/chevron-down-BiUlxZA-.js +0 -14
- package/dist/chevron-down-BiUlxZA-.js.map +0 -1
- package/dist/chevron-down-Ce0kqXiD.cjs +0 -7
- package/dist/chevron-down-Ce0kqXiD.cjs.map +0 -1
- package/dist/chevron-up-C3RClqXD.cjs +0 -7
- package/dist/createLucideIcon-BC8wu-bu.js +0 -80
- package/dist/createLucideIcon-BC8wu-bu.js.map +0 -1
- package/dist/createLucideIcon-Cv8nC2E9.cjs +0 -22
- package/dist/createLucideIcon-Cv8nC2E9.cjs.map +0 -1
- package/dist/filter-tags-DoRzXjuY.cjs +0 -48
- package/dist/filter-tags-DoRzXjuY.cjs.map +0 -1
- package/dist/filter-tags-zEQmRhEU.js +0 -2712
- package/dist/filter-tags-zEQmRhEU.js.map +0 -1
- package/dist/full-calendar-5Z4JSj8g.js +0 -3551
- package/dist/full-calendar-5Z4JSj8g.js.map +0 -1
- package/dist/full-calendar-DjAvCfuE.cjs +0 -23
- package/dist/full-calendar-DjAvCfuE.cjs.map +0 -1
- package/dist/global-search-BbZfc-VL.js +0 -1216
- package/dist/global-search-BbZfc-VL.js.map +0 -1
- package/dist/global-search-Bd74_wPV.cjs +0 -22
- package/dist/global-search-Bd74_wPV.cjs.map +0 -1
- package/dist/index-D2U2F80P.cjs +0 -2
- package/dist/index-DG0KV-sw.cjs +0 -11
- package/dist/index-DG0KV-sw.cjs.map +0 -1
- package/dist/index-XnFSmCuh.js +0 -299
- package/dist/index-XnFSmCuh.js.map +0 -1
- package/dist/input-BgPy-4Qu.js +0 -3658
- package/dist/input-BgPy-4Qu.js.map +0 -1
- package/dist/input-Cfr2WB-P.cjs +0 -47
- package/dist/input-Cfr2WB-P.cjs.map +0 -1
- package/dist/locale-provider-BojNdf1Y.cjs +0 -2
- package/dist/locale-provider-BojNdf1Y.cjs.map +0 -1
- package/dist/locale-provider-DzBeb-X3.js +0 -1013
- package/dist/locale-provider-DzBeb-X3.js.map +0 -1
- package/dist/locale-selector-BD1IWk6X.cjs +0 -22
- package/dist/locale-selector-BD1IWk6X.cjs.map +0 -1
- package/dist/locale-selector-DLRSyVye.js +0 -1772
- package/dist/locale-selector-DLRSyVye.js.map +0 -1
- package/dist/minus-C0uyaz70.cjs +0 -7
- package/dist/multi-container-BZia7HCU.js +0 -748
- package/dist/multi-container-BZia7HCU.js.map +0 -1
- package/dist/multi-container-BdNbgtPZ.cjs +0 -7
- package/dist/multi-container-BdNbgtPZ.cjs.map +0 -1
- package/dist/pipeline-Dh052Dvj.cjs +0 -27
- package/dist/pipeline-Dh052Dvj.cjs.map +0 -1
- package/dist/pipeline-DqWvleNy.js +0 -1076
- package/dist/pipeline-DqWvleNy.js.map +0 -1
- package/dist/plus-BsV82JJ5.cjs +0 -7
- package/dist/popover-BgLxmm1z.cjs +0 -7
- package/dist/popover-BgLxmm1z.cjs.map +0 -1
- package/dist/popover-PI9jbhnS.js +0 -775
- package/dist/popover-PI9jbhnS.js.map +0 -1
- package/dist/progress-CTTt_CP3.js +0 -260
- package/dist/progress-CTTt_CP3.js.map +0 -1
- package/dist/progress-CTWb7X1Q.cjs +0 -37
- package/dist/progress-CTWb7X1Q.cjs.map +0 -1
- package/dist/scroll-area-A3jGu-Ta.js +0 -974
- package/dist/scroll-area-A3jGu-Ta.js.map +0 -1
- package/dist/scroll-area-DzDnWIYJ.cjs +0 -12
- package/dist/scroll-area-DzDnWIYJ.cjs.map +0 -1
- package/dist/select-BJpZrtep.js.map +0 -1
- package/dist/select-Ii8HRuXa.cjs +0 -2
- package/dist/select-Ii8HRuXa.cjs.map +0 -1
- package/dist/separator-BzcDE0Ei.cjs +0 -2
- package/dist/separator-BzcDE0Ei.cjs.map +0 -1
- package/dist/separator-DyarVo1-.js +0 -396
- package/dist/separator-DyarVo1-.js.map +0 -1
- package/dist/sheet-DPSdOoE6.js +0 -84
- package/dist/sheet-DPSdOoE6.js.map +0 -1
- package/dist/sheet-XtjvbEMq.cjs +0 -2
- package/dist/sheet-XtjvbEMq.cjs.map +0 -1
- package/dist/sparkline-chart-CeCDeMNk.cjs +0 -102
- package/dist/sparkline-chart-CeCDeMNk.cjs.map +0 -1
- package/dist/sparkline-chart-DUS4CoW_.js +0 -19787
- package/dist/sparkline-chart-DUS4CoW_.js.map +0 -1
- package/dist/use-formatters-CObUgipW.cjs +0 -2
- package/dist/welcome-card-CNuEa6Ck.cjs +0 -67
- package/dist/welcome-card-CNuEa6Ck.cjs.map +0 -1
- package/dist/welcome-card-Cp6t6G3j.js +0 -1041
- package/dist/welcome-card-Cp6t6G3j.js.map +0 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";const l=require("react/jsx-runtime"),ee=require("react"),j=require("./index-Dy_9oyP3.cjs"),A=require("./locale-provider-BScpm-eC.cjs"),X=require("./tooltip-Dd7le9EO.cjs"),U=require("./input-UBp7V7li.cjs"),V=require("./select-CEsYpjPi.cjs"),P=require("./button-CPuCii0R.cjs"),hn=require("./calendar-CSJ060ym.cjs"),te=require("./popover-Bba1ELMX.cjs"),fn=require("./use-formatters-Bb0fX1lW.cjs"),pt=require("./calendar-BH-AuyiB.cjs"),J=require("./checkbox-BmugT50K.cjs"),ge=require("./multi-select-Bj_kIDHE.cjs"),L=require("./badge-BZcdBG5J.cjs"),ue=require("./x-D-El5XAY.cjs"),Be=require("./pencil-BJULwaDl.cjs"),pn=require("react-dom"),D=require("./dropdown-menu-ejikFvg2.cjs"),H=require("./scroll-area-HsTSI_58.cjs"),xt=require("./ellipsis-Dk7Wfc4i.cjs"),me=require("./card-CToWUN1K.cjs"),vt=require("./trending-up-mLgmkp--.cjs"),xn=require("./minus-BUFkTM0k.cjs"),ne=require("./avatar-Cl38Ye4J.cjs"),vn=require("./eye-Cved4eAo.cjs"),Se=require("./use-controllable-state-3ATd6Fqd.cjs"),ce=require("./command-BEpaOk-5.cjs"),wt=require("./trash-2-DWEeKlWT.cjs"),rt=require("./plus-Bcuujcqd.cjs"),wn=require("./chevron-up-Bq55Db6X.cjs"),ie=require("./skeleton-D3YsjVWD.cjs"),Cn=require("./sparkline-chart-D6SLZVjp.cjs"),he=require("./progress-BrzjVhWG.cjs"),Ct=require("./arrow-right-vDxRZOfm.cjs"),Sn=require("./switch-AEZvZSRV.cjs"),jn=require("./label-F0zGAiI2.cjs"),yn=require("./upload-2tm-XihE.cjs"),lt=require("./file-spreadsheet-CpySxI0-.cjs"),bn=require("./chevron-right-D-TdAZ7l.cjs");function Nn(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return s.default=e,Object.freeze(s)}const C=Nn(ee);/**
|
|
2
|
+
* @license lucide-react v0.441.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Rn=H.createLucideIcon("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
7
|
+
* @license lucide-react v0.441.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Fn=H.createLucideIcon("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
|
|
12
|
+
* @license lucide-react v0.441.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const _n=H.createLucideIcon("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/**
|
|
17
|
+
* @license lucide-react v0.441.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const Mn=H.createLucideIcon("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
|
|
22
|
+
* @license lucide-react v0.441.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const In=H.createLucideIcon("CalendarRange",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]]);/**
|
|
27
|
+
* @license lucide-react v0.441.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const kn=H.createLucideIcon("Diamond",[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z",key:"1f1r0c"}]]);/**
|
|
32
|
+
* @license lucide-react v0.441.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const En=H.createLucideIcon("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
37
|
+
* @license lucide-react v0.441.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const Dn=H.createLucideIcon("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
42
|
+
* @license lucide-react v0.441.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const Vn=H.createLucideIcon("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
47
|
+
* @license lucide-react v0.441.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/const Pn=H.createLucideIcon("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
52
|
+
* @license lucide-react v0.441.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const $n=H.createLucideIcon("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
|
57
|
+
* @license lucide-react v0.441.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/const On=H.createLucideIcon("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
62
|
+
* @license lucide-react v0.441.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const St=H.createLucideIcon("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
|
|
67
|
+
* table-core
|
|
68
|
+
*
|
|
69
|
+
* Copyright (c) TanStack
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the MIT license found in the
|
|
72
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
73
|
+
*
|
|
74
|
+
* @license MIT
|
|
75
|
+
*/function re(e,s){return typeof e=="function"?e(s):e}function W(e,s){return t=>{s.setState(n=>({...n,[e]:re(t,n[e])}))}}function Me(e){return e instanceof Function}function zn(e){return Array.isArray(e)&&e.every(s=>typeof s=="number")}function An(e,s){const t=[],n=r=>{r.forEach(o=>{t.push(o);const i=s(o);i!=null&&i.length&&n(i)})};return n(e),t}function N(e,s,t){let n=[],r;return o=>{let i;t.key&&t.debug&&(i=Date.now());const a=e(o);if(!(a.length!==n.length||a.some((h,f)=>n[f]!==h)))return r;n=a;let u;if(t.key&&t.debug&&(u=Date.now()),r=s(...a),t==null||t.onChange==null||t.onChange(r),t.key&&t.debug&&t!=null&&t.debug()){const h=Math.round((Date.now()-i)*100)/100,f=Math.round((Date.now()-u)*100)/100,g=f/16,c=(m,p)=>{for(m=String(m);m.length<p;)m=" "+m;return m};console.info(`%c⏱ ${c(f,5)} /${c(h,5)} ms`,`
|
|
76
|
+
font-size: .6rem;
|
|
77
|
+
font-weight: bold;
|
|
78
|
+
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,t==null?void 0:t.key)}return r}}function R(e,s,t,n){return{debug:()=>{var r;return(r=e==null?void 0:e.debugAll)!=null?r:e[s]},key:process.env.NODE_ENV==="development"&&t,onChange:n}}function Tn(e,s,t,n){const r=()=>{var i;return(i=o.getValue())!=null?i:e.options.renderFallbackValue},o={id:`${s.id}_${t.id}`,row:s,column:t,getValue:()=>s.getValue(n),renderValue:r,getContext:N(()=>[e,t,s,o],(i,a,d,u)=>({table:i,column:a,row:d,cell:u,getValue:u.getValue,renderValue:u.renderValue}),R(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(o,t,s,e)},{}),o}function Ln(e,s,t,n){var r,o;const a={...e._getDefaultColumnDef(),...s},d=a.accessorKey;let u=(r=(o=a.id)!=null?o:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?r:typeof a.header=="string"?a.header:void 0,h;if(a.accessorFn?h=a.accessorFn:d&&(d.includes(".")?h=g=>{let c=g;for(const p of d.split(".")){var m;c=(m=c)==null?void 0:m[p],process.env.NODE_ENV!=="production"&&c===void 0&&console.warn(`"${p}" in deeply nested key "${d}" returned undefined.`)}return c}:h=g=>g[a.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(u)}`,accessorFn:h,parent:n,depth:t,columnDef:a,columns:[],getFlatColumns:N(()=>[!0],()=>{var g;return[f,...(g=f.columns)==null?void 0:g.flatMap(c=>c.getFlatColumns())]},R(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:N(()=>[e._getOrderColumnsFn()],g=>{var c;if((c=f.columns)!=null&&c.length){let m=f.columns.flatMap(p=>p.getLeafColumns());return g(m)}return[f]},R(e.options,"debugColumns","column.getLeafColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(f,e);return f}const K="debugHeaders";function ot(e,s,t){var n;let o={id:(n=t.id)!=null?n:s.id,column:s,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],a=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(a),i.push(d)};return a(o),i},getContext:()=>({table:e,header:o,column:s})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(o,e)}),o}const Gn={createTable:e=>{e.getHeaderGroups=N(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(s,t,n,r)=>{var o,i;const a=(o=n==null?void 0:n.map(f=>t.find(g=>g.id===f)).filter(Boolean))!=null?o:[],d=(i=r==null?void 0:r.map(f=>t.find(g=>g.id===f)).filter(Boolean))!=null?i:[],u=t.filter(f=>!(n!=null&&n.includes(f.id))&&!(r!=null&&r.includes(f.id)));return je(s,[...a,...u,...d],e)},R(e.options,K,"getHeaderGroups")),e.getCenterHeaderGroups=N(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(s,t,n,r)=>(t=t.filter(o=>!(n!=null&&n.includes(o.id))&&!(r!=null&&r.includes(o.id))),je(s,t,e,"center")),R(e.options,K,"getCenterHeaderGroups")),e.getLeftHeaderGroups=N(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(s,t,n)=>{var r;const o=(r=n==null?void 0:n.map(i=>t.find(a=>a.id===i)).filter(Boolean))!=null?r:[];return je(s,o,e,"left")},R(e.options,K,"getLeftHeaderGroups")),e.getRightHeaderGroups=N(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(s,t,n)=>{var r;const o=(r=n==null?void 0:n.map(i=>t.find(a=>a.id===i)).filter(Boolean))!=null?r:[];return je(s,o,e,"right")},R(e.options,K,"getRightHeaderGroups")),e.getFooterGroups=N(()=>[e.getHeaderGroups()],s=>[...s].reverse(),R(e.options,K,"getFooterGroups")),e.getLeftFooterGroups=N(()=>[e.getLeftHeaderGroups()],s=>[...s].reverse(),R(e.options,K,"getLeftFooterGroups")),e.getCenterFooterGroups=N(()=>[e.getCenterHeaderGroups()],s=>[...s].reverse(),R(e.options,K,"getCenterFooterGroups")),e.getRightFooterGroups=N(()=>[e.getRightHeaderGroups()],s=>[...s].reverse(),R(e.options,K,"getRightFooterGroups")),e.getFlatHeaders=N(()=>[e.getHeaderGroups()],s=>s.map(t=>t.headers).flat(),R(e.options,K,"getFlatHeaders")),e.getLeftFlatHeaders=N(()=>[e.getLeftHeaderGroups()],s=>s.map(t=>t.headers).flat(),R(e.options,K,"getLeftFlatHeaders")),e.getCenterFlatHeaders=N(()=>[e.getCenterHeaderGroups()],s=>s.map(t=>t.headers).flat(),R(e.options,K,"getCenterFlatHeaders")),e.getRightFlatHeaders=N(()=>[e.getRightHeaderGroups()],s=>s.map(t=>t.headers).flat(),R(e.options,K,"getRightFlatHeaders")),e.getCenterLeafHeaders=N(()=>[e.getCenterFlatHeaders()],s=>s.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,K,"getCenterLeafHeaders")),e.getLeftLeafHeaders=N(()=>[e.getLeftFlatHeaders()],s=>s.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,K,"getLeftLeafHeaders")),e.getRightLeafHeaders=N(()=>[e.getRightFlatHeaders()],s=>s.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,K,"getRightLeafHeaders")),e.getLeafHeaders=N(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(s,t,n)=>{var r,o,i,a,d,u;return[...(r=(o=s[0])==null?void 0:o.headers)!=null?r:[],...(i=(a=t[0])==null?void 0:a.headers)!=null?i:[],...(d=(u=n[0])==null?void 0:u.headers)!=null?d:[]].map(h=>h.getLeafHeaders()).flat()},R(e.options,K,"getLeafHeaders"))}};function je(e,s,t,n){var r,o;let i=0;const a=function(g,c){c===void 0&&(c=1),i=Math.max(i,c),g.filter(m=>m.getIsVisible()).forEach(m=>{var p;(p=m.columns)!=null&&p.length&&a(m.columns,c+1)},0)};a(e);let d=[];const u=(g,c)=>{const m={depth:c,id:[n,`${c}`].filter(Boolean).join("_"),headers:[]},p=[];g.forEach(x=>{const v=[...p].reverse()[0],w=x.column.depth===m.depth;let M,$=!1;if(w&&x.column.parent?M=x.column.parent:(M=x.column,$=!0),v&&(v==null?void 0:v.column)===M)v.subHeaders.push(x);else{const O=ot(t,M,{id:[n,c,M.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:$,placeholderId:$?`${p.filter(F=>F.column===M).length}`:void 0,depth:c,index:p.length});O.subHeaders.push(x),p.push(O)}m.headers.push(x),x.headerGroup=m}),d.push(m),c>0&&u(p,c-1)},h=s.map((g,c)=>ot(t,g,{depth:i,index:c}));u(h,i-1),d.reverse();const f=g=>g.filter(m=>m.column.getIsVisible()).map(m=>{let p=0,x=0,v=[0];m.subHeaders&&m.subHeaders.length?(v=[],f(m.subHeaders).forEach(M=>{let{colSpan:$,rowSpan:O}=M;p+=$,v.push(O)})):p=1;const w=Math.min(...v);return x=x+w,m.colSpan=p,m.rowSpan=x,{colSpan:p,rowSpan:x}});return f((r=(o=d[0])==null?void 0:o.headers)!=null?r:[]),d}const Ye=(e,s,t,n,r,o,i)=>{let a={id:s,index:n,original:t,depth:r,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(a._valuesCache.hasOwnProperty(d))return a._valuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return a._valuesCache[d]=u.accessorFn(a.original,n),a._valuesCache[d]},getUniqueValues:d=>{if(a._uniqueValuesCache.hasOwnProperty(d))return a._uniqueValuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[d]=u.columnDef.getUniqueValues(a.original,n),a._uniqueValuesCache[d]):(a._uniqueValuesCache[d]=[a.getValue(d)],a._uniqueValuesCache[d])},renderValue:d=>{var u;return(u=a.getValue(d))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>An(a.subRows,d=>d.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let d=[],u=a;for(;;){const h=u.getParentRow();if(!h)break;d.push(h),u=h}return d.reverse()},getAllCells:N(()=>[e.getAllLeafColumns()],d=>d.map(u=>Tn(e,a,u,u.id)),R(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:N(()=>[a.getAllCells()],d=>d.reduce((u,h)=>(u[h.column.id]=h,u),{}),R(e.options,"debugRows","getAllCellsByColumnId"))};for(let d=0;d<e._features.length;d++){const u=e._features[d];u==null||u.createRow==null||u.createRow(a,e)}return a},Bn={createColumn:(e,s)=>{e._getFacetedRowModel=s.options.getFacetedRowModel&&s.options.getFacetedRowModel(s,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():s.getPreFilteredRowModel(),e._getFacetedUniqueValues=s.options.getFacetedUniqueValues&&s.options.getFacetedUniqueValues(s,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=s.options.getFacetedMinMaxValues&&s.options.getFacetedMinMaxValues(s,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},jt=(e,s,t)=>{var n,r;const o=t==null||(n=t.toString())==null?void 0:n.toLowerCase();return!!(!((r=e.getValue(s))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(o))};jt.autoRemove=e=>Y(e);const yt=(e,s,t)=>{var n;return!!(!((n=e.getValue(s))==null||(n=n.toString())==null)&&n.includes(t))};yt.autoRemove=e=>Y(e);const bt=(e,s,t)=>{var n;return((n=e.getValue(s))==null||(n=n.toString())==null?void 0:n.toLowerCase())===(t==null?void 0:t.toLowerCase())};bt.autoRemove=e=>Y(e);const Nt=(e,s,t)=>{var n;return(n=e.getValue(s))==null?void 0:n.includes(t)};Nt.autoRemove=e=>Y(e);const Rt=(e,s,t)=>!t.some(n=>{var r;return!((r=e.getValue(s))!=null&&r.includes(n))});Rt.autoRemove=e=>Y(e)||!(e!=null&&e.length);const Ft=(e,s,t)=>t.some(n=>{var r;return(r=e.getValue(s))==null?void 0:r.includes(n)});Ft.autoRemove=e=>Y(e)||!(e!=null&&e.length);const _t=(e,s,t)=>e.getValue(s)===t;_t.autoRemove=e=>Y(e);const Mt=(e,s,t)=>e.getValue(s)==t;Mt.autoRemove=e=>Y(e);const Je=(e,s,t)=>{let[n,r]=t;const o=e.getValue(s);return o>=n&&o<=r};Je.resolveFilterValue=e=>{let[s,t]=e,n=typeof s!="number"?parseFloat(s):s,r=typeof t!="number"?parseFloat(t):t,o=s===null||Number.isNaN(n)?-1/0:n,i=t===null||Number.isNaN(r)?1/0:r;if(o>i){const a=o;o=i,i=a}return[o,i]};Je.autoRemove=e=>Y(e)||Y(e[0])&&Y(e[1]);const Z={includesString:jt,includesStringSensitive:yt,equalsString:bt,arrIncludes:Nt,arrIncludesAll:Rt,arrIncludesSome:Ft,equals:_t,weakEquals:Mt,inNumberRange:Je};function Y(e){return e==null||e===""}const Hn={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:W("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,s)=>{e.getAutoFilterFn=()=>{const t=s.getCoreRowModel().flatRows[0],n=t==null?void 0:t.getValue(e.id);return typeof n=="string"?Z.includesString:typeof n=="number"?Z.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?Z.equals:Array.isArray(n)?Z.arrIncludes:Z.weakEquals},e.getFilterFn=()=>{var t,n;return Me(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(n=s.options.filterFns)==null?void 0:n[e.columnDef.filterFn])!=null?t:Z[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,n,r;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((n=s.options.enableColumnFilters)!=null?n:!0)&&((r=s.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=s.getState().columnFilters)==null||(t=t.find(n=>n.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,n;return(t=(n=s.getState().columnFilters)==null?void 0:n.findIndex(r=>r.id===e.id))!=null?t:-1},e.setFilterValue=t=>{s.setColumnFilters(n=>{const r=e.getFilterFn(),o=n==null?void 0:n.find(h=>h.id===e.id),i=re(t,o?o.value:void 0);if(it(r,i,e)){var a;return(a=n==null?void 0:n.filter(h=>h.id!==e.id))!=null?a:[]}const d={id:e.id,value:i};if(o){var u;return(u=n==null?void 0:n.map(h=>h.id===e.id?d:h))!=null?u:[]}return n!=null&&n.length?[...n,d]:[d]})}},createRow:(e,s)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=s=>{const t=e.getAllLeafColumns(),n=r=>{var o;return(o=re(s,r))==null?void 0:o.filter(i=>{const a=t.find(d=>d.id===i.id);if(a){const d=a.getFilterFn();if(it(d,i.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(n)},e.resetColumnFilters=s=>{var t,n;e.setColumnFilters(s?[]:(t=(n=e.initialState)==null?void 0:n.columnFilters)!=null?t:[])},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())}};function it(e,s,t){return(e&&e.autoRemove?e.autoRemove(s,t):!1)||typeof s>"u"||typeof s=="string"&&!s}const qn=(e,s,t)=>t.reduce((n,r)=>{const o=r.getValue(e);return n+(typeof o=="number"?o:0)},0),Kn=(e,s,t)=>{let n;return t.forEach(r=>{const o=r.getValue(e);o!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}),n},Un=(e,s,t)=>{let n;return t.forEach(r=>{const o=r.getValue(e);o!=null&&(n<o||n===void 0&&o>=o)&&(n=o)}),n},Wn=(e,s,t)=>{let n,r;return t.forEach(o=>{const i=o.getValue(e);i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}),[n,r]},Xn=(e,s)=>{let t=0,n=0;if(s.forEach(r=>{let o=r.getValue(e);o!=null&&(o=+o)>=o&&(++t,n+=o)}),t)return n/t},Yn=(e,s)=>{if(!s.length)return;const t=s.map(o=>o.getValue(e));if(!zn(t))return;if(t.length===1)return t[0];const n=Math.floor(t.length/2),r=t.sort((o,i)=>o-i);return t.length%2!==0?r[n]:(r[n-1]+r[n])/2},Jn=(e,s)=>Array.from(new Set(s.map(t=>t.getValue(e))).values()),Qn=(e,s)=>new Set(s.map(t=>t.getValue(e))).size,Zn=(e,s)=>s.length,Ve={sum:qn,min:Kn,max:Un,extent:Wn,mean:Xn,median:Yn,unique:Jn,uniqueCount:Qn,count:Zn},es={getDefaultColumnDef:()=>({aggregatedCell:e=>{var s,t;return(s=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?s:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:W("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,s)=>{e.toggleGrouping=()=>{s.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(n=>n!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,n;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((n=s.options.enableGrouping)!=null?n:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=s.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=s.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=s.getCoreRowModel().flatRows[0],n=t==null?void 0:t.getValue(e.id);if(typeof n=="number")return Ve.sum;if(Object.prototype.toString.call(n)==="[object Date]")return Ve.extent},e.getAggregationFn=()=>{var t,n;if(!e)throw new Error;return Me(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(n=s.options.aggregationFns)==null?void 0:n[e.columnDef.aggregationFn])!=null?t:Ve[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=s=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(s),e.resetGrouping=s=>{var t,n;e.setGrouping(s?[]:(t=(n=e.initialState)==null?void 0:n.grouping)!=null?t:[])},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())},createRow:(e,s)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const n=s.getColumn(t);return n!=null&&n.columnDef.getGroupingValue?(e._groupingValuesCache[t]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,s,t,n)=>{e.getIsGrouped=()=>s.getIsGrouped()&&s.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&s.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=t.subRows)!=null&&r.length)}}};function ts(e,s,t){if(!(s!=null&&s.length)||!t)return e;const n=e.filter(o=>!s.includes(o.id));return t==="remove"?n:[...s.map(o=>e.find(i=>i.id===o)).filter(Boolean),...n]}const ns={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:W("columnOrder",e)}),createColumn:(e,s)=>{e.getIndex=N(t=>[Ce(s,t)],t=>t.findIndex(n=>n.id===e.id),R(s.options,"debugColumns","getIndex")),e.getIsFirstColumn=t=>{var n;return((n=Ce(s,t)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=t=>{var n;const r=Ce(s,t);return((n=r[r.length-1])==null?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=s=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(s),e.resetColumnOrder=s=>{var t;e.setColumnOrder(s?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=N(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(s,t,n)=>r=>{let o=[];if(!(s!=null&&s.length))o=r;else{const i=[...s],a=[...r];for(;a.length&&i.length;){const d=i.shift(),u=a.findIndex(h=>h.id===d);u>-1&&o.push(a.splice(u,1)[0])}o=[...o,...a]}return ts(o,t,n)},R(e.options,"debugTable","_getOrderColumnsFn"))}},Pe=()=>({left:[],right:[]}),ss={getInitialState:e=>({columnPinning:Pe(),...e}),getDefaultOptions:e=>({onColumnPinningChange:W("columnPinning",e)}),createColumn:(e,s)=>{e.pin=t=>{const n=e.getLeafColumns().map(r=>r.id).filter(Boolean);s.setColumnPinning(r=>{var o,i;if(t==="right"){var a,d;return{left:((a=r==null?void 0:r.left)!=null?a:[]).filter(f=>!(n!=null&&n.includes(f))),right:[...((d=r==null?void 0:r.right)!=null?d:[]).filter(f=>!(n!=null&&n.includes(f))),...n]}}if(t==="left"){var u,h;return{left:[...((u=r==null?void 0:r.left)!=null?u:[]).filter(f=>!(n!=null&&n.includes(f))),...n],right:((h=r==null?void 0:r.right)!=null?h:[]).filter(f=>!(n!=null&&n.includes(f)))}}return{left:((o=r==null?void 0:r.left)!=null?o:[]).filter(f=>!(n!=null&&n.includes(f))),right:((i=r==null?void 0:r.right)!=null?i:[]).filter(f=>!(n!=null&&n.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(n=>{var r,o,i;return((r=n.columnDef.enablePinning)!=null?r:!0)&&((o=(i=s.options.enableColumnPinning)!=null?i:s.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(a=>a.id),{left:n,right:r}=s.getState().columnPinning,o=t.some(a=>n==null?void 0:n.includes(a)),i=t.some(a=>r==null?void 0:r.includes(a));return o?"left":i?"right":!1},e.getPinnedIndex=()=>{var t,n;const r=e.getIsPinned();return r?(t=(n=s.getState().columnPinning)==null||(n=n[r])==null?void 0:n.indexOf(e.id))!=null?t:-1:0}},createRow:(e,s)=>{e.getCenterVisibleCells=N(()=>[e._getAllVisibleCells(),s.getState().columnPinning.left,s.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.column.id))},R(s.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=N(()=>[e._getAllVisibleCells(),s.getState().columnPinning.left],(t,n)=>(n??[]).map(o=>t.find(i=>i.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),R(s.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=N(()=>[e._getAllVisibleCells(),s.getState().columnPinning.right],(t,n)=>(n??[]).map(o=>t.find(i=>i.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),R(s.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=s=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(s),e.resetColumnPinning=s=>{var t,n;return e.setColumnPinning(s?Pe():(t=(n=e.initialState)==null?void 0:n.columnPinning)!=null?t:Pe())},e.getIsSomeColumnsPinned=s=>{var t;const n=e.getState().columnPinning;if(!s){var r,o;return!!((r=n.left)!=null&&r.length||(o=n.right)!=null&&o.length)}return!!((t=n[s])!=null&&t.length)},e.getLeftLeafColumns=N(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(s,t)=>(t??[]).map(n=>s.find(r=>r.id===n)).filter(Boolean),R(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=N(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(s,t)=>(t??[]).map(n=>s.find(r=>r.id===n)).filter(Boolean),R(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=N(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(s,t,n)=>{const r=[...t??[],...n??[]];return s.filter(o=>!r.includes(o.id))},R(e.options,"debugColumns","getCenterLeafColumns"))}};function rs(e){return e||(typeof document<"u"?document:null)}const ye={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},$e=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ls={getDefaultColumnDef:()=>ye,getInitialState:e=>({columnSizing:{},columnSizingInfo:$e(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:W("columnSizing",e),onColumnSizingInfoChange:W("columnSizingInfo",e)}),createColumn:(e,s)=>{e.getSize=()=>{var t,n,r;const o=s.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:ye.minSize,(n=o??e.columnDef.size)!=null?n:ye.size),(r=e.columnDef.maxSize)!=null?r:ye.maxSize)},e.getStart=N(t=>[t,Ce(s,t),s.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((r,o)=>r+o.getSize(),0),R(s.options,"debugColumns","getStart")),e.getAfter=N(t=>[t,Ce(s,t),s.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((r,o)=>r+o.getSize(),0),R(s.options,"debugColumns","getAfter")),e.resetSize=()=>{s.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>{var t,n;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((n=s.options.enableColumnResizing)!=null?n:!0)},e.getIsResizing=()=>s.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,s)=>{e.getSize=()=>{let t=0;const n=r=>{if(r.subHeaders.length)r.subHeaders.forEach(n);else{var o;t+=(o=r.column.getSize())!=null?o:0}};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const n=s.getColumn(e.column.id),r=n==null?void 0:n.getCanResize();return o=>{if(!n||!r||(o.persist==null||o.persist(),Oe(o)&&o.touches&&o.touches.length>1))return;const i=e.getSize(),a=e?e.getLeafHeaders().map(v=>[v.column.id,v.column.getSize()]):[[n.id,n.getSize()]],d=Oe(o)?Math.round(o.touches[0].clientX):o.clientX,u={},h=(v,w)=>{typeof w=="number"&&(s.setColumnSizingInfo(M=>{var $,O;const F=s.options.columnResizeDirection==="rtl"?-1:1,E=(w-(($=M==null?void 0:M.startOffset)!=null?$:0))*F,G=Math.max(E/((O=M==null?void 0:M.startSize)!=null?O:0),-.999999);return M.columnSizingStart.forEach(y=>{let[I,k]=y;u[I]=Math.round(Math.max(k+k*G,0)*100)/100}),{...M,deltaOffset:E,deltaPercentage:G}}),(s.options.columnResizeMode==="onChange"||v==="end")&&s.setColumnSizing(M=>({...M,...u})))},f=v=>h("move",v),g=v=>{h("end",v),s.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=rs(t),m={moveHandler:v=>f(v.clientX),upHandler:v=>{c==null||c.removeEventListener("mousemove",m.moveHandler),c==null||c.removeEventListener("mouseup",m.upHandler),g(v.clientX)}},p={moveHandler:v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),f(v.touches[0].clientX),!1),upHandler:v=>{var w;c==null||c.removeEventListener("touchmove",p.moveHandler),c==null||c.removeEventListener("touchend",p.upHandler),v.cancelable&&(v.preventDefault(),v.stopPropagation()),g((w=v.touches[0])==null?void 0:w.clientX)}},x=os()?{passive:!1}:!1;Oe(o)?(c==null||c.addEventListener("touchmove",p.moveHandler,x),c==null||c.addEventListener("touchend",p.upHandler,x)):(c==null||c.addEventListener("mousemove",m.moveHandler,x),c==null||c.addEventListener("mouseup",m.upHandler,x)),s.setColumnSizingInfo(v=>({...v,startOffset:d,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=s=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(s),e.setColumnSizingInfo=s=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(s),e.resetColumnSizing=s=>{var t;e.setColumnSizing(s?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=s=>{var t;e.setColumnSizingInfo(s?$e():(t=e.initialState.columnSizingInfo)!=null?t:$e())},e.getTotalSize=()=>{var s,t;return(s=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((n,r)=>n+r.getSize(),0))!=null?s:0},e.getLeftTotalSize=()=>{var s,t;return(s=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((n,r)=>n+r.getSize(),0))!=null?s:0},e.getCenterTotalSize=()=>{var s,t;return(s=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((n,r)=>n+r.getSize(),0))!=null?s:0},e.getRightTotalSize=()=>{var s,t;return(s=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((n,r)=>n+r.getSize(),0))!=null?s:0}}};let be=null;function os(){if(typeof be=="boolean")return be;let e=!1;try{const s={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,s),window.removeEventListener("test",t)}catch{e=!1}return be=e,be}function Oe(e){return e.type==="touchstart"}const is={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:W("columnVisibility",e)}),createColumn:(e,s)=>{e.toggleVisibility=t=>{e.getCanHide()&&s.setColumnVisibility(n=>({...n,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,n;const r=e.columns;return(t=r.length?r.some(o=>o.getIsVisible()):(n=s.getState().columnVisibility)==null?void 0:n[e.id])!=null?t:!0},e.getCanHide=()=>{var t,n;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((n=s.options.enableHiding)!=null?n:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,s)=>{e._getAllVisibleCells=N(()=>[e.getAllCells(),s.getState().columnVisibility],t=>t.filter(n=>n.column.getIsVisible()),R(s.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=N(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,n,r)=>[...t,...n,...r],R(s.options,"debugRows","getVisibleCells"))},createTable:e=>{const s=(t,n)=>N(()=>[n(),n().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),R(e.options,"debugColumns",t));e.getVisibleFlatColumns=s("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=s("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=s("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=s("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=s("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:(n=e.initialState.columnVisibility)!=null?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=(n=t)!=null?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,o)=>({...r,[o.id]:t||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible((n=t.target)==null?void 0:n.checked)}}};function Ce(e,s){return s?s==="center"?e.getCenterVisibleLeafColumns():s==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const as={createTable:e=>{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():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},us={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:W("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:s=>{var t;const n=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[s.id])==null?void 0:t.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(e,s)=>{e.getCanGlobalFilter=()=>{var t,n,r,o;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((n=s.options.enableGlobalFilter)!=null?n:!0)&&((r=s.options.enableFilters)!=null?r:!0)&&((o=s.options.getColumnCanGlobalFilter==null?void 0:s.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Z.includesString,e.getGlobalFilterFn=()=>{var s,t;const{globalFilterFn:n}=e.options;return Me(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(s=(t=e.options.filterFns)==null?void 0:t[n])!=null?s:Z[n]},e.setGlobalFilter=s=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(s)},e.resetGlobalFilter=s=>{e.setGlobalFilter(s?void 0:e.initialState.globalFilter)}}},cs={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:W("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let s=!1,t=!1;e._autoResetExpanded=()=>{var n,r;if(!s){e._queue(()=>{s=!0});return}if((n=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?n:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=n=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(n),e.toggleAllRowsExpanded=n=>{n??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=n=>{var r,o;e.setExpanded(n?{}:(r=(o=e.initialState)==null?void 0:o.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(n=>n.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>n=>{n.persist==null||n.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const n=e.getState().expanded;return n===!0||Object.values(n).some(Boolean)},e.getIsAllRowsExpanded=()=>{const n=e.getState().expanded;return typeof n=="boolean"?n===!0:!(!Object.keys(n).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let n=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const i=o.split(".");n=Math.max(n,i.length)}),n},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())},createRow:(e,s)=>{e.toggleExpanded=t=>{s.setExpanded(n=>{var r;const o=n===!0?!0:!!(n!=null&&n[e.id]);let i={};if(n===!0?Object.keys(s.getRowModel().rowsById).forEach(a=>{i[a]=!0}):i=n,t=(r=t)!=null?r:!o,!o&&t)return{...i,[e.id]:!0};if(o&&!t){const{[e.id]:a,...d}=i;return d}return n})},e.getIsExpanded=()=>{var t;const n=s.getState().expanded;return!!((t=s.options.getIsRowExpanded==null?void 0:s.options.getIsRowExpanded(e))!=null?t:n===!0||n!=null&&n[e.id])},e.getCanExpand=()=>{var t,n,r;return(t=s.options.getRowCanExpand==null?void 0:s.options.getRowCanExpand(e))!=null?t:((n=s.options.enableExpanding)!=null?n:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let t=!0,n=e;for(;t&&n.parentId;)n=s.getRow(n.parentId,!0),t=n.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},He=0,qe=10,ze=()=>({pageIndex:He,pageSize:qe}),ds={getInitialState:e=>({...e,pagination:{...ze(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:W("pagination",e)}),createTable:e=>{let s=!1,t=!1;e._autoResetPageIndex=()=>{var n,r;if(!s){e._queue(()=>{s=!0});return}if((n=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?n:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=n=>{const r=o=>re(n,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=n=>{var r;e.setPagination(n?ze():(r=e.initialState.pagination)!=null?r:ze())},e.setPageIndex=n=>{e.setPagination(r=>{let o=re(n,r.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,i)),{...r,pageIndex:o}})},e.resetPageIndex=n=>{var r,o;e.setPageIndex(n?He:(r=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?r:He)},e.resetPageSize=n=>{var r,o;e.setPageSize(n?qe:(r=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?r:qe)},e.setPageSize=n=>{e.setPagination(r=>{const o=Math.max(1,re(n,r.pageSize)),i=r.pageSize*r.pageIndex,a=Math.floor(i/o);return{...r,pageIndex:a,pageSize:o}})},e.setPageCount=n=>e.setPagination(r=>{var o;let i=re(n,(o=e.options.pageCount)!=null?o:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...r,pageCount:i}}),e.getPageOptions=N(()=>[e.getPageCount()],n=>{let r=[];return n&&n>0&&(r=[...new Array(n)].fill(null).map((o,i)=>i)),r},R(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:n}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:n<r-1},e.previousPage=()=>e.setPageIndex(n=>n-1),e.nextPage=()=>e.setPageIndex(n=>n+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=()=>{var n;return(n=e.options.pageCount)!=null?n:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var n;return(n=e.options.rowCount)!=null?n:e.getPrePaginationRowModel().rows.length}}},Ae=()=>({top:[],bottom:[]}),gs={getInitialState:e=>({rowPinning:Ae(),...e}),getDefaultOptions:e=>({onRowPinningChange:W("rowPinning",e)}),createRow:(e,s)=>{e.pin=(t,n,r)=>{const o=n?e.getLeafRows().map(d=>{let{id:u}=d;return u}):[],i=r?e.getParentRows().map(d=>{let{id:u}=d;return u}):[],a=new Set([...i,e.id,...o]);s.setRowPinning(d=>{var u,h;if(t==="bottom"){var f,g;return{top:((f=d==null?void 0:d.top)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((g=d==null?void 0:d.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(t==="top"){var c,m;return{top:[...((c=d==null?void 0:d.top)!=null?c:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((m=d==null?void 0:d.bottom)!=null?m:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((u=d==null?void 0:d.top)!=null?u:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((h=d==null?void 0:d.bottom)!=null?h:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:n,enablePinning:r}=s.options;return typeof n=="function"?n(e):(t=n??r)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:n,bottom:r}=s.getState().rowPinning,o=t.some(a=>n==null?void 0:n.includes(a)),i=t.some(a=>r==null?void 0:r.includes(a));return o?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var t,n;const r=e.getIsPinned();if(!r)return-1;const o=(t=r==="top"?s.getTopRows():s.getBottomRows())==null?void 0:t.map(i=>{let{id:a}=i;return a});return(n=o==null?void 0:o.indexOf(e.id))!=null?n:-1}},createTable:e=>{e.setRowPinning=s=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(s),e.resetRowPinning=s=>{var t,n;return e.setRowPinning(s?Ae():(t=(n=e.initialState)==null?void 0:n.rowPinning)!=null?t:Ae())},e.getIsSomeRowsPinned=s=>{var t;const n=e.getState().rowPinning;if(!s){var r,o;return!!((r=n.top)!=null&&r.length||(o=n.bottom)!=null&&o.length)}return!!((t=n[s])!=null&&t.length)},e._getPinnedRows=(s,t,n)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(t??[]).map(i=>{const a=e.getRow(i,!0);return a.getIsAllParentsExpanded()?a:null}):(t??[]).map(i=>s.find(a=>a.id===i))).filter(Boolean).map(i=>({...i,position:n}))},e.getTopRows=N(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(s,t)=>e._getPinnedRows(s,t,"top"),R(e.options,"debugRows","getTopRows")),e.getBottomRows=N(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(s,t)=>e._getPinnedRows(s,t,"bottom"),R(e.options,"debugRows","getBottomRows")),e.getCenterRows=N(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(s,t,n)=>{const r=new Set([...t??[],...n??[]]);return s.filter(o=>!r.has(o.id))},R(e.options,"debugRows","getCenterRows"))}},ms={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:W("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=s=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(s),e.resetRowSelection=s=>{var t;return e.setRowSelection(s?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=s=>{e.setRowSelection(t=>{s=typeof s<"u"?s:!e.getIsAllRowsSelected();const n={...t},r=e.getPreGroupedRowModel().flatRows;return s?r.forEach(o=>{o.getCanSelect()&&(n[o.id]=!0)}):r.forEach(o=>{delete n[o.id]}),n})},e.toggleAllPageRowsSelected=s=>e.setRowSelection(t=>{const n=typeof s<"u"?s:!e.getIsAllPageRowsSelected(),r={...t};return e.getRowModel().rows.forEach(o=>{Ke(r,o.id,n,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=N(()=>[e.getState().rowSelection,e.getCoreRowModel()],(s,t)=>Object.keys(s).length?Te(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=N(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(s,t)=>Object.keys(s).length?Te(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=N(()=>[e.getState().rowSelection,e.getSortedRowModel()],(s,t)=>Object.keys(s).length?Te(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const s=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let n=!!(s.length&&Object.keys(t).length);return n&&s.some(r=>r.getCanSelect()&&!t[r.id])&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const s=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:t}=e.getState();let n=!!s.length;return n&&s.some(r=>!t[r.id])&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var s;const t=Object.keys((s=e.getState().rowSelection)!=null?s:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const s=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:s.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>s=>{e.toggleAllRowsSelected(s.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>s=>{e.toggleAllPageRowsSelected(s.target.checked)}},createRow:(e,s)=>{e.toggleSelected=(t,n)=>{const r=e.getIsSelected();s.setRowSelection(o=>{var i;if(t=typeof t<"u"?t:!r,e.getCanSelect()&&r===t)return o;const a={...o};return Ke(a,e.id,t,(i=n==null?void 0:n.selectChildren)!=null?i:!0,s),a})},e.getIsSelected=()=>{const{rowSelection:t}=s.getState();return Qe(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=s.getState();return Ue(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=s.getState();return Ue(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof s.options.enableRowSelection=="function"?s.options.enableRowSelection(e):(t=s.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof s.options.enableSubRowSelection=="function"?s.options.enableSubRowSelection(e):(t=s.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof s.options.enableMultiRowSelection=="function"?s.options.enableMultiRowSelection(e):(t=s.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var r;t&&e.toggleSelected((r=n.target)==null?void 0:r.checked)}}}},Ke=(e,s,t,n,r)=>{var o;const i=r.getRow(s,!0);t?(i.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),i.getCanSelect()&&(e[s]=!0)):delete e[s],n&&(o=i.subRows)!=null&&o.length&&i.getCanSelectSubRows()&&i.subRows.forEach(a=>Ke(e,a.id,t,n,r))};function Te(e,s){const t=e.getState().rowSelection,n=[],r={},o=function(i,a){return i.map(d=>{var u;const h=Qe(d,t);if(h&&(n.push(d),r[d.id]=d),(u=d.subRows)!=null&&u.length&&(d={...d,subRows:o(d.subRows)}),h)return d}).filter(Boolean)};return{rows:o(s.rows),flatRows:n,rowsById:r}}function Qe(e,s){var t;return(t=s[e.id])!=null?t:!1}function Ue(e,s,t){var n;if(!((n=e.subRows)!=null&&n.length))return!1;let r=!0,o=!1;return e.subRows.forEach(i=>{if(!(o&&!r)&&(i.getCanSelect()&&(Qe(i,s)?o=!0:r=!1),i.subRows&&i.subRows.length)){const a=Ue(i,s);a==="all"?o=!0:(a==="some"&&(o=!0),r=!1)}}),r?"all":o?"some":!1}const We=/([0-9]+)/gm,hs=(e,s,t)=>It(oe(e.getValue(t)).toLowerCase(),oe(s.getValue(t)).toLowerCase()),fs=(e,s,t)=>It(oe(e.getValue(t)),oe(s.getValue(t))),ps=(e,s,t)=>Ze(oe(e.getValue(t)).toLowerCase(),oe(s.getValue(t)).toLowerCase()),xs=(e,s,t)=>Ze(oe(e.getValue(t)),oe(s.getValue(t))),vs=(e,s,t)=>{const n=e.getValue(t),r=s.getValue(t);return n>r?1:n<r?-1:0},ws=(e,s,t)=>Ze(e.getValue(t),s.getValue(t));function Ze(e,s){return e===s?0:e>s?1:-1}function oe(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function It(e,s){const t=e.split(We).filter(Boolean),n=s.split(We).filter(Boolean);for(;t.length&&n.length;){const r=t.shift(),o=n.shift(),i=parseInt(r,10),a=parseInt(o,10),d=[i,a].sort();if(isNaN(d[0])){if(r>o)return 1;if(o>r)return-1;continue}if(isNaN(d[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return t.length-n.length}const xe={alphanumeric:hs,alphanumericCaseSensitive:fs,text:ps,textCaseSensitive:xs,datetime:vs,basic:ws},Cs={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:W("sorting",e),isMultiSortEvent:s=>s.shiftKey}),createColumn:(e,s)=>{e.getAutoSortingFn=()=>{const t=s.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const r of t){const o=r==null?void 0:r.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return xe.datetime;if(typeof o=="string"&&(n=!0,o.split(We).length>1))return xe.alphanumeric}return n?xe.text:xe.basic},e.getAutoSortDir=()=>{const t=s.getFilteredRowModel().flatRows[0];return typeof(t==null?void 0:t.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,n;if(!e)throw new Error;return Me(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(n=s.options.sortingFns)==null?void 0:n[e.columnDef.sortingFn])!=null?t:xe[e.columnDef.sortingFn]},e.toggleSorting=(t,n)=>{const r=e.getNextSortingOrder(),o=typeof t<"u"&&t!==null;s.setSorting(i=>{const a=i==null?void 0:i.find(c=>c.id===e.id),d=i==null?void 0:i.findIndex(c=>c.id===e.id);let u=[],h,f=o?t:r==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&n?a?h="toggle":h="add":i!=null&&i.length&&d!==i.length-1?h="replace":a?h="toggle":h="replace",h==="toggle"&&(o||r||(h="remove")),h==="add"){var g;u=[...i,{id:e.id,desc:f}],u.splice(0,u.length-((g=s.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else h==="toggle"?u=i.map(c=>c.id===e.id?{...c,desc:f}:c):h==="remove"?u=i.filter(c=>c.id!==e.id):u=[{id:e.id,desc:f}];return u})},e.getFirstSortDir=()=>{var t,n;return((t=(n=e.columnDef.sortDescFirst)!=null?n:s.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var n,r;const o=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==o&&((n=s.options.enableSortingRemoval)==null||n)&&(!(t&&(r=s.options.enableMultiRemove)!=null)||r)?!1:i==="desc"?"asc":"desc":o},e.getCanSort=()=>{var t,n;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((n=s.options.enableSorting)!=null?n:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,n;return(t=(n=e.columnDef.enableMultiSort)!=null?n:s.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const n=(t=s.getState().sorting)==null?void 0:t.find(r=>r.id===e.id);return n?n.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,n;return(t=(n=s.getState().sorting)==null?void 0:n.findIndex(r=>r.id===e.id))!=null?t:-1},e.clearSorting=()=>{s.setSorting(t=>t!=null&&t.length?t.filter(n=>n.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return n=>{t&&(n.persist==null||n.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?s.options.isMultiSortEvent==null?void 0:s.options.isMultiSortEvent(n):!1))}}},createTable:e=>{e.setSorting=s=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(s),e.resetSorting=s=>{var t,n;e.setSorting(s?[]:(t=(n=e.initialState)==null?void 0:n.sorting)!=null?t:[])},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())}},Ss=[Gn,is,ns,ss,Bn,Hn,as,us,Cs,es,cs,ds,gs,ms,ls];function js(e){var s,t;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const n=[...Ss,...(s=e._features)!=null?s:[]];let r={_features:n};const o=r._features.reduce((g,c)=>Object.assign(g,c.getDefaultOptions==null?void 0:c.getDefaultOptions(r)),{}),i=g=>r.options.mergeOptions?r.options.mergeOptions(o,g):{...o,...g};let d={...{},...(t=e.initialState)!=null?t:{}};r._features.forEach(g=>{var c;d=(c=g.getInitialState==null?void 0:g.getInitialState(d))!=null?c:d});const u=[];let h=!1;const f={_features:n,options:{...o,...e},initialState:d,_queue:g=>{u.push(g),h||(h=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();h=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{r.setState(r.initialState)},setOptions:g=>{const c=re(g,r.options);r.options=i(c)},getState:()=>r.options.state,setState:g=>{r.options.onStateChange==null||r.options.onStateChange(g)},_getRowId:(g,c,m)=>{var p;return(p=r.options.getRowId==null?void 0:r.options.getRowId(g,c,m))!=null?p:`${m?[m.id,c].join("."):c}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(g,c)=>{let m=(c?r.getPrePaginationRowModel():r.getRowModel()).rowsById[g];if(!m&&(m=r.getCoreRowModel().rowsById[g],!m))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${g}`):new Error;return m},_getDefaultColumnDef:N(()=>[r.options.defaultColumn],g=>{var c;return g=(c=g)!=null?c:{},{header:m=>{const p=m.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:m=>{var p,x;return(p=(x=m.renderValue())==null||x.toString==null?void 0:x.toString())!=null?p:null},...r._features.reduce((m,p)=>Object.assign(m,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...g}},R(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:N(()=>[r._getColumnDefs()],g=>{const c=function(m,p,x){return x===void 0&&(x=0),m.map(v=>{const w=Ln(r,v,x,p),M=v;return w.columns=M.columns?c(M.columns,w,x+1):[],w})};return c(g)},R(e,"debugColumns","getAllColumns")),getAllFlatColumns:N(()=>[r.getAllColumns()],g=>g.flatMap(c=>c.getFlatColumns()),R(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:N(()=>[r.getAllFlatColumns()],g=>g.reduce((c,m)=>(c[m.id]=m,c),{}),R(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:N(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(g,c)=>{let m=g.flatMap(p=>p.getLeafColumns());return c(m)},R(e,"debugColumns","getAllLeafColumns")),getColumn:g=>{const c=r._getAllFlatColumnsById()[g];return process.env.NODE_ENV!=="production"&&!c&&console.error(`[Table] Column with id '${g}' does not exist.`),c}};Object.assign(r,f);for(let g=0;g<r._features.length;g++){const c=r._features[g];c==null||c.createTable==null||c.createTable(r)}return r}function kt(){return e=>N(()=>[e.options.data],s=>{const t={rows:[],flatRows:[],rowsById:{}},n=function(r,o,i){o===void 0&&(o=0);const a=[];for(let u=0;u<r.length;u++){const h=Ye(e,e._getRowId(r[u],u,i),r[u],u,o,void 0,i==null?void 0:i.id);if(t.flatRows.push(h),t.rowsById[h.id]=h,a.push(h),e.options.getSubRows){var d;h.originalSubRows=e.options.getSubRows(r[u],u),(d=h.originalSubRows)!=null&&d.length&&(h.subRows=n(h.originalSubRows,o+1,h))}}return a};return t.rows=n(s),t},R(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function ys(e){const s=[],t=n=>{var r;s.push(n),(r=n.subRows)!=null&&r.length&&n.getIsExpanded()&&n.subRows.forEach(t)};return e.rows.forEach(t),{rows:s,flatRows:e.flatRows,rowsById:e.rowsById}}function bs(e,s,t){return t.options.filterFromLeafRows?Ns(e,s,t):Rs(e,s,t)}function Ns(e,s,t){var n;const r=[],o={},i=(n=t.options.maxLeafRowFilterDepth)!=null?n:100,a=function(d,u){u===void 0&&(u=0);const h=[];for(let g=0;g<d.length;g++){var f;let c=d[g];const m=Ye(t,c.id,c.original,c.index,c.depth,void 0,c.parentId);if(m.columnFilters=c.columnFilters,(f=c.subRows)!=null&&f.length&&u<i){if(m.subRows=a(c.subRows,u+1),c=m,s(c)&&!m.subRows.length){h.push(c),o[c.id]=c,r.push(c);continue}if(s(c)||m.subRows.length){h.push(c),o[c.id]=c,r.push(c);continue}}else c=m,s(c)&&(h.push(c),o[c.id]=c,r.push(c))}return h};return{rows:a(e),flatRows:r,rowsById:o}}function Rs(e,s,t){var n;const r=[],o={},i=(n=t.options.maxLeafRowFilterDepth)!=null?n:100,a=function(d,u){u===void 0&&(u=0);const h=[];for(let g=0;g<d.length;g++){let c=d[g];if(s(c)){var f;if((f=c.subRows)!=null&&f.length&&u<i){const p=Ye(t,c.id,c.original,c.index,c.depth,void 0,c.parentId);p.subRows=a(c.subRows,u+1),c=p}h.push(c),r.push(c),o[c.id]=c}}return h};return{rows:a(e),flatRows:r,rowsById:o}}function Et(){return e=>N(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(s,t,n)=>{if(!s.rows.length||!(t!=null&&t.length)&&!n){for(let g=0;g<s.flatRows.length;g++)s.flatRows[g].columnFilters={},s.flatRows[g].columnFiltersMeta={};return s}const r=[],o=[];(t??[]).forEach(g=>{var c;const m=e.getColumn(g.id);if(!m)return;const p=m.getFilterFn();if(!p){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${m.id}.`);return}r.push({id:g.id,filterFn:p,resolvedValue:(c=p.resolveFilterValue==null?void 0:p.resolveFilterValue(g.value))!=null?c:g.value})});const i=(t??[]).map(g=>g.id),a=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(g=>g.getCanGlobalFilter());n&&a&&d.length&&(i.push("__global__"),d.forEach(g=>{var c;o.push({id:g.id,filterFn:a,resolvedValue:(c=a.resolveFilterValue==null?void 0:a.resolveFilterValue(n))!=null?c:n})}));let u,h;for(let g=0;g<s.flatRows.length;g++){const c=s.flatRows[g];if(c.columnFilters={},r.length)for(let m=0;m<r.length;m++){u=r[m];const p=u.id;c.columnFilters[p]=u.filterFn(c,p,u.resolvedValue,x=>{c.columnFiltersMeta[p]=x})}if(o.length){for(let m=0;m<o.length;m++){h=o[m];const p=h.id;if(h.filterFn(c,p,h.resolvedValue,x=>{c.columnFiltersMeta[p]=x})){c.columnFilters.__global__=!0;break}}c.columnFilters.__global__!==!0&&(c.columnFilters.__global__=!1)}}const f=g=>{for(let c=0;c<i.length;c++)if(g.columnFilters[i[c]]===!1)return!1;return!0};return bs(s.rows,f,e)},R(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Fs(e){return s=>N(()=>[s.getState().pagination,s.getPrePaginationRowModel(),s.options.paginateExpandedRows?void 0:s.getState().expanded],(t,n)=>{if(!n.rows.length)return n;const{pageSize:r,pageIndex:o}=t;let{rows:i,flatRows:a,rowsById:d}=n;const u=r*o,h=u+r;i=i.slice(u,h);let f;s.options.paginateExpandedRows?f={rows:i,flatRows:a,rowsById:d}:f=ys({rows:i,flatRows:a,rowsById:d}),f.flatRows=[];const g=c=>{f.flatRows.push(c),c.subRows.length&&c.subRows.forEach(g)};return f.rows.forEach(g),f},R(s.options,"debugTable","getPaginationRowModel"))}function Dt(){return e=>N(()=>[e.getState().sorting,e.getPreSortedRowModel()],(s,t)=>{if(!t.rows.length||!(s!=null&&s.length))return t;const n=e.getState().sorting,r=[],o=n.filter(d=>{var u;return(u=e.getColumn(d.id))==null?void 0:u.getCanSort()}),i={};o.forEach(d=>{const u=e.getColumn(d.id);u&&(i[d.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=d=>{const u=d.map(h=>({...h}));return u.sort((h,f)=>{for(let c=0;c<o.length;c+=1){var g;const m=o[c],p=i[m.id],x=p.sortUndefined,v=(g=m==null?void 0:m.desc)!=null?g:!1;let w=0;if(x){const M=h.getValue(m.id),$=f.getValue(m.id),O=M===void 0,F=$===void 0;if(O||F){if(x==="first")return O?-1:1;if(x==="last")return O?1:-1;w=O&&F?0:O?x:-x}}if(w===0&&(w=p.sortingFn(h,f,m.id)),w!==0)return v&&(w*=-1),p.invertSorting&&(w*=-1),w}return h.index-f.index}),u.forEach(h=>{var f;r.push(h),(f=h.subRows)!=null&&f.length&&(h.subRows=a(h.subRows))}),u};return{rows:a(t.rows),flatRows:r,rowsById:t.rowsById}},R(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
79
|
+
* react-table
|
|
80
|
+
*
|
|
81
|
+
* Copyright (c) TanStack
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the MIT license found in the
|
|
84
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
85
|
+
*
|
|
86
|
+
* @license MIT
|
|
87
|
+
*/function _e(e,s){return e?_s(e)?C.createElement(e,s):e:null}function _s(e){return Ms(e)||typeof e=="function"||Is(e)}function Ms(e){return typeof e=="function"&&(()=>{const s=Object.getPrototypeOf(e);return s.prototype&&s.prototype.isReactComponent})()}function Is(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Vt(e){const s={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=C.useState(()=>({current:js(s)})),[n,r]=C.useState(()=>t.current.initialState);return t.current.setOptions(o=>({...o,...e,state:{...n,...e.state},onStateChange:i=>{r(i),e.onStateChange==null||e.onStateChange(i)}})),t.current}const Ie=C.forwardRef(({className:e,...s},t)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:t,className:j.cn("w-full caption-bottom text-sm",e),...s})}));Ie.displayName="Table";const ke=C.forwardRef(({className:e,...s},t)=>l.jsx("thead",{ref:t,className:j.cn("[&_tr]:border-b",e),...s}));ke.displayName="TableHeader";const Ee=C.forwardRef(({className:e,...s},t)=>l.jsx("tbody",{ref:t,className:j.cn("[&_tr:last-child]:border-0",e),...s}));Ee.displayName="TableBody";const Pt=C.forwardRef(({className:e,...s},t)=>l.jsx("tfoot",{ref:t,className:j.cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...s}));Pt.displayName="TableFooter";const le=C.forwardRef(({className:e,...s},t)=>l.jsx("tr",{ref:t,className:j.cn("border-b border-l-2 border-l-transparent transition-all duration-150 hover:bg-muted/60 hover:border-l-primary/40 data-[state=selected]:bg-muted",e),...s}));le.displayName="TableRow";const De=C.forwardRef(({className:e,...s},t)=>l.jsx("th",{ref:t,className:j.cn("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...s}));De.displayName="TableHead";const fe=C.forwardRef(({className:e,...s},t)=>l.jsx("td",{ref:t,className:j.cn("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...s}));fe.displayName="TableCell";const $t=C.forwardRef(({className:e,...s},t)=>l.jsx("caption",{ref:t,className:j.cn("mt-4 text-sm text-muted-foreground",e),...s}));$t.displayName="TableCaption";const ks=[10,20,30,40,50];function Es({columns:e,data:s,searchKey:t,searchPlaceholder:n,showColumnToggle:r=!0,showPagination:o=!0,showRowSelection:i=!1,pageSize:a=10,pageSizeOptions:d=ks,onRowClick:u,className:h,editable:f=!1,onCellEdit:g,onCellValidate:c,enableColumnResizing:m=!1,columnResizeMode:p="onChange",stickyHeader:x=!1,emptyState:v}){var q,Q;const{t:w}=A.useLocale(),[M,$]=C.useState([]),[O,F]=C.useState([]),[E,G]=C.useState({}),[y,I]=C.useState({}),k=C.useMemo(()=>i?[{id:"select",header:({table:S})=>l.jsx(J.Checkbox,{checked:S.getIsAllPageRowsSelected()||S.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:_=>S.toggleAllPageRowsSelected(!!_),"aria-label":w("table.selectAllRows")}),cell:({row:S})=>l.jsx(J.Checkbox,{checked:S.getIsSelected(),onCheckedChange:_=>S.toggleSelected(!!_),"aria-label":w("table.selectRow")}),enableSorting:!1,enableHiding:!1,enableResizing:!1},...e]:e,[e,i,w]),b=Vt({data:s,columns:k,onSortingChange:$,onColumnFiltersChange:F,getCoreRowModel:kt(),getPaginationRowModel:Fs(),getSortedRowModel:Dt(),getFilteredRowModel:Et(),onColumnVisibilityChange:G,onRowSelectionChange:I,enableColumnResizing:m,columnResizeMode:p,initialState:{pagination:{pageSize:a}},state:{sorting:M,columnFilters:O,columnVisibility:E,rowSelection:y},meta:f?{onCellEdit:g,onCellValidate:c}:void 0});return l.jsxs("div",{className:j.cn("w-full",h),children:[l.jsxs("div",{className:"flex items-center gap-4 py-4",children:[t&&l.jsx(U.Input,{placeholder:n??w("table.searchPlaceholder"),value:((q=b.getColumn(t))==null?void 0:q.getFilterValue())??"",onChange:S=>{var _;return(_=b.getColumn(t))==null?void 0:_.setFilterValue(S.target.value)},className:"max-w-sm"}),r&&l.jsxs(D.DropdownMenu,{children:[l.jsx(D.DropdownMenuTrigger,{asChild:!0,children:l.jsxs(P.Button,{variant:"outline",className:"ml-auto",children:[w("table.columns")," ",l.jsx(U.ChevronDown,{className:"ml-2 h-4 w-4"})]})}),l.jsx(D.DropdownMenuContent,{align:"end",children:b.getAllColumns().filter(S=>S.getCanHide()).map(S=>l.jsx(D.DropdownMenuCheckboxItem,{className:"capitalize",checked:S.getIsVisible(),onCheckedChange:_=>S.toggleVisibility(!!_),children:S.id},S.id))})]})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(Ie,{style:m?{width:b.getCenterTotalSize()}:void 0,children:[l.jsx(ke,{className:x?"sticky top-0 z-20 bg-background":void 0,children:b.getHeaderGroups().map(S=>l.jsx(le,{children:S.headers.map(_=>l.jsxs(De,{style:m?{width:_.getSize()}:void 0,className:m?"relative":void 0,children:[_.isPlaceholder?null:_e(_.column.columnDef.header,_.getContext()),m&&_.column.getCanResize()&&l.jsx("div",{onMouseDown:_.getResizeHandler(),onTouchStart:_.getResizeHandler(),className:j.cn("absolute right-0 top-0 h-full w-1 cursor-col-resize select-none touch-none bg-transparent hover:bg-primary/50 transition-colors",_.column.getIsResizing()&&"bg-primary")})]},_.id))},S.id))}),l.jsx(Ee,{children:(Q=b.getRowModel().rows)!=null&&Q.length?b.getRowModel().rows.map(S=>l.jsx(le,{"data-state":S.getIsSelected()&&"selected",onClick:()=>u==null?void 0:u(S.original),className:u?"cursor-pointer":"",children:S.getVisibleCells().map(_=>l.jsx(fe,{style:m?{width:_.column.getSize()}:void 0,children:_e(_.column.columnDef.cell,_.getContext())},_.id))},S.id)):l.jsx(le,{children:l.jsx(fe,{colSpan:k.length,className:"h-24 text-center",children:v??l.jsxs("div",{className:"flex flex-col items-center justify-center py-4 text-muted-foreground",children:[l.jsx(D.Search,{className:"mb-2 h-8 w-8 opacity-40"}),l.jsx("p",{className:"text-sm font-medium",children:w("table.noResults")}),l.jsx("p",{className:"text-xs",children:w("table.adjustSearchOrFilter")})]})})})})]})}),o&&l.jsxs("div",{className:"flex items-center justify-between space-x-2 py-4",children:[l.jsx("div",{className:"flex-1 text-sm text-muted-foreground",children:i&&l.jsx(l.Fragment,{children:w("table.rowsSelected",{selected:b.getFilteredSelectedRowModel().rows.length,total:b.getFilteredRowModel().rows.length})})}),l.jsxs("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("p",{className:"text-sm font-medium",children:w("table.rowsPerPage")}),l.jsxs(V.Select,{value:`${b.getState().pagination.pageSize}`,onValueChange:S=>{b.setPageSize(Number(S))},children:[l.jsx(V.SelectTrigger,{size:"sm",width:"sm",children:l.jsx(V.SelectValue,{placeholder:b.getState().pagination.pageSize})}),l.jsx(V.SelectContent,{side:"top",children:d.map(S=>l.jsx(V.SelectItem,{value:`${S}`,children:S},S))})]})]}),l.jsxs("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:[w("table.page")," ",b.getState().pagination.pageIndex+1," ",w("table.of")," ",b.getPageCount()]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(P.Button,{variant:"outline",size:"sm",onClick:()=>b.previousPage(),disabled:!b.getCanPreviousPage(),children:w("table.previous")}),l.jsx(P.Button,{variant:"outline",size:"sm",onClick:()=>b.nextPage(),disabled:!b.getCanNextPage(),children:w("table.next")})]})]})]})]})}function Ds(e){const s=({column:t})=>l.jsxs(P.Button,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:[e,l.jsx(Fn,{className:"ml-2 h-4 w-4"})]});return s.displayName=`SortableHeader(${e})`,s}function Vs(e){const s=({row:t})=>{const{t:n}=A.useLocale();return l.jsxs(D.DropdownMenu,{children:[l.jsx(D.DropdownMenuTrigger,{asChild:!0,children:l.jsxs(P.Button,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:n("table.openMenu")}),l.jsx(xt.Ellipsis,{className:"h-4 w-4"})]})}),l.jsxs(D.DropdownMenuContent,{align:"end",children:[l.jsx(D.DropdownMenuLabel,{children:n("table.actions")}),l.jsx(D.DropdownMenuSeparator,{}),e.map((r,o)=>l.jsxs(D.DropdownMenuItem,{onClick:()=>r.onClick(t.original),children:[r.icon&&l.jsx("span",{className:"mr-2",children:r.icon}),r.label]},o))]})]})};return s.displayName="ActionsCell",s}function Ps({value:e,onChange:s,onCommit:t,onCancel:n,placeholder:r,hasError:o}){const i=C.useRef(null);C.useEffect(()=>{var d,u;(d=i.current)==null||d.focus(),(u=i.current)==null||u.select()},[]);const a=d=>{d.key==="Enter"?(d.preventDefault(),t()):d.key==="Escape"&&(d.preventDefault(),n())};return l.jsx(U.Input,{ref:i,value:e,onChange:d=>s(d.target.value),onBlur:()=>requestAnimationFrame(()=>{document.activeElement!==i.current&&t()}),onKeyDown:a,placeholder:r,className:o?"h-8 ring-1 ring-destructive focus-visible:ring-destructive":"h-8"})}function $s({value:e,onChange:s,onCommit:t,onCancel:n,min:r,max:o,placeholder:i,hasError:a}){const d=C.useRef(null),[u,h]=C.useState((e==null?void 0:e.toString())??"");C.useEffect(()=>{var m,p;(m=d.current)==null||m.focus(),(p=d.current)==null||p.select()},[]);const f=m=>{const p=m.target.value;if(h(p),p===""||p==="-"){s(void 0);return}const x=parseFloat(p);isNaN(x)||s(x)},g=()=>{if(u!==""&&u!=="-"){const m=parseFloat(u);if(!isNaN(m)){let p=m;r!==void 0&&(p=Math.max(r,p)),o!==void 0&&(p=Math.min(o,p)),p!==m&&(s(p),h(p.toString()))}}t()},c=m=>{m.key==="Enter"?(m.preventDefault(),g()):m.key==="Escape"&&(m.preventDefault(),n())};return l.jsx(U.Input,{ref:d,type:"text",inputMode:"decimal",value:u,onChange:f,onBlur:()=>requestAnimationFrame(()=>{document.activeElement!==d.current&&g()}),onKeyDown:c,placeholder:i,className:a?"h-8 ring-1 ring-destructive focus-visible:ring-destructive":"h-8"})}function Os({value:e,onChange:s,onCommit:t,onCancel:n,options:r,placeholder:o}){const{t:i}=A.useLocale(),a=u=>{s(u),queueMicrotask(t)},d=u=>{u.key==="Escape"&&(u.preventDefault(),n())};return l.jsxs(V.Select,{value:e,onValueChange:a,children:[l.jsx(V.SelectTrigger,{className:"h-8",onKeyDown:d,autoFocus:!0,children:l.jsx(V.SelectValue,{placeholder:o??i("filter.select")})}),l.jsx(V.SelectContent,{children:r.map(u=>l.jsx(V.SelectItem,{value:u.value,children:u.label},u.value))})]})}function zs({value:e,onChange:s,onCommit:t,onCancel:n,dateFormat:r="PPP",placeholder:o}){const[i,a]=C.useState(!0),{t:d,formatDate:u}=fn.useFormatters(),h=o||d("date.selectDate"),f=m=>{s(m),a(!1),setTimeout(t,0)},g=m=>{a(m),m||t()},c=m=>{m.key==="Escape"&&(m.preventDefault(),n())};return l.jsxs(te.Popover,{open:i,onOpenChange:g,children:[l.jsx(te.PopoverTrigger,{asChild:!0,children:l.jsxs(P.Button,{variant:"outline",className:j.cn("h-8 w-full justify-start text-left font-normal",!e&&"text-muted-foreground"),onKeyDown:c,children:[l.jsx(pt.Calendar,{className:"mr-2 h-3 w-3"}),e?u(e,r):l.jsx("span",{children:h})]})}),l.jsx(te.PopoverContent,{className:"w-auto p-0",align:"start",children:l.jsx(hn.Calendar,{mode:"single",selected:e,onSelect:f,initialFocus:!0})})]})}function at({value:e,onChange:s,onCommit:t}){const n=r=>{s(r===!0),setTimeout(t,0)};return l.jsx(J.Checkbox,{checked:e,onCheckedChange:n,autoFocus:!0})}function As({value:e,onChange:s,onCommit:t,onCancel:n,options:r,placeholder:o}){const{t:i}=A.useLocale(),a=C.useRef(null),d=u=>{u.key==="Escape"&&(u.preventDefault(),n())};return l.jsx("div",{ref:a,onKeyDown:d,onBlur:()=>setTimeout(()=>{var u;(u=a.current)!=null&&u.contains(document.activeElement)||t()},150),children:l.jsx(ge.MultiSelect,{options:r.map(u=>({value:u.value,label:u.label})),value:e,onChange:s,placeholder:o??i("filter.select"),className:"h-8"})})}function et({value:e,row:s,rowIndex:t,columnId:n,config:r,onCellEdit:o,onCellValidate:i}){const{t:a}=A.useLocale(),[d,u]=C.useState(!1),[h,f]=C.useState(e),[g,c]=C.useState(null);C.useEffect(()=>{d||f(e)},[e,d]);const m=typeof r.editable=="function"?r.editable(s):r.editable!==!1,p=()=>{m&&(f(e),c(null),u(!0))},x=async()=>{if(d){if(i){const F=i(t,n,h,s);if(F){c(F);return}}c(null),u(!1),h!==e&&await(o==null?void 0:o(t,n,h,s))}},v=()=>{f(e),c(null),u(!1)},w=()=>{r.type!=="checkbox"&&p()},M=C.useMemo(()=>{if(r.format)return r.format(e,s);if(r.type==="checkbox")return null;if(r.type==="select"&&r.options){const F=r.options.find(E=>E.value===String(e));return(F==null?void 0:F.label)??String(e??"")}return r.type==="multi-select"&&r.options&&Array.isArray(e)?e.map(F=>{var E,G;return((G=(E=r.options)==null?void 0:E.find(y=>y.value===F))==null?void 0:G.label)??F}).join(", "):r.type==="date"&&e instanceof Date?e.toLocaleDateString():String(e??"")},[e,s,r]),$=F=>{if(F.key==="Tab"){F.preventDefault(),x();const E=F.shiftKey?"prev":"next";window.dispatchEvent(new CustomEvent("datatable-cell-navigate",{detail:{rowIndex:t,columnId:n,direction:E}}))}},O=F=>F.preventDefault();if(d){const F=l.jsxs("div",{className:"flex min-w-[120px] items-center gap-1",onClick:E=>E.stopPropagation(),onKeyDown:$,children:[l.jsxs("div",{className:"flex-1",children:[r.type==="text"&&l.jsx(Ps,{value:String(h??""),onChange:E=>f(E),onCommit:x,onCancel:v,placeholder:r.placeholder,hasError:!!g}),r.type==="number"&&l.jsx($s,{value:h,onChange:E=>f(E),onCommit:x,onCancel:v,min:r.min,max:r.max,step:r.step,precision:r.precision,prefix:r.prefix,suffix:r.suffix,placeholder:r.placeholder,hasError:!!g}),r.type==="select"&&r.options&&l.jsx(Os,{value:String(h??""),onChange:E=>f(E),onCommit:x,onCancel:v,options:r.options,placeholder:r.placeholder,hasError:!!g}),r.type==="date"&&l.jsx(zs,{value:h instanceof Date?h:h?new Date(h):void 0,onChange:E=>f(E),onCommit:x,onCancel:v,dateFormat:r.dateFormat,placeholder:r.placeholder,hasError:!!g}),r.type==="checkbox"&&l.jsx(at,{value:!!h,onChange:E=>f(E),onCommit:x}),r.type==="multi-select"&&r.options&&l.jsx(As,{value:h??[],onChange:E=>f(E),onCommit:x,onCancel:v,options:r.options,placeholder:r.placeholder,hasError:!!g})]}),l.jsx("button",{onMouseDown:O,onClick:x,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-primary hover:text-primary/80 hover:bg-muted transition-colors","aria-label":a("editable.save"),children:l.jsx(L.Check,{className:"h-3.5 w-3.5"})}),l.jsx("button",{onMouseDown:O,onClick:v,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":a("editable.cancel"),children:l.jsx(ue.X,{className:"h-3.5 w-3.5"})})]});return g?l.jsx(X.TooltipProvider,{children:l.jsxs(X.Tooltip,{open:!!g,children:[l.jsx(X.TooltipTrigger,{asChild:!0,children:F}),l.jsx(X.TooltipContent,{side:"bottom",className:"bg-destructive text-destructive-foreground",children:g})]})}):F}return r.type==="checkbox"?l.jsx(at,{value:!!e,onChange:F=>{if(m){if(i){const E=i(t,n,F,s);if(E){c(E);return}}c(null),f(F),o==null||o(t,n,F,s)}},onCommit:()=>{}}):l.jsxs("div",{className:j.cn("group/cell relative flex items-center gap-2 rounded px-1 py-0.5 -mx-1 min-h-[28px] transition-colors duration-150",m&&"cursor-pointer hover:bg-muted/30"),onDoubleClick:w,children:[l.jsx("span",{className:"flex-1 truncate",children:M}),m&&l.jsx("button",{onClick:F=>{F.stopPropagation(),p()},className:"flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-muted opacity-0 transition-opacity group-hover/cell:opacity-100","aria-label":a("editable.edit"),children:l.jsx(Be.Pencil,{className:"h-3 w-3"})})]})}et.displayName="EditableCell";function Ts(e){const s=({row:t,getValue:n,table:r})=>{const o=r.options.meta;return l.jsx(et,{value:n(),row:t.original,rowIndex:t.index,columnId:e.columnId,config:e,onCellEdit:o==null?void 0:o.onCellEdit,onCellValidate:o==null?void 0:o.onCellValidate})};return s.displayName=`EditableCell(${e.columnId})`,s}function Ls({data:e,columns:s,filename:t="export",delimiter:n=",",includeBOM:r=!0}){const o=c=>{const m=c==null?"":String(c);return m.includes(n)||m.includes('"')||m.includes(`
|
|
88
|
+
`)||m.includes("\r")?`"${m.replace(/"/g,'""')}"`:m},i=s.map(c=>o(c.header)).join(n),a=e.map(c=>s.map(m=>{const p=typeof m.accessor=="function"?m.accessor(c):c[m.accessor];return o(p)}).join(n)),d=[i,...a].join(`
|
|
89
|
+
`),u=r?"\uFEFF":"",h=new Blob([u+d],{type:"text/csv;charset=utf-8;"}),f=URL.createObjectURL(h),g=document.createElement("a");g.setAttribute("href",f),g.setAttribute("download",`${t}.csv`),g.style.visibility="hidden",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(f)}function de(e,s,t){let n=t.initialDeps??[],r,o=!0;function i(){var a,d,u;let h;t.key&&((a=t.debug)!=null&&a.call(t))&&(h=Date.now());const f=e();if(!(f.length!==n.length||f.some((m,p)=>n[p]!==m)))return r;n=f;let c;if(t.key&&((d=t.debug)!=null&&d.call(t))&&(c=Date.now()),r=s(...f),t.key&&((u=t.debug)!=null&&u.call(t))){const m=Math.round((Date.now()-h)*100)/100,p=Math.round((Date.now()-c)*100)/100,x=p/16,v=(w,M)=>{for(w=String(w);w.length<M;)w=" "+w;return w};console.info(`%c⏱ ${v(p,5)} /${v(m,5)} ms`,`
|
|
90
|
+
font-size: .6rem;
|
|
91
|
+
font-weight: bold;
|
|
92
|
+
color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,t==null?void 0:t.key)}return t!=null&&t.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(r),o=!1,r}return i.updateDeps=a=>{n=a},i}function ut(e,s){if(e===void 0)throw new Error("Unexpected undefined");return e}const Gs=(e,s)=>Math.abs(e-s)<1.01,Bs=(e,s,t)=>{let n;return function(...r){e.clearTimeout(n),n=e.setTimeout(()=>s.apply(this,r),t)}},ct=e=>{const{offsetWidth:s,offsetHeight:t}=e;return{width:s,height:t}},Hs=e=>e,qs=e=>{const s=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let r=s;r<=t;r++)n.push(r);return n},Ks=(e,s)=>{const t=e.scrollElement;if(!t)return;const n=e.targetWindow;if(!n)return;const r=i=>{const{width:a,height:d}=i;s({width:Math.round(a),height:Math.round(d)})};if(r(ct(t)),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(i=>{const a=()=>{const d=i[0];if(d!=null&&d.borderBoxSize){const u=d.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(ct(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},dt={passive:!0},gt=typeof window>"u"?!0:"onscrollend"in window,Us=(e,s)=>{const t=e.scrollElement;if(!t)return;const n=e.targetWindow;if(!n)return;let r=0;const o=e.options.useScrollendEvent&>?()=>{}:Bs(n,()=>{s(r,!1)},e.options.isScrollingResetDelay),i=h=>()=>{const{horizontal:f,isRtl:g}=e.options;r=f?t.scrollLeft*(g&&-1||1):t.scrollTop,o(),s(r,h)},a=i(!0),d=i(!1);t.addEventListener("scroll",a,dt);const u=e.options.useScrollendEvent&>return u&&t.addEventListener("scrollend",d,dt),()=>{t.removeEventListener("scroll",a),u&&t.removeEventListener("scrollend",d)}},Ws=(e,s,t)=>{if(s!=null&&s.borderBoxSize){const n=s.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},Xs=(e,{adjustments:s=0,behavior:t},n)=>{var r,o;const i=e+s;(o=(r=n.scrollElement)==null?void 0:r.scrollTo)==null||o.call(r,{[n.options.horizontal?"left":"top"]:i,behavior:t})};class Ys{constructor(s){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(r=>{r.forEach(o=>{const i=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var r;(r=n())==null||r.disconnect(),t=null},observe:r=>{var o;return(o=n())==null?void 0:o.observe(r,{box:"border-box"})},unobserve:r=>{var o;return(o=n())==null?void 0:o.unobserve(r)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([n,r])=>{typeof r>"u"&&delete t[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Hs,rangeExtractor:qs,onChange:()=>{},measureElement:Ws,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var n,r;(r=(n=this.options).onChange)==null||r.call(n,this,t)},this.maybeNotify=de(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=o,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,n)=>{const r=new Map,o=new Map;for(let i=n-1;i>=0;i--){const a=t[i];if(r.has(a.lane))continue;const d=o.get(a.lane);if(d==null||a.end>d.end?o.set(a.lane,a):a.end<d.end&&r.set(a.lane,!0),r.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,a)=>i.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=de(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(t,n,r,o,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:n,scrollMargin:r,getItemKey:o,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=de(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:n,scrollMargin:r,getItemKey:o,enabled:i,lanes:a},d)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const g of this.laneAssignments.keys())g>=t&&this.laneAssignments.delete(g);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(g=>{this.itemSizeCache.set(g.key,g.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const h=this.measurementsCache.slice(0,u),f=new Array(a).fill(void 0);for(let g=0;g<u;g++){const c=h[g];c&&(f[c.lane]=g)}for(let g=u;g<t;g++){const c=o(g),m=this.laneAssignments.get(g);let p,x;if(m!==void 0&&this.options.lanes>1){p=m;const $=f[p],O=$!==void 0?h[$]:void 0;x=O?O.end+this.options.gap:n+r}else{const $=this.options.lanes===1?h[g-1]:this.getFurthestMeasurement(h,g);x=$?$.end+this.options.gap:n+r,p=$?$.lane:g%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(g,p)}const v=d.get(c),w=typeof v=="number"?v:this.options.estimateSize(g),M=x+w;h[g]={index:g,start:x,size:w,end:M,key:c,lane:p},f[p]=g}return this.measurementsCache=h,h},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=de(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,r,o)=>this.range=t.length>0&&n>0?Js({measurements:t,outerSize:n,scrollOffset:r,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=de(()=>{let t=null,n=null;const r=this.calculateRange();return r&&(t=r.startIndex,n=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,r,o,i)=>o===null||i===null?[]:t({startIndex:o,endIndex:i,overscan:n,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,r=t.getAttribute(n);return r?parseInt(r,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(t,n)=>{const r=this.indexFromElement(t),o=this.measurementsCache[r];if(!o)return;const i=o.key,a=this.elementsCache.get(i);a!==t&&(a&&this.observer.unobserve(a),this.observer.observe(t),this.elementsCache.set(i,t)),t.isConnected&&this.resizeItem(r,this.options.measureElement(t,n,this))},this.resizeItem=(t,n)=>{const r=this.measurementsCache[t];if(!r)return;const o=this.itemSizeCache.get(r.key)??r.size,i=n-o;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,i,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,n)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((n,r)=>{n.isConnected||(this.observer.unobserve(n),this.elementsCache.delete(r))});return}this._measureElement(t,void 0)},this.getVirtualItems=de(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const r=[];for(let o=0,i=t.length;o<i;o++){const a=t[o],d=n[a];r.push(d)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length!==0)return ut(n[Ot(0,n.length-1,r=>ut(n[r]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,n,r=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();n==="auto"&&(n=t>=i+o?"end":"start"),n==="center"?t+=(r-o)/2:n==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.measurementsCache[t];if(!r)return;const o=this.getSize(),i=this.getScrollOffset();if(n==="auto")if(r.end>=i+o-this.options.scrollPaddingEnd)n="end";else if(r.start<=i+this.options.scrollPaddingStart)n="start";else return[i,n];if(n==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),n];const a=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,r.size),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:n="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,n),{adjustments:void 0,behavior:r})},this.scrollToIndex=(t,{align:n="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1)),this.currentScrollToIndex=t;let o=0;const i=10,a=u=>{if(!this.targetWindow)return;const h=this.getOffsetForIndex(t,u);if(!h){console.warn("Failed to get offset for index:",t);return}const[f,g]=h;this._scrollToOffset(f,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const c=()=>{if(this.currentScrollToIndex!==t)return;const m=this.getScrollOffset(),p=this.getOffsetForIndex(t,g);if(!p){console.warn("Failed to get offset for index:",t);return}Gs(p[0],m)||d(g)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(c):c()})},d=u=>{this.targetWindow&&this.currentScrollToIndex===t&&(o++,o<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",o,i),this.targetWindow.requestAnimationFrame(()=>a(u))):console.warn(`Failed to scroll to index ${t} after ${i} attempts.`))};a(n)},this.scrollBy=(t,{behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let r;if(n.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((t=n[n.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=n.length-1;for(;i>=0&&o.some(a=>a===null);){const a=n[i];o[a.lane]===null&&(o[a.lane]=a.end),i--}r=Math.max(...o.filter(a=>a!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:n,behavior:r})=>{this.options.scrollToFn(t,{behavior:r,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(s)}}const Ot=(e,s,t,n)=>{for(;e<=s;){const r=(e+s)/2|0,o=t(r);if(o<n)e=r+1;else if(o>n)s=r-1;else return r}return e>0?e-1:0};function Js({measurements:e,outerSize:s,scrollOffset:t,lanes:n}){const r=e.length-1,o=d=>e[d].start;if(e.length<=n)return{startIndex:0,endIndex:r};let i=Ot(0,r,o,t),a=i;if(n===1)for(;a<r&&e[a].end<t+s;)a++;else if(n>1){const d=Array(n).fill(0);for(;a<r&&d.some(h=>h<t+s);){const h=e[a];d[h.lane]=h.end,a++}const u=Array(n).fill(t+s);for(;i>=0&&u.some(h=>h>=t);){const h=e[i];u[h.lane]=h.start,i--}i=Math.max(0,i-i%n),a=Math.min(r,a+(n-1-a%n))}return{startIndex:i,endIndex:a}}const mt=typeof document<"u"?C.useLayoutEffect:C.useEffect;function Qs({useFlushSync:e=!0,...s}){const t=C.useReducer(()=>({}),{})[1],n={...s,onChange:(o,i)=>{var a;e&&i?pn.flushSync(t):t(),(a=s.onChange)==null||a.call(s,o,i)}},[r]=C.useState(()=>new Ys(n));return r.setOptions(n),mt(()=>r._didMount(),[]),mt(()=>r._willUpdate()),r}function Zs(e){return Qs({observeElementRect:Ks,observeElementOffset:Us,scrollToFn:Xs,...e})}function zt({columns:e,data:s,searchKey:t,searchPlaceholder:n,showColumnToggle:r=!0,showRowSelection:o=!1,onRowClick:i,className:a,editable:d=!1,onCellEdit:u,onCellValidate:h,enableColumnResizing:f=!1,columnResizeMode:g="onChange",stickyHeader:c=!0,emptyState:m,height:p=500,estimateRowHeight:x=48,overscan:v=10}){var _,se,pe;const{t:w}=A.useLocale(),[M,$]=C.useState([]),[O,F]=C.useState([]),[E,G]=C.useState({}),[y,I]=C.useState({}),k=C.useMemo(()=>o?[{id:"select",header:({table:T})=>l.jsx(J.Checkbox,{checked:T.getIsAllPageRowsSelected()||T.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:z=>T.toggleAllPageRowsSelected(!!z),"aria-label":w("table.selectAllRows")}),cell:({row:T})=>l.jsx(J.Checkbox,{checked:T.getIsSelected(),onCheckedChange:z=>T.toggleSelected(!!z),"aria-label":w("table.selectRow")}),enableSorting:!1,enableHiding:!1,enableResizing:!1},...e]:e,[e,o,w]),b=Vt({data:s,columns:k,onSortingChange:$,onColumnFiltersChange:F,getCoreRowModel:kt(),getSortedRowModel:Dt(),getFilteredRowModel:Et(),onColumnVisibilityChange:G,onRowSelectionChange:I,enableColumnResizing:f,columnResizeMode:g,state:{sorting:M,columnFilters:O,columnVisibility:E,rowSelection:y},meta:d?{onCellEdit:u,onCellValidate:h}:void 0}),{rows:q}=b.getRowModel(),Q=C.useRef(null),S=Zs({count:q.length,getScrollElement:()=>Q.current,estimateSize:()=>x,overscan:v});return l.jsxs("div",{className:j.cn("w-full",a),children:[l.jsxs("div",{className:"flex items-center gap-4 py-4",children:[t&&l.jsx(U.Input,{placeholder:n??w("table.searchPlaceholder"),value:((_=b.getColumn(t))==null?void 0:_.getFilterValue())??"",onChange:T=>{var z;return(z=b.getColumn(t))==null?void 0:z.setFilterValue(T.target.value)},className:"max-w-sm"}),r&&l.jsxs(D.DropdownMenu,{children:[l.jsx(D.DropdownMenuTrigger,{asChild:!0,children:l.jsxs(P.Button,{variant:"outline",className:"ml-auto",children:[w("table.columns")," ",l.jsx(U.ChevronDown,{className:"ml-2 h-4 w-4"})]})}),l.jsx(D.DropdownMenuContent,{align:"end",children:b.getAllColumns().filter(T=>T.getCanHide()).map(T=>l.jsx(D.DropdownMenuCheckboxItem,{className:"capitalize",checked:T.getIsVisible(),onCheckedChange:z=>T.toggleVisibility(!!z),children:T.id},T.id))})]})]}),l.jsx("div",{className:"rounded-md border",children:l.jsx("div",{ref:Q,className:"overflow-auto",style:{height:p},children:l.jsxs(Ie,{style:f?{width:b.getCenterTotalSize()}:void 0,children:[l.jsx(ke,{className:c?"sticky top-0 z-20 bg-background":void 0,children:b.getHeaderGroups().map(T=>l.jsx(le,{children:T.headers.map(z=>l.jsxs(De,{style:f?{width:z.getSize()}:void 0,className:f?"relative":void 0,children:[z.isPlaceholder?null:_e(z.column.columnDef.header,z.getContext()),f&&z.column.getCanResize()&&l.jsx("div",{onMouseDown:z.getResizeHandler(),onTouchStart:z.getResizeHandler(),className:j.cn("absolute right-0 top-0 h-full w-1 cursor-col-resize select-none touch-none bg-transparent hover:bg-primary/50 transition-colors",z.column.getIsResizing()&&"bg-primary")})]},z.id))},T.id))}),l.jsx(Ee,{children:q.length?l.jsxs(l.Fragment,{children:[S.getVirtualItems().length>0&&l.jsx("tr",{style:{height:((se=S.getVirtualItems()[0])==null?void 0:se.start)??0}}),S.getVirtualItems().map(T=>{const z=q[T.index];return l.jsx(le,{"data-index":T.index,ref:B=>S.measureElement(B),"data-state":z.getIsSelected()&&"selected",onClick:()=>i==null?void 0:i(z.original),className:i?"cursor-pointer":"",children:z.getVisibleCells().map(B=>l.jsx(fe,{style:f?{width:B.column.getSize()}:void 0,children:_e(B.column.columnDef.cell,B.getContext())},B.id))},z.id)}),S.getVirtualItems().length>0&&l.jsx("tr",{style:{height:S.getTotalSize()-(((pe=S.getVirtualItems().at(-1))==null?void 0:pe.end)??0)}})]}):l.jsx(le,{children:l.jsx(fe,{colSpan:k.length,className:"h-24 text-center",children:m??l.jsxs("div",{className:"flex flex-col items-center justify-center py-4 text-muted-foreground",children:[l.jsx(D.Search,{className:"mb-2 h-8 w-8 opacity-40"}),l.jsx("p",{className:"text-sm font-medium",children:w("table.noResults")}),l.jsx("p",{className:"text-xs",children:w("table.adjustSearchOrFilter")})]})})})})]})})}),l.jsxs("div",{className:"flex items-center justify-between py-2",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:w("table.rowsTotal",{count:q.length})}),o&&l.jsx("p",{className:"text-sm text-muted-foreground",children:w("table.rowsSelected",{selected:b.getFilteredSelectedRowModel().rows.length,total:q.length})})]})]})}zt.displayName="VirtualDataTable";const At=C.forwardRef(({className:e,title:s,value:t,description:n,trend:r,icon:o,loading:i=!1,...a},d)=>{const u=(r==null?void 0:r.direction)||(r!=null&&r.value&&r.value>0?"up":r!=null&&r.value&&r.value<0?"down":"neutral"),h=u==="up"?vt.TrendingUp:u==="down"?St:xn.Minus,f=u==="up"?"text-success":u==="down"?"text-destructive":"text-muted-foreground";return l.jsxs(me.Card,{ref:d,className:j.cn("",e),...a,children:[l.jsxs(me.CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(me.CardTitle,{className:"text-sm font-medium",children:s}),o&&l.jsx("div",{className:"text-muted-foreground",children:o})]}),l.jsx(me.CardContent,{children:i?l.jsxs("div",{className:"space-y-2",children:[l.jsx("div",{className:"h-8 w-24 animate-pulse rounded bg-muted"}),l.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted"})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-2xl font-bold",children:t}),(n||r)&&l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r&&l.jsxs("span",{className:j.cn("flex items-center gap-1",f),children:[l.jsx(h,{className:"h-3 w-3"}),Math.abs(r.value),"%",r.label&&l.jsx("span",{children:r.label})]}),n&&l.jsx("span",{children:n})]})]})})]})});At.displayName="KPICard";const Tt=C.forwardRef(({className:e,title:s,value:t,subtitle:n,icon:r,iconBackground:o="bg-primary/10",loading:i=!1,...a},d)=>l.jsx(me.Card,{ref:d,className:j.cn("",e),...a,children:l.jsxs(me.CardContent,{className:"flex items-center gap-4 p-6",children:[r&&l.jsx("div",{className:j.cn("flex h-12 w-12 items-center justify-center rounded-full",o),children:r}),l.jsx("div",{className:"flex-1",children:i?l.jsxs("div",{className:"space-y-2",children:[l.jsx("div",{className:"h-4 w-20 animate-pulse rounded bg-muted"}),l.jsx("div",{className:"h-6 w-16 animate-pulse rounded bg-muted"})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:s}),l.jsx("p",{className:"text-2xl font-bold",children:t}),n&&l.jsx("p",{className:"text-xs text-muted-foreground",children:n})]})})]})}));Tt.displayName="StatCard";const Lt=C.forwardRef(({className:e,icon:s,title:t,description:n,action:r,...o},i)=>l.jsxs("div",{ref:i,className:j.cn("flex min-h-[400px] flex-col items-center justify-center rounded-lg border border-dashed p-8 text-center",e),...o,children:[s&&l.jsx("div",{className:"mb-4 flex h-20 w-20 items-center justify-center rounded-full bg-muted",children:s}),l.jsx("h3",{className:"mb-2 text-lg font-semibold",children:t}),n&&l.jsx("p",{className:"mb-6 max-w-sm text-sm text-muted-foreground",children:n}),r&&l.jsx("div",{children:r})]}));Lt.displayName="EmptyState";const Gt=C.forwardRef(({className:e,items:s,...t},n)=>l.jsx("div",{ref:n,className:j.cn("relative space-y-0",e),...t,children:s.map((r,o)=>l.jsxs("div",{className:"relative pb-8 last:pb-0",children:[o!==s.length-1&&l.jsx("span",{className:"absolute left-4 top-4 -ml-px h-full w-0.5 bg-border","aria-hidden":"true"}),l.jsxs("div",{className:"relative flex items-start space-x-4",children:[l.jsx("div",{className:j.cn("relative flex h-8 w-8 items-center justify-center rounded-full border-2",r.status==="completed"&&"border-primary bg-primary text-primary-foreground",r.status==="current"&&"border-primary bg-background",r.status==="upcoming"&&"border-muted bg-background",!r.status&&"border-muted bg-background"),children:r.icon||l.jsx("div",{className:j.cn("h-2.5 w-2.5 rounded-full",r.status==="completed"&&"bg-primary-foreground",r.status==="current"&&"bg-primary",r.status==="upcoming"&&"bg-muted-foreground",!r.status&&"bg-muted-foreground")})}),l.jsxs("div",{className:"min-w-0 flex-1 pt-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{className:j.cn("text-sm font-medium",r.status==="upcoming"&&"text-muted-foreground"),children:r.title}),r.date&&l.jsx("time",{className:"text-xs text-muted-foreground",children:r.date})]}),r.description&&l.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:r.description})]})]})]},r.id))}));Gt.displayName="Timeline";const Bt=C.forwardRef(({className:e,items:s,showAvatar:t=!0,...n},r)=>l.jsx("div",{ref:r,className:j.cn("space-y-4",e),...n,children:s.map(o=>l.jsxs("div",{className:"flex gap-4",children:[t&&l.jsxs(ne.Avatar,{className:"h-8 w-8",children:[o.user.avatar&&l.jsx(ne.AvatarImage,{src:o.user.avatar,alt:o.user.name}),l.jsx(ne.AvatarFallback,{children:o.user.initials||o.user.name.charAt(0).toUpperCase()})]}),l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsxs("p",{className:"text-sm",children:[l.jsx("span",{className:"font-medium",children:o.user.name})," ",l.jsx("span",{className:"text-muted-foreground",children:o.action}),o.target&&l.jsxs("span",{className:"font-medium",children:[" ",o.target]})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:o.timestamp})]}),o.icon&&l.jsx("div",{className:"text-muted-foreground",children:o.icon})]},o.id))}));Bt.displayName="ActivityFeed";const Ht=C.forwardRef(({columns:e,onChange:s,showSelectAll:t=!0,maxHeight:n=300,className:r},o)=>{const{t:i}=A.useLocale(),a=e.filter(g=>g.visible).length,d=e.length,u=g=>{const c=e.map(m=>m.id===g&&!m.locked?{...m,visible:!m.visible}:m);s(c)},h=()=>{const g=e.every(m=>m.visible||m.locked),c=e.map(m=>m.locked?m:{...m,visible:!g});s(c)},f=()=>{const g=e.map(c=>({...c,visible:!0}));s(g)};return l.jsxs(D.DropdownMenu,{children:[l.jsx(D.DropdownMenuTrigger,{asChild:!0,children:l.jsxs(P.Button,{ref:o,variant:"outline",size:"sm",className:j.cn("gap-2",r),children:[l.jsx(Pn,{className:"h-4 w-4"}),l.jsx("span",{children:i("column.columns")}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",a,"/",d,")"]})]})}),l.jsxs(D.DropdownMenuContent,{align:"end",className:"w-56",children:[l.jsxs(D.DropdownMenuLabel,{className:"flex items-center justify-between",children:[l.jsx("span",{children:i("column.toggleColumns")}),l.jsx(P.Button,{variant:"ghost",size:"sm",className:"h-auto p-1 text-xs",onClick:f,children:i("column.reset")})]}),l.jsx(D.DropdownMenuSeparator,{}),t&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[l.jsx(J.Checkbox,{id:"select-all",checked:e.every(g=>g.visible||g.locked),onCheckedChange:h}),l.jsx("label",{htmlFor:"select-all",className:"flex-1 cursor-pointer text-sm font-medium",children:i("column.selectAll")})]}),l.jsx(D.DropdownMenuSeparator,{})]}),l.jsx(H.ScrollArea,{style:{maxHeight:n},children:l.jsx("div",{className:"space-y-1 p-1",children:e.map(g=>l.jsxs("div",{className:j.cn("flex items-center gap-2 rounded-md px-2 py-1.5 transition-colors hover:bg-muted",g.locked&&"opacity-50"),children:[l.jsx(J.Checkbox,{id:g.id,checked:g.visible,onCheckedChange:()=>u(g.id),disabled:g.locked}),l.jsxs("label",{htmlFor:g.id,className:j.cn("flex flex-1 cursor-pointer items-center gap-2 text-sm",g.locked&&"cursor-not-allowed"),children:[g.visible?l.jsx(vn.Eye,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx(En,{className:"h-3.5 w-3.5 text-muted-foreground"}),g.label]})]},g.id))})})]})]})});Ht.displayName="ColumnVisibility";const qt=C.forwardRef(({selectedCount:e,selectedIds:s,onClearSelection:t,actions:n,maxVisibleActions:r=3,className:o},i)=>{if(e===0)return null;const a=n.slice(0,r),d=n.slice(r);return l.jsxs("div",{ref:i,className:j.cn("flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2",o),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(P.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:t,children:l.jsx(ue.X,{className:"h-4 w-4"})}),l.jsxs("span",{className:"text-sm font-medium",children:[e," selected"]})]}),l.jsx("div",{className:"mx-2 h-6 w-px bg-border"}),l.jsxs("div",{className:"flex items-center gap-1",children:[a.map(u=>l.jsxs(P.Button,{variant:u.variant==="destructive"?"destructive":"ghost",size:"sm",className:"gap-2",onClick:()=>u.onClick(s),disabled:u.disabled,children:[u.icon,l.jsx("span",{children:u.label})]},u.id)),d.length>0&&l.jsxs(D.DropdownMenu,{children:[l.jsx(D.DropdownMenuTrigger,{asChild:!0,children:l.jsx(P.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",children:l.jsx(xt.Ellipsis,{className:"h-4 w-4"})})}),l.jsx(D.DropdownMenuContent,{align:"end",children:d.map(u=>l.jsxs(D.DropdownMenuItem,{onClick:()=>u.onClick(s),disabled:u.disabled,className:j.cn("flex items-center gap-2",u.variant==="destructive"&&"text-destructive"),children:[u.icon,l.jsx("span",{children:u.label})]},u.id))})]})]})]})});qt.displayName="BulkActionsToolbar";const Kt=C.forwardRef(({value:e,onChange:s,options:t=[10,20,50,100],label:n,className:r},o)=>{const{t:i}=A.useLocale(),a=n??i("table.rowsPerPage");return l.jsxs("div",{className:j.cn("flex items-center gap-2",r),children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:a}),l.jsxs(V.Select,{value:e.toString(),onValueChange:d=>s(parseInt(d,10)),children:[l.jsx(V.SelectTrigger,{ref:o,size:"sm",width:"sm",children:l.jsx(V.SelectValue,{})}),l.jsx(V.SelectContent,{align:"end",children:t.map(d=>l.jsx(V.SelectItem,{value:d.toString(),children:d},d))})]})]})});Kt.displayName="PerPageSelector";const Ut=C.forwardRef(({className:e,filters:s,onClearAll:t,...n},r)=>{const o=s.reduce((i,a)=>i+a.value.length,0);return l.jsxs("div",{ref:r,className:j.cn("flex flex-wrap items-center gap-2",e),...n,children:[s.map(i=>l.jsxs(D.DropdownMenu,{children:[l.jsx(D.DropdownMenuTrigger,{asChild:!0,children:l.jsxs(P.Button,{variant:i.value.length>0?"secondary":"outline",size:"sm",className:"gap-1",children:[i.label,i.value.length>0&&l.jsx(L.Badge,{variant:"default",className:"ml-1 h-5 px-1.5",children:i.value.length}),l.jsx(U.ChevronDown,{className:"h-3.5 w-3.5 opacity-50"})]})}),l.jsxs(D.DropdownMenuContent,{align:"start",className:"w-48",children:[l.jsx(D.DropdownMenuLabel,{children:i.label}),l.jsx(D.DropdownMenuSeparator,{}),i.options.map(a=>l.jsxs(D.DropdownMenuCheckboxItem,{checked:i.value.includes(a.value),onCheckedChange:d=>{if(i.multiple!==!1){const u=d?[...i.value,a.value]:i.value.filter(h=>h!==a.value);i.onChange(u)}else i.onChange(d?[a.value]:[])},children:[l.jsx("span",{className:"flex-1",children:a.label}),a.count!==void 0&&l.jsx("span",{className:"text-xs text-muted-foreground",children:a.count})]},a.value))]})]},i.id)),o>0&&t&&l.jsxs(P.Button,{variant:"ghost",size:"sm",className:"gap-1 text-muted-foreground",onClick:t,children:[l.jsx(ue.X,{className:"h-3.5 w-3.5"}),"Clear all"]})]})});Ut.displayName="QuickFilters";const Wt=C.forwardRef(({className:e,tags:s,onRemove:t,onClearAll:n,maxVisible:r=5,showAll:o,defaultShowAll:i=!1,onShowAllChange:a,...d},u)=>{const{t:h}=A.useLocale(),[f,g]=Se.useControllableState({value:o,defaultValue:i,onChange:a});if(s.length===0)return null;const c=f?s:s.slice(0,r),m=s.length-r;return l.jsxs("div",{ref:u,className:j.cn("flex flex-wrap items-center gap-2",e),...d,children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:h("filter.activeFilters")}),c.map(p=>l.jsxs(L.Badge,{variant:"secondary",className:"gap-1 pr-1",children:[p.category&&l.jsxs("span",{className:"text-muted-foreground",children:[p.category,":"]}),l.jsx("span",{children:p.label}),l.jsx("button",{onClick:()=>t(p.id),className:"ml-1 rounded-full p-0.5 hover:bg-muted-foreground/20",children:l.jsx(ue.X,{className:"h-3 w-3"})})]},p.id)),!f&&m>0&&l.jsx(P.Button,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>g(!0),children:h("filter.more",{count:m})}),f&&m>0&&l.jsx(P.Button,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>g(!1),children:h("filter.showLess")}),n&&s.length>1&&l.jsxs(P.Button,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs text-muted-foreground",onClick:n,children:[l.jsx(ue.X,{className:"h-3 w-3"}),h("common.clearAll")]})]})});Wt.displayName="FilterTags";function er({fields:e,value:s,onChange:t,className:n}){const{t:r}=A.useLocale(),[o,i]=C.useState(!1),a=e.find(d=>d.id===s);return l.jsxs(te.Popover,{open:o,onOpenChange:i,children:[l.jsx(te.PopoverTrigger,{asChild:!0,children:l.jsxs(P.Button,{variant:"outline",role:"combobox","aria-expanded":o,className:j.cn("w-[180px] justify-between font-normal",n),size:"sm",children:[l.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[a==null?void 0:a.icon,(a==null?void 0:a.label)??r("filter.selectField")]}),l.jsx(ge.ChevronsUpDown,{className:"ml-1 h-3 w-3 shrink-0 opacity-50"})]})}),l.jsx(te.PopoverContent,{className:"w-[220px] p-0",align:"start",children:l.jsxs(ce.Command,{children:[l.jsx(ce.CommandInput,{placeholder:r("filter.searchFields")}),l.jsxs(ce.CommandList,{children:[l.jsx(ce.CommandEmpty,{children:r("filter.noFieldFound")}),l.jsx(ce.CommandGroup,{children:e.map(d=>l.jsxs(ce.CommandItem,{value:d.id,onSelect:()=>{t(d.id),i(!1)},children:[l.jsx(L.Check,{className:j.cn("mr-2 h-4 w-4",s===d.id?"opacity-100":"opacity-0")}),l.jsxs("span",{className:"flex items-center gap-1.5",children:[d.icon,d.label]})]},d.id))})]})]})})]})}const Xe={text:[{operator:"contains",label:"Contains",labelKey:"filter.operator.contains"},{operator:"not_contains",label:"Does not contain",labelKey:"filter.operator.notContains"},{operator:"equals",label:"Equals",labelKey:"filter.operator.equals"},{operator:"not_equals",label:"Does not equal",labelKey:"filter.operator.notEquals"},{operator:"starts_with",label:"Starts with",labelKey:"filter.operator.startsWith"},{operator:"ends_with",label:"Ends with",labelKey:"filter.operator.endsWith"},{operator:"is_empty",label:"Is empty",labelKey:"filter.operator.isEmpty"},{operator:"is_not_empty",label:"Is not empty",labelKey:"filter.operator.isNotEmpty"}],number:[{operator:"equals",label:"Equals",labelKey:"filter.operator.equals"},{operator:"not_equals",label:"Does not equal",labelKey:"filter.operator.notEquals"},{operator:"gt",label:"Greater than",labelKey:"filter.operator.greaterThan"},{operator:"gte",label:"Greater than or equal",labelKey:"filter.operator.greaterThanOrEqual"},{operator:"lt",label:"Less than",labelKey:"filter.operator.lessThan"},{operator:"lte",label:"Less than or equal",labelKey:"filter.operator.lessThanOrEqual"},{operator:"between",label:"Between",labelKey:"filter.operator.between"},{operator:"is_empty",label:"Is empty",labelKey:"filter.operator.isEmpty"},{operator:"is_not_empty",label:"Is not empty",labelKey:"filter.operator.isNotEmpty"}],date:[{operator:"date_equals",label:"Is",labelKey:"filter.operator.is"},{operator:"before",label:"Before",labelKey:"filter.operator.before"},{operator:"after",label:"After",labelKey:"filter.operator.after"},{operator:"date_between",label:"Between",labelKey:"filter.operator.between"},{operator:"is_empty",label:"Is empty",labelKey:"filter.operator.isEmpty"},{operator:"is_not_empty",label:"Is not empty",labelKey:"filter.operator.isNotEmpty"}],boolean:[{operator:"is_true",label:"Is true",labelKey:"filter.operator.isTrue"},{operator:"is_false",label:"Is false",labelKey:"filter.operator.isFalse"}],select:[{operator:"equals",label:"Is",labelKey:"filter.operator.is"},{operator:"not_equals",label:"Is not",labelKey:"filter.operator.isNot"},{operator:"is_empty",label:"Is empty",labelKey:"filter.operator.isEmpty"},{operator:"is_not_empty",label:"Is not empty",labelKey:"filter.operator.isNotEmpty"}],"multi-select":[{operator:"in",label:"Includes any of",labelKey:"filter.operator.includesAny"},{operator:"not_in",label:"Does not include",labelKey:"filter.operator.doesNotInclude"},{operator:"is_empty",label:"Is empty",labelKey:"filter.operator.isEmpty"},{operator:"is_not_empty",label:"Is not empty",labelKey:"filter.operator.isNotEmpty"}]},Xt=["is_empty","is_not_empty","is_true","is_false"];function tr({fieldType:e,value:s,onChange:t,renderOperatorLabel:n,className:r}){const{t:o}=A.useLocale(),i=Xe[e]??Xe.text;return C.useEffect(()=>{i.some(a=>a.operator===s)||t(i[0].operator)},[e,i,s,t]),l.jsxs(V.Select,{value:s,onValueChange:a=>t(a),children:[l.jsx(V.SelectTrigger,{size:"sm",className:j.cn("w-[160px]",r),children:l.jsx(V.SelectValue,{})}),l.jsx(V.SelectContent,{children:i.map(a=>l.jsx(V.SelectItem,{value:a.operator,children:n?n(a):o(a.labelKey)===a.labelKey?a.label:o(a.labelKey)},a.operator))})]})}function nr({field:e,operator:s,value:t,valueTo:n,onChange:r}){var a,d;const{t:o}=A.useLocale();if(Xt.includes(s))return null;const i=s==="between"||s==="date_between";switch(e.type){case"text":return l.jsx(U.Input,{value:String(t??""),onChange:u=>r(u.target.value),placeholder:o("filter.value"),className:"h-8 w-[160px]"});case"number":return i?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(U.Input,{type:"number",value:t!=null?String(t):"",onChange:u=>r(u.target.value?Number(u.target.value):void 0,n),placeholder:o("filter.from"),className:"h-8 w-[100px]"}),l.jsx("span",{className:"text-xs text-muted-foreground",children:o("filter.to").toLowerCase()}),l.jsx(U.Input,{type:"number",value:n!=null?String(n):"",onChange:u=>r(t,u.target.value?Number(u.target.value):void 0),placeholder:o("filter.to"),className:"h-8 w-[100px]"})]}):l.jsx(U.Input,{type:"number",value:t!=null?String(t):"",onChange:u=>r(u.target.value?Number(u.target.value):void 0),placeholder:o("filter.value"),className:"h-8 w-[160px]"});case"date":return i?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ge.DatePicker,{value:t instanceof Date?t:t?new Date(t):void 0,onChange:u=>r(u,n),className:"h-8 w-[140px] text-xs"}),l.jsx("span",{className:"text-xs text-muted-foreground",children:o("filter.to").toLowerCase()}),l.jsx(ge.DatePicker,{value:n instanceof Date?n:n?new Date(n):void 0,onChange:u=>r(t,u),className:"h-8 w-[140px] text-xs"})]}):l.jsx(ge.DatePicker,{value:t instanceof Date?t:t?new Date(t):void 0,onChange:u=>r(u),className:"h-8 w-[160px] text-xs"});case"select":return l.jsxs(V.Select,{value:String(t??""),onValueChange:u=>r(u),children:[l.jsx(V.SelectTrigger,{size:"sm",className:"w-[160px]",children:l.jsx(V.SelectValue,{placeholder:o("filter.select")})}),l.jsx(V.SelectContent,{children:(a=e.options)==null?void 0:a.map(u=>l.jsx(V.SelectItem,{value:u.value,children:u.label},u.value))})]});case"multi-select":return l.jsx(ge.MultiSelect,{options:((d=e.options)==null?void 0:d.map(u=>({value:u.value,label:u.label})))??[],value:Array.isArray(t)?t:[],onChange:u=>r(u),placeholder:o("filter.select"),className:"h-8 w-[200px]"});case"boolean":return null;default:return l.jsx(U.Input,{value:String(t??""),onChange:u=>r(u.target.value),placeholder:o("filter.value"),className:"h-8 w-[160px]"})}}function sr({rule:e,fields:s,onUpdate:t,onRemove:n,showRemove:r=!0,className:o}){const i=s.find(d=>d.id===e.fieldId),a=d=>{s.find(h=>h.id===d)&&t({fieldId:d,operator:"contains",value:"",valueTo:void 0})};return l.jsxs("div",{className:j.cn("flex items-center gap-2 flex-wrap",o),children:[l.jsx(er,{fields:s,value:e.fieldId,onChange:a}),i&&l.jsxs(l.Fragment,{children:[l.jsx(tr,{fieldType:i.type,value:e.operator,onChange:d=>t({operator:d})}),l.jsx(nr,{field:i,operator:e.operator,value:e.value,valueTo:e.valueTo,onChange:(d,u)=>t({value:d,valueTo:u})})]}),r&&l.jsx(P.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 text-muted-foreground hover:text-destructive",onClick:n,children:l.jsx(ue.X,{className:"h-3.5 w-3.5"})})]})}function Yt({group:e,fields:s,depth:t,maxDepth:n,onAddRule:r,onUpdateRule:o,onRemoveRule:i,onAddGroup:a,onRemoveGroup:d,onSetGroupLogic:u,showRemove:h=!1,onRemove:f,className:g}){const{t:c}=A.useLocale(),m=["border-l-primary","border-l-blue-500","border-l-orange-500"],p=m[t%m.length];return l.jsxs("div",{className:j.cn("rounded-lg border border-l-2 bg-background p-3 space-y-2",p,g),children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("filter.match")}),l.jsx("button",{type:"button",onClick:()=>u(e.id,e.logic==="and"?"or":"and"),className:"focus:outline-none",children:l.jsx(L.Badge,{variant:e.logic==="and"?"default":"secondary",className:"cursor-pointer select-none uppercase text-[10px] px-2 py-0",children:e.logic==="and"?c("filter.and"):c("filter.or")})}),l.jsx("span",{className:"text-xs text-muted-foreground",children:c("filter.ofFollowing")})]}),h&&f&&l.jsx(P.Button,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:f,children:l.jsx(wt.Trash2,{className:"h-3 w-3"})})]}),l.jsx("div",{className:"space-y-2",children:e.rules.map(x=>l.jsx(sr,{rule:x,fields:s,onUpdate:v=>o(e.id,x.id,v),onRemove:()=>i(e.id,x.id),showRemove:e.rules.length>1||e.groups.length>0},x.id))}),e.groups.length>0&&l.jsx("div",{className:"space-y-2 pl-2",children:e.groups.map(x=>l.jsx(Yt,{group:x,fields:s,depth:t+1,maxDepth:n,onAddRule:r,onUpdateRule:o,onRemoveRule:i,onAddGroup:a,onRemoveGroup:d,onSetGroupLogic:u,showRemove:!0,onRemove:()=>d(e.id,x.id)},x.id))}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.jsxs(P.Button,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>r(e.id),children:[l.jsx(rt.Plus,{className:"mr-1 h-3 w-3"}),c("filter.addRule")]}),t<n&&l.jsxs(P.Button,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>a(e.id,t),children:[l.jsx(rt.Plus,{className:"mr-1 h-3 w-3"}),c("filter.addGroup")]})]})]})}function rr({presets:e,onLoad:s,onSave:t,onDelete:n,className:r}){const{t:o}=A.useLocale(),[i,a]=C.useState(!1),[d,u]=C.useState(""),h=()=>{d.trim()&&(t(d.trim()),u(""),a(!1))};return l.jsxs("div",{className:j.cn("flex items-center gap-1",r),children:[e.length>0&&l.jsxs(D.DropdownMenu,{children:[l.jsx(D.DropdownMenuTrigger,{asChild:!0,children:l.jsxs(P.Button,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1",children:[l.jsx(_n,{className:"h-3 w-3"}),o("filter.presets")]})}),l.jsxs(D.DropdownMenuContent,{align:"start",children:[l.jsx(D.DropdownMenuLabel,{className:"text-xs",children:o("filter.savedFilters")}),l.jsx(D.DropdownMenuSeparator,{}),e.map(f=>l.jsxs(D.DropdownMenuItem,{className:"flex items-center justify-between gap-4",children:[l.jsx("span",{className:"flex-1 cursor-pointer",onClick:()=>s(f.id),children:f.name}),l.jsx("button",{className:"text-muted-foreground hover:text-destructive",onClick:g=>{g.stopPropagation(),n(f.id)},children:l.jsx(wt.Trash2,{className:"h-3 w-3"})})]},f.id))]})]}),l.jsxs(te.Popover,{open:i,onOpenChange:a,children:[l.jsx(te.PopoverTrigger,{asChild:!0,children:l.jsxs(P.Button,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1",children:[l.jsx(Vn,{className:"h-3 w-3"}),o("filter.save")]})}),l.jsx(te.PopoverContent,{className:"w-[240px] p-3",align:"start",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-xs font-medium",children:o("filter.savePreset")}),l.jsx(U.Input,{value:d,onChange:f=>u(f.target.value),placeholder:o("filter.presetName"),className:"h-8",onKeyDown:f=>{f.key==="Enter"&&h()}}),l.jsx(P.Button,{size:"sm",className:"w-full h-7 text-xs",onClick:h,disabled:!d.trim(),children:o("filter.save")})]})})]})]})}let lr=0;function tt(){return`filter_${Date.now()}_${++lr}`}function nt(e){return{id:tt(),fieldId:e??"",operator:"contains",value:""}}function Fe(e="and"){return{id:tt(),logic:e,rules:[nt()],groups:[]}}function Jt({value:e,defaultValue:s,onChange:t,maxDepth:n=3,presets:r,onPresetsChange:o}){const[i,a]=C.useState(s??Fe()),[d,u]=C.useState([]),h=e??i,f=r??d,g=C.useCallback(y=>{const I=typeof y=="function"?y(h):y;e||a(I),t==null||t(I)},[h,e,t]),c=C.useCallback((y,I)=>{const k=b=>b.id===y?I(b):{...b,groups:b.groups.map(k)};g(b=>k(b))},[g]),m=C.useCallback(y=>{c(y,I=>({...I,rules:[...I.rules,nt()]}))},[c]),p=C.useCallback((y,I,k)=>{c(y,b=>({...b,rules:b.rules.map(q=>q.id===I?{...q,...k}:q)}))},[c]),x=C.useCallback((y,I)=>{c(y,k=>({...k,rules:k.rules.filter(b=>b.id!==I)}))},[c]),v=C.useCallback((y,I)=>{I>=n||c(y,k=>({...k,groups:[...k.groups,Fe(k.logic==="and"?"or":"and")]}))},[c,n]),w=C.useCallback((y,I)=>{c(y,k=>({...k,groups:k.groups.filter(b=>b.id!==I)}))},[c]),M=C.useCallback((y,I)=>{c(y,k=>({...k,logic:I}))},[c]),$=C.useCallback(()=>{g(Fe())},[g]),O=C.useCallback(y=>{const I={id:tt(),name:y,filter:JSON.parse(JSON.stringify(h))},k=[...f,I];return r||u(k),o==null||o(k),I},[h,f,r,o]),F=C.useCallback(y=>{const I=f.find(k=>k.id===y);I&&g(JSON.parse(JSON.stringify(I.filter)))},[f,g]),E=C.useCallback(y=>{const I=f.filter(k=>k.id!==y);r||u(I),o==null||o(I)},[f,r,o]),G=C.useMemo(()=>{const y=I=>I.rules.filter(k=>k.fieldId).length+I.groups.reduce((k,b)=>k+y(b),0);return y(h)},[h]);return{filter:h,setFilter:g,addRule:m,updateRule:p,removeRule:x,addGroup:v,removeGroup:w,setGroupLogic:M,clearAll:$,presets:f,savePreset:O,loadPreset:F,deletePreset:E,ruleCount:G,maxDepth:n}}function Qt({fields:e,compact:s=!1,expanded:t,defaultExpanded:n,onExpandedChange:r,label:o,className:i,...a}){const{t:d}=A.useLocale(),u=o??d("filter.filters"),{filter:h,addRule:f,updateRule:g,removeRule:c,addGroup:m,removeGroup:p,setGroupLogic:x,clearAll:v,presets:w,savePreset:M,loadPreset:$,deletePreset:O,ruleCount:F,maxDepth:E}=Jt(a),[G,y]=Se.useControllableState({value:t,defaultValue:n??!s,onChange:r}),I=l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Be.Filter,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:d("filter.filterRules")}),F>0&&l.jsx(L.Badge,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:F})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(rr,{presets:w,onLoad:$,onSave:M,onDelete:O}),F>0&&l.jsxs(P.Button,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground",onClick:v,children:[l.jsx(Dn,{className:"mr-1 h-3 w-3"}),d("filter.clear")]})]})]}),l.jsx(Yt,{group:h,fields:e,depth:0,maxDepth:E,onAddRule:f,onUpdateRule:g,onRemoveRule:c,onAddGroup:m,onRemoveGroup:p,onSetGroupLogic:x})]});return s?l.jsxs("div",{className:j.cn("rounded-lg border bg-background",i),children:[l.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-3 py-2 text-sm hover:bg-muted/50 transition-colors",onClick:()=>y(!G),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Be.Filter,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{className:"font-medium",children:u}),F>0&&l.jsxs(L.Badge,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:[F," ",d("filter.active")]})]}),G?l.jsx(wn.ChevronUp,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(U.ChevronDown,{className:"h-4 w-4 text-muted-foreground"})]}),G&&l.jsx("div",{className:"border-t px-3 py-3",children:I})]}):l.jsx("div",{className:j.cn("space-y-3",i),children:I})}Qt.displayName="QueryFilterBuilder";const Zt={closed:{label:"Closed Won",color:"text-emerald-700",bgColor:"bg-emerald-50",borderColor:"border-emerald-200"},commit:{label:"Commit",color:"text-blue-700",bgColor:"bg-blue-50",borderColor:"border-blue-200"},bestCase:{label:"Best Case",color:"text-amber-700",bgColor:"bg-amber-50",borderColor:"border-amber-200"},pipeline:{label:"Pipeline",color:"text-muted-foreground",bgColor:"bg-muted",borderColor:"border-border"}};function or(e,s="USD",t="en-US"){return new Intl.NumberFormat(t,{style:"currency",currency:s,notation:e>=1e6?"compact":"standard",maximumFractionDigits:e>=1e6?1:0}).format(e)}function ir(e,s){if(s===0)return{value:0,direction:"neutral"};const t=(e-s)/s*100;return{value:Math.abs(Math.round(t)),direction:t>0?"up":t<0?"down":"neutral"}}function en({bucket:e,currency:s,locale:t,onClick:n,className:r}){const o=Zt[e.category],{t:i}=A.useLocale(),a=e.previousValue!=null?ir(e.value,e.previousValue):void 0,d=e.target&&e.target>0?Math.round(e.value/e.target*100):void 0;return l.jsxs("button",{type:"button",onClick:n,disabled:!n,className:j.cn("flex flex-col rounded-lg border p-4 text-left transition-all duration-200",o.bgColor,o.borderColor,n&&"cursor-pointer hover:shadow-md active:scale-[0.99]",!n&&"cursor-default",r),children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:j.cn("text-xs font-semibold uppercase tracking-wider",o.color),children:e.label||o.label}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:i("forecast.deals",{count:e.dealCount})})]}),l.jsx("div",{className:"mt-2 text-2xl font-bold tracking-tight",children:or(e.value,s,t)}),l.jsxs("div",{className:"mt-1.5 flex items-center gap-3",children:[a&&a.direction!=="neutral"&&l.jsxs("span",{className:j.cn("flex items-center gap-0.5 text-xs font-medium",a.direction==="up"?"text-emerald-600":"text-red-600"),children:[a.direction==="up"?l.jsx(vt.TrendingUp,{className:"h-3 w-3"}):l.jsx(St,{className:"h-3 w-3"}),a.value,"%"]}),d!=null&&l.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[d,i("forecast.ofTarget")]})]}),e.trend&&e.trend.length>1&&l.jsx("div",{className:"mt-3",children:l.jsx(Cn.SparklineChart,{data:e.trend,height:32,width:"100%",color:e.category==="closed"?"hsl(var(--chart-2))":e.category==="commit"?"hsl(var(--chart-1))":e.category==="bestCase"?"hsl(var(--chart-3))":"hsl(var(--chart-4))"})})]})}function ve(e,s="USD",t="en-US"){return new Intl.NumberFormat(t,{style:"currency",currency:s,notation:e>=1e6?"compact":"standard",maximumFractionDigits:e>=1e6?1:0}).format(e)}function tn({buckets:e,target:s,currency:t,locale:n,periodLabel:r,className:o}){var c;const{t:i}=A.useLocale(),a=e.reduce((m,p)=>m+p.value,0),d=e.reduce((m,p)=>m+p.dealCount,0),u=((c=e.find(m=>m.category==="closed"))==null?void 0:c.value)??0,h=a-u,f=s&&s>0?Math.min(Math.round(a/s*100),100):void 0,g=s&&s>0?Math.min(Math.round(u/s*100),100):void 0;return l.jsx("div",{className:j.cn("rounded-lg border bg-card p-4",o),children:l.jsx("div",{className:"flex items-center justify-between gap-4",children:l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[r&&l.jsx("span",{className:"text-sm font-semibold",children:r}),l.jsx("span",{className:"text-xs text-muted-foreground",children:i("forecast.totalDeals",{count:d})})]}),s!=null&&l.jsxs("div",{className:"mt-2 space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs",children:[l.jsxs("span",{className:"text-muted-foreground",children:[i("forecast.total")," ",ve(a,t,n)]}),l.jsxs("span",{className:"flex items-center gap-1 font-medium",children:[l.jsx(On,{className:"h-3 w-3"}),ve(s,t,n)]})]}),l.jsx(he.Progress,{value:f??0,className:"h-2"}),l.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[l.jsxs("span",{children:[i("forecast.closed")," ",ve(u,t,n)," (",g??0,"%)"]}),l.jsxs("span",{children:[i("forecast.openPipeline")," ",ve(h,t,n)]})]})]}),s==null&&l.jsx("div",{className:"mt-1 text-lg font-bold",children:ve(a,t,n)})]})})})}function ar(){return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ie.Skeleton,{className:"h-5 w-32"}),l.jsx(ie.Skeleton,{className:"h-8 w-40"})]}),l.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:Array.from({length:4}).map((e,s)=>l.jsxs("div",{className:"space-y-3 rounded-lg border p-4",children:[l.jsx(ie.Skeleton,{className:"h-3 w-20"}),l.jsx(ie.Skeleton,{className:"h-7 w-28"}),l.jsx(ie.Skeleton,{className:"h-3 w-16"}),l.jsx(ie.Skeleton,{className:"h-8 w-full"})]},s))}),l.jsx(ie.Skeleton,{className:"h-20 w-full rounded-lg"})]})}function ur(e){return e.split(" ").map(s=>s[0]).join("").toUpperCase().slice(0,2)}function nn({buckets:e,target:s,currency:t,locale:n,periodLabel:r,owners:o,selectedOwnerId:i,onOwnerChange:a,onBucketClick:d,loading:u,className:h}){const{t:f}=A.useLocale();return u?l.jsx(ar,{}):l.jsxs("div",{className:j.cn("space-y-4",h),children:[(r||o&&o.length>0)&&l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r&&l.jsxs("h3",{className:"text-sm font-semibold",children:[r," ",f("forecast.forecast")]}),o&&o.length>0&&a&&l.jsxs(V.Select,{value:i??"all",onValueChange:g=>a(g==="all"?void 0:g),children:[l.jsx(V.SelectTrigger,{className:"h-8 w-[200px] text-xs",children:l.jsx(V.SelectValue,{placeholder:f("forecast.allOwners")})}),l.jsxs(V.SelectContent,{children:[l.jsx(V.SelectItem,{value:"all",children:f("forecast.allOwners")}),o.map(g=>l.jsx(V.SelectItem,{value:g.id,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(ne.Avatar,{className:"h-4 w-4",children:[l.jsx(ne.AvatarImage,{src:g.avatar,alt:g.name}),l.jsx(ne.AvatarFallback,{className:"text-[7px]",children:ur(g.name)})]}),g.name]})},g.id))]})]})]}),l.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:e.map(g=>l.jsx(en,{bucket:g,currency:t,locale:n,onClick:d?()=>d(g.category):void 0},g.category))}),l.jsx(tn,{buckets:e,target:s,currency:t,locale:n,periodLabel:r})]})}nn.displayName="ForecastBoard";function sn({sourceColumns:e,targetFields:s,mappings:t,onMappingsChange:n,previewData:r,className:o}){const i=(c,m)=>{const p=t.map(x=>x.sourceColumn===c?{...x,targetField:m}:x);t.find(x=>x.sourceColumn===c)||p.push({sourceColumn:c,targetField:m,preview:r==null?void 0:r.slice(0,3).map(x=>String(x[c]??""))}),n(p)},a=c=>{var m;return((m=t.find(p=>p.sourceColumn===c))==null?void 0:m.targetField)??null},d=new Set(t.map(c=>c.targetField).filter(Boolean)),{t:u}=A.useLocale(),h=t.filter(c=>c.targetField).length,g=s.filter(c=>c.required).filter(c=>!t.some(m=>m.targetField===c.id));return l.jsxs("div",{className:j.cn("space-y-4",o),children:[l.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[l.jsx(L.Badge,{variant:"secondary",children:u("bulkOps.mapped",{mapped:h,total:e.length})}),g.length>0&&l.jsx(L.Badge,{variant:"destructive",children:u("bulkOps.requiredUnmapped",{count:g.length})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"grid grid-cols-[1fr_32px_1fr] gap-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground px-1",children:[l.jsx("span",{children:u("bulkOps.sourceColumn")}),l.jsx("span",{}),l.jsx("span",{children:u("bulkOps.targetField")})]}),e.map(c=>{const m=a(c),p=r==null?void 0:r.slice(0,2).map(x=>String(x[c]??""));return l.jsxs("div",{className:"grid grid-cols-[1fr_32px_1fr] items-center gap-2 rounded-lg border bg-card p-2.5",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:c}),p&&p.length>0&&l.jsx("p",{className:"mt-0.5 truncate text-[10px] text-muted-foreground",children:p.join(", ")})]}),l.jsx("div",{className:"flex justify-center",children:l.jsx(Ct.ArrowRight,{className:"h-4 w-4 text-muted-foreground/50"})}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsxs(V.Select,{value:m??"__none__",onValueChange:x=>i(c,x==="__none__"?null:x),children:[l.jsx(V.SelectTrigger,{className:"h-8 text-xs",children:l.jsx(V.SelectValue,{placeholder:u("bulkOps.skipColumn")})}),l.jsxs(V.SelectContent,{children:[l.jsx(V.SelectItem,{value:"__none__",children:l.jsx("span",{className:"text-muted-foreground",children:u("bulkOps.skip")})}),s.map(x=>l.jsxs(V.SelectItem,{value:x.id,disabled:d.has(x.id)&&m!==x.id,children:[x.label,x.required&&l.jsx("span",{className:"ml-1 text-destructive",children:"*"})]},x.id))]})]}),m&&l.jsx(P.Button,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>i(c,null),children:l.jsx(ue.X,{className:"h-3 w-3"})})]})]},c)})]})]})}const ht={error:{icon:l.jsx(he.CircleAlert,{className:"h-3 w-3"}),color:"text-destructive"},warning:{icon:l.jsx(he.TriangleAlert,{className:"h-3 w-3"}),color:"text-amber-600"},info:{icon:l.jsx(he.Info,{className:"h-3 w-3"}),color:"text-blue-600"}};function rn({rows:e,fields:s,mappings:t,onFixValue:n,onToggleSkip:r,showOnlyIssues:o,onShowOnlyIssuesChange:i,className:a}){const d=t.filter(f=>f.targetField).map(f=>{const g=s.find(c=>c.id===f.targetField);return{sourceColumn:f.sourceColumn,field:g}}).filter(f=>f.field),{t:u}=A.useLocale(),h=o?e.filter(f=>f._issues.length>0):e;return l.jsxs("div",{className:j.cn("space-y-3",a),children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[l.jsx(L.Badge,{variant:"secondary",children:u("bulkOps.rows",{count:e.length})}),l.jsx(L.Badge,{variant:"outline",className:"text-destructive border-destructive/30",children:u("bulkOps.errors",{count:e.filter(f=>f._status==="error").length})}),l.jsx(L.Badge,{variant:"outline",className:"text-amber-600 border-amber-300",children:u("bulkOps.warnings",{count:e.filter(f=>f._status==="warning").length})})]}),i&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Sn.Switch,{checked:o,onCheckedChange:i,id:"show-issues"}),l.jsx(jn.Label,{htmlFor:"show-issues",className:"text-xs",children:u("bulkOps.showOnlyIssues")})]})]}),l.jsx(H.ScrollArea,{className:"rounded-lg border",children:l.jsx(X.TooltipProvider,{children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"sticky top-0 z-10 bg-muted/50",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-3 py-2 text-left text-[10px] font-semibold uppercase tracking-wider text-muted-foreground w-12",children:"#"}),l.jsx("th",{className:"px-3 py-2 text-left text-[10px] font-semibold uppercase tracking-wider text-muted-foreground w-16",children:u("bulkOps.status")}),d.map(({field:f})=>l.jsxs("th",{className:"px-3 py-2 text-left text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[f.label,f.required&&l.jsx("span",{className:"ml-0.5 text-destructive",children:"*"})]},f.id)),r&&l.jsx("th",{className:"px-3 py-2 text-center text-[10px] font-semibold uppercase tracking-wider text-muted-foreground w-16",children:u("bulkOps.skip")})]})}),l.jsx("tbody",{children:h.map(f=>{const g=new Map(f._issues.map(c=>[c.column,c]));return l.jsxs("tr",{className:j.cn("border-t transition-colors",f._status==="skipped"&&"opacity-40",f._status==="error"&&"bg-destructive/5",f._status==="warning"&&"bg-amber-50/50"),children:[l.jsx("td",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:f._rowIndex+1}),l.jsxs("td",{className:"px-3 py-1.5",children:[f._status==="valid"&&l.jsx(L.Badge,{variant:"secondary",className:"text-[9px] px-1.5 py-0",children:u("bulkOps.ok")}),f._status==="error"&&l.jsx(L.Badge,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:u("bulkOps.error")}),f._status==="warning"&&l.jsx(L.Badge,{variant:"outline",className:"text-[9px] px-1.5 py-0 text-amber-600 border-amber-300",children:u("bulkOps.warn")}),f._status==="skipped"&&l.jsx(L.Badge,{variant:"outline",className:"text-[9px] px-1.5 py-0",children:u("bulkOps.skip")})]}),d.map(({field:c})=>{const m=g.get(c.id),p=f[c.id];return l.jsx("td",{className:"px-3 py-1.5",children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:j.cn("truncate text-xs",(m==null?void 0:m.severity)==="error"&&"text-destructive font-medium",(m==null?void 0:m.severity)==="warning"&&"text-amber-600"),children:p!=null?String(p):l.jsx("span",{className:"text-muted-foreground",children:"—"})}),m&&l.jsxs(X.Tooltip,{children:[l.jsx(X.TooltipTrigger,{asChild:!0,children:l.jsx("span",{className:j.cn("shrink-0",ht[m.severity].color),children:ht[m.severity].icon})}),l.jsxs(X.TooltipContent,{side:"top",className:"max-w-[200px]",children:[l.jsx("p",{className:"text-xs",children:m.message}),m.suggestedValue!=null&&n&&l.jsx(P.Button,{size:"sm",variant:"outline",className:"mt-1 h-5 text-[10px]",onClick:()=>n(f._rowIndex,c.id,m.suggestedValue),children:u("bulkOps.fix",{value:String(m.suggestedValue)})})]})]})]})},c.id)}),r&&l.jsx("td",{className:"px-3 py-1.5 text-center",children:l.jsx(P.Button,{variant:"ghost",size:"icon",className:j.cn("h-6 w-6",f._status==="skipped"&&"text-muted-foreground"),onClick:()=>r(f._rowIndex),children:l.jsx($n,{className:"h-3 w-3"})})})]},f._rowIndex)})})]})})})]})}const ft=["upload","map","validate","confirm"];function ln({step:e,sourceColumns:s=[],targetFields:t,mappings:n=[],onMappingsChange:r,previewData:o,validatedRows:i=[],onFixValue:a,onToggleSkip:d,onNext:u,onBack:h,onFileUpload:f,onConfirm:g,progress:c,summary:m,stepLabels:p,summaryLabels:x,renderConfirmSummary:v,showOnlyIssues:w,defaultShowOnlyIssues:M=!1,onShowOnlyIssuesChange:$,className:O}){const F=ee.useRef(null),[E,G]=Se.useControllableState({value:w,defaultValue:M,onChange:$}),{t:y}=A.useLocale(),I={upload:(p==null?void 0:p.upload)??y("bulkOps.upload"),map:(p==null?void 0:p.map)??y("bulkOps.mapFields"),validate:(p==null?void 0:p.validate)??y("bulkOps.validate"),confirm:(p==null?void 0:p.confirm)??y("bulkOps.import")},k={valid:(x==null?void 0:x.valid)??"valid",warnings:(x==null?void 0:x.warnings)??"warnings",skipped:(x==null?void 0:x.skipped)??"skipped"},b=ft.findIndex(S=>S===e),q=S=>{S.preventDefault();const _=S.dataTransfer.files[0];_&&(f==null||f(_))},Q=S=>{var se;const _=(se=S.target.files)==null?void 0:se[0];_&&(f==null||f(_))};return l.jsxs("div",{className:j.cn("space-y-6",O),children:[l.jsx("div",{className:"flex items-center gap-2",children:ft.map((S,_)=>l.jsxs("div",{className:"flex items-center gap-2",children:[_>0&&l.jsx("div",{className:"h-px w-8 bg-border"}),l.jsxs("div",{className:j.cn("flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium transition-colors",_===b&&"bg-primary text-primary-foreground",_<b&&"bg-primary/10 text-primary",_>b&&"bg-muted text-muted-foreground"),children:[l.jsx("span",{className:"flex h-4 w-4 items-center justify-center rounded-full text-[10px]",children:_<b?l.jsx(L.Check,{className:"h-3 w-3"}):_+1}),I[S]]})]},S))}),l.jsxs("div",{className:"min-h-[300px]",children:[e==="upload"&&l.jsxs("div",{onDragOver:S=>S.preventDefault(),onDrop:q,className:"flex min-h-[300px] flex-col items-center justify-center rounded-lg border-2 border-dashed bg-muted/30 p-8 text-center transition-colors hover:border-primary/30 hover:bg-muted/50",children:[l.jsx(yn.Upload,{className:"mb-3 h-10 w-10 text-muted-foreground/50"}),l.jsx("p",{className:"text-sm font-medium",children:y("bulkOps.dropFile")}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:y("bulkOps.supportedFormats")}),l.jsx("input",{ref:F,type:"file",accept:".csv,.xlsx,.xls,.json",className:"hidden",onChange:Q}),l.jsxs(P.Button,{variant:"outline",size:"sm",className:"mt-4",onClick:()=>{var S;return(S=F.current)==null?void 0:S.click()},children:[l.jsx(lt.FileSpreadsheet,{className:"mr-1.5 h-3.5 w-3.5"}),y("bulkOps.browseFiles")]})]}),e==="map"&&r&&l.jsx(sn,{sourceColumns:s,targetFields:t,mappings:n,onMappingsChange:r,previewData:o}),e==="validate"&&l.jsx(rn,{rows:i,fields:t,mappings:n,onFixValue:a,onToggleSkip:d,showOnlyIssues:E,onShowOnlyIssuesChange:G}),e==="confirm"&&l.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:c!=null&&c<100?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"text-sm font-medium",children:y("bulkOps.importing")}),l.jsx(he.Progress,{value:c,className:"mt-4 h-2 w-[300px]"}),l.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:[c,y("bulkOps.complete")]})]}):c===100?l.jsxs(l.Fragment,{children:[l.jsx(L.Check,{className:"mb-3 h-10 w-10 text-emerald-600"}),l.jsx("p",{className:"text-sm font-medium",children:y("bulkOps.importComplete")})]}):m?v?v(m):l.jsxs(l.Fragment,{children:[l.jsx(lt.FileSpreadsheet,{className:"mb-3 h-10 w-10 text-muted-foreground/50"}),l.jsx("p",{className:"text-sm font-medium",children:y("bulkOps.readyToImport")}),l.jsxs("div",{className:"mt-4 flex items-center gap-4 text-sm",children:[l.jsxs("span",{className:"text-emerald-600 font-medium",children:[m.valid," ",k.valid]}),m.warnings>0&&l.jsxs("span",{className:"text-amber-600",children:[m.warnings," ",k.warnings]}),m.errors>0&&l.jsxs("span",{className:"flex items-center gap-1 text-destructive",children:[l.jsx(he.CircleAlert,{className:"h-3 w-3"}),m.errors," ",y("bulkOps.errorsSkipped")]}),m.skipped>0&&l.jsxs("span",{className:"text-muted-foreground",children:[m.skipped," ",k.skipped]})]})]}):null})]}),l.jsxs("div",{className:"flex items-center justify-between border-t pt-4",children:[l.jsxs(P.Button,{variant:"outline",size:"sm",onClick:h,disabled:b===0,children:[l.jsx(Rn,{className:"mr-1.5 h-3.5 w-3.5"}),y("bulkOps.back")]}),e==="confirm"?l.jsx(P.Button,{size:"sm",onClick:g,disabled:c!=null&&c<100,children:y(c===100?"bulkOps.done":"bulkOps.startImport")}):l.jsxs(P.Button,{size:"sm",onClick:u,children:[y("bulkOps.next"),l.jsx(Ct.ArrowRight,{className:"ml-1.5 h-3.5 w-3.5"})]})]})]})}ln.displayName="BulkDataOps";function cr({records:e,conflicts:s,onResolveConflict:t,primaryRecordId:n,onPrimaryRecordChange:r,className:o}){const i=s.filter(d=>d.resolvedValue!==void 0).length,{t:a}=A.useLocale();return l.jsxs("div",{className:j.cn("space-y-4",o),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(L.Badge,{variant:"secondary",children:a("bulkOps.recordsToMerge",{count:e.length})}),l.jsx(L.Badge,{variant:i===s.length?"default":"outline",children:a("bulkOps.conflictsResolved",{resolved:i,total:s.length})})]}),r&&l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:a("bulkOps.primaryRecord")}),l.jsx("div",{className:"flex items-center gap-2",children:e.map(d=>l.jsx(P.Button,{variant:n===d.id?"default":"outline",size:"sm",className:"text-xs",onClick:()=>r(d.id),children:d.label},d.id))})]}),l.jsx(H.ScrollArea,{className:"max-h-[400px]",children:l.jsx("div",{className:"space-y-3",children:s.map(d=>l.jsxs("div",{className:"rounded-lg border p-3",children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium",children:d.fieldLabel}),d.resolvedValue!==void 0&&l.jsx(L.Check,{className:"h-4 w-4 text-emerald-600"})]}),l.jsx("div",{className:"space-y-1.5",children:d.values.map(({recordId:u,value:h})=>{const f=e.find(c=>c.id===u),g=d.resolvedValue!==void 0&&JSON.stringify(d.resolvedValue)===JSON.stringify(h);return l.jsxs("button",{type:"button",onClick:()=>t(d.fieldId,h),className:j.cn("flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm transition-colors",g?"bg-primary/10 border border-primary/30 text-primary":"border bg-card hover:bg-muted"),children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"truncate font-medium",children:h!=null?String(h):a("bulkOps.empty")}),l.jsx("p",{className:"text-[10px] text-muted-foreground",children:a("bulkOps.fromRecord",{label:(f==null?void 0:f.label)??u})})]}),g&&l.jsx(L.Check,{className:"h-3.5 w-3.5 shrink-0"})]},u)})})]},d.fieldId))})})]})}function dr(e){return e.split(" ").map(s=>s[0]).join("").toUpperCase().slice(0,2)}function on({task:e,depth:s,rowHeight:t,onToggleCollapse:n,onTaskClick:r}){const o=e.children&&e.children.length>0;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center border-b px-2 hover:bg-muted/50 transition-colors cursor-pointer",style:{height:t,paddingLeft:8+s*16},onClick:()=>r==null?void 0:r(e),children:[o?l.jsx("button",{type:"button",className:"mr-1 flex h-4 w-4 shrink-0 items-center justify-center rounded hover:bg-muted",onClick:i=>{i.stopPropagation(),n==null||n(e.id)},children:e.collapsed?l.jsx(bn.ChevronRight,{className:"h-3 w-3"}):l.jsx(U.ChevronDown,{className:"h-3 w-3"})}):l.jsx("span",{className:"mr-1 w-4 shrink-0"}),e.milestone&&l.jsx(kn,{className:"mr-1.5 h-3 w-3 shrink-0 text-amber-500"}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium",children:e.name}),e.assignee&&l.jsxs(ne.Avatar,{className:"ml-1.5 h-5 w-5 shrink-0",children:[l.jsx(ne.AvatarImage,{src:e.assignee.avatar,alt:e.assignee.name}),l.jsx(ne.AvatarFallback,{className:"text-[7px]",children:dr(e.assignee.name)})]})]}),o&&!e.collapsed&&e.children.map(i=>l.jsx(on,{task:i,depth:s+1,rowHeight:t,onToggleCollapse:n,onTaskClick:r},i.id))]})}function an({tasks:e,rowHeight:s,width:t,onToggleCollapse:n,onTaskClick:r,className:o}){const{t:i}=A.useLocale();return l.jsxs("div",{className:j.cn("shrink-0 overflow-hidden border-r bg-background",o),style:{width:t},children:[l.jsx("div",{className:"flex items-center border-b bg-muted/30 px-3 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",style:{height:48},children:i("gantt.taskName")}),l.jsx("div",{className:"overflow-y-auto",children:e.map(a=>l.jsx(on,{task:a,depth:0,rowHeight:s,onToggleCollapse:n,onTaskClick:r},a.id))})]})}function gr({bar:e,rowHeight:s,onClick:t}){const{task:n,x:r,width:o,y:i}=e,a=n.milestone?12:s*.5,d=i+(s-a)/2;if(n.milestone){const g=r+6,c=d+6;return l.jsxs("g",{className:"cursor-pointer",onClick:t,children:[l.jsx("polygon",{points:`${g},${c-6} ${g+6},${c} ${g},${c+6} ${g-6},${c}`,fill:n.color??"hsl(var(--warning))",stroke:n.color??"hsl(var(--warning))",strokeWidth:1,opacity:.9}),l.jsx("title",{children:n.name})]})}const u=n.progress??0,h=o*u/100,f=4;return l.jsxs("g",{className:"cursor-pointer transition-opacity hover:opacity-80",onClick:t,children:[l.jsx("rect",{x:r,y:d,width:o,height:a,rx:f,fill:n.color??"hsl(var(--primary))",opacity:.2}),u>0&&l.jsx("rect",{x:r,y:d,width:Math.min(h,o),height:a,rx:f,fill:n.color??"hsl(var(--primary))",opacity:.7}),l.jsx("rect",{x:r,y:d,width:o,height:a,rx:f,fill:"none",stroke:n.color??"hsl(var(--primary))",strokeWidth:1,opacity:.5}),o>50&&l.jsx("text",{x:r+6,y:d+a/2,dominantBaseline:"central",fill:"currentColor",fontSize:10,fontWeight:500,className:"pointer-events-none",children:n.name}),l.jsxs("title",{children:[n.name," (",u,"%)"]})]})}function un({columns:e,barPositions:s,totalWidth:t,totalHeight:n,todayX:r,rowHeight:o,showTodayMarker:i,onTaskClick:a,className:d}){const u=ee.useRef(null);return l.jsxs("div",{ref:u,className:j.cn("flex-1 overflow-auto",d),children:[l.jsx("div",{className:"sticky top-0 z-10 flex border-b bg-muted/30",style:{width:t,height:48},children:e.map((h,f)=>l.jsxs("div",{className:j.cn("flex shrink-0 flex-col items-center justify-center border-r text-center",h.isWeekend&&"bg-muted/40",h.isToday&&"bg-primary/5"),style:{width:h.width},children:[l.jsx("span",{className:"text-[10px] font-semibold",children:h.label}),h.subLabel&&l.jsx("span",{className:"text-[9px] text-muted-foreground",children:h.subLabel})]},f))}),l.jsxs("div",{style:{width:t,position:"relative"},children:[l.jsxs("svg",{width:t,height:n,className:"absolute inset-0",children:[e.map((h,f)=>{const g=e.slice(0,f).reduce((c,m)=>c+m.width,0);return l.jsxs("g",{children:[l.jsx("line",{x1:g,y1:0,x2:g,y2:n,stroke:"hsl(var(--border))",strokeWidth:.5}),h.isWeekend&&l.jsx("rect",{x:g,y:0,width:h.width,height:n,fill:"hsl(var(--muted))",opacity:.3})]},f)}),s.map((h,f)=>l.jsx("line",{x1:0,y1:(f+1)*o,x2:t,y2:(f+1)*o,stroke:"hsl(var(--border))",strokeWidth:.5},`h-${f}`)),i&&l.jsx("line",{x1:r,y1:0,x2:r,y2:n,stroke:"hsl(var(--destructive))",strokeWidth:1.5,strokeDasharray:"4 2"}),s.map(h=>l.jsx(gr,{bar:h,rowHeight:o,onClick:()=>a==null?void 0:a(h.task)},h.task.id))]}),l.jsx("div",{style:{height:n}})]})]})}function Ne(e){return e instanceof Date?e:new Date(e)}function ae(e){const s=new Date(e);return s.setHours(0,0,0,0),s}function we(e,s){const t=new Date(e);return t.setDate(t.getDate()+s),t}function Le(e,s){return Math.round((e.getTime()-s.getTime())/864e5)}function mr(e){const s=e.getDay();return s===0||s===6}function hr(e,s){return e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth()&&e.getDate()===s.getDate()}function cn(e){const s=[];for(const t of e)s.push(t),t.children&&!t.collapsed&&s.push(...cn(t.children));return s}function Ge(e){switch(e){case"day":return 40;case"week":return 80;case"month":return 120}}function fr(e,s){switch(s){case"day":return{label:e.toLocaleDateString("en-US",{day:"numeric"}),subLabel:e.toLocaleDateString("en-US",{weekday:"short"})};case"week":return{label:`W${pr(e)}`,subLabel:e.toLocaleDateString("en-US",{month:"short",day:"numeric"})};case"month":return{label:e.toLocaleDateString("en-US",{month:"short"}),subLabel:e.getFullYear().toString()}}}function pr(e){const s=new Date(e.getFullYear(),0,1),t=Math.ceil((e.getTime()-s.getTime())/864e5);return Math.ceil((t+s.getDay())/7)}function Re(e){switch(e){case"day":return 1;case"week":return 7;case"month":return 30}}function dn(e,s,t){const n=ee.useMemo(()=>cn(e),[e]),r=ee.useMemo(()=>{if(n.length===0){const g=ae(new Date);return{start:we(g,-7),end:we(g,30)}}let u=1/0,h=-1/0;for(const g of n){const c=Ne(g.start).getTime(),m=Ne(g.end).getTime();c<u&&(u=c),m>h&&(h=m)}const f=Re(s)*2;return{start:we(ae(new Date(u)),-f),end:we(ae(new Date(h)),f)}},[n,s]),o=ee.useMemo(()=>{const u=[],h=Ge(s),f=Re(s),g=ae(new Date);let c=new Date(r.start);for(;c<=r.end;){const{label:m,subLabel:p}=fr(c,s);u.push({date:new Date(c),label:m,subLabel:p,width:h,isToday:hr(c,g),isWeekend:mr(c)}),c=we(c,f)}return u},[r,s]),i=ee.useMemo(()=>o.reduce((u,h)=>u+h.width,0),[o]),a=ee.useMemo(()=>{const u=Ge(s),h=Re(s),f=r.start;return n.map((g,c)=>{const m=ae(Ne(g.start)),p=ae(Ne(g.end)),x=Le(m,f)/h,v=Math.max(Le(p,m)/h,.5);return{task:g,x:x*u,width:Math.max(v*u,g.milestone?16:20),y:c*t}})},[n,r,s,t]),d=ee.useMemo(()=>{const u=ae(new Date),h=Ge(s),f=Re(s);return Le(u,r.start)/f*h},[r,s]);return{flatTasks:n,columns:o,totalWidth:i,barPositions:a,todayX:d,dateRange:r}}const xr=[{mode:"day",icon:l.jsx(pt.Calendar,{className:"h-3.5 w-3.5"})},{mode:"week",icon:l.jsx(Mn,{className:"h-3.5 w-3.5"})},{mode:"month",icon:l.jsx(In,{className:"h-3.5 w-3.5"})}];function gn({tasks:e,defaultTasks:s,onTasksChange:t,viewMode:n,defaultViewMode:r="week",onViewModeChange:o,viewModeLabels:i,hideToolbar:a=!1,renderToolbar:d,onTaskChange:u,onTaskClick:h,showTodayMarker:f=!0,rowHeight:g=40,readOnly:c=!1,sidebarWidth:m=240,height:p=500,className:x}){const{t:v}=A.useLocale(),[w,M]=Se.useControllableState({value:n,defaultValue:r,onChange:o}),[$,O]=Se.useControllableState({value:e,defaultValue:s??e??[],onChange:t}),F=S=>{M(S)},E=S=>(i==null?void 0:i[S])??v(`gantt.${S}`),G=S=>{const _=z=>z.map(B=>B.id===S?{...B,collapsed:!B.collapsed}:B.children?{...B,children:_(B.children)}:B),se=_($);O(se);const pe=z=>{for(const B of z){if(B.id===S)return B;if(B.children){const st=pe(B.children);if(st)return st}}},T=pe(se);T&&!c&&(u==null||u(T))},{flatTasks:y,columns:I,totalWidth:k,barPositions:b,todayX:q}=dn($,w,g),Q=y.length*g;return l.jsxs("div",{className:j.cn("flex flex-col overflow-hidden rounded-lg border bg-background",x),style:{height:p},children:[!a&&(d?l.jsx("div",{className:"border-b px-3 py-2",children:d({viewMode:w,setViewMode:F,taskCount:y.length})}):l.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[l.jsx("span",{className:"text-sm font-semibold",children:v("gantt.tasks",{count:y.length})}),l.jsx(X.TooltipProvider,{children:l.jsx("div",{className:"flex items-center gap-1 rounded-lg border bg-muted/30 p-0.5",children:xr.map(({mode:S,icon:_})=>l.jsxs(X.Tooltip,{children:[l.jsx(X.TooltipTrigger,{asChild:!0,children:l.jsxs(P.Button,{variant:w===S?"default":"ghost",size:"sm",className:j.cn("h-7 px-2.5 text-xs",w!==S&&"hover:bg-background"),onClick:()=>F(S),children:[_,l.jsx("span",{className:"ml-1",children:E(S)})]})}),l.jsx(X.TooltipContent,{children:v("gantt.viewMode",{mode:E(S)})})]},S))})})]})),l.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[l.jsx(an,{tasks:$,rowHeight:g,width:m,onToggleCollapse:G,onTaskClick:h}),l.jsx(un,{columns:I,barPositions:b,totalWidth:k,totalHeight:Q,todayX:q,rowHeight:g,showTodayMarker:f,onTaskClick:h,readOnly:c})]})]})}gn.displayName="GanttPlanner";function vr(e){const s=[],t=new Map;for(const n of e){const r=n.group??"",o=t.get(r);o!==void 0?s[o].items.push(n):(t.set(r,s.length),s.push({label:r,items:[n]}))}return s}function mn({roles:e,permissions:s,values:t,onChange:n,onBulkToggleRole:r,onBulkTogglePermission:o,readOnly:i=!1,className:a}){const d=C.useMemo(()=>vr(s),[s]),{t:u}=A.useLocale(),h=C.useMemo(()=>s.map(x=>x.id),[s]),f=(x,v)=>{var w;return((w=t[x])==null?void 0:w.includes(v))??!1},g=x=>h.length>0&&h.every(v=>f(x,v)),c=x=>e.length>0&&e.every(v=>f(v.id,x)),m="flex items-center justify-center h-10 min-w-[80px] border-b border-r px-2",p="flex flex-col items-center justify-center gap-1 h-14 min-w-[80px] border-b border-r px-2 bg-muted/40";return l.jsxs(H.ScrollArea,{className:j.cn("rounded-lg border bg-background",a),children:[l.jsxs("table",{className:"w-max border-collapse",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"sticky top-0 z-10 bg-background",children:[l.jsx("th",{className:"sticky left-0 z-20 border-b border-r bg-muted/40 min-w-[180px] h-14"}),l.jsx("th",{className:j.cn(p,"sticky left-[180px] z-20 bg-muted/40"),children:l.jsx("span",{className:"text-[10px] font-medium text-muted-foreground",children:u("permission.all")})}),e.map(x=>l.jsxs("th",{className:j.cn(p),children:[l.jsx("span",{className:"text-xs font-semibold truncate max-w-[72px]",children:x.name}),!i&&l.jsx(J.Checkbox,{size:"sm",checked:g(x.id),onCheckedChange:v=>r==null?void 0:r(x.id,v===!0),"aria-label":u("permission.toggleAllForRole",{role:x.name})})]},x.id))]})}),l.jsx("tbody",{children:d.map(x=>l.jsxs(C.Fragment,{children:[x.label&&l.jsx("tr",{children:l.jsx("td",{colSpan:e.length+2,className:"sticky left-0 bg-muted/20 border-b px-3 py-1.5 text-xs font-semibold text-muted-foreground tracking-wide uppercase",children:x.label})}),x.items.map(v=>l.jsxs("tr",{className:"hover:bg-accent/30 transition-colors",children:[l.jsx("td",{className:"sticky left-0 z-10 bg-background border-b border-r px-3 min-w-[180px] text-sm font-medium truncate",children:v.name}),l.jsx("td",{className:j.cn(m,"sticky left-[180px] z-10 bg-background"),children:!i&&l.jsx(J.Checkbox,{size:"sm",checked:c(v.id),onCheckedChange:w=>o==null?void 0:o(v.id,w===!0),"aria-label":u("permission.toggleForAllRoles",{permission:v.name})})}),e.map(w=>l.jsx("td",{className:j.cn(m),children:l.jsx(J.Checkbox,{size:"sm",checked:f(w.id,v.id),onCheckedChange:M=>n==null?void 0:n(w.id,v.id,M===!0),disabled:i,"aria-label":u("permission.toggleSingle",{permission:v.name,role:w.name})})},w.id))]},v.id))]},x.label))})]}),l.jsx(H.ScrollBar,{orientation:"horizontal"})]})}mn.displayName="PermissionMatrix";exports.ActivityFeed=Bt;exports.BulkActionsToolbar=qt;exports.BulkDataOps=ln;exports.ColumnVisibility=Ht;exports.DataTable=Es;exports.EditableCell=et;exports.EmptyState=Lt;exports.FORECAST_CATEGORY_CONFIG=Zt;exports.FilterTags=Wt;exports.ForecastBoard=nn;exports.ForecastBucket=en;exports.ForecastSummary=tn;exports.GanttChart=un;exports.GanttPlanner=gn;exports.GanttSidebar=an;exports.ImportMapper=sn;exports.KPICard=At;exports.MergePreview=cr;exports.NO_VALUE_OPERATORS=Xt;exports.OPERATORS_BY_FIELD_TYPE=Xe;exports.PerPageSelector=Kt;exports.PermissionMatrix=mn;exports.QueryFilterBuilder=Qt;exports.QuickFilters=Ut;exports.StatCard=Tt;exports.Table=Ie;exports.TableBody=Ee;exports.TableCaption=$t;exports.TableCell=fe;exports.TableFooter=Pt;exports.TableHead=De;exports.TableHeader=ke;exports.TableRow=le;exports.Timeline=Gt;exports.ValidationTable=rn;exports.VirtualDataTable=zt;exports.createActionsCell=Vs;exports.createEditableCell=Ts;exports.createEmptyGroup=Fe;exports.createEmptyRule=nt;exports.createSortableHeader=Ds;exports.exportToCsv=Ls;exports.useFilterBuilder=Jt;exports.useGanttPlanner=dn;
|
|
93
|
+
//# sourceMappingURL=permission-matrix-CqE8q8Hi.cjs.map
|