react-resizable-panels 4.7.2 → 4.7.4

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.
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { jsx as oe } from "react/jsx-runtime";
3
- import { useState as ie, useCallback as te, useId as pt, useLayoutEffect as Be, useEffect as de, useRef as T, createContext as ht, useImperativeHandle as We, useMemo as Ue, useSyncExternalStore as Ke, useContext as mt } from "react";
2
+ import { jsx as ie } from "react/jsx-runtime";
3
+ import { useState as re, useCallback as ne, useId as pt, useLayoutEffect as Be, useEffect as de, useRef as T, createContext as ht, useImperativeHandle as We, useMemo as Ue, useSyncExternalStore as Ke, useContext as mt } from "react";
4
4
  function gt(e, t) {
5
5
  const n = getComputedStyle(e), o = parseFloat(n.fontSize);
6
6
  return t * o;
@@ -25,36 +25,36 @@ function zt(e) {
25
25
  }
26
26
  }
27
27
  }
28
- function le({
28
+ function te({
29
29
  groupSize: e,
30
30
  panelElement: t,
31
31
  styleProp: n
32
32
  }) {
33
33
  let o;
34
- const [r, a] = zt(n);
35
- switch (a) {
34
+ const [i, s] = zt(n);
35
+ switch (s) {
36
36
  case "%": {
37
- o = r / 100 * e;
37
+ o = i / 100 * e;
38
38
  break;
39
39
  }
40
40
  case "px": {
41
- o = r;
41
+ o = i;
42
42
  break;
43
43
  }
44
44
  case "rem": {
45
- o = St(t, r);
45
+ o = St(t, i);
46
46
  break;
47
47
  }
48
48
  case "em": {
49
- o = gt(t, r);
49
+ o = gt(t, i);
50
50
  break;
51
51
  }
52
52
  case "vh": {
53
- o = yt(r);
53
+ o = yt(i);
54
54
  break;
55
55
  }
56
56
  case "vw": {
57
- o = vt(r);
57
+ o = vt(i);
58
58
  break;
59
59
  }
60
60
  }
@@ -67,7 +67,7 @@ function Q({
67
67
  group: e
68
68
  }) {
69
69
  const { orientation: t, panels: n } = e;
70
- return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
70
+ return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
71
71
  }
72
72
  function ge(e) {
73
73
  const { panels: t } = e, n = Q({ group: e });
@@ -81,51 +81,51 @@ function ge(e) {
81
81
  maxSize: 100,
82
82
  panelId: o.id
83
83
  })) : t.map((o) => {
84
- const { element: r, panelConstraints: a } = o;
85
- let u = 0;
86
- if (a.collapsedSize !== void 0) {
87
- const c = le({
84
+ const { element: i, panelConstraints: s } = o;
85
+ let l = 0;
86
+ if (s.collapsedSize !== void 0) {
87
+ const c = te({
88
88
  groupSize: n,
89
- panelElement: r,
90
- styleProp: a.collapsedSize
89
+ panelElement: i,
90
+ styleProp: s.collapsedSize
91
91
  });
92
- u = D(c / n * 100);
92
+ l = D(c / n * 100);
93
93
  }
94
- let i;
95
- if (a.defaultSize !== void 0) {
96
- const c = le({
94
+ let r;
95
+ if (s.defaultSize !== void 0) {
96
+ const c = te({
97
97
  groupSize: n,
98
- panelElement: r,
99
- styleProp: a.defaultSize
98
+ panelElement: i,
99
+ styleProp: s.defaultSize
100
100
  });
101
- i = D(c / n * 100);
101
+ r = D(c / n * 100);
102
102
  }
103
- let s = 0;
104
- if (a.minSize !== void 0) {
105
- const c = le({
103
+ let a = 0;
104
+ if (s.minSize !== void 0) {
105
+ const c = te({
106
106
  groupSize: n,
107
- panelElement: r,
108
- styleProp: a.minSize
107
+ panelElement: i,
108
+ styleProp: s.minSize
109
109
  });
110
- s = D(c / n * 100);
110
+ a = D(c / n * 100);
111
111
  }
112
- let l = 100;
113
- if (a.maxSize !== void 0) {
114
- const c = le({
112
+ let u = 100;
113
+ if (s.maxSize !== void 0) {
114
+ const c = te({
115
115
  groupSize: n,
116
- panelElement: r,
117
- styleProp: a.maxSize
116
+ panelElement: i,
117
+ styleProp: s.maxSize
118
118
  });
119
- l = D(c / n * 100);
119
+ u = D(c / n * 100);
120
120
  }
121
121
  return {
122
- groupResizeBehavior: a.groupResizeBehavior,
123
- collapsedSize: u,
124
- collapsible: a.collapsible === !0,
125
- defaultSize: i,
126
- disabled: a.disabled,
127
- minSize: s,
128
- maxSize: l,
122
+ groupResizeBehavior: s.groupResizeBehavior,
123
+ collapsedSize: l,
124
+ collapsible: s.collapsible === !0,
125
+ defaultSize: r,
126
+ disabled: s.disabled,
127
+ minSize: a,
128
+ maxSize: u,
129
129
  panelId: o.id
130
130
  };
131
131
  });
@@ -171,41 +171,41 @@ function wt({
171
171
  x: n.x + n.width / 2,
172
172
  y: n.y + n.height / 2
173
173
  };
174
- let r, a = Number.MAX_VALUE;
175
- for (const u of t) {
176
- const { x: i, y: s } = qe(o, u), l = e === "horizontal" ? i : s;
177
- l < a && (a = l, r = u);
174
+ let i, s = Number.MAX_VALUE;
175
+ for (const l of t) {
176
+ const { x: r, y: a } = qe(o, l), u = e === "horizontal" ? r : a;
177
+ u < s && (s = u, i = l);
178
178
  }
179
- return L(r, "No rect found"), r;
179
+ return L(i, "No rect found"), i;
180
180
  }
181
181
  let ue;
182
182
  function Pt() {
183
183
  return ue === void 0 && (typeof matchMedia == "function" ? ue = !!matchMedia("(pointer:coarse)").matches : ue = !1), ue;
184
184
  }
185
185
  function Ye(e) {
186
- const { element: t, orientation: n, panels: o, separators: r } = e, a = Se(
186
+ const { element: t, orientation: n, panels: o, separators: i } = e, s = Se(
187
187
  n,
188
188
  Array.from(t.children).filter(Xe).map((x) => ({ element: x }))
189
- ).map(({ element: x }) => x), u = [];
190
- let i = !1, s = !1, l = -1, c = -1, m = 0, p, v = [];
189
+ ).map(({ element: x }) => x), l = [];
190
+ let r = !1, a = !1, u = -1, c = -1, m = 0, d, v = [];
191
191
  {
192
192
  let x = -1;
193
- for (const f of a)
194
- f.hasAttribute("data-panel") && (x++, f.ariaDisabled === null && (m++, l === -1 && (l = x), c = x));
193
+ for (const f of s)
194
+ f.hasAttribute("data-panel") && (x++, f.ariaDisabled === null && (m++, u === -1 && (u = x), c = x));
195
195
  }
196
196
  if (m > 1) {
197
197
  let x = -1;
198
- for (const f of a)
198
+ for (const f of s)
199
199
  if (f.hasAttribute("data-panel")) {
200
200
  x++;
201
201
  const h = o.find(
202
202
  (g) => g.element === f
203
203
  );
204
204
  if (h) {
205
- if (p) {
206
- const g = p.element.getBoundingClientRect(), y = f.getBoundingClientRect();
205
+ if (d) {
206
+ const g = d.element.getBoundingClientRect(), y = f.getBoundingClientRect();
207
207
  let z;
208
- if (s) {
208
+ if (a) {
209
209
  const S = n === "horizontal" ? new DOMRect(
210
210
  g.right,
211
211
  g.top,
@@ -216,12 +216,12 @@ function Ye(e) {
216
216
  g.bottom,
217
217
  g.width,
218
218
  0
219
- ), d = n === "horizontal" ? new DOMRect(y.left, y.top, 0, y.height) : new DOMRect(y.left, y.top, y.width, 0);
219
+ ), p = n === "horizontal" ? new DOMRect(y.left, y.top, 0, y.height) : new DOMRect(y.left, y.top, y.width, 0);
220
220
  switch (v.length) {
221
221
  case 0: {
222
222
  z = [
223
223
  S,
224
- d
224
+ p
225
225
  ];
226
226
  break;
227
227
  }
@@ -233,7 +233,7 @@ function Ye(e) {
233
233
  });
234
234
  z = [
235
235
  P,
236
- R === g ? d : S
236
+ R === g ? p : S
237
237
  ];
238
238
  break;
239
239
  }
@@ -257,48 +257,48 @@ function Ye(e) {
257
257
  )
258
258
  ];
259
259
  for (const S of z) {
260
- let d = "width" in S ? S : S.element.getBoundingClientRect();
260
+ let p = "width" in S ? S : S.element.getBoundingClientRect();
261
261
  const P = Pt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
262
- if (d.width < P) {
263
- const C = P - d.width;
264
- d = new DOMRect(
265
- d.x - C / 2,
266
- d.y,
267
- d.width + C,
268
- d.height
262
+ if (p.width < P) {
263
+ const C = P - p.width;
264
+ p = new DOMRect(
265
+ p.x - C / 2,
266
+ p.y,
267
+ p.width + C,
268
+ p.height
269
269
  );
270
270
  }
271
- if (d.height < P) {
272
- const C = P - d.height;
273
- d = new DOMRect(
274
- d.x,
275
- d.y - C / 2,
276
- d.width,
277
- d.height + C
271
+ if (p.height < P) {
272
+ const C = P - p.height;
273
+ p = new DOMRect(
274
+ p.x,
275
+ p.y - C / 2,
276
+ p.width,
277
+ p.height + C
278
278
  );
279
279
  }
280
- const R = x <= l || x > c;
281
- !i && !R && u.push({
280
+ const R = x <= u || x > c;
281
+ !r && !R && l.push({
282
282
  group: e,
283
283
  groupSize: Q({ group: e }),
284
- panels: [p, h],
284
+ panels: [d, h],
285
285
  separator: "width" in S ? void 0 : S,
286
- rect: d
287
- }), i = !1;
286
+ rect: p
287
+ }), r = !1;
288
288
  }
289
289
  }
290
- s = !1, p = h, v = [];
290
+ a = !1, d = h, v = [];
291
291
  }
292
292
  } else if (f.hasAttribute("data-separator")) {
293
- f.ariaDisabled !== null && (i = !0);
294
- const h = r.find(
293
+ f.ariaDisabled !== null && (r = !0);
294
+ const h = i.find(
295
295
  (g) => g.element === f
296
296
  );
297
- h ? v.push(h) : (p = void 0, v = []);
297
+ h ? v.push(h) : (d = void 0, v = []);
298
298
  } else
299
- s = !0;
299
+ a = !0;
300
300
  }
301
- return u;
301
+ return l;
302
302
  }
303
303
  class Je {
304
304
  #e = {};
@@ -314,18 +314,18 @@ class Je {
314
314
  if (o.length === 1)
315
315
  o[0].call(null, n);
316
316
  else {
317
- let r = !1, a = null;
318
- const u = Array.from(o);
319
- for (let i = 0; i < u.length; i++) {
320
- const s = u[i];
317
+ let i = !1, s = null;
318
+ const l = Array.from(o);
319
+ for (let r = 0; r < l.length; r++) {
320
+ const a = l[r];
321
321
  try {
322
- s.call(null, n);
323
- } catch (l) {
324
- a === null && (r = !0, a = l);
322
+ a.call(null, n);
323
+ } catch (u) {
324
+ s === null && (i = !0, s = u);
325
325
  }
326
326
  }
327
- if (r)
328
- throw a;
327
+ if (i)
328
+ throw s;
329
329
  }
330
330
  }
331
331
  removeAllListeners() {
@@ -334,8 +334,8 @@ class Je {
334
334
  removeListener(t, n) {
335
335
  const o = this.#e[t];
336
336
  if (o !== void 0) {
337
- const r = o.indexOf(n);
338
- r >= 0 && o.splice(r, 1);
337
+ const i = o.indexOf(n);
338
+ i >= 0 && o.splice(i, 1);
339
339
  }
340
340
  }
341
341
  }
@@ -364,7 +364,7 @@ function ye(e, t) {
364
364
  n.group.id === e && t(n);
365
365
  });
366
366
  }
367
- function F(e, t) {
367
+ function _(e, t) {
368
368
  const n = A.get(e);
369
369
  A = new Map(A), A.set(e, t), Ze.emit("groupChange", {
370
370
  group: e,
@@ -373,25 +373,25 @@ function F(e, t) {
373
373
  });
374
374
  }
375
375
  function Ct(e, t, n) {
376
- let o, r = {
376
+ let o, i = {
377
377
  x: 1 / 0,
378
378
  y: 1 / 0
379
379
  };
380
- for (const a of t) {
381
- const u = qe(n, a.rect);
380
+ for (const s of t) {
381
+ const l = qe(n, s.rect);
382
382
  switch (e) {
383
383
  case "horizontal": {
384
- u.x <= r.x && (o = a, r = u);
384
+ l.x <= i.x && (o = s, i = l);
385
385
  break;
386
386
  }
387
387
  case "vertical": {
388
- u.y <= r.y && (o = a, r = u);
388
+ l.y <= i.y && (o = s, i = l);
389
389
  break;
390
390
  }
391
391
  }
392
392
  }
393
393
  return o ? {
394
- distance: r,
394
+ distance: i,
395
395
  hitRegion: o
396
396
  } : void 0;
397
397
  }
@@ -411,23 +411,23 @@ function Mt(e, t) {
411
411
  o,
412
412
  "Stacking order can only be calculated for elements with a common ancestor"
413
413
  );
414
- const r = {
414
+ const i = {
415
415
  a: Ie(Ee(n.a)),
416
416
  b: Ie(Ee(n.b))
417
417
  };
418
- if (r.a === r.b) {
419
- const a = o.childNodes, u = {
418
+ if (i.a === i.b) {
419
+ const s = o.childNodes, l = {
420
420
  a: n.a.at(-1),
421
421
  b: n.b.at(-1)
422
422
  };
423
- let i = a.length;
424
- for (; i--; ) {
425
- const s = a[i];
426
- if (s === u.a) return 1;
427
- if (s === u.b) return -1;
423
+ let r = s.length;
424
+ for (; r--; ) {
425
+ const a = s[r];
426
+ if (a === l.a) return 1;
427
+ if (a === l.b) return -1;
428
428
  }
429
429
  }
430
- return Math.sign(r.a - r.b);
430
+ return Math.sign(i.a - i.b);
431
431
  }
432
432
  const Et = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
433
433
  function It(e) {
@@ -483,18 +483,18 @@ function Tt({
483
483
  }
484
484
  function ve(e, t) {
485
485
  const n = [];
486
- return t.forEach((o, r) => {
487
- if (r.disabled)
486
+ return t.forEach((o, i) => {
487
+ if (i.disabled)
488
488
  return;
489
- const a = Ye(r), u = Ct(r.orientation, a, {
489
+ const s = Ye(i), l = Ct(i.orientation, s, {
490
490
  x: e.clientX,
491
491
  y: e.clientY
492
492
  });
493
- u && u.distance.x <= 0 && u.distance.y <= 0 && Tt({
494
- groupElement: r.element,
495
- hitRegion: u.hitRegion.rect,
493
+ l && l.distance.x <= 0 && l.distance.y <= 0 && Tt({
494
+ groupElement: i.element,
495
+ hitRegion: l.hitRegion.rect,
496
496
  pointerEventTarget: e.target
497
- }) && n.push(u.hitRegion);
497
+ }) && n.push(l.hitRegion);
498
498
  }), n;
499
499
  }
500
500
  function Ot(e, t) {
@@ -518,36 +518,36 @@ function Y({
518
518
  size: o
519
519
  }) {
520
520
  const {
521
- collapsedSize: r = 0,
522
- collapsible: a,
523
- disabled: u,
524
- maxSize: i = 100,
525
- minSize: s = 0
521
+ collapsedSize: i = 0,
522
+ collapsible: s,
523
+ disabled: l,
524
+ maxSize: r = 100,
525
+ minSize: a = 0
526
526
  } = t;
527
- if (u && !e)
527
+ if (l && !e)
528
528
  return n;
529
- if (G(o, s) < 0)
530
- if (a) {
531
- const l = (r + s) / 2;
532
- G(o, l) < 0 ? o = r : o = s;
529
+ if (G(o, a) < 0)
530
+ if (s) {
531
+ const u = (i + a) / 2;
532
+ G(o, u) < 0 ? o = i : o = a;
533
533
  } else
534
- o = s;
535
- return o = Math.min(i, o), o = D(o), o;
534
+ o = a;
535
+ return o = Math.min(r, o), o = D(o), o;
536
536
  }
537
- function re({
537
+ function se({
538
538
  delta: e,
539
539
  initialLayout: t,
540
540
  panelConstraints: n,
541
541
  pivotIndices: o,
542
- prevLayout: r,
543
- trigger: a
542
+ prevLayout: i,
543
+ trigger: s
544
544
  }) {
545
545
  if (I(e, 0))
546
546
  return t;
547
- const u = a === "imperative-api", i = Object.values(t), s = Object.values(r), l = [...i], [c, m] = o;
547
+ const l = s === "imperative-api", r = Object.values(t), a = Object.values(i), u = [...r], [c, m] = o;
548
548
  L(c != null, "Invalid first pivot index"), L(m != null, "Invalid second pivot index");
549
- let p = 0;
550
- switch (a) {
549
+ let d = 0;
550
+ switch (s) {
551
551
  case "keyboard": {
552
552
  {
553
553
  const f = e < 0 ? m : c, h = n[f];
@@ -561,13 +561,13 @@ function re({
561
561
  minSize: z = 0
562
562
  } = h;
563
563
  if (y) {
564
- const S = i[f];
564
+ const S = r[f];
565
565
  if (L(
566
566
  S != null,
567
567
  `Previous layout not found for panel index ${f}`
568
568
  ), I(S, g)) {
569
- const d = z - S;
570
- G(d, Math.abs(e)) > 0 && (e = e < 0 ? 0 - d : d);
569
+ const p = z - S;
570
+ G(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
571
571
  }
572
572
  }
573
573
  }
@@ -583,13 +583,13 @@ function re({
583
583
  minSize: z = 0
584
584
  } = h;
585
585
  if (y) {
586
- const S = i[f];
586
+ const S = r[f];
587
587
  if (L(
588
588
  S != null,
589
589
  `Previous layout not found for panel index ${f}`
590
590
  ), I(S, z)) {
591
- const d = S - g;
592
- G(d, Math.abs(e)) > 0 && (e = e < 0 ? 0 - d : d);
591
+ const p = S - g;
592
+ G(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
593
593
  }
594
594
  }
595
595
  }
@@ -601,14 +601,14 @@ function re({
601
601
  h,
602
602
  `Panel constraints not found for index ${f}`
603
603
  );
604
- const g = i[f], { collapsible: y, collapsedSize: z, minSize: S } = h;
604
+ const g = r[f], { collapsible: y, collapsedSize: z, minSize: S } = h;
605
605
  if (y && G(g, S) < 0)
606
606
  if (e > 0) {
607
- const d = S - z, P = d / 2, R = g + e;
608
- G(R, S) < 0 && (e = G(e, P) <= 0 ? 0 : d);
607
+ const p = S - z, P = p / 2, R = g + e;
608
+ G(R, S) < 0 && (e = G(e, P) <= 0 ? 0 : p);
609
609
  } else {
610
- const d = S - z, P = 100 - d / 2, R = g - e;
611
- G(R, S) < 0 && (e = G(100 + e, P) > 0 ? 0 : -d);
610
+ const p = S - z, P = 100 - p / 2, R = g - e;
611
+ G(R, S) < 0 && (e = G(100 + e, P) > 0 ? 0 : -p);
612
612
  }
613
613
  break;
614
614
  }
@@ -617,18 +617,18 @@ function re({
617
617
  const f = e < 0 ? 1 : -1;
618
618
  let h = e < 0 ? m : c, g = 0;
619
619
  for (; ; ) {
620
- const z = i[h];
620
+ const z = r[h];
621
621
  L(
622
622
  z != null,
623
623
  `Previous layout not found for panel index ${h}`
624
624
  );
625
- const d = Y({
626
- overrideDisabledPanels: u,
625
+ const p = Y({
626
+ overrideDisabledPanels: l,
627
627
  panelConstraints: n[h],
628
628
  prevSize: z,
629
629
  size: 100
630
630
  }) - z;
631
- if (g += d, h += f, h < 0 || h >= n.length)
631
+ if (g += p, h += f, h < 0 || h >= n.length)
632
632
  break;
633
633
  }
634
634
  const y = Math.min(Math.abs(e), Math.abs(g));
@@ -637,66 +637,66 @@ function re({
637
637
  {
638
638
  let h = e < 0 ? c : m;
639
639
  for (; h >= 0 && h < n.length; ) {
640
- const g = Math.abs(e) - Math.abs(p), y = i[h];
640
+ const g = Math.abs(e) - Math.abs(d), y = r[h];
641
641
  L(
642
642
  y != null,
643
643
  `Previous layout not found for panel index ${h}`
644
644
  );
645
645
  const z = y - g, S = Y({
646
- overrideDisabledPanels: u,
646
+ overrideDisabledPanels: l,
647
647
  panelConstraints: n[h],
648
648
  prevSize: y,
649
649
  size: z
650
650
  });
651
- if (!I(y, S) && (p += y - S, l[h] = S, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
651
+ if (!I(y, S) && (d += y - S, u[h] = S, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
652
652
  numeric: !0
653
653
  }) >= 0))
654
654
  break;
655
655
  e < 0 ? h-- : h++;
656
656
  }
657
657
  }
658
- if (Ot(s, l))
659
- return r;
658
+ if (Ot(a, u))
659
+ return i;
660
660
  {
661
- const f = e < 0 ? m : c, h = i[f];
661
+ const f = e < 0 ? m : c, h = r[f];
662
662
  L(
663
663
  h != null,
664
664
  `Previous layout not found for panel index ${f}`
665
665
  );
666
- const g = h + p, y = Y({
667
- overrideDisabledPanels: u,
666
+ const g = h + d, y = Y({
667
+ overrideDisabledPanels: l,
668
668
  panelConstraints: n[f],
669
669
  prevSize: h,
670
670
  size: g
671
671
  });
672
- if (l[f] = y, !I(y, g)) {
673
- let z = g - y, d = e < 0 ? m : c;
674
- for (; d >= 0 && d < n.length; ) {
675
- const P = l[d];
672
+ if (u[f] = y, !I(y, g)) {
673
+ let z = g - y, p = e < 0 ? m : c;
674
+ for (; p >= 0 && p < n.length; ) {
675
+ const P = u[p];
676
676
  L(
677
677
  P != null,
678
- `Previous layout not found for panel index ${d}`
678
+ `Previous layout not found for panel index ${p}`
679
679
  );
680
680
  const R = P + z, C = Y({
681
- overrideDisabledPanels: u,
682
- panelConstraints: n[d],
681
+ overrideDisabledPanels: l,
682
+ panelConstraints: n[p],
683
683
  prevSize: P,
684
684
  size: R
685
685
  });
686
- if (I(P, C) || (z -= C - P, l[d] = C), I(z, 0))
686
+ if (I(P, C) || (z -= C - P, u[p] = C), I(z, 0))
687
687
  break;
688
- e > 0 ? d-- : d++;
688
+ e > 0 ? p-- : p++;
689
689
  }
690
690
  }
691
691
  }
692
- const v = Object.values(l).reduce(
692
+ const v = Object.values(u).reduce(
693
693
  (f, h) => h + f,
694
694
  0
695
695
  );
696
696
  if (!I(v, 100, 0.1))
697
- return r;
698
- const x = Object.keys(r);
699
- return l.reduce((f, h, g) => (f[x[g]] = h, f), {});
697
+ return i;
698
+ const x = Object.keys(i);
699
+ return u.reduce((f, h, g) => (f[x[g]] = h, f), {});
700
700
  }
701
701
  function j(e, t) {
702
702
  if (Object.keys(e).length !== Object.keys(t).length)
@@ -710,107 +710,107 @@ function B({
710
710
  layout: e,
711
711
  panelConstraints: t
712
712
  }) {
713
- const n = Object.values(e), o = [...n], r = o.reduce(
714
- (i, s) => i + s,
713
+ const n = Object.values(e), o = [...n], i = o.reduce(
714
+ (r, a) => r + a,
715
715
  0
716
716
  );
717
717
  if (o.length !== t.length)
718
718
  throw Error(
719
- `Invalid ${t.length} panel layout: ${o.map((i) => `${i}%`).join(", ")}`
719
+ `Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
720
720
  );
721
- if (!I(r, 100) && o.length > 0)
722
- for (let i = 0; i < t.length; i++) {
723
- const s = o[i];
724
- L(s != null, `No layout data found for index ${i}`);
725
- const l = 100 / r * s;
726
- o[i] = l;
721
+ if (!I(i, 100) && o.length > 0)
722
+ for (let r = 0; r < t.length; r++) {
723
+ const a = o[r];
724
+ L(a != null, `No layout data found for index ${r}`);
725
+ const u = 100 / i * a;
726
+ o[r] = u;
727
727
  }
728
- let a = 0;
729
- for (let i = 0; i < t.length; i++) {
730
- const s = n[i];
731
- L(s != null, `No layout data found for index ${i}`);
732
- const l = o[i];
733
- L(l != null, `No layout data found for index ${i}`);
728
+ let s = 0;
729
+ for (let r = 0; r < t.length; r++) {
730
+ const a = n[r];
731
+ L(a != null, `No layout data found for index ${r}`);
732
+ const u = o[r];
733
+ L(u != null, `No layout data found for index ${r}`);
734
734
  const c = Y({
735
735
  overrideDisabledPanels: !0,
736
- panelConstraints: t[i],
737
- prevSize: s,
738
- size: l
736
+ panelConstraints: t[r],
737
+ prevSize: a,
738
+ size: u
739
739
  });
740
- l != c && (a += l - c, o[i] = c);
740
+ u != c && (s += u - c, o[r] = c);
741
741
  }
742
- if (!I(a, 0))
743
- for (let i = 0; i < t.length; i++) {
744
- const s = o[i];
745
- L(s != null, `No layout data found for index ${i}`);
746
- const l = s + a, c = Y({
742
+ if (!I(s, 0))
743
+ for (let r = 0; r < t.length; r++) {
744
+ const a = o[r];
745
+ L(a != null, `No layout data found for index ${r}`);
746
+ const u = a + s, c = Y({
747
747
  overrideDisabledPanels: !0,
748
- panelConstraints: t[i],
749
- prevSize: s,
750
- size: l
748
+ panelConstraints: t[r],
749
+ prevSize: a,
750
+ size: u
751
751
  });
752
- if (s !== c && (a -= c - s, o[i] = c, I(a, 0)))
752
+ if (a !== c && (s -= c - a, o[r] = c, I(s, 0)))
753
753
  break;
754
754
  }
755
- const u = Object.keys(e);
756
- return o.reduce((i, s, l) => (i[u[l]] = s, i), {});
755
+ const l = Object.keys(e);
756
+ return o.reduce((r, a, u) => (r[l[u]] = a, r), {});
757
757
  }
758
758
  function et({
759
759
  groupId: e,
760
760
  panelId: t
761
761
  }) {
762
762
  const n = () => {
763
- const i = U();
763
+ const r = U();
764
764
  for (const [
765
- s,
765
+ a,
766
766
  {
767
- defaultLayoutDeferred: l,
767
+ defaultLayoutDeferred: u,
768
768
  derivedPanelConstraints: c,
769
769
  layout: m,
770
- groupSize: p,
770
+ groupSize: d,
771
771
  separatorToPanels: v
772
772
  }
773
- ] of i)
774
- if (s.id === e)
773
+ ] of r)
774
+ if (a.id === e)
775
775
  return {
776
- defaultLayoutDeferred: l,
776
+ defaultLayoutDeferred: u,
777
777
  derivedPanelConstraints: c,
778
- group: s,
779
- groupSize: p,
778
+ group: a,
779
+ groupSize: d,
780
780
  layout: m,
781
781
  separatorToPanels: v
782
782
  };
783
783
  throw Error(`Group ${e} not found`);
784
784
  }, o = () => {
785
- const i = n().derivedPanelConstraints.find(
786
- (s) => s.panelId === t
785
+ const r = n().derivedPanelConstraints.find(
786
+ (a) => a.panelId === t
787
787
  );
788
- if (i !== void 0)
789
- return i;
788
+ if (r !== void 0)
789
+ return r;
790
790
  throw Error(`Panel constraints not found for Panel ${t}`);
791
- }, r = () => {
792
- const i = n().group.panels.find((s) => s.id === t);
793
- if (i !== void 0)
794
- return i;
791
+ }, i = () => {
792
+ const r = n().group.panels.find((a) => a.id === t);
793
+ if (r !== void 0)
794
+ return r;
795
795
  throw Error(`Layout not found for Panel ${t}`);
796
- }, a = () => {
797
- const i = n().layout[t];
798
- if (i !== void 0)
799
- return i;
796
+ }, s = () => {
797
+ const r = n().layout[t];
798
+ if (r !== void 0)
799
+ return r;
800
800
  throw Error(`Layout not found for Panel ${t}`);
801
- }, u = (i) => {
802
- const s = a();
803
- if (i === s)
801
+ }, l = (r) => {
802
+ const a = s();
803
+ if (r === a)
804
804
  return;
805
805
  const {
806
- defaultLayoutDeferred: l,
806
+ defaultLayoutDeferred: u,
807
807
  derivedPanelConstraints: c,
808
808
  group: m,
809
- groupSize: p,
809
+ groupSize: d,
810
810
  layout: v,
811
811
  separatorToPanels: x
812
- } = n(), f = m.panels.findIndex((z) => z.id === t), h = f === m.panels.length - 1, g = re({
813
- delta: h ? s - i : i - s,
812
+ } = n(), f = m.panels.findIndex((z) => z.id === t), h = f === m.panels.length - 1, g = se({
813
+ delta: h ? a - r : r - a,
814
814
  initialLayout: v,
815
815
  panelConstraints: c,
816
816
  pivotIndices: h ? [f - 1, f] : [f, f + 1],
@@ -820,53 +820,44 @@ function et({
820
820
  layout: g,
821
821
  panelConstraints: c
822
822
  });
823
- j(v, y) || F(m, {
824
- defaultLayoutDeferred: l,
823
+ j(v, y) || _(m, {
824
+ defaultLayoutDeferred: u,
825
825
  derivedPanelConstraints: c,
826
- groupSize: p,
826
+ groupSize: d,
827
827
  layout: y,
828
828
  separatorToPanels: x
829
829
  });
830
830
  };
831
831
  return {
832
832
  collapse: () => {
833
- const { collapsible: i, collapsedSize: s } = o(), { mutableValues: l } = r(), c = a();
834
- i && c !== s && (l.expandToSize = c, u(s));
833
+ const { collapsible: r, collapsedSize: a } = o(), { mutableValues: u } = i(), c = s();
834
+ r && c !== a && (u.expandToSize = c, l(a));
835
835
  },
836
836
  expand: () => {
837
- const { collapsible: i, collapsedSize: s, minSize: l } = o(), { mutableValues: c } = r(), m = a();
838
- if (i && m === s) {
839
- let p = c.expandToSize ?? l;
840
- p === 0 && (p = 1), u(p);
837
+ const { collapsible: r, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), m = s();
838
+ if (r && m === a) {
839
+ let d = c.expandToSize ?? u;
840
+ d === 0 && (d = 1), l(d);
841
841
  }
842
842
  },
843
843
  getSize: () => {
844
- const { group: i } = n(), s = a(), { element: l } = r(), c = i.orientation === "horizontal" ? l.offsetWidth : l.offsetHeight;
844
+ const { group: r } = n(), a = s(), { element: u } = i(), c = r.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
845
845
  return {
846
- asPercentage: s,
846
+ asPercentage: a,
847
847
  inPixels: c
848
848
  };
849
849
  },
850
850
  isCollapsed: () => {
851
- const { collapsible: i, collapsedSize: s } = o(), l = a();
852
- return i && I(s, l);
851
+ const { collapsible: r, collapsedSize: a } = o(), u = s();
852
+ return r && I(a, u);
853
853
  },
854
- resize: (i) => {
855
- if (a() !== i) {
856
- let l;
857
- switch (typeof i) {
858
- case "number": {
859
- const { group: c } = n(), m = Q({ group: c });
860
- l = D(i / m * 100);
861
- break;
862
- }
863
- case "string": {
864
- l = parseFloat(i);
865
- break;
866
- }
867
- }
868
- u(l);
869
- }
854
+ resize: (r) => {
855
+ const { group: a } = n(), { element: u } = i(), c = Q({ group: a }), m = te({
856
+ groupSize: c,
857
+ panelElement: u,
858
+ styleProp: r
859
+ }), d = D(m / c * 100);
860
+ l(d);
870
861
  }
871
862
  };
872
863
  }
@@ -876,15 +867,15 @@ function De(e) {
876
867
  const t = U();
877
868
  ve(e, t).forEach((o) => {
878
869
  if (o.separator) {
879
- const r = o.panels.find(
880
- (a) => a.panelConstraints.defaultSize !== void 0
870
+ const i = o.panels.find(
871
+ (s) => s.panelConstraints.defaultSize !== void 0
881
872
  );
882
- if (r) {
883
- const a = r.panelConstraints.defaultSize, u = et({
873
+ if (i) {
874
+ const s = i.panelConstraints.defaultSize, l = et({
884
875
  groupId: o.group.id,
885
- panelId: r.id
876
+ panelId: i.id
886
877
  });
887
- u && a !== void 0 && (u.resize(a), e.preventDefault());
878
+ l && s !== void 0 && (l.resize(s), e.preventDefault());
888
879
  }
889
880
  }
890
881
  });
@@ -903,9 +894,9 @@ function tt({
903
894
  }) {
904
895
  const t = () => {
905
896
  const n = U();
906
- for (const [o, r] of n)
897
+ for (const [o, i] of n)
907
898
  if (o.id === e)
908
- return { group: o, ...r };
899
+ return { group: o, ...i };
909
900
  throw Error(`Could not find Group with id "${e}"`);
910
901
  };
911
902
  return {
@@ -916,44 +907,44 @@ function tt({
916
907
  setLayout(n) {
917
908
  const {
918
909
  defaultLayoutDeferred: o,
919
- derivedPanelConstraints: r,
920
- group: a,
921
- groupSize: u,
922
- layout: i,
923
- separatorToPanels: s
924
- } = t(), l = B({
910
+ derivedPanelConstraints: i,
911
+ group: s,
912
+ groupSize: l,
913
+ layout: r,
914
+ separatorToPanels: a
915
+ } = t(), u = B({
925
916
  layout: n,
926
- panelConstraints: r
917
+ panelConstraints: i
927
918
  });
928
- return o ? i : (j(i, l) || F(a, {
919
+ return o ? r : (j(r, u) || _(s, {
929
920
  defaultLayoutDeferred: o,
930
- derivedPanelConstraints: r,
931
- groupSize: u,
932
- layout: l,
933
- separatorToPanels: s
934
- }), l);
921
+ derivedPanelConstraints: i,
922
+ groupSize: l,
923
+ layout: u,
924
+ separatorToPanels: a
925
+ }), u);
935
926
  }
936
927
  };
937
928
  }
938
929
  function V(e, t) {
939
- const n = fe(e), o = $(n.id, !0), r = n.separators.find(
930
+ const n = fe(e), o = $(n.id, !0), i = n.separators.find(
940
931
  (m) => m.element === e
941
932
  );
942
- L(r, "Matching separator not found");
943
- const a = o.separatorToPanels.get(r);
944
- L(a, "Matching panels not found");
945
- const u = a.map((m) => n.panels.indexOf(m)), s = tt({ groupId: n.id }).getLayout(), l = re({
933
+ L(i, "Matching separator not found");
934
+ const s = o.separatorToPanels.get(i);
935
+ L(s, "Matching panels not found");
936
+ const l = s.map((m) => n.panels.indexOf(m)), a = tt({ groupId: n.id }).getLayout(), u = se({
946
937
  delta: t,
947
- initialLayout: s,
938
+ initialLayout: a,
948
939
  panelConstraints: o.derivedPanelConstraints,
949
- pivotIndices: u,
950
- prevLayout: s,
940
+ pivotIndices: l,
941
+ prevLayout: a,
951
942
  trigger: "keyboard"
952
943
  }), c = B({
953
- layout: l,
944
+ layout: u,
954
945
  panelConstraints: o.derivedPanelConstraints
955
946
  });
956
- j(s, c) || F(n, {
947
+ j(a, c) || _(n, {
957
948
  defaultLayoutDeferred: o.defaultLayoutDeferred,
958
949
  derivedPanelConstraints: o.derivedPanelConstraints,
959
950
  groupSize: o.groupSize,
@@ -989,31 +980,31 @@ function Te(e) {
989
980
  }
990
981
  case "Enter": {
991
982
  e.preventDefault();
992
- const o = fe(t), r = $(o.id, !0), { derivedPanelConstraints: a, layout: u, separatorToPanels: i } = r, s = o.separators.find(
993
- (p) => p.element === t
983
+ const o = fe(t), i = $(o.id, !0), { derivedPanelConstraints: s, layout: l, separatorToPanels: r } = i, a = o.separators.find(
984
+ (d) => d.element === t
994
985
  );
995
- L(s, "Matching separator not found");
996
- const l = i.get(s);
997
- L(l, "Matching panels not found");
998
- const c = l[0], m = a.find(
999
- (p) => p.panelId === c.id
986
+ L(a, "Matching separator not found");
987
+ const u = r.get(a);
988
+ L(u, "Matching panels not found");
989
+ const c = u[0], m = s.find(
990
+ (d) => d.panelId === c.id
1000
991
  );
1001
992
  if (L(m, "Panel metadata not found"), m.collapsible) {
1002
- const p = u[c.id], v = m.collapsedSize === p ? o.mutableState.expandedPanelSizes[c.id] ?? m.minSize : m.collapsedSize;
1003
- V(t, v - p);
993
+ const d = l[c.id], v = m.collapsedSize === d ? o.mutableState.expandedPanelSizes[c.id] ?? m.minSize : m.collapsedSize;
994
+ V(t, v - d);
1004
995
  }
1005
996
  break;
1006
997
  }
1007
998
  case "F6": {
1008
999
  e.preventDefault();
1009
- const r = fe(t).separators.map(
1010
- (s) => s.element
1011
- ), a = Array.from(r).findIndex(
1012
- (s) => s === e.currentTarget
1000
+ const i = fe(t).separators.map(
1001
+ (a) => a.element
1002
+ ), s = Array.from(i).findIndex(
1003
+ (a) => a === e.currentTarget
1013
1004
  );
1014
- L(a !== null, "Index not found");
1015
- const u = e.shiftKey ? a > 0 ? a - 1 : r.length - 1 : a + 1 < r.length ? a + 1 : 0;
1016
- r[u].focus({
1005
+ L(s !== null, "Index not found");
1006
+ const l = e.shiftKey ? s > 0 ? s - 1 : i.length - 1 : s + 1 < i.length ? s + 1 : 0;
1007
+ i[l].focus({
1017
1008
  preventScroll: !0
1018
1009
  });
1019
1010
  break;
@@ -1055,13 +1046,13 @@ function Oe(e) {
1055
1046
  if (e.pointerType === "mouse" && e.button > 0)
1056
1047
  return;
1057
1048
  const t = U(), n = ve(e, t), o = /* @__PURE__ */ new Map();
1058
- let r = !1;
1059
- n.forEach((a) => {
1060
- a.separator && (r || (r = !0, a.separator.element.focus({
1049
+ let i = !1;
1050
+ n.forEach((s) => {
1051
+ s.separator && (i || (i = !0, s.separator.element.focus({
1061
1052
  preventScroll: !0
1062
1053
  })));
1063
- const u = t.get(a.group);
1064
- u && o.set(a.group, u.layout);
1054
+ const l = t.get(s.group);
1055
+ l && o.set(s.group, l.layout);
1065
1056
  }), Z({
1066
1057
  cursorFlags: 0,
1067
1058
  hitRegions: n,
@@ -1076,67 +1067,67 @@ let ce;
1076
1067
  function Ne() {
1077
1068
  return ce === void 0 && (ce = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (ce = !0)), ce;
1078
1069
  }
1079
- function Ft({
1070
+ function _t({
1080
1071
  cursorFlags: e,
1081
1072
  groups: t,
1082
1073
  state: n
1083
1074
  }) {
1084
- let o = 0, r = 0;
1075
+ let o = 0, i = 0;
1085
1076
  switch (n) {
1086
1077
  case "active":
1087
1078
  case "hover":
1088
- t.forEach((a) => {
1089
- if (!a.mutableState.disableCursor)
1090
- switch (a.orientation) {
1079
+ t.forEach((s) => {
1080
+ if (!s.mutableState.disableCursor)
1081
+ switch (s.orientation) {
1091
1082
  case "horizontal": {
1092
1083
  o++;
1093
1084
  break;
1094
1085
  }
1095
1086
  case "vertical": {
1096
- r++;
1087
+ i++;
1097
1088
  break;
1098
1089
  }
1099
1090
  }
1100
1091
  });
1101
1092
  }
1102
- if (!(o === 0 && r === 0)) {
1093
+ if (!(o === 0 && i === 0)) {
1103
1094
  switch (n) {
1104
1095
  case "active": {
1105
1096
  if (e && Ne()) {
1106
- const a = (e & nt) !== 0, u = (e & ot) !== 0, i = (e & it) !== 0, s = (e & rt) !== 0;
1107
- if (a)
1108
- return i ? "se-resize" : s ? "ne-resize" : "e-resize";
1109
- if (u)
1110
- return i ? "sw-resize" : s ? "nw-resize" : "w-resize";
1111
- if (i)
1112
- return "s-resize";
1097
+ const s = (e & nt) !== 0, l = (e & ot) !== 0, r = (e & it) !== 0, a = (e & rt) !== 0;
1113
1098
  if (s)
1099
+ return r ? "se-resize" : a ? "ne-resize" : "e-resize";
1100
+ if (l)
1101
+ return r ? "sw-resize" : a ? "nw-resize" : "w-resize";
1102
+ if (r)
1103
+ return "s-resize";
1104
+ if (a)
1114
1105
  return "n-resize";
1115
1106
  }
1116
1107
  break;
1117
1108
  }
1118
1109
  }
1119
- return Ne() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
1110
+ return Ne() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
1120
1111
  }
1121
1112
  }
1122
- const Fe = /* @__PURE__ */ new WeakMap();
1113
+ const _e = /* @__PURE__ */ new WeakMap();
1123
1114
  function be(e) {
1124
1115
  if (e.defaultView === null || e.defaultView === void 0)
1125
1116
  return;
1126
- let { prevStyle: t, styleSheet: n } = Fe.get(e) ?? {};
1117
+ let { prevStyle: t, styleSheet: n } = _e.get(e) ?? {};
1127
1118
  n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && e.adoptedStyleSheets.push(n));
1128
1119
  const o = W();
1129
1120
  switch (o.state) {
1130
1121
  case "active":
1131
1122
  case "hover": {
1132
- const r = Ft({
1123
+ const i = _t({
1133
1124
  cursorFlags: o.cursorFlags,
1134
- groups: o.hitRegions.map((u) => u.group),
1125
+ groups: o.hitRegions.map((l) => l.group),
1135
1126
  state: o.state
1136
- }), a = `*, *:hover {cursor: ${r} !important; }`;
1137
- if (t === a)
1127
+ }), s = `*, *:hover {cursor: ${i} !important; }`;
1128
+ if (t === s)
1138
1129
  return;
1139
- t = a, r ? n.cssRules.length === 0 ? n.insertRule(a) : n.replaceSync(a) : n.cssRules.length === 1 && n.deleteRule(0);
1130
+ t = s, i ? n.cssRules.length === 0 ? n.insertRule(s) : n.replaceSync(s) : n.cssRules.length === 1 && n.deleteRule(0);
1140
1131
  break;
1141
1132
  }
1142
1133
  case "inactive": {
@@ -1144,58 +1135,58 @@ function be(e) {
1144
1135
  break;
1145
1136
  }
1146
1137
  }
1147
- Fe.set(e, {
1138
+ _e.set(e, {
1148
1139
  prevStyle: t,
1149
1140
  styleSheet: n
1150
1141
  });
1151
1142
  }
1152
- function at({
1143
+ function st({
1153
1144
  document: e,
1154
1145
  event: t,
1155
1146
  hitRegions: n,
1156
1147
  initialLayoutMap: o,
1157
- mountedGroups: r,
1158
- pointerDownAtPoint: a,
1159
- prevCursorFlags: u
1148
+ mountedGroups: i,
1149
+ pointerDownAtPoint: s,
1150
+ prevCursorFlags: l
1160
1151
  }) {
1161
- let i = 0;
1162
- n.forEach((l) => {
1163
- const { group: c, groupSize: m } = l, { orientation: p, panels: v } = c, { disableCursor: x } = c.mutableState;
1152
+ let r = 0;
1153
+ n.forEach((u) => {
1154
+ const { group: c, groupSize: m } = u, { orientation: d, panels: v } = c, { disableCursor: x } = c.mutableState;
1164
1155
  let f = 0;
1165
- a ? p === "horizontal" ? f = (t.clientX - a.x) / m * 100 : f = (t.clientY - a.y) / m * 100 : p === "horizontal" ? f = t.clientX < 0 ? -100 : 100 : f = t.clientY < 0 ? -100 : 100;
1166
- const h = o.get(c), g = r.get(c);
1156
+ s ? d === "horizontal" ? f = (t.clientX - s.x) / m * 100 : f = (t.clientY - s.y) / m * 100 : d === "horizontal" ? f = t.clientX < 0 ? -100 : 100 : f = t.clientY < 0 ? -100 : 100;
1157
+ const h = o.get(c), g = i.get(c);
1167
1158
  if (!h || !g)
1168
1159
  return;
1169
1160
  const {
1170
1161
  defaultLayoutDeferred: y,
1171
1162
  derivedPanelConstraints: z,
1172
1163
  groupSize: S,
1173
- layout: d,
1164
+ layout: p,
1174
1165
  separatorToPanels: P
1175
1166
  } = g;
1176
- if (z && d && P) {
1177
- const R = re({
1167
+ if (z && p && P) {
1168
+ const R = se({
1178
1169
  delta: f,
1179
1170
  initialLayout: h,
1180
1171
  panelConstraints: z,
1181
- pivotIndices: l.panels.map((C) => v.indexOf(C)),
1182
- prevLayout: d,
1172
+ pivotIndices: u.panels.map((C) => v.indexOf(C)),
1173
+ prevLayout: p,
1183
1174
  trigger: "mouse-or-touch"
1184
1175
  });
1185
- if (j(R, d)) {
1176
+ if (j(R, p)) {
1186
1177
  if (f !== 0 && !x)
1187
- switch (p) {
1178
+ switch (d) {
1188
1179
  case "horizontal": {
1189
- i |= f < 0 ? nt : ot;
1180
+ r |= f < 0 ? nt : ot;
1190
1181
  break;
1191
1182
  }
1192
1183
  case "vertical": {
1193
- i |= f < 0 ? it : rt;
1184
+ r |= f < 0 ? it : rt;
1194
1185
  break;
1195
1186
  }
1196
1187
  }
1197
1188
  } else
1198
- F(l.group, {
1189
+ _(u.group, {
1199
1190
  defaultLayoutDeferred: y,
1200
1191
  derivedPanelConstraints: z,
1201
1192
  groupSize: S,
@@ -1204,14 +1195,14 @@ function at({
1204
1195
  });
1205
1196
  }
1206
1197
  });
1207
- let s = 0;
1208
- t.movementX === 0 ? s |= u & Ge : s |= i & Ge, t.movementY === 0 ? s |= u & Ae : s |= i & Ae, At(s), be(e);
1198
+ let a = 0;
1199
+ t.movementX === 0 ? a |= l & Ge : a |= r & Ge, t.movementY === 0 ? a |= l & Ae : a |= r & Ae, At(a), be(e);
1209
1200
  }
1210
- function _e(e) {
1201
+ function Fe(e) {
1211
1202
  const t = U(), n = W();
1212
1203
  switch (n.state) {
1213
1204
  case "active":
1214
- at({
1205
+ st({
1215
1206
  document: e.currentTarget,
1216
1207
  event: e,
1217
1208
  hitRegions: n.hitRegions,
@@ -1235,12 +1226,17 @@ function $e(e) {
1235
1226
  cursorFlags: 0,
1236
1227
  state: "inactive"
1237
1228
  }), t.hitRegions.forEach((o) => {
1238
- const r = $(o.group.id, !0);
1239
- F(o.group, r);
1229
+ const i = $(o.group.id, !0);
1230
+ _(o.group, i);
1240
1231
  });
1241
1232
  return;
1242
1233
  }
1243
- at({
1234
+ for (const o of t.hitRegions)
1235
+ if (o.separator) {
1236
+ const { element: i } = o.separator;
1237
+ i.hasPointerCapture?.(e.pointerId) || i.setPointerCapture?.(e.pointerId);
1238
+ }
1239
+ st({
1244
1240
  document: e.currentTarget,
1245
1241
  event: e,
1246
1242
  hitRegions: t.hitRegions,
@@ -1288,39 +1284,39 @@ function Ve(e) {
1288
1284
  state: "inactive"
1289
1285
  }), t.hitRegions.length > 0 && (be(e.currentTarget), t.hitRegions.forEach((n) => {
1290
1286
  const o = $(n.group.id, !0);
1291
- F(n.group, o);
1287
+ _(n.group, o);
1292
1288
  }), e.preventDefault());
1293
1289
  }
1294
1290
  }
1295
1291
  function je(e) {
1296
1292
  let t = 0, n = 0;
1297
1293
  const o = {};
1298
- for (const a of e)
1299
- if (a.defaultSize !== void 0) {
1294
+ for (const s of e)
1295
+ if (s.defaultSize !== void 0) {
1300
1296
  t++;
1301
- const u = D(a.defaultSize);
1302
- n += u, o[a.panelId] = u;
1297
+ const l = D(s.defaultSize);
1298
+ n += l, o[s.panelId] = l;
1303
1299
  } else
1304
- o[a.panelId] = void 0;
1305
- const r = e.length - t;
1306
- if (r !== 0) {
1307
- const a = D((100 - n) / r);
1308
- for (const u of e)
1309
- u.defaultSize === void 0 && (o[u.panelId] = a);
1300
+ o[s.panelId] = void 0;
1301
+ const i = e.length - t;
1302
+ if (i !== 0) {
1303
+ const s = D((100 - n) / i);
1304
+ for (const l of e)
1305
+ l.defaultSize === void 0 && (o[l.panelId] = s);
1310
1306
  }
1311
1307
  return o;
1312
1308
  }
1313
- function _t(e, t, n) {
1309
+ function Ft(e, t, n) {
1314
1310
  if (!n[0])
1315
1311
  return;
1316
- const r = e.panels.find((l) => l.element === t);
1317
- if (!r || !r.onResize)
1312
+ const i = e.panels.find((u) => u.element === t);
1313
+ if (!i || !i.onResize)
1318
1314
  return;
1319
- const a = Q({ group: e }), u = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, i = r.mutableValues.prevSize, s = {
1320
- asPercentage: D(u / a * 100),
1321
- inPixels: u
1315
+ const s = Q({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, a = {
1316
+ asPercentage: D(l / s * 100),
1317
+ inPixels: l
1322
1318
  };
1323
- r.mutableValues.prevSize = s, r.onResize(s, r.id, i);
1319
+ i.mutableValues.prevSize = a, i.onResize(a, i.id, r);
1324
1320
  }
1325
1321
  function $t(e, t) {
1326
1322
  if (Object.keys(e).length !== Object.keys(t).length)
@@ -1338,53 +1334,53 @@ function Ht({
1338
1334
  }) {
1339
1335
  if (n <= 0 || t <= 0 || n === t)
1340
1336
  return o;
1341
- let r = 0, a = 0, u = !1;
1342
- const i = /* @__PURE__ */ new Map(), s = [];
1337
+ let i = 0, s = 0, l = !1;
1338
+ const r = /* @__PURE__ */ new Map(), a = [];
1343
1339
  for (const m of e.panels) {
1344
- const p = o[m.id] ?? 0;
1340
+ const d = o[m.id] ?? 0;
1345
1341
  switch (m.panelConstraints.groupResizeBehavior) {
1346
1342
  case "preserve-pixel-size": {
1347
- u = !0;
1348
- const v = p / 100 * n, x = D(
1343
+ l = !0;
1344
+ const v = d / 100 * n, x = D(
1349
1345
  v / t * 100
1350
1346
  );
1351
- i.set(m.id, x), r += x;
1347
+ r.set(m.id, x), i += x;
1352
1348
  break;
1353
1349
  }
1354
1350
  case "preserve-relative-size":
1355
1351
  default: {
1356
- s.push(m.id), a += p;
1352
+ a.push(m.id), s += d;
1357
1353
  break;
1358
1354
  }
1359
1355
  }
1360
1356
  }
1361
- if (!u || s.length === 0)
1357
+ if (!l || a.length === 0)
1362
1358
  return o;
1363
- const l = 100 - r, c = { ...o };
1364
- if (i.forEach((m, p) => {
1365
- c[p] = m;
1366
- }), a > 0)
1367
- for (const m of s) {
1368
- const p = o[m] ?? 0;
1359
+ const u = 100 - i, c = { ...o };
1360
+ if (r.forEach((m, d) => {
1361
+ c[d] = m;
1362
+ }), s > 0)
1363
+ for (const m of a) {
1364
+ const d = o[m] ?? 0;
1369
1365
  c[m] = D(
1370
- p / a * l
1366
+ d / s * u
1371
1367
  );
1372
1368
  }
1373
1369
  else {
1374
1370
  const m = D(
1375
- l / s.length
1371
+ u / a.length
1376
1372
  );
1377
- for (const p of s)
1378
- c[p] = m;
1373
+ for (const d of a)
1374
+ c[d] = m;
1379
1375
  }
1380
1376
  return c;
1381
1377
  }
1382
1378
  function Vt(e, t) {
1383
- const n = e.map((r) => r.id), o = Object.keys(t);
1379
+ const n = e.map((i) => i.id), o = Object.keys(t);
1384
1380
  if (n.length !== o.length)
1385
1381
  return !1;
1386
- for (const r of n)
1387
- if (!o.includes(r))
1382
+ for (const i of n)
1383
+ if (!o.includes(i))
1388
1384
  return !1;
1389
1385
  return !0;
1390
1386
  }
@@ -1395,7 +1391,7 @@ function jt(e) {
1395
1391
  e.element.ownerDocument.defaultView,
1396
1392
  "Cannot register an unmounted Group"
1397
1393
  );
1398
- const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = new n((f) => {
1394
+ const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((f) => {
1399
1395
  for (const h of f) {
1400
1396
  const { borderBoxSize: g, target: y } = h;
1401
1397
  if (y === e.element) {
@@ -1406,82 +1402,82 @@ function jt(e) {
1406
1402
  const S = $(e.id);
1407
1403
  if (!S)
1408
1404
  return;
1409
- const d = ge(e), P = S.defaultLayoutDeferred ? je(d) : S.layout, R = Ht({
1405
+ const p = ge(e), P = S.defaultLayoutDeferred ? je(p) : S.layout, R = Ht({
1410
1406
  group: e,
1411
1407
  nextGroupSize: z,
1412
1408
  prevGroupSize: S.groupSize,
1413
1409
  prevLayout: P
1414
1410
  }), C = B({
1415
1411
  layout: R,
1416
- panelConstraints: d
1412
+ panelConstraints: p
1417
1413
  });
1418
1414
  if (!S.defaultLayoutDeferred && j(S.layout, C) && $t(
1419
1415
  S.derivedPanelConstraints,
1420
- d
1416
+ p
1421
1417
  ) && S.groupSize === z)
1422
1418
  return;
1423
- F(e, {
1419
+ _(e, {
1424
1420
  defaultLayoutDeferred: !1,
1425
- derivedPanelConstraints: d,
1421
+ derivedPanelConstraints: p,
1426
1422
  groupSize: z,
1427
1423
  layout: C,
1428
1424
  separatorToPanels: S.separatorToPanels
1429
1425
  });
1430
1426
  }
1431
1427
  } else
1432
- _t(e, y, g);
1428
+ Ft(e, y, g);
1433
1429
  }
1434
1430
  });
1435
- a.observe(e.element), e.panels.forEach((f) => {
1431
+ s.observe(e.element), e.panels.forEach((f) => {
1436
1432
  L(
1437
1433
  !o.has(f.id),
1438
1434
  `Panel ids must be unique; id "${f.id}" was used more than once`
1439
- ), o.add(f.id), f.onResize && a.observe(f.element);
1435
+ ), o.add(f.id), f.onResize && s.observe(f.element);
1440
1436
  });
1441
- const u = Q({ group: e }), i = ge(e), s = e.panels.map(({ id: f }) => f).join(",");
1442
- let l = e.mutableState.defaultLayout;
1443
- l && (Vt(e.panels, l) || (l = void 0));
1444
- const c = e.mutableState.layouts[s] ?? l ?? je(i), m = B({
1437
+ const l = Q({ group: e }), r = ge(e), a = e.panels.map(({ id: f }) => f).join(",");
1438
+ let u = e.mutableState.defaultLayout;
1439
+ u && (Vt(e.panels, u) || (u = void 0));
1440
+ const c = e.mutableState.layouts[a] ?? u ?? je(r), m = B({
1445
1441
  layout: c,
1446
- panelConstraints: i
1447
- }), p = e.element.ownerDocument;
1442
+ panelConstraints: r
1443
+ }), d = e.element.ownerDocument;
1448
1444
  q.set(
1449
- p,
1450
- (q.get(p) ?? 0) + 1
1445
+ d,
1446
+ (q.get(d) ?? 0) + 1
1451
1447
  );
1452
1448
  const v = /* @__PURE__ */ new Map();
1453
1449
  return Ye(e).forEach((f) => {
1454
1450
  f.separator && v.set(f.separator, f.panels);
1455
- }), F(e, {
1456
- defaultLayoutDeferred: u === 0,
1457
- derivedPanelConstraints: i,
1458
- groupSize: u,
1451
+ }), _(e, {
1452
+ defaultLayoutDeferred: l === 0,
1453
+ derivedPanelConstraints: r,
1454
+ groupSize: l,
1459
1455
  layout: m,
1460
1456
  separatorToPanels: v
1461
1457
  }), e.separators.forEach((f) => {
1462
1458
  L(
1463
- !r.has(f.id),
1459
+ !i.has(f.id),
1464
1460
  `Separator ids must be unique; id "${f.id}" was used more than once`
1465
- ), r.add(f.id), f.element.addEventListener("keydown", Te);
1466
- }), q.get(p) === 1 && (p.addEventListener("dblclick", De, !0), p.addEventListener("pointerdown", Oe, !0), p.addEventListener("pointerleave", _e), p.addEventListener("pointermove", $e), p.addEventListener("pointerout", He), p.addEventListener("pointerup", Ve, !0)), function() {
1461
+ ), i.add(f.id), f.element.addEventListener("keydown", Te);
1462
+ }), q.get(d) === 1 && (d.addEventListener("dblclick", De, !0), d.addEventListener("pointerdown", Oe, !0), d.addEventListener("pointerleave", Fe), d.addEventListener("pointermove", $e), d.addEventListener("pointerout", He), d.addEventListener("pointerup", Ve, !0)), function() {
1467
1463
  t = !1, q.set(
1468
- p,
1469
- Math.max(0, (q.get(p) ?? 0) - 1)
1464
+ d,
1465
+ Math.max(0, (q.get(d) ?? 0) - 1)
1470
1466
  ), Lt(e), e.separators.forEach((h) => {
1471
1467
  h.element.removeEventListener("keydown", Te);
1472
- }), q.get(p) || (p.removeEventListener(
1468
+ }), q.get(d) || (d.removeEventListener(
1473
1469
  "dblclick",
1474
1470
  De,
1475
1471
  !0
1476
- ), p.removeEventListener(
1472
+ ), d.removeEventListener(
1477
1473
  "pointerdown",
1478
1474
  Oe,
1479
1475
  !0
1480
- ), p.removeEventListener("pointerleave", _e), p.removeEventListener("pointermove", $e), p.removeEventListener("pointerout", He), p.removeEventListener("pointerup", Ve, !0)), a.disconnect();
1476
+ ), d.removeEventListener("pointerleave", Fe), d.removeEventListener("pointermove", $e), d.removeEventListener("pointerout", He), d.removeEventListener("pointerup", Ve, !0)), s.disconnect();
1481
1477
  };
1482
1478
  }
1483
1479
  function Bt() {
1484
- const [e, t] = ie({}), n = te(() => t({}), []);
1480
+ const [e, t] = re({}), n = ne(() => t({}), []);
1485
1481
  return [e, n];
1486
1482
  }
1487
1483
  function xe(e) {
@@ -1489,17 +1485,17 @@ function xe(e) {
1489
1485
  return `${e ?? t}`;
1490
1486
  }
1491
1487
  const K = typeof window < "u" ? Be : de;
1492
- function ne(e) {
1488
+ function oe(e) {
1493
1489
  const t = T(e);
1494
1490
  return K(() => {
1495
1491
  t.current = e;
1496
- }, [e]), te(
1492
+ }, [e]), ne(
1497
1493
  (...n) => t.current?.(...n),
1498
1494
  [t]
1499
1495
  );
1500
1496
  }
1501
1497
  function we(...e) {
1502
- return ne((t) => {
1498
+ return oe((t) => {
1503
1499
  e.forEach((n) => {
1504
1500
  if (n)
1505
1501
  switch (typeof n) {
@@ -1522,7 +1518,7 @@ function Pe(e) {
1522
1518
  t.current[n] = e[n];
1523
1519
  }, [e]), t.current;
1524
1520
  }
1525
- const st = ht(null);
1521
+ const at = ht(null);
1526
1522
  function Wt(e, t) {
1527
1523
  const n = T({
1528
1524
  getLayout: () => ({}),
@@ -1540,36 +1536,36 @@ function Ut({
1540
1536
  className: t,
1541
1537
  defaultLayout: n,
1542
1538
  disableCursor: o,
1543
- disabled: r,
1544
- elementRef: a,
1545
- groupRef: u,
1546
- id: i,
1547
- onLayoutChange: s,
1548
- onLayoutChanged: l,
1539
+ disabled: i,
1540
+ elementRef: s,
1541
+ groupRef: l,
1542
+ id: r,
1543
+ onLayoutChange: a,
1544
+ onLayoutChanged: u,
1549
1545
  orientation: c = "horizontal",
1550
1546
  resizeTargetMinimumSize: m = {
1551
1547
  coarse: 20,
1552
1548
  fine: 10
1553
1549
  },
1554
- style: p,
1550
+ style: d,
1555
1551
  ...v
1556
1552
  }) {
1557
1553
  const x = T({
1558
1554
  onLayoutChange: {},
1559
1555
  onLayoutChanged: {}
1560
- }), f = ne((b) => {
1561
- j(x.current.onLayoutChange, b) || (x.current.onLayoutChange = b, s?.(b));
1562
- }), h = ne((b) => {
1563
- j(x.current.onLayoutChanged, b) || (x.current.onLayoutChanged = b, l?.(b));
1564
- }), g = xe(i), y = T(null), [z, S] = Bt(), d = T({
1556
+ }), f = oe((b) => {
1557
+ j(x.current.onLayoutChange, b) || (x.current.onLayoutChange = b, a?.(b));
1558
+ }), h = oe((b) => {
1559
+ j(x.current.onLayoutChanged, b) || (x.current.onLayoutChanged = b, u?.(b));
1560
+ }), g = xe(r), y = T(null), [z, S] = Bt(), p = T({
1565
1561
  lastExpandedPanelSizes: {},
1566
1562
  layouts: {},
1567
1563
  panels: [],
1568
1564
  resizeTargetMinimumSize: m,
1569
1565
  separators: []
1570
- }), P = we(y, a);
1571
- Wt(g, u);
1572
- const R = ne(
1566
+ }), P = we(y, s);
1567
+ Wt(g, l);
1568
+ const R = oe(
1573
1569
  (b, w) => {
1574
1570
  const E = W(), M = Me(b), k = $(b);
1575
1571
  if (k) {
@@ -1603,7 +1599,7 @@ function Ut({
1603
1599
  id: g,
1604
1600
  orientation: c,
1605
1601
  registerPanel: (b) => {
1606
- const w = d.current;
1602
+ const w = p.current;
1607
1603
  return w.panels = Se(c, [
1608
1604
  ...w.panels,
1609
1605
  b
@@ -1614,7 +1610,7 @@ function Ut({
1614
1610
  };
1615
1611
  },
1616
1612
  registerSeparator: (b) => {
1617
- const w = d.current;
1613
+ const w = p.current;
1618
1614
  return w.separators = Se(c, [
1619
1615
  ...w.separators,
1620
1616
  b
@@ -1625,30 +1621,30 @@ function Ut({
1625
1621
  };
1626
1622
  },
1627
1623
  togglePanelDisabled: (b, w) => {
1628
- const M = d.current.panels.find(
1624
+ const M = p.current.panels.find(
1629
1625
  (H) => H.id === b
1630
1626
  );
1631
1627
  M && (M.panelConstraints.disabled = w);
1632
1628
  const k = Me(g), O = $(g);
1633
- k && O && F(k, {
1629
+ k && O && _(k, {
1634
1630
  ...O,
1635
1631
  derivedPanelConstraints: ge(k)
1636
1632
  });
1637
1633
  },
1638
1634
  toggleSeparatorDisabled: (b, w) => {
1639
- const M = d.current.separators.find(
1635
+ const M = p.current.separators.find(
1640
1636
  (k) => k.id === b
1641
1637
  );
1642
1638
  M && (M.disabled = w);
1643
1639
  }
1644
1640
  }),
1645
1641
  [R, g, S, c, C]
1646
- ), _ = T(null);
1642
+ ), F = T(null);
1647
1643
  return K(() => {
1648
1644
  const b = y.current;
1649
1645
  if (b === null)
1650
1646
  return;
1651
- const w = d.current;
1647
+ const w = p.current;
1652
1648
  let E;
1653
1649
  if (C.defaultLayout !== void 0 && Object.keys(C.defaultLayout).length === w.panels.length) {
1654
1650
  E = {};
@@ -1658,35 +1654,35 @@ function Ut({
1658
1654
  }
1659
1655
  }
1660
1656
  const M = {
1661
- disabled: !!r,
1657
+ disabled: !!i,
1662
1658
  element: b,
1663
1659
  id: g,
1664
1660
  mutableState: {
1665
1661
  defaultLayout: E,
1666
1662
  disableCursor: !!C.disableCursor,
1667
- expandedPanelSizes: d.current.lastExpandedPanelSizes,
1668
- layouts: d.current.layouts
1663
+ expandedPanelSizes: p.current.lastExpandedPanelSizes,
1664
+ layouts: p.current.layouts
1669
1665
  },
1670
1666
  orientation: c,
1671
1667
  panels: w.panels,
1672
1668
  resizeTargetMinimumSize: w.resizeTargetMinimumSize,
1673
1669
  separators: w.separators
1674
1670
  };
1675
- _.current = M;
1671
+ F.current = M;
1676
1672
  const k = jt(M), { defaultLayoutDeferred: O, derivedPanelConstraints: H, layout: Ce } = $(M.id, !0);
1677
1673
  !O && H.length > 0 && (f(Ce), h(Ce));
1678
1674
  const lt = ye(g, (ee) => {
1679
- const { defaultLayoutDeferred: ae, derivedPanelConstraints: Re, layout: se } = ee.next;
1675
+ const { defaultLayoutDeferred: ae, derivedPanelConstraints: Re, layout: le } = ee.next;
1680
1676
  if (ae || Re.length === 0)
1681
1677
  return;
1682
1678
  const ut = M.panels.map(({ id: N }) => N).join(",");
1683
- M.mutableState.layouts[ut] = se, Re.forEach((N) => {
1679
+ M.mutableState.layouts[ut] = le, Re.forEach((N) => {
1684
1680
  if (N.collapsible) {
1685
1681
  const { layout: pe } = ee.prev ?? {};
1686
1682
  if (pe) {
1687
1683
  const ft = I(
1688
1684
  N.collapsedSize,
1689
- se[N.panelId]
1685
+ le[N.panelId]
1690
1686
  ), dt = I(
1691
1687
  N.collapsedSize,
1692
1688
  pe[N.panelId]
@@ -1696,13 +1692,13 @@ function Ut({
1696
1692
  }
1697
1693
  });
1698
1694
  const ct = W().state !== "active";
1699
- f(se), ct && h(se);
1695
+ f(le), ct && h(le);
1700
1696
  });
1701
1697
  return () => {
1702
- _.current = null, k(), lt();
1698
+ F.current = null, k(), lt();
1703
1699
  };
1704
1700
  }, [
1705
- r,
1701
+ i,
1706
1702
  g,
1707
1703
  h,
1708
1704
  f,
@@ -1710,9 +1706,9 @@ function Ut({
1710
1706
  z,
1711
1707
  C
1712
1708
  ]), de(() => {
1713
- const b = _.current;
1709
+ const b = F.current;
1714
1710
  b && (b.mutableState.defaultLayout = n, b.mutableState.disableCursor = !!o);
1715
- }), /* @__PURE__ */ oe(st.Provider, { value: X, children: /* @__PURE__ */ oe(
1711
+ }), /* @__PURE__ */ ie(at.Provider, { value: X, children: /* @__PURE__ */ ie(
1716
1712
  "div",
1717
1713
  {
1718
1714
  ...v,
@@ -1725,7 +1721,7 @@ function Ut({
1725
1721
  height: "100%",
1726
1722
  width: "100%",
1727
1723
  overflow: "hidden",
1728
- ...p,
1724
+ ...d,
1729
1725
  display: "flex",
1730
1726
  flexDirection: c === "horizontal" ? "row" : "column",
1731
1727
  flexWrap: "nowrap",
@@ -1749,35 +1745,35 @@ function nn({
1749
1745
  storage: n = localStorage,
1750
1746
  ...o
1751
1747
  }) {
1752
- const r = t !== void 0, a = "id" in o ? o.id : o.groupId, u = me(a, t ?? []), i = Ke(
1748
+ const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = me(s, t ?? []), r = Ke(
1753
1749
  Kt,
1754
- () => n.getItem(u),
1755
- () => n.getItem(u)
1756
- ), s = Ue(
1757
- () => i ? JSON.parse(i) : void 0,
1758
- [i]
1759
- ), l = T(null), c = te(() => {
1760
- const v = l.current;
1761
- v && (l.current = null, clearTimeout(v));
1750
+ () => n.getItem(l),
1751
+ () => n.getItem(l)
1752
+ ), a = Ue(
1753
+ () => r ? JSON.parse(r) : void 0,
1754
+ [r]
1755
+ ), u = T(null), c = ne(() => {
1756
+ const v = u.current;
1757
+ v && (u.current = null, clearTimeout(v));
1762
1758
  }, []);
1763
1759
  Be(() => () => {
1764
1760
  c();
1765
1761
  }, [c]);
1766
- const m = te(
1762
+ const m = ne(
1767
1763
  (v) => {
1768
1764
  c();
1769
1765
  let x;
1770
- r ? x = me(a, Object.keys(v)) : x = me(a, []);
1766
+ i ? x = me(s, Object.keys(v)) : x = me(s, []);
1771
1767
  try {
1772
1768
  n.setItem(x, JSON.stringify(v));
1773
1769
  } catch (f) {
1774
1770
  console.error(f);
1775
1771
  }
1776
1772
  },
1777
- [c, r, a, n]
1778
- ), p = te(
1773
+ [c, i, s, n]
1774
+ ), d = ne(
1779
1775
  (v) => {
1780
- c(), e === 0 ? m(v) : l.current = setTimeout(() => {
1776
+ c(), e === 0 ? m(v) : u.current = setTimeout(() => {
1781
1777
  m(v);
1782
1778
  }, e);
1783
1779
  },
@@ -1787,13 +1783,13 @@ function nn({
1787
1783
  /**
1788
1784
  * Pass this value to `Group` as the `defaultLayout` prop.
1789
1785
  */
1790
- defaultLayout: s,
1786
+ defaultLayout: a,
1791
1787
  /**
1792
1788
  * Attach this callback on the `Group` as the `onLayoutChange` prop.
1793
1789
  *
1794
1790
  * @deprecated Use the {@link onLayoutChanged} prop instead.
1795
1791
  */
1796
- onLayoutChange: p,
1792
+ onLayoutChange: d,
1797
1793
  /**
1798
1794
  * Attach this callback on the `Group` as the `onLayoutChanged` prop.
1799
1795
  */
@@ -1805,13 +1801,13 @@ function Kt() {
1805
1801
  };
1806
1802
  }
1807
1803
  function on() {
1808
- return ie(null);
1804
+ return re(null);
1809
1805
  }
1810
1806
  function rn() {
1811
1807
  return T(null);
1812
1808
  }
1813
1809
  function Le() {
1814
- const e = mt(st);
1810
+ const e = mt(at);
1815
1811
  return L(
1816
1812
  e,
1817
1813
  "Group Context not found; did you render a Panel or Separator outside of a Group?"
@@ -1840,29 +1836,29 @@ function qt({
1840
1836
  className: t,
1841
1837
  collapsedSize: n = "0%",
1842
1838
  collapsible: o = !1,
1843
- defaultSize: r,
1844
- disabled: a,
1845
- elementRef: u,
1846
- groupResizeBehavior: i = "preserve-relative-size",
1847
- id: s,
1848
- maxSize: l = "100%",
1839
+ defaultSize: i,
1840
+ disabled: s,
1841
+ elementRef: l,
1842
+ groupResizeBehavior: r = "preserve-relative-size",
1843
+ id: a,
1844
+ maxSize: u = "100%",
1849
1845
  minSize: c = "0%",
1850
1846
  onResize: m,
1851
- panelRef: p,
1847
+ panelRef: d,
1852
1848
  style: v,
1853
1849
  ...x
1854
1850
  }) {
1855
- const f = !!s, h = xe(s), g = Pe({
1856
- disabled: a
1857
- }), y = T(null), z = we(y, u), {
1851
+ const f = !!a, h = xe(a), g = Pe({
1852
+ disabled: s
1853
+ }), y = T(null), z = we(y, l), {
1858
1854
  getPanelStyles: S,
1859
- id: d,
1855
+ id: p,
1860
1856
  orientation: P,
1861
1857
  registerPanel: R,
1862
1858
  togglePanelDisabled: C
1863
- } = Le(), X = m !== null, _ = ne(
1859
+ } = Le(), X = m !== null, F = oe(
1864
1860
  (w, E, M) => {
1865
- m?.(w, s, M);
1861
+ m?.(w, a, M);
1866
1862
  }
1867
1863
  );
1868
1864
  K(() => {
@@ -1876,47 +1872,47 @@ function qt({
1876
1872
  expandToSize: void 0,
1877
1873
  prevSize: void 0
1878
1874
  },
1879
- onResize: X ? _ : void 0,
1875
+ onResize: X ? F : void 0,
1880
1876
  panelConstraints: {
1881
- groupResizeBehavior: i,
1877
+ groupResizeBehavior: r,
1882
1878
  collapsedSize: n,
1883
1879
  collapsible: o,
1884
- defaultSize: r,
1880
+ defaultSize: i,
1885
1881
  disabled: g.disabled,
1886
- maxSize: l,
1882
+ maxSize: u,
1887
1883
  minSize: c
1888
1884
  }
1889
1885
  };
1890
1886
  return R(E);
1891
1887
  }
1892
1888
  }, [
1893
- i,
1889
+ r,
1894
1890
  n,
1895
1891
  o,
1896
- r,
1892
+ i,
1897
1893
  X,
1898
1894
  h,
1899
1895
  f,
1900
- l,
1896
+ u,
1901
1897
  c,
1902
- _,
1898
+ F,
1903
1899
  R,
1904
1900
  g
1905
1901
  ]), de(() => {
1906
- C(h, !!a);
1907
- }, [a, h, C]), Xt(h, p);
1902
+ C(h, !!s);
1903
+ }, [s, h, C]), Xt(h, d);
1908
1904
  const b = Ke(
1909
- (w) => ye(d, w),
1905
+ (w) => ye(p, w),
1910
1906
  // useSyncExternalStore does not support a custom equality check
1911
1907
  // stringify avoids re-rendering when the style value hasn't changed
1912
- () => JSON.stringify(S(d, h)),
1913
- () => JSON.stringify(S(d, h))
1908
+ () => JSON.stringify(S(p, h)),
1909
+ () => JSON.stringify(S(p, h))
1914
1910
  );
1915
- return /* @__PURE__ */ oe(
1911
+ return /* @__PURE__ */ ie(
1916
1912
  "div",
1917
1913
  {
1918
1914
  ...x,
1919
- "aria-disabled": a || void 0,
1915
+ "aria-disabled": s || void 0,
1920
1916
  "data-panel": !0,
1921
1917
  "data-testid": h,
1922
1918
  id: h,
@@ -1929,7 +1925,7 @@ function qt({
1929
1925
  overflow: "visible",
1930
1926
  ...JSON.parse(b)
1931
1927
  },
1932
- children: /* @__PURE__ */ oe(
1928
+ children: /* @__PURE__ */ ie(
1933
1929
  "div",
1934
1930
  {
1935
1931
  className: t,
@@ -1964,10 +1960,10 @@ const Yt = {
1964
1960
  padding: 0,
1965
1961
  margin: 0
1966
1962
  };
1967
- function an() {
1968
- return ie(null);
1969
- }
1970
1963
  function sn() {
1964
+ return re(null);
1965
+ }
1966
+ function an() {
1971
1967
  return T(null);
1972
1968
  }
1973
1969
  function Jt({
@@ -1976,24 +1972,24 @@ function Jt({
1976
1972
  panelId: n,
1977
1973
  panelIndex: o
1978
1974
  }) {
1979
- let r, a;
1980
- const u = e[n], i = t.find(
1981
- (s) => s.panelId === n
1975
+ let i, s;
1976
+ const l = e[n], r = t.find(
1977
+ (a) => a.panelId === n
1982
1978
  );
1983
- if (i) {
1984
- const s = i.maxSize, l = i.collapsible ? i.collapsedSize : i.minSize, c = [o, o + 1];
1985
- a = B({
1986
- layout: re({
1987
- delta: l - u,
1979
+ if (r) {
1980
+ const a = r.maxSize, u = r.collapsible ? r.collapsedSize : r.minSize, c = [o, o + 1];
1981
+ s = B({
1982
+ layout: se({
1983
+ delta: u - l,
1988
1984
  initialLayout: e,
1989
1985
  panelConstraints: t,
1990
1986
  pivotIndices: c,
1991
1987
  prevLayout: e
1992
1988
  }),
1993
1989
  panelConstraints: t
1994
- })[n], r = B({
1995
- layout: re({
1996
- delta: s - u,
1990
+ })[n], i = B({
1991
+ layout: se({
1992
+ delta: a - l,
1997
1993
  initialLayout: e,
1998
1994
  panelConstraints: t,
1999
1995
  pivotIndices: c,
@@ -2004,9 +2000,9 @@ function Jt({
2004
2000
  }
2005
2001
  return {
2006
2002
  valueControls: n,
2007
- valueMax: r,
2008
- valueMin: a,
2009
- valueNow: u
2003
+ valueMax: i,
2004
+ valueMin: s,
2005
+ valueNow: l
2010
2006
  };
2011
2007
  }
2012
2008
  function Zt({
@@ -2014,13 +2010,13 @@ function Zt({
2014
2010
  className: t,
2015
2011
  disabled: n,
2016
2012
  elementRef: o,
2017
- id: r,
2018
- style: a,
2019
- ...u
2013
+ id: i,
2014
+ style: s,
2015
+ ...l
2020
2016
  }) {
2021
- const i = xe(r), s = Pe({
2017
+ const r = xe(i), a = Pe({
2022
2018
  disabled: n
2023
- }), [l, c] = ie({}), [m, p] = ie("inactive"), v = T(null), x = we(v, o), {
2019
+ }), [u, c] = re({}), [m, d] = re("inactive"), v = T(null), x = we(v, o), {
2024
2020
  disableCursor: f,
2025
2021
  id: h,
2026
2022
  orientation: g,
@@ -2031,18 +2027,18 @@ function Zt({
2031
2027
  const P = v.current;
2032
2028
  if (P !== null) {
2033
2029
  const R = {
2034
- disabled: s.disabled,
2030
+ disabled: a.disabled,
2035
2031
  element: P,
2036
- id: i
2032
+ id: r
2037
2033
  }, C = y(R), X = Gt(
2038
2034
  (b) => {
2039
- p(
2035
+ d(
2040
2036
  b.next.state !== "inactive" && b.next.hitRegions.some(
2041
2037
  (w) => w.separator === R
2042
2038
  ) ? b.next.state : "inactive"
2043
2039
  );
2044
2040
  }
2045
- ), _ = ye(
2041
+ ), F = ye(
2046
2042
  h,
2047
2043
  (b) => {
2048
2044
  const { derivedPanelConstraints: w, layout: E, separatorToPanels: M } = b.next, k = M.get(R);
@@ -2060,34 +2056,34 @@ function Zt({
2060
2056
  }
2061
2057
  );
2062
2058
  return () => {
2063
- X(), _(), C();
2059
+ X(), F(), C();
2064
2060
  };
2065
2061
  }
2066
- }, [h, i, y, s]), de(() => {
2067
- z(i, !!n);
2068
- }, [n, i, z]);
2069
- let d;
2070
- return n && !f && (d = "not-allowed"), /* @__PURE__ */ oe(
2062
+ }, [h, r, y, a]), de(() => {
2063
+ z(r, !!n);
2064
+ }, [n, r, z]);
2065
+ let p;
2066
+ return n && !f && (p = "not-allowed"), /* @__PURE__ */ ie(
2071
2067
  "div",
2072
2068
  {
2073
- ...u,
2074
- "aria-controls": l.valueControls,
2069
+ ...l,
2070
+ "aria-controls": u.valueControls,
2075
2071
  "aria-disabled": n || void 0,
2076
2072
  "aria-orientation": S,
2077
- "aria-valuemax": l.valueMax,
2078
- "aria-valuemin": l.valueMin,
2079
- "aria-valuenow": l.valueNow,
2073
+ "aria-valuemax": u.valueMax,
2074
+ "aria-valuemin": u.valueMin,
2075
+ "aria-valuenow": u.valueNow,
2080
2076
  children: e,
2081
2077
  className: t,
2082
2078
  "data-separator": n ? "disabled" : m,
2083
- "data-testid": i,
2084
- id: i,
2079
+ "data-testid": r,
2080
+ id: r,
2085
2081
  ref: x,
2086
2082
  role: "separator",
2087
2083
  style: {
2088
2084
  flexBasis: "auto",
2089
- cursor: d,
2090
- ...a,
2085
+ cursor: p,
2086
+ ...s,
2091
2087
  flexGrow: 0,
2092
2088
  flexShrink: 0,
2093
2089
  // Inform the browser that the library is handling touch events for this element
@@ -2107,7 +2103,7 @@ export {
2107
2103
  nn as useDefaultLayout,
2108
2104
  on as useGroupCallbackRef,
2109
2105
  rn as useGroupRef,
2110
- an as usePanelCallbackRef,
2111
- sn as usePanelRef
2106
+ sn as usePanelCallbackRef,
2107
+ an as usePanelRef
2112
2108
  };
2113
2109
  //# sourceMappingURL=react-resizable-panels.js.map