@gv-tech/ui-web 2.19.0 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/dist/accordion-Be1vGv6M.js +1 -0
  2. package/dist/accordion-DXnU0LgU.mjs +221 -0
  3. package/dist/accordion.cjs +1 -1
  4. package/dist/accordion.mjs +3 -259
  5. package/dist/alert-dialog-BXRY0Ghq.js +7 -0
  6. package/dist/alert-dialog-fcZ-sL7h.mjs +164 -0
  7. package/dist/alert-dialog.cjs +1 -7
  8. package/dist/alert-dialog.mjs +4 -171
  9. package/dist/alert.cjs +1 -1
  10. package/dist/alert.mjs +35 -32
  11. package/dist/aspect-ratio-BP5HarYZ.js +1 -0
  12. package/dist/aspect-ratio-Bp8HMg-1.mjs +33 -0
  13. package/dist/aspect-ratio.cjs +1 -1
  14. package/dist/aspect-ratio.mjs +3 -43
  15. package/dist/avatar-klFl8Sqa.js +1 -0
  16. package/dist/avatar-vGm9JN1a.mjs +184 -0
  17. package/dist/avatar.cjs +1 -1
  18. package/dist/avatar.mjs +3 -205
  19. package/dist/badge.cjs +1 -1
  20. package/dist/badge.mjs +21 -24
  21. package/dist/breadcrumb.cjs +1 -1
  22. package/dist/breadcrumb.mjs +60 -68
  23. package/dist/button.cjs +1 -1
  24. package/dist/button.mjs +40 -40
  25. package/dist/calendar-aIuSXzs7.js +1 -0
  26. package/dist/calendar-oitID53a.mjs +3154 -0
  27. package/dist/calendar.cjs +1 -1
  28. package/dist/calendar.mjs +4 -2976
  29. package/dist/card.cjs +1 -1
  30. package/dist/card.mjs +42 -32
  31. package/dist/carousel-BjTSkVh9.js +1 -0
  32. package/dist/carousel-CENzZCXN.mjs +1178 -0
  33. package/dist/carousel.cjs +1 -1
  34. package/dist/carousel.mjs +4 -1403
  35. package/dist/chart.cjs +4 -4
  36. package/dist/chart.d.ts +3 -35
  37. package/dist/chart.mjs +123 -182
  38. package/dist/checkbox-Bwq7mXA2.mjs +170 -0
  39. package/dist/checkbox-DzEO1q4R.js +1 -0
  40. package/dist/checkbox.cjs +1 -1
  41. package/dist/checkbox.mjs +3 -258
  42. package/dist/collapsible.cjs +1 -1
  43. package/dist/collapsible.mjs +6 -7
  44. package/dist/command-D7hksKY6.js +1 -0
  45. package/dist/command-Ws_iF1hM.mjs +531 -0
  46. package/dist/command.cjs +1 -1
  47. package/dist/command.mjs +3 -396
  48. package/dist/context-menu-DJbgNJ7N.js +1 -0
  49. package/dist/context-menu-fu39gePi.mjs +292 -0
  50. package/dist/context-menu.cjs +1 -1
  51. package/dist/context-menu.mjs +3 -328
  52. package/dist/dialog.cjs +1 -1
  53. package/dist/dialog.mjs +50 -66
  54. package/dist/dist-0FXx-pUX.js +1 -0
  55. package/dist/dist-4A0ut6a8.mjs +10 -0
  56. package/dist/dist-ALQAoSGx.mjs +10 -0
  57. package/dist/dist-B4N_7Tps.js +1 -0
  58. package/dist/dist-B5776DvK.js +5 -0
  59. package/dist/dist-B57mzJP3.mjs +28 -0
  60. package/dist/dist-B5VmV2K7.js +1 -0
  61. package/dist/dist-BBRD-Qfb.js +1 -0
  62. package/dist/dist-BC_VB6JL.mjs +25 -0
  63. package/dist/dist-BKFtvTm8.mjs +6 -0
  64. package/dist/dist-BUS_s_6N.js +1 -0
  65. package/dist/dist-BVKPqhkg.js +1 -0
  66. package/dist/dist-Ba7mQG9D.mjs +117 -0
  67. package/dist/dist-BeFCyPgD.js +1 -0
  68. package/dist/dist-Bf4P28CV.js +1 -0
  69. package/dist/dist-BfFVoFJN.js +1 -0
  70. package/dist/dist-BhtQH_6Z.js +1 -0
  71. package/dist/dist-BmjFh8i_.mjs +5 -0
  72. package/dist/dist-BrCTkQXt.mjs +62 -0
  73. package/dist/dist-BxmpAHsT.mjs +219 -0
  74. package/dist/dist-C2ArLRnq.js +1 -0
  75. package/dist/dist-C2pRTcV_.mjs +62 -0
  76. package/dist/dist-C9wnUiS4.mjs +27 -0
  77. package/dist/dist-CIRItnqs.js +1 -0
  78. package/dist/dist-CL1DhkaL.js +1 -0
  79. package/dist/dist-CRe7xawr.js +1 -0
  80. package/dist/dist-CUFjt0cI.js +1 -0
  81. package/dist/dist-CaaGWewc.mjs +557 -0
  82. package/dist/dist-Ci2whnVp.js +1 -0
  83. package/dist/dist-CmBtqW5f.js +1 -0
  84. package/dist/dist-CsEsK2jW.js +1 -0
  85. package/dist/dist-CscAxhT8.js +1 -0
  86. package/dist/dist-CvtF5JdF.mjs +95 -0
  87. package/dist/dist-Cvwtowos.mjs +77 -0
  88. package/dist/dist-D2f83VMO.mjs +73 -0
  89. package/dist/dist-Dh_jWJh-.mjs +11 -0
  90. package/dist/dist-DikyKBU3.mjs +12 -0
  91. package/dist/dist-DmmUjo_P.js +1 -0
  92. package/dist/dist-DqvQ5UFr.mjs +38 -0
  93. package/dist/dist-FGQAMrhH.mjs +29 -0
  94. package/dist/dist-Jtk3jeb9.mjs +18 -0
  95. package/dist/dist-Kqk0oQYU.js +1 -0
  96. package/dist/dist-VI9bl_Wk.mjs +45 -0
  97. package/dist/dist-Z7lEV5Nx.mjs +1282 -0
  98. package/dist/dist-_Osar3kp.js +1 -0
  99. package/dist/dist-bDoR0CBU.mjs +112 -0
  100. package/dist/dist-cRjbOZRf.js +1 -0
  101. package/dist/dist-d_pecHgw.mjs +66 -0
  102. package/dist/dist-r36zVVcK.js +1 -0
  103. package/dist/dist-sRlXdzvf.mjs +152 -0
  104. package/dist/drawer.cjs +1 -1
  105. package/dist/drawer.mjs +48 -54
  106. package/dist/dropdown-menu-BGkQXJ-r.mjs +288 -0
  107. package/dist/dropdown-menu-uGMnmGL-.js +1 -0
  108. package/dist/dropdown-menu.cjs +1 -1
  109. package/dist/dropdown-menu.mjs +3 -316
  110. package/dist/es2015-Cx0gpR1a.js +41 -0
  111. package/dist/es2015-a1b8kENC.mjs +701 -0
  112. package/dist/form.cjs +1 -1
  113. package/dist/form.mjs +76 -67
  114. package/dist/hover-card-DdIYJP-Q.mjs +167 -0
  115. package/dist/hover-card-Ua-2KlY-.js +1 -0
  116. package/dist/hover-card.cjs +1 -1
  117. package/dist/hover-card.mjs +3 -188
  118. package/dist/index.cjs +1 -1
  119. package/dist/index.d.ts +3 -35
  120. package/dist/index.mjs +56 -296
  121. package/dist/input.cjs +1 -1
  122. package/dist/input.mjs +14 -19
  123. package/dist/jsx-runtime-CN3qjQQx.js +6 -0
  124. package/dist/jsx-runtime-CW53Uo-e.mjs +189 -0
  125. package/dist/label-8YSUv4kt.js +1 -0
  126. package/dist/label-Bur66PVg.mjs +22 -0
  127. package/dist/label.cjs +1 -1
  128. package/dist/label.mjs +3 -22
  129. package/dist/menubar-Bq1Sfbf5.js +1 -0
  130. package/dist/menubar-D2fY6zkQ.mjs +410 -0
  131. package/dist/menubar.cjs +1 -1
  132. package/dist/menubar.mjs +3 -473
  133. package/dist/navigation-menu-BuOakbgA.mjs +602 -0
  134. package/dist/navigation-menu-so6EvLAY.js +1 -0
  135. package/dist/navigation-menu.cjs +1 -1
  136. package/dist/navigation-menu.mjs +3 -673
  137. package/dist/pagination.cjs +1 -1
  138. package/dist/pagination.mjs +63 -68
  139. package/dist/popover-BUADXRkO.mjs +201 -0
  140. package/dist/popover-nBrSPqHk.js +1 -0
  141. package/dist/popover.cjs +1 -1
  142. package/dist/popover.mjs +3 -242
  143. package/dist/progress-BTApMbqg.js +6 -0
  144. package/dist/progress-BbN-RNvs.mjs +81 -0
  145. package/dist/progress.cjs +1 -6
  146. package/dist/progress.mjs +3 -99
  147. package/dist/radio-group-C5oprOrt.mjs +193 -0
  148. package/dist/radio-group-FDXr6VLM.js +1 -0
  149. package/dist/radio-group.cjs +1 -1
  150. package/dist/radio-group.mjs +3 -253
  151. package/dist/resizable-ChdgCzzx.mjs +1534 -0
  152. package/dist/resizable-ztiFzq_y.js +1 -0
  153. package/dist/resizable.cjs +1 -1
  154. package/dist/resizable.mjs +3 -1990
  155. package/dist/scroll-area-3o0-cc3n.mjs +520 -0
  156. package/dist/scroll-area-DXZqIKXN.js +1 -0
  157. package/dist/scroll-area.cjs +1 -1
  158. package/dist/scroll-area.mjs +3 -546
  159. package/dist/scroll-to-top.cjs +1 -1
  160. package/dist/scroll-to-top.mjs +71 -84
  161. package/dist/search.cjs +1 -1
  162. package/dist/search.mjs +53 -63
  163. package/dist/select-B2qM503G.mjs +744 -0
  164. package/dist/select-BHCeW-MD.js +1 -0
  165. package/dist/select.cjs +1 -1
  166. package/dist/select.mjs +3 -908
  167. package/dist/separator-BZJ-SDvg.js +1 -0
  168. package/dist/separator-DJ_IwKUQ.mjs +31 -0
  169. package/dist/separator.cjs +1 -1
  170. package/dist/separator.mjs +3 -35
  171. package/dist/sheet.cjs +1 -1
  172. package/dist/sheet.mjs +59 -66
  173. package/dist/skeleton.cjs +1 -1
  174. package/dist/skeleton.mjs +13 -7
  175. package/dist/slider-CJJPQ0fH.mjs +366 -0
  176. package/dist/slider-DHccqrW2.js +1 -0
  177. package/dist/slider.cjs +1 -1
  178. package/dist/slider.mjs +3 -442
  179. package/dist/sonner.cjs +1 -1
  180. package/dist/sonner.mjs +21 -24
  181. package/dist/support-fab.cjs +1 -1
  182. package/dist/support-fab.mjs +81 -117
  183. package/dist/switch-BbcAUYjl.mjs +103 -0
  184. package/dist/switch-DZfRzgWs.js +1 -0
  185. package/dist/switch.cjs +1 -1
  186. package/dist/switch.mjs +3 -149
  187. package/dist/table-of-contents.cjs +1 -1
  188. package/dist/table-of-contents.mjs +159 -155
  189. package/dist/table.cjs +1 -1
  190. package/dist/table.mjs +58 -57
  191. package/dist/tabs-BEy0IIV0.js +1 -0
  192. package/dist/tabs-DqAKyl9T.mjs +136 -0
  193. package/dist/tabs.cjs +1 -1
  194. package/dist/tabs.mjs +3 -195
  195. package/dist/text.cjs +1 -1
  196. package/dist/text.mjs +41 -42
  197. package/dist/textarea.cjs +1 -1
  198. package/dist/textarea.mjs +12 -17
  199. package/dist/theme-provider.cjs +1 -1
  200. package/dist/theme-provider.mjs +15 -7
  201. package/dist/theme-toggle-DKQmD-FO.js +1 -0
  202. package/dist/theme-toggle-dQbFWNI8.mjs +65 -0
  203. package/dist/theme-toggle.cjs +1 -1
  204. package/dist/theme-toggle.mjs +3 -8
  205. package/dist/toast-C84Cpidq.js +1 -0
  206. package/dist/toast-CQbUslcw.mjs +427 -0
  207. package/dist/toast.cjs +1 -1
  208. package/dist/toast.mjs +3 -494
  209. package/dist/toaster-BpcpNRz1.js +1 -0
  210. package/dist/toaster-i6giQYiq.mjs +126 -0
  211. package/dist/toaster.cjs +1 -1
  212. package/dist/toaster.mjs +3 -6
  213. package/dist/toggle-group-B2S7fkhA.mjs +155 -0
  214. package/dist/toggle-group-BNn6MNiJ.js +1 -0
  215. package/dist/toggle-group.cjs +1 -1
  216. package/dist/toggle-group.mjs +3 -170
  217. package/dist/toggle.cjs +1 -1
  218. package/dist/toggle.mjs +19 -14
  219. package/dist/tooltip-CElrNodA.js +1 -0
  220. package/dist/tooltip-oKfTBTbv.mjs +364 -0
  221. package/dist/tooltip.cjs +1 -1
  222. package/dist/tooltip.mjs +3 -342
  223. package/dist/utils-BxDanjP7.js +1 -0
  224. package/dist/utils-yc5uc46c.mjs +11 -0
  225. package/package.json +2 -2
  226. package/src/chart.tsx +7 -7
  227. package/src/setupTests.ts +5 -4
  228. package/dist/index-0ioNhtNM.mjs +0 -10
  229. package/dist/index-3j-XAIXT.mjs +0 -55
  230. package/dist/index-B2XtpfGY.js +0 -1
  231. package/dist/index-B39Lzq0v.js +0 -1
  232. package/dist/index-B7n6fy75.js +0 -1
  233. package/dist/index-B8dxbSWX.js +0 -41
  234. package/dist/index-BGIK9FQF.js +0 -1
  235. package/dist/index-BZPx6jYI.mjs +0 -8
  236. package/dist/index-BoNjHhm4.js +0 -1
  237. package/dist/index-BtZvtDmp.js +0 -1
  238. package/dist/index-Bv7qrYW6.mjs +0 -180
  239. package/dist/index-ByiPJW53.js +0 -5
  240. package/dist/index-C0dlIQIi.js +0 -1
  241. package/dist/index-C1qb0595.mjs +0 -27
  242. package/dist/index-C7HEunrh.mjs +0 -15
  243. package/dist/index-C8ni3LLa.js +0 -1
  244. package/dist/index-CCKe-Mpx.mjs +0 -6
  245. package/dist/index-CD6_IrA-.mjs +0 -10
  246. package/dist/index-CRyCZJLa.mjs +0 -677
  247. package/dist/index-CVx1AgNG.mjs +0 -615
  248. package/dist/index-Ce5TOFAK.js +0 -1
  249. package/dist/index-CeSLNJ60.mjs +0 -32
  250. package/dist/index-CefEQe_4.js +0 -1
  251. package/dist/index-Cj5hzyBi.js +0 -1
  252. package/dist/index-Cjj_rUPu.js +0 -1
  253. package/dist/index-Cl3G0jzM.js +0 -1
  254. package/dist/index-CwfE56Ep.mjs +0 -1545
  255. package/dist/index-CwyAfCwY.js +0 -1
  256. package/dist/index-CzY-WZXL.js +0 -1
  257. package/dist/index-D2HnlO3y.js +0 -1
  258. package/dist/index-DFdF7K7v.mjs +0 -50
  259. package/dist/index-DIsg7zU7.js +0 -1
  260. package/dist/index-DKN_vhyX.mjs +0 -32
  261. package/dist/index-DLcqcWxM.mjs +0 -29
  262. package/dist/index-DSxf1gN6.mjs +0 -118
  263. package/dist/index-DYxWvftI.js +0 -1
  264. package/dist/index-DaILh3TV.mjs +0 -32
  265. package/dist/index-Dfzl8TxY.mjs +0 -136
  266. package/dist/index-Dko2XdTk.js +0 -1
  267. package/dist/index-DlY82G31.mjs +0 -245
  268. package/dist/index-DnFcfnA9.mjs +0 -13
  269. package/dist/index-IZ2gq03c.mjs +0 -68
  270. package/dist/index-K9FzbxYw.mjs +0 -93
  271. package/dist/index-Le8p9oP4.mjs +0 -60
  272. package/dist/index-MQ0c3ZX_.js +0 -1
  273. package/dist/index-_XxjJPRD.js +0 -1
  274. package/dist/index-_wdrnYim.js +0 -1
  275. package/dist/index-jv3B4mTd.js +0 -1
  276. package/dist/index-kaM0u2Q1.js +0 -1
  277. package/dist/index-p6xVFRb4.mjs +0 -52
  278. package/dist/index-rKs9bXHr.mjs +0 -6
  279. package/dist/index-vuPgkS0V.mjs +0 -70
  280. package/dist/jsx-runtime-nZSsnGb7.js +0 -6
  281. package/dist/jsx-runtime-tc70JA_2.mjs +0 -264
  282. package/dist/theme-toggle-DXQGNfCe.js +0 -1
  283. package/dist/theme-toggle-tHXIbr8W.mjs +0 -79
  284. package/dist/toaster-C_S9hnXa.js +0 -1
  285. package/dist/toaster-k5DnQSsh.mjs +0 -118
  286. package/dist/utils-DY6fhrgS.mjs +0 -12
  287. package/dist/utils-cdbZV8DZ.js +0 -1
