@daisforge/ui 1.19.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/{AnalyticalWidget-Cdo6_s1Y.mjs → AnalyticalWidget-BtyWKJuu.mjs} +34 -34
- package/chunks/AnalyticalWidget-YytE3Rlw.cjs +43 -0
- package/chunks/{ApprovalCenter-DxcvzR8q.mjs → ApprovalCenter-DLKZP2AO.mjs} +2 -2
- package/chunks/{ApprovalCenter-CAcC43zn.cjs → ApprovalCenter-DdsLEipZ.cjs} +1 -1
- package/chunks/BlockTitle-DC1McGof.cjs +1 -0
- package/chunks/BlockTitle-DsXxImR6.mjs +86 -0
- package/chunks/{Container-CrB1jwqH.cjs → Container-DHnX1sHY.cjs} +1 -1
- package/chunks/{Container-Cy8w2JOq.mjs → Container-DbZwlfIM.mjs} +1 -1
- package/chunks/{EmptyState-B205JfZA.mjs → EmptyState-CUCseg9M.mjs} +1 -1
- package/chunks/{EmptyState-CcxlsZm0.cjs → EmptyState-DH1xawxg.cjs} +1 -1
- package/chunks/{FiltersActions-CFStLRsU.mjs → FiltersActions-CDZSO0MM.mjs} +4 -4
- package/chunks/{FiltersActions-BKJJH6Mu.cjs → FiltersActions-CVtgAJnC.cjs} +1 -1
- package/chunks/{FormSegmentGroup-CCCqRgCG.cjs → FormSegmentGroup-BYQ6yMK1.cjs} +1 -1
- package/chunks/{FormSegmentGroup-E1JurEt7.mjs → FormSegmentGroup-C9qYxYT9.mjs} +1 -1
- package/chunks/{GridDND-UMUi8M_Q.mjs → GridDND-CqvpXgCY.mjs} +2 -2
- package/chunks/{GridDND-DV-1g1sI.cjs → GridDND-DK6SAO8q.cjs} +1 -1
- package/chunks/LeftPanel-AyuV7bGS.cjs +1 -0
- package/chunks/{LeftPanel-HZu3ECqD.mjs → LeftPanel-C5SsoRJS.mjs} +47 -45
- package/chunks/{ListOfFilters-DJvnT9kw.cjs → ListOfFilters-BAPz0OY9.cjs} +1 -1
- package/chunks/{ListOfFilters-DTAZ3wfQ.mjs → ListOfFilters-Bd8CZHDq.mjs} +3 -3
- package/chunks/{MassActions-Z-48g81T.cjs → MassActions-C08IgW4a.cjs} +1 -1
- package/chunks/{MassActions-DSAaO1-u.mjs → MassActions-D5UwHcNG.mjs} +3 -3
- package/chunks/PageTitle-CrBeieoq.cjs +9 -0
- package/chunks/PageTitle-DkfAiZM4.mjs +133 -0
- package/chunks/{SplitView-DYHeCnl9.mjs → SplitView-BqS1Jbo4.mjs} +1 -1
- package/chunks/{SplitView-UKIBuvTi.cjs → SplitView-DNmd4sJe.cjs} +1 -1
- package/chunks/{Stories-Dlwle-SM.mjs → Stories-BnHxMCEZ.mjs} +3 -3
- package/chunks/{Stories-CZXv_Ves.cjs → Stories-UYVANawW.cjs} +1 -1
- package/chunks/Table-CdaMPDkg.cjs +31 -0
- package/chunks/{Table-B9OAyWAW.mjs → Table-DYSssxRS.mjs} +2761 -2679
- package/chunks/{TableCanvas-DkZAx-r9.mjs → TableCanvas-DDNRdQjN.mjs} +7074 -6977
- package/chunks/TableCanvas-DPHSYfH3.cjs +30 -0
- package/chunks/{TableGlide-CkorJrl9.mjs → TableGlide-DAnTJtye.mjs} +2295 -2231
- package/chunks/TableGlide-am_w97mF.cjs +1 -0
- package/chunks/{styles-C-1Srtr7.mjs → styles-CJ5y9FKW.mjs} +1 -1
- package/chunks/{styles-AUqEaroI.cjs → styles-kUWPuNSD.cjs} +1 -1
- package/chunks/utils-ChDQGRjv.cjs +25 -0
- package/chunks/{utils-YKicAHp0.mjs → utils-u1KJ37g3.mjs} +120 -108
- package/components/AiAgentPopover/index.cjs +1 -1
- package/components/AiAgentPopover/index.mjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetButtons/index.cjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetButtons/index.mjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetChips/index.cjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetChips/index.mjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetHeader/index.cjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetHeader/index.mjs +1 -1
- package/components/AnalyticalWidget/index.cjs +1 -1
- package/components/AnalyticalWidget/index.mjs +1 -1
- package/components/ApprovalCenter/components/index.cjs +1 -1
- package/components/ApprovalCenter/components/index.mjs +1 -1
- package/components/ApprovalCenter/index.cjs +1 -1
- package/components/ApprovalCenter/index.mjs +1 -1
- package/components/AutocompleteSearch/index.cjs +1 -1
- package/components/AutocompleteSearch/index.mjs +2 -2
- package/components/BlockGradientScroll/index.cjs +1 -1
- package/components/BlockGradientScroll/index.mjs +1 -1
- package/components/BlockTitle/BlockTitle.d.ts +1 -1
- package/components/BlockTitle/BlockTitle.types.d.ts +2 -1
- package/components/BlockTitle/index.cjs +1 -1
- package/components/BlockTitle/index.mjs +1 -1
- package/components/BlockTitle/utils/index.cjs +1 -1
- package/components/BlockTitle/utils/index.mjs +1 -1
- package/components/Collapse/index.cjs +1 -1
- package/components/Collapse/index.mjs +1 -1
- package/components/Combobox/index.cjs +1 -1
- package/components/Combobox/index.mjs +1 -1
- package/components/EmptyState/components/index.cjs +1 -1
- package/components/EmptyState/components/index.mjs +1 -1
- package/components/EmptyState/index.cjs +1 -1
- package/components/EmptyState/index.mjs +1 -1
- package/components/GridDND/index.cjs +1 -1
- package/components/GridDND/index.mjs +1 -1
- package/components/GridDND/utils/index.cjs +1 -1
- package/components/GridDND/utils/index.mjs +1 -1
- package/components/IconButton/index.cjs +1 -1
- package/components/IconButton/index.mjs +1 -1
- package/components/LeftPanel/components/index.cjs +1 -1
- package/components/LeftPanel/components/index.mjs +1 -1
- package/components/LeftPanel/hooks/index.cjs +1 -1
- package/components/LeftPanel/hooks/index.mjs +1 -1
- package/components/LeftPanel/index.cjs +1 -1
- package/components/LeftPanel/index.mjs +1 -1
- package/components/LeftPanel/styled.d.ts +1 -0
- package/components/LeftPanel/utils/index.cjs +1 -1
- package/components/LeftPanel/utils/index.mjs +1 -1
- package/components/ListOfFilters/index.cjs +1 -1
- package/components/ListOfFilters/index.mjs +1 -1
- package/components/MassActions/hooks/index.cjs +1 -1
- package/components/MassActions/hooks/index.mjs +1 -1
- package/components/MassActions/index.cjs +1 -1
- package/components/MassActions/index.mjs +1 -1
- package/components/ModalDF/index.cjs +1 -1
- package/components/ModalDF/index.mjs +1 -1
- package/components/Notification/index.cjs +1 -1
- package/components/Notification/index.mjs +2 -2
- package/components/PageTitle/PageTitle.styled.d.ts +3 -1
- package/components/PageTitle/index.cjs +1 -1
- package/components/PageTitle/index.mjs +1 -1
- package/components/PageTitle/utils/index.cjs +1 -1
- package/components/PageTitle/utils/index.mjs +1 -1
- package/components/PopoverDF/index.cjs +1 -1
- package/components/PopoverDF/index.mjs +1 -1
- package/components/PopupDF/index.cjs +1 -1
- package/components/PopupDF/index.mjs +1 -1
- package/components/SplitView/index.cjs +1 -1
- package/components/SplitView/index.mjs +1 -1
- package/components/SplitView/utils/index.cjs +1 -1
- package/components/SplitView/utils/index.mjs +1 -1
- package/components/Stories/components/StoriesBanner/index.cjs +1 -1
- package/components/Stories/components/StoriesBanner/index.mjs +1 -1
- package/components/Stories/components/StoriesContent/index.cjs +1 -1
- package/components/Stories/components/StoriesContent/index.mjs +1 -1
- package/components/Stories/components/StoriesPreview/index.cjs +1 -1
- package/components/Stories/components/StoriesPreview/index.mjs +1 -1
- package/components/Stories/components/StoriesProgress/index.cjs +1 -1
- package/components/Stories/components/StoriesProgress/index.mjs +1 -1
- package/components/Stories/components/StoriesViewer/index.cjs +1 -1
- package/components/Stories/components/StoriesViewer/index.mjs +1 -1
- package/components/Stories/index.cjs +1 -1
- package/components/Stories/index.mjs +1 -1
- package/components/Table/components/TableDropdown/index.cjs +1 -1
- package/components/Table/components/TableDropdown/index.mjs +1 -1
- package/components/Table/feature-collapse-table/index.cjs +1 -1
- package/components/Table/feature-collapse-table/index.mjs +2 -2
- package/components/Table/feature-column-control/ColumnsList/index.cjs +1 -1
- package/components/Table/feature-column-control/ColumnsList/index.mjs +2 -2
- package/components/Table/feature-column-control/index.cjs +1 -1
- package/components/Table/feature-column-control/index.mjs +3 -3
- package/components/Table/feature-columns-grouping/index.cjs +1 -1
- package/components/Table/feature-columns-grouping/index.mjs +1 -1
- package/components/Table/feature-context-menu/index.cjs +1 -1
- package/components/Table/feature-context-menu/index.mjs +1 -1
- package/components/Table/feature-edit/index.cjs +1 -1
- package/components/Table/feature-edit/index.mjs +1 -1
- package/components/Table/feature-filtering/combobox/combobox.d.ts +3 -2
- package/components/Table/feature-filtering/combobox/index.cjs +1 -1
- package/components/Table/feature-filtering/combobox/index.d.ts +4 -2
- package/components/Table/feature-filtering/combobox/index.mjs +7 -3
- package/components/Table/feature-filtering/filter-list-block/index.cjs +1 -1
- package/components/Table/feature-filtering/filter-list-block/index.mjs +1 -1
- package/components/Table/feature-filtering/header-filter-button/filter-component-in-popover.d.ts +1 -2
- package/components/Table/feature-filtering/header-filter-button/index.cjs +1 -1
- package/components/Table/feature-filtering/header-filter-button/index.mjs +1 -1
- package/components/Table/feature-filtering/index.cjs +1 -1
- package/components/Table/feature-filtering/index.d.ts +1 -1
- package/components/Table/feature-filtering/index.mjs +13 -9
- package/components/Table/feature-filtering/render-slot.d.ts +5 -0
- package/components/Table/feature-filtering/sidebar-filter-block/index.cjs +1 -1
- package/components/Table/feature-filtering/sidebar-filter-block/index.mjs +2 -2
- package/components/Table/feature-filtering/use-focus-search-input.d.ts +2 -0
- package/components/Table/feature-infinity-scroll/index.cjs +1 -1
- package/components/Table/feature-infinity-scroll/index.mjs +1 -1
- package/components/Table/feature-key-text/index.cjs +1 -1
- package/components/Table/feature-key-text/index.mjs +3 -3
- package/components/Table/feature-pagination/index.cjs +1 -1
- package/components/Table/feature-pagination/index.mjs +3 -3
- package/components/Table/feature-reorder-columns/handlers.d.ts +4 -0
- package/components/Table/feature-right-sidebar/index.cjs +1 -1
- package/components/Table/feature-right-sidebar/index.mjs +1 -1
- package/components/Table/feature-row-detail/index.cjs +1 -1
- package/components/Table/feature-row-detail/index.mjs +1 -1
- package/components/Table/feature-row-instruments/index.cjs +1 -1
- package/components/Table/feature-row-instruments/index.mjs +5 -5
- package/components/Table/feature-row-size/index.cjs +1 -1
- package/components/Table/feature-row-size/index.mjs +2 -2
- package/components/Table/feature-rows-grouping/index.cjs +1 -1
- package/components/Table/feature-rows-grouping/index.mjs +1 -1
- package/components/Table/feature-searching/index.cjs +1 -1
- package/components/Table/feature-searching/index.mjs +1 -1
- package/components/Table/feature-select-row/index.cjs +1 -1
- package/components/Table/feature-select-row/index.mjs +1 -1
- package/components/Table/feature-sorting/index.cjs +1 -1
- package/components/Table/feature-sorting/index.mjs +1 -1
- package/components/Table/feature-table-settings/index.cjs +1 -1
- package/components/Table/feature-table-settings/index.mjs +1 -1
- package/components/Table/feature-tree/index.cjs +1 -1
- package/components/Table/feature-tree/index.mjs +2 -2
- package/components/Table/index.cjs +1 -1
- package/components/Table/index.d.ts +1 -1
- package/components/Table/index.mjs +43 -39
- package/components/Table/renders/formatCell/index.cjs +1 -1
- package/components/Table/renders/formatCell/index.mjs +3 -3
- package/components/Table/styles/index.cjs +1 -1
- package/components/Table/styles/index.mjs +9 -9
- package/components/Table/table-hooks/index.cjs +1 -1
- package/components/Table/table-hooks/index.mjs +3 -3
- package/components/Table/types/column-config.type.d.ts +1 -0
- package/components/Table/types/index.cjs +1 -1
- package/components/Table/types/index.mjs +1 -1
- package/components/Table/types/table-config.type.d.ts +1 -0
- package/components/Table/utils/index.cjs +1 -1
- package/components/Table/utils/index.mjs +4 -4
- package/components/Table/widgets/control-block/index.cjs +1 -1
- package/components/Table/widgets/control-block/index.mjs +1 -1
- package/components/Table/widgets/control-block/right-side/index.cjs +1 -1
- package/components/Table/widgets/control-block/right-side/index.mjs +1 -1
- package/components/Table/widgets/index.cjs +1 -1
- package/components/Table/widgets/index.mjs +1 -1
- package/components/Table/widgets/mass-actions/index.cjs +1 -1
- package/components/Table/widgets/mass-actions/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/column/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/column/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/index.mjs +2 -2
- package/components/TableCanvas/TableGlideInstance/utils/column/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/utils/column/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/utils/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/utils/index.mjs +1 -1
- package/components/TableCanvas/components/SplitIconButton/index.cjs +1 -1
- package/components/TableCanvas/components/SplitIconButton/index.mjs +1 -1
- package/components/TableCanvas/components/TableDropdown/index.cjs +1 -1
- package/components/TableCanvas/components/TableDropdown/index.mjs +1 -1
- package/components/TableCanvas/feature-borders/buildBorderCallbacks.d.ts +16 -0
- package/components/TableCanvas/feature-borders/useBorders.d.ts +14 -0
- package/components/TableCanvas/feature-cell-transfer/index.cjs +1 -1
- package/components/TableCanvas/feature-cell-transfer/index.mjs +1 -1
- package/components/TableCanvas/feature-collapse-table/index.cjs +1 -1
- package/components/TableCanvas/feature-collapse-table/index.mjs +1 -1
- package/components/TableCanvas/feature-column-control/ColumnsList/index.cjs +1 -1
- package/components/TableCanvas/feature-column-control/ColumnsList/index.mjs +1 -1
- package/components/TableCanvas/feature-column-control/index.cjs +1 -1
- package/components/TableCanvas/feature-column-control/index.mjs +1 -1
- package/components/TableCanvas/feature-columns-grouping/index.cjs +1 -1
- package/components/TableCanvas/feature-columns-grouping/index.mjs +1 -1
- package/components/TableCanvas/feature-columns-grouping/useLastLvlColumnConfig.d.ts +1 -0
- package/components/TableCanvas/feature-content-state/index.cjs +1 -1
- package/components/TableCanvas/feature-content-state/index.mjs +1 -1
- package/components/TableCanvas/feature-context-menu/index.cjs +1 -1
- package/components/TableCanvas/feature-context-menu/index.mjs +1 -1
- package/components/TableCanvas/feature-edit/index.cjs +1 -1
- package/components/TableCanvas/feature-edit/index.mjs +1 -1
- package/components/TableCanvas/feature-filtering/combobox/combobox.d.ts +3 -2
- package/components/TableCanvas/feature-filtering/combobox/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/combobox/index.d.ts +4 -2
- package/components/TableCanvas/feature-filtering/combobox/index.mjs +7 -3
- package/components/TableCanvas/feature-filtering/filter-list-block/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/filter-list-block/index.mjs +2 -2
- package/components/TableCanvas/feature-filtering/header-filter-button/filter-component-in-popover.d.ts +1 -2
- package/components/TableCanvas/feature-filtering/header-filter-button/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/header-filter-button/index.mjs +2 -2
- package/components/TableCanvas/feature-filtering/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/index.d.ts +1 -1
- package/components/TableCanvas/feature-filtering/index.mjs +12 -8
- package/components/TableCanvas/feature-filtering/render-slot.d.ts +5 -0
- package/components/TableCanvas/feature-filtering/sidebar-filter-block/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/sidebar-filter-block/index.mjs +1 -1
- package/components/TableCanvas/feature-infinity-scroll/index.cjs +1 -1
- package/components/TableCanvas/feature-infinity-scroll/index.mjs +3 -3
- package/components/TableCanvas/feature-key-text/index.cjs +1 -1
- package/components/TableCanvas/feature-key-text/index.mjs +1 -1
- package/components/TableCanvas/feature-notifications/index.cjs +1 -1
- package/components/TableCanvas/feature-notifications/index.mjs +1 -1
- package/components/TableCanvas/feature-pagination/index.cjs +1 -1
- package/components/TableCanvas/feature-pagination/index.mjs +2 -2
- package/components/TableCanvas/feature-popover-table/context/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/context/index.mjs +1 -1
- package/components/TableCanvas/feature-popover-table/hooks/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/hooks/index.mjs +1 -1
- package/components/TableCanvas/feature-popover-table/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/index.mjs +6 -6
- package/components/TableCanvas/feature-popover-table/utils/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/utils/index.mjs +1 -1
- package/components/TableCanvas/feature-reorder-columns/handlers.d.ts +4 -0
- package/components/TableCanvas/feature-right-sidebar/index.cjs +1 -1
- package/components/TableCanvas/feature-right-sidebar/index.mjs +1 -1
- package/components/TableCanvas/feature-row-detail/index.cjs +1 -1
- package/components/TableCanvas/feature-row-detail/index.mjs +1 -1
- package/components/TableCanvas/feature-row-instruments/index.cjs +1 -1
- package/components/TableCanvas/feature-row-instruments/index.mjs +1 -1
- package/components/TableCanvas/feature-row-markers/index.cjs +1 -1
- package/components/TableCanvas/feature-row-markers/index.mjs +1 -1
- package/components/TableCanvas/feature-row-size/index.cjs +1 -1
- package/components/TableCanvas/feature-row-size/index.mjs +3 -3
- package/components/TableCanvas/feature-rows-grouping/index.cjs +1 -1
- package/components/TableCanvas/feature-rows-grouping/index.mjs +1 -1
- package/components/TableCanvas/feature-searching/index.cjs +1 -1
- package/components/TableCanvas/feature-searching/index.mjs +1 -1
- package/components/TableCanvas/feature-select-row/index.cjs +1 -1
- package/components/TableCanvas/feature-select-row/index.mjs +1 -1
- package/components/TableCanvas/feature-sorting/index.cjs +1 -1
- package/components/TableCanvas/feature-sorting/index.mjs +1 -1
- package/components/TableCanvas/feature-table-settings/index.cjs +1 -1
- package/components/TableCanvas/feature-table-settings/index.mjs +1 -1
- package/components/TableCanvas/feature-tooltip/index.cjs +1 -1
- package/components/TableCanvas/feature-tooltip/index.mjs +2 -2
- package/components/TableCanvas/feature-tooltip/utils/index.cjs +1 -1
- package/components/TableCanvas/feature-tooltip/utils/index.mjs +6 -6
- package/components/TableCanvas/feature-tree/handlers.d.ts +1 -0
- package/components/TableCanvas/feature-tree/index.cjs +1 -1
- package/components/TableCanvas/feature-tree/index.mjs +1 -1
- package/components/TableCanvas/index.cjs +1 -1
- package/components/TableCanvas/index.d.ts +1 -1
- package/components/TableCanvas/index.mjs +63 -59
- package/components/TableCanvas/renders/formatCell/index.cjs +1 -1
- package/components/TableCanvas/renders/formatCell/index.mjs +1 -1
- package/components/TableCanvas/styles/index.cjs +1 -1
- package/components/TableCanvas/styles/index.mjs +1 -1
- package/components/TableCanvas/table-hooks/index.cjs +1 -1
- package/components/TableCanvas/table-hooks/index.mjs +12 -12
- package/components/TableCanvas/types/column-config.type.d.ts +1 -0
- package/components/TableCanvas/types/index.cjs +1 -1
- package/components/TableCanvas/types/index.mjs +2 -2
- package/components/TableCanvas/types/table-config.type.d.ts +28 -0
- package/components/TableCanvas/utils/index.cjs +1 -1
- package/components/TableCanvas/utils/index.mjs +2 -2
- package/components/TableCanvas/widgets/control-block/compression/index.cjs +1 -1
- package/components/TableCanvas/widgets/control-block/compression/index.mjs +2 -2
- package/components/TableCanvas/widgets/control-block/index.cjs +1 -1
- package/components/TableCanvas/widgets/control-block/index.mjs +3 -3
- package/components/TableCanvas/widgets/control-block/right-side/index.cjs +1 -1
- package/components/TableCanvas/widgets/control-block/right-side/index.mjs +1 -1
- package/components/TableCanvas/widgets/index.cjs +1 -1
- package/components/TableCanvas/widgets/index.mjs +5 -5
- package/components/TableCanvas/widgets/mass-actions/hooks/index.cjs +1 -1
- package/components/TableCanvas/widgets/mass-actions/hooks/index.mjs +8 -8
- package/components/TableCanvas/widgets/mass-actions/index.cjs +1 -1
- package/components/TableCanvas/widgets/mass-actions/index.mjs +1 -1
- package/components/TableContract/index.cjs +1 -1
- package/components/TableContract/index.mjs +2 -2
- package/components/TableGlide/hooks/selection/index.cjs +1 -1
- package/components/TableGlide/hooks/selection/index.d.ts +1 -2
- package/components/TableGlide/hooks/selection/index.mjs +6 -7
- package/components/TableGlide/hooks/selection/useColoringLayers.d.ts +25 -0
- package/components/TableGlide/hooks/useHoverState.d.ts +18 -0
- package/components/TableGlide/index.cjs +1 -1
- package/components/TableGlide/index.mjs +9 -9
- package/components/TableGlide/lib/canvas/cells/buttons/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/buttons/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/cells/iconSprites/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/iconSprites/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/cells/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/cells/renderer/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/renderer/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/core/helpers/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/core/helpers/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/core/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/core/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/hooks/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/hooks/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/miniflex/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/miniflex/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/primitives/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/primitives/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/utils/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/utils/index.mjs +1 -1
- package/components/TableGlide/theming/custom-colors.d.ts +1 -1
- package/components/TableGlide/theming/index.cjs +1 -1
- package/components/TableGlide/theming/index.mjs +3 -3
- package/components/TableGlide/types.d.ts +1 -3
- package/components/TableTabs/index.cjs +1 -1
- package/components/TableTabs/index.mjs +1 -1
- package/components/Tooltip/index.cjs +1 -1
- package/components/Tooltip/index.mjs +1 -1
- package/components/TourWidget/index.cjs +1 -1
- package/components/TourWidget/index.mjs +2 -2
- package/components/Typography/index.cjs +1 -1
- package/components/Typography/index.mjs +1 -1
- package/components/Widget/index.cjs +1 -1
- package/components/Widget/index.mjs +2 -2
- package/formComponents/FormCombobox/index.cjs +1 -1
- package/formComponents/FormCombobox/index.mjs +1 -1
- package/formComponents/FormRadioGroupBox/index.cjs +1 -1
- package/formComponents/FormRadioGroupBox/index.mjs +1 -1
- package/formComponents/FormSegments/index.cjs +1 -1
- package/formComponents/FormSegments/index.mjs +1 -1
- package/formComponents/FormSwitch/index.cjs +1 -1
- package/formComponents/FormSwitch/index.mjs +1 -1
- package/index.cjs +1 -1
- package/index.mjs +1778 -1773
- package/layouts/Container/index.cjs +1 -1
- package/layouts/Container/index.mjs +1 -1
- package/layouts/Container/lib/utils/index.cjs +1 -1
- package/layouts/Container/lib/utils/index.mjs +1 -1
- package/layouts/ErrorPage/index.cjs +1 -1
- package/layouts/ErrorPage/index.mjs +1 -1
- package/layouts/FiltersActions/hooks/index.cjs +1 -1
- package/layouts/FiltersActions/hooks/index.mjs +1 -1
- package/layouts/FiltersActions/index.cjs +1 -1
- package/layouts/FiltersActions/index.mjs +1 -1
- package/layouts/Layout/index.cjs +1 -1
- package/layouts/Layout/index.mjs +1 -1
- package/layouts/PageLayout/index.cjs +1 -1
- package/layouts/PageLayout/index.mjs +1 -1
- package/mcp-data/component-index.json +1208 -523
- package/mixins/index.cjs +1 -1
- package/mixins/index.mjs +1 -1
- package/package.json +6 -6
- package/styles/index.cjs +1 -1
- package/styles/index.mjs +1 -1
- package/utils/breakpoint/index.cjs +1 -1
- package/utils/breakpoint/index.mjs +1 -1
- package/utils/clickStream/index.cjs +1 -1
- package/utils/clickStream/index.mjs +1 -1
- package/utils/eventBus/index.cjs +1 -1
- package/utils/eventBus/index.mjs +1 -1
- package/utils/hooks/index.cjs +1 -1
- package/utils/hooks/index.mjs +1 -1
- package/utils/index.cjs +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.mjs +30 -29
- package/utils/react/getMFReactDOMClient.d.ts +7 -0
- package/utils/react/index.cjs +1 -0
- package/utils/react/index.d.ts +1 -0
- package/utils/react/index.mjs +4 -0
- package/utils/styles/index.cjs +1 -1
- package/utils/styles/index.mjs +1 -1
- package/chunks/AnalyticalWidget-wke3Jm3X.cjs +0 -43
- package/chunks/BlockTitle-BEIxiECX.cjs +0 -1
- package/chunks/BlockTitle-BZxOEdTc.mjs +0 -85
- package/chunks/LeftPanel-B3-ySDMW.cjs +0 -1
- package/chunks/PageTitle-Bh3g6FUT.cjs +0 -1
- package/chunks/PageTitle-CaqXfrrQ.mjs +0 -123
- package/chunks/Table-BwhzcFX1.cjs +0 -31
- package/chunks/TableCanvas-QmXGAjPk.cjs +0 -30
- package/chunks/TableGlide-Bngn5_5l.cjs +0 -1
- package/chunks/utils-CUW5bd8S.cjs +0 -25
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const B=require("@glideappsfinal/glide-data-grid"),Ai=require("@salutejs/sdds-themes/tokens/sdds_finai"),ac=require("canvas-hypertxt"),m=require("react"),lc=require("react-dom/server"),xt=require("react/jsx-runtime");require("@glideappsfinal/glide-data-grid/dist/index.css");const te=require("./utils-CUW5bd8S.cjs"),$e=require("react-dom"),ke=require("../components/TableCanvasSharedConstants/index.cjs"),Mo=require("styled-components"),J={small:{rowHeight:20,cellVerticalPadding:4,cellHorizontalPadding:4,textfieldSize:"xs"},medium:{rowHeight:32,cellVerticalPadding:7,cellHorizontalPadding:6,textfieldSize:"s"},big:{rowHeight:48,cellVerticalPadding:12,cellHorizontalPadding:16,textfieldSize:"s"}},Ue=r=>J[r].rowHeight,Ei=r=>J[r].textfieldSize,zo={small:J.small.rowHeight,medium:J.medium.rowHeight,big:J.big.rowHeight},uc={kind:B.GridCellKind.Text,data:"",displayData:"",allowOverlay:!0,readonly:!0},Oo={big:{cellVerticalPadding:J.big.cellVerticalPadding,cellHorizontalPadding:J.big.cellHorizontalPadding,textfieldSize:J.big.textfieldSize},medium:{cellVerticalPadding:J.medium.cellVerticalPadding,cellHorizontalPadding:J.medium.cellHorizontalPadding,textfieldSize:J.medium.textfieldSize},small:{cellVerticalPadding:J.small.cellVerticalPadding,cellHorizontalPadding:J.small.cellHorizontalPadding,textfieldSize:J.small.textfieldSize}},Ti={"padding-block":"0px","padding-inline":"0px"},Yt=r=>`${r}px`,hc={small:{rowHeight:Ue("small"),cell:{"padding-block":Yt(J.small.cellVerticalPadding),"padding-inline":Yt(J.small.cellHorizontalPadding)},editorCell:Ti,input:Ei("small"),icon:"xs",combobox:"s",checkboxOfCombobox:"s",switch:"s",font:()=>Ai.bodyXXS},medium:{rowHeight:Ue("medium"),cell:{"padding-block":Yt(J.medium.cellVerticalPadding),"padding-inline":Yt(J.medium.cellHorizontalPadding)},editorCell:Ti,input:Ei("medium"),icon:"s",combobox:"m",checkboxOfCombobox:"m",switch:"s",font:()=>Ai.bodyS},big:{rowHeight:Ue("big"),cell:{"padding-block":Yt(J.big.cellVerticalPadding),"padding-inline":Yt(J.big.cellHorizontalPadding)},editorCell:Ti,input:Ei("big"),icon:"m",combobox:"l",checkboxOfCombobox:"l",switch:"l",font:()=>Ai.bodyM}},qe=33,dc={bodyM:{"font-size":"1rem","font-weight":400,"line-height":"1.25rem","bold-font-size":"1rem","bold-font-weight":600,"bold-line-height":"1.25rem"},bodyS:{"font-size":"0.875rem","font-weight":400,"line-height":"1.125rem","bold-font-size":"0.875rem","bold-font-weight":600,"bold-line-height":"1.125rem"},bodyXS:{"font-size":"0.75rem","font-weight":400,"line-height":"0.875rem","bold-font-size":"0.75rem","bold-font-weight":600,"bold-line-height":"0.875rem"},bodyXXS:{"font-size":"0.625rem","font-weight":400,"line-height":"0.75rem","bold-font-size":"0.625rem","bold-font-weight":600,"bold-line-height":"0.75rem"}},fc=16;function eo(r,t=fc){const e=parseFloat(r);return Number.isFinite(e)?r.endsWith("rem")?e*t:e:0}const gc=(r,t=!1)=>{const e=t?r["bold-font-weight"]:r["font-weight"],i=t?r["bold-font-size"]:r["font-size"],o=t?r["bold-line-height"]:r["line-height"];return`${e} normal ${i}/${o}`},Cc=(r,t=!1)=>{const e=t?r["bold-font-size"]:r["font-size"],i=t?r["bold-line-height"]:r["line-height"];return{fontSize:eo(e),lineHeightPx:eo(i)}},No=r=>Object.entries(dc).reduce((t,[e,i])=>{const o=e;return t.push([o,r(i)],[`${o}Bold`,r(i,!0)]),t},[]),Ke=Object.fromEntries(No(gc)),Wo=Object.fromEntries(No(Cc)),vc={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto",width:void 0,height:void 0,crossAxisSizing:"auto"},mc={top:0,right:0,bottom:0,left:0};class Go{constructor(t=vc){this.size={width:0,height:0},this.position={x:0,y:0},this.style={flexGrow:t.flexGrow??0,flexShrink:t.flexShrink??1,flexBasis:t.flexBasis??0,alignSelf:t.alignSelf??"auto",width:t.width,height:t.height,crossAxisSizing:t.crossAxisSizing??"auto",id:t.id,metadata:t.metadata},this.id=t.id,this.metadata=t.metadata}}class $o extends Go{build(){}}class Et extends Go{constructor(t,e,i={}){super({}),this.children=[],this.direction="row",this.wrap="nowrap",this.columnGap=0,this.rowGap=0,this.justifyContent="flex-start",this.alignItems="stretch",this.alignContent="stretch",this.padding={top:0,right:0,bottom:0,left:0},this.size.width=t,this.size.height=e,this.id=i.id,i.direction!==void 0&&(this.direction=i.direction),i.wrap!==void 0&&(this.wrap=i.wrap),i.columnGap!==void 0&&(this.columnGap=i.columnGap),i.rowGap!==void 0&&(this.rowGap=i.rowGap),i.justifyContent!==void 0&&(this.justifyContent=i.justifyContent),i.alignItems!==void 0&&(this.alignItems=i.alignItems),i.alignContent!==void 0&&(this.alignContent=i.alignContent),this.padding=Uo(i.padding)}addChild(t,e){if(t instanceof Et){const o=t;if(e){const n=o.style;n.flexGrow=e.flexGrow??0,n.flexShrink=e.flexShrink??1,n.flexBasis=e.flexBasis??0,n.alignSelf=e.alignSelf??"auto",n.width=e.width,n.height=e.height,n.crossAxisSizing=e.crossAxisSizing??"auto"}return this.children.push(o),o}const i=new $o(t);return this.children.push(i),i}getContainerMetrics(){const t=this.direction==="row"||this.direction==="row-reverse",{left:e,right:i,top:o,bottom:n}=this.padding,{width:s,height:c}=this.size;return t?{main:s-e-i,cross:c-o-n,mainGap:this.columnGap,crossGap:this.rowGap}:{main:c-o-n,cross:s-e-i,mainGap:this.rowGap,crossGap:this.columnGap}}buildFlexLines(t,e){if(this.wrap==="nowrap")return[t];const i=[];let o=[],n=0;for(const s of t){const c=s.style.flexBasis,a=o.length>0?e.mainGap:0;o.length>0&&n+a+c>e.main&&(i.push(o),o=[],n=0),o.push(s),n+=(o.length>1?e.mainGap:0)+c}return o.length>0&&i.push(o),this.wrap==="wrap-reverse"&&i.reverse(),i}measureLineCrossSizes(t,e){const i=[];for(const o of t){let n=0;for(const s of o){if(this.isDeferredCrossAxisPercentChild(s,e))continue;const c=e?s.style.height:s.style.width,a=c!==void 0?c:e?s.size.height:s.size.width;a>n&&(n=a)}i.push(n)}return i}isDeferredCrossAxisPercentChild(t,e){const i=e?t.style.height:t.style.width;return(t.style.alignSelf!=="auto"?t.style.alignSelf:this.alignItems)==="stretch"&&i===void 0&&t.style.crossAxisSizing==="deferred-percent-stretch"}resolveCrossAxisLayout(t,e){const i=t.length,o=t.reduce((u,d)=>u+d,0),n=e.crossGap*(i>1?i-1:0),s=e.cross-o-n;let c=0,a=e.crossGap;if(this.wrap==="nowrap"&&i===1)t[0]=e.cross;else if(this.wrap!=="nowrap"){const{crossStart:u,crossBetween:d}=this.calculateAlignContent(s,i,e.crossGap);if(c=u,a=d,this.alignContent==="stretch"&&s>0){const l=s/i;for(let h=0;h<i;h++)t[h]+=l}}return{crossStart:c,crossBetween:a}}calculateAlignContent(t,e,i){let o=0,n=i;switch(this.alignContent){case"flex-end":o=t;break;case"center":o=t/2;break;case"space-between":n=e>1?i+t/(e-1):0;break;case"space-around":n=i+t/e,o=n/2;break;case"space-evenly":n=i+t/(e+1),o=n;break}return{crossStart:o,crossBetween:n}}distributeMainAxisSizes(t,e,i){let o=0,n=0,s=0;for(const d of t){const l=d.style.flexBasis;o+=l,n+=d.style.flexGrow,s+=d.style.flexShrink*l}const c=t.length>1?e.mainGap*(t.length-1):0,a=e.main-o-c;let u=0;for(const d of t){const{style:l}=d;let h=l.flexBasis;a>0&&n>0?h+=a*l.flexGrow/n:a<0&&s>0&&(h+=a*l.flexShrink*h/s),h<0&&(h=0),i?d.size.width=h:d.size.height=h,u+=h}return{lineMainUsed:u,totalGrow:n}}calculateJustifySpacing(t,e,i,o){let n=0,s=i.mainGap;if(o===0){const c=t>1?i.mainGap*(t-1):0;let a=i.main-e-c;switch(a<0&&(a=0),this.justifyContent){case"flex-end":n=a;break;case"center":n=a/2;break;case"space-between":s=t>1?i.mainGap+a/(t-1):0;break;case"space-around":s=i.mainGap+a/t,n=s/2;break;case"space-evenly":s=i.mainGap+a/(t+1),n=s;break}}return{leading:n,between:s}}getFinalLineHeight(t,e,i){if(this.wrap!=="nowrap")return e;let o=e;for(const n of t){if(this.isDeferredCrossAxisPercentChild(n,i))continue;const s=i?n.style.height:n.style.width,c=s!==void 0?s:i?n.size.height:n.size.width;c>o&&(o=c)}return o}getCrossSize(t,e,i){const o=i?t.style.height:t.style.width,n=t.style.alignSelf!=="auto"?t.style.alignSelf:this.alignItems;return o!==void 0?(i?t.size.height=o:t.size.width=o,o):n==="stretch"?(i?t.size.height=e:t.size.width=e,e):i?t.size.height:t.size.width}positionChildren(t,e,i,o,n,s,c,a,u){const d=this.direction==="row-reverse"||this.direction==="column-reverse",l=d?t.length-1:0,h=d?-1:t.length,f=d?-1:1;let g=n;for(let C=l;C!==h;C+=f){const v=t[C];if(v!==void 0){const b=v.style,y=v.size,S=v.position;if(i){const I=this.direction==="row"?g:e.main-g-y.width;S.x=c+I}else{const I=this.direction==="column"?g:e.main-g-y.height;S.y=a+I}const x=b.alignSelf!=="auto"?b.alignSelf:this.alignItems,A=this.getCrossSize(v,o,i);let F=0;x==="flex-end"?F=o-A:x==="center"&&(F=(o-A)*.5),i?(S.y=a+u+F,g+=y.width+s):(S.x=c+u+F,g+=y.height+s)}}}build(){const{children:t}=this;if(t.length===0)return;const e=this.direction==="row"||this.direction==="row-reverse",i=this.getContainerMetrics(),o=this.buildFlexLines(t,i);if(o.length===0)return;const n=this.measureLineCrossSizes(o,e),{crossStart:s,crossBetween:c}=this.resolveCrossAxisLayout(n,i),a=this.padding.left,u=this.padding.top;let d=s;for(let l=0;l<o.length;l++){const h=o[l];if(h===void 0||h.length===0)continue;const{lineMainUsed:f,totalGrow:g}=this.distributeMainAxisSizes(h,i,e),{leading:C,between:v}=this.calculateJustifySpacing(h.length,f,i,g),b=this.getFinalLineHeight(h,n[l],e);this.positionChildren(h,i,e,b,C,v,a,u,d),d+=b+c}for(const l of t)l instanceof Et&&l.build()}}function Uo(r){return r===void 0?mc:typeof r=="number"?{top:r,right:r,bottom:r,left:r}:{top:r.top??0,right:r.right??0,bottom:r.bottom??0,left:r.left??0}}class nr extends Et{constructor(t,e,i={}){super(t,e,i)}getLayout(){this.build();const t={};return this._collectLayout(this,t,{counter:0}),t}_collectLayout(t,e,i){for(const o of t.children){const n=o.id??`_$$${i.counter++}`;e[n]={position:o.position,size:o.size},o instanceof Et&&this._collectLayout(o,e,i)}}}const ue={direction:"row",columnGap:0,rowGap:0,justifyContent:"flex-start",alignItems:"stretch"};function Xo(r){const t=r;return{id:r.id,direction:t.direction??ue.direction,columnGap:t.columnGap??ue.columnGap,rowGap:t.rowGap??ue.rowGap,justifyContent:t.justifyContent??ue.justifyContent,alignItems:t.alignItems??ue.alignItems}}function Vo(r,t){if(t!=null&&t.length)for(const e of t)if(e.children&&e.children.length>0){const i=new Et(e.width??0,e.height??0,Xo(e));r.addChild(i,e),Vo(i,e.children)}else r.addChild(e)}const pc=r=>{const t=r.width??0,e=r.height??0,i=Xo(r),o=new nr(t,e,i);return Vo(o,r.children),o.getLayout()},ii=class ii{constructor(t){this.debugColor="magenta",this.parent=null,this.children=[],this.rect={x:0,y:0,width:0,height:0},this.zIndex=0,this._intrinsicWidth=0,this._intrinsicHeight=0,this._layoutDirty=!0,this._measureDirty=!0,this._style={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto"},this._position="static",this.backgroundColor="transparent",this.borderColor="transparent",this.borderWidth=0,this.portalHoverEnabled=!1,this.id=t}get style(){return this._style}set style(t){this._style=t,this.markLayoutDirty()}get position(){return this._position}set position(t){this._position!==t&&(this._position=t,this.markLayoutDirty())}get left(){return this._left}set left(t){this._left!==t&&(this._left=t,this.markLayoutDirty())}get top(){return this._top}set top(t){this._top!==t&&(this._top=t,this.markLayoutDirty())}get right(){return this._right}set right(t){this._right!==t&&(this._right=t,this.markLayoutDirty())}get bottom(){return this._bottom}set bottom(t){this._bottom!==t&&(this._bottom=t,this.markLayoutDirty())}isAbsolute(){return this._position==="absolute"}isPositioningContext(){return this._position!=="static"}markLayoutDirty(){var t;this._layoutDirty||(this._layoutDirty=!0,(t=this.parent)==null||t.markLayoutDirty())}markMeasureDirty(){this._measureDirty||(this._measureDirty=!0,this.markLayoutDirty())}isLayoutDirty(){return this._layoutDirty}isMeasureDirty(){return this._measureDirty}clearLayoutDirty(){this._layoutDirty=!1}clearMeasureDirty(){this._measureDirty=!1}addChild(t){this.attachChild(t,(e,i)=>e.push(i))}addChildStart(t){this.attachChild(t,(e,i)=>e.unshift(i))}removeChild(t){const e=this.children.indexOf(t);e!==-1&&(this.children.splice(e,1),t.parent=null,this.markLayoutDirty())}getTooltip(){return this.tooltip}paint(t,e){const i=t.getZIndex();t.setZIndex(i+this.zIndex),this.onPaint(t,e),ii.DEBUG&&t.strokeRect(this.rect.x,this.rect.y,this.rect.width,this.rect.height,this.debugColor,1),t.setZIndex(i)}hitTest(t,e){const i=[];return this.collectHitCandidates(t,e,0,{value:0},i),i.sort((o,n)=>n.cumulativeZIndex-o.cumulativeZIndex||n.order-o.order),i.map(({node:o})=>o)}requestLayout(){this.parent&&this.parent.requestLayout()}requestPaint(){this.parent&&this.parent.requestPaint()}onClick(t){}onMouseDown(t){}onMouseUp(t){}onMouseEnter(t){}onMouseLeave(t){}onMouseMove(t){}onDoubleClick(t){}attachChild(t,e){t.parent=this,e(this.children,t),this.markLayoutDirty()}collectHitCandidates(t,e,i,o,n){if(!this.containsHitPoint(t,e))return;const s=i+this.zIndex;n.push({node:this,cumulativeZIndex:s,order:o.value}),o.value+=1;for(const c of this.children)c.collectHitCandidates(t,e,s,o,n)}containsHitPoint(t,e){return t>=this.rect.x&&t<=this.rect.x+this.rect.width&&e>=this.rect.y&&e<=this.rect.y+this.rect.height}};ii.DEBUG=!1;let Mt=ii;class Yo{constructor(){this.defaultFlexStyle={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto",width:void 0,height:void 0,crossAxisSizing:"auto"}}build(t,e,i){const o=i??t.children.filter(a=>!a.isAbsolute()),n=o.length,s=e.direction,c=s==="row"||s==="row-reverse";for(let a=0;a<n;a+=1){const u=o[a],d=u.style,l=this.extractChildFlexProperties(u,d);this.handlePercentageDimensions(l,d.width,d.height,c,u.rect),this.defaultFlexStyle.flexGrow=l.flexGrow,this.defaultFlexStyle.flexShrink=l.flexShrink,this.defaultFlexStyle.flexBasis=l.flexBasis,this.defaultFlexStyle.alignSelf=l.alignSelf,this.defaultFlexStyle.width=l.width,this.defaultFlexStyle.height=l.height,this.defaultFlexStyle.crossAxisSizing=l.crossAxisSizing,this.isContainer(u)?this.addContainerChild(u,e):this.addLeafChild(u,e)}}extractChildFlexProperties(t,e){const i=e.flexGrow??0,o=e.flexShrink??1,n=e.flexBasis??0;return{width:typeof e.width=="number"?e.width:void 0,height:typeof e.height=="number"?e.height:void 0,flexGrow:i,flexShrink:o,flexBasis:n,alignSelf:e.alignSelf??"auto",crossAxisSizing:"auto"}}handlePercentageDimensions(t,e,i,o,n){e==="100%"&&(o?(t.width=void 0,t.flexGrow===0&&(t.flexGrow=1)):(t.width=void 0,t.alignSelf="stretch",t.crossAxisSizing="deferred-percent-stretch")),i==="100%"&&(o?(t.height=void 0,t.alignSelf="stretch",t.crossAxisSizing="deferred-percent-stretch"):(t.height=void 0,t.flexGrow===0&&(t.flexGrow=1))),t.flexBasis===0&&(t.flexBasis=o?n.width:n.height)}isContainer(t){return"flexOptions"in t}addContainerChild(t,e){const i=new Et(0,0,t.flexOptions);i.size.width=t.rect.width,i.size.height=t.rect.height,e.addChild(i,this.defaultFlexStyle),this.build(t,i)}addLeafChild(t,e){const i=e.addChild(this.defaultFlexStyle);i.size.width=t.rect.width,i.size.height=t.rect.height}}const Me=.5;class qo{constructor(t){this.positionResolver=t}reconcile(t,e,i,o,n,s=!1){let c=!1;const{parent:a}=e,u=a!==null?a.rect:n;c=this.updateNodePosition(e,i,u??e.rect);const d=o??e.children.filter(h=>!h.isAbsolute()),l=d.length>0;if(l&&i instanceof Et){const h=this.reconcileChildLayouts(t,d,i,n);if(c=c||h,this.isContainer(e)&&!s){const f=this.updateContainerFromContent(e,i);c=c||f}}else if(!l){const h=this.remeasureAndUpdateLeaf(t,e,i);c=c||h}return this.positionNestedAbsoluteChildren(t,e),c}updateNodePosition(t,e,i){const o=t.rect,n=e.position,s=e.size;o.x=i.x+n.x,o.y=i.y+n.y;const c=o.width!==s.width,a=o.height!==s.height;return o.width=s.width,o.height=s.height,c||a}reconcileChildLayouts(t,e,i,o){let n=!1;const s=i.children,c=e.length;for(let a=0;a<c;a+=1){const u=this.reconcile(t,e[a],s[a],void 0,o);n=n||u}return n}updateContainerFromContent(t,e){const i=this.getContainerCachedIsRow(t),o=this.getContainerCachedPadding(t),n=e.children,s=n.length;let c=0;if(i){for(let h=0;h<s;h+=1){const f=n[h],g=f.position.y+f.size.height;g>c&&(c=g)}const a=c>0?c+o.bottom:0,u=t.style.height;if(u==="100%")return!1;const d=typeof u=="number"?u:0,l=a>d?a:d;if(l>t.rect.height+Me)return t.rect.height=l,this.syncFlexNodeSizeFromRect(t,e,!1,!0),!0}else{let a=0;for(let v=0;v<s;v+=1){const b=n[v],y=b.position.x+b.size.width,S=b.position.y+b.size.height;y>c&&(c=y),S>a&&(a=S)}const u=c>0?c+o.right:0,d=t.style.width;let l=!1,h=!1,f=!1;if(d!=="100%"){const v=typeof d=="number"?d:0,b=u>v?u:v;b>t.rect.width+Me&&(t.rect.width=b,l=!0,h=!0)}const g=a>0?a+o.bottom:0,C=t.style.height;if(C!=="100%"){const v=typeof C=="number"?C:0,b=g>v?g:v;b>t.rect.height+Me&&(t.rect.height=b,l=!0,f=!0)}return l&&this.syncFlexNodeSizeFromRect(t,e,h,f),l}return!1}syncFlexNodeSizeFromRect(t,e,i,o){i&&(e.size.width=t.rect.width),o&&(e.size.height=t.rect.height),this.syncAutoMainAxisFlexBasis(t,e,i,o)}syncAutoMainAxisFlexBasis(t,e,i,o){const n=t.parent;if(n===null||!this.isContainer(n)||t.style.flexBasis!==void 0&&t.style.flexBasis!==0)return;const s=this.getContainerCachedIsRow(n);s&&i?e.style.flexBasis=t.rect.width:!s&&o&&(e.style.flexBasis=t.rect.height)}remeasureAndUpdateLeaf(t,e,i){const o=e.rect.height,n=e.rect.width;e.measure(t),e.rect.width=n;const s=e.rect.height-o;return Math.abs(s)>Me?(this.syncFlexNodeSizeFromRect(e,i,!1,!0),!0):!1}positionNestedAbsoluteChildren(t,e){if(!this.isContainer(e)||!e.isPositioningContext())return;const i=e,n=i.children.filter(c=>c.isAbsolute());if(n.length===0)return;const s=this.getContainerCachedPadding(i);this.positionResolver.positionAbsoluteChildren(i.rect,s,n,c=>c.measure(t),c=>this.layoutAbsoluteChildSubtree(t,c))}layoutAbsoluteChildSubtree(t,e){if(!this.isContainer(e))return;const i=e.parent;e.parent=null;try{e.performLayout(t,!0)}finally{e.parent=i}}isContainer(t){return"flexOptions"in t}getContainerCachedIsRow(t){return t.cachedIsRow??!0}getContainerCachedPadding(t){return t.cachedPadding??{top:0,right:0,bottom:0,left:0}}}class wt{static resolvePositionValue(t,e){if(t!==void 0){if(typeof t=="number")return t;if(typeof t=="string"&&t.endsWith("%"))return parseFloat(t)/100*e}}static applyAxisPositioning(t,e,i,o,n){const s=n?e.x:e.y,c=s+(n?e.width:e.height),a=n?e.width:e.height;if(i!==void 0&&o!==void 0){const u=Math.max(0,a-i-o);n?(t.x=s+i,t.width=u):(t.y=s+i,t.height=u)}else i!==void 0&&(n?t.x=s+i:t.y=s+i);o!==void 0&&i===void 0?n?t.x=c-t.width-o:t.y=c-t.height-o:o===void 0&&i===void 0&&(n?t.x=s:t.y=s)}applyAbsolutePositioning(t,e){const i=wt.resolvePositionValue(t.left,e.width),o=wt.resolvePositionValue(t.right,e.width),n=wt.resolvePositionValue(t.top,e.height),s=wt.resolvePositionValue(t.bottom,e.height),c=t.rect;wt.applyAxisPositioning(c,e,i,o,!0),wt.applyAxisPositioning(c,e,n,s,!1)}positionAbsoluteChildren(t,e,i,o,n){const s={x:t.x+e.left,y:t.y+e.top,width:t.width-e.left-e.right,height:t.height-e.top-e.bottom};for(const c of i)o(c),this.applyAbsolutePositioning(c,s),n==null||n(c)}}class ri{constructor(){this.width=0,this.height=0,this.maxCrossSize=0,this.childCount=0,this.isRow=!0}reset(){this.width=0,this.height=0,this.maxCrossSize=0,this.childCount=0,this.isRow=!0}accumulate(t,e){this.isRow=e,e?(this.width+=t.width,this.maxCrossSize=Math.max(this.maxCrossSize,t.height)):(this.height+=t.height,this.maxCrossSize=Math.max(this.maxCrossSize,t.width)),this.childCount+=1}addGap(t,e){if(this.childCount>1){const i=t*(this.childCount-1);e?this.width+=i:this.height+=i}}getSize(){return this.isRow?{width:this.width,height:this.maxCrossSize}:{width:this.maxCrossSize,height:this.height}}static computeIntrinsicSize(t,e,i){const o=new ri;for(const n of t)o.accumulate(n,e);return o.addGap(i,e),o.getSize()}}const yc=3,Ko={top:0,right:0,bottom:0,left:0},Fc=r=>r===void 0||r==="row"||r==="row-reverse",Zo=r=>r===void 0?Ko:typeof r=="number"?{top:r,right:r,bottom:r,left:r}:{top:r.top??0,right:r.right??0,bottom:r.bottom??0,left:r.left??0};class Ct extends Mt{constructor(t,e={},i="transparent"){super(t),this.cachedPadding=Ko,this.cachedIsRow=!0,this.cachedGap=0,this.optionsCacheValid=!1,this.flexOptionsValue=e,this.positionResolver=new wt,this.flexTreeBuilder=new Yo,this.layoutReconciler=new qo(this.positionResolver),this.invalidateOptionsCache(),this.backgroundColor=i}get flexOptions(){return this.flexOptionsValue}set flexOptions(t){this.flexOptionsValue=t,this.invalidateOptionsCache(),this.markLayoutDirty()}setFlexOptions(t){Object.assign(this.flexOptionsValue,t),this.invalidateOptionsCache(),this.markLayoutDirty()}invalidateOptionsCache(){this.optionsCacheValid=!1}ensureOptionsCache(){if(this.optionsCacheValid)return;const t=this.flexOptionsValue;this.cachedIsRow=Fc(t.direction),this.cachedGap=this.cachedIsRow?t.columnGap??0:t.rowGap??0,this.cachedPadding=Zo(t.padding),this.optionsCacheValid=!0}measure(t){this.measureChildren(t),this.computeIntrinsicSize(),this.applySizeConstraints(),this.clearMeasureDirty()}measureChildren(t){const{children:e}=this;for(let i=0;i<e.length;i+=1)e[i].measure(t)}computeIntrinsicSize(){this.ensureOptionsCache();const{layoutChildren:t}=this.separateChildrenByLayoutMode(),e=t.map(s=>s.rect),{width:i,height:o}=ri.computeIntrinsicSize(e,this.cachedIsRow,this.cachedGap),n=this.cachedPadding;this._intrinsicWidth=i+n.left+n.right,this._intrinsicHeight=o+n.top+n.bottom}applySizeConstraints(){const{style:t}=this,e=this.resolveStyleDimension(t.width,"width"),i=this.resolveStyleDimension(t.height,"height");this.rect.width=e??this._intrinsicWidth,this.rect.height=i??this._intrinsicHeight,e===void 0&&this.clampWidthToParent()}resolveStyleDimension(t,e){if(typeof t=="number")return t;if(t!=="100%")return;const i=this.resolveParentContentSize(e);return i!==void 0?i:this.rect[e]>0?this.rect[e]:void 0}resolveParentContentSize(t){const{parent:e}=this;if(!(e instanceof Ct))return e!=null&&e.rect[t]&&e.rect[t]>0?e.rect[t]:void 0;e.ensureOptionsCache();const i=e.cachedPadding,o=t==="width"?i.left+i.right:i.top+i.bottom,n=e.rect[t]-o;return n>0?n:void 0}performLayout(t,e=!1){if(e?(this.measureChildren(t),this.clearMeasureDirty()):this.measure(t),this.children.length===0){this.clearLayoutDirty();return}const{layoutChildren:i,absoluteChildren:o}=this.separateChildrenByLayoutMode();i.length>0&&this.layoutPhase1Flexbox(t,i,e),o.length>0&&this.isPositioningContext()&&this.layoutPhase2Absolute(t,o),this.clearLayoutDirty()}layoutPhase1Flexbox(t,e,i=!1){const o=new nr(this.rect.width,this.rect.height,this.flexOptionsValue);this.flexTreeBuilder.build(this,o,e);let n=0,s;do o.build(),s=this.layoutReconciler.reconcile(t,this,o,e,this.rect,i),n+=1;while(s&&n<yc)}layoutPhase2Absolute(t,e){this.ensureOptionsCache(),this.positionResolver.positionAbsoluteChildren(this.rect,this.cachedPadding,e,i=>i.measure(t),i=>this.layoutAbsoluteChildSubtree(t,i))}layoutAbsoluteChildSubtree(t,e){if(!(e instanceof Ct))return;const i=e.parent;e.parent=null;try{e.performLayout(t,!0)}finally{e.parent=i}}clampWidthToParent(){const{parent:t}=this;if(t===null||t.rect.width<=0)return;let e=t.rect.width;t instanceof Ct&&(t.ensureOptionsCache(),e-=t.cachedPadding.left+t.cachedPadding.right),e=Math.max(0,e),this.rect.width>e&&(this.rect.width=e)}separateChildrenByLayoutMode(){const t=[],e=[];for(const i of this.children)i.isAbsolute()?e.push(i):t.push(i);return{layoutChildren:t,absoluteChildren:e}}onPaint(t,e){this.backgroundColor!=="transparent"&&t.fillRect(this.rect.x,this.rect.y,this.rect.width,this.rect.height,this.backgroundColor);for(const i of this.children)i.paint(t,e)}}const bc={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},Sc=(r,t)=>({minX:Math.min(r.minX,t.rect.x),minY:Math.min(r.minY,t.rect.y),maxX:Math.max(r.maxX,t.rect.x+t.rect.width),maxY:Math.max(r.maxY,t.rect.y+t.rect.height)}),xc=r=>r.minX===1/0||r.maxX===-1/0;class wc extends Ct{performLayout(t){const e=this.layoutChildren(t);if(!e){this.clearLayoutDirty();return}this.expandToFitBounds(e),this.clearLayoutDirty()}layoutChildren(t){let e={...bc};return this.children.forEach(i=>{i instanceof Ct?i.performLayout(t):i.measure(t),e=Sc(e,i)}),xc(e)?null:e}expandToFitBounds(t){const e=t.maxX-this.rect.x,i=t.maxY-this.rect.y;e>this.rect.width&&(this.rect.width=e),i>this.rect.height&&(this.rect.height=i)}onPaint(t,e){this.backgroundColor&&this.backgroundColor!=="transparent"&&t.fillRect(this.rect.x,this.rect.y,this.rect.width,this.rect.height,this.backgroundColor),this.borderWidth>0&&this.borderColor&&this.borderColor!=="transparent"&&t.strokeRect(this.rect.x+this.borderWidth/2,this.rect.y+this.borderWidth/2,this.rect.width-this.borderWidth,this.rect.height-this.borderWidth,this.borderColor,this.borderWidth),super.onPaint(t,e)}}class sr{constructor(t={}){this.options=t,this.hoveredNode=null,this.activePortalNode=null,this.currentCursor="default",this.bounds=null}setAbsoluteBounds(t){this.bounds=t?{...t}:null}handlePointerMove(t,e){this.transitionHover(t[0],e),this.updateCursor(t)}handlePointerLeave(){this.transitionHover(void 0,null),this.updateCursor([])}handlePortalReset(){this.activePortalNode&&this.dispatchPortalHover({visible:!1,x:0,y:0,width:0,height:0,originId:this.activePortalNode.id,source:this.options.portalSource}),this.activePortalNode=null}computeCursor(t,e,i){var n;const o=i.hitTest(t,e);for(const s of o){const c=(n=s.style)==null?void 0:n.cursor;if(c)return c}return"default"}getCurrentCursor(){return this.currentCursor}transitionHover(t,e){if(this.hoveredNode===t){this.updatePortalHover(t,e);return}this.hoveredNode&&this.hoveredNode.onMouseLeave(this.buildEvent("mouseleave",this.hoveredNode,e)),t&&t.onMouseEnter(this.buildEvent("mouseenter",t,e)),this.hoveredNode=t??null,this.updatePortalHover(t,e)}buildEvent(t,e,i){return i?{...i,type:t,target:e,currentTarget:e}:{type:t,x:0,y:0,originalEvent:{},stopPropagation:()=>{},preventDefault:()=>{},target:e,currentTarget:e}}updateCursor(t){var i,o,n;let e="default";for(const s of t){const c=(i=s.style)==null?void 0:i.cursor;if(c){e=c;break}}e!==this.currentCursor&&(this.currentCursor=e,(n=(o=this.options).onCursorChange)==null||n.call(o,e))}findPortalTarget(t){let e=t;for(;e;){if(e.portalHoverEnabled)return e;e=e.parent}return null}updatePortalHover(t,e=null){var c,a,u,d,l,h;const i=this.findPortalTarget(t),o=i?{...i.rect}:null,n=this.activePortalNode,s=i&&o?{id:i.id,rect:o}:null;if(i&&(n==null?void 0:n.id)===i.id){(a=(c=this.options).onPortalTargetChange)==null||a.call(c,i,e);return}if(this.activePortalNode=s,(d=(u=this.options).onPortalTargetChange)==null||d.call(u,i??null,e),!!this.options.portalHoverDispatch)if(i&&o&&this.bounds){const f=((h=(l=this.options).getTooltipContext)==null?void 0:h.call(l))??void 0;this.dispatchPortalHover({visible:!0,x:this.bounds.x+o.x,y:this.bounds.y+o.y,width:o.width,height:o.height,nodeId:i.id,originId:i.id,source:this.options.portalSource,tooltipContext:f,tooltipFromNode:i.getTooltip(),priority:1})}else n&&this.dispatchPortalHover({visible:!1,x:0,y:0,width:0,height:0,originId:n.id,source:this.options.portalSource})}dispatchPortalHover(t){var i,o,n,s;const e=((o=(i=this.options).getPortalEventTarget)==null?void 0:o.call(i))??null;(s=(n=this.options).portalHoverDispatch)==null||s.call(n,t,e)}}class Ft extends Mt{addChild(){throw new Error("CanvasLeaf cannot have children")}}const fe={selection:"normal",cellClick:"normal",editor:"normal",contextMenu:"normal"};function Ac(r){return r.selection!==void 0||r.cellClick!==void 0||r.editor!==void 0||r.contextMenu!==void 0}function jo(r){if(!r||!Ac(r))return;const t={selection:r.selection??fe.selection,cellClick:r.cellClick??fe.cellClick,editor:r.editor??fe.editor,contextMenu:r.contextMenu??fe.contextMenu};return t.editor==="open-on-click"&&t.selection==="keep"&&(console.warn('[TableCanvas interaction] `editor: "open-on-click"` требует обычного selection. Editor не будет открыт, чтобы не менять выделение неожиданно.'),t.editor="normal"),t.editor==="open-on-click"&&t.cellClick==="stop"&&(console.warn('[TableCanvas interaction] `editor: "open-on-click"` требует обычного cellClick, потому что editor открывается через click pipeline таблицы. Editor не будет открыт.'),t.editor="normal"),t}function Jo(){return{...fe}}class Qo{constructor(){this.nodes=new Map,this.listeners=new Set}register(t,e){this.nodes.set(t,e),this.notify(t)}unregister(t){this.nodes.delete(t)}get(t){return this.nodes.get(t)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(t){this.listeners.forEach(e=>e(t))}}function Ec(r,t){return r.zIndex!==t.zIndex?r.zIndex-t.zIndex:r.order-t.order}const io=typeof Path2D<"u"&&typeof CanvasRenderingContext2D.prototype.roundRect=="function";class oi{constructor(){this.commands=[],this.orderCounter=0,this.currentZIndex=0}setAnimationContext(t){return this.animationContext=t,this}getAnimationContext(){return this.animationContext}setZIndex(t){return this.currentZIndex=t,this}getZIndex(){return this.currentZIndex}pushZIndex(t=1){return this.currentZIndex+=t,this}popZIndex(t=1){return this.currentZIndex-=t,this}fillRect(t,e,i,o,n){return this.commands.push({type:"fillRect",x:t,y:e,width:i,height:o,fillStyle:n,zIndex:this.currentZIndex,order:this.orderCounter++}),this}strokeRect(t,e,i,o,n,s=1){return this.commands.push({type:"strokeRect",x:t,y:e,width:i,height:o,strokeStyle:n,lineWidth:s,zIndex:this.currentZIndex,order:this.orderCounter++}),this}fillText(t,e,i,o,n,s="middle",c){return this.commands.push({type:"fillText",text:t,x:e,y:i,font:o,fillStyle:n,textBaseline:s,textAlign:c,zIndex:this.currentZIndex,order:this.orderCounter++}),this}fillTextClipped(t,e,i,o,n,s,c="middle",a){return this.commands.push({type:"fillTextClipped",text:t,x:e,y:i,font:o,fillStyle:n,textBaseline:c,textAlign:a,clipX:s.x,clipY:s.y,clipWidth:s.width,clipHeight:s.height,zIndex:this.currentZIndex,order:this.orderCounter++}),this}drawImage(t,e,i,o,n){return this.commands.push({type:"drawImage",image:t,x:e,y:i,width:o,height:n,zIndex:this.currentZIndex,order:this.orderCounter++}),this}roundedRect(t,e,i,o,n,s){return this.commands.push({type:"roundedRect",x:t,y:e,width:i,height:o,radius:n,fillStyle:s==null?void 0:s.fillStyle,strokeStyle:s==null?void 0:s.strokeStyle,lineWidth:s==null?void 0:s.lineWidth,zIndex:this.currentZIndex,order:this.orderCounter++}),this}linearGradientRect(t,e,i,o,n,s,c=90){return this.commands.push({type:"linearGradientRect",x:t,y:e,width:i,height:o,radius:n,gradientStops:s,angle:c,zIndex:this.currentZIndex,order:this.orderCounter++}),this}custom(t){return this.commands.push({type:"custom",fn:t,zIndex:this.currentZIndex,order:this.orderCounter++}),this}clear(){return this.commands.length=0,this.orderCounter=0,this.currentZIndex=0,this.animationContext=void 0,this}get commandCount(){return this.commands.length}flush(t){const{commands:e}=this,i=e.length;if(i===0)return;e.sort(Ec);let o="",n="",s=-1,c="",a="",u="";for(let d=0;d<i;d++){const l=e[d];if(l!==void 0)switch(l.type){case"fillRect":o!==l.fillStyle&&(t.fillStyle=l.fillStyle,o=l.fillStyle),t.fillRect(l.x,l.y,l.width,l.height);break;case"strokeRect":n!==l.strokeStyle&&(t.strokeStyle=l.strokeStyle,n=l.strokeStyle),s!==l.lineWidth&&(t.lineWidth=l.lineWidth,s=l.lineWidth),t.strokeRect(l.x,l.y,l.width,l.height);break;case"fillText":c!==l.font&&(t.font=l.font,c=l.font),o!==l.fillStyle&&(t.fillStyle=l.fillStyle,o=l.fillStyle),a!==l.textBaseline&&(t.textBaseline=l.textBaseline,a=l.textBaseline),l.textAlign&&u!==l.textAlign&&(t.textAlign=l.textAlign,u=l.textAlign),t.fillText(l.text,l.x,l.y);break;case"fillTextClipped":c!==l.font&&(t.font=l.font,c=l.font),o!==l.fillStyle&&(t.fillStyle=l.fillStyle,o=l.fillStyle),a!==l.textBaseline&&(t.textBaseline=l.textBaseline,a=l.textBaseline),l.textAlign&&u!==l.textAlign&&(t.textAlign=l.textAlign,u=l.textAlign),this.executeFillTextClipped(t,l);break;case"drawImage":t.drawImage(l.image,l.x,l.y,l.width,l.height);break;case"roundedRect":this.executeRoundedRect(t,l),l.fillStyle&&(o=l.fillStyle),l.strokeStyle&&(n=l.strokeStyle),l.lineWidth!==void 0&&(s=l.lineWidth);break;case"linearGradientRect":this.executeLinearGradientRect(t,l);break;case"custom":l.fn(t),o="",n="",s=-1,c="",a="",u="";break}}this.clear()}executeLinearGradientRect(t,e){const{x:i,y:o,width:n,height:s,radius:c,gradientStops:a,angle:u}=e,d=(u-90)*Math.PI/180,l=Math.cos(d),h=Math.sin(d),f=n/2,g=s/2,C=i+f,v=o+g,y=(Math.abs(l*n)+Math.abs(h*s))/2,S=C-l*y,x=v-h*y,A=C+l*y,F=v+h*y,I=t.createLinearGradient(S,x,A,F);for(const E of a)I.addColorStop(E.offset,E.color);if(t.fillStyle=I,c>0)if(io)t.beginPath(),t.roundRect(i,o,n,s,c),t.fill();else{const E=c,L=i+n,P=o+s;t.beginPath(),t.moveTo(i+E,o),t.lineTo(L-E,o),t.quadraticCurveTo(L,o,L,o+E),t.lineTo(L,P-E),t.quadraticCurveTo(L,P,L-E,P),t.lineTo(i+E,P),t.quadraticCurveTo(i,P,i,P-E),t.lineTo(i,o+E),t.quadraticCurveTo(i,o,i+E,o),t.closePath(),t.fill()}else t.fillRect(i,o,n,s)}executeFillTextClipped(t,e){e.clipWidth<=0||e.clipHeight<=0||e.text.length===0||(t.save(),t.beginPath(),t.rect(e.clipX,e.clipY,e.clipWidth,e.clipHeight),t.clip(),t.fillText(e.text,e.x,e.y),t.restore())}executeRoundedRect(t,e){const{x:i,y:o,width:n,height:s,radius:c,fillStyle:a,strokeStyle:u,lineWidth:d}=e;if(io)t.beginPath(),t.roundRect(i,o,n,s,c);else{const l=c,h=i+n,f=o+s;t.beginPath(),t.moveTo(i+l,o),t.lineTo(h-l,o),t.quadraticCurveTo(h,o,h,o+l),t.lineTo(h,f-l),t.quadraticCurveTo(h,f,h-l,f),t.lineTo(i+l,f),t.quadraticCurveTo(i,f,i,f-l),t.lineTo(i,o+l),t.quadraticCurveTo(i,o,i+l,o),t.closePath()}a&&(t.fillStyle=a,t.fill()),u&&(t.strokeStyle=u,d!==void 0&&(t.lineWidth=d),t.stroke())}}const Tc=new oi;class Dc{constructor(t,e){this.eventHandlers=new Map,this.batcher=new oi,this.canvas=t,this.ctx=t.getContext("2d",{alpha:!1}),this.rootNode=e,this.hoverController=new sr({onCursorChange:i=>{var o;return(o=this.onCursorChange)==null?void 0:o.call(this,i)},onPortalTargetChange:(i,o)=>{var n;return(n=this.onPortalHoverTargetChange)==null?void 0:n.call(this,i,o)}}),this.setupEvents()}setupEvents(){["click","mousedown","mouseup","mousemove","dblclick"].forEach(e=>{const i=o=>this.dispatchPointerEvent(o,e);this.eventHandlers.set(e,i),this.canvas.addEventListener(e,i)})}destroy(){this.eventHandlers.forEach((t,e)=>{this.canvas.removeEventListener(e,t)}),this.eventHandlers.clear()}dispatchPointerEvent(t,e){const{x:i,y:o}=this.getEventCoords(t),n=this.rootNode.hitTest(i,o),s=n[0];let c=!1;const a={type:e,x:i,y:o,originalEvent:t,target:s,stopPropagation:()=>{c=!0},preventDefault:()=>t.preventDefault()};this.bubbleEvent(n,a,e,()=>c),e==="mousemove"&&(this.dispatchMouseMove(n,a,()=>c),this.hoverController.handlePointerMove(n,a))}getEventCoords(t){const e=this.canvas.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}bubbleEvent(t,e,i,o){t.length!==0&&this.dispatchToNodes(t,e,(n,s)=>this.invokePointerHandler(n,i,s),o)}dispatchMouseMove(t,e,i){this.dispatchToNodes(t,e,(o,n)=>o.onMouseMove(n),i)}dispatchToNodes(t,e,i,o){for(const n of t){if(o())break;i(n,{...e,currentTarget:n})}}invokePointerHandler(t,e,i){switch(e){case"click":t.onClick(i);break;case"mousedown":t.onMouseDown(i);break;case"mouseup":t.onMouseUp(i);break;case"dblclick":t.onDoubleClick(i);break}}render(){const t=window.devicePixelRatio||1,e=this.canvas.getBoundingClientRect();this.clearCanvas(),this.applyResolutionScale(t),this.updateRootRect(e),this.layoutRoot(),this.batcher.clear(),this.rootNode.paint(this.batcher,this.ctx),this.batcher.flush(this.ctx)}clearCanvas(){this.ctx.fillStyle="#ffffff",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)}applyResolutionScale(t){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.scale(t,t)}updateRootRect(t){this.rootNode.rect.width=t.width,this.rootNode.rect.height=t.height,this.rootNode.rect.x=0,this.rootNode.rect.y=0}layoutRoot(){this.rootNode instanceof Ct?this.rootNode.performLayout(this.ctx):this.rootNode.measure(this.ctx)}}const at={xs:{height:24,fontSize:12,borderRadius:4,paddingX:8,iconSize:14},s:{height:32,fontSize:13,borderRadius:6,paddingX:12,iconSize:16},m:{height:40,fontSize:14,borderRadius:8,paddingX:16,iconSize:18},l:{height:48,fontSize:16,borderRadius:10,paddingX:20,iconSize:20}};function tn(r){return{default:{bgColor:r.surfaceSolidDefault,bgColorHover:r.surfaceSolidDefault,borderColor:r.surfaceSolidDefault,textColor:r.inverseTextPrimary,iconColor:r.inverseTextPrimary},primary:{bgColor:r.surfaceSolidDefault,bgColorHover:r.surfaceSolidDefault,borderColor:r.surfaceSolidDefault,textColor:r.inverseTextPrimary,iconColor:r.inverseTextPrimary},accent:{bgColor:r.surfaceAccent,bgColorHover:r.surfaceAccentHover,borderColor:r.surfaceAccent,textColor:r.onDarkTextPrimary,iconColor:r.onDarkTextPrimary},secondary:{bgColor:r.surfaceTransparentSecondary,bgColorHover:r.surfaceTransparentSecondaryHover,borderColor:"transparent",textColor:r.textPrimary,iconColor:r.textPrimary},clear:{bgColor:r.surfaceClear,bgColorHover:r.surfaceTransparentSecondaryHover,borderColor:"transparent",textColor:r.textPrimary,iconColor:r.textPrimary},success:{bgColor:r.surfacePositive,bgColorHover:r.surfacePositiveHover,borderColor:r.surfacePositive,textColor:r.onDarkTextPrimary,iconColor:r.onDarkTextPrimary},warning:{bgColor:r.surfaceWarning,bgColorHover:r.surfaceWarningHover,borderColor:r.surfaceWarning,textColor:r.onDarkTextPrimary,iconColor:r.onDarkTextPrimary},critical:{bgColor:r.surfaceNegative,bgColorHover:r.surfaceNegativeHover,borderColor:r.surfaceNegative,textColor:r.onDarkTextPrimary,iconColor:r.onDarkTextPrimary},dark:{bgColor:r.onLightSurfaceTransparentDeep,bgColorHover:r.onLightSurfaceTransparentDeep,borderColor:r.onLightSurfaceTransparentDeep,textColor:r.onDarkTextPrimary,iconColor:r.onDarkTextPrimary},black:{bgColor:r.onLightSurfaceSolidDefault,bgColorHover:r.onLightSurfaceSolidDefault,borderColor:r.onLightSurfaceSolidDefault,textColor:r.onDarkTextPrimary,iconColor:r.onDarkTextPrimary},white:{bgColor:r.onDarkSurfaceSolidDefault,bgColorHover:r.onDarkSurfaceSolidDefault,borderColor:r.onDarkSurfaceSolidDefault,textColor:r.onLightTextPrimary,iconColor:r.onLightTextPrimary}}}const ro={bgColor:"#060A0C",bgColorHover:"#13181B",borderColor:"transparent",textColor:"#FFFFFF",textColorHover:"#F2F5F893",iconColor:"#FFFFFF",iconColorHover:"#F2F5F893"},ni={default:ro,primary:{bgColor:"#060A0C",bgColorHover:"#111C22",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},accent:{bgColor:"#118CDF",bgColorHover:"#1798EE",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},secondary:{bgColor:"#ADB9C238",bgColorHover:"#ADB9C247",borderColor:"transparent",textColor:"#060A0C",iconColor:"#060A0C"},clear:{bgColor:"transparent",bgColorHover:"rgba(6, 10, 12, 0.08)",borderColor:"transparent",textColor:"#060A0C",iconColor:"#060A0C"},success:{bgColor:"#1A9E32",bgColorHover:"#1EB83A",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},warning:{bgColor:"#FA5F05",bgColorHover:"#FB782D",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},critical:{bgColor:"#FF293E",bgColorHover:"#FF5263",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},dark:{bgColor:"#30373CC7",bgColorHover:"#30373CC7",borderColor:"transparent",textColor:"#FFFFFF",textColorHover:"#F2F5F893",iconColor:"#FFFFFF",iconColorHover:"#F2F5F893"},black:ro,white:{bgColor:"#FFFFFF",bgColorHover:"#FFFFFF",borderColor:"transparent",textColor:"#060A0C",textColorHover:"#13181B93",iconColor:"#060A0C",iconColorHover:"#13181B93"}},oe=4,ne=4,en=16,cr=20,ar=4,Tt=1,lr=6,Ic=4,si="s",ci="default",ur="#d32f2f",pe="#ffffff",rn="rgba(30, 136, 229, 0.08)",Mi="#ffffff",on="#E8EEF2",nn="#D5DFE6",zi="#8A959D",hr="|",sn="#",cn=35,dr=15,Oi=new Map,Ni=new Map;function fr(r,t){if(r.charCodeAt(0)===cn){const e=parseInt(r.slice(1),16),i=Math.min(255,(e>>16&255)+t),o=Math.min(255,(e>>8&255)+t),n=Math.min(255,(e&255)+t);return`${sn}${(i<<16|o<<8|n).toString(16).padStart(6,"0")}`}return r}function oo(r,t){const e=Math.min(1,Math.max(0,t));if(r.charCodeAt(0)!==35)throw new Error("Only HEX color format is supported");let i=r.slice(1),o,n,s;if((i.length===3||i.length===4)&&(i=i.split("").map(c=>c+c).join("")),i.length===6)o=parseInt(i.slice(0,2),16),n=parseInt(i.slice(2,4),16),s=parseInt(i.slice(4,6),16);else if(i.length===8)o=parseInt(i.slice(0,2),16),n=parseInt(i.slice(2,4),16),s=parseInt(i.slice(4,6),16);else throw new Error(`Invalid HEX color format: ${r}`);return`rgba(${o}, ${n}, ${s}, ${e})`}function an(r,t){const e=`${r}${hr}${t}`;let i=Oi.get(e);return i===void 0&&(i=fr(r,t),Oi.set(e,i)),i}function gr(r,t,e){const i=`${e}${hr}${t}`;let o=Ni.get(i);return o===void 0&&(r.font=e,o=r.measureText(t).width,Ni.set(i,o)),o}function Cr(r,t,e,i,o,n){if(r!=="auto")return r;let s=0;return o&&(s+=e+i),n&&(s+=e+i),t+s+4}function vr(r,t,e,i,o){let n=r;return i&&(n+=t+e),o&&(n+=t+e),n}function Hc(){Oi.clear(),Ni.clear()}const Lc=fr(ur,dr);function mr(r,t,e,i){if(e)return{bgColor:r.bgCell,borderColor:r.borderColor,textColor:r.textLight,iconColor:r.textLight};switch(t){case"primary":return Wi(r,i);case"secondary":return ln(r,i);case"danger":return un(i);default:return Wi(r,i)}}function Pc(r,t,e,i,o){const{accentColor:n}=r,s=r.accentFg||pe,c=r.accentFg||pe,a=.4;if(t||e){const h=o?oo(n,a):n;return{bgColor:h,borderColor:h,textColor:s,iconColor:c}}const u="#485056B0",d="white",l=o?oo(u,a):u;return{bgColor:d,borderColor:l,textColor:s,iconColor:c}}function Wi(r,t){const{accentColor:e}=r,i=t?an(e,dr):e;return{bgColor:i,borderColor:i,textColor:r.accentFg||pe,iconColor:r.accentFg||pe}}function ln(r,t){return{bgColor:t?r.accentLight||rn:r.bgCell,borderColor:r.accentColor,textColor:r.accentColor,iconColor:r.accentColor}}function un(r){const t=r?Lc:ur;return{bgColor:t,borderColor:t,textColor:Mi,iconColor:Mi}}function pr(r,t,e){return t?{bgColor:on,borderColor:nn,textColor:zi,iconColor:zi}:{bgColor:e?r.bgColorHover:r.bgColor,borderColor:r.borderColor,textColor:e&&r.textColorHover?r.textColorHover:r.textColor,iconColor:e&&r.iconColorHover?r.iconColorHover:r.iconColor}}const jt=-1,no=0,ht={colIndex:jt,rowIndex:jt},et={x:no,y:no},Bc=2;function Xe(r){const{location:t}=r;if(Array.isArray(t)&&t.length>=Bc)return ht.colIndex=t[0]??jt,ht.rowIndex=t[1]??jt,ht;const{col:e}=r,{row:i}=r;if(typeof e=="number"&&typeof i=="number")return ht.colIndex=e,ht.rowIndex=i,ht;const{colIndex:o}=r,{rowIndex:n}=r;return typeof o=="number"&&typeof n=="number"?(ht.colIndex=o,ht.rowIndex=n,ht):(ht.colIndex=jt,ht.rowIndex=jt,ht)}const ze="-",so=0;function ee(r,t){const{colIndex:e,rowIndex:i}=r;return e>=so&&i>=so?`${e}${ze}${i}`:`${t.x}${ze}${t.y}${ze}${t.width}${ze}${t.height}`}function Gi(r){const{posX:t}=r,{posY:e}=r;if(typeof t=="number"&&typeof e=="number"&&t===t&&e===e)return et.x=t,et.y=e,et;const{x:i}=r,{y:o}=r;if(typeof i=="number"&&typeof o=="number"&&i===i&&o===o)return et.x=i,et.y=o,et;const{location:n}=r;if(Array.isArray(n)&&n.length>=2){const s=n[0],c=n[1];if(typeof s=="number"&&typeof c=="number")return et.x=s,et.y=c,et}return null}function $i(r,t){const e=r.x,i=r.y,o=t.x,n=t.y;return e>=o&&e<=o+t.width&&i>=n&&i<=n+t.height?(et.x=e-o,et.y=i-n,et):r}function hn(r,t,e){if(typeof r!="number"||typeof t!="number")return;const i=e.width,o=e.height,n=e.x,s=e.y;if(r>=-1&&r<=i+1&&t>=-1&&t<=o+1)return et.x=r,et.y=t,et;if(r>=n-1&&r<=n+i+1&&t>=s-1&&t<=s+o+1)return et.x=r-n,et.y=t-s,et}function yr(r,t,e){const i=e.x,o=e.y;return r>=i&&r<=i+e.width&&t>=o&&t<=o+e.height}function zt(r,t){if(typeof r=="object"&&r){const{hoverX:e}=r,{hoverY:i}=r,{rectX:o}=r,{rectY:n}=r;if(typeof e=="number"&&typeof i=="number"&&typeof o=="number"&&typeof n=="number"){const s=t.x-o,c=t.y-n;return e>=s&&e<=s+t.width&&i>=c&&i<=c+t.height}}return!!r}function Ve(){return typeof window<"u"?Math.ceil(window.devicePixelRatio):1}function dn(r){let t=0;for(let e=0;e<r.length;e++)t=(t<<5)-t+r.charCodeAt(e),t|=0;return t.toString(36)}function Ui(r,t){let e=r;return t&&(e=e.replace(/currentColor/g,t),!e.includes("fill=")&&!e.includes("stroke=")&&(e=e.replace("<svg",`<svg fill="${t}"`))),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}class fn{constructor(){this.iconRegistry=new Map,this.svgDataUrlCache=new Map,this.spriteCache=new Map,this.pendingLoads=new Set,this.loadListeners=new Set,this.inFlightCount=0,this.stats={requests:0,hits:0,misses:0,cacheSize:0,inFlight:0}}onLoad(t){return this.loadListeners.add(t),()=>this.loadListeners.delete(t)}register(t,e={}){const i=Array.isArray(t)?t:Object.entries(t).map(([o,n])=>({name:o,svg:n}));for(const{name:o,svg:n}of i)o&&n&&(e.overwrite||!this.iconRegistry.has(o))&&this.iconRegistry.set(o,n);return this}getSprite(t,e,i){const o=this.resolveKey(t,e,i);if(!o)return null;this.stats.requests++;const n=this.spriteCache.get(o.key);return n?(this.stats.hits++,n):(this.stats.misses++,this.loadSprite(o.key,o.url,e,!0),null)}preload(t,e){const i=Array.isArray(t)?t:[t];for(const o of i){const n=this.resolveKey(o,e.size,e.color);n&&this.loadSprite(n.key,n.url,e.size,!1)}return this}draw(t,e,i,o,n,s){const c=this.getSprite(e,n,s);if(c){const a=n*Ve();t.drawImage(c,0,0,a,a,i,o,n,n)}}getImageDirect(t){return t&&t instanceof HTMLImageElement&&t.complete&&t.naturalHeight!==0?t:null}getStats(){return{...this.stats}}reset(){return this.spriteCache.clear(),this.svgDataUrlCache.clear(),this.pendingLoads.clear(),this.stats={requests:0,hits:0,misses:0,cacheSize:0,inFlight:0},this}clearSpriteCache(){return this.spriteCache.clear(),this.pendingLoads.clear(),this.stats.cacheSize=0,this}has(t){return this.iconRegistry.has(t)}getSvg(t){return this.iconRegistry.get(t)}resolveKey(t,e,i){if(!t||e<=0)return null;const o=e*Ve();if(typeof t=="string"){const{key:n,url:s}=this.resolveIconUrl(t,i);return{key:`${n}@${o}`,url:s}}return t instanceof HTMLImageElement?{key:`img:${t.src}:${i??""}@${o}`,url:t.src}:null}resolveIconUrl(t,e){const i=e??"",o=this.iconRegistry.get(t);if(o){const s=`r:${t}:${i}`;return this.svgDataUrlCache.has(s)||this.svgDataUrlCache.set(s,Ui(o,e)),{key:s,url:this.svgDataUrlCache.get(s)}}const n=t.trimStart();if(n.startsWith("<svg")){const s=`s:${dn(n)}:${i}`;return this.svgDataUrlCache.has(s)||this.svgDataUrlCache.set(s,Ui(n,e)),{key:s,url:this.svgDataUrlCache.get(s)}}return{key:`u:${t}:${i}`,url:t}}loadSprite(t,e,i,o){var c;if(this.spriteCache.has(t)||this.pendingLoads.has(t))return;this.pendingLoads.add(t),this.inFlightCount++,this.stats.inFlight=this.inFlightCount;const n=new Image;n.src=e;const s=i*Ve();(c=n.decode)==null||c.call(n).then(()=>{const a=document.createElement("canvas");a.width=s,a.height=s;const u=a.getContext("2d");u&&(u.drawImage(n,0,0,s,s),this.spriteCache.set(t,a),this.stats.cacheSize=this.spriteCache.size),o&&this.notifyListeners()}).catch(()=>{}).finally(()=>{this.pendingLoads.delete(t),this.inFlightCount--,this.stats.inFlight=this.inFlightCount,!o&&this.inFlightCount===0&&this.notifyListeners()})}notifyListeners(){this.loadListeners.forEach(t=>t())}}const Dt=new fn;function gn(r){return Dt.onLoad(r)}function _c(r,t={}){Dt.register(r,t)}function Cn(r,t,e){return Dt.getSprite(r,t,e)}function vn(r,t){Dt.preload(r,t)}function mn(r,t,e,i,o,n){Dt.draw(r,t,e,i,o,n)}function pn(r,t){return Dt.getImageDirect(r)}function Rc(){return Dt.getStats()}function kc(){Dt.clearSpriteCache()}const Mc=mn;function ft(r,t,e,i,o,n){if(!t||o<=0)return;const s=Cn(t,o,n);if(s){r.drawImage(s,e,i,o,o);return}const c=pn(t);c&&r.drawImage(c,e,i,o,o)}function yn(r,t,e,i,o,n,s,c="primary",a=!1,u=!1,d,l,h,f=lr){const g=oe,C=o-g*2,v=Math.min(C-ne,en),b=s.baseFontFull,y=h?gr(h,n,b):0,S=Cr(i,y,v,f,d,l),x=e+g,A=zt(u,{x:t,y:e,width:S,height:o}),F=mr(s,c,a,A),I=t+S*.5,E=x+C*.5;r.roundedRect(t,x,S,C,ar,{fillStyle:F.bgColor,strokeStyle:F.borderColor,lineWidth:Tt});const L=vr(y,v,f,d,l);let P=I-L*.5;if(d){const it=E-v*.5;ft(r,d,P,it,v,F.textColor),P+=v+f}if(r.fillText(n,P,E,b,F.textColor,"middle","left"),l){const it=P+y+f,z=E-v*.5;ft(r,l,it,z,v,F.textColor)}return{x:t,y:x,width:S,height:C,actualWidth:S}}function Fn(r,t,e,i,o,n=ci,s=si,c=!1,a=!1,u,d,l,h=lr,f){const g=at[s],C=f?f[n]:ni[n],v=`${g.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,b=l?gr(l,o,v):0,y=Cr(i,b,g.iconSize,h,u,d),S=zt(a,{x:t,y:e,width:y,height:g.height}),x=pr(C,c,S),A=t+y*.5,F=e+g.height*.5;x.bgColor!=="transparent"?r.roundedRect(t,e,y,g.height,g.borderRadius,{fillStyle:x.bgColor,strokeStyle:x.borderColor!=="transparent"?x.borderColor:void 0,lineWidth:x.borderColor!=="transparent"?Tt:0}):x.borderColor!=="transparent"&&r.roundedRect(t,e,y,g.height,g.borderRadius,{fillStyle:x.bgColor,strokeStyle:x.borderColor,lineWidth:Tt});const I=vr(b,g.iconSize,h,u,d);let E=A-I*.5;if(u){const L=F-g.iconSize*.5;ft(r,u,E,L,g.iconSize,x.textColor),E+=g.iconSize+h}if(r.fillText(o,E,F,v,x.textColor,"middle","left"),d){const L=E+b+h,P=F-g.iconSize*.5;ft(r,d,L,P,g.iconSize,x.textColor)}return{x:t,y:e,width:y,height:g.height,actualWidth:y}}const zc={100:"FF",90:"E6",80:"CC",75:"BF",70:"B3",60:"99",50:"80",40:"66",30:"4D",25:"40",20:"33",10:"1A",0:"00"},Oc=(r,t)=>r.length!==6?r:r.slice(0,4)+zc[t],qt="transparent",Nc=Object.fromEntries(Object.entries(ni).map(([r,t])=>r==="secondary"?[r,{bgColor:qt,borderColor:qt,textColor:"#485056B0",bgColorHover:qt,iconColor:"#485056B0",iconColorHovered:"#485056FF"}]:[r,{bgColor:qt,borderColor:qt,textColor:t.bgColor,bgColorHover:qt,iconColor:t.bgColor,iconColorHovered:t.bgColorHover}]));function bn(r,t,e,i,o=ci,n=si,s=!1,c=!1,a){const u=at[n],d=Nc[o],l=(a==null?void 0:a.overrideSquareSize)??u.height,h=(a==null?void 0:a.overrideIconSize)??u.iconSize,f=zt(c,{x:t,y:e,width:l,height:l}),g=d,C=t+l*.5,v=e+l*.5,b=C-h*.5,y=v-h*.5;g.bgColor!=="transparent"?r.roundedRect(t,e,l,l,u.borderRadius,{fillStyle:g.bgColor,strokeStyle:g.borderColor!=="transparent"?g.borderColor:void 0,lineWidth:g.borderColor!=="transparent"?Tt:0}):g.borderColor!=="transparent"&&r.roundedRect(t,e,l,l,u.borderRadius,{fillStyle:g.bgColor,strokeStyle:g.borderColor,lineWidth:Tt});const S=(a==null?void 0:a.iconColor)??g.iconColor,x=(a==null?void 0:a.iconColorHovered)??(a==null?void 0:a.iconColor)??g.iconColorHovered,A=s?Oc(S,40):f?x:S;return ft(r,i,b,y,h,A),{x:t,y:e,width:l,height:l}}function Fr(r,t,e,i,o,n,s,c="primary",a=!1,u=!1){const d=oe,l=o-d*2,h=Math.min(l-ne,cr),f=i==="auto"?h:i,g=e+d,C=zt(u,{x:t,y:e,width:f,height:o}),v=mr(s,c,a,C),b=t+f*.5,y=g+l*.5,S=b-h*.5,x=y-h*.5;return r.roundedRect(t,g,f,l,ar,{fillStyle:v.bgColor,strokeStyle:v.borderColor,lineWidth:Tt}),ft(r,n,S,x,h,v.iconColor),{x:t,y:g,width:f,height:l}}function Sn(r,t,e,i,o=ci,n=si,s=!1,c=!1){const a=at[n],u=ni[o],d=a.height,l=zt(c,{x:t,y:e,width:d,height:d}),h=pr(u,s,l),f=t+d*.5,g=e+d*.5,C=f-a.iconSize*.5,v=g-a.iconSize*.5;return h.bgColor!=="transparent"?r.roundedRect(t,e,d,d,a.borderRadius,{fillStyle:h.bgColor,strokeStyle:h.borderColor!=="transparent"?h.borderColor:void 0,lineWidth:h.borderColor!=="transparent"?Tt:0}):h.borderColor!=="transparent"&&r.roundedRect(t,e,d,d,a.borderRadius,{fillStyle:h.bgColor,strokeStyle:h.borderColor,lineWidth:Tt}),ft(r,i,C,v,a.iconSize,h.iconColor),{x:t,y:e,width:d,height:d}}const co={xs:{height:16,fontSize:10,paddingX:4,borderRadius:4},s:{height:20,fontSize:11,paddingX:6,borderRadius:5},m:{height:24,fontSize:12,paddingX:8,borderRadius:6},l:{height:28,fontSize:13,paddingX:10,borderRadius:7}};function Wc(r){return{default:{bgColor:r.surfaceSolidDefault,bgColorTransparent:r.surfaceTransparentSecondary,textColor:r.inverseTextPrimary,textColorOnTransparent:r.textPrimary},accent:{bgColor:r.surfaceAccent,bgColorTransparent:r.surfaceTransparentAccent,textColor:r.onDarkTextPrimary,textColorOnTransparent:r.textAccent},positive:{bgColor:r.surfacePositive,bgColorTransparent:r.surfaceTransparentPositive,textColor:r.onDarkTextPrimary,textColorOnTransparent:r.textPositive},warning:{bgColor:r.surfaceWarning,bgColorTransparent:r.surfaceTransparentWarning,textColor:r.onDarkTextPrimary,textColorOnTransparent:r.textWarning},negative:{bgColor:r.surfaceNegative,bgColorTransparent:r.surfaceTransparentNegative,textColor:r.onDarkTextPrimary,textColorOnTransparent:r.textNegative},dark:{bgColor:r.onLightSurfaceSolidDefault,bgColorTransparent:r.onLightSurfaceTransparentDeep,textColor:r.onDarkTextPrimary,textColorOnTransparent:r.onLightTextPrimary},light:{bgColor:r.onDarkSurfaceSolidDefault,bgColorTransparent:r.onDarkSurfaceTransparentCard,textColor:r.onLightTextPrimary,textColorOnTransparent:r.onDarkTextPrimary}}}const Gc="|",Oe=6,ao=new Map,lo={xs:10,s:12,m:14,l:16};class xn extends Ft{constructor(t,e,i){var o;super(t),this.view="default",this.size="s",this.transparent=!1,this.clear=!1,this.pilled=!1,this.viewColors={},this.text=e,i&&(i.view!==void 0&&(this.view=i.view),i.size!==void 0&&(this.size=i.size),i.transparent!==void 0&&(this.transparent=i.transparent),i.clear!==void 0&&(this.clear=i.clear),i.pilled!==void 0&&(this.pilled=i.pilled),this.leftIcon=i.leftIcon,this.rightIcon=i.rightIcon,this.customColor=i.customColor,this.customBackgroundColor=i.customBackgroundColor,(o=i.theme)!=null&&o.tokens&&(this.viewColors=Wc(i.theme.tokens)))}measure(t){const e=co[this.size],i=lo[this.size],o=`${e.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,n=uo(t,o,this.text),s=this.text.length>0;let c=0;this.leftIcon&&(c+=i+(s?Oe:0)),this.rightIcon&&(c+=i+(s?Oe:0)),this.rect.width=n+c+e.paddingX*2,this.rect.height=e.height}onPaint(t,e){const{x:i,y:o,width:n,height:s}=this.rect,c=co[this.size],a=lo[this.size],u=this.viewColors[this.view];if(!u)return;const d=`${c.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`;let l,h;if(this.clear?(l="transparent",h=this.customColor??u.textColorOnTransparent):this.transparent?(l=this.customBackgroundColor??u.bgColorTransparent,h=this.customColor??u.textColorOnTransparent):(l=this.customBackgroundColor??u.bgColor,h=this.customColor??u.textColor),!this.clear){const C=this.pilled?s/2:c.borderRadius;t.roundedRect(i,o,n,s,C,{fillStyle:l})}const f=o+s/2;let g=i+c.paddingX;if(this.leftIcon){const C=f-a/2;ft(t,this.leftIcon,g,C,a,h),g+=a+Oe}if(t.fillText(this.text,g,f,d,h,"middle"),this.rightIcon){const C=uo(e,d,this.text),v=g+C+Oe,b=f-a/2;ft(t,this.rightIcon,v,b,a,h)}}}function uo(r,t,e){const i=`${t}${Gc}${e}`;let o=ao.get(i);return o===void 0&&(r.font=t,o=r.measureText(e).width,ao.set(i,o)),o}const $c="default",Uc="s",Di="pointer",Ne=8,Xc={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e",baseFontFull:"13px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},ho=new Map;class wn extends Ft{constructor(t,e,i){var o;super(t),this.variant="primary",this.view=$c,this.size=Uc,this.disabled=!1,this.isHovered=!1,this.useNewApi=!1,this.text=e,super.style={...super.style,cursor:Di},i&&(i.view!==void 0?(this.view=i.view,this.useNewApi=!0):i.variant!==void 0&&(this.variant=i.variant),i.size!==void 0&&(this.size=i.size,this.useNewApi=!0),this.leftIcon=i.leftIcon,this.rightIcon=i.rightIcon,i.disabled!==void 0&&(this.disabled=i.disabled),i.onClick&&(this.onClick=i.onClick),(o=i.theme)!=null&&o.tokens&&(this.viewColors=tn(i.theme.tokens)))}set style(t){super.style={...super.style,cursor:Di,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=Di),t}measure(t){const e=at[this.size],i=`${e.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,o=Vc(t,this.text,i);let n=0;this.leftIcon&&(n+=e.iconSize+Ne),this.rightIcon&&(n+=e.iconSize+Ne),this.rect.width=o+n+e.paddingX*2,this.rect.height=e.height}onPaint(t,e){const{x:i,y:o,width:n}=this.rect;if(this.useNewApi)Fn(t,i,o,n,this.text,this.view,this.size,this.disabled,this.isHovered,this.leftIcon,this.rightIcon,e,Ne,this.viewColors);else{const s=at[this.size];yn(t,i,o,n,s.height,this.text,Xc,this.variant,this.disabled,this.isHovered,this.leftIcon,this.rightIcon,e,Ne)}}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}}function Vc(r,t,e){const i=`${e}|${t}`;let o=ho.get(i);return o===void 0&&(r.font=e,o=r.measureText(t).width,ho.set(i,o)),o}const fo=16,go="black",Co=0,Yc=Math.PI/2,qc=1.8,Kt={startX:-3.5,startY:-4.25,middleX:2.75,middleY:0,endX:-3.5,endY:4.25};class Kc extends Ft{constructor(t,e={}){super(t),this.rotation=Co,this.color=go,this.rotation=e.rotation??Co,this.color=e.color??go,this.rect.width=fo,this.rect.height=fo}measure(t){}onPaint(t,e){const{x:i,y:o,width:n,height:s}=this.rect,c=i+n/2,a=o+s/2,u=this.rotation*Yc;t.custom(d=>{d.save(),d.translate(c,a),d.rotate(u),d.strokeStyle=this.color,d.lineWidth=qc,d.lineCap="round",d.lineJoin="round",d.beginPath(),d.moveTo(Kt.startX,Kt.startY),d.lineTo(Kt.middleX,Kt.middleY),d.lineTo(Kt.endX,Kt.endY),d.stroke(),d.restore()})}}const Zc=28,jc="default",Jc="s",Qc="pointer",ta=20,ea={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e"};class Xi extends Ft{constructor(t,e,i){super(t),this.view=jc,this.buttonSize=Jc,this.isHovered=!1,this.useNewApi=!1,this.getDisabled=()=>this.disabled?"default":Qc,this.icon=e,this.size=(i==null?void 0:i.size)??"auto",this.variant=(i==null?void 0:i.variant)??"primary",this.disabled=(i==null?void 0:i.disabled)??!1,super.style={...super.style,cursor:this.getDisabled()},(i==null?void 0:i.view)!==void 0&&(this.view=i.view,this.useNewApi=!0),(i==null?void 0:i.buttonSize)!==void 0&&(this.buttonSize=i.buttonSize,this.useNewApi=!0),(i==null?void 0:i.overrideSquareSize)!==void 0&&(this.overrideSquareSize=i.overrideSquareSize),(i==null?void 0:i.overrideIconSize)!==void 0&&(this.overrideIconSize=i.overrideIconSize),(i==null?void 0:i.overrideWidth)!==void 0&&(this.overrideWidth=i.overrideWidth),(i==null?void 0:i.iconColor)!==void 0&&(this.iconColor=i.iconColor),(i==null?void 0:i.iconColorHovered)!==void 0&&(this.iconColorHovered=i.iconColorHovered),i!=null&&i.onClick&&(this.onClick=o=>{var n;return(n=i.onClick)==null?void 0:n.call(i,o)})}set style(t){super.style={...super.style,cursor:this.getDisabled(),...t}}get style(){const t=super.style;return t.cursor||(t.cursor=this.getDisabled()),t}measure(t){if(this.useNewApi){const e=at[this.buttonSize],i=this.overrideSquareSize??e.height;this.rect.height=i,this.rect.width=this.overrideWidth??i}else{const e=vo(this.size);this.rect.height=e.height,this.rect.width=e.width}}onPaint(t,e){const{x:i,y:o,width:n,height:s}=this.rect;if(this.useNewApi){const c=this.overrideSquareSize!==void 0||this.overrideIconSize!==void 0||this.iconColor!==void 0||this.iconColorHovered!==void 0?{overrideSquareSize:this.overrideSquareSize,overrideIconSize:this.overrideIconSize,iconColor:this.iconColor,iconColorHovered:this.iconColorHovered}:void 0;if(bn(t,i,o,this.icon,this.view,this.buttonSize,this.disabled,this.isHovered,c),Mt.DEBUG){const a=at[this.buttonSize],u=this.overrideSquareSize??a.height,d=this.overrideIconSize??a.iconSize,l=i+(u-d)*.5,h=o+(u-d)*.5;t.strokeRect(l,h,d,d,"cyan",1)}}else Fr(t,i,o,n,s,this.icon,ea,this.variant,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}containsHitPoint(t,e){if(this.useNewApi){const n=at[this.buttonSize],s=this.overrideSquareSize??n.height,c={x:this.rect.x,y:this.rect.y,width:this.overrideWidth??s,height:s};return mo(t,e,c)}const i=vo(this.size,this.rect.height),o=ia(this.rect.x,this.rect.y,i);return mo(t,e,o)}}function vo(r,t){const e=typeof r=="number"?r:t??Zc,i=0,o=oe,n=Math.min(e-o*2-ne,ta),s=typeof r=="number"?r:n+i*2;return{height:e,width:s,paddingX:i,paddingY:o,iconSize:n}}function ia(r,t,e){return{x:r+e.paddingX,y:t+e.paddingY,width:e.width-e.paddingX*2,height:e.height-e.paddingY*2}}function mo(r,t,e){return r>=e.x&&r<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}const ra=16,oa="transparent";class An extends Ft{constructor(t,e,i){super(t),this.icon=e,this.size=(i==null?void 0:i.size)??ra,this.color=i==null?void 0:i.color}measure(t){this.rect.width=this.size,this.rect.height=this.size}onPaint(t,e){const{x:i,y:o,width:n,height:s}=this.rect;this.backgroundColor&&this.backgroundColor!==oa&&t.fillRect(i,o,n,s,this.backgroundColor),ft(t,this.icon,i,o,this.size,this.color)}}const na=28,sa="default",ca="s",Ii="pointer",aa=20,la={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e"};class En extends Ft{constructor(t,e,i){super(t),this.view=sa,this.buttonSize=ca,this.isHovered=!1,this.useNewApi=!1,this.icon=e,this.size=(i==null?void 0:i.size)??"auto",this.variant=(i==null?void 0:i.variant)??"primary",this.disabled=(i==null?void 0:i.disabled)??!1,super.style={...super.style,cursor:Ii},(i==null?void 0:i.view)!==void 0&&(this.view=i.view,this.useNewApi=!0),(i==null?void 0:i.buttonSize)!==void 0&&(this.buttonSize=i.buttonSize,this.useNewApi=!0),i!=null&&i.onClick&&(this.onClick=o=>{var n;return(n=i.onClick)==null?void 0:n.call(i,o)})}set style(t){super.style={...super.style,cursor:Ii,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=Ii),t}measure(t){if(this.useNewApi){const e=at[this.buttonSize];this.rect.height=e.height,this.rect.width=e.height}else{const e=po(this.size);this.rect.height=e.height,this.rect.width=e.width}}onPaint(t,e){const{x:i,y:o,width:n,height:s}=this.rect;this.useNewApi?Sn(t,i,o,this.icon,this.view,this.buttonSize,this.disabled,this.isHovered):Fr(t,i,o,n,s,this.icon,la,this.variant,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}containsHitPoint(t,e){if(this.useNewApi){const n=at[this.buttonSize],s={x:this.rect.x,y:this.rect.y,width:n.height,height:n.height};return yo(t,e,s)}const i=po(this.size,this.rect.height),o=ua(this.rect.x,this.rect.y,i);return yo(t,e,o)}}function po(r,t){const e=typeof r=="number"?r:t??na,i=0,o=oe,n=Math.min(e-o*2-ne,aa),s=typeof r=="number"?r:n+i*2;return{height:e,width:s,paddingX:i,paddingY:o,iconSize:n}}function ua(r,t,e){return{x:r+e.paddingX,y:t+e.paddingY,width:e.width-e.paddingX*2,height:e.height-e.paddingY*2}}function yo(r,t,e){return r>=e.x&&r<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}const he="transparent",ha=0;class Tn extends Ft{constructor(t,e=he){super(t),this.color=he,this.borderColor=he,this.borderWidth=ha,this.color=e}measure(t){const{style:e,rect:i}=this;typeof e.width=="number"&&(i.width=e.width),typeof e.height=="number"&&(i.height=e.height)}onPaint(t,e){const{x:i,y:o,width:n,height:s}=this.rect;if(this.color!==he&&t.fillRect(i,o,n,s,this.color),this.borderWidth>0&&this.borderColor!==he){const c=this.borderWidth/2;t.strokeRect(i+c,o+c,n-this.borderWidth,s-this.borderWidth,this.borderColor,this.borderWidth)}}}const Dn="|",da=2,fa=1e4,Vi=new Map,Yi=new Map;function In(r,t,e){r.size>=fa&&r.clear(),r.set(t,e)}function ga(r,t){return`${r}${Dn}${t}`}function Ca({text:r,font:t,maxWidth:e,textOverflow:i,ellipsis:o,forceEllipsis:n}){return[t,r,e.toFixed(da),i,o,n?"force":"normal"].join(Dn)}function qi(r,t,e){const i=ga(e,t);let o=Vi.get(i);return o===void 0&&(r.font=e,o=r.measureText(t).width,In(Vi,i,o)),o}function va(r){const t=typeof Intl<"u"?Intl.Segmenter:void 0;if(typeof t=="function"){const e=new t(void 0,{granularity:"grapheme"});return Array.from(e.segment(r),({segment:i})=>i)}return Array.from(r)}function ma(r,t,e,i,o){const n=qi(r,o,e);if(n>i)return{text:"",didTruncate:!0,width:0};const s=va(t);let c=0,a=s.length,u=o,d=n;for(;c<=a;){const l=Math.floor((c+a)/2),h=`${s.slice(0,l).join("")}${o}`,f=qi(r,h,e);f<=i?(u=h,d=f,c=l+1):a=l-1}return{text:u,didTruncate:!0,width:d}}function Ki(r){const{ctx:t,text:e,font:i,maxWidth:o,textOverflow:n,ellipsis:s,forceEllipsis:c=!1}=r,a=Math.max(0,o);if(a<=0||e.length===0&&!(c&&n==="ellipsis"))return{text:"",didTruncate:e.length>0,width:0};const u=Ca({text:e,font:i,maxWidth:a,textOverflow:n,ellipsis:s,forceEllipsis:c}),d=Yi.get(u);if(d)return d;const l=qi(t,e,i);let h;return l<=a&&!c?h={text:e,didTruncate:!1,width:l}:n==="clip"?h={text:e,didTruncate:!0,width:l}:h=ma(t,e,i,a,s),In(Yi,u,h),h}function Fo({ctx:r,lines:t,font:e,maxWidth:i,maxLines:o,textOverflow:n,ellipsis:s}){const c=Math.max(0,Math.floor(o)),a=Math.min(t.length,c),u=t.slice(0,a),d=t.length>a;if(n==="ellipsis"&&u.length>0){const l=u.length-1,h=u[l]??"";u[l]=Ki({ctx:r,text:h,font:e,maxWidth:i,textOverflow:n,ellipsis:s,forceEllipsis:d}).text}return{lines:u,didClamp:d}}function pa(){Vi.clear(),Yi.clear()}const ya="14px sans-serif",Fa="black",ba=1,Sa=14,xa="visible",wa="clip",Aa="…",Ea=/(\d*\.?\d+)px/,pt="|",Ta=30,Da=`${pt}precise-wrap`,Ia=1e4,Ha=5e3,La=/[\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F\u200D\uFE0E\uFE0F\u2600-\u27BF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/,Zi=new Map,ji=new Map,Ji=new Map;let Hi=null;function Pa(){return Hi===null&&typeof document<"u"&&(Hi=document.createElement("canvas").getContext("2d")),Hi}function Hn(r,t,e,i){r.size>=i&&r.clear(),r.set(t,e)}function Ba(r,t,e,i){return`${r}${pt}${t}${pt}${e??""}${pt}${i??""}`}function _a(r,t){return`${r}${pt}${t}`}function Ra(r,t,e){return`${r}${pt}${t}${pt}${e}`}function Ln(r,t,e,i){return`${r}${pt}${t}${pt}${e}${pt}${i}`}class br extends Mt{constructor(t,e,i){super(t),this.font=ya,this.color=Fa,this.wordWrap=!1,this.lineHeight=ba,this.overflow=xa,this.textOverflow=wa,this.ellipsis=Aa,this.lastMeasureKey="",this.cachedLines=null,this.cachedLinesKey="",this.lastPaintedTextWidth=0,this.text=e,i&&(i.font&&(this.font=i.font),i.fontSize!==void 0&&(this.fontSize=i.fontSize),i.lineHeightPx!==void 0&&(this.lineHeightPx=i.lineHeightPx),i.color&&(this.color=i.color),i.wordWrap!==void 0&&(this.wordWrap=i.wordWrap),i.lineHeight!==void 0&&(this.lineHeight=i.lineHeight,this.lineHeightPx=void 0),i.overflow!==void 0&&(this.overflow=i.overflow),i.textOverflow!==void 0&&(this.textOverflow=i.textOverflow),i.ellipsis!==void 0&&(this.ellipsis=i.ellipsis),i.maxLines!==void 0&&(this.maxLines=i.maxLines),i.autoTooltip!==void 0&&(this.autoTooltip=i.autoTooltip))}measure(t){const{font:e,text:i,wordWrap:o,lineHeight:n,rect:s,fontSize:c}=this,{lineHeightPx:a}=bo(e,n,c,this.lineHeightPx);this.isSingleLineClampEnabled()?this.measureSingleLineClamp(t,e,i,a,s):o?this.measureWordWrap(t,e,i,a,s):this.measureSingleLine(t,e,i,a,s)}measureWordWrap(t,e,i,o,n){const s=So(this.style.width,n.width);if(s>0){const c=this.getResolvedMaxLines(),u=!(this.overflow==="hidden"&&c!==void 0&&c>1&&Ma(i)),d=Ln(e,i,s,u);(d!==this.cachedLinesKey||this.cachedLines===null)&&(this.cachedLines=ka(t,i,e,s,u),this.cachedLinesKey=d),n.width=s;const l=c!==void 0&&this.overflow==="hidden"?Math.min(this.cachedLines.length,c):this.cachedLines.length;n.height=l*o}else n.width=We(t,i,e),n.height=o,this.cachedLines=null}measureSingleLineClamp(t,e,i,o,n){const s=So(this.style.width,n.width);s>0?(n.width=s,n.height=o):(n.width=We(t,i,e),n.height=o),this.cachedLines=null}measureSingleLine(t,e,i,o,n){const s=Ra(e,i,o);s!==this.lastMeasureKey&&(this.lastMeasureKey=s,n.width=We(t,i,e),n.height=o),this.cachedLines=null}getLastPaintedTextWidth(){return this.lastPaintedTextWidth}getTooltip(){if(this.tooltip)return this.tooltip;const t=this.autoTooltip;if(!t)return;const e=typeof t=="object"?t:void 0;if(!(e?e.enabled!==!1:t===!0)||!this.computeIsTruncated())return;let o=this.text;if(e&&typeof e.text=="function"?o=e.text(this.text):e&&typeof e.text=="string"&&(o=e.text),o===null||o==="")return;if(!e)return o;const{enabled:n,text:s,...c}=e;return{...c,text:o}}computeIsTruncated(){if(this.overflow!=="hidden"||this.textOverflow!=="ellipsis")return!1;const t=Pa();if(!t)return!1;const e=this.cachedLines;if(e!==null&&e.length>0){const i=this.getResolvedMaxLines();return i===void 0?!1:Fo({ctx:t,lines:e,font:this.font,maxWidth:this.rect.width,maxLines:i,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).didClamp}return Ki({ctx:t,text:this.text,font:this.font,maxWidth:this.rect.width,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).didTruncate}getResolvedMaxLines(){if(this.maxLines===void 0||!Number.isFinite(this.maxLines)||this.maxLines<=0)return;const t=Math.floor(this.maxLines);return t>0?t:void 0}isSingleLineClampEnabled(){return this.wordWrap&&this.overflow==="hidden"&&this.getResolvedMaxLines()===1}isMultilineClampEnabled(){return this.wordWrap&&this.overflow==="hidden"&&this.getResolvedMaxLines()!==void 0}onPaint(t,e){const{font:i,text:o,rect:n,color:s}=this,c=this.cachedLines;c!==null&&c.length>0?this.paintMultiline(t,e,i,s,c,n):this.paintSingleLine(t,e,o,i,s,n)}paintMultiline(t,e,i,o,n,s){const{lineHeightPx:c}=bo(i,this.lineHeight,this.fontSize,this.lineHeightPx),a=this.getResolvedMaxLines(),u=this.isMultilineClampEnabled()&&a!==void 0?Fo({ctx:e,lines:n,font:i,maxWidth:s.width,maxLines:a,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).lines:n,d=u.length*c;let l=s.y+Math.max(0,(s.height-d)*.5);this.lastPaintedTextWidth=0;for(let h=0,f=u.length;h<f;h+=1){const g=u[h];g!==void 0&&(this.overflow==="hidden"?t.fillTextClipped(g,s.x,l,i,o,s,"top","left"):t.fillText(g,s.x,l,i,o,"top"),l+=c)}}paintSingleLine(t,e,i,o,n,s){const c=s.y+s.height*.5;if(this.overflow==="hidden"){const a=Ki({ctx:e,text:i,font:o,maxWidth:s.width,textOverflow:this.textOverflow,ellipsis:this.ellipsis});if(this.lastPaintedTextWidth=Math.min(a.width,Math.max(0,s.width)),a.text.length===0)return;t.fillTextClipped(a.text,s.x,c,o,n,s,"middle","left");return}this.lastPaintedTextWidth=We(e,i,o),t.fillText(i,s.x,c,o,n,"middle")}}function bo(r,t,e,i){const o=Ba(r,t,e,i);let n=Zi.get(o);if(n===void 0){const s=Ea.exec(r),c=e??(s&&s[1]!==void 0?Number(s[1]):Sa);n={fontSize:c,lineHeightPx:i??c*t},Zi.set(o,n)}return n}function We(r,t,e){const i=_a(e,t);let o=ji.get(i);return o===void 0&&(r.font=e,o=r.measureText(t).width,Hn(ji,i,o,Ia)),o}function ka(r,t,e,i,o){r.font=e;const n=Math.max(i,Ta),s=Ln(e,t,n,o);let c=Ji.get(s);if(!c){const a=o?e:`${e}${Da}`;c=za(ac.split(r,t,a,n,o)),Hn(Ji,s,c,Ha)}return c}function So(r,t){return typeof r=="number"&&r>0?r:t>0?t:0}function Ma(r){return La.test(r)}function za(r){if(Array.isArray(r))return r;const t=r;return t.lines&&Array.isArray(t.lines)?t.lines:[]}function Oa(){Zi.clear(),ji.clear(),Ji.clear(),pa()}const ge={250:15.625,32:2,28:1.75,24:1.5,20:1.25,18:1.125,16:1,14:.875,12:.75,8:.5,0:0},xo=16,de=16,Pn=90,wo="rgba(8, 8, 8, 0.08)",Na=4e3,Wa=1920,Ga="linear-gradient( 90deg, rgba(8, 8, 8, 0.09) 0%, rgba(8, 8, 8, 0.08) 6.25%, rgba(8, 8, 8, 0.05) 12.5%, rgba(8, 8, 8, 0.01) 25%, rgba(8, 8, 8, 0.05) 37.5%, rgba(8, 8, 8, 0.08) 43.75%, rgba(8, 8, 8, 0.09) 50%, rgba(8, 8, 8, 0.08) 56.25%, rgba(8, 8, 8, 0.05) 62.5%, rgba(8, 8, 8, 0.01) 75%, rgba(8, 8, 8, 0.05) 87.5%, rgba(8, 8, 8, 0.08) 93.75%, rgba(8, 8, 8, 0.09) 100% )",$a="linear-gradient( 90deg, rgba(8, 8, 8, 0.36) 0%, rgba(8, 8, 8, 0.32) 6.25%, rgba(8, 8, 8, 0.20) 12.5%, rgba(8, 8, 8, 0.04) 25%, rgba(8, 8, 8, 0.20) 37.5%, rgba(8, 8, 8, 0.32) 43.75%, rgba(8, 8, 8, 0.36) 50%, rgba(8, 8, 8, 0.08) 56.25%, rgba(8, 8, 8, 0.20) 62.5%, rgba(8, 8, 8, 0.04) 75%, rgba(8, 8, 8, 0.20) 87.5%, rgba(8, 8, 8, 0.32) 93.75%, rgba(8, 8, 8, 0.36) 100% )";let Ao=null;const Ua={right:90,left:270,top:0,bottom:180,"top right":45,"right top":45,"bottom right":135,"right bottom":135,"bottom left":225,"left bottom":225,"top left":315,"left top":315};class Bn extends Ft{constructor(t,e){super(t),this._gradientStops=null,this._gradientAngle=Pn;const i=(e==null?void 0:e.customGradientColor)??(e!=null&&e.lighter?$a:Ga),o=qa(i);o&&(this._gradientStops=o.stops,this._gradientAngle=o.angle),this.borderRadius=Xa(e==null?void 0:e.roundness),this.animated=(e==null?void 0:e.animated)??!0,this.shimmerDuration=(e==null?void 0:e.shimmerDuration)??Na}measure(t){const{style:e,rect:i}=this;typeof e.width=="number"&&(i.width=e.width),typeof e.height=="number"&&(i.height=e.height)}onPaint(t,e){var f;const{x:i,y:o,width:n,height:s}=this.rect;if(n<=0||s<=0)return;const{_gradientStops:c,borderRadius:a}=this;if(!c||c.length<2){a>0?t.roundedRect(i,o,n,s,a,{fillStyle:wo}):t.fillRect(i,o,n,s,wo);return}const u=t.getAnimationContext(),d=u==null?void 0:u.frameTime;if(!this.animated||d===void 0){t.linearGradientRect(i,o,n,s,a,c,this._gradientAngle);return}Ao??(Ao=d);const h=(d-Ao)%this.shimmerDuration/this.shimmerDuration;t.custom(g=>{g.save(),g.beginPath(),a>0?g.roundRect(i,o,n,s,a):g.rect(i,o,n,s),g.clip();const{startX:C,startY:v,endX:b,endY:y}=Ka(i,o,s,h),S=g.createLinearGradient(C,v,b,y);for(const x of c)S.addColorStop(x.offset,x.color);g.fillStyle=S,g.fillRect(i,o,n,s),g.restore()}),(f=u==null?void 0:u.requestAnimationFrame)==null||f.call(u)}}function Eo(r){return r in ge}function Xa(r){if(r===void 0)return ge[xo]*de;if(typeof r=="number")return Eo(r)?ge[r]*de:r;const t=r.trim(),e=Number(t);if(!Number.isNaN(e))return Eo(e)?ge[e]*de:e;const i=t.match(/^(-?\d+(?:\.\d+)?)px$/i);if(i){const[,n]=i;return parseFloat(n)}const o=t.match(/^(-?\d+(?:\.\d+)?)rem$/i);if(o){const[,n]=o;return parseFloat(n)*de}return ge[xo]*de}function Va(r){var i;const t=r.trim(),e=t.match(/^var\s*\(\s*[^,]+,\s*([\s\S]+)\s*\)$/i);return((i=e==null?void 0:e[1])==null?void 0:i.trim())??t}function Ya(r,t){switch(t.toLowerCase()){case"rad":return r*180/Math.PI;case"turn":return r*360;case"grad":return r*180/200;default:return r}}function qa(r){const e=Va(r).match(/^linear-gradient\s*\(([\s\S]+)\)$/i);if(!(e!=null&&e[1]))return null;const i=[];let o="",n=0;for(const h of e[1])h==="("&&n++,h===")"&&n--,h===","&&n===0?(i.push(o.trim()),o=""):o+=h;o.trim()&&i.push(o.trim());const[s]=i;if(i.length<2||!s)return null;let c=Pn,a=0;const u=s.match(/^(-?\d+(?:\.\d+)?)(deg|rad|turn|grad)?$/i);if(u!=null&&u[1]){const[,h,f="deg"]=u;c=Ya(parseFloat(h),f),a=1}else if(s.startsWith("to ")){const h=s.substring(3).trim().toLowerCase(),f=Ua[h];f!==void 0&&(c=f,a=1)}const d=[],l=i.slice(a);for(let h=0;h<l.length;h++){const f=l[h];if(!f)continue;const g=f.trim().match(/^(#[0-9a-fA-F]{3,8}|rgba?\s*\([^)]+\)|hsla?\s*\([^)]+\)|[a-zA-Z]+)(?:\s+(-?\d+(?:\.\d+)?)(%))?$/);if(!(g!=null&&g[1]))continue;const[,C,v,b]=g,y=b==="%"?parseFloat(v)/100:l.length>1?h/(l.length-1):0;d.push({offset:Math.max(0,Math.min(1,y)),color:C})}return d.length<2?null:{stops:d,angle:c}}function Ka(r,t,e,i){const o=Wa,n=i*o,s=r-o+n,c=r+o+n,a=t+e/2;return{startX:s,startY:a,endX:c,endY:a}}function Za(r,t){const e=r.replace("#","");let i,o,n,s=255;e.length===3||e.length===4?(i=parseInt(e[0]+e[0],16),o=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),e.length===4&&(s=parseInt(e[3]+e[3],16))):(i=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),e.length===8&&(s=parseInt(e.slice(6,8),16)));const c=Math.round(s*t),a=u=>u.toString(16).padStart(2,"0");return`#${a(i)}${a(o)}${a(n)}${a(c)}`}function ja(r){return{default:{color:r.textPrimary,colorHover:r.textPrimaryHover,colorActive:r.textPrimaryActive},accent:{color:r.textAccent,colorHover:r.textAccentHover,colorActive:r.textAccentActive},secondary:{color:r.textSecondary,colorHover:r.textSecondaryHover,colorActive:r.textSecondaryActive},tertiary:{color:r.textTertiary,colorHover:r.textTertiaryHover,colorActive:r.textTertiaryActive},paragraph:{color:r.textParagraph,colorHover:r.textParagraphHover,colorActive:r.textParagraphActive},positive:{color:r.textPositive,colorHover:r.textPositiveHover,colorActive:r.textPositiveActive},warning:{color:r.textWarning,colorHover:r.textWarningHover,colorActive:r.textWarningActive},negative:{color:r.textNegative,colorHover:r.textNegativeHover,colorActive:r.textNegativeActive},clear:{color:r.textPrimary,colorHover:r.textPrimaryHover,colorActive:r.textPrimaryActive}}}const Ja="default",Li="pointer",Qa=.4,tl=2,el=1;class _n extends br{constructor(t,e,i){var o;super(t,e,i),this.view=Ja,this.disabled=!1,this.isHovered=!1,this.isActive=!1,this.hasCustomColor=!1,super.style={...super.style,cursor:Li},i&&(this.href=i.href,this.target=i.target,this.rel=i.rel,i.view!==void 0&&(this.view=i.view),i.disabled!==void 0&&(this.disabled=i.disabled),this.hasCustomColor=i.color!==void 0,(o=i.theme)!=null&&o.tokens&&(this.viewColors=ja(i.theme.tokens))),!this.hasCustomColor&&this.viewColors&&(this.color=this.viewColors[this.view].color)}set style(t){super.style={...super.style,cursor:Li,...t}}get style(){const t=super.style;return t.cursor=this.disabled?"not-allowed":Li,t}setOnClick(t){this.customClickHandler=t}resolveColor(){let t;if(this.hasCustomColor||!this.viewColors)t=this.color;else{const e=this.viewColors[this.view];this.isActive?t=e.colorActive:this.isHovered?t=e.colorHover:t=e.color}return this.disabled&&(t=Za(t,Qa)),t}onPaint(t,e){const i=this.color;this.color=this.resolveColor(),super.onPaint(t,e);const{view:o,isHovered:n,wordWrap:s}=this,a=!s&&(o==="default"||o==="clear"||!this.disabled&&n),u=this.getLastPaintedTextWidth();a&&u>0&&this.paintUnderline(t,u),this.color=i}paintUnderline(t,e){const{x:i,y:o,height:n}=this.rect,s=o+n+tl,c=this.resolveColor();t.custom(a=>{a.beginPath(),a.moveTo(i,s),a.lineTo(i+e,s),a.strokeStyle=c,a.lineWidth=el,a.stroke()})}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1,this.isActive=!1}onMouseDown(){this.disabled||(this.isActive=!0)}onMouseUp(){this.isActive=!1}onClick(t){if(this.disabled)return;let e=!1;const i=t.preventDefault;t.preventDefault=()=>{e=!0,i.call(t)},!(this.customClickHandler&&(this.customClickHandler(t),e))&&this.navigate()}navigate(){if(!this.href)return;const t=this.target||"_self";if(t==="_self")window.location.href=this.href;else{const e=this.rel??(t==="_blank"?"noopener,noreferrer":void 0);window.open(this.href,t,e)}}}let Ce=0;const Ze=new Set;function il(){Ce++,Ce===1&&Ze.forEach(t=>t(!0));let r=!1;return()=>{r||(r=!0,Ce--,Ce===0&&Ze.forEach(t=>t(!1)))}}function rl(){return Ce>0}function ol(r){return Ze.add(r),()=>{Ze.delete(r)}}const je="basic-grid-canvas-portal-hover",nl=400;let sl=0;const Pi="__canvasPortalTargetId";function cl(r){var i;if(!r)return"window";const t=r;if((i=t.dataset)!=null&&i.portalTargetId)return t.dataset.portalTargetId;const e=r;return e[Pi]||(e[Pi]=++sl),String(e[Pi])}const re=new Map;function al(r,t){return`${r??"default"}:${t??"default"}`}function Qi(r,t){const e=new CustomEvent(je,{detail:r});t?t.dispatchEvent(e):window.dispatchEvent(e)}function To(r){const t=re.get(r);t!==void 0&&(window.clearTimeout(t),re.delete(r))}function ll(r){const t=`${r}:`;for(const[e,i]of re.entries())e.startsWith(t)&&(window.clearTimeout(i),re.delete(e))}function ul(r,t,e){const i=window.setTimeout(()=>{re.delete(r),Qi(t,e)},nl);re.set(r,i)}function Jt(r,t,e){if(typeof window>"u")return;const i=cl(t),o=`${i}:${al(r.source,r.originId)}`;r.visible?(ll(i),Qi(r,t)):e?(To(o),Qi(r,t)):(To(o),ul(o,r,t))}function hl(r,t){if(typeof window>"u")return()=>{};const e=t??window,i=o=>{const n=o;n.detail&&r(n.detail)};return e.addEventListener(je,i),()=>{e.removeEventListener(je,i)}}const dl="cell";class yt{constructor(t,e){this.bounds=null,this.batcher=new oi,this.portalEventTarget=null,this.tooltipContext=void 0,this.rootNode=t,this.hoverController=new sr({onCursorChange:i=>{var o;return(o=this.onCursorChange)==null?void 0:o.call(this,i)},portalHoverDispatch:Jt,getPortalEventTarget:()=>this.portalEventTarget,portalSource:dl,getTooltipContext:()=>this.tooltipContext})}setPortalEventTarget(t){this.portalEventTarget=t}setTooltipContext(t){this.tooltipContext=t}setRootNode(t){this.rootNode=t}setOriginId(t){}render(t,e,i,o,n){this.bounds={...o??e},this.hoverController.setAbsoluteBounds(this.bounds),t.save(),t.translate(e.x,e.y),this.prepareRootNode(t,e),i?this.dispatchPointerEvent("mousemove",i.x,i.y):this.handleMouseLeave(),this.batcher.clear(),this.batcher.setAnimationContext(n),this.rootNode.paint(this.batcher,t),this.batcher.flush(t),t.restore()}dispatchPointerEvent(t,e,i,o){var d;if(!this.bounds)return{propagationStopped:!1,suppressGridDefault:!1};const n=this.rootNode.hitTest(e,i),s=(d=n.find(l=>l.interaction!==void 0))==null?void 0:d.interaction;let c=!1,a=!1;const u={type:t,x:e,y:i,originalEvent:o??{},target:n[0],stopPropagation:()=>{c=!0},preventDefault:()=>{a=!0,o==null||o.preventDefault()}};return n.length===0?(t==="mousemove"&&this.hoverController.handlePointerMove([],null),{propagationStopped:!1,suppressGridDefault:a,...s?{interaction:s}:{}}):(this.dispatchEventToNodes(n,u,t),t==="mousemove"&&this.hoverController.handlePointerMove(n,u),{propagationStopped:c,suppressGridDefault:a,...s?{interaction:s}:{}})}getInteractionAtPoint(t,e){var i;if(this.bounds)return(i=this.rootNode.hitTest(t,e).find(o=>o.interaction))==null?void 0:i.interaction}dispatchEventToNodes(t,e,i){let o=!1;const n={...e,stopPropagation:()=>{o=!0,e.stopPropagation()}};for(const s of t){if(o)break;const c={...n,currentTarget:s};this.invokeNodeHandler(s,i,c)}}invokeNodeHandler(t,e,i){switch(e){case"click":t.onClick({...i,cellBounds:this.bounds});break;case"mousedown":t.onMouseDown(i);break;case"mouseup":t.onMouseUp(i);break;case"dblclick":t.onDoubleClick(i);break;case"mousemove":t.onMouseMove(i);break;case"mouseenter":t.onMouseEnter(i);break;case"mouseleave":t.onMouseLeave(i);break}}handleMouseLeave(){this.hoverController.handlePointerLeave()}prepareRootNode(t,e){this.rootNode.rect.x=0,this.rootNode.rect.y=0,this.rootNode.rect.width=e.width,this.rootNode.rect.height=e.height,this.rootNode instanceof Ct?this.rootNode.performLayout(t):this.rootNode.measure(t)}computeCursor(t,e){return this.hoverController.computeCursor(t,e,this.rootNode)}getCurrentCursor(){return this.hoverController.getCurrentCursor()}forcePortalHide(){this.hoverController.handlePortalReset()}}const ai="canvas-cell";function Rn(r,t,e,i){return{kind:B.GridCellKind.Custom,allowOverlay:!1,readonly:!0,copyData:e??"",data:{kind:ai,render:r,onClick:t},...i}}function Sr(r){var e;const t=r;return!!(t&&t.kind===B.GridCellKind.Custom&&((e=t.data)==null?void 0:e.kind)===ai)}const ve=5,kn=[["hoverX","hoverY"],["mouseX","mouseY"],["pointerX","pointerY"],["posX","posY"],["x","y"]],Mn="default",zn="pointer";function On(r,t){for(const[e,i]of kn){const o=r[e],n=r[i];if(typeof o=="number"&&typeof n=="number"&&!Number.isNaN(o)&&!Number.isNaN(n)){if(Nn(o,n,t))return{x:o-t.x,y:n-t.y};if(Wn(o,n,t))return{x:o,y:n}}}}function Nn(r,t,e){return r>=e.x&&r<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}function Wn(r,t,e){return r>=-ve&&r<=e.width+ve&&t>=-ve&&t<=e.height+ve}function Gn(r,t,e){if((r==null?void 0:r.canvasRoot)instanceof yt){const i=e?"nativeEvent"in e?e.nativeEvent:e:void 0;return r.canvasRoot.dispatchPointerEvent("click",t.x,t.y,i)}return{propagationStopped:!1,suppressGridDefault:!1}}function $n(r,t){if(r!=null&&r.clickHandlers&&Array.isArray(r.clickHandlers)){for(const{area:e,handler:i}of r.clickHandlers)if(yr(t.x,t.y,e))return i(),!0}return!1}function Un(r,t,e,i,o,n){const{onClick:s}=r.data;return s?!!s(t.x,t.y,e,i,o,n??void 0):!1}const tr=new WeakMap,Xn=new Map;function Vn(r,t,e){const i={...e??{}};return delete i.hoveredAreas,Xn.set(r,i),t.data.renderData=i,i}function ie(r,t){return t.data.renderData??Xn.get(r)}function Yn(r,t){var i,o;(((i=tr.get(r))==null?void 0:i.hovered)??!1)!==t&&(tr.set(r,{hovered:t}),t?(o=r.onMouseEnter)==null||o.call(r):fl(r))}function fl(r){const{renderData:t}=r;(t==null?void 0:t.canvasRoot)instanceof yt&&t.canvasRoot.forcePortalHide()}function qn(r){var t;return(t=tr.get(r))==null?void 0:t.hovered}function Kn(r,t,e,i){var o;if(r instanceof yt)if(t){if(e.event){const s="nativeEvent"in e.event?e.event.nativeEvent:e.event;r.dispatchPointerEvent("mousemove",t.x,t.y,s)}const n=r.computeCursor(t.x,t.y);n&&n!==Mn&&((o=i.overrideCursor)==null||o.call(i,n))}else r.handleMouseLeave(),r.forcePortalHide()}function Zn(r,t,e,i,o){var a;const n=!!(t&&e.some(u=>yr(t.x,t.y,u))),s=qn(r)??!1,c=!!t;c!==s&&Yn(r,c),n&&!i&&((a=o.overrideCursor)==null||a.call(o,zn))}function xr({cell:r,rect:t,relativePoint:e,renderData:i,rowData:o,rowIndex:n,event:s}){const c=Gn(i,e,s);return c.propagationStopped?{handled:!0,propagationStopped:!0,suppressGridDefault:c.suppressGridDefault}:$n(i,e)?{handled:!0,propagationStopped:!1,suppressGridDefault:c.suppressGridDefault}:Un(r,e,t,o,n,i)?{handled:!0,propagationStopped:!1,suppressGridDefault:c.suppressGridDefault}:{handled:!1,propagationStopped:!1,suppressGridDefault:c.suppressGridDefault}}function jn(r){const t=r.selection==="keep",e=r.cellClick==="stop",i=r.editor==="never",o=r.contextMenu==="keep-selection"?"manual-keep-selection":r.contextMenu==="none"?"none":"normal";return{suppressEarlyGridSelect:t,suppressExternalCellClick:e,suppressGridDefaultFor:{pointerdown:t,click:i,contextmenu:o!=="normal"},contextMenuMode:o,...r.editor==="open-on-click"?{editorRequest:{target:"self"}}:{}}}function gl({decision:r,propagationStopped:t,suppressGridDefault:e}){const i=r.suppressGridDefaultFor.click||e,o={suppressExternalCellClick:r.suppressExternalCellClick||t,suppressGridDefaultForClick:i};return!i&&r.editorRequest&&(o.editorRequest=r.editorRequest),o}function Jn({renderData:r,relativePoint:t}){const e=(r==null?void 0:r.canvasRoot)instanceof yt?r.canvasRoot.getInteractionAtPoint(t.x,t.y):void 0;return e?{handled:!0,suppressEarlyGridSelect:jn(e).suppressEarlyGridSelect,interaction:e}:{handled:!1,suppressEarlyGridSelect:!1}}function wr(r={}){return{kind:B.GridCellKind.Custom,isMatch:t=>{var e;return((e=t.data)==null?void 0:e.kind)===ai},needsHover:!0,needsHoverPosition:!0,onSelect:t=>{var h;const e=t.cell,i=t.bounds,o=Gi(t);if(!o)return;const n=$i(o,i),s=Xe(t),c=ee(s,i),a=ie(c,e),u=Jn({renderData:a,relativePoint:n}),d=t.location??[s.colIndex,s.rowIndex],l=u.interaction&&r.beginOrGetInteractionSession?r.beginOrGetInteractionSession({cell:d,relativePoint:n,interaction:u.interaction,source:"pointer",...t.button!==void 0?{button:t.button}:{}}):void 0;(l!=null&&l.decision.suppressEarlyGridSelect||u.suppressEarlyGridSelect)&&((h=t.preventDefault)==null||h.call(t))},onClick:t=>{var h,f;const e=t.cell,i=t.bounds,o=Gi(t);if(!o)return;const n=$i(o,i),s=Xe(t),c=ee(s,i),a=ie(c,e),u=t.location??[s.colIndex,s.rowIndex],l=((h=r.consumeCanvasClickResult)==null?void 0:h.call(r,{cell:u,relativePoint:n,...t.button!==void 0?{button:t.button}:{}}))??xr({cell:e,rect:i,relativePoint:n,renderData:a,rowData:t.row??t.rowData,rowIndex:s.rowIndex,event:t.event});l.suppressGridDefault&&((f=t.preventDefault)==null||f.call(t)),l.handled},draw:(t,e)=>{const{ctx:i,rect:o,theme:n}=t,{render:s}=e.data,c=t.cellFillColor!==void 0?{...n,bgCell:t.cellFillColor}:n,a=Xe(t),u=ee(a,o),d={hoverX:t.hoverX,hoverY:t.hoverY,row:t.row,rowData:t.rowData,event:t.event,frameTime:t.frameTime,requestAnimationFrame:t.requestAnimationFrame},l=hn(t.hoverX,t.hoverY,o)??On(d,o);i.save();const h=ie(u,e),f=s(i,o,c,l==null?void 0:l.x,l==null?void 0:l.y,{...d,canvasRoot:h==null?void 0:h.canvasRoot}),g=(f==null?void 0:f.hoveredAreas)??[];Vn(u,e,f);const C=(f==null?void 0:f.canvasRoot)??(h==null?void 0:h.canvasRoot);Kn(C,l,d,t),Zn(e.data,l,g,C,t),i.restore()},onPaste:()=>{}}}const Cl=wr(),Je=new Map;function Qn(r){const t=vl(r),e=Je.get(t);if(e)return e;const o=lc.renderToString(r).match(/<svg[\s\S]*?<\/svg>/);if(!o)return console.warn("Could not extract SVG from React icon component:",r.type),"";const n=o[0];return Je.set(t,n),n}function vl(r){const t=r.type,e=typeof t=="function"||typeof t=="object"?t.displayName||t.name||"Anonymous":String(t),{size:i,color:o,className:n}=r.props||{},s=JSON.stringify({size:i,color:o,className:n});return`${e}:${s}`}function At(r){return m.isValidElement(r)}function mt(r){return typeof r=="string"?r:At(r)?Qn(r):""}function ml(){Je.clear()}function pl(){return Je.size}const er=r=>{if(r===void 0)return;if(typeof r=="number")return r;const t=r.trim();if(t==="100%")return"100%";const e=t.match(/^(-?\d+(?:\.\d+)?)px$/i);if(e)return Number(e[1]);const i=t.match(/^(-?\d+(?:\.\d+)?)rem$/i);if(i)return Number(i[1])*16;const o=Number(t);if(!Number.isNaN(o))return o},Do={small:{radius:4,stroke:1.5},medium:{radius:4,stroke:1.5},big:{radius:6,stroke:2}};function yl(r,t,e,i,o,n,s,c,a,u,d=!1,l=!1){const f=s-0,C=Math.min(f-0,cr),v=n==="auto"?C:n,b=e+0,y=(a==null?void 0:a.rowSize)||"medium",S=!i&&!o,x=zt(l,{x:t,y:e,width:v,height:s}),A=Pc(a,i,o,x,d),F=t+v*.5,I=b+f*.5,E=F-C*.5,L=I-C*.5;return r.roundedRect(t,b,v,f,Do[y].radius,{fillStyle:A.bgColor,strokeStyle:A.borderColor,lineWidth:S?Do[y].stroke:void 0}),ft(r,c,E,L,C,A.iconColor),{x:t,y:b,width:v,height:f}}const Fl=28,bl="default",Sl="s",Io="pointer",xl=20,ir={indeterminateIcon:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke-linecap="round" stroke-width="2" stroke="currentColor" d="m5.09449,9.0315l8,0"></path></svg>',checkedIcon:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" fill="none"><path fill="currentColor" d="m5.70711,8.15582c-0.39053,-0.39052 -1.02369,-0.39052 -1.41422,0c-0.39052,0.39053 -0.39052,1.02369 0,1.41422l3.70666,3.70666l6.71095,-6.70248c0.3908,-0.39027 0.3912,-1.02344 0.0009,-1.41421c-0.3903,-0.39077 -1.02344,-0.39117 -1.41421,-0.00089l-5.29674,5.29004l-2.29334,-2.29334z"></path></svg>'},wl=Object.values(ir),Al={accentColor:"#1e88e5",accentFg:"#ffffff"};class El extends Ft{constructor(t,e,i=!1,o=!1,n){super(t),this.view=bl,this.buttonSize=Sl,this.isHovered=!1,this.useNewApi=!1,this.icon=e,this.checked=i,this.indeterminate=o,this.size=(n==null?void 0:n.size)??"auto",this.theme=n==null?void 0:n.theme,this.view=(n==null?void 0:n.view)??"primary",this.disabled=(n==null?void 0:n.disabled)??!1,super.style={...super.style,cursor:this.disabled?"auto":Io},!this.disabled&&(n!=null&&n.onClick)&&(this.onClick=s=>{var c;return(c=n.onClick)==null?void 0:c.call(n,s)})}set style(t){super.style={...super.style,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=Io),t}measure(t){if(this.useNewApi){const e=at[this.buttonSize];this.rect.height=e.height,this.rect.width=e.height}else{const e=Tl(this.size);this.rect.height=e.height,this.rect.width=e.width}}onPaint(t,e){const{x:i,y:o,width:n,height:s}=this.rect;yl(t,i,o,this.checked,this.indeterminate,n,s,this.icon,this.theme??Al,this.view,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}}function Tl(r,t){const e=typeof r=="number"?r:Fl,i=0,o=oe,n=Math.min(e-o*2-ne,xl),s=typeof r=="number"?r:n+i*2;return{height:e,width:s,paddingX:i,paddingY:o,iconSize:n}}const Dl=({backgroundColor:r,__backgroundColorResolver:t},e)=>(t==null?void 0:t(e))??r,vt=r=>{const t=e=>null;return t.__canvasType=r,t},Il=m.memo(({cellId:r,renderContent:t,nodeRegistry:e,onRegistryChange:i})=>{const o=t(),n=m.useRef(null);return m.useLayoutEffect(()=>{const s=e.current,c=n.current;c&&c!==r&&s.delete(c);const a=s.get(r),u=a!==void 0;s.set(r,o),u&&a!==o&&(i==null||i()),n.current=r},[r,o,e,i]),m.useLayoutEffect(()=>()=>{const s=e.current;n.current&&(s.delete(n.current),n.current=null)},[e]),null}),Hl=vt("Skeleton"),Ll=vt("Container"),Pl=vt("Text"),Bl=vt("Icon"),_l=vt("Button"),Rl=vt("IconButton"),kl=vt("EmbedIconButton"),Ml=vt("Rect"),zl=vt("Badge"),Ol=vt("Checkbox"),Nl=vt("Link"),me={Container:Ll,Text:Pl,Icon:Bl,Button:_l,IconButton:Rl,EmbedIconButton:kl,Checkbox:Ol,Rect:Ml,Badge:zl,Skeleton:Hl,Link:Nl,icon:mt};function dt(r,t){if(r)return function(e){r.call(this,e)}}function Qe({element:r,idPrefix:t="root",theme:e}){const i=[],o=ts(r,t,0,i,e);if(i.length>0){const n=new Map;for(const{icon:s,size:c}of i){if(!s)continue;const a=n.get(c)??[];a.push(s),n.set(c,a)}n.forEach((s,c)=>{vn(s,{size:c})})}return o}function rr(r){return r==null?"":typeof r=="string"||typeof r=="number"?String(r):Array.isArray(r)?r.map(rr).join(""):""}function Ho(r,t,e){const i=r.fontMetrics,o=r.fonts;if(i===void 0||o===void 0)return{};const n=t??r.baseFontStyle,s=Object.keys(o).find(a=>o[a]===n);if(s===void 0)return{};const c=i[s];return c===void 0?{}:{fontSize:c.fontSize,...e===void 0?{lineHeightPx:c.lineHeightPx}:{}}}function ts(r,t,e,i,o){if(!r||!m.isValidElement(r))throw new Error("Invalid element. Use Canvas.* components.");const n=r.type,s=n.__canvasType;if(!s)throw new Error(`Unknown canvas component. Use Canvas.* components. Got: ${(n==null?void 0:n.name)||n}`);const c=r.props,u=(r.key!=null?String(r.key):null)??e,d=c.id??`${t}-${s.toLowerCase()}-${u}`,l=g=>At(g)?mt(g):g;if(s==="Icon"&&c.icon)i.push({icon:l(c.icon),size:c.size??16});else if(s==="IconButton"&&c.icon){const g=c.buttonSize??"s",{iconSize:C}=at[g];i.push({icon:l(c.icon),size:C})}else if(s==="EmbedIconButton"&&c.icon){const g=c.buttonSize??"s",C=c.overrideIconSize??at[g].iconSize;i.push({icon:l(c.icon),size:C})}else if(s==="Checkbox")wl.forEach(g=>{i.push({icon:l(g),size:20})});else if(s==="Button"){const g=c.size??"s",{iconSize:C}=at[g];c.leftIcon&&i.push({icon:l(c.leftIcon),size:C}),c.rightIcon&&i.push({icon:l(c.rightIcon),size:C})}else if(s==="Badge"){const g=c.size??"s",v={xs:10,s:12,m:14,l:16}[g]??12;c.leftIcon&&i.push({icon:l(c.leftIcon),size:v}),c.rightIcon&&i.push({icon:l(c.rightIcon),size:v})}const h=Wl(s,d,c,o);if(c.portalHoverEnabled&&(h.portalHoverEnabled=!0),c.tooltip!==void 0&&(h.tooltip=c.tooltip),c.autoTooltip!==void 0){const g=c.autoTooltip;(g===!0||typeof g=="object"&&g!==null&&g.enabled!==!1)&&(h.portalHoverEnabled=!0)}c.interaction!==void 0&&(h.interaction=jo(c.interaction)),typeof c.zIndex=="number"&&(h.zIndex=c.zIndex),c.style&&(h.style=c.style);const{children:f}=c;return f&&h instanceof Ct&&m.Children.toArray(f).forEach((C,v)=>{if(m.isValidElement(C)){const b=ts(C,d,v,i,o);h.addChild(b)}}),h}function Wl(r,t,e,i){switch(r){case"Container":{const o=e,{id:n,gap:s,columnGap:c,rowGap:a,position:u,left:d,top:l,right:h,bottom:f,zIndex:g,onClick:C,onMouseEnter:v,onMouseLeave:b,onMouseDown:y,backgroundColor:S,__backgroundColorResolver:x,portalHoverEnabled:A,...F}=o,I={...F,columnGap:c??s??0,rowGap:a??s??0},E=new Ct(t,I,Dl(o,i));u&&(E.position=u),d!==void 0&&(E.left=d),l!==void 0&&(E.top=l),h!==void 0&&(E.right=h),f!==void 0&&(E.bottom=f);const L=dt(C),P=dt(v),it=dt(b),z=dt(y);return L&&(E.onClick=L),P&&(E.onMouseEnter=P),it&&(E.onMouseLeave=it),z&&(E.onMouseDown=z),E}case"Text":{const{children:o,font:n,color:s,wordWrap:c,lineHeight:a,overflow:u,textOverflow:d,ellipsis:l,maxLines:h,autoTooltip:f,position:g,left:C,top:v,right:b,bottom:y,portalHoverEnabled:S}=e,x=rr(o),A=i.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';let F;n?F=/["']|sans-serif|serif|monospace/i.test(n)?n:`${n} ${A}`:F=i.baseFontStyle?`${i.baseFontStyle} ${A}`:`13px ${A}`;const I=Ho(i,n,a),E=new br(t,x,{font:F,...I,color:s,wordWrap:c,lineHeight:a,overflow:u,textOverflow:d,ellipsis:l,maxLines:h,autoTooltip:f});return g&&(E.position=g),C!==void 0&&(E.left=C),v!==void 0&&(E.top=v),b!==void 0&&(E.right=b),y!==void 0&&(E.bottom=y),E}case"Icon":{const{icon:o,size:n,color:s,backgroundColor:c,position:a,left:u,top:d,right:l,bottom:h,onClick:f,onMouseEnter:g,onMouseLeave:C,onMouseDown:v}=e,b=At(o)?mt(o):o,y=new An(t,b,{size:n,color:s});c&&(y.backgroundColor=c),a&&(y.position=a),u!==void 0&&(y.left=u),d!==void 0&&(y.top=d),l!==void 0&&(y.right=l),h!==void 0&&(y.bottom=h);const S=dt(f),x=dt(g),A=dt(C),F=dt(v);return S&&(y.onClick=S),x&&(y.onMouseEnter=x),A&&(y.onMouseLeave=A),F&&(y.onMouseDown=F),y}case"Button":{const{children:o,variant:n,view:s,size:c,leftIcon:a,rightIcon:u,disabled:d,position:l,left:h,top:f,right:g,bottom:C,onClick:v}=e,b=typeof o=="string"?o:"",y=At(a)?mt(a):a,S=At(u)?mt(u):u,x=new wn(t,b,{variant:n,view:s,size:c,leftIcon:y,rightIcon:S,disabled:d,theme:i});if(l&&(x.position=l),h!==void 0&&(x.left=h),f!==void 0&&(x.top=f),g!==void 0&&(x.right=g),C!==void 0&&(x.bottom=C),!d){const A=dt(v);A&&(x.onClick=A)}return x}case"EmbedIconButton":case"IconButton":{const{icon:o,size:n,variant:s,view:c,buttonSize:a,overrideSquareSize:u,overrideIconSize:d,disabled:l,position:h,left:f,top:g,right:C,bottom:v,onClick:b}=e,y=At(o)?mt(o):o,S=r==="IconButton"?En:Xi,x=new S(t,y,{size:n,variant:s,view:c,buttonSize:a,overrideSquareSize:u,overrideIconSize:d,disabled:l});if(x instanceof Xi){const{iconColor:A,iconColorHovered:F,overrideWidth:I}=e;I!==void 0&&(x.overrideWidth=I),A!==void 0&&(x.iconColor=A),F!==void 0&&(x.iconColorHovered=F)}if(h&&(x.position=h),f!==void 0&&(x.left=f),g!==void 0&&(x.top=g),C!==void 0&&(x.right=C),v!==void 0&&(x.bottom=v),!l){const A=dt(b);A&&(x.onClick=A)}return x}case"Checkbox":{const{checked:o,indeterminate:n,size:s="auto",theme:c,view:a,buttonSize:u,disabled:d,position:l,left:h,top:f,right:g,bottom:C,onClick:v}=e,b=mt(o?ir.checkedIcon:ir.indeterminateIcon),y=new El(t,b,o,n,{size:s,theme:c??i,view:a,buttonSize:u,disabled:d});if(l&&(y.position=l),h!==void 0&&(y.left=h),f!==void 0&&(y.top=f),g!==void 0&&(y.right=g),C!==void 0&&(y.bottom=C),!d){const S=dt(v);S&&(y.onClick=S)}return y}case"Rect":{const{color:o,borderColor:n,borderWidth:s,position:c,left:a,top:u,right:d,bottom:l}=e,h=new Tn(t,o);return n&&(h.borderColor=n),s&&(h.borderWidth=s),c&&(h.position=c),a!==void 0&&(h.left=a),u!==void 0&&(h.top=u),d!==void 0&&(h.right=d),l!==void 0&&(h.bottom=l),h}case"Badge":{const{text:o,view:n,size:s,transparent:c,clear:a,leftIcon:u,rightIcon:d,customColor:l,customBackgroundColor:h,position:f,left:g,top:C,right:v,bottom:b,portalHoverEnabled:y,pilled:S}=e,x=At(u)?mt(u):u,A=At(d)?mt(d):d,F=new xn(t,o,{view:n,size:s,transparent:c,clear:a,leftIcon:x,rightIcon:A,pilled:S,customColor:l,customBackgroundColor:h,theme:i});return f&&(F.position=f),g!==void 0&&(F.left=g),C!==void 0&&(F.top=C),v!==void 0&&(F.right=v),b!==void 0&&(F.bottom=b),F}case"Skeleton":{const{width:o,height:n,roundness:s,lighter:c,customGradientColor:a,animated:u,shimmerDuration:d,style:l,portalHoverEnabled:h}=e,f=er(o),g=er(n),C={...l,...f!==void 0?{width:f}:null,...g!==void 0?{height:g}:null},v=new Bn(t,{roundness:s,lighter:c,customGradientColor:a,shimmerDuration:d,animated:u});return v.style=C,v}case"Link":{const{children:o,href:n,target:s,view:c,disabled:a,font:u,color:d,wordWrap:l,lineHeight:h,overflow:f,textOverflow:g,ellipsis:C,maxLines:v,position:b,left:y,top:S,right:x,bottom:A,onClick:F,portalHoverEnabled:I}=e,E=rr(o),L=i.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';let P;u?P=/["']|sans-serif|serif|monospace/i.test(u)?u:`${u} ${L}`:P=i.baseFontStyle?`${i.baseFontStyle} ${L}`:`13px ${L}`;const it=Ho(i,u,h),z=new _n(t,E,{font:P,...it,color:d,wordWrap:l,lineHeight:h,overflow:f,textOverflow:g,ellipsis:C,maxLines:v,href:n,target:s,view:c,disabled:a,theme:i});if(b&&(z.position=b),y!==void 0&&(z.left=y),S!==void 0&&(z.top=S),x!==void 0&&(z.right=x),A!==void 0&&(z.bottom=A),!a){const Q=dt(F);Q&&z.setOnClick(Q)}return z}default:throw new Error(`Unknown canvas component type: ${r}`)}}const Gl='400 normal 1rem/1.25rem "SB Sans Text", sans-serif, Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif',$l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Ul=30,Xl=50,Vl=3;async function es(){return typeof document>"u"||!document.fonts?Promise.resolve():document.fonts.ready.then(()=>{})}function is(r={}){const{testFont:t=Gl,testText:e=$l,maxChecks:i=Ul,checkInterval:o=Xl,stableThreshold:n=Vl}=r;return new Promise(s=>{if(typeof document>"u"){s();return}const a=document.createElement("canvas").getContext("2d");if(!a){s();return}let u=-1,d=0,l=0;const h=()=>{a.font=t;const{width:f}=a.measureText(e);f!==u?(u=f,d=0):d+=1,l+=1,d>=n||l>=i?s():setTimeout(h,o)};h()})}function rs(r){return es().then(()=>is(r))}function Ar({dataEditorRef:r,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){const o=r.current;if(!o)return;const n=Math.min(30,t),s=e,c=[];for(let a=0-i;a<n;a+=1)for(let u=0;u<s;u+=1)c.push({cell:[u,a]});c.length>0&&o.updateCells(c)}function Er(r){let t=null;return()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,r()}))}}function Yl(){const r=m.useRef(null),t=m.useCallback(()=>(r.current||(r.current=new Qo),r.current),[]);return{registry:t(),getRegistry:t}}function os({dataEditorRef:r,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){m.useLayoutEffect(()=>{const o=Er(()=>{Oa(),Ar({dataEditorRef:r,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i})});rs().then(o)},[r,t,e,i])}function ns({dataEditorRef:r,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){m.useEffect(()=>{const o=Er(()=>{Ar({dataEditorRef:r,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i})});return gn(o)},[r,t,e,i])}B.GridCellKind.Text;const ti=(r,t)=>({kind:B.GridCellKind.Text,data:r,displayData:r,allowOverlay:!0,readonly:!0,...t}),Qt=r=>{const{data:t,...e}=r??{};return{kind:B.GridCellKind.Text,data:"",displayData:"",allowOverlay:!0,readonly:!0,...e}};function ss(r){const t=r;return!!(t!=null&&t.kind)}function ql(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function Tr(r){return typeof r!="object"&&!Array.isArray(r)||r===null}function cs(r){return r==null||typeof r=="boolean"}const li=r=>{if(!r||!m.isValidElement(r))return!1;const t=r.type;return!!(t!=null&&t.__canvasType)},Dr=r=>typeof r=="string",or=r=>Dr(r)?!0:li(r),Kl=r=>Dr(r)?!0:li(r),Lo=({jsxElement:r,canvasCellCache:t,cellInfo:e,options:i})=>{let o=null;if(ss(r))return{...r,...i};if(Tr(r))return cs(r)?Qt(i):ti(String(r),i);if(!li(r)){const b="передан НЕ CanvasEl";return ti(b,{...i,data:b})}const{colInd:n,rowInd:s,row:c,column:a}=e,{id:u}=a,d=i.getPortalEventTarget;let l=null;const h=`cell-${n}-${s}`,f=(b,y,S,x,A,F)=>{let I=(F==null?void 0:F.canvasRoot)instanceof yt?F.canvasRoot:l;{if(!r)return{};const P=Qe({element:r,idPrefix:`cell-${n}-${s}-${u}`,theme:S});I?(I.setRootNode(P),I.setOriginId(h)):I=new yt(P,h),l=I}if(!I)return{};const E=x!==void 0&&A!==void 0?{x,y:A}:void 0;I.rootNode.style={width:y.width,height:y.height},o||(o=b.canvas.getBoundingClientRect());const L={x:o.left+y.x,y:o.top+y.y,width:y.width,height:y.height};return I.setPortalEventTarget((d==null?void 0:d())??null),I.setTooltipContext({column:e.column,row:e.row,ctxs:e.ctxs,refTable:i.refTable}),I.render(b,y,E,L,{frameTime:F==null?void 0:F.frameTime,requestAnimationFrame:F==null?void 0:F.requestAnimationFrame}),l=I,{canvasRoot:I}},{data:g,...C}=i,v=a.copyData?typeof a.copyData=="function"?a.copyData(c):a.copyData:g;return Rn(f,void 0,v,C)},Ir=(r,t,e)=>r?t>=r.x&&t<r.x+r.width&&e>=r.y&&e<r.y+r.height:!1,Zl=r=>{const t=r.findIndex(e=>!e.isServiceColumn);return t===-1?r.length:t},jl=(r,t)=>{if(!r)return;const e=Math.max(r.x,t),i=Math.max(0,r.x+r.width-e);if(!(i<=0||r.height<=0))return{x:e,y:r.y,width:i,height:r.height}};function as({cellsSelectionMode:r,selection:t,baseTheme:e,serviceColumnsCount:i,activeDataRange:o,outlineRange:n,checkboxSelectedRowIndexes:s,errorCellRanges:c,highlightRegionsExternal:a}){return m.useMemo(()=>{const u=[...a??[]],d=t.current,l=()=>{if(c!=null&&c.length)for(const v of c)u.push({color:e.errorOutlineColor,range:v,style:"solid-outline"})};if(!d||r==="disabled")return l(),u.length>0?u:void 0;const[,h]=d.cell,g=(s==null?void 0:s.has(h))??!1?e.selectionActiveCheckboxBg:e.selectionActiveBg,C=e.selectionServiceActiveBg;return o&&i>0&&u.push({color:C,range:{x:0,y:o.y,width:i,height:o.height},style:"no-outline"}),o&&r==="cell"&&o.width===1&&o.height===1&&u.push({color:g,range:o,style:"no-outline"}),n&&u.push({color:e.accentColor,range:n,style:"solid-outline"}),l(),u.length>0?u:void 0},[r,t,e.selectionActiveBg,e.selectionActiveCheckboxBg,e.selectionServiceActiveBg,e.errorOutlineColor,e.accentColor,i,o,n,s,c,a])}function ls({baseRegions:r,selectedColumnIndexes:t,headerSelectedRowIndexes:e,activeRow:i,activeRange:o,selectionRangeStack:n,checkboxAvailableRowIndexes:s,totalRows:c,firstDataCol:a,columnsCount:u,theme:d}){return m.useMemo(()=>{const l=t.length>0,h=e.length>0,f=i!==void 0,g=((n==null?void 0:n.length)??0)>0;if(!l&&!h&&!f&&!g)return r;const C=u-a,v=[...r??[]],b=(y,S)=>{const[x,...A]=[...y].sort((L,P)=>L-P);if(x===void 0)return;let F=x,I=x;const E=(L,P)=>{v.push({color:d.accentColor,range:S(L,P),style:"solid-outline"})};for(const L of A)L===I+1||(E(F,I),F=L),I=L;E(F,I)};if(l){a>0&&v.push({color:d.selectionServiceActiveBg,range:{x:0,y:0,width:a,height:c},style:"no-outline"});for(const y of t)v.push({color:d.selectionActiveBg,range:{x:y,y:0,width:1,height:c},style:"no-outline"});b(t,(y,S)=>({x:y,y:0,width:S-y+1,height:c}))}if(h&&C>0){if(a>0)for(const y of e)v.push({color:d.selectionServiceActiveBg,range:{x:0,y,width:a,height:1},style:"no-outline"});for(const y of e)v.push({color:d.selectionActiveBg,range:{x:a,y,width:C,height:1},style:"no-outline"});b(e,(y,S)=>({x:a,y,width:C,height:S-y+1}))}if(i!==void 0&&C>0){const y=s!=null&&s.has(i)?d.selectionActiveCheckboxBg:d.selectionCheckboxBg,S=(A,F)=>{F>0&&v.push({color:y,range:{x:A,y:i,width:F,height:1},style:"no-outline"})};if(!(o&&i>=o.y&&i<o.y+o.height))S(a,C);else{const A=Math.max(o.x,a),F=o.x+o.width;S(a,A-a),S(F,u-F)}}if(g&&n&&a>0){const y=new Set;for(const S of n){const x=Math.max(S.x,a);if(!(S.x+S.width-x<=0||S.height<=0))for(let F=S.y;F<S.y+S.height;F+=1)y.add(F)}for(const S of y)v.push({color:d.selectionServiceActiveBg,range:{x:0,y:S,width:a,height:1},style:"no-outline"})}return v},[r,t,e,i,o,n,s,c,a,u,d.selectionActiveBg,d.selectionActiveCheckboxBg,d.selectionCheckboxBg,d.selectionServiceActiveBg,d.accentColor])}const Ge={columns:B.CompactSelection.empty(),rows:B.CompactSelection.empty(),current:void 0};function us({cellsSelectionMode:r,gridSelection:t,onGridSelectionChange:e,onSelectionEmit:i}){const[o,n]=m.useState(Ge),s=t!==void 0,c=t??o,a=m.useCallback(l=>{s?e==null||e(l):n(l),i==null||i(l)},[s,e,i]),u=m.useCallback(()=>{s?e==null||e(Ge):n(Ge),i==null||i(Ge)},[s,e,i]),d=m.useMemo(()=>r==="range-cell"?"rect":r==="multi-range-cell"?"multi-rect":r==="disabled"?"none":"cell",[r]);return{selection:c,handleGridSelectionChange:a,handleSelectionCleared:u,rangeSelect:d}}const Zt=new Set,Po=({start:r,length:t})=>{const e=new Set;for(let i=0;i<t;i+=1)e.add(r+i);return e};function hs({columns:r,selection:t,cellsSelectionMode:e,checkboxSelectedRowIndexes:i}){return m.useMemo(()=>{const o=t.current,n=Zl(r);if(!(e!=="disabled"&&o!==void 0)||!o)return{hasAnyActiveSelection:!1,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:Zt,activeColumns:Zt,activeDataRange:void 0,isSingleCellCustomHighlight:!1,outlineRange:void 0,isServiceColumn:h=>{var f;return!!((f=r[h])!=null&&f.isServiceColumn)},isActiveRow:h=>!1,isCheckboxSelectedRow:h=>(i==null?void 0:i.has(h))??!1,isActiveDataCell:(h,f)=>!1,isActiveHeaderColumn:h=>!1};const c=jl(o.range,n),a=c!==void 0,u=e==="cell"&&c!==void 0&&c.width===1&&c.height===1;if(!a)return{hasAnyActiveSelection:!1,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:Zt,activeColumns:Zt,activeDataRange:void 0,isSingleCellCustomHighlight:!1,outlineRange:void 0,isServiceColumn:h=>{var f;return!!((f=r[h])!=null&&f.isServiceColumn)},isActiveRow:h=>!1,isCheckboxSelectedRow:h=>(i==null?void 0:i.has(h))??!1,isActiveDataCell:(h,f)=>!1,isActiveHeaderColumn:h=>!1};const d=c!=null&&c.height&&c.height>0?Po({start:c.y,length:c.height}):Zt,l=c!=null&&c.width&&c.width>0?Po({start:c.x,length:c.width}):Zt;return{hasAnyActiveSelection:a,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:d,activeColumns:l,activeDataRange:c,isSingleCellCustomHighlight:u,outlineRange:u?c:void 0,isServiceColumn:h=>{var f;return!!((f=r[h])!=null&&f.isServiceColumn)},isActiveRow:h=>d.has(h),isCheckboxSelectedRow:h=>(i==null?void 0:i.has(h))??!1,isActiveDataCell:(h,f)=>Ir(c,h,f),isActiveHeaderColumn:h=>r[h]?l.has(h):!1}},[r,e,i,t])}function Jl({highlightActiveRow:r,onHighlightActiveRowChange:t,isHighlightActiveRowControlled:e}){const[i,o]=m.useState(void 0),n=e??t!==void 0,s=n?r:i,c=m.useCallback(a=>{n||o(a),t==null||t(a)},[n,t]);return{activeRow:s,commitActiveRow:c}}function Ql({columns:r}){const[t,e]=m.useState(()=>B.CompactSelection.empty()),i=m.useMemo(()=>t.toArray().filter(u=>{var d;return!((d=r[u])!=null&&d.isServiceColumn)}),[t,r]),o=m.useMemo(()=>new Set(i),[i]),n=m.useRef(void 0),[s,c]=m.useState(!1),a=m.useCallback(()=>{e(B.CompactSelection.empty())},[]);return{selectedColumns:t,setSelectedColumns:e,selectedColumnIndexes:i,selectedColumnSet:o,lastSelectedColumnRef:n,isNativeColumnSelection:s,setIsNativeColumnSelection:c,clearColumnSelection:a}}function tu(){const[r,t]=m.useState(()=>B.CompactSelection.empty()),e=m.useMemo(()=>r.toArray(),[r]),i=m.useRef(r);i.current=r;const o=m.useRef(!1),n=m.useRef(B.CompactSelection.empty()),s=m.useRef(!1);m.useEffect(()=>{const a=d=>{o.current=d.ctrlKey||d.metaKey,n.current=i.current,s.current=!0},u=()=>{s.current=!1};return window.addEventListener("pointerdown",a,!0),window.addEventListener("pointerup",u,!0),()=>{window.removeEventListener("pointerdown",a,!0),window.removeEventListener("pointerup",u,!0)}},[]);const c=m.useCallback(()=>{t(B.CompactSelection.empty())},[]);return{selectedRows:r,setSelectedRows:t,headerSelectedRowIndexes:e,selectedRowsRef:i,ctrlGestureRef:o,ctrlBaseRowsRef:n,pointerGestureRef:s,clearRowSelection:c}}function ds({columns:r,selection:t,cellsSelectionMode:e,highlightActiveType:i,enableColumnSelection:o,enableRowSelection:n,enableSelectAll:s,leadingServiceColumnsCount:c,dataRowCount:a,handleGridSelectionChange:u,handleSelectionCleared:d,onSelectionEmit:l,highlightActiveRow:h,onHighlightActiveRowChange:f,isHighlightActiveRowControlled:g}){const{selectedColumns:C,setSelectedColumns:v,selectedColumnIndexes:b,selectedColumnSet:y,lastSelectedColumnRef:S,isNativeColumnSelection:x,setIsNativeColumnSelection:A}=Ql({columns:r}),{setSelectedRows:F,headerSelectedRowIndexes:I,ctrlGestureRef:E,ctrlBaseRowsRef:L,pointerGestureRef:P}=tu(),{activeRow:it,commitActiveRow:z}=Jl({highlightActiveRow:h,onHighlightActiveRowChange:f,isHighlightActiveRowControlled:g}),Q=m.useMemo(()=>r.findIndex(O=>O.isServiceColumn&&O.id==="row-markers"),[r]),It=m.useCallback(O=>{const{current:W}=O;if(!W)return O;const $=c,{range:q}=W;if(q.x>=$)return O;const G=q.x+q.width-$;return G<=0?{current:void 0,rows:B.CompactSelection.empty(),columns:B.CompactSelection.empty()}:{...O,current:{...W,cell:[Math.max(W.cell[0],$),W.cell[1]],range:{...q,x:$,width:G}}}},[c]),se=m.useCallback(O=>{const W=O.current;if(n&&Q>=0&&W&&W.cell[0]===Q){const q=c,G=W.range.y,Z=G+Math.max(W.range.height,1);if(E.current){const j=Z-G<=1;let tt=L.current;if(tt.length===0&&t.current&&t.current.cell[0]===Q){const bt=t.current.range;tt=B.CompactSelection.empty().add([bt.y,bt.y+Math.max(bt.height,1)]),L.current=tt}let ot;j?ot=tt.hasIndex(G)?tt.remove(G):tt.add(G):ot=tt.add([G,Z]),v(B.CompactSelection.empty()),F(ot),z(void 0),A(!1),u({...O,current:{...W,range:{x:q,y:W.range.y,width:0,height:W.range.height}}}),l==null||l({current:void 0,rows:ot,columns:B.CompactSelection.empty()});return}const V=Math.max(r.length-q,0);v(B.CompactSelection.empty()),F(B.CompactSelection.empty()),z(void 0),A(!1),u({...O,current:{...W,range:{x:q,y:W.range.y,width:V,height:W.range.height}}});return}const $=It(O);($.current!==void 0||$.rows.length>0)&&(v(B.CompactSelection.empty()),F(B.CompactSelection.empty())),A(!1),i==="row"?P.current&&$.current&&z($.current.cell[1]):z(void 0),u($)},[r,t,u,It,Q,n,c,i,l,z,E,L,P,v,F,A]),ui=m.useCallback(()=>{v(B.CompactSelection.empty()),F(B.CompactSelection.empty()),z(void 0),A(!1),d()},[d,z,v,F,A]),Ot=m.useRef([]),Bt=m.useMemo(()=>{var q;const O=new Set(b);if(x&&t.current){const{x:G,width:Z}=t.current.range;for(let V=G;V<G+Z;V+=1)(q=r[V])!=null&&q.isServiceColumn||O.add(V)}const W=Array.from(O).sort((G,Z)=>G-Z).map(G=>{var Z;return(Z=r[G])==null?void 0:Z.id}).filter(G=>!!G),$=Ot.current;return $.length===W.length&&$.every((G,Z)=>G===W[Z])?$:(Ot.current=W,W)},[b,x,t,r]),hi=(e==="range-cell"||e==="multi-range-cell")&&!x&&!(t.current!==void 0&&t.current.cell[0]<c),ye=m.useCallback((O,W)=>{if(s&&Q>=0&&O===Q&&e!=="disabled"){const j=c,tt=Math.max(r.length-j,0);if(tt===0||a===0)return;v(B.CompactSelection.empty()),F(B.CompactSelection.empty()),z(void 0),A(!0),u({current:{cell:[j,0],range:{x:j,y:0,width:tt,height:a},rangeStack:[]},rows:B.CompactSelection.empty(),columns:B.CompactSelection.empty()});return}if(!o)return;const $=r[O];if(!$||$.isServiceColumn)return;const q=W.shiftKey;if(W.ctrlKey||W.metaKey){let j=C;if(j.length===0&&x&&t.current){const ot=t.current.range;j=j.add([ot.x,ot.x+ot.width])}const tt=j.hasIndex(O)?j.remove(O):j.add(O);S.current=O,v(tt),F(B.CompactSelection.empty()),z(void 0),A(!1),u({current:void 0,rows:B.CompactSelection.empty(),columns:B.CompactSelection.empty()}),l==null||l({current:void 0,rows:B.CompactSelection.empty(),columns:tt});return}let Z,V;q&&S.current!==void 0?(Z=Math.min(S.current,O),V=Math.max(S.current,O)):(Z=O,V=O,S.current=O),v(B.CompactSelection.empty()),F(B.CompactSelection.empty()),z(void 0),A(!0),u({current:{cell:[Z,0],range:{x:Z,y:0,width:V-Z+1,height:a},rangeStack:[]},rows:B.CompactSelection.empty(),columns:B.CompactSelection.empty()})},[o,s,Q,e,c,r,t,x,C,a,u,l,z,S,v,F,A]),Nt=m.useCallback(O=>{const W=new Set(O),$=r.map((j,tt)=>!j.isServiceColumn&&W.has(j.id)?tt:-1).filter(j=>j>=0);if(F(B.CompactSelection.empty()),z(void 0),$.length===0){v(B.CompactSelection.empty()),A(!1),u({current:void 0,rows:B.CompactSelection.empty(),columns:B.CompactSelection.empty()});return}const q=$[0],G=$[$.length-1];if(q===void 0||G===void 0)return;const Z=G-q===$.length-1;if(S.current=G,Z){v(B.CompactSelection.empty()),A(!0),u({current:{cell:[q,0],range:{x:q,y:0,width:G-q+1,height:a},rangeStack:[]},rows:B.CompactSelection.empty(),columns:B.CompactSelection.empty()});return}let V=B.CompactSelection.empty();$.forEach(j=>{V=V.add(j)}),v(V),A(!1),u({current:void 0,rows:B.CompactSelection.empty(),columns:B.CompactSelection.empty()})},[r,a,u,v,F,A,z,S]);return{selectedColumnIndexes:b,selectedColumnKeysAll:Bt,selectColumnsByKeys:Nt,selectedColumnSet:y,headerSelectedRowIndexes:I,activeRow:it,numberingColumnIndex:Q,drawFocusRing:hi,selectColumnFromHeader:ye,handleGridSelectionWithColumnReset:se,handleSelectionClearedWithColumns:ui}}function eu(r,t,e,i){const o=performance.now();function n(s){const c=s-o,a=Math.min(c/i,1),u=t+(e-t)*a;r(Math.round(u)),a<1&&requestAnimationFrame(n)}requestAnimationFrame(n)}const iu=r=>{const t=typeof r=="number",[e,i]=m.useState(()=>t?r:56);return m.useEffect(()=>{t&&eu(i,e,r,300)},[r]),t?e:r};function ru({columns:r,rows:t,freezeColumns:e,selectedRange:i}){const[o,n]=m.useState(null),s=m.useRef(o);s.current=o;const c=m.useRef(null),a=m.useRef(0),u=m.useMemo(()=>r.some(C=>!C.isServiceColumn&&C.isErrorCell),[r]),d=m.useRef({cols:0,rows:0,freeze:0});d.current={cols:r.length,rows:t.length,freeze:e??0};const l=m.useCallback(()=>{a.current||(a.current=requestAnimationFrame(()=>{a.current=0;const C=c.current;if(!C)return;const{cols:v,rows:b,freeze:y}=d.current,S=Math.max(C.width,1),x=Math.max(C.height,1),A=s.current;if(A){const P=A.x+A.width,it=A.y+A.height,z=A.x>0&&C.x-A.x<S/2,Q=A.y>0&&C.y-A.y<x/2,It=P<v&&P-(C.x+C.width)<S/2,se=it<b&&it-(C.y+C.height)<x/2;if(!z&&!Q&&!It&&!se)return}const F=y>0?0:Math.max(0,C.x-S),I=Math.max(0,C.y-x),E=Math.min(v,C.x+C.width+S),L=Math.min(b,C.y+C.height+x);n({x:F,y:I,width:E-F,height:L-I})}))},[]);m.useEffect(()=>()=>{a.current&&cancelAnimationFrame(a.current)},[]),m.useEffect(()=>{u&&l()},[u,l]);const h=m.useCallback(C=>{c.current=C,l()},[l]),f=m.useMemo(()=>{const C=[];if(!u)return C;const v=o??{x:0,y:0,width:Math.min(r.length,60),height:Math.min(t.length,300)},b=Math.max(0,v.x),y=Math.min(r.length,v.x+v.width),S=Math.max(0,v.y),x=Math.min(t.length,v.y+v.height);for(let A=b;A<y;A+=1){const F=r[A],{isErrorCell:I}=F??{};if(!(!F||F.isServiceColumn||!I))for(let E=S;E<x;E+=1){const L=t[E];L!==void 0&&I(L)&&C.push({x:A,y:E,width:1,height:1})}}return C},[r,t,o,u]);return{errorCellRanges:m.useMemo(()=>!i||f.length===0?f:f.filter(C=>!Ir(i,C.x,C.y)),[f,i]),trackVisibleRegion:h}}function fs({cell:r,glideCell:t,rect:e,renderData:i,relativePoint:o,mouseArgs:n}){const s=(i==null?void 0:i.canvasRoot)instanceof yt?i.canvasRoot.getInteractionAtPoint(o.x,o.y):void 0;if(s)return{cell:r,glideCell:t,rect:e,renderData:i,relativePoint:o,interaction:s,...n?{mouseArgs:n}:{}}}function ou({dataEditor:r,getCellContent:t,clientX:e,clientY:i,nativeEvent:o}){const n=r==null?void 0:r.getMouseArgsForPosition(e,i,o);if(!n||n.kind!=="cell")return;const s=[n.location[0],n.location[1]],c=t(s);if(!Sr(c))return;const a=n.bounds,u=ee({colIndex:s[0],rowIndex:s[1]},a),d=ie(u,c),l={x:n.localEventX,y:n.localEventY};return fs({cell:s,mouseArgs:n,glideCell:c,rect:a,renderData:d,relativePoint:l})}function nu({eventTarget:r,dataEditorRef:t,getCellContent:e,interactionSessionStore:i,onCellContextMenuExternal:o}){m.useEffect(()=>{if(!r)return;const n=s=>{var g;if(!(s instanceof MouseEvent))return;const c=s;if(c.clientX===0&&c.clientY===0)return;const a=ou({dataEditor:t.current,getCellContent:e,clientX:c.clientX,clientY:c.clientY,nativeEvent:c});if(!a)return;const{cell:u,interaction:d,mouseArgs:l,relativePoint:h}=a,f=i.beginOrGet({cell:u,relativePoint:h,interaction:d,button:c.button,source:"contextmenu"});if(f.decision.contextMenuMode!=="normal"){if(i.consumePhase(f,"contextmenu-capture"),c.stopPropagation(),(g=c.stopImmediatePropagation)==null||g.call(c),f.decision.contextMenuMode==="none"){c.cancelable&&c.preventDefault();return}!l||!o||o(u,{...l,preventDefault:()=>{c.cancelable&&c.preventDefault()}})}};return r.addEventListener("contextmenu",n,!0),()=>{r.removeEventListener("contextmenu",n,!0)}},[t,r,e,i,o])}const su=250;function cu(r){return m.useCallback((t,e)=>{const i=r.consumeEditorRequest(t,su);return!i||i.target!=="self"?e:{...e,activationBehaviorOverride:"single-click"}},[r])}const Ye=350;function Bo(r){return Math.round(r)}function au({cell:r,relativePoint:t,button:e}){return[r[0],r[1],e??"unknown",Bo(t.x),Bo(t.y)].join(":")}function ei(r,t){return r[0]===t[0]&&r[1]===t[1]}function gs(r,t){return Math.abs(r.x-t.x)<=1&&Math.abs(r.y-t.y)<=1}function lu(r,t){return!ei(r.cell,t.cell)||r.button!==void 0&&t.button!==void 0&&r.button!==t.button?!1:gs(r.relativePoint,t.relativePoint)}function uu(r,t){return Date.now()-r.startedAt>(t.maxAgeMs??Ye)||!ei(r.cell,t.cell)||r.button!==void 0&&t.button!==void 0&&r.button!==t.button?!1:gs(r.relativePoint,t.relativePoint)}function hu(){let r,t=1;const e=i=>{if(!(!r||!uu(r,i)))return r};return{beginOrGet:i=>{const o=e(i);return o||(r={id:t++,key:au(i),cell:i.cell,relativePoint:i.relativePoint,interaction:i.interaction,decision:jn(i.interaction),consumedPhases:new Set,startedAt:i.startedAt??Date.now(),source:i.source,...i.button!==void 0?{button:i.button}:{}},r)},findMatching:e,getCurrent:()=>r,storeClickResult:(i,o)=>{i.clickResult=o},consumeClickResult:i=>{const o=r;if(!(o!=null&&o.clickResult))return;if(!lu(o,i)){delete o.clickResult;return}const n=o.clickResult;return delete o.clickResult,o.consumedPhases.add("renderer-click"),n},consumePhase:(i,o)=>i.consumedPhases.has(o)?!1:(i.consumedPhases.add(o),!0),armEditorRequest:(i,o)=>{var n;(n=i.editorRequest)!=null&&n.consumed||(i.editorRequest={target:o.target,armedAt:Date.now()})},consumeEditorRequest:(i,o=Ye)=>{const n=r;if(!n)return;const s=n.editorRequest;if(!(s!=null&&s.consumed)&&s){if(Date.now()-s.armedAt>o){r=void 0;return}if(ei(n.cell,i))return s.consumed=!0,n.consumedPhases.add("editor-activation"),s}},isMatchingRecent:(i,o,n=Ye)=>{const s=r;return!s||!s.consumedPhases.has(i)?!1:Date.now()-s.startedAt<=n&&ei(s.cell,o)},clearStale:(i=Ye)=>{r&&Date.now()-r.startedAt>i&&(r=void 0)},clear:()=>{r=void 0}}}function du(){const r=m.useMemo(()=>hu(),[]),t=m.useCallback(i=>r.beginOrGet(i),[r]),e=m.useCallback(i=>r.consumeClickResult(i),[r]);return{interactionSessionStore:r,beginOrGetInteractionSession:t,consumeCanvasClickResult:e}}function fu(r={}){const t=m.useMemo(()=>!0,[]);return m.useMemo(()=>{const e=[];return t&&e.push(wr({beginOrGetInteractionSession:r.beginOrGetInteractionSession,consumeCanvasClickResult:r.consumeCanvasClickResult})),e.length>0?e:void 0},[t,r.beginOrGetInteractionSession,r.consumeCanvasClickResult])}const Bi={glideScroller:"dvn-scroller",glideTable:"gdg-table",glideUnderlay:"dvn-underlay"};function Cs(r){const t=(r==null?void 0:r.querySelector(`.${Bi.glideTable}`))??null,e=(t==null?void 0:t.querySelector(`.${Bi.glideScroller}`))??null,i=(t==null?void 0:t.querySelector(`.${Bi.glideUnderlay}`))??null;return{container:t,scroller:e,underlay:i}}const _o="[useGlideElements]";function gu(r,t){const[e,i]=m.useState(null),[o,n]=m.useState(null),[s,c]=m.useState(null),a=m.useRef(null);m.useEffect(()=>{const d=r==null?void 0:r.current;if(te.tableDebug(_o,"useEffect fired",{hasWrapper:!!d,fullScreened:t}),!d)return;const l=()=>{const{container:f,scroller:g,underlay:C}=Cs(d);return te.tableDebug(_o,"tryFind",{containerFound:!!f,scrollerFound:!!g,underlayFound:!!C}),f?(i(v=>v===f?v:f),n(v=>v===g?v:g),c(v=>v===C?v:C),a.current&&(a.current.disconnect(),a.current=null),!0):!1},h=requestAnimationFrame(()=>{if(l())return;const f=new MutationObserver(()=>{l()});f.observe(d,{childList:!0,subtree:!0}),a.current=f});return()=>{cancelAnimationFrame(h),a.current&&(a.current.disconnect(),a.current=null),i(null),n(null),c(null)}},[r,t]);const u=m.useCallback(d=>e?$e.createPortal(d,e):null,[e]);return{glideContainer:e,glideScroller:o,glideUnderlay:s,isReady:!!e,renderInContainer:u}}function Cu(r){const t=document.createElement("div");t.style.cssText="position:fixed;left:0;top:0;width:0;height:0;pointer-events:none;visibility:hidden",r.appendChild(t);const e=t.getBoundingClientRect();return r.removeChild(t),{x:e.left,y:e.top}}function vu(r,t){m.useEffect(()=>{if(!t)return;const e=r.current;if(!e)return;const i=te.throttleWithLastCall(()=>{const{x:o,y:n}=Cu(e);e.style.setProperty("--gdg-portal-offset-x",`${o}px`),e.style.setProperty("--gdg-portal-offset-y",`${n}px`)},100);return i(),window.addEventListener("resize",i),e.addEventListener("resize",i),()=>{window.removeEventListener("resize",i),e.removeEventListener("resize",i)}},[r,t])}function mu(r,t){const{columnsLast:e,rows:i,ctxs:o,refTable:n,theme:s,portalEventTargetRef:c,externalOnItemHovered:a,onHoverRowChange:u}=r,d=m.useRef(null),l=m.useCallback(g=>{const C=d.current;d.current=null,Jt({visible:!1,x:0,y:0,width:0,height:0,source:"cell",originId:C??void 0,nodeId:C??void 0},g,!0)},[]),h=m.useCallback(g=>{var y,S,x,A;a==null||a(g),u==null||u(g.kind==="cell"?g.location[1]:void 0);const C=(c==null?void 0:c.current)??null,v=(y=g.location)==null?void 0:y[0],b=v!=null?e[v]:void 0;if((g.kind==="header"||g.kind==="group-header")&&g.hiddenIndicatorCol!=null){const F=g.hiddenIndicatorCol;d.current===ke.HEADER_TOOLTIP_HIDDEN_COLS_ID||l(C);const E=e.length,L=Math.min(F,E-1),P=(S=t.current)==null?void 0:S.getBounds(L,-1);if(!P)return;const it=F>=E?P.x+P.width:P.x,z=g.hiddenIndicatorAboveLeaf??0;d.current=ke.HEADER_TOOLTIP_HIDDEN_COLS_ID,Jt({visible:!0,x:it-2,y:P.y-z,width:4,height:P.height+z,source:"header",originId:ke.HEADER_TOOLTIP_HIDDEN_COLS_ID,nodeId:ke.HEADER_TOOLTIP_HIDDEN_COLS_ID,priority:1},C);return}if(g.kind==="header"){if(!(b!=null&&b.headerCellTooltip)){l(C);return}const F=`header-tooltip-${v}`;d.current===F||l(C);const E=(x=t.current)==null?void 0:x.getBounds(v,-1);if(!E)return;d.current=F,Jt({visible:!0,x:E.x,y:E.y,width:E.width,height:E.height,source:"header",originId:F,nodeId:F,priority:0,tooltipContext:{column:b,ctxs:o,refTable:n,colInd:v,theme:s}},C);return}if(g.kind==="cell"){const F=g.location[1],I=i[F];if(!b||!I||!b.cellTooltip){l(C);return}const E=`col-tooltip-${v}-${F}`;d.current===E||l(C);const P=(A=t.current)==null?void 0:A.getBounds(v,F);if(!P)return;d.current=E,Jt({visible:!0,x:P.x,y:P.y,width:P.width,height:P.height,source:"cell",originId:E,nodeId:E,priority:0,tooltipContext:{column:b,row:I,ctxs:o,refTable:n,colInd:v,rowInd:F,theme:s}},C);return}l(C)},[e,i,o,n,s,c,a,u,l,t]),f=m.useCallback(()=>{l((c==null?void 0:c.current)??null)},[l,c]);return{onItemHovered:h,hideTooltip:f}}function pu({enabled:r,portalEventTargetRef:t,headerHeight:e,groupHeaderHeight:i,experimental:o}){const[n,s]=m.useState(0),c=m.useRef(null),a=m.useMemo(()=>{const h=e??qe;let f=typeof h=="number"?h:qe;return Array.isArray(i)?f+=i.reduce((g,C)=>g+C,0):typeof i=="number"&&(f+=i),f},[e,i]),u=m.useRef(a);u.current=a;const d=m.useCallback(h=>{var b;if((b=c.current)==null||b.call(c),c.current=null,!h)return;if(!r){s(0);return}const f=t==null?void 0:t.current;if(!f)return;const g=f.querySelector(".dvn-scroller"),C=f.querySelector(".dvn-underlay");if(!g||!C)return;const v=()=>{const y=g.scrollTop,S=Math.min(y,u.current);s(-1*S),C.style.overflowY="visible",C.style.transform=`translateY(-${S}px)`};g.addEventListener("scroll",v),c.current=()=>{g.removeEventListener("scroll",v),C.style.transform="",C.style.overflowY=""}},[r,t]),l=m.useMemo(()=>r?{...o,paddingBottom:n}:o,[r,n,o]);return{unstickyCallbackRef:d,mergedExperimental:l}}const _i=Mo.div.withConfig({displayName:"styled__StyledOverlayPortal"})(["[id^='gdg-overlay-']{position:fixed;z-index:9001;margin-left:calc(-1 * var(--gdg-portal-offset-x,0px));margin-top:calc(-1 * var(--gdg-portal-offset-y,0px));}"]),yu=Mo(B).withConfig({displayName:"styled__StyledGlideDataEditor"})([""]),Hr={textPrimary:"#13181BF5",textPrimaryHover:"#13181B93",textPrimaryActive:"#13181BC4",textSecondary:"#485056B0",textSecondaryHover:"#485056FF",textSecondaryActive:"#485056D3",textTertiary:"#707C847A",textTertiaryHover:"#717C84FF",textTertiaryActive:"#717C8493",textTertiaryBase:"#8A959D",textTertiaryVariant:"#657179",textParagraph:"#13181BCC",textParagraphHover:"#13181B7A",textParagraphActive:"#13181BA3",textAccent:"#0B7ECB",textAccentHover:"#0D96F2FF",textAccentActive:"#0966A5FF",textAccentTransparent20:"#0B7ECB33",textPositive:"#108E26",textPositiveHover:"#14B32EFF",textPositiveActive:"#0C6A1BFF",textWarning:"#FA5F05",textWarningHover:"#FB782DFF",textWarningActive:"#D25004FF",textNegative:"#E31227",textNegativeHover:"#EE2F43FF",textNegativeActive:"#BD0F21FF",inverseTextPrimary:"#F2F5F8F5",onDarkTextPrimary:"#F2F5F8F5",onDarkTextPrimaryHover:"#F2F5F893",onDarkTextPrimaryActive:"#F2F5F8C4",onDarkTextPrimary96:"#F7F9FBF4",onDarkTextPrimary56:"#F7F9FB8E",onDarkTextPrimary28:"#F7F9FB47",onLightTextPrimary:"#13181BF5",onLightTextPrimaryHover:"#13181B93",onLightTextPrimaryActive:"#13181BC4",surfaceSolidCard:"#FFFFFF",surfaceAccentMinor:"#ECF6FCFF",surfaceSolidDefault:"#060A0C",surfaceSolidTertiary:"#E8EEF2",surfaceAccent:"#118CDF",surfaceAccentHover:"#1798EEFF",surfaceAccentActive:"#0F81CCFF",surfaceTransparentSecondary:"#ADB9C238",surfaceTransparentSecondaryHover:"#ADB9C247",surfaceTransparentSecondaryActive:"#ADB9C24D",surfaceTransparentTertiary:"#8A959D47",surfaceTransparentDeep:"#30373CC6",surfaceClear:"#FFFFFF00",surfacePositive:"#1A9E32",surfacePositiveHover:"#1EB83AFF",surfacePositiveActive:"#178C2CFF",surfaceWarning:"#FA5F05",surfaceWarningHover:"#FB782DFF",surfaceWarningActive:"#E65705FF",surfaceWarningMinor56:"#F3A9128E",surfaceNegative:"#FF293E",surfaceNegativeHover:"#FF5263FF",surfaceNegativeActive:"#FF142CFF",disabled:"#DDDDDD",surfaceTransparentAccent:"#118CDF1F",surfaceTransparentAccent12:"#118CDF1E",surfaceTransparentAccent20:"#118CDF33",surfaceTransparentPositive:"#1A9E321F",surfaceTransparentPositive12:"#1A9E321E",surfaceTransparentPositive20:"#1A9E3233",surfaceTransparentWarning:"#FA5F051F",surfaceTransparentWarning12:"#FA5F051E",surfaceTransparentWarning20:"#FA5F0533",surfaceTransparentNegative:"#FF293E1F",surfaceTransparentNegative12:"#FF293E1E",surfaceTransparentNegative20:"#FF293E33",onLightSurfaceSolidDefault:"#060A0C",onLightSurfaceTransparentDeep:"#30373CC7",onDarkSurfaceSolidDefault:"#F7F9FB",onDarkSurfaceTransparentCard:"#FFFFFF0F",outlineAccent:"#0B7ECB",outlineSolidPrimary:"#D5DFE6",outlineSolidPrimary26:"#D5DFE642",dataBlueMinor:"#CFECFF",dataBlueMinorActive:"#C2E7FFFF",dataBlue:"#8BB2FC",dataAccentMinorHover:"#52BAFF",dataPositive:"#28D247",dataPositiveMinor:"#9EFAAF",dataNegative:"#FF8F9A",dataNegativeMinor:"#FFE0E3",dataWarning:"#FD9C68",dataWarningMinor:"#FEE2D2",dataOrange:"#F3A912",dataOrangeMinor:"#FFD37A",dataViolet:"#AD42F5",dataVioletMinor:"#DEB7F7",dataPink:"#FF8FBC",dataMagenta:"#F391E2",dataCyan:"#00DDE0",dataCyanDark:"#04C6C9",dataLime:"#93E006",dataTeal:"#14CC98"},Fu={textPrimary:"#13181BF5",textPrimaryHover:"#13181B93",textPrimaryActive:"#13181BC4",textSecondary:"#03070CAF",textSecondaryHover:"#485056FF",textSecondaryActive:"#485056D3",textTertiary:"#000206A8",textTertiaryHover:"#717C84FF",textTertiaryActive:"#717C8493",textTertiaryBase:"#818C95",textTertiaryVariant:"#65717A",textParagraph:"#13181BCC",textParagraphHover:"#13181B7A",textParagraphActive:"#13181BA3",textAccent:"#0058A2",textAccentHover:"#0D96F2FF",textAccentActive:"#0966A5FF",textAccentTransparent20:"#0058A23F",textPositive:"#0F5E00",textPositiveHover:"#14B32EFF",textPositiveActive:"#0C6A1BFF",textWarning:"#D95800",textWarningHover:"#FB782DFF",textWarningActive:"#D25004FF",textNegative:"#A50016",textNegativeHover:"#EE2F43FF",textNegativeActive:"#BD0F21FF",inverseTextPrimary:"#F2F5F8F5",onDarkTextPrimary:"#F2F5F8F5",onDarkTextPrimaryHover:"#F2F5F893",onDarkTextPrimaryActive:"#F2F5F8C4",onDarkTextPrimary96:"#F7F9FBF4",onDarkTextPrimary56:"#F7F9FB8E",onDarkTextPrimary28:"#F7F9FB47",onLightTextPrimary:"#13181BF5",onLightTextPrimaryHover:"#13181B93",onLightTextPrimaryActive:"#13181BC4",surfaceSolidCard:"#FFFFFF",surfaceAccentMinor:"#CFE5F2FF",surfaceSolidDefault:"#060A0C",surfaceSolidTertiary:"#CFD9E0",surfaceAccent:"#0076D2",surfaceAccentHover:"#1798EEFF",surfaceAccentActive:"#0F81CCFF",surfaceTransparentSecondary:"#7D96A838",surfaceTransparentSecondaryHover:"#ADB9C247",surfaceTransparentSecondaryActive:"#ADB9C24D",surfaceTransparentTertiary:"#516E8347",surfaceTransparentDeep:"#30373DC6",surfaceClear:"#FFFFFF00",surfacePositive:"#198A00",surfacePositiveHover:"#1EB83AFF",surfacePositiveActive:"#178C2CFF",surfaceWarning:"#D95800",surfaceWarningHover:"#FB782DFF",surfaceWarningActive:"#E65705FF",surfaceWarningMinor56:"#D491008E",surfaceNegative:"#E7002F",surfaceNegativeHover:"#FF5263FF",surfaceNegativeActive:"#FF142CFF",disabled:"#DDDDDD",surfaceTransparentAccent:"#0076D21F",surfaceTransparentAccent12:"#0076D21E",surfaceTransparentAccent20:"#0076D233",surfaceTransparentPositive:"#198A001F",surfaceTransparentPositive12:"#198A003F",surfaceTransparentPositive20:"#198A0033",surfaceTransparentWarning:"#D958001F",surfaceTransparentWarning12:"#D958003F",surfaceTransparentWarning20:"#D9580033",surfaceTransparentNegative:"#E7002F1F",surfaceTransparentNegative12:"#E7002F3F",surfaceTransparentNegative20:"#E7002F33",onLightSurfaceSolidDefault:"#060A0C",onLightSurfaceTransparentDeep:"#30373DC7",onDarkSurfaceSolidDefault:"#D6DFE7",onDarkSurfaceTransparentCard:"#FFFFFF0F",outlineAccent:"#0058A2",outlineSolidPrimary:"#C4CFD7",outlineSolidPrimary26:"#AFC0CB42",dataBlueMinor:"#9CD5FF",dataBlueMinorActive:"#C2E7FFFF",dataBlue:"#6096FF",dataAccentMinorHover:"#0077C1",dataPositive:"#168600",dataPositiveMinor:"#96DAA1",dataNegative:"#BA5161",dataNegativeMinor:"#F8BDC4",dataWarning:"#B35B10",dataWarningMinor:"#F7C29D",dataOrange:"#D49100",dataOrangeMinor:"#F3B400",dataViolet:"#9A29E0",dataVioletMinor:"#D48BFF",dataPink:"#FB5AA5",dataMagenta:"#EB60D7",dataCyan:"#00C1C3",dataCyanDark:"#00AAAD",dataLime:"#7FC400",dataTeal:"#00B082"},bu={...Hr,textPrimary:"#14191DF5",textPrimaryHover:"#151A1E93",textPrimaryActive:"#151A1EC4",textSecondary:"#475158B0",textSecondaryHover:"#465058FF",textSecondaryActive:"#465058D3",textTertiary:"#707F897A",textTertiaryHover:"#707F89FF",textTertiaryActive:"#707F8993",textParagraph:"#14191DCC",textParagraphHover:"#151A1E7A",textParagraphActive:"#151A1EA3",textAccent:"#0087CD",textAccentHover:"#00A3F5FF",textAccentActive:"#006DA3FF",textPositive:"#219532",textPositiveHover:"#28B83EFF",textPositiveActive:"#1A7527FF",textWarning:"#E15400",textWarningHover:"#FF640AFF",textWarningActive:"#B84300FF",textNegative:"#D60033",textNegativeHover:"#FF003BFF",textNegativeActive:"#AD0028FF",inverseTextPrimary:"#F3F7FAF5",onDarkTextPrimary:"#F3F7FAF5",onDarkTextPrimaryHover:"#F4F8FA93",onDarkTextPrimaryActive:"#F4F8FAC4",onLightTextPrimary:"#14191DF5",onLightTextPrimaryHover:"#151A1E93",onLightTextPrimaryActive:"#151A1EC4",surfaceAccentMinor:"#EFF8FF",surfaceSolidDefault:"#060A0D",surfaceSolidTertiary:"#CFDBE4",surfaceAccent:"#1F9EEB",surfaceAccentHover:"#3AA9EEFF",surfaceAccentActive:"#1492E1FF",surfaceTransparentSecondary:"#A8B6BF38",surfaceTransparentSecondaryHover:"#A7B5BE47",surfaceTransparentSecondaryActive:"#A7B5BE4D",surfaceTransparentTertiary:"#8B98A247",surfaceTransparentDeep:"#30383EC7",surfacePositive:"#21A038",surfacePositiveHover:"#24B23EFF",surfacePositiveActive:"#1D9032FF",surfaceWarning:"#E15400",surfaceWarningHover:"#F55A00FF",surfaceWarningActive:"#CC4B00FF",surfaceNegative:"#F81C42",surfaceNegativeHover:"#F94361FF",surfaceNegativeActive:"#F70830FF",surfaceTransparentAccent:"#0090DA1F",surfaceTransparentPositive:"#21A0381F",surfaceTransparentWarning:"#E154001F",surfaceTransparentNegative:"#F81C421F",onLightSurfaceSolidDefault:"#060A0D",onLightSurfaceTransparentDeep:"#30383EC7",onDarkSurfaceSolidDefault:"#F6F9FB",outlineAccent:"#0087CD",outlineSolidPrimary:"#CFDBE4",dataBlueMinor:"#D3EBFF",dataBlueMinorActive:"#C2E3FFFF",dataBlue:"#1F9EEB",dataOrange:"#F3621C",dataOrangeMinor:"#F79772",dataPink:"#FC8CA6"},Su={...Hr},xu={light:Hr,dark:Su,highContrastLight:Fu,betaCoreLight:bu},wu=(r="light")=>xu[r],gt={bgEditableCell:{light:"#FFF6E5",dark:"#211807",highContrastLight:"#F1DDB8",betaCoreLight:"#FFF6E5"},bgEditableCellHovered:{light:"#FFF4E0",dark:"#2A1F09",highContrastLight:"#E8D4AD",betaCoreLight:"#FFF4E0"},selectionCheckboxBg:{light:"#ECF6FC",dark:"#ECF6FC",highContrastLight:"#CFE5F2",betaCoreLight:"#EFF8FF"},selectionActiveBg:{light:"#E2F1FB",dark:"#E2F1FB",highContrastLight:"#BFDDF4",betaCoreLight:"#E2F1FB"},selectionActiveCheckboxBg:{light:"#D1E9F8",dark:"#D1E9F8",highContrastLight:"#9BCAEA",betaCoreLight:"#D1E9F8"},selectionServiceBg:{light:"#ECF6FC",dark:"#ECF6FC",highContrastLight:"#CFE5F2",betaCoreLight:"#EFF8FF"},selectionServiceActiveBg:{light:"#D4E7F2",dark:"#D4E7F2",highContrastLight:"#B9D6E7",betaCoreLight:"#D4E7F2"},errorOutlineColor:{light:"#FF3D51",dark:"#FF3D51",highContrastLight:"#E9203F",betaCoreLight:"#F81C42"},bgRowHovered:{light:"#F7F9FB",dark:"#F7F9FB",highContrastLight:"#E8EEF2",betaCoreLight:"#F7F9FB"},bgServiceRowHovered:{light:"#D4E7F2",dark:"#D4E7F2",highContrastLight:"#B9D6E7",betaCoreLight:"#D4E7F2"},bgSelectedRowHovered:{light:"#DEECF5",dark:"#DEECF5",highContrastLight:"#C2DCEB",betaCoreLight:"#DEECF5"}},Au=r=>({tokens:wu(r),fonts:Ke,fontMetrics:Wo,bgEditableCell:gt.bgEditableCell[r],bgEditableCellHovered:gt.bgEditableCellHovered[r],selectionCheckboxBg:gt.selectionCheckboxBg[r],selectionActiveBg:gt.selectionActiveBg[r],selectionActiveCheckboxBg:gt.selectionActiveCheckboxBg[r],selectionServiceBg:gt.selectionServiceBg[r],selectionServiceActiveBg:gt.selectionServiceActiveBg[r],errorOutlineColor:gt.errorOutlineColor[r],bgRowHovered:gt.bgRowHovered[r],bgServiceRowHovered:gt.bgServiceRowHovered[r],bgSelectedRowHovered:gt.bgSelectedRowHovered[r]}),lt={accentColor:{light:"#0b7ecb",dark:"#0b7ecb",highContrastLight:"#0058A2",betaCoreLight:"#0087CD"},accentLight:{light:"#E2F1FB",dark:"#E2F1FB",highContrastLight:"#DAE8F1",betaCoreLight:"#E2F1FB"},textDark:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5",betaCoreLight:"#14191DF5"},textHeader:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5",betaCoreLight:"#14191DF5"},textHeaderSelected:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5",betaCoreLight:"#14191DF5"},textGroupHeader:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5",betaCoreLight:"#14191DF5"},bgCell:{light:"#FFFFFF",dark:"#FFFFFF",highContrastLight:"#FFFFFF",betaCoreLight:"#FFFFFF"},bgHeader:{light:"#ECF6FCFF",dark:"#ECF6FCFF",highContrastLight:"#CFE5F2FF",betaCoreLight:"#EFF8FF"},bgHeaderHasFocus:{light:"#ECF6FCFF",dark:"#ECF6FCFF",highContrastLight:"#B9D6E7",betaCoreLight:"#EFF8FF"},bgHeaderHovered:{light:"#DEECF5",dark:"#DEECF5",highContrastLight:"#C2DCEB",betaCoreLight:"#DEECF5"},borderColor:{light:"#D5DFE6",dark:"#D5DFE6",highContrastLight:"#C4CFD7",betaCoreLight:"#CFDBE4"},bgGroupHeader:{light:"#ECF6FCFF",dark:"#ECF6FCFF",highContrastLight:"#CFE5F2FF",betaCoreLight:"#EFF8FF"},bgGroupHeaderHovered:{light:"#DEECF5",dark:"#DEECF5",highContrastLight:"#C2DCEB",betaCoreLight:"#DEECF5"}},Eu=r=>({accentColor:lt.accentColor[r],accentLight:lt.accentLight[r],textDark:lt.textDark[r],textHeader:lt.textHeader[r],textHeaderSelected:lt.textHeaderSelected[r],textGroupHeader:lt.textGroupHeader[r],bgCell:lt.bgCell[r],bgHeader:lt.bgHeader[r],bgHeaderHasFocus:lt.bgHeaderHasFocus[r],bgHeaderHovered:lt.bgHeaderHovered[r],borderColor:lt.borderColor[r],bgGroupHeader:lt.bgGroupHeader[r],bgGroupHeaderHovered:lt.bgGroupHeaderHovered[r],hiddenColumnsIndicatorColor:lt.accentColor[r]}),Ro={small:"bodyXXS",medium:"bodyS",big:"bodyM"},Tu=(r="big")=>{const t=Ke[Ro[r]],e=Wo[Ro[r]],i=`${e.fontSize}px`,o=e.lineHeightPx,n=Oo[r],{cellHorizontalPadding:s,cellVerticalPadding:c}=n;return{headerFontStyle:Ke.bodyXSBold,baseFontStyle:t,fontFamily:'"SB Sans Text", sans-serif, Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif',editorFontSize:i,lineHeight:o,cellHorizontalPadding:s,cellVerticalPadding:c,activeSizes:n}},Lr=(r="big",t="light")=>({...Eu(t),...Tu(r),...Au(t),rowSize:r}),Du=Lr(),vs=(r,t,e,i)=>{let o=r;for(let s=r;s>=0;s-=1){const c=e(s,t);if(c&&c[0]<=r&&c[1]>=r){o=c[0];break}}const n=i(o,t);return[o,n?n[0]:t]},Ri=(r,t)=>{if(r==null)return null;const e=typeof r=="number"?r:r(t);return e<=0?null:[t.colInd,t.colInd+e]},ko=(r,t)=>r==null?null:r(t);function Iu(...r){}const Hu={},ki=r=>Array.isArray(r)?r.filter(t=>typeof t=="string"):typeof r=="string"?[r]:[],Lu=({columns:r,rows:t,bottomSummaryRows:e,rowHeight:i,width:o,rowSize:n="medium",ctxs:s=Hu,freezeColumns:c,onColumnResize:a,renderGroupHeader:u,groupAlignMap:d,refTable:l,onColumnsReorder:h,portalEventTargetRef:f,onItemHovered:g,unstickyHeader:C,resizableColumn:v=!0,minColumnWidth:b=56,maxColumnWidth:y,maxColumnAutoWidth:S,containerRef:x,containerClassName:A,containerStyle:F,renderOverlayFeatures:I,hideGrid:E,contentStateNode:L,fullScreened:P,editorOverlayPortal:it,highlightActiveType:z="disabled",cellsSelectionMode:Q="range-cell",enableColumnSelection:It=!0,enableRowSelection:se=!0,enableSelectAll:ui=!0,enableLowDprHairline:Ot,gridSelection:Bt,onGridSelectionChange:hi,onSelectionEmit:ye,onColumnSelectionChange:Nt,pendingColumnSelectionKeys:O,onColumnSelectionApplied:W,highlightActiveRow:$,onHighlightActiveRowChange:q,highlightActiveRowControlled:G,highlightRegions:Z,checkboxSelectedRowIndexes:V,checkboxVisibleRowIndexes:j,hoverEffects:tt,onCellClicked:ot,onCellContextMenu:bt,onGroupHeaderClicked:_t,onMouseMove:Fe,onVisibleRegionChanged:be,portalElementRef:Pu,...Wt})=>{var Yr,qr,Kr;const Pr=te.useActiveTheme(),R=m.useMemo(()=>Lr(n,Pr),[n,Pr]),ms=m.useMemo(()=>{const p=typeof i=="number"?i:void 0;if(p)return p;const w=zo[n],T=typeof i=="function"?i:void 0;return T?D=>{const _=t[D];if(!_)return p??w;const k=T(_,{rowSizeName:n,rowSizeValue:w},D);return typeof k=="number"&&!Number.isNaN(k)?k:w}:w},[t,i,n]),Gt=(e==null?void 0:e.length)??0,ps=iu(ms),[Se,ys]=m.useState(new Map),xe=m.useRef(null),Fs=m.useCallback((p,w,T,D)=>{var H;const _=p;_.id&&((H=xe.current)==null||H.call(xe),a==null||a(_,w,T,D),ys(k=>(k.set(_.id,w),new Map(k))))},[a]),Rt=m.useMemo(()=>Se.size===0?r:r.map(p=>Se.has(p.id)?{...p,width:Se.get(p.id),grow:0}:p),[r,Se]),[Br,Bu]=m.useState(0),di=m.useMemo(()=>new WeakMap,[]),fi=m.useRef(null),Ht=m.useRef(null);m.useEffect(()=>{var p;(Bt==null?void 0:Bt.current)!==void 0&&((p=Ht.current)==null||p.focus())},[Bt]);const{interactionSessionStore:ut,beginOrGetInteractionSession:bs,consumeCanvasClickResult:Ss}=du(),_r=cu(ut),{selection:St,handleGridSelectionChange:xs,handleSelectionCleared:ws,rangeSelect:As}=us({cellsSelectionMode:Q,gridSelection:Bt,onGridSelectionChange:hi,onSelectionEmit:ye}),nt=hs({columns:Rt,selection:St,cellsSelectionMode:Q,checkboxSelectedRowIndexes:V}),Es=m.useMemo(()=>q?p=>q(p,p!==void 0?t[p]:void 0):void 0,[q,t]),{selectedColumnIndexes:Ts,selectedColumnKeysAll:Rr,selectColumnsByKeys:we,selectedColumnSet:Ae,headerSelectedRowIndexes:kr,activeRow:Ds,numberingColumnIndex:Mr,drawFocusRing:Is,selectColumnFromHeader:zr,handleGridSelectionWithColumnReset:Hs,handleSelectionClearedWithColumns:Ls}=ds({columns:Rt,selection:St,cellsSelectionMode:Q,highlightActiveType:z,enableColumnSelection:It,enableRowSelection:se,enableSelectAll:ui,leadingServiceColumnsCount:nt.leadingServiceColumnsCount,dataRowCount:t.length+Gt,handleGridSelectionChange:xs,handleSelectionCleared:ws,onSelectionEmit:ye,highlightActiveRow:$,onHighlightActiveRowChange:Es,isHighlightActiveRowControlled:G});m.useEffect(()=>{Nt==null||Nt(Rr)},[Rr,Nt]),m.useEffect(()=>{if(!O)return;we(O);const p=setTimeout(()=>W==null?void 0:W(),0);return()=>clearTimeout(p)},[O,Rt,we,W]);const Ee=kr.length>0,Te=m.useMemo(()=>{var T;const p=new Set,w=(T=St.current)==null?void 0:T.rangeStack;if(w){const D=nt.firstDataColumnIndex;for(const _ of w){const H=Math.max(_.x,D);for(let k=H;k<_.x+_.width;k+=1)p.add(k)}}return p},[St,nt.firstDataColumnIndex]),X=m.useMemo(()=>Rt.map((p,w)=>{const T={...p.themeOverride??{}};let D=Object.keys(T).length>0;return p.isServiceColumn&&(T.bgCell=R.selectionServiceBg,D=!0),w===Mr&&(T.accentLight="transparent",T.accentColor="transparent",D=!0),nt.isActiveHeaderColumn(w)&&(T.bgHeader=R.selectionServiceActiveBg,T.bgHeaderHasFocus=R.selectionServiceActiveBg,D=!0),Ae.has(w)&&(T.bgHeader=R.selectionServiceActiveBg,T.bgHeaderHasFocus=R.selectionServiceActiveBg,D=!0),Te.has(w)&&(T.bgHeader=R.selectionServiceActiveBg,T.bgHeaderHasFocus=R.selectionServiceActiveBg,D=!0),Ee&&!p.isServiceColumn&&(T.bgHeader=R.selectionServiceActiveBg,T.bgHeaderHasFocus=R.selectionServiceActiveBg,D=!0),D?{...p,themeOverride:T}:p}),[Rt,nt,Ae,Te,Ee,Mr,R.selectionServiceBg,R.selectionServiceActiveBg]),{errorCellRanges:Ps,trackVisibleRegion:Or}=ru({columns:Rt,rows:t,freezeColumns:c,selectedRange:(Yr=St.current)==null?void 0:Yr.range}),Bs=m.useCallback((p,w,T,D)=>{Or(p),be==null||be(p,w,T,D)},[Or,be]),ce=m.useCallback(([p,w],T)=>{var _e,Jr,Re,Qr;Iu(Br);const D=(T==null?void 0:T.applyCanvasEditorActivation)!==!1,_=st=>D?_r([p,w],st):st,H=!!e&&w>t.length-1,k=t[w],M=X[p];if(!M)return Qt();if(H){const st=e[w-t.length],{renderSummaryCell:Pt,colSpan:ct}=M;if(!Pt||!st)return Qt();const wi={row:st,column:M,colInd:p,rowInd:w,ctxs:s,theme:R,hovered:{cellHover:!1,rowHover:!1},active:{cellActive:!1,rowActive:!1}},sc=Pt(wi),to=Ri(ct,wi),cc={data:"",...to&&{span:to}};return _(Lo({jsxElement:sc,canvasCellCache:di,cellInfo:wi,options:{...cc,getPortalEventTarget:()=>(f==null?void 0:f.current)??null,refTable:l}}))}if(!k)return Qt();const rt=(st,Pt,ct)=>({row:t[ct],column:st,colInd:Pt,rowInd:ct,ctxs:s,theme:R,hovered:{cellHover:!1,rowHover:!1},active:{cellActive:!1,rowActive:!1}}),[Y,K]=vs(p,w,(st,Pt)=>{const ct=X[st];return ct!=null&&ct.colSpan?Ri(ct.colSpan,rt(ct,st,Pt)):null},(st,Pt)=>{const ct=X[st];return ct!=null&&ct.rowSpan?ko(ct.rowSpan,rt(ct,st,Pt)):null});if(Y!==p||K!==w)return ce([Y,K],T);const U=fi.current,N={row:k,column:M,colInd:p,rowInd:w,ctxs:s,theme:R,hovered:{cellHover:(U==null?void 0:U.colInd)===p&&(U==null?void 0:U.rowInd)===w,rowHover:(U==null?void 0:U.rowInd)===w},active:{cellActive:nt.isActiveDataCell(p,w),rowActive:nt.isActiveRow(w)}},{renderCell:Vt,id:Lt,colSpan:yi,rowSpan:Ie,spanAlign:He,editable:Le,contentAlign:rc,columnThemeOverride:Zr}=M,oc=((Jr=(_e=k[Lt])==null?void 0:_e.toString)==null?void 0:Jr.call(_e))??"NOT FOUND",Pe=Ri(yi,N),Be=ko(Ie,N),Fi=(Pe||Be)&&He?typeof He=="function"?He(N):He:void 0,jr=Le?typeof Le=="boolean"?Le:Le(k):!1,bi=typeof Zr=="function"?Zr(N):void 0,Si={data:((Qr=(Re=k[Lt])==null?void 0:Re.toString)==null?void 0:Qr.call(Re))??"NOT FOUND",...jr?{readonly:!1,allowOverlay:!0}:{readonly:!0,...M.hasPreview===!0&&{allowOverlay:!0},...M.hasPreview==="none"&&{allowOverlay:!1}},themeOverride:{...bi,...jr&&{bgCell:R.bgEditableCell}},contentAlign:rc,...Pe&&{span:Pe},...Be&&{spanRows:Be},...Fi&&{spanAlign:Fi}};if(!Vt){const st=String(oc);return Tr(st)?_(ti(st,Si)):_(Qt(Si))}const xi=bi?{...N,theme:{...R,...bi}}:N,nc=Vt(Pe||Be?{...xi,__mergedCell:{align:Fi}}:xi);return _(Lo({jsxElement:nc,canvasCellCache:di,cellInfo:xi,options:{...Si,getPortalEventTarget:()=>(f==null?void 0:f.current)??null,refTable:l}}))},[Br,e,t,X,s,R,nt,di,f,_r]),_s=m.useCallback((p,w)=>{var N;const T=ce(p,{applyCanvasEditorActivation:!1});if(!Sr(T)){ot==null||ot(p,w);return}let D=!1;const _=w.preventDefault;w.preventDefault=()=>{D=!0,_()};const H=ee({colIndex:p[0],rowIndex:p[1]},w.bounds),k=ie(H,T),M={x:w.localEventX,y:w.localEventY},rt=fs({cell:p,glideCell:T,rect:w.bounds,renderData:k,relativePoint:M}),Y=rt?ut.beginOrGet({cell:p,relativePoint:M,interaction:rt.interaction,button:w.button,source:"click"}):ut.beginOrGet({cell:p,relativePoint:M,interaction:Jo(),button:w.button,source:"click"}),K=xr({cell:T,rect:w.bounds,relativePoint:M,renderData:k,rowData:t[p[1]],rowIndex:p[1]}),U=Y?gl({decision:Y.decision,propagationStopped:K.propagationStopped,suppressGridDefault:K.suppressGridDefault}):{suppressExternalCellClick:K.propagationStopped,suppressGridDefaultForClick:K.suppressGridDefault};if(Y&&(ut.consumePhase(Y,"cell-click"),ut.storeClickResult(Y,K)),w.button===0&&((N=U.editorRequest)==null?void 0:N.target)==="self"&&ut.armEditorRequest(Y,U.editorRequest),U.suppressGridDefaultForClick&&(w.preventDefault(),Y!=null&&Y.decision.editorRequest&&ut.clear()),U.suppressExternalCellClick||ot==null||ot(p,w),D||w.button===1){ut.clear();return}},[ce,ut,ot,t]),Rs=m.useCallback((p,w)=>{ut.isMatchingRecent("contextmenu-capture",p)||bt==null||bt(p,w)},[ut,bt]),ks=fu({beginOrGetInteractionSession:bs,consumeCanvasClickResult:Ss}),$t=m.useRef(null),Ut=m.useRef(null),ae=m.useMemo(()=>new Map,[]),Nr=m.useMemo(()=>new Map,[]),gi=m.useRef(null),kt=m.useRef(null),Ms=m.useMemo(()=>te.mergeRefs(kt,x),[x]),{drawHeader:zs,onHeaderClicked:Os}=m.useMemo(()=>({drawHeader:(T,D)=>{var Ie;const{ctx:_,rect:H,columnIndex:k}=T,M=X[k];if(!M||!M.renderHeaderCell)return D();const rt={column:M,drawArgs:T,ctxs:s,theme:R};let Y=M.renderHeaderCell(rt);if(!or(Y))return D();typeof Y=="string"&&(Y=xt.jsx(me.Container,{style:{width:"100%"},alignItems:"center",children:xt.jsx(me.Text,{children:Y})}));const K=`header-${M.id}-${k}`,U=Qe({element:Y,idPrefix:K,theme:R});let N;ae.has(M.id)?(N=ae.get(M.id),N==null||N.setRootNode(U),N!=null&&N.rootNode&&(N.rootNode.style={width:H.width,height:H.height})):(N=new yt(U,K),N.rootNode.style={width:H.width,height:H.height},ae.set(M.id,N)),N==null||N.setPortalEventTarget((f==null?void 0:f.current)??null),N==null||N.setTooltipContext({column:M,ctxs:s,refTable:l,theme:R});const Vt=((Ie=$t.current)==null?void 0:Ie.id)===M.id?$t.current:void 0,Lt=_.canvas.getBoundingClientRect(),yi={x:Lt.left+H.x,y:Lt.top+H.y,width:H.width,height:H.height};return N==null?void 0:N.render(_,H,Vt,yi)},onHeaderClicked:(T,D)=>{const _=X[T];if(_){if(_.renderHeaderCell){const H=ae.get(_.id);if(H){const k=H.getInteractionAtPoint(D.localEventX,D.localEventY);if(H.dispatchPointerEvent("click",D.localEventX,D.localEventY),k)return}}zr(T,D)}}}),[X,s,R,ae,f,Ht,zr]),Ns=m.useCallback((p,w)=>{const T=X[p];if(!It||!T){_t==null||_t(p,w);return}const D=ki(T.group),_=Math.max(0,D.indexOf(w.group)),H=D.slice(0,_+1).join("\0"),k=K=>{const U=X[K];return U!==void 0&&ki(U.group).slice(0,_+1).join("\0")===H};let M=p,rt=p;for(;M-1>=0&&k(M-1);)M-=1;for(;rt+1<X.length&&k(rt+1);)rt+=1;const Y=[];for(let K=M;K<=rt;K+=1){const U=X[K];U&&!U.isServiceColumn&&Y.push(U.id)}Y.length>0&&we(Y),_t==null||_t(p,w)},[It,X,we,_t]),Wr=m.useMemo(()=>{const p=new Map;X.forEach((T,D)=>{if(T.isServiceColumn)return;const _=nt.isActiveHeaderColumn(D)||Ae.has(D)||Te.has(D)||Ee;ki(T.group).forEach(H=>{if(H==="")return;const k=p.get(H);p.set(H,(k??!0)&&_)})});const w=new Set;return p.forEach((T,D)=>{T&&w.add(D)}),w},[X,nt,Ae,Te,Ee]),Ws=m.useCallback(p=>{const w=d==null?void 0:d.get(p),T={name:p,...w&&{spanAlign:w}};return Wr.has(p)?{...T,overrideTheme:{bgGroupHeader:R.selectionServiceActiveBg,bgGroupHeaderHovered:R.bgHeaderHovered}}:T},[d,Wr,R.selectionServiceActiveBg,R.bgHeaderHovered]),{glideContainer:Ci,isReady:Gs,renderInContainer:$s}=gu(kt,P),Gr=it==="inside";vu(kt,Gr),nu({eventTarget:Ci??kt.current,dataEditorRef:Ht,getCellContent:ce,interactionSessionStore:ut,onCellContextMenuExternal:bt});const{unstickyCallbackRef:$r,mergedExperimental:vi}=pu({enabled:C,portalEventTargetRef:f,headerHeight:Wt.headerHeight,groupHeaderHeight:Wt.groupHeaderHeight,experimental:Wt.experimental}),Us=m.useMemo(()=>te.mergeRefs(Ht,l,$r),[l,$r]),Xs=m.useMemo(()=>Ot===void 0?vi:{...vi,enableLowDprHairline:Ot},[Ot,vi]),Ur=m.useCallback((...p)=>{var _;const w=Ht.current;if(!w)return;const T=new Set;p.forEach(H=>{typeof H=="number"&&H>=0&&H<t.length&&T.add(H)});const D=[];T.forEach(H=>{X.forEach((k,M)=>{D.push({cell:[M,H]})})}),D.length>0&&((_=w.updateCells)==null||_.call(w,D))},[X,t.length]),De=m.useCallback(p=>{const w=fi.current;(w==null?void 0:w.colInd)===(p==null?void 0:p.colInd)&&(w==null?void 0:w.rowInd)===(p==null?void 0:p.rowInd)||(fi.current=p,Ur(w==null?void 0:w.rowInd,p==null?void 0:p.rowInd))},[Ur]),Vs=m.useCallback(p=>{Fe==null||Fe(p),p.kind==="cell"?(()=>{const T=p.location[0],D=p.location[1],_=t[D],H=X[T];if(!_||!H||H.isServiceColumn){De(null);return}De({colInd:T,rowInd:D})})():De(null),p.kind==="group-header"?(()=>{if(typeof p.group!="string"){Ut.current=null;return}Ut.current={id:p.group,x:p.localEventX,y:p.localEventY}})():Ut.current=null,p.kind==="header"?(()=>{var H,k;const T=p.location[0],D=p.location[1],_=X[T];if(!_||!(_!=null&&_.renderHeaderCell)){$t.current=null;return}$t.current={id:_.id,x:p.localEventX,y:p.localEventY},(k=(H=Ht.current)==null?void 0:H.updateCells)==null||k.call(H,[{cell:[T,D]}])})():$t.current=null,$t.current=null,Ut.current=null},[X,Fe,t,De]),Xr={dataEditorRef:Ht,rowCount:t.length,columnCount:X.length,headerAndGroupHeaderRowsCount:1+(Wt.groupHeaderHeight??[]).length};ns(Xr),os(Xr);const Ys=m.useMemo(()=>h?(w,T)=>{var H,k;const D=(H=X[w])==null?void 0:H.id,_=(k=X[T])==null?void 0:k.id;typeof D!="string"||typeof _!="string"||h(D,_)}:void 0,[X,h]),qs=m.useMemo(()=>{if(u)return(p,w)=>{var Lt;const T=u(p);if(T==="default")return w();if("defaultWithCustomGroupName"in T)return w(T.defaultWithCustomGroupName);const{groupName:_,rect:H,ctx:k}=p;let M=T;if(!or(M))return w();typeof M=="string"&&(M=xt.jsx(me.Container,{style:{width:"100%"},alignItems:"center",children:xt.jsx(me.Text,{children:M})}));const rt=_,Y=Qe({element:M,idPrefix:rt,theme:R}),K=new yt(Y,rt);K.rootNode.style={width:H.width,height:H.height},K.setPortalEventTarget((f==null?void 0:f.current)??null),Nr.set(rt,K);const U=((Lt=Ut.current)==null?void 0:Lt.id)===rt?Ut.current:void 0,N=k.canvas.getBoundingClientRect(),Vt={x:N.left+H.x,y:N.top+H.y,width:H.width,height:H.height};return K.render(k,H,U,Vt)}},[Nr,u,R,f]),mi=tt==null?void 0:tt.row,le=!!mi,Vr=typeof mi=="object"?mi.color:void 0,[Xt,Ks]=m.useState(void 0),Zs=m.useCallback(p=>{Ks(w=>w===p?w:p)},[]),js=m.useMemo(()=>{const p=!!(V!=null&&V.size),w=le?Xt:void 0;if(!Gt&&!p&&w===void 0)return;const T=Vr??R.bgRowHovered;return D=>D>t.length-1?{bgCell:R.bgHeader}:V!=null&&V.has(D)?{bgCell:D===w?R.bgSelectedRowHovered:R.selectionCheckboxBg}:D===w?{bgCell:T}:{}},[t.length,Gt,R.bgHeader,R.selectionCheckboxBg,R.bgRowHovered,R.bgSelectedRowHovered,V,le,Xt,Vr]),{onItemHovered:Js,hideTooltip:Qs}=mu({columnsLast:X,rows:t,ctxs:s,refTable:l,theme:R,portalEventTargetRef:f,externalOnItemHovered:g,onHoverRowChange:le?Zs:void 0},Ht);xe.current=Qs;const tc=as({cellsSelectionMode:Q,selection:St,baseTheme:R,serviceColumnsCount:nt.leadingServiceColumnsCount,activeDataRange:nt.activeDataRange,outlineRange:nt.outlineRange,checkboxSelectedRowIndexes:V,errorCellRanges:Ps,highlightRegionsExternal:Z}),pi=ls({baseRegions:tc,selectedColumnIndexes:Ts,headerSelectedRowIndexes:kr,activeRow:Ds,activeRange:(qr=St.current)==null?void 0:qr.range,selectionRangeStack:(Kr=St.current)==null?void 0:Kr.rangeStack,checkboxAvailableRowIndexes:j,totalRows:t.length+Gt,firstDataCol:nt.leadingServiceColumnsCount,columnsCount:Rt.length,theme:R}),ec=m.useMemo(()=>{const p=nt.leadingServiceColumnsCount;return!le||Xt===void 0||Xt>t.length-1||p===0?pi:[{color:R.bgServiceRowHovered,range:{x:0,y:Xt,width:p,height:1},style:"no-outline"},...pi??[]]},[pi,nt.leadingServiceColumnsCount,le,Xt,t.length,R.bgServiceRowHovered]),ic=m.useMemo(()=>{if(!(!F&&!L&&!E))return{...F,...L?{position:"relative"}:void 0,...E?{height:"100%",minHeight:0}:void 0}},[F,L,E]);return xt.jsxs("div",{ref:Ms,className:A,style:ic,children:[Gr?$e.createPortal(xt.jsx(_i,{ref:gi,onAnimationEndCapture:p=>p.stopPropagation(),id:"portal"}),(kt==null?void 0:kt.current)??document.body):$e.createPortal(xt.jsx(_i,{id:"portal",ref:gi}),document.body),$e.createPortal(xt.jsx(_i,{id:"portal2"}),document.body),!E&&xt.jsx(yu,{ref:Us,className:"gdg-table",portalElementRef:gi,theme:R,getRowThemeOverride:js,onHeaderClicked:Os,onGroupHeaderClicked:Ns,onMouseMove:Vs,drawHeader:zs,drawGroupHeader:qs,getGroupDetails:Ws,getCellContent:ce,columns:X,rows:t.length+Gt,freezeTrailingRows:Gt,freezeColumns:c,minColumnWidth:b,maxColumnAutoWidth:S,maxColumnWidth:y,columnSelect:"none",columnSelectionBlending:"exclusive",drawFocusRing:Is,gridSelection:St,onGridSelectionChange:Hs,onSelectionCleared:Ls,width:o??"100%",onColumnMoved:Ys,onColumnResize:v?Fs:void 0,customRenderers:ks,rowHeight:ps,highlightRegions:ec,rangeSelect:As,smoothScrollX:!0,smoothScrollY:!0,headerHeight:qe,onCellClicked:_s,onCellContextMenu:Rs,onItemHovered:Js,onVisibleRegionChanged:Bs,...Wt,experimental:Xs,keybindings:{...Wt.keybindings,copy:!1,paste:!1},onPaste:!1}),L,Gs&&Ci&&(I==null?void 0:I({containerElement:Ci,renderInContainer:$s}))]})};exports.BUTTON_PADDING_Y=oe;exports.CACHE_SEPARATOR=hr;exports.CANVAS_CELL_KIND=ai;exports.CANVAS_PORTAL_EVENT=je;exports.Canvas=me;exports.CanvasAbsoluteContainer=wc;exports.CanvasBadge=xn;exports.CanvasButton=wn;exports.CanvasChevron=Kc;exports.CanvasContainer=Ct;exports.CanvasEmbedIconButton=Xi;exports.CanvasHoverController=sr;exports.CanvasIcon=An;exports.CanvasIconButton=En;exports.CanvasLeaf=Ft;exports.CanvasLink=_n;exports.CanvasNode=Mt;exports.CanvasRect=Tn;exports.CanvasRegistry=Qo;exports.CanvasRoot=Dc;exports.CanvasSkeleton=Bn;exports.CanvasText=br;exports.CellCanvasRoot=yt;exports.DANGER_COLOR=ur;exports.DANGER_TEXT_COLOR=Mi;exports.DEFAULT_ACCENT_FG=pe;exports.DEFAULT_BORDER_WIDTH=Tt;exports.DEFAULT_BUTTON_RADIUS=ar;exports.DEFAULT_CURSOR=Mn;exports.DEFAULT_HEADER_HEIGHT=qe;exports.DEFAULT_ICON_SIZE=en;exports.DEFAULT_ICON_SPACING=lr;exports.DEFAULT_ROW_HEIGHT=zo;exports.DEFAULT_SECONDARY_HOVER=rn;exports.DEFAULT_SIZE=si;exports.DEFAULT_TEXT_PADDING=Ic;exports.DEFAULT_VIEW=ci;exports.DISABLED_BG_COLOR=on;exports.DISABLED_BORDER_COLOR=nn;exports.DISABLED_TEXT_COLOR=zi;exports.DrawBatcher=oi;exports.EMPTY_CELL_OBJ=uc;exports.FlexBox=Et;exports.FlexElement=$o;exports.FlexTreeBuilder=Yo;exports.HEX_COLOR_CHAR_CODE=cn;exports.HEX_COLOR_PREFIX=sn;exports.ICON_SIZE_ADJUSTMENT=ne;exports.IconSpriteManager=fn;exports.LEGACY_HOVER_CURSOR=zn;exports.LIGHTEN_AMOUNT=dr;exports.LayoutReconciler=qo;exports.MAX_ICON_SIZE=cr;exports.POINTER_CANDIDATE_KEYS=kn;exports.PositionResolver=wt;exports.RELATIVE_COORD_TOLERANCE=ve;exports.RootBridge=Il;exports.RootFlexBox=nr;exports.SIZES=Oo;exports.SIZE_CONFIG=at;exports.SizeAccumulator=ri;exports.TABLE_GLIDE_SIZES=hc;exports.THEME=Du;exports.TableGlide=Lu;exports.VIEW_COLORS=ni;exports.buildButtonViewColors=tn;exports.buildCanvasTree=Qe;exports.buildCellId=ee;exports.calculateButtonWidth=Cr;exports.calculateContentWidth=vr;exports.canvasCellRenderer=Cl;exports.clearButtonCaches=Hc;exports.clearIconCache=ml;exports.createCanvasCell=Rn;exports.createCanvasCellRenderer=wr;exports.createEmptyCellGlide=Qt;exports.createNormalCanvasInteraction=Jo;exports.createRafUpdate=Er;exports.createSvgDataUrl=Ui;exports.createTextCellGlide=ti;exports.defaultBatcher=Tc;exports.defaultIconManager=Dt;exports.dispatchCanvasPortalHover=Jt;exports.drawButton=yn;exports.drawButtonWithView=Fn;exports.drawEmbedIconButtonWithView=bn;exports.drawIcon=mn;exports.drawIcon$1=ft;exports.drawIconButton=Fr;exports.drawIconButtonWithView=Sn;exports.drawIconDirect=Mc;exports.findBlockOrigin=vs;exports.flexBoxLayout=pc;exports.fontStyles=Ke;exports.getCachedTextWidth=gr;exports.getCellIndices=Xe;exports.getDpr=Ve;exports.getHoverState=qn;exports.getIconCacheSize=pl;exports.getIconImageDirect=pn;exports.getIconSprite=Cn;exports.getIconSpriteStats=Rc;exports.getRelativePointerPosition=On;exports.getRowHeightBySize=Ue;exports.getTheme=Lr;exports.handleCanvasRootClick=Gn;exports.handleCanvasRootHover=Kn;exports.handleCellClick=Un;exports.handleClickHandlers=$n;exports.hashString=dn;exports.isAbsoluteCoords=Nn;exports.isCanvasCell=Sr;exports.isCanvasContent=or;exports.isCanvasEl=li;exports.isCanvasString=Dr;exports.isGlideCellObj=Kl;exports.isGlideGridCellObj=ss;exports.isHoveringBounds=zt;exports.isObject=ql;exports.isPointInArea=yr;exports.isPortalHoverLocked=rl;exports.isPrimitive=Tr;exports.isReactIcon=At;exports.isRelativeCoords=Wn;exports.isValueEmpty=cs;exports.lightenColor=fr;exports.lightenColorCached=an;exports.lockPortalHover=il;exports.normalizeCanvasInteraction=jo;exports.normalizeDimensionValue=er;exports.normalizeHoverPoint=hn;exports.normalizeIcon=mt;exports.onAnyIconLoad=gn;exports.performCanvasClick=xr;exports.performCanvasPointerDownIntent=Jn;exports.preloadIconSprites=vn;exports.queryGlideElements=Cs;exports.reactIconToSvg=Qn;exports.rectContainsCell=Ir;exports.registerIconDefinitions=_c;exports.resetIconSpriteCache=kc;exports.resolveButtonColors=mr;exports.resolveClickPoint=Gi;exports.resolveDangerColors=un;exports.resolvePaddingBox=Uo;exports.resolvePaddingBox$1=Zo;exports.resolvePrimaryColors=Wi;exports.resolveSecondaryColors=ln;exports.resolveViewColors=pr;exports.retrieveRenderData=ie;exports.storeRenderData=Vn;exports.subscribeToCanvasPortalHover=hl;exports.subscribeToPortalHoverLock=ol;exports.toRelativePoint=$i;exports.updateGridCells=Ar;exports.updateHoverState=Yn;exports.updateHoverStateIfNeeded=Zn;exports.useBaseHighlightRegions=as;exports.useCanvasRegistry=Yl;exports.useColumnRowHighlightRegions=ls;exports.useFontLoadRedraw=os;exports.useIconLoadRedraw=ns;exports.useNativeGridSelection=us;exports.useSelectionGeometry=hs;exports.useTableSelectionSystem=ds;exports.waitForCanvasFonts=is;exports.waitForDocumentFonts=es;exports.waitForFonts=rs;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";const x=require("react/jsx-runtime"),s=require("react"),T=require("../constants/index.cjs"),h=require("styled-components"),V=require("../shared/utils/debug/index.cjs"),S="xl",v=T.breakPoints,E=s.createContext({breakpoint:S,breakpointConfig:v}),b=e=>t=>`
|
|
2
|
-
@media ${e} {
|
|
3
|
-
${t}
|
|
4
|
-
}
|
|
5
|
-
`,W=e=>({xs:{min:0,max:e.xs-1},s:{min:e.xs+1,max:e.s},m:{min:e.s+1,max:e.m},l:{min:e.m+1,max:e.l},xl:{min:e.l+1,max:e.xl},xxl:{min:e.xl+1,max:1e5}}),A=e=>{const t=W(e);return{up:n=>b(`(min-width: ${t[n].max+1}px)`),down:n=>b(`(max-width: ${t[n].min-1}px)`),only:n=>b(`(min-width: ${t[n].min}px) and (max-width: ${t[n].max}px)`),not:n=>b(`(max-width: ${t[n].min-1}px), (min-width: ${t[n].max+1}px)`),between:(n,r)=>b(`(min-width: ${t[n].min}px) and (max-width: ${t[r].max}px)`),exact:(n,r)=>b(`(min-width: ${n}px) and (max-width: ${r}px)`)}},j=A(v),I=({breakpointConfig:e=v,children:t})=>x.jsx(h.ThemeProvider,{theme:{media:A(e)},children:t}),_=({children:e,breakpointConfig:t=v})=>{const[n,r]=s.useState(S);s.useEffect(()=>{const a=Object.entries(t).map(([i,c])=>({key:i,mql:window.matchMedia(`(max-width: ${c}px)`)})),u=()=>{var c;const i=((c=a.find(({mql:l})=>l.matches))==null?void 0:c.key)||S;r(i)};return u(),a.forEach(({mql:i})=>{i.addEventListener("change",u)}),()=>{a.forEach(({mql:i})=>{i.removeEventListener("change",u)})}},[]);const o=s.useMemo(()=>({breakpoint:n,breakpointConfig:t}),[n,t]);return x.jsx(E.Provider,{value:o,children:x.jsx(I,{breakpointConfig:t,children:e})})},U=()=>{const{breakpoint:e,breakpointConfig:t}=s.useContext(E),n=s.useMemo(()=>({up:r=>t[e]>t[r],down:r=>t[e]<t[r],only:r=>t[e]===t[r],not:r=>t[e]!==t[r],between:(r,o)=>t[e]>t[r]&&t[e]<t[o]}),[e,t]);return{breakpoint:e,...n}};function N(e,t,n,r={}){const o={bubbles:!0,cancelable:!0,composed:!0,...r,detail:n},a=new CustomEvent(t,o);return e.dispatchEvent(a)}const H=null,k=s.createContext(H),q=({children:e,clickStreamInstance:t})=>x.jsx(k.Provider,{value:t,children:e});var D=(e=>(e.START="Start",e.END="End",e.SUCCESS="Success",e.FAILED="Failed",e))(D||{}),L=(e=>(e.BUISINESS="business",e))(L||{});const M=()=>{const e=s.useContext(k);if(!e)throw new Error("Ошибка. Приложение необходимо обернуть в ClickStreamProvider");return e},z=(e,t)=>e.join("/").concat(t?`_${t}`:""),K=e=>Object.entries(e).reduce((t,n)=>{if(n[0]&&n[1]){const r={key:n[0],value:n[1]};t.push(r)}return t},[]),Q=e=>Array.isArray(e)?e.join(";"):typeof e=="boolean"?`${e}`:e??"null";function X(e,t){if(!t)return e;const n=JSON.stringify(t),r=btoa(n);return e.set("X-Digital-Trace-Context",r),e}function Y(e){function t(){const i=s.useRef(e),c=s.useCallback(()=>i.current,[]),l=s.useRef(new Set),d=s.useCallback(m=>{i.current={...i.current,...m},l.current.forEach(g=>g())},[]),f=s.useCallback(m=>(l.current.add(m),()=>l.current.delete(m)),[]);return{get:c,set:d,subscribe:f}}const n=s.createContext(null);function r({children:i}){return x.jsx(n.Provider,{value:t(),children:i})}function o(i){const c=s.useContext(n);if(!c)throw new Error("Store not found");const[l,d]=s.useState(c.get());return s.useEffect(()=>c.subscribe(()=>d(c.get())),[]),[i(l),c.set]}function a(){const i=s.useContext(n);if(!i)throw new Error("Store not found");return i.set}function u(i){const c=s.useContext(n);if(!c)throw new Error("Store not found");const[l,d]=s.useState(c.get());return s.useEffect(()=>c.subscribe(()=>d(c.get())),[]),i(l)}return{Provider:r,useStore:o,useSelector:u,useDispatch:a}}const G=typeof requestAnimationFrame=="function",J=typeof cancelAnimationFrame=="function",Z=e=>G?requestAnimationFrame(e):setTimeout(e,0),ee=e=>{J?cancelAnimationFrame(e):clearTimeout(e)},R=e=>{let t=null;return new ResizeObserver((n,r)=>{t!==null&&ee(t),t=Z(()=>{t=null,e(n,r)})})},te=(e,t=200)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}},B=(e,t,n="")=>{const r=[],o=new Map;return e.forEach((a,u)=>{const i=`${n}-${u}`,c=a.value||i,l={...a,value:c};if(t&&o.set(c.toString(),t),a.items){const[d,f]=B(a.items,t,i);f.forEach((m,g)=>o.set(g,m)),l.items=d}r.push(l)}),[r,o]},ne=e=>s.useCallback((t,n)=>{const r=e.get(t.value);r==null||r(t,n)},[e]),re=null,P=s.createContext(re),oe=({children:e,busInstance:t})=>x.jsx(P.Provider,{value:t,children:e}),se=()=>{const e=s.useContext(P);if(!e)throw new Error("Ошибка. Приложение необходимо обернуть в EventBusProvider");return e},ie=()=>{const e=new Uint8Array(16);crypto.getRandomValues(e);const t=Array.from(e).map(o=>o.toString(16).padStart(2,"0")).join(""),n=new Uint8Array(8);crypto.getRandomValues(n);const r=Array.from(n).map(o=>o.toString(16).padStart(2,"0")).join("");return{traceId:t,requestQueryParam:"rq",headers:{"x-b3-traceid":t,"x-b3-spanid":r}}},w=()=>{const e=document.documentElement.getAttribute("data-theme");return e==="dark"?"dark":e==="highContrastLight"?"highContrastLight":e==="betaCoreLight"?"betaCoreLight":"light"},ae=e=>e?h.css(["&&{","}"],e):void 0,C=new Map;function ce(e){const t=`${e}_<space>`;if(C.has(t)){const o=C.get(t);return typeof o=="number"&&o||0}const n=document.createElement("span");n.style.cssText=`
|
|
6
|
-
font: ${e};
|
|
7
|
-
visibility: hidden;
|
|
8
|
-
white-space: pre-wrap;
|
|
9
|
-
position: absolute;
|
|
10
|
-
`,n.textContent=" ",document.body.appendChild(n);const r=n.offsetWidth;return document.body.removeChild(n),C.set(t,r),r}function ue(e,t){const n=document.createElement("span");n.style.cssText=`
|
|
11
|
-
font: ${t};
|
|
12
|
-
visibility: hidden;
|
|
13
|
-
white-space: nowrap;
|
|
14
|
-
position: absolute;
|
|
15
|
-
padding: 0;
|
|
16
|
-
margin: 0;
|
|
17
|
-
`,n.textContent=e,document.body.appendChild(n);const r=n.offsetWidth;return document.body.removeChild(n),r}function $(e,t){if(e===" ")return ce(t);if(e===" ")return $(" ",t)*4;const n=`${t}_${e}`;if(C.has(n)){const o=C.get(n);return typeof o=="number"&&o||0}const r=ue(e,t);return C.set(n,r),r}function le(e,t,n=0){if(!e)return 0;const r=Array.from(e).reduce((u,i)=>u+$(i,t),0),o=e.length,a=Math.max(o-1,0)*n;return r+a}function de(e,t,n=0){const r=document.createElement("span");r.style.cssText=`
|
|
18
|
-
font: ${t};
|
|
19
|
-
visibility: hidden;
|
|
20
|
-
position: absolute;
|
|
21
|
-
white-space: pre;
|
|
22
|
-
padding: 0;
|
|
23
|
-
margin: 0;
|
|
24
|
-
letter-spacing: ${n}px;
|
|
25
|
-
`,r.textContent=e,document.body.appendChild(r);const o=r.offsetWidth;return document.body.removeChild(r),o}function me(e,t,n=0){return e?de(e,t,n):0}const fe=e=>{const t=e.substring(e.indexOf("(")+1,e.indexOf(","));return getComputedStyle(document.body).getPropertyValue(t)},he=(e,t)=>{const n=t.split(".");let r=e;for(const o of n)if(typeof r=="object"&&r!==null&&o in r)r=r[o];else return;return r},pe=e=>T.viewColors[e],ge=()=>{const[e,t]=s.useState(()=>w()??"light");return s.useEffect(()=>{t(w());const n=new MutationObserver(()=>t(w()));return n.observe(document.documentElement,{childList:!1,attributes:!0,attributeFilter:["data-theme"],subtree:!1}),()=>{var r;return(r=n==null?void 0:n.disconnect)==null?void 0:r.call(n)}},[]),e},be=(e,t)=>{const[n,r]=s.useState(!1),o=s.useRef();return[s.useCallback(function(...u){r(!0),clearTimeout(o.current),o.current=setTimeout(()=>{e.apply(this,u),r(!1)},t)},[t,e]),{debouncing:n}]},Ce=(e,t=500,n)=>{const[r,o]=s.useState(n??e);return s.useEffect(()=>{const a=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(a)}},[e]),r},p=new Map,xe=e=>!e||p.get(e)==="loaded"?Promise.resolve():new Promise(t=>{const n=new Image;n.onload=()=>{p.set(e,"loaded"),t()},n.onerror=()=>{p.set(e,"error"),t()},n.src=e}),we=(e,t=0)=>{const[n,r]=s.useState(()=>e?p.get(e)??"loading":"idle"),[o,a]=s.useState(0),u=s.useRef(e);u.current=e;const i=s.useCallback(()=>{e&&p.delete(e),a(c=>c+1)},[e]);return s.useEffect(()=>{if(!e){r("idle");return}const c=p.get(e);if(c){r(c);return}let l=!0,d;r("loading");const f=g=>{p.set(e,g);const y=()=>{l&&u.current===e&&r(g)};t>0?d=setTimeout(y,t):y()},m=new Image;return m.onload=()=>f("loaded"),m.onerror=()=>f("error"),m.src=e,()=>{l=!1,d&&clearTimeout(d)}},[e,o,t]),{status:n,isLoading:n==="loading",isLoaded:n==="loaded",isError:n==="error",reload:i}},ve=typeof window<"u"&&"structuredClone"in window&&typeof window.structuredClone=="function"||typeof globalThis<"u"&&"structuredClone"in globalThis&&typeof globalThis.structuredClone=="function";function F(...e){return e.reduce((t,n)=>(!n||typeof n!="string"||(t=`${t} ${n}`),t),"")}const Se=F;function ye(...e){const t=e.filter(Boolean);return t.length<=1?t[0]||null:function(r){for(const o of t)typeof o=="function"?o(r):o&&(o.current=r)}}const Te=(e,t,n)=>t>n?n:t<e?e:t,O=e=>e!=null&&e.lines&&e.lines>1?{display:"-webkit-box",WebkitLineClamp:e.lines,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal"}:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},Ee=e=>h.css(O(e)),Ae=h.css(["width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;"]),Ie=(e,t=200)=>{let n;return(...r)=>{n||(n=!0,e(...r),setTimeout(()=>{n=!1},t))}},ke=(e,t=200)=>{let n=null,r=null,o=!1;const a=(...u)=>{n=u,o||(e(...u),o=!0,r=setTimeout(()=>{o=!1,n!==u&&a(...n),r=null},t))};return a.cancel=()=>{r&&(clearTimeout(r),o=!1,r=null)},a},De="0.3s",Le=`all ${De} ease`,Re=h.keyframes(["from{transform:scale(0.85);opacity:0;}to{transform:scale(1);opacity:1;}"]),Be=h.keyframes(["from{transform:scale(1);opacity:1;}to{transform:scale(0.85);opacity:0;}"]);h.css(["animation:"," "," "," forwards;"],({$isOpen:e})=>e?Re:Be,({$duration:e="2.35s"})=>e,({$timing:e="ease"})=>e);const Pe=h.keyframes(["from{opacity:0;transform:translateY(-10px);}to{opacity:1;transform:translateY(0);}"]),$e=(e,t="vertical",n=!0)=>{const[r,o]=s.useState({vertical:!1,horizontal:!1});switch(s.useEffect(()=>{const a=e.current;if(!a)return;const u=()=>{if(!a)return;const c=a.scrollHeight>a.clientHeight,l=a.scrollWidth>a.clientWidth;o(d=>d.vertical!==c||d.horizontal!==l?{vertical:c,horizontal:l}:d)};u();let i;return n&&typeof ResizeObserver<"u"&&(i=R(u),i.observe(a)),()=>{i==null||i.disconnect()}},[e,n]),t){case"vertical":return r.vertical;case"horizontal":return r.horizontal;case"both":return r;default:return r.vertical}},Fe=V.createDebugLogger("TABLE");exports.BreakpointProvider=_;exports.ClickStreamProvider=q;exports.DEFAULT_TRANSITION=Le;exports.EClickStreamErrorType=L;exports.EClickStreamStatusProcess=D;exports.EventBusProvider=oe;exports.MediaProvider=I;exports.bubble=N;exports.clamp=Te;exports.createClickStreamEventValue=z;exports.createSafeResizeObserver=R;exports.createStore=Y;exports.debounce=te;exports.fadeIn=Pe;exports.generateB3Headers=ie;exports.getActiveTheme=w;exports.getCssProp=ae;exports.getTextWidth=me;exports.getTextWidthByCache=le;exports.getTokenValue=fe;exports.getValue=he;exports.getViewColor=pe;exports.injectDigitalTraceContextHeader=X;exports.isStructuredCloneSupported=ve;exports.mCls=Se;exports.media=j;exports.mergeClasses=F;exports.mergeRefs=ye;exports.preloadImage=xe;exports.processDropdownItems=B;exports.tableDebug=Fe;exports.throttle=Ie;exports.throttleWithLastCall=ke;exports.transformClickStreamProperties=K;exports.transformClickStreamPropertyValuesToString=Q;exports.truncateText=O;exports.truncateTextCss=Ee;exports.useActiveTheme=ge;exports.useBreakpoint=U;exports.useClickStream=M;exports.useDebouncedFn=be;exports.useDebouncedValue=Ce;exports.useDropdownItemClickHandler=ne;exports.useEventBus=se;exports.useHasScroll=$e;exports.useImageLoader=we;exports.visuallyHiddenCss=Ae;
|