@arcadeai/design-system 3.39.0 → 3.39.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (425) hide show
  1. package/dist/CompositeItem-CniPsjzP.js +30 -0
  2. package/dist/CompositeList-yq5K_yj6.js +81 -0
  3. package/dist/CompositeRoot-Dy-5A-Je.js +206 -0
  4. package/dist/DialogRoot-DDokfJcO.js +57 -0
  5. package/dist/DialogTrigger-CFUE8YsM.js +402 -0
  6. package/dist/DirectionContext-BSOheMwC.js +10 -0
  7. package/dist/FieldItemContext-CF2fRwBC.js +12 -0
  8. package/dist/FloatingPortalLite-BHsRx4XN.js +29 -0
  9. package/dist/InternalBackdrop-BVEfe6O1.js +610 -0
  10. package/dist/LabelableContext-Dzw1DWuj.js +171 -0
  11. package/dist/Separator-CswSYAXX.js +25 -0
  12. package/dist/ToolbarRootContext-D7EsmJ5f.js +10 -0
  13. package/dist/andromeeda-B-gfN00q.js +4 -0
  14. package/dist/angular-html-dA1qUKRV.js +32 -0
  15. package/dist/angular-ts-CXyBC0vY.js +21 -0
  16. package/dist/apl-CjNiDgad.js +3 -3
  17. package/dist/assets/icons/telegram.js +10 -0
  18. package/dist/assets/images/arcade-grid.d.ts.map +1 -1
  19. package/dist/assets/images/arcade-grid.js +1 -0
  20. package/dist/assets/index.css +1 -1
  21. package/dist/assets/tokens.css +1 -1
  22. package/dist/assets/variables.css +1 -1
  23. package/dist/astro--3ZkKqYU.js +18 -0
  24. package/dist/astro-CFFExE8Q.js +5 -5
  25. package/dist/aurora-x-B56eICma.js +4 -0
  26. package/dist/ayu-dark-DJSOaKig.js +4 -0
  27. package/dist/ayu-light-BPfFt4v-.js +4 -0
  28. package/dist/ayu-mirage-DmPLRBj7.js +4 -0
  29. package/dist/blade-BoRuQEEj.js +20 -0
  30. package/dist/blade-D0HyNvCw.js +4 -4
  31. package/dist/c-C4SM8H98.js +6 -0
  32. package/dist/cairo-DM6WF2e3.js +1 -1
  33. package/dist/{calendar-DreAgQKY.js → calendar-CLEnvrbp.js} +483 -482
  34. package/dist/catppuccin-frappe-CA5k7W3u.js +4 -0
  35. package/dist/catppuccin-latte-CYfkUW5v.js +4 -0
  36. package/dist/catppuccin-macchiato-BOj_4I3g.js +4 -0
  37. package/dist/catppuccin-mocha-BXpUXme4.js +4 -0
  38. package/dist/clamp-BxE4ZAuA.js +17 -0
  39. package/dist/cobol-HihOMwht.js +1 -1
  40. package/dist/coffee-D8Swy5yR.js +8 -0
  41. package/dist/components/index.js +665 -644
  42. package/dist/components/ui/atoms/accordion.d.ts +9 -7
  43. package/dist/components/ui/atoms/accordion.d.ts.map +1 -1
  44. package/dist/components/ui/atoms/accordion.js +454 -243
  45. package/dist/components/ui/atoms/alert-dialog.d.ts +13 -9
  46. package/dist/components/ui/atoms/alert-dialog.d.ts.map +1 -1
  47. package/dist/components/ui/atoms/alert-dialog.js +149 -183
  48. package/dist/components/ui/atoms/alert.d.ts +2 -1
  49. package/dist/components/ui/atoms/alert.d.ts.map +1 -1
  50. package/dist/components/ui/atoms/alert.js +36 -25
  51. package/dist/components/ui/atoms/avatar.d.ts +10 -5
  52. package/dist/components/ui/atoms/avatar.d.ts.map +1 -1
  53. package/dist/components/ui/atoms/avatar.js +198 -205
  54. package/dist/components/ui/atoms/badge.d.ts +4 -5
  55. package/dist/components/ui/atoms/badge.d.ts.map +1 -1
  56. package/dist/components/ui/atoms/badge.js +31 -22
  57. package/dist/components/ui/atoms/breadcrumb.d.ts +4 -5
  58. package/dist/components/ui/atoms/breadcrumb.d.ts.map +1 -1
  59. package/dist/components/ui/atoms/breadcrumb.js +46 -29
  60. package/dist/components/ui/atoms/button.d.ts +4 -6
  61. package/dist/components/ui/atoms/button.d.ts.map +1 -1
  62. package/dist/components/ui/atoms/button.js +59 -28
  63. package/dist/components/ui/atoms/byoc-badge.d.ts +2 -2
  64. package/dist/components/ui/atoms/byoc-badge.d.ts.map +1 -1
  65. package/dist/components/ui/atoms/byoc-badge.js +14 -8
  66. package/dist/components/ui/atoms/calendar.d.ts +6 -16
  67. package/dist/components/ui/atoms/calendar.d.ts.map +1 -1
  68. package/dist/components/ui/atoms/calendar.js +1 -1
  69. package/dist/components/ui/atoms/card.d.ts +4 -2
  70. package/dist/components/ui/atoms/card.d.ts.map +1 -1
  71. package/dist/components/ui/atoms/card.js +46 -35
  72. package/dist/components/ui/atoms/chart.d.ts +24 -48
  73. package/dist/components/ui/atoms/chart.d.ts.map +1 -1
  74. package/dist/components/ui/atoms/chart.js +179 -148
  75. package/dist/components/ui/atoms/checkbox.d.ts +2 -3
  76. package/dist/components/ui/atoms/checkbox.d.ts.map +1 -1
  77. package/dist/components/ui/atoms/checkbox.js +269 -249
  78. package/dist/components/ui/atoms/code-block.js +1 -1
  79. package/dist/components/ui/atoms/collapsible.d.ts +5 -5
  80. package/dist/components/ui/atoms/collapsible.d.ts.map +1 -1
  81. package/dist/components/ui/atoms/collapsible.js +208 -23
  82. package/dist/components/ui/atoms/command.d.ts +4 -3
  83. package/dist/components/ui/atoms/command.d.ts.map +1 -1
  84. package/dist/components/ui/atoms/command.js +1655 -348
  85. package/dist/components/ui/atoms/dialog.d.ts +12 -10
  86. package/dist/components/ui/atoms/dialog.d.ts.map +1 -1
  87. package/dist/components/ui/atoms/dialog.js +91 -80
  88. package/dist/components/ui/atoms/dropdown-menu.d.ts +21 -17
  89. package/dist/components/ui/atoms/dropdown-menu.d.ts.map +1 -1
  90. package/dist/components/ui/atoms/dropdown-menu.js +1507 -899
  91. package/dist/components/ui/atoms/form.d.ts +5 -3
  92. package/dist/components/ui/atoms/form.d.ts.map +1 -1
  93. package/dist/components/ui/atoms/form.js +36 -42
  94. package/dist/components/ui/atoms/hover-card.d.ts +5 -6
  95. package/dist/components/ui/atoms/hover-card.d.ts.map +1 -1
  96. package/dist/components/ui/atoms/hover-card.js +355 -193
  97. package/dist/components/ui/atoms/icons/index.d.ts +1 -0
  98. package/dist/components/ui/atoms/icons/index.d.ts.map +1 -1
  99. package/dist/components/ui/atoms/icons/index.js +58 -56
  100. package/dist/components/ui/atoms/icons/telegram.d.ts +4 -0
  101. package/dist/components/ui/atoms/icons/telegram.d.ts.map +1 -0
  102. package/dist/components/ui/atoms/icons/telegram.js +37 -0
  103. package/dist/components/ui/atoms/index.d.ts +1 -0
  104. package/dist/components/ui/atoms/index.d.ts.map +1 -1
  105. package/dist/components/ui/atoms/index.js +566 -545
  106. package/dist/components/ui/atoms/input-group.d.ts +20 -0
  107. package/dist/components/ui/atoms/input-group.d.ts.map +1 -0
  108. package/dist/components/ui/atoms/input-group.js +136 -0
  109. package/dist/components/ui/atoms/input.d.ts.map +1 -1
  110. package/dist/components/ui/atoms/input.js +113 -13
  111. package/dist/components/ui/atoms/label.d.ts +1 -2
  112. package/dist/components/ui/atoms/label.d.ts.map +1 -1
  113. package/dist/components/ui/atoms/label.js +18 -31
  114. package/dist/components/ui/atoms/markdown.js +1 -1
  115. package/dist/components/ui/atoms/mobile-tooltip.js +4 -3
  116. package/dist/components/ui/atoms/popover.d.ts +8 -6
  117. package/dist/components/ui/atoms/popover.d.ts.map +1 -1
  118. package/dist/components/ui/atoms/popover.js +617 -245
  119. package/dist/components/ui/atoms/pro-badge.js +1 -1
  120. package/dist/components/ui/atoms/progress.d.ts +7 -4
  121. package/dist/components/ui/atoms/progress.d.ts.map +1 -1
  122. package/dist/components/ui/atoms/progress.js +236 -92
  123. package/dist/components/ui/atoms/radio-group.d.ts +4 -4
  124. package/dist/components/ui/atoms/radio-group.d.ts.map +1 -1
  125. package/dist/components/ui/atoms/radio-group.js +355 -251
  126. package/dist/components/ui/atoms/resizable.d.ts +3 -4
  127. package/dist/components/ui/atoms/resizable.d.ts.map +1 -1
  128. package/dist/components/ui/atoms/resizable.js +25 -27
  129. package/dist/components/ui/atoms/scroll-area.d.ts +5 -5
  130. package/dist/components/ui/atoms/scroll-area.d.ts.map +1 -1
  131. package/dist/components/ui/atoms/scroll-area.js +611 -526
  132. package/dist/components/ui/atoms/scroll-button.d.ts.map +1 -1
  133. package/dist/components/ui/atoms/scroll-button.js +27 -22
  134. package/dist/components/ui/atoms/select.d.ts +11 -11
  135. package/dist/components/ui/atoms/select.d.ts.map +1 -1
  136. package/dist/components/ui/atoms/select.js +1525 -889
  137. package/dist/components/ui/atoms/separator.d.ts +2 -3
  138. package/dist/components/ui/atoms/separator.d.ts.map +1 -1
  139. package/dist/components/ui/atoms/separator.js +16 -35
  140. package/dist/components/ui/atoms/sheet.d.ts +9 -9
  141. package/dist/components/ui/atoms/sheet.d.ts.map +1 -1
  142. package/dist/components/ui/atoms/sheet.js +65 -64
  143. package/dist/components/ui/atoms/sidebar.d.ts +9 -15
  144. package/dist/components/ui/atoms/sidebar.d.ts.map +1 -1
  145. package/dist/components/ui/atoms/sidebar.js +288 -283
  146. package/dist/components/ui/atoms/skeleton.js +4 -4
  147. package/dist/components/ui/atoms/slider.d.ts +2 -3
  148. package/dist/components/ui/atoms/slider.d.ts.map +1 -1
  149. package/dist/components/ui/atoms/slider.js +886 -440
  150. package/dist/components/ui/atoms/switch.d.ts +4 -5
  151. package/dist/components/ui/atoms/switch.d.ts.map +1 -1
  152. package/dist/components/ui/atoms/switch.js +218 -151
  153. package/dist/components/ui/atoms/table.d.ts +2 -4
  154. package/dist/components/ui/atoms/table.d.ts.map +1 -1
  155. package/dist/components/ui/atoms/table.js +35 -36
  156. package/dist/components/ui/atoms/tabs.d.ts +11 -7
  157. package/dist/components/ui/atoms/tabs.d.ts.map +1 -1
  158. package/dist/components/ui/atoms/tabs.js +492 -186
  159. package/dist/components/ui/atoms/textarea.d.ts.map +1 -1
  160. package/dist/components/ui/atoms/textarea.js +7 -7
  161. package/dist/components/ui/atoms/toggle.d.ts +2 -3
  162. package/dist/components/ui/atoms/toggle.d.ts.map +1 -1
  163. package/dist/components/ui/atoms/toggle.js +92 -45
  164. package/dist/components/ui/atoms/tooltip.d.ts +6 -9
  165. package/dist/components/ui/atoms/tooltip.d.ts.map +1 -1
  166. package/dist/components/ui/atoms/tooltip.js +625 -343
  167. package/dist/components/ui/atoms/view-tools-control.js +16 -15
  168. package/dist/components/ui/atoms/virtualized-grid.d.ts +11 -4
  169. package/dist/components/ui/atoms/virtualized-grid.d.ts.map +1 -1
  170. package/dist/components/ui/atoms/virtualized-grid.js +365 -333
  171. package/dist/components/ui/index.js +665 -644
  172. package/dist/components/ui/molecules/chat-history-item.d.ts.map +1 -1
  173. package/dist/components/ui/molecules/chat-history-item.js +47 -40
  174. package/dist/components/ui/molecules/command-bar.js +1 -1
  175. package/dist/components/ui/molecules/confirm-popover.d.ts +2 -2
  176. package/dist/components/ui/molecules/confirm-popover.d.ts.map +1 -1
  177. package/dist/components/ui/molecules/confirm-popover.js +26 -24
  178. package/dist/components/ui/molecules/date-time-picker.d.ts.map +1 -1
  179. package/dist/components/ui/molecules/date-time-picker.js +17 -11
  180. package/dist/components/ui/molecules/index.js +1 -1
  181. package/dist/components/ui/molecules/message.d.ts +2 -3
  182. package/dist/components/ui/molecules/message.d.ts.map +1 -1
  183. package/dist/components/ui/molecules/message.js +10 -16
  184. package/dist/components/ui/molecules/prompt-input.d.ts +1 -1
  185. package/dist/components/ui/molecules/prompt-input.d.ts.map +1 -1
  186. package/dist/components/ui/molecules/prompt-input.js +21 -22
  187. package/dist/components/ui/molecules/requirement-badges.d.ts.map +1 -1
  188. package/dist/components/ui/molecules/requirement-badges.js +3 -3
  189. package/dist/components/ui/molecules/steps-progress.js +1 -0
  190. package/dist/components/ui/molecules/tool-call-accordion.js +1 -0
  191. package/dist/components/ui/molecules/tool-card.d.ts.map +1 -1
  192. package/dist/components/ui/molecules/tool-card.js +60 -47
  193. package/dist/components/ui/molecules/toolkit-card.d.ts.map +1 -1
  194. package/dist/components/ui/molecules/toolkit-card.js +1 -1
  195. package/dist/components/ui/molecules/user-nav.d.ts.map +1 -1
  196. package/dist/components/ui/molecules/user-nav.js +62 -57
  197. package/dist/components/ui/templates/auth-template.js +5 -5
  198. package/dist/composite-BASdnlNo.js +220 -0
  199. package/dist/composite-BSpUD7nI.js +66 -0
  200. package/dist/cpp-CA4iM_wM.js +18 -0
  201. package/dist/createBaseUIEventDetails-CqidROtw.js +55 -0
  202. package/dist/crystal-CRJyc4G-.js +4 -4
  203. package/dist/css-M7EaDHN_.js +6 -0
  204. package/dist/csv-B7yqA61e.js +6 -0
  205. package/dist/dark-plus-B4vfALTw.js +4 -0
  206. package/dist/detectBrowser-Dn2N72k1.js +42 -0
  207. package/dist/dracula-Cb59ZzY3.js +4 -0
  208. package/dist/dracula-soft-aaEmszbU.js +4 -0
  209. package/dist/edge-BYQkOzbF.js +1 -1
  210. package/dist/element-DSo91iOi.js +88 -0
  211. package/dist/elm-BtNbw_Cd.js +1 -1
  212. package/dist/erlang-DNcDT8Hi.js +1 -1
  213. package/dist/event-BCa0Un_3.js +30 -0
  214. package/dist/everforest-dark-CLp_21RJ.js +4 -0
  215. package/dist/everforest-light-CZ0NCAAv.js +4 -0
  216. package/dist/floating-ui.utils-48URp89E.js +126 -0
  217. package/dist/floating-ui.utils.dom-jr2suqy2.js +135 -0
  218. package/dist/fsharp-CYOiIVNx.js +1 -1
  219. package/dist/getDisabledMountTransitionStyles-fmnaQYVj.js +1539 -0
  220. package/dist/getPseudoElementBounds-B4_miSEJ.js +364 -0
  221. package/dist/git-rebase-ZWUFO_T4.js +1 -1
  222. package/dist/github-dark-BD3lImVS.js +4 -0
  223. package/dist/github-dark-default-ID_nBUwl.js +4 -0
  224. package/dist/github-dark-dimmed-Cw4rFgde.js +4 -0
  225. package/dist/github-dark-high-contrast-DSby9de8.js +4 -0
  226. package/dist/github-light-W396yAFe.js +4 -0
  227. package/dist/github-light-default-DCAQ2px1.js +4 -0
  228. package/dist/github-light-high-contrast-ChWJGEvx.js +4 -0
  229. package/dist/glimmer-js-DkxNrfPT.js +2 -2
  230. package/dist/glimmer-ts-D6YZEmK_.js +2 -2
  231. package/dist/glsl-CgdqkyFp.js +8 -0
  232. package/dist/graphql-Bv26LTzG.js +14 -0
  233. package/dist/gruvbox-dark-hard-BC1GRqFa.js +4 -0
  234. package/dist/gruvbox-dark-medium-COLy2cDY.js +4 -0
  235. package/dist/gruvbox-dark-soft-B8MALL4f.js +4 -0
  236. package/dist/gruvbox-light-hard-Bzxr_AnB.js +4 -0
  237. package/dist/gruvbox-light-medium-D2fqu3Kj.js +4 -0
  238. package/dist/gruvbox-light-soft-atzRH3-n.js +4 -0
  239. package/dist/hack-ItRNKiEb.js +1 -1
  240. package/dist/haml-B1t5q1Sv.js +10 -0
  241. package/dist/haml-NZLVzu_R.js +1 -1
  242. package/dist/handlebars-B2fb61mr.js +14 -0
  243. package/dist/handlebars-mxStpSE7.js +2 -2
  244. package/dist/highlighted-body-OFNGDK62-Df6AJMbs.js +20 -0
  245. package/dist/hooks/use-mobile.d.ts.map +1 -1
  246. package/dist/hooks/use-mobile.js +11 -12
  247. package/dist/horizon-PFtq58ZB.js +4 -0
  248. package/dist/horizon-bright-2WzHy-Vo.js +4 -0
  249. package/dist/houston-BEqUWhHr.js +4 -0
  250. package/dist/html-B50bmoVb.js +1 -1
  251. package/dist/html-CPZ3oZQ7.js +10 -0
  252. package/dist/html-derivative-B2qv7eyt.js +8 -0
  253. package/dist/http-BQ2t9cn1.js +14 -0
  254. package/dist/hurl-RyCMCa80.js +12 -0
  255. package/dist/imba-DpB-wtPB.js +6 -0
  256. package/dist/index-3rscXtm3.js +4708 -0
  257. package/dist/inertValue-kpZZDBEy.js +7 -0
  258. package/dist/integrations/rhf/index.js +6 -5
  259. package/dist/isElementDisabled-Cbd8W9kH.js +6 -0
  260. package/dist/java-CbphP4lz.js +6 -0
  261. package/dist/javascript-CgYd5l7W.js +6 -0
  262. package/dist/jinja-DFCUirAg.js +11 -0
  263. package/dist/jison-CTEI_s6O.js +8 -0
  264. package/dist/json-B5-prx4F.js +6 -0
  265. package/dist/json5-CZ8R1oUY.js +6 -0
  266. package/dist/jsonc-DMboCKBJ.js +6 -0
  267. package/dist/jsonl-YgIUi4Dg.js +6 -0
  268. package/dist/jsx-D4q4E1UD.js +6 -0
  269. package/dist/julia-2ubi2n9a.js +16 -0
  270. package/dist/just-CEK2SJ_k.js +4 -4
  271. package/dist/kanagawa-dragon-DuYaOBBk.js +4 -0
  272. package/dist/kanagawa-lotus-CyjAihYC.js +4 -0
  273. package/dist/kanagawa-wave-BVdXUMj5.js +4 -0
  274. package/dist/laserwave-B_2VVKNJ.js +4 -0
  275. package/dist/less-MoGo8xoS.js +6 -0
  276. package/dist/light-plus-IB4fPeJj.js +4 -0
  277. package/dist/liquid-CHzkx3jT.js +2 -2
  278. package/dist/lua-Bp3IRv7I.js +1 -1
  279. package/dist/main.js +691 -670
  280. package/dist/markdown-B-zRtm0x.js +6 -0
  281. package/dist/{markdown-D0xxRbwP.js → markdown-B71Eurda.js} +10329 -8108
  282. package/dist/marko-BlmC3dqW.js +14 -0
  283. package/dist/marko-CJBA24Ri.js +2 -2
  284. package/dist/material-theme-CjsSdYF2.js +4 -0
  285. package/dist/material-theme-darker-DEk0vgdS.js +4 -0
  286. package/dist/material-theme-lighter-DEVB_7K5.js +4 -0
  287. package/dist/material-theme-ocean-DK6jm24j.js +4 -0
  288. package/dist/material-theme-palenight-CNkXNpHv.js +4 -0
  289. package/dist/mdc-C9YSUwVC.js +2 -2
  290. package/dist/mdc-CLNk3q28.js +12 -0
  291. package/dist/mdx-CiUWpBB_.js +6 -0
  292. package/dist/mermaid-GHXKKRXX-BkplG-MI.js +5 -0
  293. package/dist/metadata/toolkit-icons.d.ts.map +1 -1
  294. package/dist/metadata/toolkit-icons.js +40 -38
  295. package/dist/metadata/toolkits.d.ts.map +1 -1
  296. package/dist/metadata/toolkits.js +13 -0
  297. package/dist/min-dark-CJcHUHwu.js +4 -0
  298. package/dist/min-light-BAN2UR75.js +4 -0
  299. package/dist/monokai-BbXwpjKl.js +4 -0
  300. package/dist/night-owl-csViJ7u4.js +4 -0
  301. package/dist/night-owl-light-BC-NuMC3.js +4 -0
  302. package/dist/nim-QAjRdh9w.js +5 -5
  303. package/dist/nord-B8Sq-VQ0.js +4 -0
  304. package/dist/one-dark-pro-DTdrcl-J.js +4 -0
  305. package/dist/one-light-kPHTChCU.js +4 -0
  306. package/dist/owner-rKN292Q9.js +6 -0
  307. package/dist/perl-DkVrgJBg.js +3 -3
  308. package/dist/php-BIzsF_5x.js +4 -4
  309. package/dist/php-Kn-vgdBD.js +18 -0
  310. package/dist/plastic-DDweBgVs.js +4 -0
  311. package/dist/poimandres-Dqvs16BQ.js +4 -0
  312. package/dist/popupStateMapping-BT9Y_jIq.js +1849 -0
  313. package/dist/postcss-CwL8bLZI.js +6 -0
  314. package/dist/pug-CTOOvSEH.js +12 -0
  315. package/dist/pug-XOw9Q1Ho.js +1 -1
  316. package/dist/python-jjYlTiSH.js +6 -0
  317. package/dist/qml-rTNXsquU.js +1 -1
  318. package/dist/r-C8zl4zMO.js +6 -0
  319. package/dist/react-resizable-panels-BqIpIFl2.js +2017 -0
  320. package/dist/red-DBDwQkX-.js +4 -0
  321. package/dist/regexp-Dpy_RgoJ.js +6 -0
  322. package/dist/resolveAriaLabelledBy-B5vw-szP.js +11 -0
  323. package/dist/rose-pine-DGHrTu7e.js +4 -0
  324. package/dist/rose-pine-dawn-DfRVdapG.js +4 -0
  325. package/dist/rose-pine-moon-DFpJm5Rd.js +4 -0
  326. package/dist/rst-DM32Wy3O.js +5 -5
  327. package/dist/ruby-BeqCs27h.js +8 -8
  328. package/dist/safePolygon-CJcmMc0u.js +389 -0
  329. package/dist/safeReact-DKq-628G.js +7 -0
  330. package/dist/sas-fpEvgATw.js +1 -1
  331. package/dist/sass-BmupNt-w.js +6 -0
  332. package/dist/scss-BZYVIVaN.js +8 -0
  333. package/dist/serializeValue-BebmSzW3.js +14 -0
  334. package/dist/shellscript-fMxXshxv.js +6 -0
  335. package/dist/shellsession-DiDJNQdy.js +1 -1
  336. package/dist/slack-dark-noeC6QPl.js +4 -0
  337. package/dist/slack-ochin-3_2idqLR.js +4 -0
  338. package/dist/snazzy-light-B9cV359v.js +4 -0
  339. package/dist/solarized-dark-B6X0ILWr.js +4 -0
  340. package/dist/solarized-light-LxOemn3c.js +4 -0
  341. package/dist/sql-D30Zid36.js +6 -0
  342. package/dist/stata-B8c5fTjX.js +1 -1
  343. package/dist/styles-DU5BO7fS.js +16 -0
  344. package/dist/stylus-BoBcEBjx.js +6 -0
  345. package/dist/surrealql-CQi7GQN7.js +1 -1
  346. package/dist/svelte-b9PAcyUe.js +14 -0
  347. package/dist/svelte-rYri41WT.js +3 -3
  348. package/dist/synthwave-84-DzQeMpV0.js +4 -0
  349. package/dist/templ-Crs9Ui8q.js +1 -1
  350. package/dist/tex-AHxmLTL0.js +1 -1
  351. package/dist/tokyo-night-CLM-V_Re.js +4 -0
  352. package/dist/{toolkit-card-CB1oiaei.js → toolkit-card-DhpOY80l.js} +56 -36
  353. package/dist/ts-tags-CP1b-4Z2.js +41 -0
  354. package/dist/ts-tags-ioVe2PKw.js +5 -5
  355. package/dist/tsx-QNpb2qLW.js +6 -0
  356. package/dist/twig-DwV2Fi4L.js +2 -2
  357. package/dist/typescript-AhniRyfZ.js +6 -0
  358. package/dist/useAnimationFrame-DIc6eFHa.js +69 -0
  359. package/dist/useAriaLabelledBy-VklrCmKp.js +34 -0
  360. package/dist/useBaseUiId-C8Dq0BQq.js +25 -0
  361. package/dist/useButton-JYPKQKj4.js +150 -0
  362. package/dist/useCollapsiblePanel-9pDlDh3R.js +257 -0
  363. package/dist/useCompositeItem-D00ALGkT.js +35 -0
  364. package/dist/useCompositeListItem-CYQrZg5-.js +74 -0
  365. package/dist/useControlled-Sx-_x7Sz.js +32 -0
  366. package/dist/useFocus-Aj9ShMQu.js +97 -0
  367. package/dist/useIsoLayoutEffect-DpJo20by.js +7 -0
  368. package/dist/useLabelableId-DF_d91GP.js +44 -0
  369. package/dist/useOnFirstRender-B4aruaIA.js +9 -0
  370. package/dist/useOnMount-JHtE6teb.js +9 -0
  371. package/dist/useOpenChangeComplete-DkeH9FGJ.js +130 -0
  372. package/dist/useRender-BNXBkp2o.js +7 -0
  373. package/dist/useRenderElement-DNB2vtF1.js +274 -0
  374. package/dist/useRole-N-RCRzo1.js +76 -0
  375. package/dist/useStableCallback-CudqoENs.js +33 -0
  376. package/dist/useSyncedFloatingRootContext-Bc90zSTy.js +185 -0
  377. package/dist/useTimeout-DAqPwigF.js +33 -0
  378. package/dist/useValueAsRef-LhoZc6As.js +20 -0
  379. package/dist/useValueChanged-Bissqjjn.js +15 -0
  380. package/dist/valueToPercent-BBgE4D3L.js +27 -0
  381. package/dist/vesper-BmV7KiQ0.js +4 -0
  382. package/dist/visuallyHidden-PuyyGHVF.js +22 -0
  383. package/dist/vitesse-black-CxZz3C4s.js +4 -0
  384. package/dist/vitesse-dark-DVUJ0sy2.js +4 -0
  385. package/dist/vitesse-light-BDJohtUr.js +4 -0
  386. package/dist/vue-CY6W2ID0.js +31 -0
  387. package/dist/vue-DXEmyXn9.js +3 -3
  388. package/dist/vue-html-DYXHAJ2G.js +8 -0
  389. package/dist/vue-vine-D41-N99t.js +4 -4
  390. package/dist/vue-vine-DiWTpMwZ.js +18 -0
  391. package/dist/wasm-3y0A1Y71.js +6 -0
  392. package/dist/wasm-Dm9SFfrx.js +7 -0
  393. package/dist/web-BbvN_Lei.js +2846 -0
  394. package/dist/wgsl-SXl3EZUN.js +6 -0
  395. package/dist/wit-Cw0CTVY0.js +6 -0
  396. package/dist/xml-CNXGTZ6Z.js +8 -0
  397. package/dist/xsl-BmSZphgC.js +1 -1
  398. package/dist/yaml-DZqZ2PBD.js +6 -0
  399. package/package.json +37 -34
  400. package/dist/highlighted-body-TPN3WLV5-D6UnKGod.js +0 -19
  401. package/dist/index-0ioNhtNM.js +0 -10
  402. package/dist/index-437EL2iq.js +0 -52
  403. package/dist/index-B695uy69.js +0 -9
  404. package/dist/index-BEZCAdXQ.js +0 -1568
  405. package/dist/index-BGQepRFJ.js +0 -27
  406. package/dist/index-BZPx6jYI.js +0 -8
  407. package/dist/index-BaLuVb4t.js +0 -70
  408. package/dist/index-Bw62B28F.js +0 -31
  409. package/dist/index-By-GFSsC.js +0 -245
  410. package/dist/index-ByaXH_ih.js +0 -10
  411. package/dist/index-CCKe-Mpx.js +0 -6
  412. package/dist/index-Cv867SGx.js +0 -13
  413. package/dist/index-CvA4FcaC.js +0 -677
  414. package/dist/index-D2LZVjSn.js +0 -82
  415. package/dist/index-DFZozV_h.js +0 -68
  416. package/dist/index-DJQkmo5O.js +0 -49
  417. package/dist/index-DLohNuco.js +0 -36
  418. package/dist/index-DrFfdHac.js +0 -144
  419. package/dist/index-DrlYGDRT.js +0 -119
  420. package/dist/index-Dz8CQngS.js +0 -181
  421. package/dist/index-cd1ceFJg.js +0 -6973
  422. package/dist/index-rKs9bXHr.js +0 -6
  423. package/dist/mermaid-O7DHMXV3-gUrB-Xs1.js +0 -4
  424. package/dist/react-resizable-panels.browser-DYl0LXfw.js +0 -1510
  425. package/dist/web-BwFNdl01.js +0 -697