@@ -1,1991 +1,4 @@
1
1
  "use client";
2
- import { j as $ } from "./jsx-runtime-tc70JA_2.mjs";
3
- import { GripVertical as nt } from "lucide-react";
4
- import { createContext as ot, useRef as F, useEffect as se, useSyncExternalStore as rt, useState as ue, useId as at, useContext as it, useCallback as Ie, useLayoutEffect as st, useImperativeHandle as Ne, useMemo as lt } from "react";
5
- import { c as je } from "./utils-DY6fhrgS.mjs";
6
- function ut(e, t) {
7
- const n = getComputedStyle(e), o = parseFloat(n.fontSize);
8
- return t * o;
9
- }
10
- function ct(e, t) {
11
- const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
12
- return t * o;
13
- }
14
- function dt(e) {
15
- return e / 100 * window.innerHeight;
16
- }
17
- function ft(e) {
18
- return e / 100 * window.innerWidth;
19
- }
20
- function pt(e) {
21
- switch (typeof e) {
22
- case "number":
23
- return [e, "px"];
24
- case "string": {
25
- const t = parseFloat(e);
26
- return e.endsWith("%") ? [t, "%"] : e.endsWith("px") ? [t, "px"] : e.endsWith("rem") ? [t, "rem"] : e.endsWith("em") ? [t, "em"] : e.endsWith("vh") ? [t, "vh"] : e.endsWith("vw") ? [t, "vw"] : [t, "%"];
27
- }
28
- }
29
- }
30
- function oe({
31
- groupSize: e,
32
- panelElement: t,
33
- styleProp: n
34
- }) {
35
- let o;
36
- const [a, i] = pt(n);
37
- switch (i) {
38
- case "%": {
39
- o = a / 100 * e;
40
- break;
41
- }
42
- case "px": {
43
- o = a;
44
- break;
45
- }
46
- case "rem": {
47
- o = ct(t, a);
48
- break;
49
- }
50
- case "em": {
51
- o = ut(t, a);
52
- break;
53
- }
54
- case "vh": {
55
- o = dt(a);
56
- break;
57
- }
58
- case "vw": {
59
- o = ft(a);
60
- break;
61
- }
62
- }
63
- return o;
64
- }
65
- function j(e) {
66
- return parseFloat(e.toFixed(3));
67
- }
68
- function Z({
69
- group: e
70
- }) {
71
- const { orientation: t, panels: n } = e;
72
- return n.reduce((o, a) => (o += t === "horizontal" ? a.element.offsetWidth : a.element.offsetHeight, o), 0);
73
- }
74
- function ce(e) {
75
- const { panels: t } = e, n = Z({ group: e });
76
- return n === 0 ? t.map((o) => ({
77
- collapsedSize: 0,
78
- collapsible: o.panelConstraints.collapsible === !0,
79
- defaultSize: void 0,
80
- disabled: o.panelConstraints.disabled,
81
- minSize: 0,
82
- maxSize: 100,
83
- panelId: o.id
84
- })) : t.map((o) => {
85
- const { element: a, panelConstraints: i } = o;
86
- let l = 0;
87
- if (i.collapsedSize !== void 0) {
88
- const u = oe({
89
- groupSize: n,
90
- panelElement: a,
91
- styleProp: i.collapsedSize
92
- });
93
- l = j(u / n * 100);
94
- }
95
- let r;
96
- if (i.defaultSize !== void 0) {
97
- const u = oe({
98
- groupSize: n,
99
- panelElement: a,
100
- styleProp: i.defaultSize
101
- });
102
- r = j(u / n * 100);
103
- }
104
- let s = 0;
105
- if (i.minSize !== void 0) {
106
- const u = oe({
107
- groupSize: n,
108
- panelElement: a,
109
- styleProp: i.minSize
110
- });
111
- s = j(u / n * 100);
112
- }
113
- let c = 100;
114
- if (i.maxSize !== void 0) {
115
- const u = oe({
116
- groupSize: n,
117
- panelElement: a,
118
- styleProp: i.maxSize
119
- });
120
- c = j(u / n * 100);
121
- }
122
- return {
123
- collapsedSize: l,
124
- collapsible: i.collapsible === !0,
125
- defaultSize: r,
126
- disabled: i.disabled,
127
- minSize: s,
128
- maxSize: c,
129
- panelId: o.id
130
- };
131
- });
132
- }
133
- function C(e, t = "Assertion error") {
134
- if (!e)
135
- throw Error(t);
136
- }
137
- function de(e, t) {
138
- return Array.from(t).sort(
139
- e === "horizontal" ? mt : ht
140
- );
141
- }
142
- function mt(e, t) {
143
- const n = e.element.offsetLeft - t.element.offsetLeft;
144
- return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
145
- }
146
- function ht(e, t) {
147
- const n = e.element.offsetTop - t.element.offsetTop;
148
- return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
149
- }
150
- function Oe(e) {
151
- return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
152
- }
153
- function Fe(e, t) {
154
- return {
155
- x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
156
- Math.abs(e.x - t.left),
157
- Math.abs(e.x - t.right)
158
- ),
159
- y: e.y >= t.top && e.y <= t.bottom ? 0 : Math.min(
160
- Math.abs(e.y - t.top),
161
- Math.abs(e.y - t.bottom)
162
- )
163
- };
164
- }
165
- function gt({
166
- orientation: e,
167
- rects: t,
168
- targetRect: n
169
- }) {
170
- const o = {
171
- x: n.x + n.width / 2,
172
- y: n.y + n.height / 2
173
- };
174
- let a, i = Number.MAX_VALUE;
175
- for (const l of t) {
176
- const { x: r, y: s } = Fe(o, l), c = e === "horizontal" ? r : s;
177
- c < i && (i = c, a = l);
178
- }
179
- return C(a, "No rect found"), a;
180
- }
181
- let re;
182
- function vt() {
183
- return re === void 0 && (typeof matchMedia == "function" ? re = !!matchMedia("(pointer:coarse)").matches : re = !1), re;
184
- }
185
- function $e(e) {
186
- const { element: t, orientation: n, panels: o, separators: a } = e, i = de(
187
- n,
188
- Array.from(t.children).filter(Oe).map((h) => ({ element: h }))
189
- ).map(({ element: h }) => h), l = [];
190
- let r = !1, s = !1, c = -1, u = -1, S = 0, z, b = [];
191
- {
192
- let h = -1;
193
- for (const d of i)
194
- d.hasAttribute("data-panel") && (h++, d.ariaDisabled === null && (S++, c === -1 && (c = h), u = h));
195
- }
196
- if (S > 1) {
197
- let h = -1;
198
- for (const d of i)
199
- if (d.hasAttribute("data-panel")) {
200
- h++;
201
- const p = o.find(
202
- (f) => f.element === d
203
- );
204
- if (p) {
205
- if (z) {
206
- const f = z.element.getBoundingClientRect(), v = d.getBoundingClientRect();
207
- let y;
208
- if (s) {
209
- const g = n === "horizontal" ? new DOMRect(
210
- f.right,
211
- f.top,
212
- 0,
213
- f.height
214
- ) : new DOMRect(
215
- f.left,
216
- f.bottom,
217
- f.width,
218
- 0
219
- ), m = n === "horizontal" ? new DOMRect(v.left, v.top, 0, v.height) : new DOMRect(v.left, v.top, v.width, 0);
220
- switch (b.length) {
221
- case 0: {
222
- y = [
223
- g,
224
- m
225
- ];
226
- break;
227
- }
228
- case 1: {
229
- const L = b[0], P = gt({
230
- orientation: n,
231
- rects: [f, v],
232
- targetRect: L.element.getBoundingClientRect()
233
- });
234
- y = [
235
- L,
236
- P === f ? m : g
237
- ];
238
- break;
239
- }
240
- default: {
241
- y = b;
242
- break;
243
- }
244
- }
245
- } else
246
- b.length ? y = b : y = [
247
- n === "horizontal" ? new DOMRect(
248
- f.right,
249
- v.top,
250
- v.left - f.right,
251
- v.height
252
- ) : new DOMRect(
253
- v.left,
254
- f.bottom,
255
- v.width,
256
- v.top - f.bottom
257
- )
258
- ];
259
- for (const g of y) {
260
- let m = "width" in g ? g : g.element.getBoundingClientRect();
261
- const L = vt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
262
- if (m.width < L) {
263
- const M = L - m.width;
264
- m = new DOMRect(
265
- m.x - M / 2,
266
- m.y,
267
- m.width + M,
268
- m.height
269
- );
270
- }
271
- if (m.height < L) {
272
- const M = L - m.height;
273
- m = new DOMRect(
274
- m.x,
275
- m.y - M / 2,
276
- m.width,
277
- m.height + M
278
- );
279
- }
280
- const P = h <= c || h > u;
281
- !r && !P && l.push({
282
- group: e,
283
- groupSize: Z({ group: e }),
284
- panels: [z, p],
285
- separator: "width" in g ? void 0 : g,
286
- rect: m
287
- }), r = !1;
288
- }
289
- }
290
- s = !1, z = p, b = [];
291
- }
292
- } else if (d.hasAttribute("data-separator")) {
293
- d.ariaDisabled !== null && (r = !0);
294
- const p = a.find(
295
- (f) => f.element === d
296
- );
297
- p ? b.push(p) : (z = void 0, b = []);
298
- } else
299
- s = !0;
300
- }
301
- return l;
302
- }
303
- class yt {
304
- #e = {};
305
- addListener(t, n) {
306
- const o = this.#e[t];
307
- return o === void 0 ? this.#e[t] = [n] : o.includes(n) || o.push(n), () => {
308
- this.removeListener(t, n);
309
- };
310
- }
311
- emit(t, n) {
312
- const o = this.#e[t];
313
- if (o !== void 0)
314
- if (o.length === 1)
315
- o[0].call(null, n);
316
- else {
317
- let a = !1, i = null;
318
- const l = Array.from(o);
319
- for (let r = 0; r < l.length; r++) {
320
- const s = l[r];
321
- try {
322
- s.call(null, n);
323
- } catch (c) {
324
- i === null && (a = !0, i = c);
325
- }
326
- }
327
- if (a)
328
- throw i;
329
- }
330
- }
331
- removeAllListeners() {
332
- this.#e = {};
333
- }
334
- removeListener(t, n) {
335
- const o = this.#e[t];
336
- if (o !== void 0) {
337
- const a = o.indexOf(n);
338
- a >= 0 && o.splice(a, 1);
339
- }
340
- }
341
- }
342
- function k(e, t, n = 0) {
343
- return Math.abs(j(e) - j(t)) <= n;
344
- }
345
- let I = {
346
- cursorFlags: 0,
347
- interactionState: {
348
- state: "inactive"
349
- },
350
- mountedGroups: /* @__PURE__ */ new Map()
351
- };
352
- const A = new yt();
353
- function D() {
354
- return I;
355
- }
356
- function R(e) {
357
- const t = typeof e == "function" ? e(I) : e;
358
- if (I === t)
359
- return I;
360
- const n = I;
361
- return I = {
362
- ...I,
363
- ...t
364
- }, t.cursorFlags !== void 0 && A.emit("cursorFlagsChange", I.cursorFlags), t.interactionState !== void 0 && A.emit("interactionStateChange", I.interactionState), t.mountedGroups !== void 0 && (I.mountedGroups.forEach((o, a) => {
365
- o.derivedPanelConstraints.forEach((i) => {
366
- if (i.collapsible) {
367
- const { layout: l } = n.mountedGroups.get(a) ?? {};
368
- if (l) {
369
- const r = k(
370
- i.collapsedSize,
371
- o.layout[i.panelId]
372
- ), s = k(
373
- i.collapsedSize,
374
- l[i.panelId]
375
- );
376
- r && !s && (a.inMemoryLastExpandedPanelSizes[i.panelId] = l[i.panelId]);
377
- }
378
- }
379
- });
380
- }), A.emit("mountedGroupsChange", I.mountedGroups)), I;
381
- }
382
- function bt(e, t, n) {
383
- let o, a = {
384
- x: 1 / 0,
385
- y: 1 / 0
386
- };
387
- for (const i of t) {
388
- const l = Fe(n, i.rect);
389
- switch (e) {
390
- case "horizontal": {
391
- l.x <= a.x && (o = i, a = l);
392
- break;
393
- }
394
- case "vertical": {
395
- l.y <= a.y && (o = i, a = l);
396
- break;
397
- }
398
- }
399
- }
400
- return o ? {
401
- distance: a,
402
- hitRegion: o
403
- } : void 0;
404
- }
405
- function wt(e) {
406
- return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
407
- }
408
- function St(e, t) {
409
- if (e === t) throw new Error("Cannot compare node with itself");
410
- const n = {
411
- a: Se(e),
412
- b: Se(t)
413
- };
414
- let o;
415
- for (; n.a.at(-1) === n.b.at(-1); )
416
- o = n.a.pop(), n.b.pop();
417
- C(
418
- o,
419
- "Stacking order can only be calculated for elements with a common ancestor"
420
- );
421
- const a = {
422
- a: we(be(n.a)),
423
- b: we(be(n.b))
424
- };
425
- if (a.a === a.b) {
426
- const i = o.childNodes, l = {
427
- a: n.a.at(-1),
428
- b: n.b.at(-1)
429
- };
430
- let r = i.length;
431
- for (; r--; ) {
432
- const s = i[r];
433
- if (s === l.a) return 1;
434
- if (s === l.b) return -1;
435
- }
436
- }
437
- return Math.sign(a.a - a.b);
438
- }
439
- const zt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
440
- function xt(e) {
441
- const t = getComputedStyle(Ae(e) ?? e).display;
442
- return t === "flex" || t === "inline-flex";
443
- }
444
- function Ct(e) {
445
- const t = getComputedStyle(e);
446
- return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || xt(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || zt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
447
- }
448
- function be(e) {
449
- let t = e.length;
450
- for (; t--; ) {
451
- const n = e[t];
452
- if (C(n, "Missing node"), Ct(n)) return n;
453
- }
454
- return null;
455
- }
456
- function we(e) {
457
- return e && Number(getComputedStyle(e).zIndex) || 0;
458
- }
459
- function Se(e) {
460
- const t = [];
461
- for (; e; )
462
- t.push(e), e = Ae(e);
463
- return t;
464
- }
465
- function Ae(e) {
466
- const { parentNode: t } = e;
467
- return wt(t) ? t.host : t;
468
- }
469
- function Lt(e, t) {
470
- return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
471
- }
472
- function Pt({
473
- groupElement: e,
474
- hitRegion: t,
475
- pointerEventTarget: n
476
- }) {
477
- if (!Oe(n) || n.contains(e) || e.contains(n))
478
- return !0;
479
- if (St(n, e) > 0) {
480
- let o = n;
481
- for (; o; ) {
482
- if (o.contains(e))
483
- return !0;
484
- if (Lt(o.getBoundingClientRect(), t))
485
- return !1;
486
- o = o.parentElement;
487
- }
488
- }
489
- return !0;
490
- }
491
- function fe(e, t) {
492
- const n = [];
493
- return t.forEach((o, a) => {
494
- if (a.disabled)
495
- return;
496
- const i = $e(a), l = bt(a.orientation, i, {
497
- x: e.clientX,
498
- y: e.clientY
499
- });
500
- l && l.distance.x <= 0 && l.distance.y <= 0 && Pt({
501
- groupElement: a.element,
502
- hitRegion: l.hitRegion.rect,
503
- pointerEventTarget: e.target
504
- }) && n.push(l.hitRegion);
505
- }), n;
506
- }
507
- function Mt(e, t) {
508
- if (e.length !== t.length)
509
- return !1;
510
- for (let n = 0; n < e.length; n++)
511
- if (e[n] != t[n])
512
- return !1;
513
- return !0;
514
- }
515
- function O(e, t) {
516
- return k(e, t) ? 0 : e > t ? 1 : -1;
517
- }
518
- function K({
519
- overrideDisabledPanels: e,
520
- panelConstraints: t,
521
- prevSize: n,
522
- size: o
523
- }) {
524
- const {
525
- collapsedSize: a = 0,
526
- collapsible: i,
527
- disabled: l,
528
- maxSize: r = 100,
529
- minSize: s = 0
530
- } = t;
531
- if (l && !e)
532
- return n;
533
- if (O(o, s) < 0)
534
- if (i) {
535
- const c = (a + s) / 2;
536
- O(o, c) < 0 ? o = a : o = s;
537
- } else
538
- o = s;
539
- return o = Math.min(r, o), o = j(o), o;
540
- }
541
- function te({
542
- delta: e,
543
- initialLayout: t,
544
- panelConstraints: n,
545
- pivotIndices: o,
546
- prevLayout: a,
547
- trigger: i
548
- }) {
549
- if (k(e, 0))
550
- return t;
551
- const l = i === "imperative-api", r = Object.values(t), s = Object.values(a), c = [...r], [u, S] = o;
552
- C(u != null, "Invalid first pivot index"), C(S != null, "Invalid second pivot index");
553
- let z = 0;
554
- switch (i) {
555
- case "keyboard": {
556
- {
557
- const d = e < 0 ? S : u, p = n[d];
558
- C(
559
- p,
560
- `Panel constraints not found for index ${d}`
561
- );
562
- const {
563
- collapsedSize: f = 0,
564
- collapsible: v,
565
- minSize: y = 0
566
- } = p;
567
- if (v) {
568
- const g = r[d];
569
- if (C(
570
- g != null,
571
- `Previous layout not found for panel index ${d}`
572
- ), k(g, f)) {
573
- const m = y - g;
574
- O(m, Math.abs(e)) > 0 && (e = e < 0 ? 0 - m : m);
575
- }
576
- }
577
- }
578
- {
579
- const d = e < 0 ? u : S, p = n[d];
580
- C(
581
- p,
582
- `No panel constraints found for index ${d}`
583
- );
584
- const {
585
- collapsedSize: f = 0,
586
- collapsible: v,
587
- minSize: y = 0
588
- } = p;
589
- if (v) {
590
- const g = r[d];
591
- if (C(
592
- g != null,
593
- `Previous layout not found for panel index ${d}`
594
- ), k(g, y)) {
595
- const m = g - f;
596
- O(m, Math.abs(e)) > 0 && (e = e < 0 ? 0 - m : m);
597
- }
598
- }
599
- }
600
- break;
601
- }
602
- default: {
603
- const d = e < 0 ? S : u, p = n[d];
604
- C(
605
- p,
606
- `Panel constraints not found for index ${d}`
607
- );
608
- const f = r[d], { collapsible: v, collapsedSize: y, minSize: g } = p;
609
- if (v && O(f, g) < 0)
610
- if (e > 0) {
611
- const m = g - y, L = m / 2, P = f + e;
612
- O(P, g) < 0 && (e = O(e, L) <= 0 ? 0 : m);
613
- } else {
614
- const m = g - y, L = 100 - m / 2, P = f - e;
615
- O(P, g) < 0 && (e = O(100 + e, L) > 0 ? 0 : -m);
616
- }
617
- break;
618
- }
619
- }
620
- {
621
- const d = e < 0 ? 1 : -1;
622
- let p = e < 0 ? S : u, f = 0;
623
- for (; ; ) {
624
- const y = r[p];
625
- C(
626
- y != null,
627
- `Previous layout not found for panel index ${p}`
628
- );
629
- const g = K({
630
- overrideDisabledPanels: l,
631
- panelConstraints: n[p],
632
- prevSize: y,
633
- size: 100
634
- }) - y;
635
- if (f += g, p += d, p < 0 || p >= n.length)
636
- break;
637
- }
638
- const v = Math.min(Math.abs(e), Math.abs(f));
639
- e = e < 0 ? 0 - v : v;
640
- }
641
- {
642
- let d = e < 0 ? u : S;
643
- for (; d >= 0 && d < n.length; ) {
644
- const p = Math.abs(e) - Math.abs(z), f = r[d];
645
- C(
646
- f != null,
647
- `Previous layout not found for panel index ${d}`
648
- );
649
- const v = f - p, y = K({
650
- overrideDisabledPanels: l,
651
- panelConstraints: n[d],
652
- prevSize: f,
653
- size: v
654
- });
655
- if (!k(f, y) && (z += f - y, c[d] = y, z.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
656
- numeric: !0
657
- }) >= 0))
658
- break;
659
- e < 0 ? d-- : d++;
660
- }
661
- }
662
- if (Mt(s, c))
663
- return a;
664
- {
665
- const d = e < 0 ? S : u, p = r[d];
666
- C(
667
- p != null,
668
- `Previous layout not found for panel index ${d}`
669
- );
670
- const f = p + z, v = K({
671
- overrideDisabledPanels: l,
672
- panelConstraints: n[d],
673
- prevSize: p,
674
- size: f
675
- });
676
- if (c[d] = v, !k(v, f)) {
677
- let y = f - v, g = e < 0 ? S : u;
678
- for (; g >= 0 && g < n.length; ) {
679
- const m = c[g];
680
- C(
681
- m != null,
682
- `Previous layout not found for panel index ${g}`
683
- );
684
- const L = m + y, P = K({
685
- overrideDisabledPanels: l,
686
- panelConstraints: n[g],
687
- prevSize: m,
688
- size: L
689
- });
690
- if (k(m, P) || (y -= P - m, c[g] = P), k(y, 0))
691
- break;
692
- e > 0 ? g-- : g++;
693
- }
694
- }
695
- }
696
- const b = Object.values(c).reduce(
697
- (d, p) => p + d,
698
- 0
699
- );
700
- if (!k(b, 100, 0.1))
701
- return a;
702
- const h = Object.keys(a);
703
- return c.reduce((d, p, f) => (d[h[f]] = p, d), {});
704
- }
705
- function Y(e, t) {
706
- if (Object.keys(e).length !== Object.keys(t).length)
707
- return !1;
708
- for (const n in e)
709
- if (t[n] === void 0 || O(e[n], t[n]) !== 0)
710
- return !1;
711
- return !0;
712
- }
713
- function _({
714
- layout: e,
715
- panelConstraints: t
716
- }) {
717
- const n = Object.values(e), o = [...n], a = o.reduce(
718
- (r, s) => r + s,
719
- 0
720
- );
721
- if (o.length !== t.length)
722
- throw Error(
723
- `Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
724
- );
725
- if (!k(a, 100) && o.length > 0)
726
- for (let r = 0; r < t.length; r++) {
727
- const s = o[r];
728
- C(s != null, `No layout data found for index ${r}`);
729
- const c = 100 / a * s;
730
- o[r] = c;
731
- }
732
- let i = 0;
733
- for (let r = 0; r < t.length; r++) {
734
- const s = n[r];
735
- C(s != null, `No layout data found for index ${r}`);
736
- const c = o[r];
737
- C(c != null, `No layout data found for index ${r}`);
738
- const u = K({
739
- overrideDisabledPanels: !0,
740
- panelConstraints: t[r],
741
- prevSize: s,
742
- size: c
743
- });
744
- c != u && (i += c - u, o[r] = u);
745
- }
746
- if (!k(i, 0))
747
- for (let r = 0; r < t.length; r++) {
748
- const s = o[r];
749
- C(s != null, `No layout data found for index ${r}`);
750
- const c = s + i, u = K({
751
- overrideDisabledPanels: !0,
752
- panelConstraints: t[r],
753
- prevSize: s,
754
- size: c
755
- });
756
- if (s !== u && (i -= u - s, o[r] = u, k(i, 0)))
757
- break;
758
- }
759
- const l = Object.keys(e);
760
- return o.reduce((r, s, c) => (r[l[c]] = s, r), {});
761
- }
762
- function We({
763
- groupId: e,
764
- panelId: t
765
- }) {
766
- const n = () => {
767
- const { mountedGroups: r } = D();
768
- for (const [
769
- s,
770
- {
771
- defaultLayoutDeferred: c,
772
- derivedPanelConstraints: u,
773
- layout: S,
774
- separatorToPanels: z
775
- }
776
- ] of r)
777
- if (s.id === e)
778
- return {
779
- defaultLayoutDeferred: c,
780
- derivedPanelConstraints: u,
781
- group: s,
782
- layout: S,
783
- separatorToPanels: z
784
- };
785
- throw Error(`Group ${e} not found`);
786
- }, o = () => {
787
- const r = n().derivedPanelConstraints.find(
788
- (s) => s.panelId === t
789
- );
790
- if (r !== void 0)
791
- return r;
792
- throw Error(`Panel constraints not found for Panel ${t}`);
793
- }, a = () => {
794
- const r = n().group.panels.find((s) => s.id === t);
795
- if (r !== void 0)
796
- return r;
797
- throw Error(`Layout not found for Panel ${t}`);
798
- }, i = () => {
799
- const r = n().layout[t];
800
- if (r !== void 0)
801
- return r;
802
- throw Error(`Layout not found for Panel ${t}`);
803
- }, l = (r) => {
804
- const s = i();
805
- if (r === s)
806
- return;
807
- const {
808
- defaultLayoutDeferred: c,
809
- derivedPanelConstraints: u,
810
- group: S,
811
- layout: z,
812
- separatorToPanels: b
813
- } = n(), h = S.panels.findIndex((v) => v.id === t), d = h === S.panels.length - 1, p = te({
814
- delta: d ? s - r : r - s,
815
- initialLayout: z,
816
- panelConstraints: u,
817
- pivotIndices: d ? [h - 1, h] : [h, h + 1],
818
- prevLayout: z,
819
- trigger: "imperative-api"
820
- }), f = _({
821
- layout: p,
822
- panelConstraints: u
823
- });
824
- Y(z, f) || R((v) => ({
825
- mountedGroups: new Map(v.mountedGroups).set(S, {
826
- defaultLayoutDeferred: c,
827
- derivedPanelConstraints: u,
828
- layout: f,
829
- separatorToPanels: b
830
- })
831
- }));
832
- };
833
- return {
834
- collapse: () => {
835
- const { collapsible: r, collapsedSize: s } = o(), { mutableValues: c } = a(), u = i();
836
- r && u !== s && (c.expandToSize = u, l(s));
837
- },
838
- expand: () => {
839
- const { collapsible: r, collapsedSize: s, minSize: c } = o(), { mutableValues: u } = a(), S = i();
840
- if (r && S === s) {
841
- let z = u.expandToSize ?? c;
842
- z === 0 && (z = 1), l(z);
843
- }
844
- },
845
- getSize: () => {
846
- const { group: r } = n(), s = i(), { element: c } = a(), u = r.orientation === "horizontal" ? c.offsetWidth : c.offsetHeight;
847
- return {
848
- asPercentage: s,
849
- inPixels: u
850
- };
851
- },
852
- isCollapsed: () => {
853
- const { collapsible: r, collapsedSize: s } = o(), c = i();
854
- return r && k(s, c);
855
- },
856
- resize: (r) => {
857
- if (i() !== r) {
858
- let s;
859
- switch (typeof r) {
860
- case "number": {
861
- const { group: c } = n(), u = Z({ group: c });
862
- s = j(r / u * 100);
863
- break;
864
- }
865
- case "string": {
866
- s = parseFloat(r);
867
- break;
868
- }
869
- }
870
- l(s);
871
- }
872
- }
873
- };
874
- }
875
- function ze(e) {
876
- if (e.defaultPrevented)
877
- return;
878
- const { mountedGroups: t } = D();
879
- fe(e, t).forEach((n) => {
880
- if (n.separator) {
881
- const o = n.panels.find(
882
- (a) => a.panelConstraints.defaultSize !== void 0
883
- );
884
- if (o) {
885
- const a = o.panelConstraints.defaultSize, i = We({
886
- groupId: n.group.id,
887
- panelId: o.id
888
- });
889
- i && a !== void 0 && (i.resize(a), e.preventDefault());
890
- }
891
- }
892
- });
893
- }
894
- function ie(e) {
895
- const { mountedGroups: t } = D();
896
- for (const [n] of t)
897
- if (n.separators.some(
898
- (o) => o.element === e
899
- ))
900
- return n;
901
- throw Error("Could not find parent Group for separator element");
902
- }
903
- function He({
904
- groupId: e
905
- }) {
906
- const t = () => {
907
- const { mountedGroups: n } = D();
908
- for (const [o, a] of n)
909
- if (o.id === e)
910
- return { group: o, ...a };
911
- throw Error(`Could not find Group with id "${e}"`);
912
- };
913
- return {
914
- getLayout() {
915
- const { defaultLayoutDeferred: n, layout: o } = t();
916
- return n ? {} : o;
917
- },
918
- setLayout(n) {
919
- const {
920
- defaultLayoutDeferred: o,
921
- derivedPanelConstraints: a,
922
- group: i,
923
- layout: l,
924
- separatorToPanels: r
925
- } = t(), s = _({
926
- layout: n,
927
- panelConstraints: a
928
- });
929
- if (o)
930
- return l;
931
- if (!Y(l, s)) {
932
- R((u) => ({
933
- mountedGroups: new Map(u.mountedGroups).set(i, {
934
- defaultLayoutDeferred: o,
935
- derivedPanelConstraints: a,
936
- layout: s,
937
- separatorToPanels: r
938
- })
939
- }));
940
- const c = i.panels.map(({ id: u }) => u).join(",");
941
- i.inMemoryLayouts[c] = s;
942
- }
943
- return s;
944
- }
945
- };
946
- }
947
- function Ve(e) {
948
- const { mountedGroups: t } = D(), n = t.get(e);
949
- return C(n, `Mounted Group ${e.id} not found`), n;
950
- }
951
- function X(e, t) {
952
- const n = ie(e), o = Ve(n), a = n.separators.find(
953
- (u) => u.element === e
954
- );
955
- C(a, "Matching separator not found");
956
- const i = o.separatorToPanels.get(a);
957
- C(i, "Matching panels not found");
958
- const l = i.map((u) => n.panels.indexOf(u)), r = He({ groupId: n.id }).getLayout(), s = te({
959
- delta: t,
960
- initialLayout: r,
961
- panelConstraints: o.derivedPanelConstraints,
962
- pivotIndices: l,
963
- prevLayout: r,
964
- trigger: "keyboard"
965
- }), c = _({
966
- layout: s,
967
- panelConstraints: o.derivedPanelConstraints
968
- });
969
- Y(r, c) || R((u) => ({
970
- mountedGroups: new Map(u.mountedGroups).set(n, {
971
- defaultLayoutDeferred: o.defaultLayoutDeferred,
972
- derivedPanelConstraints: o.derivedPanelConstraints,
973
- layout: c,
974
- separatorToPanels: o.separatorToPanels
975
- })
976
- }));
977
- }
978
- function xe(e) {
979
- if (e.defaultPrevented)
980
- return;
981
- const t = e.currentTarget, n = ie(t);
982
- if (!n.disabled)
983
- switch (e.key) {
984
- case "ArrowDown": {
985
- e.preventDefault(), n.orientation === "vertical" && X(t, 5);
986
- break;
987
- }
988
- case "ArrowLeft": {
989
- e.preventDefault(), n.orientation === "horizontal" && X(t, -5);
990
- break;
991
- }
992
- case "ArrowRight": {
993
- e.preventDefault(), n.orientation === "horizontal" && X(t, 5);
994
- break;
995
- }
996
- case "ArrowUp": {
997
- e.preventDefault(), n.orientation === "vertical" && X(t, -5);
998
- break;
999
- }
1000
- case "End": {
1001
- e.preventDefault(), X(t, 100);
1002
- break;
1003
- }
1004
- case "Enter": {
1005
- e.preventDefault();
1006
- const o = ie(t), { derivedPanelConstraints: a, layout: i, separatorToPanels: l } = Ve(o), r = o.separators.find(
1007
- (S) => S.element === t
1008
- );
1009
- C(r, "Matching separator not found");
1010
- const s = l.get(r);
1011
- C(s, "Matching panels not found");
1012
- const c = s[0], u = a.find(
1013
- (S) => S.panelId === c.id
1014
- );
1015
- if (C(u, "Panel metadata not found"), u.collapsible) {
1016
- const S = i[c.id], z = u.collapsedSize === S ? o.inMemoryLastExpandedPanelSizes[c.id] ?? u.minSize : u.collapsedSize;
1017
- X(t, z - S);
1018
- }
1019
- break;
1020
- }
1021
- case "F6": {
1022
- e.preventDefault();
1023
- const o = ie(t).separators.map(
1024
- (l) => l.element
1025
- ), a = Array.from(o).findIndex(
1026
- (l) => l === e.currentTarget
1027
- );
1028
- C(a !== null, "Index not found");
1029
- const i = e.shiftKey ? a > 0 ? a - 1 : o.length - 1 : a + 1 < o.length ? a + 1 : 0;
1030
- o[i].focus();
1031
- break;
1032
- }
1033
- case "Home": {
1034
- e.preventDefault(), X(t, -100);
1035
- break;
1036
- }
1037
- }
1038
- }
1039
- function Ce(e) {
1040
- if (e.defaultPrevented || e.pointerType === "mouse" && e.button > 0)
1041
- return;
1042
- const { mountedGroups: t } = D(), n = fe(e, t), o = /* @__PURE__ */ new Map();
1043
- let a = !1;
1044
- n.forEach((i) => {
1045
- i.separator && (a || (a = !0, i.separator.element.focus()));
1046
- const l = t.get(i.group);
1047
- l && o.set(i.group, l.layout);
1048
- }), R({
1049
- interactionState: {
1050
- hitRegions: n,
1051
- initialLayoutMap: o,
1052
- pointerDownAtPoint: { x: e.clientX, y: e.clientY },
1053
- state: "active"
1054
- }
1055
- }), n.length && e.preventDefault();
1056
- }
1057
- const Et = (e) => e, le = () => {
1058
- }, Be = 1, Xe = 2, Ye = 4, _e = 8, Le = 3, Pe = 12;
1059
- let ae;
1060
- function Me() {
1061
- return ae === void 0 && (ae = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (ae = !0)), ae;
1062
- }
1063
- function kt({
1064
- cursorFlags: e,
1065
- groups: t,
1066
- state: n
1067
- }) {
1068
- let o = 0, a = 0;
1069
- switch (n) {
1070
- case "active":
1071
- case "hover":
1072
- t.forEach((i) => {
1073
- if (!i.disableCursor)
1074
- switch (i.orientation) {
1075
- case "horizontal": {
1076
- o++;
1077
- break;
1078
- }
1079
- case "vertical": {
1080
- a++;
1081
- break;
1082
- }
1083
- }
1084
- });
1085
- }
1086
- if (!(o === 0 && a === 0)) {
1087
- switch (n) {
1088
- case "active": {
1089
- if (e && Me()) {
1090
- const i = (e & Be) !== 0, l = (e & Xe) !== 0, r = (e & Ye) !== 0, s = (e & _e) !== 0;
1091
- if (i)
1092
- return r ? "se-resize" : s ? "ne-resize" : "e-resize";
1093
- if (l)
1094
- return r ? "sw-resize" : s ? "nw-resize" : "w-resize";
1095
- if (r)
1096
- return "s-resize";
1097
- if (s)
1098
- return "n-resize";
1099
- }
1100
- break;
1101
- }
1102
- }
1103
- return Me() ? o > 0 && a > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && a > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
1104
- }
1105
- }
1106
- const Ee = /* @__PURE__ */ new WeakMap();
1107
- function pe(e) {
1108
- if (e.defaultView === null || e.defaultView === void 0)
1109
- return;
1110
- let { prevStyle: t, styleSheet: n } = Ee.get(e) ?? {};
1111
- n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets.push(n));
1112
- const { cursorFlags: o, interactionState: a } = D();
1113
- switch (a.state) {
1114
- case "active":
1115
- case "hover": {
1116
- const i = kt({
1117
- cursorFlags: o,
1118
- groups: a.hitRegions.map((r) => r.group),
1119
- state: a.state
1120
- }), l = `*, *:hover {cursor: ${i} !important; }`;
1121
- if (t === l)
1122
- return;
1123
- t = l, i ? n.cssRules.length === 0 ? n.insertRule(l) : n.replaceSync(l) : n.cssRules.length === 1 && n.deleteRule(0);
1124
- break;
1125
- }
1126
- case "inactive": {
1127
- t = void 0, n.cssRules.length === 1 && n.deleteRule(0);
1128
- break;
1129
- }
1130
- }
1131
- Ee.set(e, {
1132
- prevStyle: t,
1133
- styleSheet: n
1134
- });
1135
- }
1136
- function Je({
1137
- document: e,
1138
- event: t,
1139
- hitRegions: n,
1140
- initialLayoutMap: o,
1141
- mountedGroups: a,
1142
- pointerDownAtPoint: i,
1143
- prevCursorFlags: l
1144
- }) {
1145
- let r = 0;
1146
- const s = new Map(a);
1147
- n.forEach((u) => {
1148
- const { group: S, groupSize: z } = u, { disableCursor: b, orientation: h, panels: d } = S;
1149
- let p = 0;
1150
- i ? h === "horizontal" ? p = (t.clientX - i.x) / z * 100 : p = (t.clientY - i.y) / z * 100 : h === "horizontal" ? p = t.clientX < 0 ? -100 : 100 : p = t.clientY < 0 ? -100 : 100;
1151
- const f = o.get(S), {
1152
- defaultLayoutDeferred: v,
1153
- derivedPanelConstraints: y,
1154
- layout: g,
1155
- separatorToPanels: m
1156
- } = a.get(S) ?? { defaultLayoutDeferred: !1 };
1157
- if (y && f && g && m) {
1158
- const L = te({
1159
- delta: p,
1160
- initialLayout: f,
1161
- panelConstraints: y,
1162
- pivotIndices: u.panels.map((P) => d.indexOf(P)),
1163
- prevLayout: g,
1164
- trigger: "mouse-or-touch"
1165
- });
1166
- if (Y(L, g)) {
1167
- if (p !== 0 && !b)
1168
- switch (h) {
1169
- case "horizontal": {
1170
- r |= p < 0 ? Be : Xe;
1171
- break;
1172
- }
1173
- case "vertical": {
1174
- r |= p < 0 ? Ye : _e;
1175
- break;
1176
- }
1177
- }
1178
- } else {
1179
- s.set(u.group, {
1180
- defaultLayoutDeferred: v,
1181
- derivedPanelConstraints: y,
1182
- layout: L,
1183
- separatorToPanels: m
1184
- });
1185
- const P = u.group.panels.map(({ id: M }) => M).join(",");
1186
- u.group.inMemoryLayouts[P] = L;
1187
- }
1188
- }
1189
- });
1190
- let c = 0;
1191
- t.movementX === 0 ? c |= l & Le : c |= r & Le, t.movementY === 0 ? c |= l & Pe : c |= r & Pe, R({
1192
- cursorFlags: c,
1193
- mountedGroups: s
1194
- }), pe(e);
1195
- }
1196
- function ke(e) {
1197
- const { cursorFlags: t, interactionState: n, mountedGroups: o } = D();
1198
- n.state === "active" && Je({
1199
- document: e.currentTarget,
1200
- event: e,
1201
- hitRegions: n.hitRegions,
1202
- initialLayoutMap: n.initialLayoutMap,
1203
- mountedGroups: o,
1204
- prevCursorFlags: t
1205
- });
1206
- }
1207
- function De(e) {
1208
- if (e.defaultPrevented)
1209
- return;
1210
- const { cursorFlags: t, interactionState: n, mountedGroups: o } = D();
1211
- switch (n.state) {
1212
- case "active": {
1213
- if (
1214
- // Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
1215
- e.buttons === 0
1216
- ) {
1217
- R(
1218
- (a) => a.interactionState.state === "inactive" ? a : {
1219
- cursorFlags: 0,
1220
- interactionState: { state: "inactive" }
1221
- }
1222
- ), R((a) => ({
1223
- mountedGroups: new Map(a.mountedGroups)
1224
- }));
1225
- return;
1226
- }
1227
- Je({
1228
- document: e.currentTarget,
1229
- event: e,
1230
- hitRegions: n.hitRegions,
1231
- initialLayoutMap: n.initialLayoutMap,
1232
- mountedGroups: o,
1233
- pointerDownAtPoint: n.pointerDownAtPoint,
1234
- prevCursorFlags: t
1235
- });
1236
- break;
1237
- }
1238
- default: {
1239
- const a = fe(e, o);
1240
- a.length === 0 ? n.state !== "inactive" && R({
1241
- interactionState: {
1242
- state: "inactive"
1243
- }
1244
- }) : R({
1245
- interactionState: {
1246
- hitRegions: a,
1247
- state: "hover"
1248
- }
1249
- }), pe(e.currentTarget);
1250
- break;
1251
- }
1252
- }
1253
- }
1254
- function Re(e) {
1255
- if (e.relatedTarget instanceof HTMLIFrameElement) {
1256
- const { interactionState: t } = D();
1257
- t.state === "hover" && R({
1258
- interactionState: {
1259
- state: "inactive"
1260
- }
1261
- });
1262
- }
1263
- }
1264
- function Ge(e) {
1265
- if (e.defaultPrevented || e.pointerType === "mouse" && e.button > 0)
1266
- return;
1267
- const { interactionState: t } = D();
1268
- t.state === "active" && (R({
1269
- cursorFlags: 0,
1270
- interactionState: {
1271
- state: "inactive"
1272
- }
1273
- }), t.hitRegions.length > 0 && (pe(e.currentTarget), R((n) => ({
1274
- mountedGroups: new Map(n.mountedGroups)
1275
- })), e.preventDefault()));
1276
- }
1277
- function Te(e) {
1278
- let t = 0, n = 0;
1279
- const o = {};
1280
- for (const i of e)
1281
- if (i.defaultSize !== void 0) {
1282
- t++;
1283
- const l = j(i.defaultSize);
1284
- n += l, o[i.panelId] = l;
1285
- } else
1286
- o[i.panelId] = void 0;
1287
- const a = e.length - t;
1288
- if (a !== 0) {
1289
- const i = j((100 - n) / a);
1290
- for (const l of e)
1291
- l.defaultSize === void 0 && (o[l.panelId] = i);
1292
- }
1293
- return o;
1294
- }
1295
- function Dt(e, t, n) {
1296
- if (!n[0])
1297
- return;
1298
- const o = e.panels.find((s) => s.element === t);
1299
- if (!o || !o.onResize)
1300
- return;
1301
- const a = Z({ group: e }), i = e.orientation === "horizontal" ? o.element.offsetWidth : o.element.offsetHeight, l = o.mutableValues.prevSize, r = {
1302
- asPercentage: j(i / a * 100),
1303
- inPixels: i
1304
- };
1305
- o.mutableValues.prevSize = r, o.onResize(r, o.id, l);
1306
- }
1307
- function Rt(e, t) {
1308
- if (Object.keys(e).length !== Object.keys(t).length)
1309
- return !1;
1310
- for (const n in e)
1311
- if (e[n] !== t[n])
1312
- return !1;
1313
- return !0;
1314
- }
1315
- function Gt(e, t) {
1316
- const n = e.map((a) => a.id), o = Object.keys(t);
1317
- if (n.length !== o.length)
1318
- return !1;
1319
- for (const a of n)
1320
- if (!o.includes(a))
1321
- return !1;
1322
- return !0;
1323
- }
1324
- const q = /* @__PURE__ */ new Map();
1325
- function Tt(e) {
1326
- let t = !0;
1327
- C(
1328
- e.element.ownerDocument.defaultView,
1329
- "Cannot register an unmounted Group"
1330
- );
1331
- const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), i = new n((h) => {
1332
- for (const d of h) {
1333
- const { borderBoxSize: p, target: f } = d;
1334
- if (f === e.element) {
1335
- if (t) {
1336
- if (Z({ group: e }) === 0)
1337
- return;
1338
- R((v) => {
1339
- const y = v.mountedGroups.get(e);
1340
- if (y) {
1341
- const g = ce(e), m = y.defaultLayoutDeferred ? Te(g) : y.layout, L = _({
1342
- layout: m,
1343
- panelConstraints: g
1344
- });
1345
- return !y.defaultLayoutDeferred && Y(m, L) && Rt(
1346
- y.derivedPanelConstraints,
1347
- g
1348
- ) ? v : {
1349
- mountedGroups: new Map(v.mountedGroups).set(e, {
1350
- defaultLayoutDeferred: !1,
1351
- derivedPanelConstraints: g,
1352
- layout: L,
1353
- separatorToPanels: y.separatorToPanels
1354
- })
1355
- };
1356
- }
1357
- return v;
1358
- });
1359
- }
1360
- } else
1361
- Dt(e, f, p);
1362
- }
1363
- });
1364
- i.observe(e.element), e.panels.forEach((h) => {
1365
- C(
1366
- !o.has(h.id),
1367
- `Panel ids must be unique; id "${h.id}" was used more than once`
1368
- ), o.add(h.id), h.onResize && i.observe(h.element);
1369
- });
1370
- const l = Z({ group: e }), r = ce(e), s = e.panels.map(({ id: h }) => h).join(",");
1371
- let c = e.defaultLayout;
1372
- c && (Gt(e.panels, c) || (c = void 0));
1373
- const u = e.inMemoryLayouts[s] ?? c ?? Te(r), S = _({
1374
- layout: u,
1375
- panelConstraints: r
1376
- }), z = $e(e), b = e.element.ownerDocument;
1377
- return R((h) => {
1378
- const d = /* @__PURE__ */ new Map();
1379
- return q.set(
1380
- b,
1381
- (q.get(b) ?? 0) + 1
1382
- ), z.forEach((p) => {
1383
- p.separator && d.set(p.separator, p.panels);
1384
- }), {
1385
- mountedGroups: new Map(h.mountedGroups).set(e, {
1386
- defaultLayoutDeferred: l === 0,
1387
- derivedPanelConstraints: r,
1388
- layout: S,
1389
- separatorToPanels: d
1390
- })
1391
- };
1392
- }), e.separators.forEach((h) => {
1393
- C(
1394
- !a.has(h.id),
1395
- `Separator ids must be unique; id "${h.id}" was used more than once`
1396
- ), a.add(h.id), h.element.addEventListener("keydown", xe);
1397
- }), q.get(b) === 1 && (b.addEventListener("dblclick", ze, !0), b.addEventListener("pointerdown", Ce, !0), b.addEventListener("pointerleave", ke), b.addEventListener("pointermove", De), b.addEventListener("pointerout", Re), b.addEventListener("pointerup", Ge, !0)), function() {
1398
- t = !1, q.set(
1399
- b,
1400
- Math.max(0, (q.get(b) ?? 0) - 1)
1401
- ), R((h) => {
1402
- const d = new Map(h.mountedGroups);
1403
- return d.delete(e), { mountedGroups: d };
1404
- }), e.separators.forEach((h) => {
1405
- h.element.removeEventListener("keydown", xe);
1406
- }), q.get(b) || (b.removeEventListener(
1407
- "dblclick",
1408
- ze,
1409
- !0
1410
- ), b.removeEventListener(
1411
- "pointerdown",
1412
- Ce,
1413
- !0
1414
- ), b.removeEventListener("pointerleave", ke), b.removeEventListener("pointermove", De), b.removeEventListener("pointerout", Re), b.removeEventListener("pointerup", Ge, !0)), i.disconnect();
1415
- };
1416
- }
1417
- function It() {
1418
- const [e, t] = ue({}), n = Ie(() => t({}), []);
1419
- return [e, n];
1420
- }
1421
- function me(e) {
1422
- const t = at();
1423
- return `${e ?? t}`;
1424
- }
1425
- const J = typeof window < "u" ? st : se;
1426
- function ee(e) {
1427
- const t = F(e);
1428
- return J(() => {
1429
- t.current = e;
1430
- }, [e]), Ie(
1431
- (...n) => t.current?.(...n),
1432
- [t]
1433
- );
1434
- }
1435
- function he(...e) {
1436
- return ee((t) => {
1437
- e.forEach((n) => {
1438
- if (n)
1439
- switch (typeof n) {
1440
- case "function": {
1441
- n(t);
1442
- break;
1443
- }
1444
- case "object": {
1445
- n.current = t;
1446
- break;
1447
- }
1448
- }
1449
- });
1450
- });
1451
- }
1452
- function ge(e) {
1453
- const t = F({ ...e });
1454
- return J(() => {
1455
- for (const n in e)
1456
- t.current[n] = e[n];
1457
- }, [e]), t.current;
1458
- }
1459
- const Ue = ot(null);
1460
- function Nt(e, t) {
1461
- const n = F({
1462
- getLayout: () => ({}),
1463
- setLayout: Et
1464
- });
1465
- Ne(t, () => n.current, []), J(() => {
1466
- Object.assign(
1467
- n.current,
1468
- He({ groupId: e })
1469
- );
1470
- });
1471
- }
1472
- function qe({
1473
- children: e,
1474
- className: t,
1475
- defaultLayout: n,
1476
- disableCursor: o,
1477
- disabled: a,
1478
- elementRef: i,
1479
- groupRef: l,
1480
- id: r,
1481
- onLayoutChange: s,
1482
- onLayoutChanged: c,
1483
- orientation: u = "horizontal",
1484
- resizeTargetMinimumSize: S = {
1485
- coarse: 20,
1486
- fine: 10
1487
- },
1488
- style: z,
1489
- ...b
1490
- }) {
1491
- const h = F({
1492
- onLayoutChange: {},
1493
- onLayoutChanged: {}
1494
- }), d = ee((w) => {
1495
- Y(h.current.onLayoutChange, w) || (h.current.onLayoutChange = w, s?.(w));
1496
- }), p = ee((w) => {
1497
- Y(h.current.onLayoutChanged, w) || (h.current.onLayoutChanged = w, c?.(w));
1498
- }), f = me(r), v = F(null), [y, g] = It(), m = F({
1499
- lastExpandedPanelSizes: {},
1500
- layouts: {},
1501
- panels: [],
1502
- resizeTargetMinimumSize: S,
1503
- separators: []
1504
- }), L = he(v, i);
1505
- Nt(f, l);
1506
- const P = ee(
1507
- (w, x) => {
1508
- const { interactionState: E, mountedGroups: G } = D();
1509
- for (const T of G.keys())
1510
- if (T.id === w) {
1511
- const N = G.get(T);
1512
- if (N) {
1513
- let V = !1;
1514
- return E.state === "active" && (V = E.hitRegions.some(
1515
- (Q) => Q.group === T
1516
- )), {
1517
- flexGrow: N.layout[x] ?? 1,
1518
- pointerEvents: V ? "none" : void 0
1519
- };
1520
- }
1521
- }
1522
- return {
1523
- flexGrow: n?.[x] ?? 1
1524
- };
1525
- }
1526
- ), M = ge({
1527
- defaultLayout: n,
1528
- disableCursor: o
1529
- }), U = lt(
1530
- () => ({
1531
- get disableCursor() {
1532
- return !!M.disableCursor;
1533
- },
1534
- getPanelStyles: P,
1535
- id: f,
1536
- orientation: u,
1537
- registerPanel: (w) => {
1538
- const x = m.current;
1539
- return x.panels = de(u, [
1540
- ...x.panels,
1541
- w
1542
- ]), g(), () => {
1543
- x.panels = x.panels.filter(
1544
- (E) => E !== w
1545
- ), g();
1546
- };
1547
- },
1548
- registerSeparator: (w) => {
1549
- const x = m.current;
1550
- return x.separators = de(u, [
1551
- ...x.separators,
1552
- w
1553
- ]), g(), () => {
1554
- x.separators = x.separators.filter(
1555
- (E) => E !== w
1556
- ), g();
1557
- };
1558
- },
1559
- togglePanelDisabled: (w, x) => {
1560
- const E = m.current.panels.find(
1561
- (T) => T.id === w
1562
- );
1563
- E && (E.panelConstraints.disabled = x);
1564
- const { mountedGroups: G } = D();
1565
- for (const T of G.keys())
1566
- if (T.id === f) {
1567
- const N = G.get(T);
1568
- N && (N.derivedPanelConstraints = ce(T));
1569
- }
1570
- },
1571
- toggleSeparatorDisabled: (w, x) => {
1572
- const E = m.current.separators.find(
1573
- (G) => G.id === w
1574
- );
1575
- E && (E.disabled = x);
1576
- }
1577
- }),
1578
- [P, f, g, u, M]
1579
- ), H = F(null);
1580
- return J(() => {
1581
- const w = v.current;
1582
- if (w === null)
1583
- return;
1584
- const x = m.current;
1585
- let E;
1586
- if (M.defaultLayout !== void 0 && Object.keys(M.defaultLayout).length === x.panels.length) {
1587
- E = {};
1588
- for (const W of x.panels) {
1589
- const B = M.defaultLayout[W.id];
1590
- B !== void 0 && (E[W.id] = B);
1591
- }
1592
- }
1593
- const G = {
1594
- defaultLayout: E,
1595
- disableCursor: !!M.disableCursor,
1596
- disabled: !!a,
1597
- element: w,
1598
- id: f,
1599
- inMemoryLastExpandedPanelSizes: m.current.lastExpandedPanelSizes,
1600
- inMemoryLayouts: m.current.layouts,
1601
- orientation: u,
1602
- panels: x.panels,
1603
- resizeTargetMinimumSize: x.resizeTargetMinimumSize,
1604
- separators: x.separators
1605
- };
1606
- H.current = G;
1607
- const T = Tt(G), N = D().mountedGroups.get(G);
1608
- if (N) {
1609
- const { defaultLayoutDeferred: W, derivedPanelConstraints: B, layout: ne } = N;
1610
- !W && B.length > 0 && (d(ne), p(ne));
1611
- }
1612
- const V = A.addListener(
1613
- "interactionStateChange",
1614
- (W) => {
1615
- W.state;
1616
- }
1617
- ), Q = A.addListener(
1618
- "mountedGroupsChange",
1619
- (W) => {
1620
- const B = W.get(G);
1621
- if (B) {
1622
- const { defaultLayoutDeferred: ne, derivedPanelConstraints: Qe, layout: ye } = B;
1623
- if (ne || Qe.length === 0)
1624
- return;
1625
- const { interactionState: et } = D(), tt = et.state !== "active";
1626
- d(ye), tt && p(ye);
1627
- }
1628
- }
1629
- );
1630
- return () => {
1631
- H.current = null, T(), V(), Q();
1632
- };
1633
- }, [
1634
- a,
1635
- f,
1636
- p,
1637
- d,
1638
- u,
1639
- y,
1640
- M
1641
- ]), se(() => {
1642
- const w = H.current;
1643
- w && (w.defaultLayout = n, w.disableCursor = !!o);
1644
- }), /* @__PURE__ */ $.jsx(Ue.Provider, { value: U, children: /* @__PURE__ */ $.jsx(
1645
- "div",
1646
- {
1647
- ...b,
1648
- className: t,
1649
- "data-group": !0,
1650
- "data-testid": f,
1651
- id: f,
1652
- ref: L,
1653
- style: {
1654
- height: "100%",
1655
- width: "100%",
1656
- overflow: "hidden",
1657
- ...z,
1658
- display: "flex",
1659
- flexDirection: u === "horizontal" ? "row" : "column",
1660
- flexWrap: "nowrap",
1661
- // Inform the browser that the library is handling touch events for this element
1662
- // but still allow users to scroll content within panels in the non-resizing direction
1663
- // NOTE This is not an inherited style
1664
- // See github.com/bvaughn/react-resizable-panels/issues/662
1665
- touchAction: u === "horizontal" ? "pan-y" : "pan-x"
1666
- },
1667
- children: e
1668
- }
1669
- ) });
1670
- }
1671
- qe.displayName = "Group";
1672
- function ve() {
1673
- const e = it(Ue);
1674
- return C(
1675
- e,
1676
- "Group Context not found; did you render a Panel or Separator outside of a Group?"
1677
- ), e;
1678
- }
1679
- function jt(e, t) {
1680
- const { id: n } = ve(), o = F({
1681
- collapse: le,
1682
- expand: le,
1683
- getSize: () => ({
1684
- asPercentage: 0,
1685
- inPixels: 0
1686
- }),
1687
- isCollapsed: () => !1,
1688
- resize: le
1689
- });
1690
- Ne(t, () => o.current, []), J(() => {
1691
- Object.assign(
1692
- o.current,
1693
- We({ groupId: n, panelId: e })
1694
- );
1695
- });
1696
- }
1697
- function Ke({
1698
- children: e,
1699
- className: t,
1700
- collapsedSize: n = "0%",
1701
- collapsible: o = !1,
1702
- defaultSize: a,
1703
- disabled: i,
1704
- elementRef: l,
1705
- id: r,
1706
- maxSize: s = "100%",
1707
- minSize: c = "0%",
1708
- onResize: u,
1709
- panelRef: S,
1710
- style: z,
1711
- ...b
1712
- }) {
1713
- const h = !!r, d = me(r), p = ge({
1714
- disabled: i
1715
- }), f = F(null), v = he(f, l), {
1716
- getPanelStyles: y,
1717
- id: g,
1718
- orientation: m,
1719
- registerPanel: L,
1720
- togglePanelDisabled: P
1721
- } = ve(), M = u !== null, U = ee(
1722
- (w, x, E) => {
1723
- u?.(w, r, E);
1724
- }
1725
- );
1726
- J(() => {
1727
- const w = f.current;
1728
- if (w !== null) {
1729
- const x = {
1730
- element: w,
1731
- id: d,
1732
- idIsStable: h,
1733
- mutableValues: {
1734
- expandToSize: void 0,
1735
- prevSize: void 0
1736
- },
1737
- onResize: M ? U : void 0,
1738
- panelConstraints: {
1739
- collapsedSize: n,
1740
- collapsible: o,
1741
- defaultSize: a,
1742
- disabled: p.disabled,
1743
- maxSize: s,
1744
- minSize: c
1745
- }
1746
- };
1747
- return L(x);
1748
- }
1749
- }, [
1750
- n,
1751
- o,
1752
- a,
1753
- M,
1754
- d,
1755
- h,
1756
- s,
1757
- c,
1758
- U,
1759
- L,
1760
- p
1761
- ]), se(() => {
1762
- P(d, !!i);
1763
- }, [i, d, P]), jt(d, S);
1764
- const H = rt(
1765
- (w) => (A.addListener("mountedGroupsChange", w), () => {
1766
- A.removeListener("mountedGroupsChange", w);
1767
- }),
1768
- // useSyncExternalStore does not support a custom equality check
1769
- // stringify avoids re-rendering when the style value hasn't changed
1770
- () => JSON.stringify(y(g, d)),
1771
- () => JSON.stringify(y(g, d))
1772
- );
1773
- return /* @__PURE__ */ $.jsx(
1774
- "div",
1775
- {
1776
- ...b,
1777
- "aria-disabled": i || void 0,
1778
- "data-panel": !0,
1779
- "data-testid": d,
1780
- id: d,
1781
- ref: v,
1782
- style: {
1783
- ...Ot,
1784
- display: "flex",
1785
- flexBasis: 0,
1786
- flexShrink: 1,
1787
- // Prevent Panel content from interfering with panel size
1788
- overflow: "hidden",
1789
- ...JSON.parse(H)
1790
- },
1791
- children: /* @__PURE__ */ $.jsx(
1792
- "div",
1793
- {
1794
- className: t,
1795
- style: {
1796
- maxHeight: "100%",
1797
- maxWidth: "100%",
1798
- flexGrow: 1,
1799
- ...z,
1800
- // Inform the browser that the library is handling touch events for this element
1801
- // but still allow users to scroll content within panels in the non-resizing direction
1802
- // NOTE This is not an inherited style
1803
- // See github.com/bvaughn/react-resizable-panels/issues/662
1804
- touchAction: m === "horizontal" ? "pan-y" : "pan-x"
1805
- },
1806
- children: e
1807
- }
1808
- )
1809
- }
1810
- );
1811
- }
1812
- Ke.displayName = "Panel";
1813
- const Ot = {
1814
- minHeight: 0,
1815
- maxHeight: "100%",
1816
- height: "auto",
1817
- minWidth: 0,
1818
- maxWidth: "100%",
1819
- width: "auto",
1820
- border: "none",
1821
- borderWidth: 0,
1822
- padding: 0,
1823
- margin: 0
1824
- };
1825
- function Ft({
1826
- layout: e,
1827
- panelConstraints: t,
1828
- panelId: n,
1829
- panelIndex: o
1830
- }) {
1831
- let a, i;
1832
- const l = e[n], r = t.find(
1833
- (s) => s.panelId === n
1834
- );
1835
- if (r) {
1836
- const s = r.maxSize, c = r.collapsible ? r.collapsedSize : r.minSize, u = [o, o + 1];
1837
- i = _({
1838
- layout: te({
1839
- delta: c - l,
1840
- initialLayout: e,
1841
- panelConstraints: t,
1842
- pivotIndices: u,
1843
- prevLayout: e
1844
- }),
1845
- panelConstraints: t
1846
- })[n], a = _({
1847
- layout: te({
1848
- delta: s - l,
1849
- initialLayout: e,
1850
- panelConstraints: t,
1851
- pivotIndices: u,
1852
- prevLayout: e
1853
- }),
1854
- panelConstraints: t
1855
- })[n];
1856
- }
1857
- return {
1858
- valueControls: n,
1859
- valueMax: a,
1860
- valueMin: i,
1861
- valueNow: l
1862
- };
1863
- }
1864
- function Ze({
1865
- children: e,
1866
- className: t,
1867
- disabled: n,
1868
- elementRef: o,
1869
- id: a,
1870
- style: i,
1871
- ...l
1872
- }) {
1873
- const r = me(a), s = ge({
1874
- disabled: n
1875
- }), [c, u] = ue({}), [S, z] = ue("inactive"), b = F(null), h = he(b, o), {
1876
- disableCursor: d,
1877
- id: p,
1878
- orientation: f,
1879
- registerSeparator: v,
1880
- toggleSeparatorDisabled: y
1881
- } = ve(), g = f === "horizontal" ? "vertical" : "horizontal";
1882
- J(() => {
1883
- const L = b.current;
1884
- if (L !== null) {
1885
- const P = {
1886
- disabled: s.disabled,
1887
- element: L,
1888
- id: r
1889
- }, M = v(P), U = A.addListener(
1890
- "interactionStateChange",
1891
- (w) => {
1892
- z(
1893
- w.state !== "inactive" && w.hitRegions.some(
1894
- (x) => x.separator === P
1895
- ) ? w.state : "inactive"
1896
- );
1897
- }
1898
- ), H = A.addListener(
1899
- "mountedGroupsChange",
1900
- (w) => {
1901
- w.forEach(
1902
- ({ derivedPanelConstraints: x, layout: E, separatorToPanels: G }, T) => {
1903
- if (T.id === p) {
1904
- const N = G.get(P);
1905
- if (N) {
1906
- const V = N[0], Q = T.panels.indexOf(V);
1907
- u(
1908
- Ft({
1909
- layout: E,
1910
- panelConstraints: x,
1911
- panelId: V.id,
1912
- panelIndex: Q
1913
- })
1914
- );
1915
- }
1916
- }
1917
- }
1918
- );
1919
- }
1920
- );
1921
- return () => {
1922
- U(), H(), M();
1923
- };
1924
- }
1925
- }, [p, r, v, s]), se(() => {
1926
- y(r, !!n);
1927
- }, [n, r, y]);
1928
- let m;
1929
- return n && !d && (m = "not-allowed"), /* @__PURE__ */ $.jsx(
1930
- "div",
1931
- {
1932
- ...l,
1933
- "aria-controls": c.valueControls,
1934
- "aria-disabled": n || void 0,
1935
- "aria-orientation": g,
1936
- "aria-valuemax": c.valueMax,
1937
- "aria-valuemin": c.valueMin,
1938
- "aria-valuenow": c.valueNow,
1939
- children: e,
1940
- className: t,
1941
- "data-separator": n ? "disabled" : S,
1942
- "data-testid": r,
1943
- id: r,
1944
- ref: h,
1945
- role: "separator",
1946
- style: {
1947
- flexBasis: "auto",
1948
- cursor: m,
1949
- ...i,
1950
- flexGrow: 0,
1951
- flexShrink: 0,
1952
- // Inform the browser that the library is handling touch events for this element
1953
- // See github.com/bvaughn/react-resizable-panels/issues/662
1954
- touchAction: "none"
1955
- },
1956
- tabIndex: n ? void 0 : 0
1957
- }
1958
- );
1959
- }
1960
- Ze.displayName = "Separator";
1961
- const Vt = ({
1962
- className: e,
1963
- direction: t,
1964
- ...n
1965
- }) => /* @__PURE__ */ $.jsx(
1966
- qe,
1967
- {
1968
- orientation: t,
1969
- className: je("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", e),
1970
- ...n
1971
- }
1972
- ), Bt = Ke, Xt = ({
1973
- withHandle: e,
1974
- className: t,
1975
- ...n
1976
- }) => /* @__PURE__ */ $.jsx(
1977
- Ze,
1978
- {
1979
- className: je(
1980
- "bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-none data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
1981
- t
1982
- ),
1983
- ...n,
1984
- children: e && /* @__PURE__ */ $.jsx("div", { className: "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-sm border", children: /* @__PURE__ */ $.jsx(nt, { className: "h-2.5 w-2.5" }) })
1985
- }
1986
- );
1987
- export {
1988
- Xt as ResizableHandle,
1989
- Bt as ResizablePanel,
1990
- Vt as ResizablePanelGroup
1991
- };
2
+ "use client";
3
+ import { n as e, r as t, t as n } from "./resizable-ChdgCzzx.mjs";
4
+ export { n as ResizableHandle, e as ResizablePanel, t as ResizablePanelGroup };