@daisforge/ui 1.16.0 → 1.18.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.
Files changed (370) hide show
  1. package/chunks/{AnalyticalWidget-BWcBjoNh.mjs → AnalyticalWidget-Cdo6_s1Y.mjs} +165 -163
  2. package/chunks/AnalyticalWidget-wke3Jm3X.cjs +43 -0
  3. package/chunks/{ApprovalCenter-CGs7n-2C.cjs → ApprovalCenter-CAcC43zn.cjs} +1 -1
  4. package/chunks/{ApprovalCenter-BqN8Zjol.mjs → ApprovalCenter-DxcvzR8q.mjs} +1 -1
  5. package/chunks/{BlockTitle-o2QTRA7D.cjs → BlockTitle-BEIxiECX.cjs} +1 -1
  6. package/chunks/{BlockTitle-BM2EE1b1.mjs → BlockTitle-BZxOEdTc.mjs} +1 -1
  7. package/chunks/{FiltersActions-CKimtYsU.cjs → FiltersActions-BKJJH6Mu.cjs} +1 -1
  8. package/chunks/{FiltersActions-C5OGUDDx.mjs → FiltersActions-CFStLRsU.mjs} +3 -3
  9. package/chunks/{GridDND-DkL6-TgS.cjs → GridDND-DV-1g1sI.cjs} +1 -1
  10. package/chunks/{GridDND-D9T2wqLt.mjs → GridDND-UMUi8M_Q.mjs} +1 -1
  11. package/chunks/{ListOfFilters-B8XF6KiI.cjs → ListOfFilters-DJvnT9kw.cjs} +1 -1
  12. package/chunks/{ListOfFilters-BEDW_v5t.mjs → ListOfFilters-DTAZ3wfQ.mjs} +2 -2
  13. package/chunks/{MassActions-C66ulAuq.mjs → MassActions-DSAaO1-u.mjs} +2 -2
  14. package/chunks/{MassActions-BHNmuh3s.cjs → MassActions-Z-48g81T.cjs} +1 -1
  15. package/chunks/{PageTitle-BEdQpyZh.cjs → PageTitle-Bh3g6FUT.cjs} +1 -1
  16. package/chunks/{PageTitle-BVbWaV52.mjs → PageTitle-CaqXfrrQ.mjs} +1 -1
  17. package/chunks/{Stories-DVh7iByM.cjs → Stories-CZXv_Ves.cjs} +1 -1
  18. package/chunks/{Stories-lNAuXVJN.mjs → Stories-Dlwle-SM.mjs} +1 -1
  19. package/chunks/{Table-C_1QGsh8.mjs → Table-B9OAyWAW.mjs} +4 -4
  20. package/chunks/{Table-C-lLZklk.cjs → Table-BwhzcFX1.cjs} +1 -1
  21. package/chunks/{TableCanvas--g37wjRi.mjs → TableCanvas-DcoUBrgC.mjs} +5315 -4827
  22. package/chunks/TableCanvas-MMWMrYiV.cjs +30 -0
  23. package/chunks/{TableGlide-Cjcw7Wur.mjs → TableGlide-Ch-gaROR.mjs} +1982 -1852
  24. package/chunks/TableGlide-TYzM2bEB.cjs +1 -0
  25. package/components/AiAgentPopover/AiAgentPopover.styled.d.ts +1 -0
  26. package/components/AnalyticalWidget/AnalyticalWidget.d.ts +5 -3
  27. package/components/AnalyticalWidget/components/AnalyticalWidgetButtons/AnalyticalWidgetIconButtonDots.d.ts +69 -11
  28. package/components/AnalyticalWidget/components/AnalyticalWidgetButtons/index.cjs +1 -1
  29. package/components/AnalyticalWidget/components/AnalyticalWidgetButtons/index.mjs +1 -1
  30. package/components/AnalyticalWidget/components/AnalyticalWidgetChips/index.cjs +1 -1
  31. package/components/AnalyticalWidget/components/AnalyticalWidgetChips/index.mjs +1 -1
  32. package/components/AnalyticalWidget/components/AnalyticalWidgetHeader/index.cjs +1 -1
  33. package/components/AnalyticalWidget/components/AnalyticalWidgetHeader/index.mjs +1 -1
  34. package/components/AnalyticalWidget/index.cjs +1 -1
  35. package/components/AnalyticalWidget/index.mjs +1 -1
  36. package/components/ApprovalCenter/components/index.cjs +1 -1
  37. package/components/ApprovalCenter/components/index.mjs +1 -1
  38. package/components/ApprovalCenter/index.cjs +1 -1
  39. package/components/ApprovalCenter/index.mjs +1 -1
  40. package/components/ApprovalCenter/styled.d.ts +1 -0
  41. package/components/AutocompleteSearch/index.cjs +1 -1
  42. package/components/AutocompleteSearch/index.mjs +1 -1
  43. package/components/BlockTitle/index.cjs +1 -1
  44. package/components/BlockTitle/index.mjs +1 -1
  45. package/components/BlockTitle/utils/index.cjs +1 -1
  46. package/components/BlockTitle/utils/index.mjs +1 -1
  47. package/components/Combobox/index.cjs +1 -1
  48. package/components/Combobox/index.mjs +1 -1
  49. package/components/DrawerDF/components/styled.d.ts +1 -0
  50. package/components/GridDND/index.cjs +1 -1
  51. package/components/GridDND/index.mjs +1 -1
  52. package/components/GridDND/utils/index.cjs +1 -1
  53. package/components/GridDND/utils/index.mjs +1 -1
  54. package/components/LeftPanel/styled.d.ts +1 -0
  55. package/components/ListOfFilters/index.cjs +1 -1
  56. package/components/ListOfFilters/index.mjs +1 -1
  57. package/components/MassActions/hooks/index.cjs +1 -1
  58. package/components/MassActions/hooks/index.mjs +1 -1
  59. package/components/MassActions/index.cjs +1 -1
  60. package/components/MassActions/index.mjs +1 -1
  61. package/components/MassActions/styled.d.ts +7 -2
  62. package/components/PageTitle/index.cjs +1 -1
  63. package/components/PageTitle/index.mjs +1 -1
  64. package/components/PageTitle/utils/index.cjs +1 -1
  65. package/components/PageTitle/utils/index.mjs +1 -1
  66. package/components/PopoverDF/index.cjs +1 -1
  67. package/components/PopoverDF/index.mjs +1 -1
  68. package/components/PopupDF/index.cjs +1 -1
  69. package/components/PopupDF/index.d.ts +1 -1
  70. package/components/PopupDF/index.mjs +108 -94
  71. package/components/PopupDF/types.d.ts +1 -1
  72. package/components/Stories/components/StoriesBanner/index.cjs +1 -1
  73. package/components/Stories/components/StoriesBanner/index.mjs +1 -1
  74. package/components/Stories/components/StoriesContent/index.cjs +1 -1
  75. package/components/Stories/components/StoriesContent/index.mjs +1 -1
  76. package/components/Stories/components/StoriesPreview/index.cjs +1 -1
  77. package/components/Stories/components/StoriesPreview/index.mjs +1 -1
  78. package/components/Stories/components/StoriesProgress/index.cjs +1 -1
  79. package/components/Stories/components/StoriesProgress/index.mjs +1 -1
  80. package/components/Stories/components/StoriesViewer/index.cjs +1 -1
  81. package/components/Stories/components/StoriesViewer/index.mjs +1 -1
  82. package/components/Stories/index.cjs +1 -1
  83. package/components/Stories/index.mjs +1 -1
  84. package/components/Table/components/TableDropdown/index.cjs +1 -1
  85. package/components/Table/components/TableDropdown/index.mjs +1 -1
  86. package/components/Table/feature-collapse-table/CollapseTableButton.d.ts +2 -0
  87. package/components/Table/feature-collapse-table/index.cjs +1 -1
  88. package/components/Table/feature-collapse-table/index.mjs +1 -1
  89. package/components/Table/feature-column-control/ColumnsList/index.cjs +1 -1
  90. package/components/Table/feature-column-control/ColumnsList/index.mjs +1 -1
  91. package/components/Table/feature-column-control/index.cjs +1 -1
  92. package/components/Table/feature-column-control/index.mjs +1 -1
  93. package/components/Table/feature-column-control/styled.d.ts +1 -0
  94. package/components/Table/feature-columns-grouping/index.cjs +1 -1
  95. package/components/Table/feature-columns-grouping/index.mjs +1 -1
  96. package/components/Table/feature-context-menu/index.cjs +1 -1
  97. package/components/Table/feature-context-menu/index.mjs +1 -1
  98. package/components/Table/feature-edit/index.cjs +1 -1
  99. package/components/Table/feature-edit/index.mjs +1 -1
  100. package/components/Table/feature-filtering/combobox/index.cjs +1 -1
  101. package/components/Table/feature-filtering/combobox/index.mjs +1 -1
  102. package/components/Table/feature-filtering/filter-list-block/index.cjs +1 -1
  103. package/components/Table/feature-filtering/filter-list-block/index.mjs +1 -1
  104. package/components/Table/feature-filtering/header-filter-button/index.cjs +1 -1
  105. package/components/Table/feature-filtering/header-filter-button/index.mjs +1 -1
  106. package/components/Table/feature-filtering/header-filter-button/styles.d.ts +1 -0
  107. package/components/Table/feature-filtering/index.cjs +1 -1
  108. package/components/Table/feature-filtering/index.mjs +1 -1
  109. package/components/Table/feature-filtering/sidebar-filter-block/index.cjs +1 -1
  110. package/components/Table/feature-filtering/sidebar-filter-block/index.mjs +1 -1
  111. package/components/Table/feature-infinity-scroll/index.cjs +1 -1
  112. package/components/Table/feature-infinity-scroll/index.mjs +1 -1
  113. package/components/Table/feature-key-text/index.cjs +1 -1
  114. package/components/Table/feature-key-text/index.mjs +1 -1
  115. package/components/Table/feature-pagination/index.cjs +1 -1
  116. package/components/Table/feature-pagination/index.mjs +1 -1
  117. package/components/Table/feature-right-sidebar/index.cjs +1 -1
  118. package/components/Table/feature-right-sidebar/index.mjs +1 -1
  119. package/components/Table/feature-row-detail/handlers.d.ts +1 -0
  120. package/components/Table/feature-row-detail/index.cjs +1 -1
  121. package/components/Table/feature-row-detail/index.mjs +1 -1
  122. package/components/Table/feature-row-instruments/index.cjs +1 -1
  123. package/components/Table/feature-row-instruments/index.mjs +1 -1
  124. package/components/Table/feature-row-size/index.cjs +1 -1
  125. package/components/Table/feature-row-size/index.mjs +1 -1
  126. package/components/Table/feature-rows-grouping/index.cjs +1 -1
  127. package/components/Table/feature-rows-grouping/index.mjs +1 -1
  128. package/components/Table/feature-searching/index.cjs +1 -1
  129. package/components/Table/feature-searching/index.mjs +1 -1
  130. package/components/Table/feature-searching/styled.d.ts +1 -0
  131. package/components/Table/feature-select-row/index.cjs +1 -1
  132. package/components/Table/feature-select-row/index.mjs +1 -1
  133. package/components/Table/feature-sorting/index.cjs +1 -1
  134. package/components/Table/feature-sorting/index.mjs +1 -1
  135. package/components/Table/feature-sorting/styles.d.ts +1 -0
  136. package/components/Table/feature-table-settings/index.cjs +1 -1
  137. package/components/Table/feature-table-settings/index.mjs +1 -1
  138. package/components/Table/feature-tree/index.cjs +1 -1
  139. package/components/Table/feature-tree/index.mjs +1 -1
  140. package/components/Table/index.cjs +1 -1
  141. package/components/Table/index.mjs +1 -1
  142. package/components/Table/renders/formatCell/index.cjs +1 -1
  143. package/components/Table/renders/formatCell/index.mjs +1 -1
  144. package/components/Table/styles/index.cjs +1 -1
  145. package/components/Table/styles/index.mjs +1 -1
  146. package/components/Table/table-hooks/index.cjs +1 -1
  147. package/components/Table/table-hooks/index.mjs +1 -1
  148. package/components/Table/types/index.cjs +1 -1
  149. package/components/Table/types/index.mjs +1 -1
  150. package/components/Table/utils/index.cjs +1 -1
  151. package/components/Table/utils/index.mjs +1 -1
  152. package/components/Table/widgets/control-block/control-block-button.d.ts +3 -2
  153. package/components/Table/widgets/control-block/index.cjs +1 -1
  154. package/components/Table/widgets/control-block/index.mjs +1 -1
  155. package/components/Table/widgets/control-block/right-side/index.cjs +1 -1
  156. package/components/Table/widgets/control-block/right-side/index.mjs +1 -1
  157. package/components/Table/widgets/index.cjs +1 -1
  158. package/components/Table/widgets/index.mjs +1 -1
  159. package/components/Table/widgets/mass-actions/index.cjs +1 -1
  160. package/components/Table/widgets/mass-actions/index.mjs +1 -1
  161. package/components/TableCanvas/TableGlideInstance/adapters/column/index.cjs +1 -1
  162. package/components/TableCanvas/TableGlideInstance/adapters/column/index.mjs +1 -1
  163. package/components/TableCanvas/TableGlideInstance/adapters/index.cjs +1 -1
  164. package/components/TableCanvas/TableGlideInstance/adapters/index.mjs +1 -1
  165. package/components/TableCanvas/TableGlideInstance/index.cjs +1 -1
  166. package/components/TableCanvas/TableGlideInstance/index.mjs +2 -2
  167. package/components/TableCanvas/TableGlideInstance/type.d.ts +3 -1
  168. package/components/TableCanvas/TableGlideInstance/utils/column/index.cjs +1 -1
  169. package/components/TableCanvas/TableGlideInstance/utils/column/index.mjs +1 -1
  170. package/components/TableCanvas/TableGlideInstance/utils/index.cjs +1 -1
  171. package/components/TableCanvas/TableGlideInstance/utils/index.mjs +1 -1
  172. package/components/TableCanvas/components/SplitIconButton/index.cjs +1 -1
  173. package/components/TableCanvas/components/SplitIconButton/index.mjs +1 -1
  174. package/components/TableCanvas/components/TableDropdown/index.cjs +1 -1
  175. package/components/TableCanvas/components/TableDropdown/index.mjs +1 -1
  176. package/components/TableCanvas/feature-cell-transfer/index.cjs +1 -1
  177. package/components/TableCanvas/feature-cell-transfer/index.mjs +1 -1
  178. package/components/TableCanvas/feature-cell-transfer/types.d.ts +1 -1
  179. package/components/TableCanvas/feature-cell-transfer/utils/applyBlockEdit.d.ts +12 -0
  180. package/components/TableCanvas/feature-cell-transfer/utils/applyValuesToRows.d.ts +2 -1
  181. package/components/TableCanvas/feature-cell-transfer/utils/collectMatrixFromTargets.d.ts +1 -0
  182. package/components/TableCanvas/feature-cell-transfer/utils/collectTextMatrix.d.ts +1 -0
  183. package/components/TableCanvas/feature-cell-transfer/utils/resolveBlockOrigin.d.ts +13 -0
  184. package/components/TableCanvas/feature-cell-transfer/utils/snapDestToRowBlocks.d.ts +4 -0
  185. package/components/TableCanvas/feature-collapse-table/CollapseTableButton.d.ts +3 -2
  186. package/components/TableCanvas/feature-collapse-table/index.cjs +1 -1
  187. package/components/TableCanvas/feature-collapse-table/index.mjs +1 -1
  188. package/components/TableCanvas/feature-column-control/ColumnsList/index.cjs +1 -1
  189. package/components/TableCanvas/feature-column-control/ColumnsList/index.mjs +1 -1
  190. package/components/TableCanvas/feature-column-control/index.cjs +1 -1
  191. package/components/TableCanvas/feature-column-control/index.mjs +1 -1
  192. package/components/TableCanvas/feature-column-control/styled.d.ts +1 -0
  193. package/components/TableCanvas/feature-column-control/types.d.ts +3 -0
  194. package/components/TableCanvas/feature-columns-grouping/index.cjs +1 -1
  195. package/components/TableCanvas/feature-columns-grouping/index.mjs +1 -1
  196. package/components/TableCanvas/feature-columns-grouping/useLastLvlColumnConfig.d.ts +5 -1
  197. package/components/TableCanvas/feature-content-state/index.cjs +1 -1
  198. package/components/TableCanvas/feature-content-state/index.mjs +1 -1
  199. package/components/TableCanvas/feature-context-menu/index.cjs +1 -1
  200. package/components/TableCanvas/feature-context-menu/index.mjs +1 -1
  201. package/components/TableCanvas/feature-edit/index.cjs +1 -1
  202. package/components/TableCanvas/feature-edit/index.mjs +1 -1
  203. package/components/TableCanvas/feature-filtering/combobox/index.cjs +1 -1
  204. package/components/TableCanvas/feature-filtering/combobox/index.mjs +1 -1
  205. package/components/TableCanvas/feature-filtering/filter-list-block/index.cjs +1 -1
  206. package/components/TableCanvas/feature-filtering/filter-list-block/index.mjs +1 -1
  207. package/components/TableCanvas/feature-filtering/header-filter-button/index.cjs +1 -1
  208. package/components/TableCanvas/feature-filtering/header-filter-button/index.mjs +1 -1
  209. package/components/TableCanvas/feature-filtering/header-filter-button/styles.d.ts +1 -0
  210. package/components/TableCanvas/feature-filtering/index.cjs +1 -1
  211. package/components/TableCanvas/feature-filtering/index.mjs +1 -1
  212. package/components/TableCanvas/feature-filtering/sidebar-filter-block/index.cjs +1 -1
  213. package/components/TableCanvas/feature-filtering/sidebar-filter-block/index.mjs +1 -1
  214. package/components/TableCanvas/feature-infinity-scroll/index.cjs +1 -1
  215. package/components/TableCanvas/feature-infinity-scroll/index.mjs +1 -1
  216. package/components/TableCanvas/feature-key-text/index.cjs +1 -1
  217. package/components/TableCanvas/feature-key-text/index.mjs +1 -1
  218. package/components/TableCanvas/feature-notifications/index.cjs +1 -1
  219. package/components/TableCanvas/feature-notifications/index.mjs +1 -1
  220. package/components/TableCanvas/feature-pagination/index.cjs +1 -1
  221. package/components/TableCanvas/feature-pagination/index.mjs +1 -1
  222. package/components/TableCanvas/feature-popover-table/context/index.cjs +1 -1
  223. package/components/TableCanvas/feature-popover-table/context/index.mjs +1 -1
  224. package/components/TableCanvas/feature-popover-table/hooks/index.cjs +1 -1
  225. package/components/TableCanvas/feature-popover-table/hooks/index.mjs +1 -1
  226. package/components/TableCanvas/feature-popover-table/index.cjs +1 -1
  227. package/components/TableCanvas/feature-popover-table/index.mjs +1 -1
  228. package/components/TableCanvas/feature-popover-table/utils/index.cjs +1 -1
  229. package/components/TableCanvas/feature-popover-table/utils/index.mjs +1 -1
  230. package/components/TableCanvas/feature-right-sidebar/index.cjs +1 -1
  231. package/components/TableCanvas/feature-right-sidebar/index.mjs +1 -1
  232. package/components/TableCanvas/feature-row-detail/handlers.d.ts +1 -0
  233. package/components/TableCanvas/feature-row-detail/index.cjs +1 -1
  234. package/components/TableCanvas/feature-row-detail/index.mjs +1 -1
  235. package/components/TableCanvas/feature-row-instruments/index.cjs +1 -1
  236. package/components/TableCanvas/feature-row-instruments/index.mjs +1 -1
  237. package/components/TableCanvas/feature-row-markers/index.cjs +1 -1
  238. package/components/TableCanvas/feature-row-markers/index.mjs +1 -1
  239. package/components/TableCanvas/feature-row-size/index.cjs +1 -1
  240. package/components/TableCanvas/feature-row-size/index.mjs +1 -1
  241. package/components/TableCanvas/feature-rows-grouping/getColsAfterRowsGrouping.d.ts +2 -1
  242. package/components/TableCanvas/feature-rows-grouping/index.cjs +1 -1
  243. package/components/TableCanvas/feature-rows-grouping/index.mjs +1 -1
  244. package/components/TableCanvas/feature-rows-grouping/mergedView.d.ts +14 -0
  245. package/components/TableCanvas/feature-rows-grouping/types.d.ts +4 -0
  246. package/components/TableCanvas/feature-searching/index.cjs +1 -1
  247. package/components/TableCanvas/feature-searching/index.mjs +1 -1
  248. package/components/TableCanvas/feature-searching/styled.d.ts +1 -0
  249. package/components/TableCanvas/feature-select-row/index.cjs +1 -1
  250. package/components/TableCanvas/feature-select-row/index.mjs +1 -1
  251. package/components/TableCanvas/feature-sorting/index.cjs +1 -1
  252. package/components/TableCanvas/feature-sorting/index.mjs +1 -1
  253. package/components/TableCanvas/feature-sorting/styles.d.ts +1 -0
  254. package/components/TableCanvas/feature-table-settings/index.cjs +1 -1
  255. package/components/TableCanvas/feature-table-settings/index.mjs +1 -1
  256. package/components/TableCanvas/feature-tooltip/index.cjs +1 -1
  257. package/components/TableCanvas/feature-tooltip/index.mjs +1 -1
  258. package/components/TableCanvas/feature-tooltip/utils/index.cjs +1 -1
  259. package/components/TableCanvas/feature-tooltip/utils/index.mjs +1 -1
  260. package/components/TableCanvas/feature-tree/index.cjs +1 -1
  261. package/components/TableCanvas/feature-tree/index.mjs +1 -1
  262. package/components/TableCanvas/feature-tree/mergedSubRows.d.ts +5 -0
  263. package/components/TableCanvas/feature-tree/types.d.ts +2 -0
  264. package/components/TableCanvas/index.cjs +1 -1
  265. package/components/TableCanvas/index.mjs +4 -4
  266. package/components/TableCanvas/renders/formatCell/index.cjs +1 -1
  267. package/components/TableCanvas/renders/formatCell/index.mjs +1 -1
  268. package/components/TableCanvas/renders/rowIconConfig.d.ts +0 -5
  269. package/components/TableCanvas/renders/withSelectIcon.d.ts +3 -1
  270. package/components/TableCanvas/styles/index.cjs +1 -1
  271. package/components/TableCanvas/styles/index.mjs +1 -1
  272. package/components/TableCanvas/table-hooks/createMergeByValueRowSpan.d.ts +7 -0
  273. package/components/TableCanvas/table-hooks/createMergedRegionsResolver.d.ts +21 -0
  274. package/components/TableCanvas/table-hooks/index.cjs +1 -1
  275. package/components/TableCanvas/table-hooks/index.mjs +1 -1
  276. package/components/TableCanvas/table-hooks/resolveMergedView.d.ts +7 -0
  277. package/components/TableCanvas/table-hooks/usePrepareTableConfig.d.ts +4 -1
  278. package/components/TableCanvas/types/column-config-internal.type.d.ts +4 -1
  279. package/components/TableCanvas/types/column-config.type.d.ts +2 -0
  280. package/components/TableCanvas/types/ctxs.type.d.ts +2 -0
  281. package/components/TableCanvas/types/glide-type.d.ts +1 -1
  282. package/components/TableCanvas/types/index.cjs +1 -1
  283. package/components/TableCanvas/types/index.d.ts +1 -0
  284. package/components/TableCanvas/types/index.mjs +1 -1
  285. package/components/TableCanvas/types/merged-cells.type.d.ts +4 -0
  286. package/components/TableCanvas/types/table-config.type.d.ts +15 -0
  287. package/components/TableCanvas/utils/index.cjs +1 -1
  288. package/components/TableCanvas/utils/index.mjs +1 -1
  289. package/components/TableCanvas/widgets/control-block/compression/index.cjs +1 -1
  290. package/components/TableCanvas/widgets/control-block/compression/index.mjs +1 -1
  291. package/components/TableCanvas/widgets/control-block/control-block-button.d.ts +3 -2
  292. package/components/TableCanvas/widgets/control-block/index.cjs +1 -1
  293. package/components/TableCanvas/widgets/control-block/index.mjs +1 -1
  294. package/components/TableCanvas/widgets/control-block/right-side/index.cjs +1 -1
  295. package/components/TableCanvas/widgets/control-block/right-side/index.mjs +1 -1
  296. package/components/TableCanvas/widgets/index.cjs +1 -1
  297. package/components/TableCanvas/widgets/index.mjs +1 -1
  298. package/components/TableCanvas/widgets/mass-actions/hooks/index.cjs +1 -1
  299. package/components/TableCanvas/widgets/mass-actions/hooks/index.mjs +1 -1
  300. package/components/TableCanvas/widgets/mass-actions/index.cjs +1 -1
  301. package/components/TableCanvas/widgets/mass-actions/index.mjs +1 -1
  302. package/components/TableCanvas/widgets/mass-actions/styled.d.ts +10 -4
  303. package/components/TableContract/index.cjs +1 -1
  304. package/components/TableContract/index.mjs +1 -1
  305. package/components/TableGlide/TableGlide.d.ts +1 -1
  306. package/components/TableGlide/hooks/selection/index.cjs +1 -1
  307. package/components/TableGlide/hooks/selection/index.mjs +1 -1
  308. package/components/TableGlide/hooks/useErrorCellRanges.d.ts +14 -0
  309. package/components/TableGlide/index.cjs +1 -1
  310. package/components/TableGlide/index.mjs +13 -13
  311. package/components/TableGlide/lib/canvas/cells/buttons/index.cjs +1 -1
  312. package/components/TableGlide/lib/canvas/cells/buttons/index.mjs +1 -1
  313. package/components/TableGlide/lib/canvas/cells/iconSprites/index.cjs +1 -1
  314. package/components/TableGlide/lib/canvas/cells/iconSprites/index.mjs +1 -1
  315. package/components/TableGlide/lib/canvas/cells/index.cjs +1 -1
  316. package/components/TableGlide/lib/canvas/cells/index.mjs +1 -1
  317. package/components/TableGlide/lib/canvas/cells/renderer/index.cjs +1 -1
  318. package/components/TableGlide/lib/canvas/cells/renderer/index.mjs +1 -1
  319. package/components/TableGlide/lib/canvas/core/helpers/index.cjs +1 -1
  320. package/components/TableGlide/lib/canvas/core/helpers/index.mjs +1 -1
  321. package/components/TableGlide/lib/canvas/core/index.cjs +1 -1
  322. package/components/TableGlide/lib/canvas/core/index.mjs +1 -1
  323. package/components/TableGlide/lib/canvas/hooks/index.cjs +1 -1
  324. package/components/TableGlide/lib/canvas/hooks/index.mjs +1 -1
  325. package/components/TableGlide/lib/canvas/index.cjs +1 -1
  326. package/components/TableGlide/lib/canvas/index.mjs +22 -22
  327. package/components/TableGlide/lib/canvas/miniflex/index.cjs +1 -1
  328. package/components/TableGlide/lib/canvas/miniflex/index.mjs +1 -1
  329. package/components/TableGlide/lib/canvas/primitives/index.cjs +1 -1
  330. package/components/TableGlide/lib/canvas/primitives/index.mjs +1 -1
  331. package/components/TableGlide/lib/canvas/utils/index.cjs +1 -1
  332. package/components/TableGlide/lib/canvas/utils/index.mjs +2 -2
  333. package/components/TableGlide/theming/index.cjs +1 -1
  334. package/components/TableGlide/theming/index.mjs +1 -1
  335. package/components/TableGlide/types.d.ts +10 -0
  336. package/components/TableGlide/utils/findBlockOrigin.d.ts +5 -0
  337. package/components/TableGlide/utils/getRowSpan.d.ts +6 -0
  338. package/components/Tooltip/index.cjs +1 -1
  339. package/components/Tooltip/index.mjs +1 -1
  340. package/components/TourWidget/index.cjs +1 -1
  341. package/components/TourWidget/index.mjs +1 -1
  342. package/components/Typography/index.cjs +1 -1
  343. package/components/Typography/index.mjs +1 -1
  344. package/components/Widget/Widget.d.ts +1 -0
  345. package/components/Widget/components/WidgetIconButtonDots.d.ts +1 -0
  346. package/components/Widget/index.cjs +1 -1
  347. package/components/Widget/index.mjs +1 -1
  348. package/formComponents/FormCombobox/index.cjs +1 -1
  349. package/formComponents/FormCombobox/index.mjs +1 -1
  350. package/formComponents/FormDatePickers/FormDatePickerRange/ui/FormDatePickerRangeStyled.d.ts +2 -0
  351. package/formComponents/FormSwitch/index.cjs +1 -1
  352. package/formComponents/FormSwitch/index.mjs +1 -1
  353. package/formComponents/FormTextArea/ui/ButtonStyled.d.ts +1 -0
  354. package/formComponents/FormTextField/ui/IconButtonStyled.d.ts +1 -0
  355. package/index.cjs +1 -1
  356. package/index.mjs +11 -11
  357. package/layouts/FiltersActions/FiltersActions.d.ts +15 -6
  358. package/layouts/FiltersActions/components/FiltersButton.d.ts +4 -0
  359. package/layouts/FiltersActions/components/ResetAllFiltersButton.d.ts +6 -4
  360. package/layouts/FiltersActions/components/Tabs.d.ts +4 -2
  361. package/layouts/FiltersActions/hooks/index.cjs +1 -1
  362. package/layouts/FiltersActions/hooks/index.mjs +1 -1
  363. package/layouts/FiltersActions/index.cjs +1 -1
  364. package/layouts/FiltersActions/index.mjs +1 -1
  365. package/mcp-data/component-index.json +250 -80
  366. package/package.json +7 -6
  367. package/shared/ui/Search/styled.d.ts +1 -0
  368. package/chunks/AnalyticalWidget-z2HzQ4aA.cjs +0 -43
  369. package/chunks/TableCanvas-uzBMXlx6.cjs +0 -30
  370. package/chunks/TableGlide-DTBZ1jNA.cjs +0 -1
