react-resizable-panels 4.12.2 → 4.12.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 ae } from "react/jsx-runtime";
3
- import { useState as Q, useCallback as re, useId as mt, useLayoutEffect as Ke, useEffect as me, useRef as O, createContext as gt, useImperativeHandle as Xe, useMemo as Se, useSyncExternalStore as qe, useContext as yt } from "react";
2
+ import { jsx as se } from "react/jsx-runtime";
3
+ import { useState as Q, useCallback as ie, useId as mt, useLayoutEffect as Ke, useEffect as ge, useRef as O, createContext as gt, useImperativeHandle as Xe, useMemo as ve, useSyncExternalStore as qe, useContext as yt } from "react";
4
4
  function St(e, t) {
5
5
  const n = getComputedStyle(e), o = parseFloat(n.fontSize);
6
6
  return t * o;
@@ -25,7 +25,7 @@ function xt(e) {
25
25
  }
26
26
  }
27
27
  }
28
- function ie({
28
+ function oe({
29
29
  groupSize: e,
30
30
  panelElement: t,
31
31
  styleProp: n
@@ -69,7 +69,7 @@ function ne({
69
69
  const { orientation: t, panels: n } = e;
70
70
  return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
71
71
  }
72
- function ve(e) {
72
+ function be(e) {
73
73
  const { panels: t } = e, n = ne({ group: e });
74
74
  return n === 0 ? t.map((o) => ({
75
75
  groupResizeBehavior: o.panelConstraints.groupResizeBehavior,
@@ -84,7 +84,7 @@ function ve(e) {
84
84
  const { element: i, panelConstraints: s } = o;
85
85
  let u = 0;
86
86
  if (s.collapsedSize !== void 0) {
87
- const c = ie({
87
+ const c = oe({
88
88
  groupSize: n,
89
89
  panelElement: i,
90
90
  styleProp: s.collapsedSize
@@ -93,7 +93,7 @@ function ve(e) {
93
93
  }
94
94
  let a;
95
95
  if (s.defaultSize !== void 0) {
96
- const c = ie({
96
+ const c = oe({
97
97
  groupSize: n,
98
98
  panelElement: i,
99
99
  styleProp: s.defaultSize
@@ -102,7 +102,7 @@ function ve(e) {
102
102
  }
103
103
  let r = 0;
104
104
  if (s.minSize !== void 0) {
105
- const c = ie({
105
+ const c = oe({
106
106
  groupSize: n,
107
107
  panelElement: i,
108
108
  styleProp: s.minSize
@@ -111,7 +111,7 @@ function ve(e) {
111
111
  }
112
112
  let l = 100;
113
113
  if (s.maxSize !== void 0) {
114
- const c = ie({
114
+ const c = oe({
115
115
  groupSize: n,
116
116
  panelElement: i,
117
117
  styleProp: s.maxSize
@@ -134,7 +134,7 @@ function C(e, t = "Assertion error") {
134
134
  if (!e)
135
135
  throw Error(t);
136
136
  }
137
- function be(e, t) {
137
+ function ze(e, t) {
138
138
  return Array.from(t).sort(
139
139
  e === "horizontal" ? Pt : wt
140
140
  );
@@ -178,12 +178,12 @@ function Lt({
178
178
  }
179
179
  return C(i, "No rect found"), i;
180
180
  }
181
- let fe;
181
+ let de;
182
182
  function Ct() {
183
- return fe === void 0 && (typeof matchMedia == "function" ? fe = !!matchMedia("(pointer:coarse)").matches : fe = !1), fe;
183
+ return de === void 0 && (typeof matchMedia == "function" ? de = !!matchMedia("(pointer:coarse)").matches : de = !1), de;
184
184
  }
185
185
  function Ze(e) {
186
- const { element: t, orientation: n, panels: o, separators: i } = e, s = be(
186
+ const { element: t, orientation: n, panels: o, separators: i } = e, s = ze(
187
187
  n,
188
188
  Array.from(t.children).filter(Ye).map((z) => ({ element: z }))
189
189
  ).map(({ element: z }) => z), u = [];
@@ -226,14 +226,14 @@ function Ze(e) {
226
226
  break;
227
227
  }
228
228
  case 1: {
229
- const w = S[0], M = Lt({
229
+ const w = S[0], E = Lt({
230
230
  orientation: n,
231
231
  rects: [h, y],
232
232
  targetRect: w.element.getBoundingClientRect()
233
233
  });
234
234
  b = [
235
235
  w,
236
- M === h ? g : v
236
+ E === h ? g : v
237
237
  ];
238
238
  break;
239
239
  }
@@ -277,8 +277,8 @@ function Ze(e) {
277
277
  g.height + L
278
278
  );
279
279
  }
280
- const M = z <= l || z > c;
281
- !a && !M && u.push({
280
+ const E = z <= l || z > c;
281
+ !a && !E && u.push({
282
282
  group: e,
283
283
  groupSize: ne({ group: e }),
284
284
  panels: [p, d],
@@ -343,32 +343,32 @@ let ee = {
343
343
  cursorFlags: 0,
344
344
  state: "inactive"
345
345
  };
346
- const ze = new Qe();
347
- function B() {
346
+ const xe = new Qe();
347
+ function W() {
348
348
  return ee;
349
349
  }
350
350
  function Rt(e) {
351
- return ze.addListener("change", e);
351
+ return xe.addListener("change", e);
352
352
  }
353
- function Mt(e) {
353
+ function Et(e) {
354
354
  const t = ee, n = { ...ee };
355
- n.cursorFlags = e, ee = n, ze.emit("change", {
355
+ n.cursorFlags = e, ee = n, xe.emit("change", {
356
356
  prev: t,
357
357
  next: n
358
358
  });
359
359
  }
360
360
  function te(e) {
361
361
  const t = ee;
362
- ee = e, ze.emit("change", {
362
+ ee = e, xe.emit("change", {
363
363
  prev: t,
364
364
  next: e
365
365
  });
366
366
  }
367
- const Et = (e) => e, ye = () => {
367
+ const Mt = (e) => e, Se = () => {
368
368
  }, et = 1, tt = 2, nt = 4, ot = 8, Ie = 3, ke = 12;
369
- let de;
369
+ let pe;
370
370
  function De() {
371
- return de === void 0 && (de = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (de = !0)), de;
371
+ return pe === void 0 && (pe = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (pe = !0)), pe;
372
372
  }
373
373
  function It({
374
374
  cursorFlags: e,
@@ -414,15 +414,15 @@ function It({
414
414
  }
415
415
  }
416
416
  const Te = /* @__PURE__ */ new WeakMap();
417
- function xe(e) {
418
- if (e.defaultView === null || e.defaultView === void 0)
417
+ function Pe(e) {
418
+ if (!e.defaultView || !e.adoptedStyleSheets)
419
419
  return;
420
420
  let { prevStyle: t, styleSheet: n } = Te.get(e) ?? {};
421
421
  n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && (Object.isExtensible(e.adoptedStyleSheets) ? e.adoptedStyleSheets.push(n) : e.adoptedStyleSheets = [
422
422
  ...e.adoptedStyleSheets,
423
423
  n
424
424
  ]));
425
- const o = B();
425
+ const o = W();
426
426
  switch (o.state) {
427
427
  case "active":
428
428
  case "hover": {
@@ -463,10 +463,10 @@ function H(e, t) {
463
463
  if (t)
464
464
  throw Error(`Could not find data for Group with id ${e}`);
465
465
  }
466
- function X() {
466
+ function V() {
467
467
  return F;
468
468
  }
469
- function Pe(e, t) {
469
+ function we(e, t) {
470
470
  return it.addListener("groupChange", (n) => {
471
471
  n.group.id === e && t(n);
472
472
  });
@@ -481,21 +481,23 @@ function j(e, t, n) {
481
481
  });
482
482
  }
483
483
  function rt(e) {
484
- const t = B();
485
- let n = !1;
484
+ const t = W(), n = V();
485
+ let o = !1;
486
486
  switch (t.state) {
487
487
  case "active":
488
488
  te({
489
489
  cursorFlags: 0,
490
490
  state: "inactive"
491
- }), t.hitRegions.length > 0 && (xe(e), n = !0, t.hitRegions.forEach((o) => {
492
- const i = H(o.group.id, !0);
493
- j(o.group, i, {
491
+ }), t.hitRegions.length > 0 && (Pe(e), o = !0, t.hitRegions.forEach((i) => {
492
+ if (!n.has(i.group))
493
+ return;
494
+ const s = H(i.group.id, !0);
495
+ j(i.group, s, {
494
496
  isUserInteraction: !0
495
497
  });
496
498
  }));
497
499
  }
498
- return n;
500
+ return o;
499
501
  }
500
502
  function Ge(e) {
501
503
  e.defaultPrevented || rt(e.currentTarget);
@@ -609,7 +611,7 @@ function _t({
609
611
  }
610
612
  return !0;
611
613
  }
612
- function we(e, t) {
614
+ function Le(e, t) {
613
615
  const n = [];
614
616
  return t.forEach((o, i) => {
615
617
  if (i.disabled)
@@ -633,11 +635,11 @@ function $t(e, t) {
633
635
  return !1;
634
636
  return !0;
635
637
  }
636
- function k(e, t, n = 0) {
638
+ function D(e, t, n = 0) {
637
639
  return Math.abs(T(e) - T(t)) <= n;
638
640
  }
639
641
  function A(e, t) {
640
- return k(e, t) ? 0 : e > t ? 1 : -1;
642
+ return D(e, t) ? 0 : e > t ? 1 : -1;
641
643
  }
642
644
  function Z({
643
645
  overrideDisabledPanels: e,
@@ -662,7 +664,7 @@ function Z({
662
664
  o = r;
663
665
  return o = Math.min(a, o), o = T(o), o;
664
666
  }
665
- function le({
667
+ function ae({
666
668
  delta: e,
667
669
  initialLayout: t,
668
670
  panelConstraints: n,
@@ -670,7 +672,7 @@ function le({
670
672
  prevLayout: i,
671
673
  trigger: s
672
674
  }) {
673
- if (k(e, 0))
675
+ if (D(e, 0))
674
676
  return t;
675
677
  const u = s === "imperative-api", a = Object.values(t), r = Object.values(i), l = [...a], [c, m] = o;
676
678
  C(c != null, "Invalid first pivot index"), C(m != null, "Invalid second pivot index");
@@ -693,7 +695,7 @@ function le({
693
695
  if (C(
694
696
  v != null,
695
697
  `Previous layout not found for panel index ${f}`
696
- ), k(v, h)) {
698
+ ), D(v, h)) {
697
699
  const g = b - v;
698
700
  A(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
699
701
  }
@@ -715,7 +717,7 @@ function le({
715
717
  if (C(
716
718
  v != null,
717
719
  `Previous layout not found for panel index ${f}`
718
- ), k(v, b)) {
720
+ ), D(v, b)) {
719
721
  const g = v - h;
720
722
  A(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
721
723
  }
@@ -732,11 +734,11 @@ function le({
732
734
  const h = a[f], { collapsible: y, collapsedSize: b, minSize: v } = d;
733
735
  if (y && A(h, v) < 0)
734
736
  if (e > 0) {
735
- const g = v - b, w = g / 2, M = h + e;
736
- A(M, v) < 0 && (e = A(e, w) <= 0 ? 0 : g);
737
+ const g = v - b, w = g / 2, E = h + e;
738
+ A(E, v) < 0 && (e = A(e, w) <= 0 ? 0 : g);
737
739
  } else {
738
- const g = v - b, w = 100 - g / 2, M = h - e;
739
- A(M, v) < 0 && (e = A(100 + e, w) > 0 ? 0 : -g);
740
+ const g = v - b, w = 100 - g / 2, E = h - e;
741
+ A(E, v) < 0 && (e = A(100 + e, w) > 0 ? 0 : -g);
740
742
  }
741
743
  break;
742
744
  }
@@ -776,7 +778,7 @@ function le({
776
778
  prevSize: y,
777
779
  size: b
778
780
  });
779
- if (!k(y, v) && (p += y - v, l[d] = v, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
781
+ if (!D(y, v) && (p += y - v, l[d] = v, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
780
782
  numeric: !0
781
783
  }) >= 0))
782
784
  break;
@@ -797,7 +799,7 @@ function le({
797
799
  prevSize: d,
798
800
  size: h
799
801
  });
800
- if (l[f] = y, !k(y, h)) {
802
+ if (l[f] = y, !D(y, h)) {
801
803
  let b = h - y, g = e < 0 ? m : c;
802
804
  for (; g >= 0 && g < n.length; ) {
803
805
  const w = l[g];
@@ -805,13 +807,13 @@ function le({
805
807
  w != null,
806
808
  `Previous layout not found for panel index ${g}`
807
809
  );
808
- const M = w + b, L = Z({
810
+ const E = w + b, L = Z({
809
811
  overrideDisabledPanels: u,
810
812
  panelConstraints: n[g],
811
813
  prevSize: w,
812
- size: M
814
+ size: E
813
815
  });
814
- if (k(w, L) || (b -= L - w, l[g] = L), k(b, 0))
816
+ if (D(w, L) || (b -= L - w, l[g] = L), D(b, 0))
815
817
  break;
816
818
  e > 0 ? g-- : g++;
817
819
  }
@@ -821,12 +823,12 @@ function le({
821
823
  (f, d) => d + f,
822
824
  0
823
825
  );
824
- if (!k(S, 100, 0.1))
826
+ if (!D(S, 100, 0.1))
825
827
  return i;
826
828
  const z = Object.keys(i);
827
829
  return l.reduce((f, d, h) => (f[z[h]] = d, f), {});
828
830
  }
829
- function W(e, t) {
831
+ function K(e, t) {
830
832
  if (Object.keys(e).length !== Object.keys(t).length)
831
833
  return !1;
832
834
  for (const n in e)
@@ -834,7 +836,7 @@ function W(e, t) {
834
836
  return !1;
835
837
  return !0;
836
838
  }
837
- function K({
839
+ function X({
838
840
  layout: e,
839
841
  panelConstraints: t
840
842
  }) {
@@ -846,7 +848,7 @@ function K({
846
848
  throw Error(
847
849
  `Invalid ${t.length} panel layout: ${o.map((a) => `${a}%`).join(", ")}`
848
850
  );
849
- if (!k(i, 100) && o.length > 0)
851
+ if (!D(i, 100) && o.length > 0)
850
852
  for (let a = 0; a < t.length; a++) {
851
853
  const r = o[a];
852
854
  C(r != null, `No layout data found for index ${a}`);
@@ -867,7 +869,7 @@ function K({
867
869
  });
868
870
  l != c && (s += l - c, o[a] = c);
869
871
  }
870
- if (!k(s, 0))
872
+ if (!D(s, 0))
871
873
  for (let a = 0; a < t.length; a++) {
872
874
  const r = o[a];
873
875
  C(r != null, `No layout data found for index ${a}`);
@@ -877,7 +879,7 @@ function K({
877
879
  prevSize: r,
878
880
  size: l
879
881
  });
880
- if (r !== c && (s -= c - r, o[a] = c, k(s, 0)))
882
+ if (r !== c && (s -= c - r, o[a] = c, D(s, 0)))
881
883
  break;
882
884
  }
883
885
  const u = Object.keys(e);
@@ -888,7 +890,7 @@ function at({
888
890
  panelId: t
889
891
  }) {
890
892
  const n = () => {
891
- const r = X();
893
+ const r = V();
892
894
  for (const [
893
895
  l,
894
896
  {
@@ -935,7 +937,7 @@ function at({
935
937
  const p = s(), S = l.findIndex((h) => h.id === t), z = S === 0, f = S === l.length - 1;
936
938
  if (f && r < p && (z || l.slice(0, S).every((h, y) => {
937
939
  const b = m[y];
938
- return b?.collapsible && k(b.collapsedSize, c[b.panelId]);
940
+ return b?.collapsible && D(b.collapsedSize, c[b.panelId]);
939
941
  }))) {
940
942
  const h = l.slice(0, S).reduce((y, b) => y + c[b.id], 0);
941
943
  return {
@@ -943,7 +945,7 @@ function at({
943
945
  [t]: T(100 - h)
944
946
  };
945
947
  }
946
- return le({
948
+ return ae({
947
949
  delta: f ? p - r : r - p,
948
950
  initialLayout: c,
949
951
  panelConstraints: m,
@@ -967,11 +969,11 @@ function at({
967
969
  panels: p.panels,
968
970
  prevLayout: z,
969
971
  derivedPanelConstraints: m
970
- }), h = K({
972
+ }), h = X({
971
973
  layout: d,
972
974
  panelConstraints: m
973
975
  });
974
- W(z, h) || j(p, {
976
+ K(z, h) || j(p, {
975
977
  defaultLayoutDeferred: c,
976
978
  derivedPanelConstraints: m,
977
979
  groupSize: S,
@@ -1000,10 +1002,10 @@ function at({
1000
1002
  },
1001
1003
  isCollapsed: () => {
1002
1004
  const { collapsible: r, collapsedSize: l } = o(), c = s();
1003
- return r && k(l, c);
1005
+ return r && D(l, c);
1004
1006
  },
1005
1007
  resize: (r) => {
1006
- const { group: l } = n(), { element: c } = i(), m = ne({ group: l }), p = ie({
1008
+ const { group: l } = n(), { element: c } = i(), m = ne({ group: l }), p = oe({
1007
1009
  groupSize: m,
1008
1010
  panelElement: c,
1009
1011
  styleProp: r
@@ -1015,8 +1017,8 @@ function at({
1015
1017
  function _e(e) {
1016
1018
  if (e.defaultPrevented)
1017
1019
  return;
1018
- const t = X();
1019
- we(e, t).forEach((o) => {
1020
+ const t = V();
1021
+ Le(e, t).forEach((o) => {
1020
1022
  if (o.separator && !o.separator.disableDoubleClick) {
1021
1023
  const i = o.panels.find(
1022
1024
  (s) => s.panelConstraints.defaultSize !== void 0
@@ -1031,8 +1033,8 @@ function _e(e) {
1031
1033
  }
1032
1034
  });
1033
1035
  }
1034
- function pe(e) {
1035
- const t = X();
1036
+ function he(e) {
1037
+ const t = V();
1036
1038
  for (const [n] of t)
1037
1039
  if (n.separators.some(
1038
1040
  (o) => o.element === e
@@ -1044,7 +1046,7 @@ function lt({
1044
1046
  groupId: e
1045
1047
  }) {
1046
1048
  const t = () => {
1047
- const n = X();
1049
+ const n = V();
1048
1050
  for (const [o, i] of n)
1049
1051
  if (o.id === e)
1050
1052
  return { group: o, ...i };
@@ -1063,11 +1065,11 @@ function lt({
1063
1065
  groupSize: u,
1064
1066
  layout: a,
1065
1067
  separatorToPanels: r
1066
- } = t(), l = K({
1068
+ } = t(), l = X({
1067
1069
  layout: n,
1068
1070
  panelConstraints: i
1069
1071
  });
1070
- return o ? a : (W(a, l) || j(s, {
1072
+ return o ? a : (K(a, l) || j(s, {
1071
1073
  defaultLayoutDeferred: o,
1072
1074
  derivedPanelConstraints: i,
1073
1075
  groupSize: u,
@@ -1077,25 +1079,25 @@ function lt({
1077
1079
  }
1078
1080
  };
1079
1081
  }
1080
- function U(e, t) {
1081
- const n = pe(e), o = H(n.id, !0), i = n.separators.find(
1082
+ function B(e, t) {
1083
+ const n = he(e), o = H(n.id, !0), i = n.separators.find(
1082
1084
  (m) => m.element === e
1083
1085
  );
1084
1086
  C(i, "Matching separator not found");
1085
1087
  const s = o.separatorToPanels.get(i);
1086
1088
  C(s, "Matching panels not found");
1087
- const u = s.map((m) => n.panels.indexOf(m)), r = lt({ groupId: n.id }).getLayout(), l = le({
1089
+ const u = s.map((m) => n.panels.indexOf(m)), r = lt({ groupId: n.id }).getLayout(), l = ae({
1088
1090
  delta: t,
1089
1091
  initialLayout: r,
1090
1092
  panelConstraints: o.derivedPanelConstraints,
1091
1093
  pivotIndices: u,
1092
1094
  prevLayout: r,
1093
1095
  trigger: "keyboard"
1094
- }), c = K({
1096
+ }), c = X({
1095
1097
  layout: l,
1096
1098
  panelConstraints: o.derivedPanelConstraints
1097
1099
  });
1098
- W(r, c) || j(
1100
+ K(r, c) || j(
1099
1101
  n,
1100
1102
  {
1101
1103
  defaultLayoutDeferred: o.defaultLayoutDeferred,
@@ -1114,32 +1116,32 @@ function U(e, t) {
1114
1116
  function $e(e) {
1115
1117
  if (e.defaultPrevented)
1116
1118
  return;
1117
- const t = e.currentTarget, n = pe(t);
1119
+ const t = e.currentTarget, n = he(t);
1118
1120
  if (!n.disabled)
1119
1121
  switch (e.key) {
1120
1122
  case "ArrowDown": {
1121
- e.preventDefault(), n.orientation === "vertical" && U(t, 5);
1123
+ e.preventDefault(), n.orientation === "vertical" && B(t, 5);
1122
1124
  break;
1123
1125
  }
1124
1126
  case "ArrowLeft": {
1125
- e.preventDefault(), n.orientation === "horizontal" && U(t, -5);
1127
+ e.preventDefault(), n.orientation === "horizontal" && B(t, -5);
1126
1128
  break;
1127
1129
  }
1128
1130
  case "ArrowRight": {
1129
- e.preventDefault(), n.orientation === "horizontal" && U(t, 5);
1131
+ e.preventDefault(), n.orientation === "horizontal" && B(t, 5);
1130
1132
  break;
1131
1133
  }
1132
1134
  case "ArrowUp": {
1133
- e.preventDefault(), n.orientation === "vertical" && U(t, -5);
1135
+ e.preventDefault(), n.orientation === "vertical" && B(t, -5);
1134
1136
  break;
1135
1137
  }
1136
1138
  case "End": {
1137
- e.preventDefault(), U(t, 100);
1139
+ e.preventDefault(), B(t, 100);
1138
1140
  break;
1139
1141
  }
1140
1142
  case "Enter": {
1141
1143
  e.preventDefault();
1142
- const o = pe(t), i = H(o.id, !0), { derivedPanelConstraints: s, layout: u, separatorToPanels: a } = i, r = o.separators.find(
1144
+ const o = he(t), i = H(o.id, !0), { derivedPanelConstraints: s, layout: u, separatorToPanels: a } = i, r = o.separators.find(
1143
1145
  (p) => p.element === t
1144
1146
  );
1145
1147
  C(r, "Matching separator not found");
@@ -1150,13 +1152,13 @@ function $e(e) {
1150
1152
  );
1151
1153
  if (C(m, "Panel metadata not found"), m.collapsible) {
1152
1154
  const p = u[c.id], S = m.collapsedSize === p ? o.mutableState.expandedPanelSizes[c.id] ?? m.minSize : m.collapsedSize;
1153
- U(t, S - p);
1155
+ B(t, S - p);
1154
1156
  }
1155
1157
  break;
1156
1158
  }
1157
1159
  case "F6": {
1158
1160
  e.preventDefault();
1159
- const i = pe(t).separators.map(
1161
+ const i = he(t).separators.map(
1160
1162
  (r) => r.element
1161
1163
  ), s = Array.from(i).findIndex(
1162
1164
  (r) => r === e.currentTarget
@@ -1169,7 +1171,7 @@ function $e(e) {
1169
1171
  break;
1170
1172
  }
1171
1173
  case "Home": {
1172
- e.preventDefault(), U(t, -100);
1174
+ e.preventDefault(), B(t, -100);
1173
1175
  break;
1174
1176
  }
1175
1177
  }
@@ -1179,7 +1181,7 @@ function je(e) {
1179
1181
  return;
1180
1182
  if (e.pointerType === "mouse" && e.button > 0)
1181
1183
  return;
1182
- const t = X(), n = we(e, t), o = /* @__PURE__ */ new Map();
1184
+ const t = V(), n = Le(e, t), o = /* @__PURE__ */ new Map();
1183
1185
  let i = !1;
1184
1186
  n.forEach((s) => {
1185
1187
  s.separator && (i || (i = !0, s.separator.element.focus({
@@ -1222,7 +1224,7 @@ function ut({
1222
1224
  separatorToPanels: w
1223
1225
  } = h;
1224
1226
  if (b && g && w) {
1225
- const M = le({
1227
+ const E = ae({
1226
1228
  delta: f,
1227
1229
  initialLayout: d,
1228
1230
  panelConstraints: b,
@@ -1230,7 +1232,7 @@ function ut({
1230
1232
  prevLayout: g,
1231
1233
  trigger: "mouse-or-touch"
1232
1234
  });
1233
- if (W(M, g)) {
1235
+ if (K(E, g)) {
1234
1236
  if (f !== 0 && !z)
1235
1237
  switch (p) {
1236
1238
  case "horizontal": {
@@ -1247,16 +1249,16 @@ function ut({
1247
1249
  defaultLayoutDeferred: y,
1248
1250
  derivedPanelConstraints: b,
1249
1251
  groupSize: v,
1250
- layout: M,
1252
+ layout: E,
1251
1253
  separatorToPanels: w
1252
1254
  });
1253
1255
  }
1254
1256
  });
1255
1257
  let r = 0;
1256
- t.movementX === 0 ? r |= u & Ie : r |= a & Ie, t.movementY === 0 ? r |= u & ke : r |= a & ke, Mt(r), xe(e);
1258
+ t.movementX === 0 ? r |= u & Ie : r |= a & Ie, t.movementY === 0 ? r |= u & ke : r |= a & ke, Et(r), Pe(e);
1257
1259
  }
1258
1260
  function He(e) {
1259
- const t = X(), n = B();
1261
+ const t = V(), n = W();
1260
1262
  switch (n.state) {
1261
1263
  case "active":
1262
1264
  ut({
@@ -1272,7 +1274,7 @@ function He(e) {
1272
1274
  function Ve(e) {
1273
1275
  if (e.defaultPrevented)
1274
1276
  return;
1275
- const t = B(), n = X();
1277
+ const t = W(), n = V();
1276
1278
  switch (t.state) {
1277
1279
  case "active": {
1278
1280
  if (
@@ -1283,6 +1285,8 @@ function Ve(e) {
1283
1285
  cursorFlags: 0,
1284
1286
  state: "inactive"
1285
1287
  }), t.hitRegions.forEach((o) => {
1288
+ if (!n.has(o.group))
1289
+ return;
1286
1290
  const i = H(o.group.id, !0);
1287
1291
  j(o.group, i, {
1288
1292
  isUserInteraction: !0
@@ -1293,7 +1297,7 @@ function Ve(e) {
1293
1297
  for (const o of t.hitRegions)
1294
1298
  if (o.separator) {
1295
1299
  const { element: i } = o.separator;
1296
- i.hasPointerCapture?.(e.pointerId) || i.setPointerCapture?.(e.pointerId);
1300
+ i.isConnected && !i.hasPointerCapture?.(e.pointerId) && i.setPointerCapture?.(e.pointerId);
1297
1301
  }
1298
1302
  ut({
1299
1303
  document: e.currentTarget,
@@ -1307,7 +1311,7 @@ function Ve(e) {
1307
1311
  break;
1308
1312
  }
1309
1313
  default: {
1310
- const o = we(e, n);
1314
+ const o = Le(e, n);
1311
1315
  o.length === 0 ? t.state !== "inactive" && te({
1312
1316
  cursorFlags: 0,
1313
1317
  state: "inactive"
@@ -1315,14 +1319,14 @@ function Ve(e) {
1315
1319
  cursorFlags: 0,
1316
1320
  hitRegions: o,
1317
1321
  state: "hover"
1318
- }), xe(e.currentTarget);
1322
+ }), Pe(e.currentTarget);
1319
1323
  break;
1320
1324
  }
1321
1325
  }
1322
1326
  }
1323
1327
  function Ue(e) {
1324
1328
  if (e.relatedTarget instanceof HTMLIFrameElement)
1325
- switch (B().state) {
1329
+ switch (W().state) {
1326
1330
  case "hover":
1327
1331
  te({
1328
1332
  cursorFlags: 0,
@@ -1375,7 +1379,10 @@ function Ht(e, t) {
1375
1379
  return !1;
1376
1380
  return !0;
1377
1381
  }
1378
- function Vt({
1382
+ function Vt(e, t) {
1383
+ return e.length !== t.length ? !1 : e.every((n, o) => Ht(n, t[o]));
1384
+ }
1385
+ function Ut({
1379
1386
  group: e,
1380
1387
  nextGroupSize: t,
1381
1388
  prevGroupSize: n,
@@ -1424,7 +1431,7 @@ function Vt({
1424
1431
  }
1425
1432
  return c;
1426
1433
  }
1427
- function Ut(e, t) {
1434
+ function Bt(e, t) {
1428
1435
  const n = e.map((i) => i.id), o = Object.keys(t);
1429
1436
  if (n.length !== o.length)
1430
1437
  return !1;
@@ -1434,7 +1441,7 @@ function Ut(e, t) {
1434
1441
  return !0;
1435
1442
  }
1436
1443
  const J = /* @__PURE__ */ new Map();
1437
- function Bt(e) {
1444
+ function Wt(e) {
1438
1445
  let t = !0;
1439
1446
  C(
1440
1447
  e.element.ownerDocument.defaultView,
@@ -1451,20 +1458,20 @@ function Bt(e) {
1451
1458
  const v = H(e.id);
1452
1459
  if (!v)
1453
1460
  return;
1454
- const g = ve(e), w = v.defaultLayoutDeferred ? We(g) : v.layout, M = Vt({
1461
+ const g = be(e), w = v.defaultLayoutDeferred ? We(g) : v.layout, E = Ut({
1455
1462
  group: e,
1456
1463
  nextGroupSize: b,
1457
1464
  prevGroupSize: v.groupSize,
1458
1465
  prevLayout: w
1459
- }), L = K({
1460
- layout: M,
1466
+ }), L = X({
1467
+ layout: E,
1461
1468
  panelConstraints: g
1462
1469
  });
1463
- if (!v.defaultLayoutDeferred && W(v.layout, L) && Ht(
1470
+ if (!v.defaultLayoutDeferred && K(v.layout, L) && Vt(
1464
1471
  v.derivedPanelConstraints,
1465
1472
  g
1466
1473
  ) && v.groupSize === b)
1467
- return;
1474
+ continue;
1468
1475
  j(e, {
1469
1476
  defaultLayoutDeferred: !1,
1470
1477
  derivedPanelConstraints: g,
@@ -1483,10 +1490,10 @@ function Bt(e) {
1483
1490
  `Panel ids must be unique; id "${f.id}" was used more than once`
1484
1491
  ), o.add(f.id), f.onResize && s.observe(f.element);
1485
1492
  });
1486
- const u = ne({ group: e }), a = ve(e), r = e.panels.map(({ id: f }) => f).join(",");
1493
+ const u = ne({ group: e }), a = be(e), r = e.panels.map(({ id: f }) => f).join(",");
1487
1494
  let l = e.mutableState.defaultLayout;
1488
- l && (Ut(e.panels, l) || (l = void 0));
1489
- const c = e.mutableState.layouts[r] ?? l ?? We(a), m = K({
1495
+ l && (Bt(e.panels, l) || (l = void 0));
1496
+ const c = e.mutableState.layouts[r] ?? l ?? We(a), m = X({
1490
1497
  layout: c,
1491
1498
  panelConstraints: a
1492
1499
  }), p = e.element.ownerDocument;
@@ -1529,26 +1536,26 @@ function Bt(e) {
1529
1536
  ), p.removeEventListener("pointerleave", He), p.removeEventListener("pointermove", Ve), p.removeEventListener("pointerout", Ue), p.removeEventListener("pointerup", Be, !0)), s.disconnect();
1530
1537
  };
1531
1538
  }
1532
- function Wt() {
1533
- const [e, t] = Q({}), n = re(() => t({}), []);
1539
+ function Kt() {
1540
+ const [e, t] = Q({}), n = ie(() => t({}), []);
1534
1541
  return [e, n];
1535
1542
  }
1536
- function Le(e) {
1543
+ function Ce(e) {
1537
1544
  const t = mt();
1538
1545
  return `${e ?? t}`;
1539
1546
  }
1540
- const q = typeof window < "u" ? Ke : me;
1541
- function se(e) {
1547
+ const q = typeof window < "u" ? Ke : ge;
1548
+ function re(e) {
1542
1549
  const t = O(e);
1543
1550
  return q(() => {
1544
1551
  t.current = e;
1545
- }, [e]), re(
1552
+ }, [e]), ie(
1546
1553
  (...n) => t.current?.(...n),
1547
1554
  [t]
1548
1555
  );
1549
1556
  }
1550
- function Ce(...e) {
1551
- return se((t) => {
1557
+ function Re(...e) {
1558
+ return re((t) => {
1552
1559
  e.forEach((n) => {
1553
1560
  if (n)
1554
1561
  switch (typeof n) {
@@ -1564,7 +1571,7 @@ function Ce(...e) {
1564
1571
  });
1565
1572
  });
1566
1573
  }
1567
- function Re(e) {
1574
+ function Ee(e) {
1568
1575
  const t = O({ ...e });
1569
1576
  return q(() => {
1570
1577
  for (const n in e)
@@ -1572,10 +1579,10 @@ function Re(e) {
1572
1579
  }, [e]), t.current;
1573
1580
  }
1574
1581
  const ct = gt(null);
1575
- function Kt(e, t) {
1582
+ function Xt(e, t) {
1576
1583
  const n = O({
1577
1584
  getLayout: () => ({}),
1578
- setLayout: Et
1585
+ setLayout: Mt
1579
1586
  });
1580
1587
  Xe(t, () => n.current, []), q(() => {
1581
1588
  Object.assign(
@@ -1584,7 +1591,7 @@ function Kt(e, t) {
1584
1591
  );
1585
1592
  });
1586
1593
  }
1587
- function Xt({
1594
+ function qt({
1588
1595
  children: e,
1589
1596
  className: t,
1590
1597
  defaultLayout: n,
@@ -1606,36 +1613,36 @@ function Xt({
1606
1613
  const z = O({
1607
1614
  onLayoutChange: {},
1608
1615
  onLayoutChanged: {}
1609
- }), f = se((x) => {
1610
- W(z.current.onLayoutChange, x) || (z.current.onLayoutChange = x, r?.(x));
1611
- }), d = se(
1616
+ }), f = re((x) => {
1617
+ K(z.current.onLayoutChange, x) || (z.current.onLayoutChange = x, r?.(x));
1618
+ }), d = re(
1612
1619
  (x, P) => {
1613
- W(z.current.onLayoutChanged, x) || (z.current.onLayoutChanged = x, l?.(x, { isUserInteraction: P }));
1620
+ K(z.current.onLayoutChanged, x) || (z.current.onLayoutChanged = x, l?.(x, { isUserInteraction: P }));
1614
1621
  }
1615
- ), h = Le(a), y = O(null), [b, v] = Wt(), g = O({
1622
+ ), h = Ce(a), y = O(null), [b, v] = Kt(), g = O({
1616
1623
  lastExpandedPanelSizes: {},
1617
1624
  layouts: {},
1618
1625
  panels: [],
1619
1626
  resizeTargetMinimumSize: m,
1620
1627
  separators: []
1621
- }), w = Ce(y, s);
1622
- Kt(h, u);
1623
- const M = se(
1628
+ }), w = Re(y, s);
1629
+ Xt(h, u);
1630
+ const E = re(
1624
1631
  (x, P) => {
1625
- const I = B(), R = Oe(x), E = H(x);
1626
- if (E) {
1627
- let D = !1;
1632
+ const I = W(), R = Oe(x), M = H(x);
1633
+ if (M) {
1634
+ let k = !1;
1628
1635
  switch (I.state) {
1629
1636
  case "active": {
1630
- D = I.hitRegions.some(
1631
- (V) => V.group === R
1637
+ k = I.hitRegions.some(
1638
+ (U) => U.group === R
1632
1639
  );
1633
1640
  break;
1634
1641
  }
1635
1642
  }
1636
1643
  return {
1637
- flexGrow: E.layout[P] ?? 1,
1638
- pointerEvents: D ? "none" : void 0
1644
+ flexGrow: M.layout[P] ?? 1,
1645
+ pointerEvents: k ? "none" : void 0
1639
1646
  };
1640
1647
  }
1641
1648
  if (n?.[P])
@@ -1643,20 +1650,20 @@ function Xt({
1643
1650
  flexGrow: n?.[P]
1644
1651
  };
1645
1652
  }
1646
- ), L = Re({
1653
+ ), L = Ee({
1647
1654
  defaultLayout: n,
1648
1655
  disableCursor: o
1649
- }), G = Se(
1656
+ }), G = ve(
1650
1657
  () => ({
1651
1658
  get disableCursor() {
1652
1659
  return !!L.disableCursor;
1653
1660
  },
1654
- getPanelStyles: M,
1661
+ getPanelStyles: E,
1655
1662
  id: h,
1656
1663
  orientation: c,
1657
1664
  registerPanel: (x) => {
1658
1665
  const P = g.current;
1659
- return P.panels = be(c, [
1666
+ return P.panels = ze(c, [
1660
1667
  ...P.panels,
1661
1668
  x
1662
1669
  ]), v(), () => {
@@ -1667,7 +1674,7 @@ function Xt({
1667
1674
  },
1668
1675
  registerSeparator: (x) => {
1669
1676
  const P = g.current;
1670
- return P.separators = be(c, [
1677
+ return P.separators = ze(c, [
1671
1678
  ...P.separators,
1672
1679
  x
1673
1680
  ]), v(), () => {
@@ -1678,26 +1685,26 @@ function Xt({
1678
1685
  },
1679
1686
  updatePanelProps: (x, { disabled: P }) => {
1680
1687
  const R = g.current.panels.find(
1681
- (V) => V.id === x
1688
+ (U) => U.id === x
1682
1689
  );
1683
1690
  R && (R.panelConstraints.disabled = P);
1684
- const E = Oe(h), D = H(h);
1685
- E && D && j(E, {
1686
- ...D,
1687
- derivedPanelConstraints: ve(E)
1691
+ const M = Oe(h), k = H(h);
1692
+ M && k && j(M, {
1693
+ ...k,
1694
+ derivedPanelConstraints: be(M)
1688
1695
  });
1689
1696
  },
1690
1697
  updateSeparatorProps: (x, {
1691
1698
  disabled: P,
1692
1699
  disableDoubleClick: I
1693
1700
  }) => {
1694
- const E = g.current.separators.find(
1695
- (D) => D.id === x
1701
+ const M = g.current.separators.find(
1702
+ (k) => k.id === x
1696
1703
  );
1697
- E && (E.disabled = P, E.disableDoubleClick = I);
1704
+ M && (M.disabled = P, M.disableDoubleClick = I);
1698
1705
  }
1699
1706
  }),
1700
- [M, h, v, c, L]
1707
+ [E, h, v, c, L]
1701
1708
  ), N = O(null);
1702
1709
  return q(() => {
1703
1710
  const x = y.current;
@@ -1728,33 +1735,33 @@ function Xt({
1728
1735
  separators: P.separators
1729
1736
  };
1730
1737
  N.current = R;
1731
- const E = Bt(R), { defaultLayoutDeferred: D, derivedPanelConstraints: V, layout: ue } = H(R.id, !0);
1732
- !D && V.length > 0 && (f(ue), d(ue, !1));
1733
- const oe = Pe(h, (_) => {
1734
- const { defaultLayoutDeferred: Y, derivedPanelConstraints: Ee, layout: ce } = _.next;
1735
- if (Y || Ee.length === 0)
1738
+ const M = Wt(R), { defaultLayoutDeferred: k, derivedPanelConstraints: U, layout: le } = H(R.id, !0);
1739
+ !k && U.length > 0 && (f(le), d(le, !1));
1740
+ const ue = we(h, (_) => {
1741
+ const { defaultLayoutDeferred: Y, derivedPanelConstraints: ce, layout: fe } = _.next;
1742
+ if (Y || ce.length === 0)
1736
1743
  return;
1737
1744
  const ft = R.panels.map(({ id: $ }) => $).join(",");
1738
- R.mutableState.layouts[ft] = ce, Ee.forEach(($) => {
1745
+ R.mutableState.layouts[ft] = fe, ce.forEach(($) => {
1739
1746
  if ($.collapsible) {
1740
- const { layout: ge } = _.prev ?? {};
1741
- if (ge) {
1742
- const pt = k(
1747
+ const { layout: ye } = _.prev ?? {};
1748
+ if (ye) {
1749
+ const pt = D(
1743
1750
  $.collapsedSize,
1744
- ce[$.panelId]
1745
- ), ht = k(
1751
+ fe[$.panelId]
1752
+ ), ht = D(
1746
1753
  $.collapsedSize,
1747
- ge[$.panelId]
1754
+ ye[$.panelId]
1748
1755
  );
1749
- pt && !ht && (R.mutableState.expandedPanelSizes[$.panelId] = ge[$.panelId]);
1756
+ pt && !ht && (R.mutableState.expandedPanelSizes[$.panelId] = ye[$.panelId]);
1750
1757
  }
1751
1758
  }
1752
1759
  });
1753
- const dt = B().state !== "active";
1754
- f(ce), dt && d(ce, _.isUserInteraction);
1760
+ const dt = W().state !== "active";
1761
+ f(fe), dt && d(fe, _.isUserInteraction);
1755
1762
  });
1756
1763
  return () => {
1757
- N.current = null, E(), oe();
1764
+ N.current = null, M(), ue();
1758
1765
  };
1759
1766
  }, [
1760
1767
  i,
@@ -1764,10 +1771,10 @@ function Xt({
1764
1771
  c,
1765
1772
  b,
1766
1773
  L
1767
- ]), me(() => {
1774
+ ]), ge(() => {
1768
1775
  const x = N.current;
1769
1776
  x && (x.mutableState.defaultLayout = n, x.mutableState.disableCursor = !!o);
1770
- }), /* @__PURE__ */ ae(ct.Provider, { value: G, children: /* @__PURE__ */ ae(
1777
+ }), /* @__PURE__ */ se(ct.Provider, { value: G, children: /* @__PURE__ */ se(
1771
1778
  "div",
1772
1779
  {
1773
1780
  ...S,
@@ -1794,16 +1801,16 @@ function Xt({
1794
1801
  }
1795
1802
  ) });
1796
1803
  }
1797
- Xt.displayName = "Group";
1798
- function he(e, t) {
1804
+ qt.displayName = "Group";
1805
+ function me(e, t) {
1799
1806
  return `react-resizable-panels:${[e, ...t].join(":")}`;
1800
1807
  }
1801
- function qt({
1808
+ function Yt({
1802
1809
  id: e,
1803
1810
  panelIds: t,
1804
1811
  storage: n
1805
1812
  }) {
1806
- const o = he(e, []), i = n.getItem(o);
1813
+ const o = me(e, []), i = n.getItem(o);
1807
1814
  if (i)
1808
1815
  try {
1809
1816
  const s = JSON.parse(i);
@@ -1833,38 +1840,38 @@ function qt({
1833
1840
  } catch {
1834
1841
  }
1835
1842
  }
1836
- function sn({
1843
+ function an({
1837
1844
  debounceSaveMs: e = 100,
1838
1845
  onlySaveAfterUserInteractions: t,
1839
1846
  panelIds: n,
1840
1847
  storage: o = localStorage,
1841
1848
  ...i
1842
1849
  }) {
1843
- const s = n !== void 0, u = "id" in i ? i.id : i.groupId, a = he(u, n ?? []), r = qe(
1844
- Yt,
1850
+ const s = n !== void 0, u = "id" in i ? i.id : i.groupId, a = me(u, n ?? []), r = qe(
1851
+ Jt,
1845
1852
  () => o.getItem(a),
1846
1853
  () => o.getItem(a)
1847
- ), l = Se(() => {
1854
+ ), l = ve(() => {
1848
1855
  if (r) {
1849
1856
  const d = JSON.parse(r), h = Object.values(d);
1850
1857
  if (Array.from(h).every((y) => typeof y == "number"))
1851
1858
  return d;
1852
1859
  }
1853
- }, [r]), c = Se(() => {
1860
+ }, [r]), c = ve(() => {
1854
1861
  if (!l)
1855
- return qt({
1862
+ return Yt({
1856
1863
  id: u,
1857
1864
  panelIds: n,
1858
1865
  storage: o
1859
1866
  });
1860
- }, [l, u, n, o]), m = l ?? c, p = O(null), S = re(() => {
1867
+ }, [l, u, n, o]), m = l ?? c, p = O(null), S = ie(() => {
1861
1868
  const d = p.current;
1862
1869
  d && (p.current = null, clearTimeout(d));
1863
1870
  }, []);
1864
1871
  Ke(() => () => {
1865
1872
  S();
1866
1873
  }, [S]);
1867
- const z = re(
1874
+ const z = ie(
1868
1875
  // The hook persists every layout commit -- including library-driven ones --
1869
1876
  // because it owns its own storage and the goal is to remember whatever
1870
1877
  // layout the user is currently looking at. Consumers that only want to
@@ -1875,7 +1882,7 @@ function sn({
1875
1882
  return;
1876
1883
  S();
1877
1884
  let y;
1878
- s ? y = he(u, Object.keys(d)) : y = he(u, []);
1885
+ s ? y = me(u, Object.keys(d)) : y = me(u, []);
1879
1886
  try {
1880
1887
  o.setItem(y, JSON.stringify(d));
1881
1888
  } catch (b) {
@@ -1889,7 +1896,7 @@ function sn({
1889
1896
  t,
1890
1897
  o
1891
1898
  ]
1892
- ), f = re(
1899
+ ), f = ie(
1893
1900
  (d) => {
1894
1901
  S(), e === 0 ? z(d, { isUserInteraction: !1 }) : p.current = setTimeout(() => {
1895
1902
  z(d, { isUserInteraction: !1 });
@@ -1914,14 +1921,14 @@ function sn({
1914
1921
  onLayoutChanged: z
1915
1922
  };
1916
1923
  }
1917
- function Yt() {
1924
+ function Jt() {
1918
1925
  return function() {
1919
1926
  };
1920
1927
  }
1921
- function an() {
1928
+ function ln() {
1922
1929
  return Q(null);
1923
1930
  }
1924
- function ln() {
1931
+ function un() {
1925
1932
  return O(null);
1926
1933
  }
1927
1934
  function Me() {
@@ -1931,16 +1938,16 @@ function Me() {
1931
1938
  "Group Context not found; did you render a Panel or Separator outside of a Group?"
1932
1939
  ), e;
1933
1940
  }
1934
- function Jt(e, t) {
1941
+ function Zt(e, t) {
1935
1942
  const { id: n } = Me(), o = O({
1936
- collapse: ye,
1937
- expand: ye,
1943
+ collapse: Se,
1944
+ expand: Se,
1938
1945
  getSize: () => ({
1939
1946
  asPercentage: 0,
1940
1947
  inPixels: 0
1941
1948
  }),
1942
1949
  isCollapsed: () => !1,
1943
- resize: ye
1950
+ resize: Se
1944
1951
  });
1945
1952
  Xe(t, () => o.current, []), q(() => {
1946
1953
  Object.assign(
@@ -1949,7 +1956,7 @@ function Jt(e, t) {
1949
1956
  );
1950
1957
  });
1951
1958
  }
1952
- function Zt({
1959
+ function Qt({
1953
1960
  children: e,
1954
1961
  className: t,
1955
1962
  collapsedSize: n = "0%",
@@ -1966,23 +1973,23 @@ function Zt({
1966
1973
  style: S,
1967
1974
  ...z
1968
1975
  }) {
1969
- const f = !!r, d = Le(r), h = Re({
1976
+ const f = !!r, d = Ce(r), h = Ee({
1970
1977
  disabled: s
1971
- }), y = O(null), b = Ce(y, u), {
1978
+ }), y = O(null), b = Re(y, u), {
1972
1979
  getPanelStyles: v,
1973
1980
  id: g,
1974
1981
  orientation: w,
1975
- registerPanel: M,
1982
+ registerPanel: E,
1976
1983
  updatePanelProps: L
1977
- } = Me(), G = m !== null, N = se(
1978
- (R, E, D) => {
1979
- m?.(R, r, D);
1984
+ } = Me(), G = m !== null, N = re(
1985
+ (R, M, k) => {
1986
+ m?.(R, r, k);
1980
1987
  }
1981
1988
  );
1982
1989
  q(() => {
1983
1990
  const R = y.current;
1984
1991
  if (R !== null) {
1985
- const E = {
1992
+ const M = {
1986
1993
  element: R,
1987
1994
  id: d,
1988
1995
  idIsStable: f,
@@ -2001,7 +2008,7 @@ function Zt({
2001
2008
  minSize: c
2002
2009
  }
2003
2010
  };
2004
- return M(E);
2011
+ return E(M);
2005
2012
  }
2006
2013
  }, [
2007
2014
  a,
@@ -2014,17 +2021,17 @@ function Zt({
2014
2021
  l,
2015
2022
  c,
2016
2023
  N,
2017
- M,
2024
+ E,
2018
2025
  h
2019
- ]), me(() => {
2026
+ ]), ge(() => {
2020
2027
  L(d, { disabled: s });
2021
- }, [s, d, L]), Jt(d, p);
2028
+ }, [s, d, L]), Zt(d, p);
2022
2029
  const x = () => {
2023
2030
  const R = v(g, d);
2024
2031
  if (R)
2025
2032
  return JSON.stringify(R);
2026
2033
  }, P = qe(
2027
- (R) => Pe(g, R),
2034
+ (R) => we(g, R),
2028
2035
  x,
2029
2036
  x
2030
2037
  );
@@ -2033,7 +2040,7 @@ function Zt({
2033
2040
  flexGrow: void 0,
2034
2041
  flexShrink: void 0,
2035
2042
  flexBasis: i
2036
- } : I = { flexGrow: 1 }, /* @__PURE__ */ ae(
2043
+ } : I = { flexGrow: 1 }, /* @__PURE__ */ se(
2037
2044
  "div",
2038
2045
  {
2039
2046
  ...z,
@@ -2043,14 +2050,14 @@ function Zt({
2043
2050
  id: d,
2044
2051
  ref: b,
2045
2052
  style: {
2046
- ...Qt,
2053
+ ...en,
2047
2054
  display: "flex",
2048
2055
  flexBasis: 0,
2049
2056
  flexShrink: 1,
2050
2057
  overflow: "visible",
2051
2058
  ...I
2052
2059
  },
2053
- children: /* @__PURE__ */ ae(
2060
+ children: /* @__PURE__ */ se(
2054
2061
  "div",
2055
2062
  {
2056
2063
  className: t,
@@ -2072,8 +2079,8 @@ function Zt({
2072
2079
  }
2073
2080
  );
2074
2081
  }
2075
- Zt.displayName = "Panel";
2076
- const Qt = {
2082
+ Qt.displayName = "Panel";
2083
+ const en = {
2077
2084
  minHeight: 0,
2078
2085
  maxHeight: "100%",
2079
2086
  height: "auto",
@@ -2085,13 +2092,13 @@ const Qt = {
2085
2092
  padding: 0,
2086
2093
  margin: 0
2087
2094
  };
2088
- function un() {
2095
+ function cn() {
2089
2096
  return Q(null);
2090
2097
  }
2091
- function cn() {
2098
+ function fn() {
2092
2099
  return O(null);
2093
2100
  }
2094
- function en({
2101
+ function tn({
2095
2102
  layout: e,
2096
2103
  panelConstraints: t,
2097
2104
  panelId: n,
@@ -2103,8 +2110,8 @@ function en({
2103
2110
  );
2104
2111
  if (a) {
2105
2112
  const r = a.maxSize, l = a.collapsible ? a.collapsedSize : a.minSize, c = [o, o + 1];
2106
- s = K({
2107
- layout: le({
2113
+ s = X({
2114
+ layout: ae({
2108
2115
  delta: l - u,
2109
2116
  initialLayout: e,
2110
2117
  panelConstraints: t,
@@ -2112,8 +2119,8 @@ function en({
2112
2119
  prevLayout: e
2113
2120
  }),
2114
2121
  panelConstraints: t
2115
- })[n], i = K({
2116
- layout: le({
2122
+ })[n], i = X({
2123
+ layout: ae({
2117
2124
  delta: r - u,
2118
2125
  initialLayout: e,
2119
2126
  panelConstraints: t,
@@ -2130,7 +2137,7 @@ function en({
2130
2137
  valueNow: u
2131
2138
  };
2132
2139
  }
2133
- function tn({
2140
+ function nn({
2134
2141
  children: e,
2135
2142
  className: t,
2136
2143
  disabled: n,
@@ -2140,16 +2147,16 @@ function tn({
2140
2147
  style: u,
2141
2148
  ...a
2142
2149
  }) {
2143
- const r = Le(s), l = Re({
2150
+ const r = Ce(s), l = Ee({
2144
2151
  disabled: n,
2145
2152
  disableDoubleClick: o
2146
- }), [c, m] = Q({}), [p, S] = Q("inactive"), [z, f] = Q(!1), d = O(null), h = Ce(d, i), {
2153
+ }), [c, m] = Q({}), [p, S] = Q("inactive"), [z, f] = Q(!1), d = O(null), h = Re(d, i), {
2147
2154
  disableCursor: y,
2148
2155
  id: b,
2149
2156
  orientation: v,
2150
2157
  registerSeparator: g,
2151
2158
  updateSeparatorProps: w
2152
- } = Me(), M = v === "horizontal" ? "vertical" : "horizontal";
2159
+ } = Me(), E = v === "horizontal" ? "vertical" : "horizontal";
2153
2160
  q(() => {
2154
2161
  const N = d.current;
2155
2162
  if (N !== null) {
@@ -2159,23 +2166,25 @@ function tn({
2159
2166
  element: N,
2160
2167
  id: r
2161
2168
  }, P = g(x), I = Rt(
2162
- (E) => {
2169
+ (M) => {
2163
2170
  S(
2164
- E.next.state !== "inactive" && E.next.hitRegions.some(
2165
- (D) => D.separator === x
2166
- ) ? E.next.state : "inactive"
2171
+ M.next.state !== "inactive" && M.next.hitRegions.some(
2172
+ (k) => k.separator === x
2173
+ ) ? M.next.state : "inactive"
2167
2174
  );
2168
2175
  }
2169
- ), R = Pe(
2176
+ ), R = we(
2170
2177
  b,
2171
- (E) => {
2172
- const { derivedPanelConstraints: D, layout: V, separatorToPanels: ue } = E.next, oe = ue.get(x);
2173
- if (oe) {
2174
- const _ = oe[0], Y = oe.indexOf(_);
2178
+ (M) => {
2179
+ const { derivedPanelConstraints: k, layout: U, separatorToPanels: le } = M.next, ue = le.get(x);
2180
+ if (ue) {
2181
+ const _ = ue[0], Y = k.findIndex(
2182
+ (ce) => ce.panelId === _.id
2183
+ );
2175
2184
  m(
2176
- en({
2177
- layout: V,
2178
- panelConstraints: D,
2185
+ tn({
2186
+ layout: U,
2187
+ panelConstraints: k,
2179
2188
  panelId: _.id,
2180
2189
  panelIndex: Y
2181
2190
  })
@@ -2187,7 +2196,7 @@ function tn({
2187
2196
  I(), R(), P();
2188
2197
  };
2189
2198
  }
2190
- }, [b, r, g, l]), me(() => {
2199
+ }, [b, r, g, l]), ge(() => {
2191
2200
  w(r, { disabled: n, disableDoubleClick: o });
2192
2201
  }, [n, o, r, w]);
2193
2202
  let L;
@@ -2204,13 +2213,13 @@ function tn({
2204
2213
  default:
2205
2214
  z ? G = "focus" : G = p;
2206
2215
  }
2207
- return /* @__PURE__ */ ae(
2216
+ return /* @__PURE__ */ se(
2208
2217
  "div",
2209
2218
  {
2210
2219
  ...a,
2211
2220
  "aria-controls": c.valueControls,
2212
2221
  "aria-disabled": n || void 0,
2213
- "aria-orientation": M,
2222
+ "aria-orientation": E,
2214
2223
  "aria-valuemax": c.valueMax,
2215
2224
  "aria-valuemin": c.valueMin,
2216
2225
  "aria-valuenow": c.valueNow,
@@ -2237,16 +2246,16 @@ function tn({
2237
2246
  }
2238
2247
  );
2239
2248
  }
2240
- tn.displayName = "Separator";
2249
+ nn.displayName = "Separator";
2241
2250
  export {
2242
- Xt as Group,
2243
- Zt as Panel,
2244
- tn as Separator,
2251
+ qt as Group,
2252
+ Qt as Panel,
2253
+ nn as Separator,
2245
2254
  Ct as isCoarsePointer,
2246
- sn as useDefaultLayout,
2247
- an as useGroupCallbackRef,
2248
- ln as useGroupRef,
2249
- un as usePanelCallbackRef,
2250
- cn as usePanelRef
2255
+ an as useDefaultLayout,
2256
+ ln as useGroupCallbackRef,
2257
+ un as useGroupRef,
2258
+ cn as usePanelCallbackRef,
2259
+ fn as usePanelRef
2251
2260
  };
2252
2261
  //# sourceMappingURL=react-resizable-panels.js.map