@@ -1,1510 +0,0 @@
1
- import * as Pn from "react";
2
- import { createContext as wn, forwardRef as Qe, createElement as de, useContext as en, useRef as F, useImperativeHandle as nn, useState as ue, useEffect as te, useCallback as B, useMemo as En, useLayoutEffect as In } from "react";
3
- const Ce = wn(null);
4
- Ce.displayName = "PanelGroupContext";
5
- const A = {
6
- group: "data-panel-group",
7
- groupDirection: "data-panel-group-direction",
8
- groupId: "data-panel-group-id",
9
- panel: "data-panel",
10
- panelCollapsible: "data-panel-collapsible",
11
- panelId: "data-panel-id",
12
- panelSize: "data-panel-size",
13
- resizeHandle: "data-resize-handle",
14
- resizeHandleActive: "data-resize-handle-active",
15
- resizeHandleEnabled: "data-panel-resize-handle-enabled",
16
- resizeHandleId: "data-panel-resize-handle-id",
17
- resizeHandleState: "data-resize-handle-state"
18
- }, Be = 10, re = In, Ve = Pn.useId, Cn = typeof Ve == "function" ? Ve : () => null;
19
- let Rn = 0;
20
- function Fe(e = null) {
21
- const n = Cn(), t = F(e || n || null);
22
- return t.current === null && (t.current = "" + Rn++), e ?? t.current;
23
- }
24
- function tn({
25
- children: e,
26
- className: n = "",
27
- collapsedSize: t,
28
- collapsible: r,
29
- defaultSize: i,
30
- forwardedRef: o,
31
- id: l,
32
- maxSize: s,
33
- minSize: a,
34
- onCollapse: m,
35
- onExpand: P,
36
- onResize: f,
37
- order: u,
38
- style: x,
39
- tagName: h = "div",
40
- ...E
41
- }) {
42
- const w = en(Ce);
43
- if (w === null)
44
- throw Error("Panel components must be rendered within a PanelGroup container");
45
- const {
46
- collapsePanel: S,
47
- expandPanel: R,
48
- getPanelSize: M,
49
- getPanelStyle: $,
50
- groupId: q,
51
- isPanelCollapsed: C,
52
- reevaluatePanelConstraints: b,
53
- registerPanel: U,
54
- resizePanel: J,
55
- unregisterPanel: W
56
- } = w, _ = Fe(l), D = F({
57
- callbacks: {
58
- onCollapse: m,
59
- onExpand: P,
60
- onResize: f
61
- },
62
- constraints: {
63
- collapsedSize: t,
64
- collapsible: r,
65
- defaultSize: i,
66
- maxSize: s,
67
- minSize: a
68
- },
69
- id: _,
70
- idIsFromProps: l !== void 0,
71
- order: u
72
- });
73
- F({
74
- didLogMissingDefaultSizeWarning: !1
75
- }), re(() => {
76
- const {
77
- callbacks: k,
78
- constraints: N
79
- } = D.current, G = {
80
- ...N
81
- };
82
- D.current.id = _, D.current.idIsFromProps = l !== void 0, D.current.order = u, k.onCollapse = m, k.onExpand = P, k.onResize = f, N.collapsedSize = t, N.collapsible = r, N.defaultSize = i, N.maxSize = s, N.minSize = a, (G.collapsedSize !== N.collapsedSize || G.collapsible !== N.collapsible || G.maxSize !== N.maxSize || G.minSize !== N.minSize) && b(D.current, G);
83
- }), re(() => {
84
- const k = D.current;
85
- return U(k), () => {
86
- W(k);
87
- };
88
- }, [u, _, U, W]), nn(o, () => ({
89
- collapse: () => {
90
- S(D.current);
91
- },
92
- expand: (k) => {
93
- R(D.current, k);
94
- },
95
- getId() {
96
- return _;
97
- },
98
- getSize() {
99
- return M(D.current);
100
- },
101
- isCollapsed() {
102
- return C(D.current);
103
- },
104
- isExpanded() {
105
- return !C(D.current);
106
- },
107
- resize: (k) => {
108
- J(D.current, k);
109
- }
110
- }), [S, R, M, C, _, J]);
111
- const ee = $(D.current, i);
112
- return de(h, {
113
- ...E,
114
- children: e,
115
- className: n,
116
- id: _,
117
- style: {
118
- ...ee,
119
- ...x
120
- },
121
- // CSS selectors
122
- [A.groupId]: q,
123
- [A.panel]: "",
124
- [A.panelCollapsible]: r || void 0,
125
- [A.panelId]: _,
126
- [A.panelSize]: parseFloat("" + ee.flexGrow).toFixed(1)
127
- });
128
- }
129
- const Ln = Qe((e, n) => de(tn, {
130
- ...e,
131
- forwardedRef: n
132
- }));
133
- tn.displayName = "Panel";
134
- Ln.displayName = "forwardRef(Panel)";
135
- let Te = null, we = -1, Z = null;
136
- function An(e, n, t) {
137
- const r = (n & an) !== 0, i = (n & un) !== 0, o = (n & cn) !== 0, l = (n & dn) !== 0;
138
- if (n) {
139
- if (r)
140
- return o ? "se-resize" : l ? "ne-resize" : "e-resize";
141
- if (i)
142
- return o ? "sw-resize" : l ? "nw-resize" : "w-resize";
143
- if (o)
144
- return "s-resize";
145
- if (l)
146
- return "n-resize";
147
- }
148
- switch (e) {
149
- case "horizontal":
150
- return "ew-resize";
151
- case "intersection":
152
- return "move";
153
- case "vertical":
154
- return "ns-resize";
155
- }
156
- }
157
- function Dn() {
158
- Z !== null && (document.head.removeChild(Z), Te = null, Z = null, we = -1);
159
- }
160
- function $e(e, n, t) {
161
- var r, i;
162
- const o = An(e, n);
163
- if (Te !== o) {
164
- if (Te = o, Z === null && (Z = document.createElement("style"), document.head.appendChild(Z)), we >= 0) {
165
- var l;
166
- (l = Z.sheet) === null || l === void 0 || l.removeRule(we);
167
- }
168
- we = (r = (i = Z.sheet) === null || i === void 0 ? void 0 : i.insertRule(`*{cursor: ${o} !important;}`)) !== null && r !== void 0 ? r : -1;
169
- }
170
- }
171
- function rn(e) {
172
- return e.type === "keydown";
173
- }
174
- function on(e) {
175
- return e.type.startsWith("pointer");
176
- }
177
- function ln(e) {
178
- return e.type.startsWith("mouse");
179
- }
180
- function Re(e) {
181
- if (on(e)) {
182
- if (e.isPrimary)
183
- return {
184
- x: e.clientX,
185
- y: e.clientY
186
- };
187
- } else if (ln(e))
188
- return {
189
- x: e.clientX,
190
- y: e.clientY
191
- };
192
- return {
193
- x: 1 / 0,
194
- y: 1 / 0
195
- };
196
- }
197
- function Mn() {
198
- if (typeof matchMedia == "function")
199
- return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
200
- }
201
- function Hn(e, n, t) {
202
- return e.x < n.x + n.width && e.x + e.width > n.x && e.y < n.y + n.height && e.y + e.height > n.y;
203
- }
204
- function $n(e, n) {
205
- if (e === n) throw new Error("Cannot compare node with itself");
206
- const t = {
207
- a: Xe(e),
208
- b: Xe(n)
209
- };
210
- let r;
211
- for (; t.a.at(-1) === t.b.at(-1); )
212
- e = t.a.pop(), n = t.b.pop(), r = e;
213
- y(r, "Stacking order can only be calculated for elements with a common ancestor");
214
- const i = {
215
- a: qe(Oe(t.a)),
216
- b: qe(Oe(t.b))
217
- };
218
- if (i.a === i.b) {
219
- const o = r.childNodes, l = {
220
- a: t.a.at(-1),
221
- b: t.b.at(-1)
222
- };
223
- let s = o.length;
224
- for (; s--; ) {
225
- const a = o[s];
226
- if (a === l.a) return 1;
227
- if (a === l.b) return -1;
228
- }
229
- }
230
- return Math.sign(i.a - i.b);
231
- }
232
- const Nn = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
233
- function kn(e) {
234
- var n;
235
- const t = getComputedStyle((n = sn(e)) !== null && n !== void 0 ? n : e).display;
236
- return t === "flex" || t === "inline-flex";
237
- }
238
- function _n(e) {
239
- const n = getComputedStyle(e);
240
- return !!(n.position === "fixed" || n.zIndex !== "auto" && (n.position !== "static" || kn(e)) || +n.opacity < 1 || "transform" in n && n.transform !== "none" || "webkitTransform" in n && n.webkitTransform !== "none" || "mixBlendMode" in n && n.mixBlendMode !== "normal" || "filter" in n && n.filter !== "none" || "webkitFilter" in n && n.webkitFilter !== "none" || "isolation" in n && n.isolation === "isolate" || Nn.test(n.willChange) || n.webkitOverflowScrolling === "touch");
241
- }
242
- function Oe(e) {
243
- let n = e.length;
244
- for (; n--; ) {
245
- const t = e[n];
246
- if (y(t, "Missing node"), _n(t)) return t;
247
- }
248
- return null;
249
- }
250
- function qe(e) {
251
- return e && Number(getComputedStyle(e).zIndex) || 0;
252
- }
253
- function Xe(e) {
254
- const n = [];
255
- for (; e; )
256
- n.push(e), e = sn(e);
257
- return n;
258
- }
259
- function sn(e) {
260
- const {
261
- parentNode: n
262
- } = e;
263
- return n && n instanceof ShadowRoot ? n.host : n;
264
- }
265
- const an = 1, un = 2, cn = 4, dn = 8, Gn = Mn() === "coarse";
266
- let O = [], ce = !1, Q = /* @__PURE__ */ new Map(), Le = /* @__PURE__ */ new Map();
267
- const ve = /* @__PURE__ */ new Set();
268
- function Tn(e, n, t, r, i) {
269
- var o;
270
- const {
271
- ownerDocument: l
272
- } = n, s = {
273
- direction: t,
274
- element: n,
275
- hitAreaMargins: r,
276
- setResizeHandlerState: i
277
- }, a = (o = Q.get(l)) !== null && o !== void 0 ? o : 0;
278
- return Q.set(l, a + 1), ve.add(s), Ee(), function() {
279
- var P;
280
- Le.delete(e), ve.delete(s);
281
- const f = (P = Q.get(l)) !== null && P !== void 0 ? P : 1;
282
- if (Q.set(l, f - 1), Ee(), f === 1 && Q.delete(l), O.includes(s)) {
283
- const u = O.indexOf(s);
284
- u >= 0 && O.splice(u, 1), Ae(), i("up", !0, null);
285
- }
286
- };
287
- }
288
- function Bn(e) {
289
- const {
290
- target: n
291
- } = e, {
292
- x: t,
293
- y: r
294
- } = Re(e);
295
- ce = !0, We({
296
- target: n,
297
- x: t,
298
- y: r
299
- }), Ee(), O.length > 0 && (Ie("down", e), Ae(), e.preventDefault(), fn(n) || e.stopImmediatePropagation());
300
- }
301
- function Ne(e) {
302
- const {
303
- x: n,
304
- y: t
305
- } = Re(e);
306
- if (ce && // Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
307
- e.type !== "pointerleave" && e.buttons === 0 && (ce = !1, Ie("up", e)), !ce) {
308
- const {
309
- target: r
310
- } = e;
311
- We({
312
- target: r,
313
- x: n,
314
- y: t
315
- });
316
- }
317
- Ie("move", e), Ae(), O.length > 0 && e.preventDefault();
318
- }
319
- function ke(e) {
320
- const {
321
- target: n
322
- } = e, {
323
- x: t,
324
- y: r
325
- } = Re(e);
326
- Le.clear(), ce = !1, O.length > 0 && (e.preventDefault(), fn(n) || e.stopImmediatePropagation()), Ie("up", e), We({
327
- target: n,
328
- x: t,
329
- y: r
330
- }), Ae(), Ee();
331
- }
332
- function fn(e) {
333
- let n = e;
334
- for (; n; ) {
335
- if (n.hasAttribute(A.resizeHandle))
336
- return !0;
337
- n = n.parentElement;
338
- }
339
- return !1;
340
- }
341
- function We({
342
- target: e,
343
- x: n,
344
- y: t
345
- }) {
346
- O.splice(0);
347
- let r = null;
348
- (e instanceof HTMLElement || e instanceof SVGElement) && (r = e), ve.forEach((i) => {
349
- const {
350
- element: o,
351
- hitAreaMargins: l
352
- } = i, s = o.getBoundingClientRect(), {
353
- bottom: a,
354
- left: m,
355
- right: P,
356
- top: f
357
- } = s, u = Gn ? l.coarse : l.fine;
358
- if (n >= m - u && n <= P + u && t >= f - u && t <= a + u) {
359
- if (r !== null && document.contains(r) && o !== r && !o.contains(r) && !r.contains(o) && // Calculating stacking order has a cost, so we should avoid it if possible
360
- // That is why we only check potentially intersecting handles,
361
- // and why we skip if the event target is within the handle's DOM
362
- $n(r, o) > 0) {
363
- let h = r, E = !1;
364
- for (; h && !h.contains(o); ) {
365
- if (Hn(h.getBoundingClientRect(), s)) {
366
- E = !0;
367
- break;
368
- }
369
- h = h.parentElement;
370
- }
371
- if (E)
372
- return;
373
- }
374
- O.push(i);
375
- }
376
- });
377
- }
378
- function _e(e, n) {
379
- Le.set(e, n);
380
- }
381
- function Ae() {
382
- let e = !1, n = !1;
383
- O.forEach((r) => {
384
- const {
385
- direction: i
386
- } = r;
387
- i === "horizontal" ? e = !0 : n = !0;
388
- });
389
- let t = 0;
390
- Le.forEach((r) => {
391
- t |= r;
392
- }), e && n ? $e("intersection", t) : e ? $e("horizontal", t) : n ? $e("vertical", t) : Dn();
393
- }
394
- let Ge;
395
- function Ee() {
396
- var e;
397
- (e = Ge) === null || e === void 0 || e.abort(), Ge = new AbortController();
398
- const n = {
399
- capture: !0,
400
- signal: Ge.signal
401
- };
402
- ve.size && (ce ? (O.length > 0 && Q.forEach((t, r) => {
403
- const {
404
- body: i
405
- } = r;
406
- t > 0 && (i.addEventListener("contextmenu", ke, n), i.addEventListener("pointerleave", Ne, n), i.addEventListener("pointermove", Ne, n));
407
- }), Q.forEach((t, r) => {
408
- const {
409
- body: i
410
- } = r;
411
- i.addEventListener("pointerup", ke, n), i.addEventListener("pointercancel", ke, n);
412
- })) : Q.forEach((t, r) => {
413
- const {
414
- body: i
415
- } = r;
416
- t > 0 && (i.addEventListener("pointerdown", Bn, n), i.addEventListener("pointermove", Ne, n));
417
- }));
418
- }
419
- function Ie(e, n) {
420
- ve.forEach((t) => {
421
- const {
422
- setResizeHandlerState: r
423
- } = t, i = O.includes(t);
424
- r(e, i, n);
425
- });
426
- }
427
- function Fn() {
428
- const [e, n] = ue(0);
429
- return B(() => n((t) => t + 1), []);
430
- }
431
- function y(e, n) {
432
- if (!e)
433
- throw console.error(n), Error(n);
434
- }
435
- function oe(e, n, t = Be) {
436
- return e.toFixed(t) === n.toFixed(t) ? 0 : e > n ? 1 : -1;
437
- }
438
- function Y(e, n, t = Be) {
439
- return oe(e, n, t) === 0;
440
- }
441
- function K(e, n, t) {
442
- return oe(e, n, t) === 0;
443
- }
444
- function Wn(e, n, t) {
445
- if (e.length !== n.length)
446
- return !1;
447
- for (let r = 0; r < e.length; r++) {
448
- const i = e[r], o = n[r];
449
- if (!K(i, o, t))
450
- return !1;
451
- }
452
- return !0;
453
- }
454
- function ae({
455
- panelConstraints: e,
456
- panelIndex: n,
457
- size: t
458
- }) {
459
- const r = e[n];
460
- y(r != null, `Panel constraints not found for index ${n}`);
461
- let {
462
- collapsedSize: i = 0,
463
- collapsible: o,
464
- maxSize: l = 100,
465
- minSize: s = 0
466
- } = r;
467
- if (oe(t, s) < 0)
468
- if (o) {
469
- const a = (i + s) / 2;
470
- oe(t, a) < 0 ? t = i : t = s;
471
- } else
472
- t = s;
473
- return t = Math.min(l, t), t = parseFloat(t.toFixed(Be)), t;
474
- }
475
- function ye({
476
- delta: e,
477
- initialLayout: n,
478
- panelConstraints: t,
479
- pivotIndices: r,
480
- prevLayout: i,
481
- trigger: o
482
- }) {
483
- if (K(e, 0))
484
- return n;
485
- const l = [...n], [s, a] = r;
486
- y(s != null, "Invalid first pivot index"), y(a != null, "Invalid second pivot index");
487
- let m = 0;
488
- if (o === "keyboard") {
489
- {
490
- const f = e < 0 ? a : s, u = t[f];
491
- y(u, `Panel constraints not found for index ${f}`);
492
- const {
493
- collapsedSize: x = 0,
494
- collapsible: h,
495
- minSize: E = 0
496
- } = u;
497
- if (h) {
498
- const w = n[f];
499
- if (y(w != null, `Previous layout not found for panel index ${f}`), K(w, x)) {
500
- const S = E - w;
501
- oe(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
502
- }
503
- }
504
- }
505
- {
506
- const f = e < 0 ? s : a, u = t[f];
507
- y(u, `No panel constraints found for index ${f}`);
508
- const {
509
- collapsedSize: x = 0,
510
- collapsible: h,
511
- minSize: E = 0
512
- } = u;
513
- if (h) {
514
- const w = n[f];
515
- if (y(w != null, `Previous layout not found for panel index ${f}`), K(w, E)) {
516
- const S = w - x;
517
- oe(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
518
- }
519
- }
520
- }
521
- }
522
- {
523
- const f = e < 0 ? 1 : -1;
524
- let u = e < 0 ? a : s, x = 0;
525
- for (; ; ) {
526
- const E = n[u];
527
- y(E != null, `Previous layout not found for panel index ${u}`);
528
- const S = ae({
529
- panelConstraints: t,
530
- panelIndex: u,
531
- size: 100
532
- }) - E;
533
- if (x += S, u += f, u < 0 || u >= t.length)
534
- break;
535
- }
536
- const h = Math.min(Math.abs(e), Math.abs(x));
537
- e = e < 0 ? 0 - h : h;
538
- }
539
- {
540
- let u = e < 0 ? s : a;
541
- for (; u >= 0 && u < t.length; ) {
542
- const x = Math.abs(e) - Math.abs(m), h = n[u];
543
- y(h != null, `Previous layout not found for panel index ${u}`);
544
- const E = h - x, w = ae({
545
- panelConstraints: t,
546
- panelIndex: u,
547
- size: E
548
- });
549
- if (!K(h, w) && (m += h - w, l[u] = w, m.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
550
- numeric: !0
551
- }) >= 0))
552
- break;
553
- e < 0 ? u-- : u++;
554
- }
555
- }
556
- if (Wn(i, l))
557
- return i;
558
- {
559
- const f = e < 0 ? a : s, u = n[f];
560
- y(u != null, `Previous layout not found for panel index ${f}`);
561
- const x = u + m, h = ae({
562
- panelConstraints: t,
563
- panelIndex: f,
564
- size: x
565
- });
566
- if (l[f] = h, !K(h, x)) {
567
- let E = x - h, S = e < 0 ? a : s;
568
- for (; S >= 0 && S < t.length; ) {
569
- const R = l[S];
570
- y(R != null, `Previous layout not found for panel index ${S}`);
571
- const M = R + E, $ = ae({
572
- panelConstraints: t,
573
- panelIndex: S,
574
- size: M
575
- });
576
- if (K(R, $) || (E -= $ - R, l[S] = $), K(E, 0))
577
- break;
578
- e > 0 ? S-- : S++;
579
- }
580
- }
581
- }
582
- const P = l.reduce((f, u) => u + f, 0);
583
- return K(P, 100) ? l : i;
584
- }
585
- function Kn({
586
- layout: e,
587
- panelsArray: n,
588
- pivotIndices: t
589
- }) {
590
- let r = 0, i = 100, o = 0, l = 0;
591
- const s = t[0];
592
- y(s != null, "No pivot index found"), n.forEach((f, u) => {
593
- const {
594
- constraints: x
595
- } = f, {
596
- maxSize: h = 100,
597
- minSize: E = 0
598
- } = x;
599
- u === s ? (r = E, i = h) : (o += E, l += h);
600
- });
601
- const a = Math.min(i, 100 - o), m = Math.max(r, 100 - l), P = e[s];
602
- return {
603
- valueMax: a,
604
- valueMin: m,
605
- valueNow: P
606
- };
607
- }
608
- function Se(e, n = document) {
609
- return Array.from(n.querySelectorAll(`[${A.resizeHandleId}][data-panel-group-id="${e}"]`));
610
- }
611
- function pn(e, n, t = document) {
612
- const i = Se(e, t).findIndex((o) => o.getAttribute(A.resizeHandleId) === n);
613
- return i ?? null;
614
- }
615
- function gn(e, n, t) {
616
- const r = pn(e, n, t);
617
- return r != null ? [r, r + 1] : [-1, -1];
618
- }
619
- function Un(e) {
620
- return e instanceof HTMLElement ? !0 : typeof e == "object" && e !== null && "tagName" in e && "getAttribute" in e;
621
- }
622
- function mn(e, n = document) {
623
- if (Un(n) && n.dataset.panelGroupId == e)
624
- return n;
625
- const t = n.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);
626
- return t || null;
627
- }
628
- function De(e, n = document) {
629
- const t = n.querySelector(`[${A.resizeHandleId}="${e}"]`);
630
- return t || null;
631
- }
632
- function Vn(e, n, t, r = document) {
633
- var i, o, l, s;
634
- const a = De(n, r), m = Se(e, r), P = a ? m.indexOf(a) : -1, f = (i = (o = t[P]) === null || o === void 0 ? void 0 : o.id) !== null && i !== void 0 ? i : null, u = (l = (s = t[P + 1]) === null || s === void 0 ? void 0 : s.id) !== null && l !== void 0 ? l : null;
635
- return [f, u];
636
- }
637
- function On({
638
- committedValuesRef: e,
639
- eagerValuesRef: n,
640
- groupId: t,
641
- layout: r,
642
- panelDataArray: i,
643
- panelGroupElement: o,
644
- setLayout: l
645
- }) {
646
- F({
647
- didWarnAboutMissingResizeHandle: !1
648
- }), re(() => {
649
- if (!o)
650
- return;
651
- const s = Se(t, o);
652
- for (let a = 0; a < i.length - 1; a++) {
653
- const {
654
- valueMax: m,
655
- valueMin: P,
656
- valueNow: f
657
- } = Kn({
658
- layout: r,
659
- panelsArray: i,
660
- pivotIndices: [a, a + 1]
661
- }), u = s[a];
662
- if (u != null) {
663
- const x = i[a];
664
- y(x, `No panel data found for index "${a}"`), u.setAttribute("aria-controls", x.id), u.setAttribute("aria-valuemax", "" + Math.round(m)), u.setAttribute("aria-valuemin", "" + Math.round(P)), u.setAttribute("aria-valuenow", f != null ? "" + Math.round(f) : "");
665
- }
666
- }
667
- return () => {
668
- s.forEach((a, m) => {
669
- a.removeAttribute("aria-controls"), a.removeAttribute("aria-valuemax"), a.removeAttribute("aria-valuemin"), a.removeAttribute("aria-valuenow");
670
- });
671
- };
672
- }, [t, r, i, o]), te(() => {
673
- if (!o)
674
- return;
675
- const s = n.current;
676
- y(s, "Eager values not found");
677
- const {
678
- panelDataArray: a
679
- } = s, m = mn(t, o);
680
- y(m != null, `No group found for id "${t}"`);
681
- const P = Se(t, o);
682
- y(P, `No resize handles found for group id "${t}"`);
683
- const f = P.map((u) => {
684
- const x = u.getAttribute(A.resizeHandleId);
685
- y(x, "Resize handle element has no handle id attribute");
686
- const [h, E] = Vn(t, x, a, o);
687
- if (h == null || E == null)
688
- return () => {
689
- };
690
- const w = (S) => {
691
- if (!S.defaultPrevented)
692
- switch (S.key) {
693
- case "Enter": {
694
- S.preventDefault();
695
- const R = a.findIndex((M) => M.id === h);
696
- if (R >= 0) {
697
- const M = a[R];
698
- y(M, `No panel data found for index ${R}`);
699
- const $ = r[R], {
700
- collapsedSize: q = 0,
701
- collapsible: C,
702
- minSize: b = 0
703
- } = M.constraints;
704
- if ($ != null && C) {
705
- const U = ye({
706
- delta: K($, q) ? b - q : q - $,
707
- initialLayout: r,
708
- panelConstraints: a.map((J) => J.constraints),
709
- pivotIndices: gn(t, x, o),
710
- prevLayout: r,
711
- trigger: "keyboard"
712
- });
713
- r !== U && l(U);
714
- }
715
- }
716
- break;
717
- }
718
- }
719
- };
720
- return u.addEventListener("keydown", w), () => {
721
- u.removeEventListener("keydown", w);
722
- };
723
- });
724
- return () => {
725
- f.forEach((u) => u());
726
- };
727
- }, [o, e, n, t, r, i, l]);
728
- }
729
- function je(e, n) {
730
- if (e.length !== n.length)
731
- return !1;
732
- for (let t = 0; t < e.length; t++)
733
- if (e[t] !== n[t])
734
- return !1;
735
- return !0;
736
- }
737
- function hn(e, n) {
738
- const t = e === "horizontal", {
739
- x: r,
740
- y: i
741
- } = Re(n);
742
- return t ? r : i;
743
- }
744
- function qn(e, n, t, r, i) {
745
- const o = t === "horizontal", l = De(n, i);
746
- y(l, `No resize handle element found for id "${n}"`);
747
- const s = l.getAttribute(A.groupId);
748
- y(s, "Resize handle element has no group id attribute");
749
- let {
750
- initialCursorPosition: a
751
- } = r;
752
- const m = hn(t, e), P = mn(s, i);
753
- y(P, `No group element found for id "${s}"`);
754
- const f = P.getBoundingClientRect(), u = o ? f.width : f.height;
755
- return (m - a) / u * 100;
756
- }
757
- function Xn(e, n, t, r, i, o) {
758
- if (rn(e)) {
759
- const l = t === "horizontal";
760
- let s = 0;
761
- e.shiftKey ? s = 100 : i != null ? s = i : s = 10;
762
- let a = 0;
763
- switch (e.key) {
764
- case "ArrowDown":
765
- a = l ? 0 : s;
766
- break;
767
- case "ArrowLeft":
768
- a = l ? -s : 0;
769
- break;
770
- case "ArrowRight":
771
- a = l ? s : 0;
772
- break;
773
- case "ArrowUp":
774
- a = l ? 0 : -s;
775
- break;
776
- case "End":
777
- a = 100;
778
- break;
779
- case "Home":
780
- a = -100;
781
- break;
782
- }
783
- return a;
784
- } else
785
- return r == null ? 0 : qn(e, n, t, r, o);
786
- }
787
- function jn({
788
- panelDataArray: e
789
- }) {
790
- const n = Array(e.length), t = e.map((o) => o.constraints);
791
- let r = 0, i = 100;
792
- for (let o = 0; o < e.length; o++) {
793
- const l = t[o];
794
- y(l, `Panel constraints not found for index ${o}`);
795
- const {
796
- defaultSize: s
797
- } = l;
798
- s != null && (r++, n[o] = s, i -= s);
799
- }
800
- for (let o = 0; o < e.length; o++) {
801
- const l = t[o];
802
- y(l, `Panel constraints not found for index ${o}`);
803
- const {
804
- defaultSize: s
805
- } = l;
806
- if (s != null)
807
- continue;
808
- const a = e.length - r, m = i / a;
809
- r++, n[o] = m, i -= m;
810
- }
811
- return n;
812
- }
813
- function le(e, n, t) {
814
- n.forEach((r, i) => {
815
- const o = e[i];
816
- y(o, `Panel data not found for index ${i}`);
817
- const {
818
- callbacks: l,
819
- constraints: s,
820
- id: a
821
- } = o, {
822
- collapsedSize: m = 0,
823
- collapsible: P
824
- } = s, f = t[a];
825
- if (f == null || r !== f) {
826
- t[a] = r;
827
- const {
828
- onCollapse: u,
829
- onExpand: x,
830
- onResize: h
831
- } = l;
832
- h && h(r, f), P && (u || x) && (x && (f == null || Y(f, m)) && !Y(r, m) && x(), u && (f == null || !Y(f, m)) && Y(r, m) && u());
833
- }
834
- });
835
- }
836
- function Pe(e, n) {
837
- if (e.length !== n.length)
838
- return !1;
839
- for (let t = 0; t < e.length; t++)
840
- if (e[t] != n[t])
841
- return !1;
842
- return !0;
843
- }
844
- function Jn({
845
- defaultSize: e,
846
- dragState: n,
847
- layout: t,
848
- panelData: r,
849
- panelIndex: i,
850
- precision: o = 3
851
- }) {
852
- const l = t[i];
853
- let s;
854
- return l == null ? s = e != null ? e.toFixed(o) : "1" : r.length === 1 ? s = "1" : s = l.toFixed(o), {
855
- flexBasis: 0,
856
- flexGrow: s,
857
- flexShrink: 1,
858
- // Without this, Panel sizes may be unintentionally overridden by their content
859
- overflow: "hidden",
860
- // Disable pointer events inside of a panel during resize
861
- // This avoid edge cases like nested iframes
862
- pointerEvents: n !== null ? "none" : void 0
863
- };
864
- }
865
- function Yn(e, n = 10) {
866
- let t = null;
867
- return (...i) => {
868
- t !== null && clearTimeout(t), t = setTimeout(() => {
869
- e(...i);
870
- }, n);
871
- };
872
- }
873
- function Je(e) {
874
- try {
875
- if (typeof localStorage < "u")
876
- e.getItem = (n) => localStorage.getItem(n), e.setItem = (n, t) => {
877
- localStorage.setItem(n, t);
878
- };
879
- else
880
- throw new Error("localStorage not supported in this environment");
881
- } catch (n) {
882
- console.error(n), e.getItem = () => null, e.setItem = () => {
883
- };
884
- }
885
- }
886
- function zn(e) {
887
- return `react-resizable-panels:${e}`;
888
- }
889
- function yn(e) {
890
- return e.map((n) => {
891
- const {
892
- constraints: t,
893
- id: r,
894
- idIsFromProps: i,
895
- order: o
896
- } = n;
897
- return i ? r : o ? `${o}:${JSON.stringify(t)}` : JSON.stringify(t);
898
- }).sort((n, t) => n.localeCompare(t)).join(",");
899
- }
900
- function xn(e, n) {
901
- try {
902
- const t = zn(e), r = n.getItem(t);
903
- if (r) {
904
- const i = JSON.parse(r);
905
- if (typeof i == "object" && i != null)
906
- return i;
907
- }
908
- } catch {
909
- }
910
- return null;
911
- }
912
- function Zn(e, n, t) {
913
- var r, i;
914
- const o = (r = xn(e, t)) !== null && r !== void 0 ? r : {}, l = yn(n);
915
- return (i = o[l]) !== null && i !== void 0 ? i : null;
916
- }
917
- function Qn(e, n, t, r, i) {
918
- var o;
919
- const l = zn(e), s = yn(n), a = (o = xn(e, i)) !== null && o !== void 0 ? o : {};
920
- a[s] = {
921
- expandToSizes: Object.fromEntries(t.entries()),
922
- layout: r
923
- };
924
- try {
925
- i.setItem(l, JSON.stringify(a));
926
- } catch (m) {
927
- console.error(m);
928
- }
929
- }
930
- function Ye({
931
- layout: e,
932
- panelConstraints: n
933
- }) {
934
- const t = [...e], r = t.reduce((o, l) => o + l, 0);
935
- if (t.length !== n.length)
936
- throw Error(`Invalid ${n.length} panel layout: ${t.map((o) => `${o}%`).join(", ")}`);
937
- if (!K(r, 100) && t.length > 0)
938
- for (let o = 0; o < n.length; o++) {
939
- const l = t[o];
940
- y(l != null, `No layout data found for index ${o}`);
941
- const s = 100 / r * l;
942
- t[o] = s;
943
- }
944
- let i = 0;
945
- for (let o = 0; o < n.length; o++) {
946
- const l = t[o];
947
- y(l != null, `No layout data found for index ${o}`);
948
- const s = ae({
949
- panelConstraints: n,
950
- panelIndex: o,
951
- size: l
952
- });
953
- l != s && (i += l - s, t[o] = s);
954
- }
955
- if (!K(i, 0))
956
- for (let o = 0; o < n.length; o++) {
957
- const l = t[o];
958
- y(l != null, `No layout data found for index ${o}`);
959
- const s = l + i, a = ae({
960
- panelConstraints: n,
961
- panelIndex: o,
962
- size: s
963
- });
964
- if (l !== a && (i -= a - l, t[o] = a, K(i, 0)))
965
- break;
966
- }
967
- return t;
968
- }
969
- const et = 100, xe = {
970
- getItem: (e) => (Je(xe), xe.getItem(e)),
971
- setItem: (e, n) => {
972
- Je(xe), xe.setItem(e, n);
973
- }
974
- }, Ze = {};
975
- function vn({
976
- autoSaveId: e = null,
977
- children: n,
978
- className: t = "",
979
- direction: r,
980
- forwardedRef: i,
981
- id: o = null,
982
- onLayout: l = null,
983
- keyboardResizeBy: s = null,
984
- storage: a = xe,
985
- style: m,
986
- tagName: P = "div",
987
- ...f
988
- }) {
989
- const u = Fe(o), x = F(null), [h, E] = ue(null), [w, S] = ue([]), R = Fn(), M = F({}), $ = F(/* @__PURE__ */ new Map()), q = F(0), C = F({
990
- autoSaveId: e,
991
- direction: r,
992
- dragState: h,
993
- id: u,
994
- keyboardResizeBy: s,
995
- onLayout: l,
996
- storage: a
997
- }), b = F({
998
- layout: w,
999
- panelDataArray: [],
1000
- panelDataArrayChanged: !1
1001
- });
1002
- F({
1003
- didLogIdAndOrderWarning: !1,
1004
- didLogPanelConstraintsWarning: !1,
1005
- prevPanelIds: []
1006
- }), nn(i, () => ({
1007
- getId: () => C.current.id,
1008
- getLayout: () => {
1009
- const {
1010
- layout: c
1011
- } = b.current;
1012
- return c;
1013
- },
1014
- setLayout: (c) => {
1015
- const {
1016
- onLayout: g
1017
- } = C.current, {
1018
- layout: v,
1019
- panelDataArray: p
1020
- } = b.current, d = Ye({
1021
- layout: c,
1022
- panelConstraints: p.map((z) => z.constraints)
1023
- });
1024
- je(v, d) || (S(d), b.current.layout = d, g && g(d), le(p, d, M.current));
1025
- }
1026
- }), []), re(() => {
1027
- C.current.autoSaveId = e, C.current.direction = r, C.current.dragState = h, C.current.id = u, C.current.onLayout = l, C.current.storage = a;
1028
- }), On({
1029
- committedValuesRef: C,
1030
- eagerValuesRef: b,
1031
- groupId: u,
1032
- layout: w,
1033
- panelDataArray: b.current.panelDataArray,
1034
- setLayout: S,
1035
- panelGroupElement: x.current
1036
- }), te(() => {
1037
- const {
1038
- panelDataArray: c
1039
- } = b.current;
1040
- if (e) {
1041
- if (w.length === 0 || w.length !== c.length)
1042
- return;
1043
- let g = Ze[e];
1044
- g == null && (g = Yn(Qn, et), Ze[e] = g);
1045
- const v = [...c], p = new Map($.current);
1046
- g(e, v, p, w, a);
1047
- }
1048
- }, [e, w, a]), te(() => {
1049
- });
1050
- const U = B((c) => {
1051
- const {
1052
- onLayout: g
1053
- } = C.current, {
1054
- layout: v,
1055
- panelDataArray: p
1056
- } = b.current;
1057
- if (c.constraints.collapsible) {
1058
- const d = p.map((X) => X.constraints), {
1059
- collapsedSize: z = 0,
1060
- panelSize: I,
1061
- pivotIndices: H
1062
- } = ne(p, c, v);
1063
- if (y(I != null, `Panel size not found for panel "${c.id}"`), !Y(I, z)) {
1064
- $.current.set(c.id, I);
1065
- const j = se(p, c) === p.length - 1 ? I - z : z - I, L = ye({
1066
- delta: j,
1067
- initialLayout: v,
1068
- panelConstraints: d,
1069
- pivotIndices: H,
1070
- prevLayout: v,
1071
- trigger: "imperative-api"
1072
- });
1073
- Pe(v, L) || (S(L), b.current.layout = L, g && g(L), le(p, L, M.current));
1074
- }
1075
- }
1076
- }, []), J = B((c, g) => {
1077
- const {
1078
- onLayout: v
1079
- } = C.current, {
1080
- layout: p,
1081
- panelDataArray: d
1082
- } = b.current;
1083
- if (c.constraints.collapsible) {
1084
- const z = d.map((V) => V.constraints), {
1085
- collapsedSize: I = 0,
1086
- panelSize: H = 0,
1087
- minSize: X = 0,
1088
- pivotIndices: j
1089
- } = ne(d, c, p), L = g ?? X;
1090
- if (Y(H, I)) {
1091
- const V = $.current.get(c.id), he = V != null && V >= L ? V : L, He = se(d, c) === d.length - 1 ? H - he : he - H, T = ye({
1092
- delta: He,
1093
- initialLayout: p,
1094
- panelConstraints: z,
1095
- pivotIndices: j,
1096
- prevLayout: p,
1097
- trigger: "imperative-api"
1098
- });
1099
- Pe(p, T) || (S(T), b.current.layout = T, v && v(T), le(d, T, M.current));
1100
- }
1101
- }
1102
- }, []), W = B((c) => {
1103
- const {
1104
- layout: g,
1105
- panelDataArray: v
1106
- } = b.current, {
1107
- panelSize: p
1108
- } = ne(v, c, g);
1109
- return y(p != null, `Panel size not found for panel "${c.id}"`), p;
1110
- }, []), _ = B((c, g) => {
1111
- const {
1112
- panelDataArray: v
1113
- } = b.current, p = se(v, c);
1114
- return Jn({
1115
- defaultSize: g,
1116
- dragState: h,
1117
- layout: w,
1118
- panelData: v,
1119
- panelIndex: p
1120
- });
1121
- }, [h, w]), D = B((c) => {
1122
- const {
1123
- layout: g,
1124
- panelDataArray: v
1125
- } = b.current, {
1126
- collapsedSize: p = 0,
1127
- collapsible: d,
1128
- panelSize: z
1129
- } = ne(v, c, g);
1130
- return y(z != null, `Panel size not found for panel "${c.id}"`), d === !0 && Y(z, p);
1131
- }, []), ee = B((c) => {
1132
- const {
1133
- layout: g,
1134
- panelDataArray: v
1135
- } = b.current, {
1136
- collapsedSize: p = 0,
1137
- collapsible: d,
1138
- panelSize: z
1139
- } = ne(v, c, g);
1140
- return y(z != null, `Panel size not found for panel "${c.id}"`), !d || oe(z, p) > 0;
1141
- }, []), k = B((c) => {
1142
- const {
1143
- panelDataArray: g
1144
- } = b.current;
1145
- g.push(c), g.sort((v, p) => {
1146
- const d = v.order, z = p.order;
1147
- return d == null && z == null ? 0 : d == null ? -1 : z == null ? 1 : d - z;
1148
- }), b.current.panelDataArrayChanged = !0, R();
1149
- }, [R]);
1150
- re(() => {
1151
- if (b.current.panelDataArrayChanged) {
1152
- b.current.panelDataArrayChanged = !1;
1153
- const {
1154
- autoSaveId: c,
1155
- onLayout: g,
1156
- storage: v
1157
- } = C.current, {
1158
- layout: p,
1159
- panelDataArray: d
1160
- } = b.current;
1161
- let z = null;
1162
- if (c) {
1163
- const H = Zn(c, d, v);
1164
- H && ($.current = new Map(Object.entries(H.expandToSizes)), z = H.layout);
1165
- }
1166
- z == null && (z = jn({
1167
- panelDataArray: d
1168
- }));
1169
- const I = Ye({
1170
- layout: z,
1171
- panelConstraints: d.map((H) => H.constraints)
1172
- });
1173
- je(p, I) || (S(I), b.current.layout = I, g && g(I), le(d, I, M.current));
1174
- }
1175
- }), re(() => {
1176
- const c = b.current;
1177
- return () => {
1178
- c.layout = [];
1179
- };
1180
- }, []);
1181
- const N = B((c) => {
1182
- let g = !1;
1183
- const v = x.current;
1184
- return v && window.getComputedStyle(v, null).getPropertyValue("direction") === "rtl" && (g = !0), function(d) {
1185
- d.preventDefault();
1186
- const z = x.current;
1187
- if (!z)
1188
- return () => null;
1189
- const {
1190
- direction: I,
1191
- dragState: H,
1192
- id: X,
1193
- keyboardResizeBy: j,
1194
- onLayout: L
1195
- } = C.current, {
1196
- layout: V,
1197
- panelDataArray: he
1198
- } = b.current, {
1199
- initialLayout: be
1200
- } = H ?? {}, He = gn(X, c, z);
1201
- let T = Xn(d, c, I, H, j, z);
1202
- const Ke = I === "horizontal";
1203
- Ke && g && (T = -T);
1204
- const Sn = he.map((bn) => bn.constraints), ze = ye({
1205
- delta: T,
1206
- initialLayout: be ?? V,
1207
- panelConstraints: Sn,
1208
- pivotIndices: He,
1209
- prevLayout: V,
1210
- trigger: rn(d) ? "keyboard" : "mouse-or-touch"
1211
- }), Ue = !Pe(V, ze);
1212
- (on(d) || ln(d)) && q.current != T && (q.current = T, !Ue && T !== 0 ? Ke ? _e(c, T < 0 ? an : un) : _e(c, T < 0 ? cn : dn) : _e(c, 0)), Ue && (S(ze), b.current.layout = ze, L && L(ze), le(he, ze, M.current));
1213
- };
1214
- }, []), G = B((c, g) => {
1215
- const {
1216
- onLayout: v
1217
- } = C.current, {
1218
- layout: p,
1219
- panelDataArray: d
1220
- } = b.current, z = d.map((V) => V.constraints), {
1221
- panelSize: I,
1222
- pivotIndices: H
1223
- } = ne(d, c, p);
1224
- y(I != null, `Panel size not found for panel "${c.id}"`);
1225
- const j = se(d, c) === d.length - 1 ? I - g : g - I, L = ye({
1226
- delta: j,
1227
- initialLayout: p,
1228
- panelConstraints: z,
1229
- pivotIndices: H,
1230
- prevLayout: p,
1231
- trigger: "imperative-api"
1232
- });
1233
- Pe(p, L) || (S(L), b.current.layout = L, v && v(L), le(d, L, M.current));
1234
- }, []), fe = B((c, g) => {
1235
- const {
1236
- layout: v,
1237
- panelDataArray: p
1238
- } = b.current, {
1239
- collapsedSize: d = 0,
1240
- collapsible: z
1241
- } = g, {
1242
- collapsedSize: I = 0,
1243
- collapsible: H,
1244
- maxSize: X = 100,
1245
- minSize: j = 0
1246
- } = c.constraints, {
1247
- panelSize: L
1248
- } = ne(p, c, v);
1249
- L != null && (z && H && Y(L, d) ? Y(d, I) || G(c, I) : L < j ? G(c, j) : L > X && G(c, X));
1250
- }, [G]), pe = B((c, g) => {
1251
- const {
1252
- direction: v
1253
- } = C.current, {
1254
- layout: p
1255
- } = b.current;
1256
- if (!x.current)
1257
- return;
1258
- const d = De(c, x.current);
1259
- y(d, `Drag handle element not found for id "${c}"`);
1260
- const z = hn(v, g);
1261
- E({
1262
- dragHandleId: c,
1263
- dragHandleRect: d.getBoundingClientRect(),
1264
- initialCursorPosition: z,
1265
- initialLayout: p
1266
- });
1267
- }, []), ge = B(() => {
1268
- E(null);
1269
- }, []), Me = B((c) => {
1270
- const {
1271
- panelDataArray: g
1272
- } = b.current, v = se(g, c);
1273
- v >= 0 && (g.splice(v, 1), delete M.current[c.id], b.current.panelDataArrayChanged = !0, R());
1274
- }, [R]), ie = En(() => ({
1275
- collapsePanel: U,
1276
- direction: r,
1277
- dragState: h,
1278
- expandPanel: J,
1279
- getPanelSize: W,
1280
- getPanelStyle: _,
1281
- groupId: u,
1282
- isPanelCollapsed: D,
1283
- isPanelExpanded: ee,
1284
- reevaluatePanelConstraints: fe,
1285
- registerPanel: k,
1286
- registerResizeHandle: N,
1287
- resizePanel: G,
1288
- startDragging: pe,
1289
- stopDragging: ge,
1290
- unregisterPanel: Me,
1291
- panelGroupElement: x.current
1292
- }), [U, h, r, J, W, _, u, D, ee, fe, k, N, G, pe, ge, Me]), me = {
1293
- display: "flex",
1294
- flexDirection: r === "horizontal" ? "row" : "column",
1295
- height: "100%",
1296
- overflow: "hidden",
1297
- width: "100%"
1298
- };
1299
- return de(Ce.Provider, {
1300
- value: ie
1301
- }, de(P, {
1302
- ...f,
1303
- children: n,
1304
- className: t,
1305
- id: o,
1306
- ref: x,
1307
- style: {
1308
- ...me,
1309
- ...m
1310
- },
1311
- // CSS selectors
1312
- [A.group]: "",
1313
- [A.groupDirection]: r,
1314
- [A.groupId]: u
1315
- }));
1316
- }
1317
- const nt = Qe((e, n) => de(vn, {
1318
- ...e,
1319
- forwardedRef: n
1320
- }));
1321
- vn.displayName = "PanelGroup";
1322
- nt.displayName = "forwardRef(PanelGroup)";
1323
- function se(e, n) {
1324
- return e.findIndex((t) => t === n || t.id === n.id);
1325
- }
1326
- function ne(e, n, t) {
1327
- const r = se(e, n), o = r === e.length - 1 ? [r - 1, r] : [r, r + 1], l = t[r];
1328
- return {
1329
- ...n.constraints,
1330
- panelSize: l,
1331
- pivotIndices: o
1332
- };
1333
- }
1334
- function tt({
1335
- disabled: e,
1336
- handleId: n,
1337
- resizeHandler: t,
1338
- panelGroupElement: r
1339
- }) {
1340
- te(() => {
1341
- if (e || t == null || r == null)
1342
- return;
1343
- const i = De(n, r);
1344
- if (i == null)
1345
- return;
1346
- const o = (l) => {
1347
- if (!l.defaultPrevented)
1348
- switch (l.key) {
1349
- case "ArrowDown":
1350
- case "ArrowLeft":
1351
- case "ArrowRight":
1352
- case "ArrowUp":
1353
- case "End":
1354
- case "Home": {
1355
- l.preventDefault(), t(l);
1356
- break;
1357
- }
1358
- case "F6": {
1359
- l.preventDefault();
1360
- const s = i.getAttribute(A.groupId);
1361
- y(s, `No group element found for id "${s}"`);
1362
- const a = Se(s, r), m = pn(s, n, r);
1363
- y(m !== null, `No resize element found for id "${n}"`);
1364
- const P = l.shiftKey ? m > 0 ? m - 1 : a.length - 1 : m + 1 < a.length ? m + 1 : 0;
1365
- a[P].focus();
1366
- break;
1367
- }
1368
- }
1369
- };
1370
- return i.addEventListener("keydown", o), () => {
1371
- i.removeEventListener("keydown", o);
1372
- };
1373
- }, [r, e, n, t]);
1374
- }
1375
- function rt({
1376
- children: e = null,
1377
- className: n = "",
1378
- disabled: t = !1,
1379
- hitAreaMargins: r,
1380
- id: i,
1381
- onBlur: o,
1382
- onClick: l,
1383
- onDragging: s,
1384
- onFocus: a,
1385
- onPointerDown: m,
1386
- onPointerUp: P,
1387
- style: f = {},
1388
- tabIndex: u = 0,
1389
- tagName: x = "div",
1390
- ...h
1391
- }) {
1392
- var E, w;
1393
- const S = F(null), R = F({
1394
- onClick: l,
1395
- onDragging: s,
1396
- onPointerDown: m,
1397
- onPointerUp: P
1398
- });
1399
- te(() => {
1400
- R.current.onClick = l, R.current.onDragging = s, R.current.onPointerDown = m, R.current.onPointerUp = P;
1401
- });
1402
- const M = en(Ce);
1403
- if (M === null)
1404
- throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");
1405
- const {
1406
- direction: $,
1407
- groupId: q,
1408
- registerResizeHandle: C,
1409
- startDragging: b,
1410
- stopDragging: U,
1411
- panelGroupElement: J
1412
- } = M, W = Fe(i), [_, D] = ue("inactive"), [ee, k] = ue(!1), [N, G] = ue(null), fe = F({
1413
- state: _
1414
- });
1415
- re(() => {
1416
- fe.current.state = _;
1417
- }), te(() => {
1418
- if (t)
1419
- G(null);
1420
- else {
1421
- const ie = C(W);
1422
- G(() => ie);
1423
- }
1424
- }, [t, W, C]);
1425
- const pe = (E = r?.coarse) !== null && E !== void 0 ? E : 15, ge = (w = r?.fine) !== null && w !== void 0 ? w : 5;
1426
- return te(() => {
1427
- if (t || N == null)
1428
- return;
1429
- const ie = S.current;
1430
- y(ie, "Element ref not attached");
1431
- let me = !1;
1432
- return Tn(W, ie, $, {
1433
- coarse: pe,
1434
- fine: ge
1435
- }, (g, v, p) => {
1436
- if (!v) {
1437
- D("inactive");
1438
- return;
1439
- }
1440
- switch (g) {
1441
- case "down": {
1442
- D("drag"), me = !1, y(p, 'Expected event to be defined for "down" action'), b(W, p);
1443
- const {
1444
- onDragging: d,
1445
- onPointerDown: z
1446
- } = R.current;
1447
- d?.(!0), z?.();
1448
- break;
1449
- }
1450
- case "move": {
1451
- const {
1452
- state: d
1453
- } = fe.current;
1454
- me = !0, d !== "drag" && D("hover"), y(p, 'Expected event to be defined for "move" action'), N(p);
1455
- break;
1456
- }
1457
- case "up": {
1458
- D("hover"), U();
1459
- const {
1460
- onClick: d,
1461
- onDragging: z,
1462
- onPointerUp: I
1463
- } = R.current;
1464
- z?.(!1), I?.(), me || d?.();
1465
- break;
1466
- }
1467
- }
1468
- });
1469
- }, [pe, $, t, ge, C, W, N, b, U]), tt({
1470
- disabled: t,
1471
- handleId: W,
1472
- resizeHandler: N,
1473
- panelGroupElement: J
1474
- }), de(x, {
1475
- ...h,
1476
- children: e,
1477
- className: n,
1478
- id: i,
1479
- onBlur: () => {
1480
- k(!1), o?.();
1481
- },
1482
- onFocus: () => {
1483
- k(!0), a?.();
1484
- },
1485
- ref: S,
1486
- role: "separator",
1487
- style: {
1488
- ...{
1489
- touchAction: "none",
1490
- userSelect: "none"
1491
- },
1492
- ...f
1493
- },
1494
- tabIndex: u,
1495
- // CSS selectors
1496
- [A.groupDirection]: $,
1497
- [A.groupId]: q,
1498
- [A.resizeHandle]: "",
1499
- [A.resizeHandleActive]: _ === "drag" ? "pointer" : ee ? "keyboard" : void 0,
1500
- [A.resizeHandleEnabled]: !t,
1501
- [A.resizeHandleId]: W,
1502
- [A.resizeHandleState]: _
1503
- });
1504
- }
1505
- rt.displayName = "PanelResizeHandle";
1506
- export {
1507
- rt as P,
1508
- Ln as a,
1509
- nt as b
1510
- };