@@ -1 +0,0 @@
1
- "use strict";const L=require("@glideappsfinal/glide-data-grid"),gi=require("@salutejs/sdds-themes/tokens/sdds_finai"),Vs=require("canvas-hypertxt"),p=require("react"),Ys=require("react-dom/server"),bt=require("react/jsx-runtime");require("@glideappsfinal/glide-data-grid/dist/index.css");const qt=require("./utils-CUW5bd8S.cjs"),_e=require("react-dom"),Ao=require("styled-components"),Z={small:{rowHeight:20,cellVerticalPadding:4,cellHorizontalPadding:4,textfieldSize:"xs"},medium:{rowHeight:32,cellVerticalPadding:7,cellHorizontalPadding:8,textfieldSize:"s"},big:{rowHeight:48,cellVerticalPadding:12,cellHorizontalPadding:16,textfieldSize:"s"}},Re=r=>Z[r].rowHeight,Ci=r=>Z[r].textfieldSize,Eo={small:Z.small.rowHeight,medium:Z.medium.rowHeight,big:Z.big.rowHeight},Ks={kind:L.GridCellKind.Text,data:"",displayData:"",allowOverlay:!0,readonly:!0},To={big:{cellVerticalPadding:Z.big.cellVerticalPadding,cellHorizontalPadding:Z.big.cellHorizontalPadding,textfieldSize:Z.big.textfieldSize},medium:{cellVerticalPadding:Z.medium.cellVerticalPadding,cellHorizontalPadding:Z.medium.cellHorizontalPadding,textfieldSize:Z.medium.textfieldSize},small:{cellVerticalPadding:Z.small.cellVerticalPadding,cellHorizontalPadding:Z.small.cellHorizontalPadding,textfieldSize:Z.small.textfieldSize}},vi={"padding-block":"0px","padding-inline":"0px"},$t=r=>`${r}px`,qs={small:{rowHeight:Re("small"),cell:{"padding-block":$t(Z.small.cellVerticalPadding),"padding-inline":$t(Z.small.cellHorizontalPadding)},editorCell:vi,input:Ci("small"),icon:"xs",combobox:"s",checkboxOfCombobox:"s",switch:"s",font:()=>gi.bodyXXS},medium:{rowHeight:Re("medium"),cell:{"padding-block":$t(Z.medium.cellVerticalPadding),"padding-inline":$t(Z.medium.cellHorizontalPadding)},editorCell:vi,input:Ci("medium"),icon:"s",combobox:"m",checkboxOfCombobox:"m",switch:"s",font:()=>gi.bodyS},big:{rowHeight:Re("big"),cell:{"padding-block":$t(Z.big.cellVerticalPadding),"padding-inline":$t(Z.big.cellHorizontalPadding)},editorCell:vi,input:Ci("big"),icon:"m",combobox:"l",checkboxOfCombobox:"l",switch:"l",font:()=>gi.bodyM}},Oe=33,Zs={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"}},js=16;function $r(r,t=js){const e=parseFloat(r);return Number.isFinite(e)?r.endsWith("rem")?e*t:e:0}const Js=(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}`},Qs=(r,t=!1)=>{const e=t?r["bold-font-size"]:r["font-size"],i=t?r["bold-line-height"]:r["line-height"];return{fontSize:$r(e),lineHeightPx:$r(i)}},Do=r=>Object.entries(Zs).reduce((t,[e,i])=>{const o=e;return t.push([o,r(i)],[`${o}Bold`,r(i,!0)]),t},[]),Ne=Object.fromEntries(Do(Js)),Io=Object.fromEntries(Do(Qs)),ta={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto",width:void 0,height:void 0,crossAxisSizing:"auto"},ea={top:0,right:0,bottom:0,left:0};class Ho{constructor(t=ta){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 Lo extends Ho{build(){}}class wt extends Ho{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=Po(i.padding)}addChild(t,e){if(t instanceof wt){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 Lo(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:a}=this.size;return t?{main:s-e-i,cross:a-o-n,mainGap:this.columnGap,crossGap:this.rowGap}:{main:a-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 a=s.style.flexBasis,c=o.length>0?e.mainGap:0;o.length>0&&n+c+a>e.main&&(i.push(o),o=[],n=0),o.push(s),n+=(o.length>1?e.mainGap:0)+a}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 a=e?s.style.height:s.style.width,c=a!==void 0?a:e?s.size.height:s.size.width;c>n&&(n=c)}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 a=0,c=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(a=u,c=d,this.alignContent==="stretch"&&s>0){const l=s/i;for(let h=0;h<i;h++)t[h]+=l}}return{crossStart:a,crossBetween:c}}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 a=t.length>1?e.mainGap*(t.length-1):0,c=e.main-o-a;let u=0;for(const d of t){const{style:l}=d;let h=l.flexBasis;c>0&&n>0?h+=c*l.flexGrow/n:c<0&&s>0&&(h+=c*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 a=t>1?i.mainGap*(t-1):0;let c=i.main-e-a;switch(c<0&&(c=0),this.justifyContent){case"flex-end":n=c;break;case"center":n=c/2;break;case"space-between":s=t>1?i.mainGap+c/(t-1):0;break;case"space-around":s=i.mainGap+c/t,n=s/2;break;case"space-evenly":s=i.mainGap+c/(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,a=s!==void 0?s:i?n.size.height:n.size.width;a>o&&(o=a)}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,a,c,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 v=l;v!==h;v+=f){const C=t[v];if(C!==void 0){const w=C.style,y=C.size,x=C.position;if(i){const P=this.direction==="row"?g:e.main-g-y.width;x.x=a+P}else{const P=this.direction==="column"?g:e.main-g-y.height;x.y=c+P}const b=w.alignSelf!=="auto"?w.alignSelf:this.alignItems,E=this.getCrossSize(C,o,i);let F=0;b==="flex-end"?F=o-E:b==="center"&&(F=(o-E)*.5),i?(x.y=c+u+F,g+=y.width+s):(x.x=a+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:a}=this.resolveCrossAxisLayout(n,i),c=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:v,between:C}=this.calculateJustifySpacing(h.length,f,i,g),w=this.getFinalLineHeight(h,n[l],e);this.positionChildren(h,i,e,w,v,C,c,u,d),d+=w+a}for(const l of t)l instanceof wt&&l.build()}}function Po(r){return r===void 0?ea: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 Yi extends wt{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 wt&&this._collectLayout(o,e,i)}}}const ne={direction:"row",columnGap:0,rowGap:0,justifyContent:"flex-start",alignItems:"stretch"};function Bo(r){const t=r;return{id:r.id,direction:t.direction??ne.direction,columnGap:t.columnGap??ne.columnGap,rowGap:t.rowGap??ne.rowGap,justifyContent:t.justifyContent??ne.justifyContent,alignItems:t.alignItems??ne.alignItems}}function _o(r,t){if(t!=null&&t.length)for(const e of t)if(e.children&&e.children.length>0){const i=new wt(e.width??0,e.height??0,Bo(e));r.addChild(i,e),_o(i,e.children)}else r.addChild(e)}const ia=r=>{const t=r.width??0,e=r.height??0,i=Bo(r),o=new Yi(t,e,i);return _o(o,r.children),o.getLayout()},Ye=class Ye{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),Ye.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 a of this.children)a.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}};Ye.DEBUG=!1;let _t=Ye;class Ro{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(c=>!c.isAbsolute()),n=o.length,s=e.direction,a=s==="row"||s==="row-reverse";for(let c=0;c<n;c+=1){const u=o[c],d=u.style,l=this.extractChildFlexProperties(u,d);this.handlePercentageDimensions(l,d.width,d.height,a,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 wt(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 De=.5;class ko{constructor(t){this.positionResolver=t}reconcile(t,e,i,o,n,s=!1){let a=!1;const{parent:c}=e,u=c!==null?c.rect:n;a=this.updateNodePosition(e,i,u??e.rect);const d=o??e.children.filter(h=>!h.isAbsolute()),l=d.length>0;if(l&&i instanceof wt){const h=this.reconcileChildLayouts(t,d,i,n);if(a=a||h,this.isContainer(e)&&!s){const f=this.updateContainerFromContent(e,i);a=a||f}}else if(!l){const h=this.remeasureAndUpdateLeaf(t,e,i);a=a||h}return this.positionNestedAbsoluteChildren(t,e),a}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 a=o.width!==s.width,c=o.height!==s.height;return o.width=s.width,o.height=s.height,a||c}reconcileChildLayouts(t,e,i,o){let n=!1;const s=i.children,a=e.length;for(let c=0;c<a;c+=1){const u=this.reconcile(t,e[c],s[c],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 a=0;if(i){for(let h=0;h<s;h+=1){const f=n[h],g=f.position.y+f.size.height;g>a&&(a=g)}const c=a>0?a+o.bottom:0,u=t.style.height;if(u==="100%")return!1;const d=typeof u=="number"?u:0,l=c>d?c:d;if(l>t.rect.height+De)return t.rect.height=l,this.syncFlexNodeSizeFromRect(t,e,!1,!0),!0}else{let c=0;for(let C=0;C<s;C+=1){const w=n[C],y=w.position.x+w.size.width,x=w.position.y+w.size.height;y>a&&(a=y),x>c&&(c=x)}const u=a>0?a+o.right:0,d=t.style.width;let l=!1,h=!1,f=!1;if(d!=="100%"){const C=typeof d=="number"?d:0,w=u>C?u:C;w>t.rect.width+De&&(t.rect.width=w,l=!0,h=!0)}const g=c>0?c+o.bottom:0,v=t.style.height;if(v!=="100%"){const C=typeof v=="number"?v:0,w=g>C?g:C;w>t.rect.height+De&&(t.rect.height=w,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)>De?(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(a=>a.isAbsolute());if(n.length===0)return;const s=this.getContainerCachedPadding(i);this.positionResolver.positionAbsoluteChildren(i.rect,s,n,a=>a.measure(t),a=>this.layoutAbsoluteChildSubtree(t,a))}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 St{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,a=s+(n?e.width:e.height),c=n?e.width:e.height;if(i!==void 0&&o!==void 0){const u=Math.max(0,c-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=a-t.width-o:t.y=a-t.height-o:o===void 0&&i===void 0&&(n?t.x=s:t.y=s)}applyAbsolutePositioning(t,e){const i=St.resolvePositionValue(t.left,e.width),o=St.resolvePositionValue(t.right,e.width),n=St.resolvePositionValue(t.top,e.height),s=St.resolvePositionValue(t.bottom,e.height),a=t.rect;St.applyAxisPositioning(a,e,i,o,!0),St.applyAxisPositioning(a,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 a of i)o(a),this.applyAbsolutePositioning(a,s),n==null||n(a)}}class Ke{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 Ke;for(const n of t)o.accumulate(n,e);return o.addGap(i,e),o.getSize()}}const ra=3,Mo={top:0,right:0,bottom:0,left:0},oa=r=>r===void 0||r==="row"||r==="row-reverse",zo=r=>r===void 0?Mo: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 gt extends _t{constructor(t,e={},i="transparent"){super(t),this.cachedPadding=Mo,this.cachedIsRow=!0,this.cachedGap=0,this.optionsCacheValid=!1,this.flexOptionsValue=e,this.positionResolver=new St,this.flexTreeBuilder=new Ro,this.layoutReconciler=new ko(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=oa(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}=Ke.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 gt))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 Yi(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<ra)}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 gt))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 gt&&(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 na={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},sa=(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)}),aa=r=>r.minX===1/0||r.maxX===-1/0;class ca extends gt{performLayout(t){const e=this.layoutChildren(t);if(!e){this.clearLayoutDirty();return}this.expandToFitBounds(e),this.clearLayoutDirty()}layoutChildren(t){let e={...na};return this.children.forEach(i=>{i instanceof gt?i.performLayout(t):i.measure(t),e=sa(e,i)}),aa(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 Ki{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 a=(n=s.style)==null?void 0:n.cursor;if(a)return a}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 a=(i=s.style)==null?void 0:i.cursor;if(a){e=a;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 a,c,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){(c=(a=this.options).onPortalTargetChange)==null||c.call(a,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 _t{addChild(){throw new Error("CanvasLeaf cannot have children")}}const ce={selection:"normal",cellClick:"normal",editor:"normal",contextMenu:"normal"};function la(r){return r.selection!==void 0||r.cellClick!==void 0||r.editor!==void 0||r.contextMenu!==void 0}function Oo(r){if(!r||!la(r))return;const t={selection:r.selection??ce.selection,cellClick:r.cellClick??ce.cellClick,editor:r.editor??ce.editor,contextMenu:r.contextMenu??ce.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 No(){return{...ce}}class Wo{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 ua(r,t){return r.zIndex!==t.zIndex?r.zIndex-t.zIndex:r.order-t.order}const Ur=typeof Path2D<"u"&&typeof CanvasRenderingContext2D.prototype.roundRect=="function";class qe{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",a){return this.commands.push({type:"fillText",text:t,x:e,y:i,font:o,fillStyle:n,textBaseline:s,textAlign:a,zIndex:this.currentZIndex,order:this.orderCounter++}),this}fillTextClipped(t,e,i,o,n,s,a="middle",c){return this.commands.push({type:"fillTextClipped",text:t,x:e,y:i,font:o,fillStyle:n,textBaseline:a,textAlign:c,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,a=90){return this.commands.push({type:"linearGradientRect",x:t,y:e,width:i,height:o,radius:n,gradientStops:s,angle:a,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(ua);let o="",n="",s=-1,a="",c="",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":a!==l.font&&(t.font=l.font,a=l.font),o!==l.fillStyle&&(t.fillStyle=l.fillStyle,o=l.fillStyle),c!==l.textBaseline&&(t.textBaseline=l.textBaseline,c=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":a!==l.font&&(t.font=l.font,a=l.font),o!==l.fillStyle&&(t.fillStyle=l.fillStyle,o=l.fillStyle),c!==l.textBaseline&&(t.textBaseline=l.textBaseline,c=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,a="",c="",u="";break}}this.clear()}executeLinearGradientRect(t,e){const{x:i,y:o,width:n,height:s,radius:a,gradientStops:c,angle:u}=e,d=(u-90)*Math.PI/180,l=Math.cos(d),h=Math.sin(d),f=n/2,g=s/2,v=i+f,C=o+g,y=(Math.abs(l*n)+Math.abs(h*s))/2,x=v-l*y,b=C-h*y,E=v+l*y,F=C+h*y,P=t.createLinearGradient(x,b,E,F);for(const T of c)P.addColorStop(T.offset,T.color);if(t.fillStyle=P,a>0)if(Ur)t.beginPath(),t.roundRect(i,o,n,s,a),t.fill();else{const T=a,B=i+n,O=o+s;t.beginPath(),t.moveTo(i+T,o),t.lineTo(B-T,o),t.quadraticCurveTo(B,o,B,o+T),t.lineTo(B,O-T),t.quadraticCurveTo(B,O,B-T,O),t.lineTo(i+T,O),t.quadraticCurveTo(i,O,i,O-T),t.lineTo(i,o+T),t.quadraticCurveTo(i,o,i+T,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:a,fillStyle:c,strokeStyle:u,lineWidth:d}=e;if(Ur)t.beginPath(),t.roundRect(i,o,n,s,a);else{const l=a,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()}c&&(t.fillStyle=c,t.fill()),u&&(t.strokeStyle=u,d!==void 0&&(t.lineWidth=d),t.stroke())}}const ha=new qe;class da{constructor(t,e){this.eventHandlers=new Map,this.batcher=new qe,this.canvas=t,this.ctx=t.getContext("2d",{alpha:!1}),this.rootNode=e,this.hoverController=new Ki({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 a=!1;const c={type:e,x:i,y:o,originalEvent:t,target:s,stopPropagation:()=>{a=!0},preventDefault:()=>t.preventDefault()};this.bubbleEvent(n,c,e,()=>a),e==="mousemove"&&(this.dispatchMouseMove(n,c,()=>a),this.hoverController.handlePointerMove(n,c))}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 gt?this.rootNode.performLayout(this.ctx):this.rootNode.measure(this.ctx)}}const it={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 Go(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 Xr={bgColor:"#060A0C",bgColorHover:"#13181B",borderColor:"transparent",textColor:"#FFFFFF",textColorHover:"#F2F5F893",iconColor:"#FFFFFF",iconColorHover:"#F2F5F893"},Ze={default:Xr,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:Xr,white:{bgColor:"#FFFFFF",bgColorHover:"#FFFFFF",borderColor:"transparent",textColor:"#060A0C",textColorHover:"#13181B93",iconColor:"#060A0C",iconColorHover:"#13181B93"}},Qt=4,te=4,$o=16,qi=20,Zi=4,At=1,ji=6,fa=4,je="s",Je="default",Ji="#d32f2f",ge="#ffffff",Uo="rgba(30, 136, 229, 0.08)",Ai="#ffffff",Xo="#E8EEF2",Vo="#D5DFE6",Ei="#8A959D",Qi="|",Yo="#",Ko=35,tr=15,Ti=new Map,Di=new Map;function er(r,t){if(r.charCodeAt(0)===Ko){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`${Yo}${(i<<16|o<<8|n).toString(16).padStart(6,"0")}`}return r}function Vr(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(a=>a+a).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 qo(r,t){const e=`${r}${Qi}${t}`;let i=Ti.get(e);return i===void 0&&(i=er(r,t),Ti.set(e,i)),i}function ir(r,t,e){const i=`${e}${Qi}${t}`;let o=Di.get(i);return o===void 0&&(r.font=e,o=r.measureText(t).width,Di.set(i,o)),o}function rr(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 or(r,t,e,i,o){let n=r;return i&&(n+=t+e),o&&(n+=t+e),n}function ga(){Ti.clear(),Di.clear()}const Ca=er(Ji,tr);function nr(r,t,e,i){if(e)return{bgColor:r.bgCell,borderColor:r.borderColor,textColor:r.textLight,iconColor:r.textLight};switch(t){case"primary":return Ii(r,i);case"secondary":return Zo(r,i);case"danger":return jo(i);default:return Ii(r,i)}}function va(r,t,e,i,o){const{accentColor:n}=r,s=r.accentFg||ge,a=r.accentFg||ge,c=.4;if(t||e){const h=o?Vr(n,c):n;return{bgColor:h,borderColor:h,textColor:s,iconColor:a}}const u="#485056B0",d="white",l=o?Vr(u,c):u;return{bgColor:d,borderColor:l,textColor:s,iconColor:a}}function Ii(r,t){const{accentColor:e}=r,i=t?qo(e,tr):e;return{bgColor:i,borderColor:i,textColor:r.accentFg||ge,iconColor:r.accentFg||ge}}function Zo(r,t){return{bgColor:t?r.accentLight||Uo:r.bgCell,borderColor:r.accentColor,textColor:r.accentColor,iconColor:r.accentColor}}function jo(r){const t=r?Ca:Ji;return{bgColor:t,borderColor:t,textColor:Ai,iconColor:Ai}}function sr(r,t,e){return t?{bgColor:Xo,borderColor:Vo,textColor:Ei,iconColor:Ei}:{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 Yt=-1,Yr=0,ct={colIndex:Yt,rowIndex:Yt},J={x:Yr,y:Yr},pa=2;function ke(r){const{location:t}=r;if(Array.isArray(t)&&t.length>=pa)return ct.colIndex=t[0]??Yt,ct.rowIndex=t[1]??Yt,ct;const{col:e}=r,{row:i}=r;if(typeof e=="number"&&typeof i=="number")return ct.colIndex=e,ct.rowIndex=i,ct;const{colIndex:o}=r,{rowIndex:n}=r;return typeof o=="number"&&typeof n=="number"?(ct.colIndex=o,ct.rowIndex=n,ct):(ct.colIndex=Yt,ct.rowIndex=Yt,ct)}const Ie="-",Kr=0;function Zt(r,t){const{colIndex:e,rowIndex:i}=r;return e>=Kr&&i>=Kr?`${e}${Ie}${i}`:`${t.x}${Ie}${t.y}${Ie}${t.width}${Ie}${t.height}`}function Hi(r){const{posX:t}=r,{posY:e}=r;if(typeof t=="number"&&typeof e=="number"&&t===t&&e===e)return J.x=t,J.y=e,J;const{x:i}=r,{y:o}=r;if(typeof i=="number"&&typeof o=="number"&&i===i&&o===o)return J.x=i,J.y=o,J;const{location:n}=r;if(Array.isArray(n)&&n.length>=2){const s=n[0],a=n[1];if(typeof s=="number"&&typeof a=="number")return J.x=s,J.y=a,J}return null}function Li(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?(J.x=e-o,J.y=i-n,J):r}function Jo(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 J.x=r,J.y=t,J;if(r>=n-1&&r<=n+i+1&&t>=s-1&&t<=s+o+1)return J.x=r-n,J.y=t-s,J}function ar(r,t,e){const i=e.x,o=e.y;return r>=i&&r<=i+e.width&&t>=o&&t<=o+e.height}function Rt(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,a=t.y-n;return e>=s&&e<=s+t.width&&i>=a&&i<=a+t.height}}return!!r}function Me(){return typeof window<"u"?Math.ceil(window.devicePixelRatio):1}function Qo(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 Pi(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 tn{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 a=this.getSprite(e,n,s);if(a){const c=n*Me();t.drawImage(a,0,0,c,c,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*Me();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,Pi(o,e)),{key:s,url:this.svgDataUrlCache.get(s)}}const n=t.trimStart();if(n.startsWith("<svg")){const s=`s:${Qo(n)}:${i}`;return this.svgDataUrlCache.has(s)||this.svgDataUrlCache.set(s,Pi(n,e)),{key:s,url:this.svgDataUrlCache.get(s)}}return{key:`u:${t}:${i}`,url:t}}loadSprite(t,e,i,o){var a;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*Me();(a=n.decode)==null||a.call(n).then(()=>{const c=document.createElement("canvas");c.width=s,c.height=s;const u=c.getContext("2d");u&&(u.drawImage(n,0,0,s,s),this.spriteCache.set(t,c),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 Et=new tn;function en(r){return Et.onLoad(r)}function ma(r,t={}){Et.register(r,t)}function rn(r,t,e){return Et.getSprite(r,t,e)}function on(r,t){Et.preload(r,t)}function nn(r,t,e,i,o,n){Et.draw(r,t,e,i,o,n)}function sn(r,t){return Et.getImageDirect(r)}function ya(){return Et.getStats()}function Fa(){Et.clearSpriteCache()}const ba=nn;function ut(r,t,e,i,o,n){if(!t||o<=0)return;const s=rn(t,o,n);if(s){r.drawImage(s,e,i,o,o);return}const a=sn(t);a&&r.drawImage(a,e,i,o,o)}function an(r,t,e,i,o,n,s,a="primary",c=!1,u=!1,d,l,h,f=ji){const g=Qt,v=o-g*2,C=Math.min(v-te,$o),w=s.baseFontFull,y=h?ir(h,n,w):0,x=rr(i,y,C,f,d,l),b=e+g,E=Rt(u,{x:t,y:e,width:x,height:o}),F=nr(s,a,c,E),P=t+x*.5,T=b+v*.5;r.roundedRect(t,b,x,v,Zi,{fillStyle:F.bgColor,strokeStyle:F.borderColor,lineWidth:At});const B=or(y,C,f,d,l);let O=P-B*.5;if(d){const ot=T-C*.5;ut(r,d,O,ot,C,F.textColor),O+=C+f}if(r.fillText(n,O,T,w,F.textColor,"middle","left"),l){const ot=O+y+f,G=T-C*.5;ut(r,l,ot,G,C,F.textColor)}return{x:t,y:b,width:x,height:v,actualWidth:x}}function cn(r,t,e,i,o,n=Je,s=je,a=!1,c=!1,u,d,l,h=ji,f){const g=it[s],v=f?f[n]:Ze[n],C=`${g.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,w=l?ir(l,o,C):0,y=rr(i,w,g.iconSize,h,u,d),x=Rt(c,{x:t,y:e,width:y,height:g.height}),b=sr(v,a,x),E=t+y*.5,F=e+g.height*.5;b.bgColor!=="transparent"?r.roundedRect(t,e,y,g.height,g.borderRadius,{fillStyle:b.bgColor,strokeStyle:b.borderColor!=="transparent"?b.borderColor:void 0,lineWidth:b.borderColor!=="transparent"?At:0}):b.borderColor!=="transparent"&&r.roundedRect(t,e,y,g.height,g.borderRadius,{fillStyle:b.bgColor,strokeStyle:b.borderColor,lineWidth:At});const P=or(w,g.iconSize,h,u,d);let T=E-P*.5;if(u){const B=F-g.iconSize*.5;ut(r,u,T,B,g.iconSize,b.textColor),T+=g.iconSize+h}if(r.fillText(o,T,F,C,b.textColor,"middle","left"),d){const B=T+w+h,O=F-g.iconSize*.5;ut(r,d,B,O,g.iconSize,b.textColor)}return{x:t,y:e,width:y,height:g.height,actualWidth:y}}const Sa={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"},xa=(r,t)=>r.length!==6?r:r.slice(0,4)+Sa[t],Ut="transparent",wa=Object.fromEntries(Object.entries(Ze).map(([r,t])=>r==="secondary"?[r,{bgColor:Ut,borderColor:Ut,textColor:"#485056B0",bgColorHover:Ut,iconColor:"#485056B0",iconColorHovered:"#485056FF"}]:[r,{bgColor:Ut,borderColor:Ut,textColor:t.bgColor,bgColorHover:Ut,iconColor:t.bgColor,iconColorHovered:t.bgColorHover}]));function ln(r,t,e,i,o=Je,n=je,s=!1,a=!1,c){const u=it[n],d=wa[o],l=(c==null?void 0:c.overrideSquareSize)??u.height,h=(c==null?void 0:c.overrideIconSize)??u.iconSize,f=Rt(a,{x:t,y:e,width:l,height:l}),g=d,v=t+l*.5,C=e+l*.5,w=v-h*.5,y=C-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"?At:0}):g.borderColor!=="transparent"&&r.roundedRect(t,e,l,l,u.borderRadius,{fillStyle:g.bgColor,strokeStyle:g.borderColor,lineWidth:At});const x=(c==null?void 0:c.iconColor)??g.iconColor,b=(c==null?void 0:c.iconColorHovered)??(c==null?void 0:c.iconColor)??g.iconColorHovered,E=s?xa(x,40):f?b:x;return ut(r,i,w,y,h,E),{x:t,y:e,width:l,height:l}}function cr(r,t,e,i,o,n,s,a="primary",c=!1,u=!1){const d=Qt,l=o-d*2,h=Math.min(l-te,qi),f=i==="auto"?h:i,g=e+d,v=Rt(u,{x:t,y:e,width:f,height:o}),C=nr(s,a,c,v),w=t+f*.5,y=g+l*.5,x=w-h*.5,b=y-h*.5;return r.roundedRect(t,g,f,l,Zi,{fillStyle:C.bgColor,strokeStyle:C.borderColor,lineWidth:At}),ut(r,n,x,b,h,C.iconColor),{x:t,y:g,width:f,height:l}}function un(r,t,e,i,o=Je,n=je,s=!1,a=!1){const c=it[n],u=Ze[o],d=c.height,l=Rt(a,{x:t,y:e,width:d,height:d}),h=sr(u,s,l),f=t+d*.5,g=e+d*.5,v=f-c.iconSize*.5,C=g-c.iconSize*.5;return h.bgColor!=="transparent"?r.roundedRect(t,e,d,d,c.borderRadius,{fillStyle:h.bgColor,strokeStyle:h.borderColor!=="transparent"?h.borderColor:void 0,lineWidth:h.borderColor!=="transparent"?At:0}):h.borderColor!=="transparent"&&r.roundedRect(t,e,d,d,c.borderRadius,{fillStyle:h.bgColor,strokeStyle:h.borderColor,lineWidth:At}),ut(r,i,v,C,c.iconSize,h.iconColor),{x:t,y:e,width:d,height:d}}const qr={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 Aa(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 Ea="|",He=6,Zr=new Map,jr={xs:10,s:12,m:14,l:16};class hn 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=Aa(i.theme.tokens)))}measure(t){const e=qr[this.size],i=jr[this.size],o=`${e.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,n=Jr(t,o,this.text);let s=0;this.leftIcon&&(s+=i+He),this.rightIcon&&(s+=i+He),this.rect.width=n+s+e.paddingX*2,this.rect.height=e.height}onPaint(t,e){const{x:i,y:o,width:n,height:s}=this.rect,a=qr[this.size],c=jr[this.size],u=this.viewColors[this.view];if(!u)return;const d=`${a.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 v=this.pilled?s/2:a.borderRadius;t.roundedRect(i,o,n,s,v,{fillStyle:l})}const f=o+s/2;let g=i+a.paddingX;if(this.leftIcon){const v=f-c/2;ut(t,this.leftIcon,g,v,c,h),g+=c+He}if(t.fillText(this.text,g,f,d,h,"middle"),this.rightIcon){const v=Jr(e,d,this.text),C=g+v+He,w=f-c/2;ut(t,this.rightIcon,C,w,c,h)}}}function Jr(r,t,e){const i=`${t}${Ea}${e}`;let o=Zr.get(i);return o===void 0&&(r.font=t,o=r.measureText(e).width,Zr.set(i,o)),o}const Ta="default",Da="s",pi="pointer",Le=8,Ia={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"},Qr=new Map;class dn extends Ft{constructor(t,e,i){var o;super(t),this.variant="primary",this.view=Ta,this.size=Da,this.disabled=!1,this.isHovered=!1,this.useNewApi=!1,this.text=e,super.style={...super.style,cursor:pi},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=Go(i.theme.tokens)))}set style(t){super.style={...super.style,cursor:pi,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=pi),t}measure(t){const e=it[this.size],i=`${e.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,o=Ha(t,this.text,i);let n=0;this.leftIcon&&(n+=e.iconSize+Le),this.rightIcon&&(n+=e.iconSize+Le),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)cn(t,i,o,n,this.text,this.view,this.size,this.disabled,this.isHovered,this.leftIcon,this.rightIcon,e,Le,this.viewColors);else{const s=it[this.size];an(t,i,o,n,s.height,this.text,Ia,this.variant,this.disabled,this.isHovered,this.leftIcon,this.rightIcon,e,Le)}}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}}function Ha(r,t,e){const i=`${e}|${t}`;let o=Qr.get(i);return o===void 0&&(r.font=e,o=r.measureText(t).width,Qr.set(i,o)),o}const to=16,eo="black",io=0,La=Math.PI/2,Pa=1.8,Xt={startX:-3.5,startY:-4.25,middleX:2.75,middleY:0,endX:-3.5,endY:4.25};class Ba extends Ft{constructor(t,e={}){super(t),this.rotation=io,this.color=eo,this.rotation=e.rotation??io,this.color=e.color??eo,this.rect.width=to,this.rect.height=to}measure(t){}onPaint(t,e){const{x:i,y:o,width:n,height:s}=this.rect,a=i+n/2,c=o+s/2,u=this.rotation*La;t.custom(d=>{d.save(),d.translate(a,c),d.rotate(u),d.strokeStyle=this.color,d.lineWidth=Pa,d.lineCap="round",d.lineJoin="round",d.beginPath(),d.moveTo(Xt.startX,Xt.startY),d.lineTo(Xt.middleX,Xt.middleY),d.lineTo(Xt.endX,Xt.endY),d.stroke(),d.restore()})}}const _a=28,Ra="default",ka="s",Ma="pointer",za=20,Oa={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e"};class Bi extends Ft{constructor(t,e,i){super(t),this.view=Ra,this.buttonSize=ka,this.isHovered=!1,this.useNewApi=!1,this.getDisabled=()=>this.disabled?"default":Ma,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.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=it[this.buttonSize],i=this.overrideSquareSize??e.height;this.rect.height=i,this.rect.width=i}else{const e=ro(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 a=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(ln(t,i,o,this.icon,this.view,this.buttonSize,this.disabled,this.isHovered,a),_t.DEBUG){const c=it[this.buttonSize],u=this.overrideSquareSize??c.height,d=this.overrideIconSize??c.iconSize,l=i+(u-d)*.5,h=o+(u-d)*.5;t.strokeRect(l,h,d,d,"cyan",1)}}else cr(t,i,o,n,s,this.icon,Oa,this.variant,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}containsHitPoint(t,e){if(this.useNewApi){const n=it[this.buttonSize],s=this.overrideSquareSize??n.height,a={x:this.rect.x,y:this.rect.y,width:s,height:s};return oo(t,e,a)}const i=ro(this.size,this.rect.height),o=Na(this.rect.x,this.rect.y,i);return oo(t,e,o)}}function ro(r,t){const e=typeof r=="number"?r:t??_a,i=0,o=Qt,n=Math.min(e-o*2-te,za),s=typeof r=="number"?r:n+i*2;return{height:e,width:s,paddingX:i,paddingY:o,iconSize:n}}function Na(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 oo(r,t,e){return r>=e.x&&r<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}const Wa=16,Ga="transparent";class fn extends Ft{constructor(t,e,i){super(t),this.icon=e,this.size=(i==null?void 0:i.size)??Wa,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!==Ga&&t.fillRect(i,o,n,s,this.backgroundColor),ut(t,this.icon,i,o,this.size,this.color)}}const $a=28,Ua="default",Xa="s",mi="pointer",Va=20,Ya={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e"};class gn extends Ft{constructor(t,e,i){super(t),this.view=Ua,this.buttonSize=Xa,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:mi},(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:mi,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=mi),t}measure(t){if(this.useNewApi){const e=it[this.buttonSize];this.rect.height=e.height,this.rect.width=e.height}else{const e=no(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?un(t,i,o,this.icon,this.view,this.buttonSize,this.disabled,this.isHovered):cr(t,i,o,n,s,this.icon,Ya,this.variant,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}containsHitPoint(t,e){if(this.useNewApi){const n=it[this.buttonSize],s={x:this.rect.x,y:this.rect.y,width:n.height,height:n.height};return so(t,e,s)}const i=no(this.size,this.rect.height),o=Ka(this.rect.x,this.rect.y,i);return so(t,e,o)}}function no(r,t){const e=typeof r=="number"?r:t??$a,i=0,o=Qt,n=Math.min(e-o*2-te,Va),s=typeof r=="number"?r:n+i*2;return{height:e,width:s,paddingX:i,paddingY:o,iconSize:n}}function Ka(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 so(r,t,e){return r>=e.x&&r<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}const se="transparent",qa=0;class Cn extends Ft{constructor(t,e=se){super(t),this.color=se,this.borderColor=se,this.borderWidth=qa,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!==se&&t.fillRect(i,o,n,s,this.color),this.borderWidth>0&&this.borderColor!==se){const a=this.borderWidth/2;t.strokeRect(i+a,o+a,n-this.borderWidth,s-this.borderWidth,this.borderColor,this.borderWidth)}}}const vn="|",Za=2,ja=1e4,_i=new Map,Ri=new Map;function pn(r,t,e){r.size>=ja&&r.clear(),r.set(t,e)}function Ja(r,t){return`${r}${vn}${t}`}function Qa({text:r,font:t,maxWidth:e,textOverflow:i,ellipsis:o,forceEllipsis:n}){return[t,r,e.toFixed(Za),i,o,n?"force":"normal"].join(vn)}function ki(r,t,e){const i=Ja(e,t);let o=_i.get(i);return o===void 0&&(r.font=e,o=r.measureText(t).width,pn(_i,i,o)),o}function tc(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 ec(r,t,e,i,o){const n=ki(r,o,e);if(n>i)return{text:"",didTruncate:!0,width:0};const s=tc(t);let a=0,c=s.length,u=o,d=n;for(;a<=c;){const l=Math.floor((a+c)/2),h=`${s.slice(0,l).join("")}${o}`,f=ki(r,h,e);f<=i?(u=h,d=f,a=l+1):c=l-1}return{text:u,didTruncate:!0,width:d}}function Mi(r){const{ctx:t,text:e,font:i,maxWidth:o,textOverflow:n,ellipsis:s,forceEllipsis:a=!1}=r,c=Math.max(0,o);if(c<=0||e.length===0&&!(a&&n==="ellipsis"))return{text:"",didTruncate:e.length>0,width:0};const u=Qa({text:e,font:i,maxWidth:c,textOverflow:n,ellipsis:s,forceEllipsis:a}),d=Ri.get(u);if(d)return d;const l=ki(t,e,i);let h;return l<=c&&!a?h={text:e,didTruncate:!1,width:l}:n==="clip"?h={text:e,didTruncate:!0,width:l}:h=ec(t,e,i,c,s),pn(Ri,u,h),h}function ao({ctx:r,lines:t,font:e,maxWidth:i,maxLines:o,textOverflow:n,ellipsis:s}){const a=Math.max(0,Math.floor(o)),c=Math.min(t.length,a),u=t.slice(0,c),d=t.length>c;if(n==="ellipsis"&&u.length>0){const l=u.length-1,h=u[l]??"";u[l]=Mi({ctx:r,text:h,font:e,maxWidth:i,textOverflow:n,ellipsis:s,forceEllipsis:d}).text}return{lines:u,didClamp:d}}function ic(){_i.clear(),Ri.clear()}const rc="14px sans-serif",oc="black",nc=1,sc=14,ac="visible",cc="clip",lc="…",uc=/(\d*\.?\d+)px/,mt="|",hc=30,dc=`${mt}precise-wrap`,fc=1e4,gc=5e3,Cc=/[\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F\u200D\uFE0E\uFE0F\u2600-\u27BF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/,zi=new Map,Oi=new Map,Ni=new Map;let yi=null;function vc(){return yi===null&&typeof document<"u"&&(yi=document.createElement("canvas").getContext("2d")),yi}function mn(r,t,e,i){r.size>=i&&r.clear(),r.set(t,e)}function pc(r,t,e,i){return`${r}${mt}${t}${mt}${e??""}${mt}${i??""}`}function mc(r,t){return`${r}${mt}${t}`}function yc(r,t,e){return`${r}${mt}${t}${mt}${e}`}function yn(r,t,e,i){return`${r}${mt}${t}${mt}${e}${mt}${i}`}class lr extends _t{constructor(t,e,i){super(t),this.font=rc,this.color=oc,this.wordWrap=!1,this.lineHeight=nc,this.overflow=ac,this.textOverflow=cc,this.ellipsis=lc,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:a}=this,{lineHeightPx:c}=co(e,n,a,this.lineHeightPx);this.isSingleLineClampEnabled()?this.measureSingleLineClamp(t,e,i,c,s):o?this.measureWordWrap(t,e,i,c,s):this.measureSingleLine(t,e,i,c,s)}measureWordWrap(t,e,i,o,n){const s=lo(this.style.width,n.width);if(s>0){const a=this.getResolvedMaxLines(),u=!(this.overflow==="hidden"&&a!==void 0&&a>1&&bc(i)),d=yn(e,i,s,u);(d!==this.cachedLinesKey||this.cachedLines===null)&&(this.cachedLines=Fc(t,i,e,s,u),this.cachedLinesKey=d),n.width=s;const l=a!==void 0&&this.overflow==="hidden"?Math.min(this.cachedLines.length,a):this.cachedLines.length;n.height=l*o}else n.width=Pe(t,i,e),n.height=o,this.cachedLines=null}measureSingleLineClamp(t,e,i,o,n){const s=lo(this.style.width,n.width);s>0?(n.width=s,n.height=o):(n.width=Pe(t,i,e),n.height=o),this.cachedLines=null}measureSingleLine(t,e,i,o,n){const s=yc(e,i,o);s!==this.lastMeasureKey&&(this.lastMeasureKey=s,n.width=Pe(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,...a}=e;return{...a,text:o}}computeIsTruncated(){if(this.overflow!=="hidden"||this.textOverflow!=="ellipsis")return!1;const t=vc();if(!t)return!1;const e=this.cachedLines;if(e!==null&&e.length>0){const i=this.getResolvedMaxLines();return i===void 0?!1:ao({ctx:t,lines:e,font:this.font,maxWidth:this.rect.width,maxLines:i,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).didClamp}return Mi({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,a=this.cachedLines;a!==null&&a.length>0?this.paintMultiline(t,e,i,s,a,n):this.paintSingleLine(t,e,o,i,s,n)}paintMultiline(t,e,i,o,n,s){const{lineHeightPx:a}=co(i,this.lineHeight,this.fontSize,this.lineHeightPx),c=this.getResolvedMaxLines(),u=this.isMultilineClampEnabled()&&c!==void 0?ao({ctx:e,lines:n,font:i,maxWidth:s.width,maxLines:c,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).lines:n,d=u.length*a;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+=a)}}paintSingleLine(t,e,i,o,n,s){const a=s.y+s.height*.5;if(this.overflow==="hidden"){const c=Mi({ctx:e,text:i,font:o,maxWidth:s.width,textOverflow:this.textOverflow,ellipsis:this.ellipsis});if(this.lastPaintedTextWidth=Math.min(c.width,Math.max(0,s.width)),c.text.length===0)return;t.fillTextClipped(c.text,s.x,a,o,n,s,"middle","left");return}this.lastPaintedTextWidth=Pe(e,i,o),t.fillText(i,s.x,a,o,n,"middle")}}function co(r,t,e,i){const o=pc(r,t,e,i);let n=zi.get(o);if(n===void 0){const s=uc.exec(r),a=e??(s&&s[1]!==void 0?Number(s[1]):sc);n={fontSize:a,lineHeightPx:i??a*t},zi.set(o,n)}return n}function Pe(r,t,e){const i=mc(e,t);let o=Oi.get(i);return o===void 0&&(r.font=e,o=r.measureText(t).width,mn(Oi,i,o,fc)),o}function Fc(r,t,e,i,o){r.font=e;const n=Math.max(i,hc),s=yn(e,t,n,o);let a=Ni.get(s);if(!a){const c=o?e:`${e}${dc}`;a=Sc(Vs.split(r,t,c,n,o)),mn(Ni,s,a,gc)}return a}function lo(r,t){return typeof r=="number"&&r>0?r:t>0?t:0}function bc(r){return Cc.test(r)}function Sc(r){if(Array.isArray(r))return r;const t=r;return t.lines&&Array.isArray(t.lines)?t.lines:[]}function xc(){zi.clear(),Oi.clear(),Ni.clear(),ic()}const le={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},uo=16,ae=16,Fn=90,ho="rgba(8, 8, 8, 0.08)",wc=4e3,Ac=1920,Ec="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% )",Tc="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 fo=null;const Dc={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=Fn;const i=(e==null?void 0:e.customGradientColor)??(e!=null&&e.lighter?Tc:Ec),o=Pc(i);o&&(this._gradientStops=o.stops,this._gradientAngle=o.angle),this.borderRadius=Ic(e==null?void 0:e.roundness),this.animated=(e==null?void 0:e.animated)??!0,this.shimmerDuration=(e==null?void 0:e.shimmerDuration)??wc}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:a,borderRadius:c}=this;if(!a||a.length<2){c>0?t.roundedRect(i,o,n,s,c,{fillStyle:ho}):t.fillRect(i,o,n,s,ho);return}const u=t.getAnimationContext(),d=u==null?void 0:u.frameTime;if(!this.animated||d===void 0){t.linearGradientRect(i,o,n,s,c,a,this._gradientAngle);return}fo??(fo=d);const h=(d-fo)%this.shimmerDuration/this.shimmerDuration;t.custom(g=>{g.save(),g.beginPath(),c>0?g.roundRect(i,o,n,s,c):g.rect(i,o,n,s),g.clip();const{startX:v,startY:C,endX:w,endY:y}=Bc(i,o,s,h),x=g.createLinearGradient(v,C,w,y);for(const b of a)x.addColorStop(b.offset,b.color);g.fillStyle=x,g.fillRect(i,o,n,s),g.restore()}),(f=u==null?void 0:u.requestAnimationFrame)==null||f.call(u)}}function go(r){return r in le}function Ic(r){if(r===void 0)return le[uo]*ae;if(typeof r=="number")return go(r)?le[r]*ae:r;const t=r.trim(),e=Number(t);if(!Number.isNaN(e))return go(e)?le[e]*ae: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)*ae}return le[uo]*ae}function Hc(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 Lc(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 Pc(r){const e=Hc(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 a=Fn,c=0;const u=s.match(/^(-?\d+(?:\.\d+)?)(deg|rad|turn|grad)?$/i);if(u!=null&&u[1]){const[,h,f="deg"]=u;a=Lc(parseFloat(h),f),c=1}else if(s.startsWith("to ")){const h=s.substring(3).trim().toLowerCase(),f=Dc[h];f!==void 0&&(a=f,c=1)}const d=[],l=i.slice(c);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[,v,C,w]=g,y=w==="%"?parseFloat(C)/100:l.length>1?h/(l.length-1):0;d.push({offset:Math.max(0,Math.min(1,y)),color:v})}return d.length<2?null:{stops:d,angle:a}}function Bc(r,t,e,i){const o=Ac,n=i*o,s=r-o+n,a=r+o+n,c=t+e/2;return{startX:s,startY:c,endX:a,endY:c}}function _c(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 a=Math.round(s*t),c=u=>u.toString(16).padStart(2,"0");return`#${c(i)}${c(o)}${c(n)}${c(a)}`}function Rc(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 kc="default",Fi="pointer",Mc=.4,zc=2,Oc=1;class Sn extends lr{constructor(t,e,i){var o;super(t,e,i),this.view=kc,this.disabled=!1,this.isHovered=!1,this.isActive=!1,this.hasCustomColor=!1,super.style={...super.style,cursor:Fi},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=Rc(i.theme.tokens))),!this.hasCustomColor&&this.viewColors&&(this.color=this.viewColors[this.view].color)}set style(t){super.style={...super.style,cursor:Fi,...t}}get style(){const t=super.style;return t.cursor=this.disabled?"not-allowed":Fi,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=_c(t,Mc)),t}onPaint(t,e){const i=this.color;this.color=this.resolveColor(),super.onPaint(t,e);const{view:o,isHovered:n,wordWrap:s}=this,c=!s&&(o==="default"||o==="clear"||!this.disabled&&n),u=this.getLastPaintedTextWidth();c&&u>0&&this.paintUnderline(t,u),this.color=i}paintUnderline(t,e){const{x:i,y:o,height:n}=this.rect,s=o+n+zc,a=this.resolveColor();t.custom(c=>{c.beginPath(),c.moveTo(i,s),c.lineTo(i+e,s),c.strokeStyle=a,c.lineWidth=Oc,c.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 ue=0;const We=new Set;function Nc(){ue++,ue===1&&We.forEach(t=>t(!0));let r=!1;return()=>{r||(r=!0,ue--,ue===0&&We.forEach(t=>t(!1)))}}function Wc(){return ue>0}function Gc(r){return We.add(r),()=>{We.delete(r)}}const Ge="basic-grid-canvas-portal-hover",$c=400;let Uc=0;const bi="__canvasPortalTargetId";function Xc(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[bi]||(e[bi]=++Uc),String(e[bi])}const Jt=new Map;function Vc(r,t){return`${r??"default"}:${t??"default"}`}function Wi(r,t){const e=new CustomEvent(Ge,{detail:r});t?t.dispatchEvent(e):window.dispatchEvent(e)}function Co(r){const t=Jt.get(r);t!==void 0&&(window.clearTimeout(t),Jt.delete(r))}function Yc(r){const t=`${r}:`;for(const[e,i]of Jt.entries())e.startsWith(t)&&(window.clearTimeout(i),Jt.delete(e))}function Kc(r,t,e){const i=window.setTimeout(()=>{Jt.delete(r),Wi(t,e)},$c);Jt.set(r,i)}function fe(r,t,e){if(typeof window>"u")return;const i=Xc(t),o=`${i}:${Vc(r.source,r.originId)}`;r.visible?(Yc(i),Wi(r,t)):e?(Co(o),Wi(r,t)):(Co(o),Kc(o,r,t))}function qc(r,t){if(typeof window>"u")return()=>{};const e=t??window,i=o=>{const n=o;n.detail&&r(n.detail)};return e.addEventListener(Ge,i),()=>{e.removeEventListener(Ge,i)}}const Zc="cell";class yt{constructor(t,e){this.bounds=null,this.batcher=new qe,this.portalEventTarget=null,this.tooltipContext=void 0,this.rootNode=t,this.hoverController=new Ki({onCursorChange:i=>{var o;return(o=this.onCursorChange)==null?void 0:o.call(this,i)},portalHoverDispatch:fe,getPortalEventTarget:()=>this.portalEventTarget,portalSource:Zc,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 a=!1,c=!1;const u={type:t,x:e,y:i,originalEvent:o??{},target:n[0],stopPropagation:()=>{a=!0},preventDefault:()=>{c=!0,o==null||o.preventDefault()}};return n.length===0?(t==="mousemove"&&this.hoverController.handlePointerMove([],null),{propagationStopped:!1,suppressGridDefault:c,...s?{interaction:s}:{}}):(this.dispatchEventToNodes(n,u,t),t==="mousemove"&&this.hoverController.handlePointerMove(n,u),{propagationStopped:a,suppressGridDefault:c,...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 a={...n,currentTarget:s};this.invokeNodeHandler(s,i,a)}}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 gt?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 Qe="canvas-cell";function xn(r,t,e,i){return{kind:L.GridCellKind.Custom,allowOverlay:!1,readonly:!0,copyData:e??"",data:{kind:Qe,render:r,onClick:t},...i}}function ur(r){var e;const t=r;return!!(t&&t.kind===L.GridCellKind.Custom&&((e=t.data)==null?void 0:e.kind)===Qe)}const he=5,wn=[["hoverX","hoverY"],["mouseX","mouseY"],["pointerX","pointerY"],["posX","posY"],["x","y"]],An="default",En="pointer";function Tn(r,t){for(const[e,i]of wn){const o=r[e],n=r[i];if(typeof o=="number"&&typeof n=="number"&&!Number.isNaN(o)&&!Number.isNaN(n)){if(Dn(o,n,t))return{x:o-t.x,y:n-t.y};if(In(o,n,t))return{x:o,y:n}}}}function Dn(r,t,e){return r>=e.x&&r<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}function In(r,t,e){return r>=-he&&r<=e.width+he&&t>=-he&&t<=e.height+he}function Hn(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 Ln(r,t){if(r!=null&&r.clickHandlers&&Array.isArray(r.clickHandlers)){for(const{area:e,handler:i}of r.clickHandlers)if(ar(t.x,t.y,e))return i(),!0}return!1}function Pn(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 Gi=new WeakMap,Bn=new Map;function _n(r,t,e){const i={...e??{}};return delete i.hoveredAreas,Bn.set(r,i),t.data.renderData=i,i}function jt(r,t){return t.data.renderData??Bn.get(r)}function Rn(r,t){var i,o;(((i=Gi.get(r))==null?void 0:i.hovered)??!1)!==t&&(Gi.set(r,{hovered:t}),t?(o=r.onMouseEnter)==null||o.call(r):jc(r))}function jc(r){const{renderData:t}=r;(t==null?void 0:t.canvasRoot)instanceof yt&&t.canvasRoot.forcePortalHide()}function kn(r){var t;return(t=Gi.get(r))==null?void 0:t.hovered}function Mn(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!==An&&((o=i.overrideCursor)==null||o.call(i,n))}else r.handleMouseLeave(),r.forcePortalHide()}function zn(r,t,e,i,o){var c;const n=!!(t&&e.some(u=>ar(t.x,t.y,u))),s=kn(r)??!1,a=!!t;a!==s&&Rn(r,a),n&&!i&&((c=o.overrideCursor)==null||c.call(o,En))}function hr({cell:r,rect:t,relativePoint:e,renderData:i,rowData:o,rowIndex:n,event:s}){const a=Hn(i,e,s);return a.propagationStopped?{handled:!0,propagationStopped:!0,suppressGridDefault:a.suppressGridDefault}:Ln(i,e)?{handled:!0,propagationStopped:!1,suppressGridDefault:a.suppressGridDefault}:Pn(r,e,t,o,n,i)?{handled:!0,propagationStopped:!1,suppressGridDefault:a.suppressGridDefault}:{handled:!1,propagationStopped:!1,suppressGridDefault:a.suppressGridDefault}}function On(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 Jc({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 Nn({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:On(e).suppressEarlyGridSelect,interaction:e}:{handled:!1,suppressEarlyGridSelect:!1}}function dr(r={}){return{kind:L.GridCellKind.Custom,isMatch:t=>{var e;return((e=t.data)==null?void 0:e.kind)===Qe},needsHover:!0,needsHoverPosition:!0,onSelect:t=>{var h;const e=t.cell,i=t.bounds,o=Hi(t);if(!o)return;const n=Li(o,i),s=ke(t),a=Zt(s,i),c=jt(a,e),u=Nn({renderData:c,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=Hi(t);if(!o)return;const n=Li(o,i),s=ke(t),a=Zt(s,i),c=jt(a,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}:{}}))??hr({cell:e,rect:i,relativePoint:n,renderData:c,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,a=t.cellFillColor!==void 0?{...n,bgCell:t.cellFillColor}:n,c=ke(t),u=Zt(c,o),d={hoverX:t.hoverX,hoverY:t.hoverY,row:t.row,rowData:t.rowData,event:t.event,frameTime:t.frameTime,requestAnimationFrame:t.requestAnimationFrame},l=Jo(t.hoverX,t.hoverY,o)??Tn(d,o);i.save();const h=jt(u,e),f=s(i,o,a,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)??[];_n(u,e,f);const v=(f==null?void 0:f.canvasRoot)??(h==null?void 0:h.canvasRoot);Mn(v,l,d,t),zn(e.data,l,g,v,t),i.restore()},onPaste:()=>{}}}const Qc=dr(),$e=new Map;function Wn(r){const t=tl(r),e=$e.get(t);if(e)return e;const o=Ys.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 $e.set(t,n),n}function tl(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 xt(r){return p.isValidElement(r)}function pt(r){return typeof r=="string"?r:xt(r)?Wn(r):""}function el(){$e.clear()}function il(){return $e.size}const $i=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},vo={small:{radius:4,stroke:1.5},medium:{radius:4,stroke:1.5},big:{radius:6,stroke:2}};function rl(r,t,e,i,o,n,s,a,c,u,d=!1,l=!1){const f=s-0,v=Math.min(f-0,qi),C=n==="auto"?v:n,w=e+0,y=(c==null?void 0:c.rowSize)||"medium",x=!i&&!o,b=Rt(l,{x:t,y:e,width:C,height:s}),E=va(c,i,o,b,d),F=t+C*.5,P=w+f*.5,T=F-v*.5,B=P-v*.5;return r.roundedRect(t,w,C,f,vo[y].radius,{fillStyle:E.bgColor,strokeStyle:E.borderColor,lineWidth:x?vo[y].stroke:void 0}),ut(r,a,T,B,v,E.iconColor),{x:t,y:w,width:C,height:f}}const ol=28,nl="default",sl="s",po="pointer",al=20,Ui={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>'},cl=Object.values(Ui),ll={accentColor:"#1e88e5",accentFg:"#ffffff"};class ul extends Ft{constructor(t,e,i=!1,o=!1,n){super(t),this.view=nl,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":po},!this.disabled&&(n!=null&&n.onClick)&&(this.onClick=s=>{var a;return(a=n.onClick)==null?void 0:a.call(n,s)})}set style(t){super.style={...super.style,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=po),t}measure(t){if(this.useNewApi){const e=it[this.buttonSize];this.rect.height=e.height,this.rect.width=e.height}else{const e=hl(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;rl(t,i,o,this.checked,this.indeterminate,n,s,this.icon,this.theme??ll,this.view,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}}function hl(r,t){const e=typeof r=="number"?r:ol,i=0,o=Qt,n=Math.min(e-o*2-te,al),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,Ct=r=>{const t=e=>null;return t.__canvasType=r,t},fl=p.memo(({cellId:r,renderContent:t,nodeRegistry:e,onRegistryChange:i})=>{const o=t(),n=p.useRef(null);return p.useLayoutEffect(()=>{const s=e.current,a=n.current;a&&a!==r&&s.delete(a);const c=s.get(r),u=c!==void 0;s.set(r,o),u&&c!==o&&(i==null||i()),n.current=r},[r,o,e,i]),p.useLayoutEffect(()=>()=>{const s=e.current;n.current&&(s.delete(n.current),n.current=null)},[e]),null}),gl=Ct("Skeleton"),Cl=Ct("Container"),vl=Ct("Text"),pl=Ct("Icon"),ml=Ct("Button"),yl=Ct("IconButton"),Fl=Ct("EmbedIconButton"),bl=Ct("Rect"),Sl=Ct("Badge"),xl=Ct("Checkbox"),wl=Ct("Link"),de={Container:Cl,Text:vl,Icon:pl,Button:ml,IconButton:yl,EmbedIconButton:Fl,Checkbox:xl,Rect:bl,Badge:Sl,Skeleton:gl,Link:wl,icon:pt};function lt(r,t){if(r)return function(e){r.call(this,e)}}function Ue({element:r,idPrefix:t="root",theme:e}){const i=[],o=Gn(r,t,0,i,e);if(i.length>0){const n=new Map;for(const{icon:s,size:a}of i){if(!s)continue;const c=n.get(a)??[];c.push(s),n.set(a,c)}n.forEach((s,a)=>{on(s,{size:a})})}return o}function Xi(r){return r==null?"":typeof r=="string"||typeof r=="number"?String(r):Array.isArray(r)?r.map(Xi).join(""):""}function mo(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(c=>o[c]===n);if(s===void 0)return{};const a=i[s];return a===void 0?{}:{fontSize:a.fontSize,...e===void 0?{lineHeightPx:a.lineHeightPx}:{}}}function Gn(r,t,e,i,o){if(!r||!p.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 a=r.props,u=(r.key!=null?String(r.key):null)??e,d=a.id??`${t}-${s.toLowerCase()}-${u}`,l=g=>xt(g)?pt(g):g;if(s==="Icon"&&a.icon)i.push({icon:l(a.icon),size:a.size??16});else if(s==="IconButton"&&a.icon){const g=a.buttonSize??"s",{iconSize:v}=it[g];i.push({icon:l(a.icon),size:v})}else if(s==="EmbedIconButton"&&a.icon){const g=a.buttonSize??"s",v=a.overrideIconSize??it[g].iconSize;i.push({icon:l(a.icon),size:v})}else if(s==="Checkbox")cl.forEach(g=>{i.push({icon:l(g),size:20})});else if(s==="Button"){const g=a.size??"s",{iconSize:v}=it[g];a.leftIcon&&i.push({icon:l(a.leftIcon),size:v}),a.rightIcon&&i.push({icon:l(a.rightIcon),size:v})}else if(s==="Badge"){const g=a.size??"s",C={xs:10,s:12,m:14,l:16}[g]??12;a.leftIcon&&i.push({icon:l(a.leftIcon),size:C}),a.rightIcon&&i.push({icon:l(a.rightIcon),size:C})}const h=Al(s,d,a,o);if(a.portalHoverEnabled&&(h.portalHoverEnabled=!0),a.tooltip!==void 0&&(h.tooltip=a.tooltip),a.autoTooltip!==void 0){const g=a.autoTooltip;(g===!0||typeof g=="object"&&g!==null&&g.enabled!==!1)&&(h.portalHoverEnabled=!0)}a.interaction!==void 0&&(h.interaction=Oo(a.interaction)),typeof a.zIndex=="number"&&(h.zIndex=a.zIndex),a.style&&(h.style=a.style);const{children:f}=a;return f&&h instanceof gt&&p.Children.toArray(f).forEach((v,C)=>{if(p.isValidElement(v)){const w=Gn(v,d,C,i,o);h.addChild(w)}}),h}function Al(r,t,e,i){switch(r){case"Container":{const o=e,{id:n,gap:s,columnGap:a,rowGap:c,position:u,left:d,top:l,right:h,bottom:f,zIndex:g,onClick:v,onMouseEnter:C,onMouseLeave:w,onMouseDown:y,backgroundColor:x,__backgroundColorResolver:b,portalHoverEnabled:E,...F}=o,P={...F,columnGap:a??s??0,rowGap:c??s??0},T=new gt(t,P,dl(o,i));u&&(T.position=u),d!==void 0&&(T.left=d),l!==void 0&&(T.top=l),h!==void 0&&(T.right=h),f!==void 0&&(T.bottom=f);const B=lt(v),O=lt(C),ot=lt(w),G=lt(y);return B&&(T.onClick=B),O&&(T.onMouseEnter=O),ot&&(T.onMouseLeave=ot),G&&(T.onMouseDown=G),T}case"Text":{const{children:o,font:n,color:s,wordWrap:a,lineHeight:c,overflow:u,textOverflow:d,ellipsis:l,maxLines:h,autoTooltip:f,position:g,left:v,top:C,right:w,bottom:y,portalHoverEnabled:x}=e,b=Xi(o),E=i.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';let F;n?F=/["']|sans-serif|serif|monospace/i.test(n)?n:`${n} ${E}`:F=i.baseFontStyle?`${i.baseFontStyle} ${E}`:`13px ${E}`;const P=mo(i,n,c),T=new lr(t,b,{font:F,...P,color:s,wordWrap:a,lineHeight:c,overflow:u,textOverflow:d,ellipsis:l,maxLines:h,autoTooltip:f});return g&&(T.position=g),v!==void 0&&(T.left=v),C!==void 0&&(T.top=C),w!==void 0&&(T.right=w),y!==void 0&&(T.bottom=y),T}case"Icon":{const{icon:o,size:n,color:s,backgroundColor:a,position:c,left:u,top:d,right:l,bottom:h,onClick:f,onMouseEnter:g,onMouseLeave:v,onMouseDown:C}=e,w=xt(o)?pt(o):o,y=new fn(t,w,{size:n,color:s});a&&(y.backgroundColor=a),c&&(y.position=c),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 x=lt(f),b=lt(g),E=lt(v),F=lt(C);return x&&(y.onClick=x),b&&(y.onMouseEnter=b),E&&(y.onMouseLeave=E),F&&(y.onMouseDown=F),y}case"Button":{const{children:o,variant:n,view:s,size:a,leftIcon:c,rightIcon:u,disabled:d,position:l,left:h,top:f,right:g,bottom:v,onClick:C}=e,w=typeof o=="string"?o:"",y=xt(c)?pt(c):c,x=xt(u)?pt(u):u,b=new dn(t,w,{variant:n,view:s,size:a,leftIcon:y,rightIcon:x,disabled:d,theme:i});if(l&&(b.position=l),h!==void 0&&(b.left=h),f!==void 0&&(b.top=f),g!==void 0&&(b.right=g),v!==void 0&&(b.bottom=v),!d){const E=lt(C);E&&(b.onClick=E)}return b}case"EmbedIconButton":case"IconButton":{const{icon:o,size:n,variant:s,view:a,buttonSize:c,overrideSquareSize:u,overrideIconSize:d,disabled:l,position:h,left:f,top:g,right:v,bottom:C,onClick:w}=e,y=xt(o)?pt(o):o,x=r==="IconButton"?gn:Bi,b=new x(t,y,{size:n,variant:s,view:a,buttonSize:c,overrideSquareSize:u,overrideIconSize:d,disabled:l});if(b instanceof Bi){const{iconColor:E,iconColorHovered:F}=e;E!==void 0&&(b.iconColor=E),F!==void 0&&(b.iconColorHovered=F)}if(h&&(b.position=h),f!==void 0&&(b.left=f),g!==void 0&&(b.top=g),v!==void 0&&(b.right=v),C!==void 0&&(b.bottom=C),!l){const E=lt(w);E&&(b.onClick=E)}return b}case"Checkbox":{const{checked:o,indeterminate:n,size:s="auto",theme:a,view:c,buttonSize:u,disabled:d,position:l,left:h,top:f,right:g,bottom:v,onClick:C}=e,w=pt(o?Ui.checkedIcon:Ui.indeterminateIcon),y=new ul(t,w,o,n,{size:s,theme:a??i,view:c,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),v!==void 0&&(y.bottom=v),!d){const x=lt(C);x&&(y.onClick=x)}return y}case"Rect":{const{color:o,borderColor:n,borderWidth:s,position:a,left:c,top:u,right:d,bottom:l}=e,h=new Cn(t,o);return n&&(h.borderColor=n),s&&(h.borderWidth=s),a&&(h.position=a),c!==void 0&&(h.left=c),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:a,clear:c,leftIcon:u,rightIcon:d,customColor:l,customBackgroundColor:h,position:f,left:g,top:v,right:C,bottom:w,portalHoverEnabled:y,pilled:x}=e,b=xt(u)?pt(u):u,E=xt(d)?pt(d):d,F=new hn(t,o,{view:n,size:s,transparent:a,clear:c,leftIcon:b,rightIcon:E,pilled:x,customColor:l,customBackgroundColor:h,theme:i});return f&&(F.position=f),g!==void 0&&(F.left=g),v!==void 0&&(F.top=v),C!==void 0&&(F.right=C),w!==void 0&&(F.bottom=w),F}case"Skeleton":{const{width:o,height:n,roundness:s,lighter:a,customGradientColor:c,animated:u,shimmerDuration:d,style:l,portalHoverEnabled:h}=e,f=$i(o),g=$i(n),v={...l,...f!==void 0?{width:f}:null,...g!==void 0?{height:g}:null},C=new bn(t,{roundness:s,lighter:a,customGradientColor:c,shimmerDuration:d,animated:u});return C.style=v,C}case"Link":{const{children:o,href:n,target:s,view:a,disabled:c,font:u,color:d,wordWrap:l,lineHeight:h,overflow:f,textOverflow:g,ellipsis:v,maxLines:C,position:w,left:y,top:x,right:b,bottom:E,onClick:F,portalHoverEnabled:P}=e,T=Xi(o),B=i.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';let O;u?O=/["']|sans-serif|serif|monospace/i.test(u)?u:`${u} ${B}`:O=i.baseFontStyle?`${i.baseFontStyle} ${B}`:`13px ${B}`;const ot=mo(i,u,h),G=new Sn(t,T,{font:O,...ot,color:d,wordWrap:l,lineHeight:h,overflow:f,textOverflow:g,ellipsis:v,maxLines:C,href:n,target:s,view:a,disabled:c,theme:i});if(w&&(G.position=w),y!==void 0&&(G.left=y),x!==void 0&&(G.top=x),b!==void 0&&(G.right=b),E!==void 0&&(G.bottom=E),!c){const Q=lt(F);Q&&G.setOnClick(Q)}return G}default:throw new Error(`Unknown canvas component type: ${r}`)}}const El='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',Tl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Dl=30,Il=50,Hl=3;async function $n(){return typeof document>"u"||!document.fonts?Promise.resolve():document.fonts.ready.then(()=>{})}function Un(r={}){const{testFont:t=El,testText:e=Tl,maxChecks:i=Dl,checkInterval:o=Il,stableThreshold:n=Hl}=r;return new Promise(s=>{if(typeof document>"u"){s();return}const c=document.createElement("canvas").getContext("2d");if(!c){s();return}let u=-1,d=0,l=0;const h=()=>{c.font=t;const{width:f}=c.measureText(e);f!==u?(u=f,d=0):d+=1,l+=1,d>=n||l>=i?s():setTimeout(h,o)};h()})}function Xn(r){return $n().then(()=>Un(r))}function fr({dataEditorRef:r,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){const o=r.current;if(!o)return;const n=Math.min(30,t),s=e,a=[];for(let c=0-i;c<n;c+=1)for(let u=0;u<s;u+=1)a.push({cell:[u,c]});a.length>0&&o.updateCells(a)}function gr(r){let t=null;return()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,r()}))}}function Ll(){const r=p.useRef(null),t=p.useCallback(()=>(r.current||(r.current=new Wo),r.current),[]);return{registry:t(),getRegistry:t}}function Vn({dataEditorRef:r,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){p.useLayoutEffect(()=>{const o=gr(()=>{xc(),fr({dataEditorRef:r,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i})});Xn().then(o)},[r,t,e,i])}function Yn({dataEditorRef:r,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){p.useEffect(()=>{const o=gr(()=>{fr({dataEditorRef:r,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i})});return en(o)},[r,t,e,i])}L.GridCellKind.Text;const Xe=(r,t)=>({kind:L.GridCellKind.Text,data:r,displayData:r,allowOverlay:!0,readonly:!0,...t}),Kt=r=>{const{data:t,...e}=r??{};return{kind:L.GridCellKind.Text,data:"",displayData:"",allowOverlay:!0,readonly:!0,...e}};function Kn(r){const t=r;return!!(t!=null&&t.kind)}function Pl(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function Cr(r){return typeof r!="object"&&!Array.isArray(r)||r===null}function qn(r){return r==null||typeof r=="boolean"}const ti=r=>{if(!r||!p.isValidElement(r))return!1;const t=r.type;return!!(t!=null&&t.__canvasType)},vr=r=>typeof r=="string",Vi=r=>vr(r)?!0:ti(r),Bl=r=>vr(r)?!0:ti(r),yo=({jsxElement:r,canvasCellCache:t,cellInfo:e,options:i})=>{let o=null;if(Kn(r))return{...r,...i};if(Cr(r))return qn(r)?Kt(i):Xe(String(r),i);if(!ti(r)){const w="передан НЕ CanvasEl";return Xe(w,{...i,data:w})}const{colInd:n,rowInd:s,row:a,column:c}=e,{id:u}=c,d=i.getPortalEventTarget;let l=null;const h=`cell-${n}-${s}`,f=(w,y,x,b,E,F)=>{let P=(F==null?void 0:F.canvasRoot)instanceof yt?F.canvasRoot:l;{if(!r)return{};const O=Ue({element:r,idPrefix:`cell-${n}-${s}-${u}`,theme:x});P?(P.setRootNode(O),P.setOriginId(h)):P=new yt(O,h),l=P}if(!P)return{};const T=b!==void 0&&E!==void 0?{x:b,y:E}:void 0;P.rootNode.style={width:y.width,height:y.height},o||(o=w.canvas.getBoundingClientRect());const B={x:o.left+y.x,y:o.top+y.y,width:y.width,height:y.height};return P.setPortalEventTarget((d==null?void 0:d())??null),P.setTooltipContext({column:e.column,row:e.row,ctxs:e.ctxs,refTable:i.refTable}),P.render(w,y,T,B,{frameTime:F==null?void 0:F.frameTime,requestAnimationFrame:F==null?void 0:F.requestAnimationFrame}),l=P,{canvasRoot:P}},{data:g,...v}=i,C=c.copyData?typeof c.copyData=="function"?c.copyData(a):c.copyData:g;return xn(f,void 0,C,v)},pr=(r,t,e)=>r?t>=r.x&&t<r.x+r.width&&e>=r.y&&e<r.y+r.height:!1,_l=r=>{const t=r.findIndex(e=>!e.isServiceColumn);return t===-1?r.length:t},Rl=(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 Zn({cellsSelectionMode:r,selection:t,baseTheme:e,serviceColumnsCount:i,activeDataRange:o,outlineRange:n,checkboxSelectedRowIndexes:s,errorCellRanges:a,highlightRegionsExternal:c}){return p.useMemo(()=>{const u=[...c??[]],d=t.current,l=()=>{if(a!=null&&a.length)for(const C of a)u.push({color:e.errorOutlineColor,range:C,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,v=e.selectionServiceActiveBg;return o&&i>0&&u.push({color:v,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,a,c])}function jn({baseRegions:r,selectedColumnIndexes:t,headerSelectedRowIndexes:e,activeRow:i,activeRange:o,selectionRangeStack:n,checkboxAvailableRowIndexes:s,totalRows:a,firstDataCol:c,columnsCount:u,theme:d}){return p.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 v=u-c,C=[...r??[]],w=(y,x)=>{const[b,...E]=[...y].sort((B,O)=>B-O);if(b===void 0)return;let F=b,P=b;const T=(B,O)=>{C.push({color:d.accentColor,range:x(B,O),style:"solid-outline"})};for(const B of E)B===P+1||(T(F,P),F=B),P=B;T(F,P)};if(l){c>0&&C.push({color:d.selectionServiceActiveBg,range:{x:0,y:0,width:c,height:a},style:"no-outline"});for(const y of t)C.push({color:d.selectionActiveBg,range:{x:y,y:0,width:1,height:a},style:"no-outline"});w(t,(y,x)=>({x:y,y:0,width:x-y+1,height:a}))}if(h&&v>0){if(c>0)for(const y of e)C.push({color:d.selectionServiceActiveBg,range:{x:0,y,width:c,height:1},style:"no-outline"});for(const y of e)C.push({color:d.selectionActiveBg,range:{x:c,y,width:v,height:1},style:"no-outline"});w(e,(y,x)=>({x:c,y,width:v,height:x-y+1}))}if(i!==void 0&&v>0){const y=s!=null&&s.has(i)?d.selectionActiveCheckboxBg:d.selectionCheckboxBg,x=(E,F)=>{F>0&&C.push({color:y,range:{x:E,y:i,width:F,height:1},style:"no-outline"})};if(!(o&&i>=o.y&&i<o.y+o.height))x(c,v);else{const E=Math.max(o.x,c),F=o.x+o.width;x(c,E-c),x(F,u-F)}}if(g&&n&&c>0){const y=new Set;for(const x of n){const b=Math.max(x.x,c);if(!(x.x+x.width-b<=0||x.height<=0))for(let F=x.y;F<x.y+x.height;F+=1)y.add(F)}for(const x of y)C.push({color:d.selectionServiceActiveBg,range:{x:0,y:x,width:c,height:1},style:"no-outline"})}return C},[r,t,e,i,o,n,s,a,c,u,d.selectionActiveBg,d.selectionActiveCheckboxBg,d.selectionCheckboxBg,d.selectionServiceActiveBg,d.accentColor])}const Be={columns:L.CompactSelection.empty(),rows:L.CompactSelection.empty(),current:void 0};function Jn({cellsSelectionMode:r,gridSelection:t,onGridSelectionChange:e,onSelectionEmit:i}){const[o,n]=p.useState(Be),s=t!==void 0,a=t??o,c=p.useCallback(l=>{s?e==null||e(l):n(l),i==null||i(l)},[s,e,i]),u=p.useCallback(()=>{s?e==null||e(Be):n(Be),i==null||i(Be)},[s,e,i]),d=p.useMemo(()=>r==="range-cell"?"rect":r==="multi-range-cell"?"multi-rect":r==="disabled"?"none":"cell",[r]);return{selection:a,handleGridSelectionChange:c,handleSelectionCleared:u,rangeSelect:d}}const Vt=new Set,Fo=({start:r,length:t})=>{const e=new Set;for(let i=0;i<t;i+=1)e.add(r+i);return e};function Qn({columns:r,selection:t,cellsSelectionMode:e,checkboxSelectedRowIndexes:i}){return p.useMemo(()=>{const o=t.current,n=_l(r);if(!(e!=="disabled"&&o!==void 0)||!o)return{hasAnyActiveSelection:!1,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:Vt,activeColumns:Vt,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 a=Rl(o.range,n),c=a!==void 0,u=e==="cell"&&a!==void 0&&a.width===1&&a.height===1;if(!c)return{hasAnyActiveSelection:!1,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:Vt,activeColumns:Vt,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=a!=null&&a.height&&a.height>0?Fo({start:a.y,length:a.height}):Vt,l=a!=null&&a.width&&a.width>0?Fo({start:a.x,length:a.width}):Vt;return{hasAnyActiveSelection:c,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:d,activeColumns:l,activeDataRange:a,isSingleCellCustomHighlight:u,outlineRange:u?a: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)=>pr(a,h,f),isActiveHeaderColumn:h=>r[h]?l.has(h):!1}},[r,e,i,t])}function kl({highlightActiveRow:r,onHighlightActiveRowChange:t,isHighlightActiveRowControlled:e}){const[i,o]=p.useState(void 0),n=e??t!==void 0,s=n?r:i,a=p.useCallback(c=>{n||o(c),t==null||t(c)},[n,t]);return{activeRow:s,commitActiveRow:a}}function Ml({columns:r}){const[t,e]=p.useState(()=>L.CompactSelection.empty()),i=p.useMemo(()=>t.toArray().filter(u=>{var d;return!((d=r[u])!=null&&d.isServiceColumn)}),[t,r]),o=p.useMemo(()=>new Set(i),[i]),n=p.useRef(void 0),[s,a]=p.useState(!1),c=p.useCallback(()=>{e(L.CompactSelection.empty())},[]);return{selectedColumns:t,setSelectedColumns:e,selectedColumnIndexes:i,selectedColumnSet:o,lastSelectedColumnRef:n,isNativeColumnSelection:s,setIsNativeColumnSelection:a,clearColumnSelection:c}}function zl(){const[r,t]=p.useState(()=>L.CompactSelection.empty()),e=p.useMemo(()=>r.toArray(),[r]),i=p.useRef(r);i.current=r;const o=p.useRef(!1),n=p.useRef(L.CompactSelection.empty()),s=p.useRef(!1);p.useEffect(()=>{const c=d=>{o.current=d.ctrlKey||d.metaKey,n.current=i.current,s.current=!0},u=()=>{s.current=!1};return window.addEventListener("pointerdown",c,!0),window.addEventListener("pointerup",u,!0),()=>{window.removeEventListener("pointerdown",c,!0),window.removeEventListener("pointerup",u,!0)}},[]);const a=p.useCallback(()=>{t(L.CompactSelection.empty())},[]);return{selectedRows:r,setSelectedRows:t,headerSelectedRowIndexes:e,selectedRowsRef:i,ctrlGestureRef:o,ctrlBaseRowsRef:n,pointerGestureRef:s,clearRowSelection:a}}function ts({columns:r,selection:t,cellsSelectionMode:e,highlightActiveType:i,enableColumnSelection:o,enableRowSelection:n,enableSelectAll:s,leadingServiceColumnsCount:a,dataRowCount:c,handleGridSelectionChange:u,handleSelectionCleared:d,onSelectionEmit:l,highlightActiveRow:h,onHighlightActiveRowChange:f,isHighlightActiveRowControlled:g}){const{selectedColumns:v,setSelectedColumns:C,selectedColumnIndexes:w,selectedColumnSet:y,lastSelectedColumnRef:x,isNativeColumnSelection:b,setIsNativeColumnSelection:E}=Ml({columns:r}),{setSelectedRows:F,headerSelectedRowIndexes:P,ctrlGestureRef:T,ctrlBaseRowsRef:B,pointerGestureRef:O}=zl(),{activeRow:ot,commitActiveRow:G}=kl({highlightActiveRow:h,onHighlightActiveRowChange:f,isHighlightActiveRowControlled:g}),Q=p.useMemo(()=>r.findIndex(M=>M.isServiceColumn&&M.id==="row-markers"),[r]),kt=p.useCallback(M=>{const{current:N}=M;if(!N)return M;const z=a,{range:X}=N;if(X.x>=z)return M;const Y=X.x+X.width-z;return Y<=0?{current:void 0,rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()}:{...M,current:{...N,cell:[Math.max(N.cell[0],z),N.cell[1]],range:{...X,x:z,width:Y}}}},[a]),ei=p.useCallback(M=>{const N=M.current;if(n&&Q>=0&&N&&N.cell[0]===Q){const X=a,Y=N.range.y,nt=Y+Math.max(N.range.height,1);if(T.current){const W=nt-Y<=1;let tt=B.current;if(tt.length===0&&t.current&&t.current.cell[0]===Q){const dt=t.current.range;tt=L.CompactSelection.empty().add([dt.y,dt.y+Math.max(dt.height,1)]),B.current=tt}let st;W?st=tt.hasIndex(Y)?tt.remove(Y):tt.add(Y):st=tt.add([Y,nt]),C(L.CompactSelection.empty()),F(st),G(void 0),E(!1),u({...M,current:{...N,range:{x:X,y:N.range.y,width:0,height:N.range.height}}}),l==null||l({current:void 0,rows:st,columns:L.CompactSelection.empty()});return}const ht=Math.max(r.length-X,0);C(L.CompactSelection.empty()),F(L.CompactSelection.empty()),G(void 0),E(!1),u({...M,current:{...N,range:{x:X,y:N.range.y,width:ht,height:N.range.height}}});return}const z=kt(M);(z.current!==void 0||z.rows.length>0)&&(C(L.CompactSelection.empty()),F(L.CompactSelection.empty())),E(!1),i==="row"?O.current&&z.current&&G(z.current.cell[1]):G(void 0),u(z)},[r,t,u,kt,Q,n,a,i,l,G,T,B,O,C,F,E]),ii=p.useCallback(()=>{C(L.CompactSelection.empty()),F(L.CompactSelection.empty()),G(void 0),E(!1),d()},[d,G,C,F,E]),ee=p.useMemo(()=>{var N;const M=new Set(w);if(b&&t.current){const{x:z,width:X}=t.current.range;for(let Y=z;Y<z+X;Y+=1)(N=r[Y])!=null&&N.isServiceColumn||M.add(Y)}return Array.from(M).sort((z,X)=>z-X).map(z=>{var X;return(X=r[z])==null?void 0:X.id}).filter(z=>!!z)},[w,b,t,r]),Ht=(e==="range-cell"||e==="multi-range-cell")&&!b&&!(t.current!==void 0&&t.current.cell[0]<a),ri=p.useCallback((M,N)=>{if(s&&Q>=0&&M===Q&&e!=="disabled"){const W=a,tt=Math.max(r.length-W,0);if(tt===0||c===0)return;C(L.CompactSelection.empty()),F(L.CompactSelection.empty()),G(void 0),E(!0),u({current:{cell:[W,0],range:{x:W,y:0,width:tt,height:c},rangeStack:[]},rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()});return}if(!o)return;const z=r[M];if(!z||z.isServiceColumn)return;const X=N.shiftKey;if(N.ctrlKey||N.metaKey){let W=v;if(W.length===0&&b&&t.current){const st=t.current.range;W=W.add([st.x,st.x+st.width])}const tt=W.hasIndex(M)?W.remove(M):W.add(M);x.current=M,C(tt),F(L.CompactSelection.empty()),G(void 0),E(!1),u({current:void 0,rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()}),l==null||l({current:void 0,rows:L.CompactSelection.empty(),columns:tt});return}let nt,ht;X&&x.current!==void 0?(nt=Math.min(x.current,M),ht=Math.max(x.current,M)):(nt=M,ht=M,x.current=M),C(L.CompactSelection.empty()),F(L.CompactSelection.empty()),G(void 0),E(!0),u({current:{cell:[nt,0],range:{x:nt,y:0,width:ht-nt+1,height:c},rangeStack:[]},rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()})},[o,s,Q,e,a,r,t,b,v,c,u,l,G,x,C,F,E]),Ce=p.useCallback(M=>{const N=new Set(M),z=r.map((W,tt)=>!W.isServiceColumn&&N.has(W.id)?tt:-1).filter(W=>W>=0);if(F(L.CompactSelection.empty()),G(void 0),z.length===0){C(L.CompactSelection.empty()),E(!1),u({current:void 0,rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()});return}const X=z[0],Y=z[z.length-1];if(X===void 0||Y===void 0)return;const nt=Y-X===z.length-1;if(x.current=Y,nt){C(L.CompactSelection.empty()),E(!0),u({current:{cell:[X,0],range:{x:X,y:0,width:Y-X+1,height:c},rangeStack:[]},rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()});return}let ht=L.CompactSelection.empty();z.forEach(W=>{ht=ht.add(W)}),C(ht),E(!1),u({current:void 0,rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()})},[r,c,u,C,F,E,G,x]);return{selectedColumnIndexes:w,selectedColumnKeysAll:ee,selectColumnsByKeys:Ce,selectedColumnSet:y,headerSelectedRowIndexes:P,activeRow:ot,numberingColumnIndex:Q,drawFocusRing:Ht,selectColumnFromHeader:ri,handleGridSelectionWithColumnReset:ei,handleSelectionClearedWithColumns:ii}}function Ol(r,t,e,i){const o=performance.now();function n(s){const a=s-o,c=Math.min(a/i,1),u=t+(e-t)*c;r(Math.round(u)),c<1&&requestAnimationFrame(n)}requestAnimationFrame(n)}const Nl=r=>{const t=typeof r=="number",[e,i]=p.useState(()=>t?r:56);return p.useEffect(()=>{t&&Ol(i,e,r,300)},[r]),t?e:r};function es({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 Wl({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]],a=t(s);if(!ur(a))return;const c=n.bounds,u=Zt({colIndex:s[0],rowIndex:s[1]},c),d=jt(u,a),l={x:n.localEventX,y:n.localEventY};return es({cell:s,mouseArgs:n,glideCell:a,rect:c,renderData:d,relativePoint:l})}function Gl({eventTarget:r,dataEditorRef:t,getCellContent:e,interactionSessionStore:i,onCellContextMenuExternal:o}){p.useEffect(()=>{if(!r)return;const n=s=>{var g;if(!(s instanceof MouseEvent))return;const a=s;if(a.clientX===0&&a.clientY===0)return;const c=Wl({dataEditor:t.current,getCellContent:e,clientX:a.clientX,clientY:a.clientY,nativeEvent:a});if(!c)return;const{cell:u,interaction:d,mouseArgs:l,relativePoint:h}=c,f=i.beginOrGet({cell:u,relativePoint:h,interaction:d,button:a.button,source:"contextmenu"});if(f.decision.contextMenuMode!=="normal"){if(i.consumePhase(f,"contextmenu-capture"),a.stopPropagation(),(g=a.stopImmediatePropagation)==null||g.call(a),f.decision.contextMenuMode==="none"){a.cancelable&&a.preventDefault();return}!l||!o||o(u,{...l,preventDefault:()=>{a.cancelable&&a.preventDefault()}})}};return r.addEventListener("contextmenu",n,!0),()=>{r.removeEventListener("contextmenu",n,!0)}},[t,r,e,i,o])}const $l=250;function Ul(r){return p.useCallback((t,e)=>{const i=r.consumeEditorRequest(t,$l);return!i||i.target!=="self"?e:{...e,activationBehaviorOverride:"single-click"}},[r])}const ze=350;function bo(r){return Math.round(r)}function Xl({cell:r,relativePoint:t,button:e}){return[r[0],r[1],e??"unknown",bo(t.x),bo(t.y)].join(":")}function Ve(r,t){return r[0]===t[0]&&r[1]===t[1]}function is(r,t){return Math.abs(r.x-t.x)<=1&&Math.abs(r.y-t.y)<=1}function Vl(r,t){return!Ve(r.cell,t.cell)||r.button!==void 0&&t.button!==void 0&&r.button!==t.button?!1:is(r.relativePoint,t.relativePoint)}function Yl(r,t){return Date.now()-r.startedAt>(t.maxAgeMs??ze)||!Ve(r.cell,t.cell)||r.button!==void 0&&t.button!==void 0&&r.button!==t.button?!1:is(r.relativePoint,t.relativePoint)}function Kl(){let r,t=1;const e=i=>{if(!(!r||!Yl(r,i)))return r};return{beginOrGet:i=>{const o=e(i);return o||(r={id:t++,key:Xl(i),cell:i.cell,relativePoint:i.relativePoint,interaction:i.interaction,decision:On(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(!Vl(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=ze)=>{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(Ve(n.cell,i))return s.consumed=!0,n.consumedPhases.add("editor-activation"),s}},isMatchingRecent:(i,o,n=ze)=>{const s=r;return!s||!s.consumedPhases.has(i)?!1:Date.now()-s.startedAt<=n&&Ve(s.cell,o)},clearStale:(i=ze)=>{r&&Date.now()-r.startedAt>i&&(r=void 0)},clear:()=>{r=void 0}}}function ql(){const r=p.useMemo(()=>Kl(),[]),t=p.useCallback(i=>r.beginOrGet(i),[r]),e=p.useCallback(i=>r.consumeClickResult(i),[r]);return{interactionSessionStore:r,beginOrGetInteractionSession:t,consumeCanvasClickResult:e}}function Zl(r={}){const t=p.useMemo(()=>!0,[]);return p.useMemo(()=>{const e=[];return t&&e.push(dr({beginOrGetInteractionSession:r.beginOrGetInteractionSession,consumeCanvasClickResult:r.consumeCanvasClickResult})),e.length>0?e:void 0},[t,r.beginOrGetInteractionSession,r.consumeCanvasClickResult])}const Si={glideScroller:"dvn-scroller",glideTable:"gdg-table",glideUnderlay:"dvn-underlay"};function rs(r){const t=(r==null?void 0:r.querySelector(`.${Si.glideTable}`))??null,e=(t==null?void 0:t.querySelector(`.${Si.glideScroller}`))??null,i=(t==null?void 0:t.querySelector(`.${Si.glideUnderlay}`))??null;return{container:t,scroller:e,underlay:i}}const So="[useGlideElements]";function jl(r,t){const[e,i]=p.useState(null),[o,n]=p.useState(null),[s,a]=p.useState(null),c=p.useRef(null);p.useEffect(()=>{const d=r==null?void 0:r.current;if(qt.tableDebug(So,"useEffect fired",{hasWrapper:!!d,fullScreened:t}),!d)return;const l=()=>{const{container:f,scroller:g,underlay:v}=rs(d);return qt.tableDebug(So,"tryFind",{containerFound:!!f,scrollerFound:!!g,underlayFound:!!v}),f?(i(C=>C===f?C:f),n(C=>C===g?C:g),a(C=>C===v?C:v),c.current&&(c.current.disconnect(),c.current=null),!0):!1},h=requestAnimationFrame(()=>{if(l())return;const f=new MutationObserver(()=>{l()});f.observe(d,{childList:!0,subtree:!0}),c.current=f});return()=>{cancelAnimationFrame(h),c.current&&(c.current.disconnect(),c.current=null),i(null),n(null),a(null)}},[r,t]);const u=p.useCallback(d=>e?_e.createPortal(d,e):null,[e]);return{glideContainer:e,glideScroller:o,glideUnderlay:s,isReady:!!e,renderInContainer:u}}function Jl(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 Ql(r,t){p.useEffect(()=>{if(!t)return;const e=r.current;if(!e)return;const i=qt.throttleWithLastCall(()=>{const{x:o,y:n}=Jl(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 tu(r,t){const{columnsLast:e,rows:i,ctxs:o,refTable:n,theme:s,portalEventTargetRef:a,externalOnItemHovered:c,onHoverRowChange:u}=r,d=p.useRef(null),l=p.useCallback(f=>{const g=d.current;d.current=null,fe({visible:!1,x:0,y:0,width:0,height:0,source:"cell",originId:g??void 0,nodeId:g??void 0},f,!0)},[]);return p.useCallback(f=>{var w,y,x;c==null||c(f),u==null||u(f.kind==="cell"?f.location[1]:void 0);const g=(a==null?void 0:a.current)??null,v=(w=f.location)==null?void 0:w[0],C=v!=null?e[v]:void 0;if(f.kind==="header"){if(!(C!=null&&C.headerCellTooltip)){l(g);return}const b=`header-tooltip-${v}`;d.current===b||l(g);const F=(y=t.current)==null?void 0:y.getBounds(v,-1);if(!F)return;d.current=b,fe({visible:!0,x:F.x,y:F.y,width:F.width,height:F.height,source:"header",originId:b,nodeId:b,priority:0,tooltipContext:{column:C,ctxs:o,refTable:n,colInd:v,theme:s}},g);return}if(f.kind==="cell"){const b=f.location[1],E=i[b];if(!C||!E||!C.cellTooltip){l(g);return}const F=`col-tooltip-${v}-${b}`;d.current===F||l(g);const T=(x=t.current)==null?void 0:x.getBounds(v,b);if(!T)return;d.current=F,fe({visible:!0,x:T.x,y:T.y,width:T.width,height:T.height,source:"cell",originId:F,nodeId:F,priority:0,tooltipContext:{column:C,row:E,ctxs:o,refTable:n,colInd:v,rowInd:b,theme:s}},g);return}l(g)},[e,i,o,n,s,a,c,u,l,t])}function eu({enabled:r,portalEventTargetRef:t,headerHeight:e,groupHeaderHeight:i,experimental:o}){const[n,s]=p.useState(0),a=p.useRef(null),c=p.useMemo(()=>{const h=e??Oe;let f=typeof h=="number"?h:Oe;return Array.isArray(i)?f+=i.reduce((g,v)=>g+v,0):typeof i=="number"&&(f+=i),f},[e,i]),u=p.useRef(c);u.current=c;const d=p.useCallback(h=>{var w;if((w=a.current)==null||w.call(a),a.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"),v=f.querySelector(".dvn-underlay");if(!g||!v)return;const C=()=>{const y=g.scrollTop,x=Math.min(y,u.current);s(-1*x),v.style.overflowY="visible",v.style.transform=`translateY(-${x}px)`};g.addEventListener("scroll",C),a.current=()=>{g.removeEventListener("scroll",C),v.style.transform="",v.style.overflowY=""}},[r,t]),l=p.useMemo(()=>r?{...o,paddingBottom:n}:o,[r,n,o]);return{unstickyCallbackRef:d,mergedExperimental:l}}const xi=Ao.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));}"]),iu=Ao(L).withConfig({displayName:"styled__StyledGlideDataEditor"})([""]),mr={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"},ru={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"},ou={...mr,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"},nu={...mr},su={light:mr,dark:nu,highContrastLight:ru,betaCoreLight:ou},au=(r="light")=>su[r],ft={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"}},cu=r=>({tokens:au(r),fonts:Ne,fontMetrics:Io,bgEditableCell:ft.bgEditableCell[r],bgEditableCellHovered:ft.bgEditableCellHovered[r],selectionCheckboxBg:ft.selectionCheckboxBg[r],selectionActiveBg:ft.selectionActiveBg[r],selectionActiveCheckboxBg:ft.selectionActiveCheckboxBg[r],selectionServiceBg:ft.selectionServiceBg[r],selectionServiceActiveBg:ft.selectionServiceActiveBg[r],errorOutlineColor:ft.errorOutlineColor[r],bgRowHovered:ft.bgRowHovered[r],bgServiceRowHovered:ft.bgServiceRowHovered[r],bgSelectedRowHovered:ft.bgSelectedRowHovered[r]}),rt={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"}},lu=r=>({accentColor:rt.accentColor[r],accentLight:rt.accentLight[r],textDark:rt.textDark[r],textHeader:rt.textHeader[r],textHeaderSelected:rt.textHeaderSelected[r],textGroupHeader:rt.textGroupHeader[r],bgCell:rt.bgCell[r],bgHeader:rt.bgHeader[r],bgHeaderHasFocus:rt.bgHeaderHasFocus[r],bgHeaderHovered:rt.bgHeaderHovered[r],borderColor:rt.borderColor[r],bgGroupHeader:rt.bgGroupHeader[r],bgGroupHeaderHovered:rt.bgGroupHeaderHovered[r]}),xo={small:"bodyXXS",medium:"bodyS",big:"bodyM"},uu=(r="big")=>{const t=Ne[xo[r]],e=Io[xo[r]],i=`${e.fontSize}px`,o=e.lineHeightPx,n=To[r],{cellHorizontalPadding:s,cellVerticalPadding:a}=n;return{headerFontStyle:Ne.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:a,activeSizes:n}},yr=(r="big",t="light")=>({...lu(t),...uu(r),...cu(t),rowSize:r}),hu=yr(),wo=(r,t)=>{if(r==null)return null;const e=typeof r=="number"?r:r(t);return[t.colInd,t.colInd+e]};function du(...r){}const fu={},wi=r=>Array.isArray(r)?r.filter(t=>typeof t=="string"):typeof r=="string"?[r]:[],gu=({columns:r,rows:t,bottomSummaryRows:e,rowHeight:i,width:o,rowSize:n="medium",ctxs:s=fu,freezeColumns:a,onColumnResize:c,renderGroupHeader:u,groupAlignMap:d,refTable:l,onColumnsReorder:h,portalEventTargetRef:f,onItemHovered:g,unstickyHeader:v,resizableColumn:C=!0,minColumnWidth:w=56,maxColumnWidth:y,maxColumnAutoWidth:x,containerRef:b,containerClassName:E,containerStyle:F,renderOverlayFeatures:P,hideGrid:T,contentStateNode:B,fullScreened:O,editorOverlayPortal:ot,highlightActiveType:G="disabled",cellsSelectionMode:Q="range-cell",enableColumnSelection:kt=!0,enableRowSelection:ei=!0,enableSelectAll:ii=!0,enableLowDprHairline:ee,gridSelection:Ht,onGridSelectionChange:ri,onSelectionEmit:Ce,onColumnSelectionChange:M,pendingColumnSelectionKeys:N,onColumnSelectionApplied:z,highlightActiveRow:X,onHighlightActiveRowChange:Y,highlightActiveRowControlled:nt,highlightRegions:ht,checkboxSelectedRowIndexes:W,checkboxVisibleRowIndexes:tt,hoverEffects:st,onCellClicked:dt,onCellContextMenu:ie,onGroupHeaderClicked:Lt,onMouseMove:ve,portalElementRef:Cu,...Mt})=>{var _r,Rr;const Fr=qt.useActiveTheme(),_=p.useMemo(()=>yr(n,Fr),[n,Fr]),os=p.useMemo(()=>{const m=typeof i=="number"?i:void 0;if(m)return m;const S=Eo[n],A=typeof i=="function"?i:void 0;return A?D=>{const H=t[D];if(!H)return m??S;const R=A(H,{rowSizeName:n,rowSizeValue:S},D);return typeof R=="number"&&!Number.isNaN(R)?R:S}:S},[t,i,n]),zt=(e==null?void 0:e.length)??0,ns=Nl(os),[pe,ss]=p.useState(new Map),as=p.useCallback((m,S,A,D)=>{const H=m;H.id&&(c==null||c(H,S,A,D),ss(I=>(I.set(H.id,S),new Map(I))))},[c]),Ot=p.useMemo(()=>pe.size===0?r:r.map(m=>pe.has(m.id)?{...m,width:pe.get(m.id),grow:0}:m),[r,pe]),[br,vu]=p.useState(0),oi=p.useMemo(()=>new WeakMap,[]),ni=p.useRef(null),Tt=p.useRef(null);p.useEffect(()=>{var m;(Ht==null?void 0:Ht.current)!==void 0&&((m=Tt.current)==null||m.focus())},[Ht]);const{interactionSessionStore:at,beginOrGetInteractionSession:cs,consumeCanvasClickResult:ls}=ql(),Sr=Ul(at),{selection:vt,handleGridSelectionChange:us,handleSelectionCleared:hs,rangeSelect:ds}=Jn({cellsSelectionMode:Q,gridSelection:Ht,onGridSelectionChange:ri,onSelectionEmit:Ce}),et=Qn({columns:Ot,selection:vt,cellsSelectionMode:Q,checkboxSelectedRowIndexes:W}),fs=p.useMemo(()=>Y?m=>Y(m,m!==void 0?t[m]:void 0):void 0,[Y,t]),{selectedColumnIndexes:gs,selectedColumnKeysAll:xr,selectColumnsByKeys:me,selectedColumnSet:ye,headerSelectedRowIndexes:wr,activeRow:Cs,numberingColumnIndex:Ar,drawFocusRing:vs,selectColumnFromHeader:Er,handleGridSelectionWithColumnReset:ps,handleSelectionClearedWithColumns:ms}=ts({columns:Ot,selection:vt,cellsSelectionMode:Q,highlightActiveType:G,enableColumnSelection:kt,enableRowSelection:ei,enableSelectAll:ii,leadingServiceColumnsCount:et.leadingServiceColumnsCount,dataRowCount:t.length+zt,handleGridSelectionChange:us,handleSelectionCleared:hs,onSelectionEmit:Ce,highlightActiveRow:X,onHighlightActiveRowChange:fs,isHighlightActiveRowControlled:nt});p.useEffect(()=>{M==null||M(xr)},[xr,M]),p.useEffect(()=>{if(!N)return;me(N);const m=setTimeout(()=>z==null?void 0:z(),0);return()=>clearTimeout(m)},[N,Ot,me,z]);const Fe=wr.length>0,be=p.useMemo(()=>{var A;const m=new Set,S=(A=vt.current)==null?void 0:A.rangeStack;if(S){const D=et.firstDataColumnIndex;for(const H of S){const I=Math.max(H.x,D);for(let R=I;R<H.x+H.width;R+=1)m.add(R)}}return m},[vt,et.firstDataColumnIndex]),V=p.useMemo(()=>Ot.map((m,S)=>{const A={...m.themeOverride??{}};let D=Object.keys(A).length>0;return m.isServiceColumn&&(A.bgCell=_.selectionServiceBg,D=!0),S===Ar&&(A.accentLight="transparent",A.accentColor="transparent",D=!0),et.isActiveHeaderColumn(S)&&(A.bgHeader=_.selectionServiceActiveBg,A.bgHeaderHasFocus=_.selectionServiceActiveBg,D=!0),ye.has(S)&&(A.bgHeader=_.selectionServiceActiveBg,A.bgHeaderHasFocus=_.selectionServiceActiveBg,D=!0),be.has(S)&&(A.bgHeader=_.selectionServiceActiveBg,A.bgHeaderHasFocus=_.selectionServiceActiveBg,D=!0),Fe&&!m.isServiceColumn&&(A.bgHeader=_.selectionServiceActiveBg,A.bgHeaderHasFocus=_.selectionServiceActiveBg,D=!0),D?{...m,themeOverride:A}:m}),[Ot,et,ye,be,Fe,Ar,_.selectionServiceBg,_.selectionServiceActiveBg]),ys=p.useMemo(()=>{var A;const m=(A=vt.current)==null?void 0:A.range,S=[];return V.forEach((D,H)=>{D.isServiceColumn||!D.isErrorCell||t.forEach((I,R)=>{var k;(k=D.isErrorCell)!=null&&k.call(D,I)&&(pr(m,H,R)||S.push({x:H,y:R,width:1,height:1}))})}),S},[V,t,vt.current]),Se=p.useCallback(([m,S],A)=>{var Ee,Or,Te,Nr;du(br);const D=(A==null?void 0:A.applyCanvasEditorActivation)!==!1,H=It=>D?Sr([m,S],It):It,I=!!e&&S>t.length-1,R=t[S],k=V[m];if(!k)return Kt();if(I){const It=e[S-t.length],{renderSummaryCell:Wr,colSpan:$s}=k;if(!Wr||!It)return Kt();const fi={row:It,column:k,colInd:m,rowInd:S,ctxs:s,theme:_,hovered:{cellHover:!1,rowHover:!1},active:{cellActive:!1,rowActive:!1}},Us=Wr(fi),Gr=wo($s,fi),Xs={data:"",...Gr&&{span:Gr}};return H(yo({jsxElement:Us,canvasCellCache:oi,cellInfo:fi,options:{...Xs,getPortalEventTarget:()=>(f==null?void 0:f.current)??null,refTable:l}}))}if(!R)return Kt();const K=ni.current,U={row:R,column:k,colInd:m,rowInd:S,ctxs:s,theme:_,hovered:{cellHover:(K==null?void 0:K.colInd)===m&&(K==null?void 0:K.rowInd)===S,rowHover:(K==null?void 0:K.rowInd)===S},active:{cellActive:et.isActiveDataCell(m,S),rowActive:et.isActiveRow(S)}},{renderCell:q,id:j,colSpan:$,editable:Dt,contentAlign:Bt,columnThemeOverride:we}=k,Ae=((Or=(Ee=R[j])==null?void 0:Ee.toString)==null?void 0:Or.call(Ee))??"NOT FOUND",kr=wo($,U),Mr=Dt?typeof Dt=="boolean"?Dt:Dt(R):!1,hi=typeof we=="function"?we(U):void 0,di={data:((Nr=(Te=R[j])==null?void 0:Te.toString)==null?void 0:Nr.call(Te))??"NOT FOUND",...Mr?{readonly:!1,allowOverlay:!0}:{readonly:!0,...k.hasPreview===!0&&{allowOverlay:!0},...k.hasPreview==="none"&&{allowOverlay:!1}},themeOverride:{...hi,...Mr&&{bgCell:_.bgEditableCell}},contentAlign:Bt,...kr&&{span:kr}};if(!q){const It=String(Ae);return Cr(It)?H(Xe(It,di)):H(Kt(di))}const zr=hi?{...U,theme:{..._,...hi}}:U,Gs=q(zr);return H(yo({jsxElement:Gs,canvasCellCache:oi,cellInfo:zr,options:{...di,getPortalEventTarget:()=>(f==null?void 0:f.current)??null,refTable:l}}))},[br,e,t,V,s,_,et,oi,f,Sr]),Fs=p.useCallback((m,S)=>{var $;const A=Se(m,{applyCanvasEditorActivation:!1});if(!ur(A)){dt==null||dt(m,S);return}let D=!1;const H=S.preventDefault;S.preventDefault=()=>{D=!0,H()};const I=Zt({colIndex:m[0],rowIndex:m[1]},S.bounds),R=jt(I,A),k={x:S.localEventX,y:S.localEventY},K=es({cell:m,glideCell:A,rect:S.bounds,renderData:R,relativePoint:k}),U=K?at.beginOrGet({cell:m,relativePoint:k,interaction:K.interaction,button:S.button,source:"click"}):at.beginOrGet({cell:m,relativePoint:k,interaction:No(),button:S.button,source:"click"}),q=hr({cell:A,rect:S.bounds,relativePoint:k,renderData:R,rowData:t[m[1]],rowIndex:m[1]}),j=U?Jc({decision:U.decision,propagationStopped:q.propagationStopped,suppressGridDefault:q.suppressGridDefault}):{suppressExternalCellClick:q.propagationStopped,suppressGridDefaultForClick:q.suppressGridDefault};if(U&&(at.consumePhase(U,"cell-click"),at.storeClickResult(U,q)),S.button===0&&(($=j.editorRequest)==null?void 0:$.target)==="self"&&at.armEditorRequest(U,j.editorRequest),j.suppressGridDefaultForClick&&(S.preventDefault(),U!=null&&U.decision.editorRequest&&at.clear()),j.suppressExternalCellClick||dt==null||dt(m,S),D||S.button===1){at.clear();return}},[Se,at,dt,t]),bs=p.useCallback((m,S)=>{at.isMatchingRecent("contextmenu-capture",m)||ie==null||ie(m,S)},[at,ie]),Ss=Zl({beginOrGetInteractionSession:cs,consumeCanvasClickResult:ls}),Nt=p.useRef(null),Wt=p.useRef(null),re=p.useMemo(()=>new Map,[]),Tr=p.useMemo(()=>new Map,[]),si=p.useRef(null),Pt=p.useRef(null),xs=p.useMemo(()=>qt.mergeRefs(Pt,b),[b]),{drawHeader:ws,onHeaderClicked:As}=p.useMemo(()=>({drawHeader:(A,D)=>{var Ae;const{ctx:H,rect:I,columnIndex:R}=A,k=V[R];if(!k||!k.renderHeaderCell)return D();const K={column:k,drawArgs:A,ctxs:s,theme:_};let U=k.renderHeaderCell(K);if(!Vi(U))return D();typeof U=="string"&&(U=bt.jsx(de.Container,{style:{width:"100%"},alignItems:"center",children:bt.jsx(de.Text,{children:U})}));const q=`header-${k.id}-${R}`,j=Ue({element:U,idPrefix:q,theme:_});let $;re.has(k.id)?($=re.get(k.id),$==null||$.setRootNode(j),$!=null&&$.rootNode&&($.rootNode.style={width:I.width,height:I.height})):($=new yt(j,q),$.rootNode.style={width:I.width,height:I.height},re.set(k.id,$)),$==null||$.setPortalEventTarget((f==null?void 0:f.current)??null),$==null||$.setTooltipContext({column:k,ctxs:s,refTable:l});const Dt=((Ae=Nt.current)==null?void 0:Ae.id)===k.id?Nt.current:void 0,Bt=H.canvas.getBoundingClientRect(),we={x:Bt.left+I.x,y:Bt.top+I.y,width:I.width,height:I.height};return $==null?void 0:$.render(H,I,Dt,we)},onHeaderClicked:(A,D)=>{const H=V[A];if(H){if(H.renderHeaderCell){const I=re.get(H.id);if(I){const R=I.getInteractionAtPoint(D.localEventX,D.localEventY);if(I.dispatchPointerEvent("click",D.localEventX,D.localEventY),R)return}}Er(A,D)}}}),[V,s,_,re,f,Tt,Er]),Es=p.useCallback((m,S)=>{const A=V[m];if(!kt||!A){Lt==null||Lt(m,S);return}const D=wi(A.group),H=Math.max(0,D.indexOf(S.group)),I=D.slice(0,H+1).join("\0"),R=q=>{const j=V[q];return j!==void 0&&wi(j.group).slice(0,H+1).join("\0")===I};let k=m,K=m;for(;k-1>=0&&R(k-1);)k-=1;for(;K+1<V.length&&R(K+1);)K+=1;const U=[];for(let q=k;q<=K;q+=1){const j=V[q];j&&!j.isServiceColumn&&U.push(j.id)}U.length>0&&me(U),Lt==null||Lt(m,S)},[kt,V,me,Lt]),Dr=p.useMemo(()=>{const m=new Map;V.forEach((A,D)=>{if(A.isServiceColumn)return;const H=et.isActiveHeaderColumn(D)||ye.has(D)||be.has(D)||Fe;wi(A.group).forEach(I=>{if(I==="")return;const R=m.get(I);m.set(I,(R??!0)&&H)})});const S=new Set;return m.forEach((A,D)=>{A&&S.add(D)}),S},[V,et,ye,be,Fe]),Ts=p.useCallback(m=>{const S=d==null?void 0:d.get(m),A={name:m,...S&&{spanAlign:S}};return Dr.has(m)?{...A,overrideTheme:{bgGroupHeader:_.selectionServiceActiveBg,bgGroupHeaderHovered:_.bgHeaderHovered}}:A},[d,Dr,_.selectionServiceActiveBg,_.bgHeaderHovered]),{glideContainer:ai,isReady:Ds,renderInContainer:Is}=jl(Pt,O),Ir=ot==="inside";Ql(Pt,Ir),Gl({eventTarget:ai??Pt.current,dataEditorRef:Tt,getCellContent:Se,interactionSessionStore:at,onCellContextMenuExternal:ie});const{unstickyCallbackRef:Hr,mergedExperimental:ci}=eu({enabled:v,portalEventTargetRef:f,headerHeight:Mt.headerHeight,groupHeaderHeight:Mt.groupHeaderHeight,experimental:Mt.experimental}),Hs=p.useMemo(()=>qt.mergeRefs(Tt,l,Hr),[l,Hr]),Ls=p.useMemo(()=>ee===void 0?ci:{...ci,enableLowDprHairline:ee},[ee,ci]),Lr=p.useCallback((...m)=>{var H;const S=Tt.current;if(!S)return;const A=new Set;m.forEach(I=>{typeof I=="number"&&I>=0&&I<t.length&&A.add(I)});const D=[];A.forEach(I=>{V.forEach((R,k)=>{D.push({cell:[k,I]})})}),D.length>0&&((H=S.updateCells)==null||H.call(S,D))},[V,t.length]),xe=p.useCallback(m=>{const S=ni.current;(S==null?void 0:S.colInd)===(m==null?void 0:m.colInd)&&(S==null?void 0:S.rowInd)===(m==null?void 0:m.rowInd)||(ni.current=m,Lr(S==null?void 0:S.rowInd,m==null?void 0:m.rowInd))},[Lr]),Ps=p.useCallback(m=>{ve==null||ve(m),m.kind==="cell"?(()=>{const A=m.location[0],D=m.location[1],H=t[D],I=V[A];if(!H||!I||I.isServiceColumn){xe(null);return}xe({colInd:A,rowInd:D})})():xe(null),m.kind==="group-header"?(()=>{if(typeof m.group!="string"){Wt.current=null;return}Wt.current={id:m.group,x:m.localEventX,y:m.localEventY}})():Wt.current=null,m.kind==="header"?(()=>{var I,R;const A=m.location[0],D=m.location[1],H=V[A];if(!H||!(H!=null&&H.renderHeaderCell)){Nt.current=null;return}Nt.current={id:H.id,x:m.localEventX,y:m.localEventY},(R=(I=Tt.current)==null?void 0:I.updateCells)==null||R.call(I,[{cell:[A,D]}])})():Nt.current=null,Nt.current=null,Wt.current=null},[V,ve,t,xe]),Pr={dataEditorRef:Tt,rowCount:t.length,columnCount:V.length,headerAndGroupHeaderRowsCount:1+(Mt.groupHeaderHeight??[]).length};Yn(Pr),Vn(Pr);const Bs=p.useMemo(()=>h?(S,A)=>{var I,R;const D=(I=V[S])==null?void 0:I.id,H=(R=V[A])==null?void 0:R.id;typeof D!="string"||typeof H!="string"||h(D,H)}:void 0,[V,h]),_s=p.useMemo(()=>{if(u)return(m,S)=>{var Bt;const A=u(m);if(A==="default")return S();if("defaultWithCustomGroupName"in A)return S(A.defaultWithCustomGroupName);const{groupName:H,rect:I,ctx:R}=m;let k=A;if(!Vi(k))return S();typeof k=="string"&&(k=bt.jsx(de.Container,{style:{width:"100%"},alignItems:"center",children:bt.jsx(de.Text,{children:k})}));const K=H,U=Ue({element:k,idPrefix:K,theme:_}),q=new yt(U,K);q.rootNode.style={width:I.width,height:I.height},q.setPortalEventTarget((f==null?void 0:f.current)??null),Tr.set(K,q);const j=((Bt=Wt.current)==null?void 0:Bt.id)===K?Wt.current:void 0,$=R.canvas.getBoundingClientRect(),Dt={x:$.left+I.x,y:$.top+I.y,width:I.width,height:I.height};return q.render(R,I,j,Dt)}},[Tr,u,_,f]),li=st==null?void 0:st.row,oe=!!li,Br=typeof li=="object"?li.color:void 0,[Gt,Rs]=p.useState(void 0),ks=p.useCallback(m=>{Rs(S=>S===m?S:m)},[]),Ms=p.useMemo(()=>{const m=!!(W!=null&&W.size),S=oe?Gt:void 0;if(!zt&&!m&&S===void 0)return;const A=Br??_.bgRowHovered;return D=>D>t.length-1?{bgCell:_.bgHeader}:W!=null&&W.has(D)?{bgCell:D===S?_.bgSelectedRowHovered:_.selectionCheckboxBg}:D===S?{bgCell:A}:{}},[t.length,zt,_.bgHeader,_.selectionCheckboxBg,_.bgRowHovered,_.bgSelectedRowHovered,W,oe,Gt,Br]),zs=tu({columnsLast:V,rows:t,ctxs:s,refTable:l,theme:_,portalEventTargetRef:f,externalOnItemHovered:g,onHoverRowChange:oe?ks:void 0},Tt),Os=Zn({cellsSelectionMode:Q,selection:vt,baseTheme:_,serviceColumnsCount:et.leadingServiceColumnsCount,activeDataRange:et.activeDataRange,outlineRange:et.outlineRange,checkboxSelectedRowIndexes:W,errorCellRanges:ys,highlightRegionsExternal:ht}),ui=jn({baseRegions:Os,selectedColumnIndexes:gs,headerSelectedRowIndexes:wr,activeRow:Cs,activeRange:(_r=vt.current)==null?void 0:_r.range,selectionRangeStack:(Rr=vt.current)==null?void 0:Rr.rangeStack,checkboxAvailableRowIndexes:tt,totalRows:t.length+zt,firstDataCol:et.leadingServiceColumnsCount,columnsCount:Ot.length,theme:_}),Ns=p.useMemo(()=>{const m=et.leadingServiceColumnsCount;return!oe||Gt===void 0||Gt>t.length-1||m===0?ui:[{color:_.bgServiceRowHovered,range:{x:0,y:Gt,width:m,height:1},style:"no-outline"},...ui??[]]},[ui,et.leadingServiceColumnsCount,oe,Gt,t.length,_.bgServiceRowHovered]),Ws=p.useMemo(()=>{if(!(!F&&!B&&!T))return{...F,...B?{position:"relative"}:void 0,...T?{height:"100%",minHeight:0}:void 0}},[F,B,T]);return bt.jsxs("div",{ref:xs,className:E,style:Ws,children:[Ir?_e.createPortal(bt.jsx(xi,{ref:si,onAnimationEndCapture:m=>m.stopPropagation(),id:"portal"}),(Pt==null?void 0:Pt.current)??document.body):_e.createPortal(bt.jsx(xi,{id:"portal",ref:si}),document.body),_e.createPortal(bt.jsx(xi,{id:"portal2"}),document.body),!T&&bt.jsx(iu,{ref:Hs,className:"gdg-table",portalElementRef:si,theme:_,getRowThemeOverride:Ms,onHeaderClicked:As,onGroupHeaderClicked:Es,onMouseMove:Ps,drawHeader:ws,drawGroupHeader:_s,getGroupDetails:Ts,getCellContent:Se,columns:V,rows:t.length+zt,freezeTrailingRows:zt,freezeColumns:a,minColumnWidth:w,maxColumnAutoWidth:x,maxColumnWidth:y,columnSelect:"none",columnSelectionBlending:"exclusive",drawFocusRing:vs,gridSelection:vt,onGridSelectionChange:ps,onSelectionCleared:ms,width:o??"100%",onColumnMoved:Bs,onColumnResize:C?as:void 0,customRenderers:Ss,rowHeight:ns,highlightRegions:Ns,rangeSelect:ds,smoothScrollX:!0,smoothScrollY:!0,headerHeight:Oe,onCellClicked:Fs,onCellContextMenu:bs,onItemHovered:zs,...Mt,experimental:Ls,keybindings:{...Mt.keybindings,copy:!1,paste:!1},onPaste:!1}),B,Ds&&ai&&(P==null?void 0:P({containerElement:ai,renderInContainer:Is}))]})};exports.BUTTON_PADDING_Y=Qt;exports.CACHE_SEPARATOR=Qi;exports.CANVAS_CELL_KIND=Qe;exports.CANVAS_PORTAL_EVENT=Ge;exports.Canvas=de;exports.CanvasAbsoluteContainer=ca;exports.CanvasBadge=hn;exports.CanvasButton=dn;exports.CanvasChevron=Ba;exports.CanvasContainer=gt;exports.CanvasEmbedIconButton=Bi;exports.CanvasHoverController=Ki;exports.CanvasIcon=fn;exports.CanvasIconButton=gn;exports.CanvasLeaf=Ft;exports.CanvasLink=Sn;exports.CanvasNode=_t;exports.CanvasRect=Cn;exports.CanvasRegistry=Wo;exports.CanvasRoot=da;exports.CanvasSkeleton=bn;exports.CanvasText=lr;exports.CellCanvasRoot=yt;exports.DANGER_COLOR=Ji;exports.DANGER_TEXT_COLOR=Ai;exports.DEFAULT_ACCENT_FG=ge;exports.DEFAULT_BORDER_WIDTH=At;exports.DEFAULT_BUTTON_RADIUS=Zi;exports.DEFAULT_CURSOR=An;exports.DEFAULT_HEADER_HEIGHT=Oe;exports.DEFAULT_ICON_SIZE=$o;exports.DEFAULT_ICON_SPACING=ji;exports.DEFAULT_ROW_HEIGHT=Eo;exports.DEFAULT_SECONDARY_HOVER=Uo;exports.DEFAULT_SIZE=je;exports.DEFAULT_TEXT_PADDING=fa;exports.DEFAULT_VIEW=Je;exports.DISABLED_BG_COLOR=Xo;exports.DISABLED_BORDER_COLOR=Vo;exports.DISABLED_TEXT_COLOR=Ei;exports.DrawBatcher=qe;exports.EMPTY_CELL_OBJ=Ks;exports.FlexBox=wt;exports.FlexElement=Lo;exports.FlexTreeBuilder=Ro;exports.HEX_COLOR_CHAR_CODE=Ko;exports.HEX_COLOR_PREFIX=Yo;exports.ICON_SIZE_ADJUSTMENT=te;exports.IconSpriteManager=tn;exports.LEGACY_HOVER_CURSOR=En;exports.LIGHTEN_AMOUNT=tr;exports.LayoutReconciler=ko;exports.MAX_ICON_SIZE=qi;exports.POINTER_CANDIDATE_KEYS=wn;exports.PositionResolver=St;exports.RELATIVE_COORD_TOLERANCE=he;exports.RootBridge=fl;exports.RootFlexBox=Yi;exports.SIZES=To;exports.SIZE_CONFIG=it;exports.SizeAccumulator=Ke;exports.TABLE_GLIDE_SIZES=qs;exports.THEME=hu;exports.TableGlide=gu;exports.VIEW_COLORS=Ze;exports.buildButtonViewColors=Go;exports.buildCanvasTree=Ue;exports.buildCellId=Zt;exports.calculateButtonWidth=rr;exports.calculateContentWidth=or;exports.canvasCellRenderer=Qc;exports.clearButtonCaches=ga;exports.clearIconCache=el;exports.createCanvasCell=xn;exports.createCanvasCellRenderer=dr;exports.createEmptyCellGlide=Kt;exports.createNormalCanvasInteraction=No;exports.createRafUpdate=gr;exports.createSvgDataUrl=Pi;exports.createTextCellGlide=Xe;exports.defaultBatcher=ha;exports.defaultIconManager=Et;exports.dispatchCanvasPortalHover=fe;exports.drawButton=an;exports.drawButtonWithView=cn;exports.drawEmbedIconButtonWithView=ln;exports.drawIcon=nn;exports.drawIcon$1=ut;exports.drawIconButton=cr;exports.drawIconButtonWithView=un;exports.drawIconDirect=ba;exports.flexBoxLayout=ia;exports.fontStyles=Ne;exports.getCachedTextWidth=ir;exports.getCellIndices=ke;exports.getDpr=Me;exports.getHoverState=kn;exports.getIconCacheSize=il;exports.getIconImageDirect=sn;exports.getIconSprite=rn;exports.getIconSpriteStats=ya;exports.getRelativePointerPosition=Tn;exports.getRowHeightBySize=Re;exports.getTheme=yr;exports.handleCanvasRootClick=Hn;exports.handleCanvasRootHover=Mn;exports.handleCellClick=Pn;exports.handleClickHandlers=Ln;exports.hashString=Qo;exports.isAbsoluteCoords=Dn;exports.isCanvasCell=ur;exports.isCanvasContent=Vi;exports.isCanvasEl=ti;exports.isCanvasString=vr;exports.isGlideCellObj=Bl;exports.isGlideGridCellObj=Kn;exports.isHoveringBounds=Rt;exports.isObject=Pl;exports.isPointInArea=ar;exports.isPortalHoverLocked=Wc;exports.isPrimitive=Cr;exports.isReactIcon=xt;exports.isRelativeCoords=In;exports.isValueEmpty=qn;exports.lightenColor=er;exports.lightenColorCached=qo;exports.lockPortalHover=Nc;exports.normalizeCanvasInteraction=Oo;exports.normalizeDimensionValue=$i;exports.normalizeHoverPoint=Jo;exports.normalizeIcon=pt;exports.onAnyIconLoad=en;exports.performCanvasClick=hr;exports.performCanvasPointerDownIntent=Nn;exports.preloadIconSprites=on;exports.queryGlideElements=rs;exports.reactIconToSvg=Wn;exports.rectContainsCell=pr;exports.registerIconDefinitions=ma;exports.resetIconSpriteCache=Fa;exports.resolveButtonColors=nr;exports.resolveClickPoint=Hi;exports.resolveDangerColors=jo;exports.resolvePaddingBox=Po;exports.resolvePaddingBox$1=zo;exports.resolvePrimaryColors=Ii;exports.resolveSecondaryColors=Zo;exports.resolveViewColors=sr;exports.retrieveRenderData=jt;exports.storeRenderData=_n;exports.subscribeToCanvasPortalHover=qc;exports.subscribeToPortalHoverLock=Gc;exports.toRelativePoint=Li;exports.updateGridCells=fr;exports.updateHoverState=Rn;exports.updateHoverStateIfNeeded=zn;exports.useBaseHighlightRegions=Zn;exports.useCanvasRegistry=Ll;exports.useColumnRowHighlightRegions=jn;exports.useFontLoadRedraw=Vn;exports.useIconLoadRedraw=Yn;exports.useNativeGridSelection=Jn;exports.useSelectionGeometry=Qn;exports.useTableSelectionSystem=ts;exports.waitForCanvasFonts=Un;exports.waitForDocumentFonts=$n;exports.waitForFonts=Xn;