react-resizable-panels 4.13.0 → 4.13.1

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,21 +1,21 @@
1
1
  "use client";
2
- import { jsx as B, jsxs as zt } from "react/jsx-runtime";
3
- import { useState as Z, useCallback as ce, useId as wt, useLayoutEffect as Ze, useEffect as Se, useRef as D, createContext as Pt, useContext as Lt, isValidElement as Ct, useImperativeHandle as Qe, useMemo as Pe, useSyncExternalStore as et } from "react";
4
- function Rt(e, t) {
2
+ import { jsx as U, jsxs as wt } from "react/jsx-runtime";
3
+ import { useState as Z, useCallback as ce, useId as Pt, useLayoutEffect as Qe, useEffect as Se, useRef as O, createContext as Lt, useContext as Ct, isValidElement as Rt, useImperativeHandle as et, useMemo as Pe, useSyncExternalStore as tt } from "react";
4
+ function Mt(e, t) {
5
5
  const n = getComputedStyle(e), o = parseFloat(n.fontSize);
6
6
  return t * o;
7
7
  }
8
- function Mt(e, t) {
8
+ function Et(e, t) {
9
9
  const n = getComputedStyle(e.ownerDocument.documentElement), o = parseFloat(n.fontSize);
10
10
  return t * o;
11
11
  }
12
- function Et(e) {
12
+ function It(e) {
13
13
  return e / 100 * window.innerHeight;
14
14
  }
15
- function It(e) {
15
+ function kt(e) {
16
16
  return e / 100 * window.innerWidth;
17
17
  }
18
- function kt(e) {
18
+ function Tt(e) {
19
19
  switch (typeof e) {
20
20
  case "number":
21
21
  return [e, "px"];
@@ -31,8 +31,8 @@ function ie({
31
31
  styleProp: n
32
32
  }) {
33
33
  let o;
34
- const [r, i] = kt(n);
35
- switch (i) {
34
+ const [r, s] = Tt(n);
35
+ switch (s) {
36
36
  case "%": {
37
37
  o = r / 100 * e;
38
38
  break;
@@ -42,19 +42,19 @@ function ie({
42
42
  break;
43
43
  }
44
44
  case "rem": {
45
- o = Mt(t, r);
45
+ o = Et(t, r);
46
46
  break;
47
47
  }
48
48
  case "em": {
49
- o = Rt(t, r);
49
+ o = Mt(t, r);
50
50
  break;
51
51
  }
52
52
  case "vh": {
53
- o = Et(r);
53
+ o = It(r);
54
54
  break;
55
55
  }
56
56
  case "vw": {
57
- o = It(r);
57
+ o = kt(r);
58
58
  break;
59
59
  }
60
60
  }
@@ -81,66 +81,66 @@ function Le(e) {
81
81
  maxSize: 100,
82
82
  panelId: o.id
83
83
  })) : t.map((o) => {
84
- const { element: r, panelConstraints: i } = o;
85
- let c = 0;
86
- if (i.collapsedSize !== void 0) {
84
+ const { element: r, panelConstraints: s } = o;
85
+ let i = 0;
86
+ if (s.collapsedSize !== void 0) {
87
87
  const f = ie({
88
88
  groupSize: n,
89
89
  panelElement: r,
90
- styleProp: i.collapsedSize
90
+ styleProp: s.collapsedSize
91
91
  });
92
- c = A(f / n * 100);
92
+ i = A(f / n * 100);
93
93
  }
94
- let l;
95
- if (i.collapsedThreshold !== void 0) {
94
+ let u;
95
+ if (s.collapsedThreshold !== void 0) {
96
96
  const f = ie({
97
97
  groupSize: n,
98
98
  panelElement: r,
99
- styleProp: i.collapsedThreshold
99
+ styleProp: s.collapsedThreshold
100
100
  });
101
- l = A(f / n * 100);
101
+ u = A(f / n * 100);
102
102
  }
103
- let a;
104
- if (i.defaultSize !== void 0) {
103
+ let c;
104
+ if (s.defaultSize !== void 0) {
105
105
  const f = ie({
106
106
  groupSize: n,
107
107
  panelElement: r,
108
- styleProp: i.defaultSize
108
+ styleProp: s.defaultSize
109
109
  });
110
- a = A(f / n * 100);
110
+ c = A(f / n * 100);
111
111
  }
112
- let s = 0;
113
- if (i.minSize !== void 0) {
112
+ let a = 0;
113
+ if (s.minSize !== void 0) {
114
114
  const f = ie({
115
115
  groupSize: n,
116
116
  panelElement: r,
117
- styleProp: i.minSize
117
+ styleProp: s.minSize
118
118
  });
119
- s = A(f / n * 100);
119
+ a = A(f / n * 100);
120
120
  }
121
- let u = 100;
122
- if (i.maxSize !== void 0) {
121
+ let l = 100;
122
+ if (s.maxSize !== void 0) {
123
123
  const f = ie({
124
124
  groupSize: n,
125
125
  panelElement: r,
126
- styleProp: i.maxSize
126
+ styleProp: s.maxSize
127
127
  });
128
- u = A(f / n * 100);
128
+ l = A(f / n * 100);
129
129
  }
130
130
  return {
131
- groupResizeBehavior: i.groupResizeBehavior,
132
- collapsedSize: c,
133
- collapsedThreshold: l,
134
- collapsible: i.collapsible === !0,
135
- defaultSize: a,
136
- disabled: i.disabled,
137
- minSize: s,
138
- maxSize: u,
131
+ groupResizeBehavior: s.groupResizeBehavior,
132
+ collapsedSize: i,
133
+ collapsedThreshold: u,
134
+ collapsible: s.collapsible === !0,
135
+ defaultSize: c,
136
+ disabled: s.disabled,
137
+ minSize: a,
138
+ maxSize: l,
139
139
  panelId: o.id
140
140
  };
141
141
  });
142
142
  }
143
- class tt {
143
+ class nt {
144
144
  #e = {};
145
145
  addListener(t, n) {
146
146
  const o = this.#e[t];
@@ -154,18 +154,18 @@ class tt {
154
154
  if (o.length === 1)
155
155
  o[0].call(null, n);
156
156
  else {
157
- let r = !1, i = null;
158
- const c = Array.from(o);
159
- for (let l = 0; l < c.length; l++) {
160
- const a = c[l];
157
+ let r = !1, s = null;
158
+ const i = Array.from(o);
159
+ for (let u = 0; u < i.length; u++) {
160
+ const c = i[u];
161
161
  try {
162
- a.call(null, n);
163
- } catch (s) {
164
- i === null && (r = !0, i = s);
162
+ c.call(null, n);
163
+ } catch (a) {
164
+ s === null && (r = !0, s = a);
165
165
  }
166
166
  }
167
167
  if (r)
168
- throw i;
168
+ throw s;
169
169
  }
170
170
  }
171
171
  removeAllListeners() {
@@ -179,70 +179,70 @@ class tt {
179
179
  }
180
180
  }
181
181
  }
182
- let k = {
182
+ let T = {
183
183
  cursorFlags: 0,
184
184
  state: "inactive"
185
185
  };
186
- const Re = new tt();
186
+ const Re = new nt();
187
187
  function X() {
188
- return k;
188
+ return T;
189
189
  }
190
- function nt(e) {
190
+ function ot(e) {
191
191
  return Re.addListener("change", e);
192
192
  }
193
- function Tt(e, t = [], n) {
194
- const o = k, r = { ...k };
195
- r.cursorFlags = e, r.state === "active" && (r.previews = t, n && (r.previewLayoutMap = n)), k = r, Re.emit("change", {
193
+ function Dt(e, t = [], n) {
194
+ const o = T, r = { ...T };
195
+ r.cursorFlags = e, r.state === "active" && (r.previews = t, n && (r.previewLayoutMap = n)), T = r, Re.emit("change", {
196
196
  prev: o,
197
197
  next: r
198
198
  });
199
199
  }
200
- function U(e) {
201
- const t = k;
202
- k = e, Re.emit("change", {
200
+ function W(e) {
201
+ const t = T;
202
+ T = e, Re.emit("change", {
203
203
  prev: t,
204
204
  next: e
205
205
  });
206
206
  }
207
207
  function Ot(e) {
208
- k.state !== "active" || !k.previews.some((t) => t.separator === e) || U({
209
- ...k,
210
- previews: k.previews.map(
208
+ T.state !== "active" || !T.previews.some((t) => t.separator === e) || W({
209
+ ...T,
210
+ previews: T.previews.map(
211
211
  (t) => t.separator === e ? { ...t } : t
212
212
  )
213
213
  });
214
214
  }
215
- function Dt(e) {
216
- if (k.state === "inactive")
215
+ function Gt(e) {
216
+ if (T.state === "inactive")
217
217
  return !1;
218
- const t = k.hitRegions.filter(
218
+ const t = T.hitRegions.filter(
219
219
  (o) => o.group !== e
220
- ), n = k.state === "active" && k.previews.some((o) => o.group === e);
221
- if (t.length === k.hitRegions.length && !n)
220
+ ), n = T.state === "active" && T.previews.some((o) => o.group === e);
221
+ if (t.length === T.hitRegions.length && !n)
222
222
  return !1;
223
223
  if (t.length === 0)
224
- U({ cursorFlags: 0, state: "inactive" });
225
- else if (k.state === "active") {
226
- const o = new Map(k.initialLayoutMap), r = new Map(k.previewLayoutMap);
227
- o.delete(e), r.delete(e), U({
228
- ...k,
224
+ W({ cursorFlags: 0, state: "inactive" });
225
+ else if (T.state === "active") {
226
+ const o = new Map(T.initialLayoutMap), r = new Map(T.previewLayoutMap);
227
+ o.delete(e), r.delete(e), W({
228
+ ...T,
229
229
  cursorFlags: 0,
230
230
  hitRegions: t,
231
231
  initialLayoutMap: o,
232
232
  previewLayoutMap: r,
233
- previews: k.previews.filter((i) => i.group !== e)
233
+ previews: T.previews.filter((s) => s.group !== e)
234
234
  });
235
235
  } else
236
- U({ ...k, hitRegions: t });
236
+ W({ ...T, hitRegions: t });
237
237
  return !0;
238
238
  }
239
239
  const At = (e) => e, we = () => {
240
- }, ot = 1, rt = 2, it = 4, st = 8, Ge = 3, Fe = 12;
240
+ }, rt = 1, it = 2, st = 4, at = 8, Fe = 3, Ne = 12;
241
241
  let me;
242
- function Ne() {
242
+ function _e() {
243
243
  return me === void 0 && (me = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (me = !0)), me;
244
244
  }
245
- function Gt({
245
+ function Ft({
246
246
  cursorFlags: e,
247
247
  groups: t,
248
248
  state: n
@@ -251,9 +251,9 @@ function Gt({
251
251
  switch (n) {
252
252
  case "active":
253
253
  case "hover":
254
- t.forEach((i) => {
255
- if (!i.mutableState.disableCursor)
256
- switch (i.orientation) {
254
+ t.forEach((s) => {
255
+ if (!s.mutableState.disableCursor)
256
+ switch (s.orientation) {
257
257
  case "horizontal": {
258
258
  o++;
259
259
  break;
@@ -268,28 +268,28 @@ function Gt({
268
268
  if (!(o === 0 && r === 0)) {
269
269
  switch (n) {
270
270
  case "active": {
271
- if (e && Ne()) {
272
- const i = (e & ot) !== 0, c = (e & rt) !== 0, l = (e & it) !== 0, a = (e & st) !== 0;
271
+ if (e && _e()) {
272
+ const s = (e & rt) !== 0, i = (e & it) !== 0, u = (e & st) !== 0, c = (e & at) !== 0;
273
+ if (s)
274
+ return u ? "se-resize" : c ? "ne-resize" : "e-resize";
273
275
  if (i)
274
- return l ? "se-resize" : a ? "ne-resize" : "e-resize";
275
- if (c)
276
- return l ? "sw-resize" : a ? "nw-resize" : "w-resize";
277
- if (l)
276
+ return u ? "sw-resize" : c ? "nw-resize" : "w-resize";
277
+ if (u)
278
278
  return "s-resize";
279
- if (a)
279
+ if (c)
280
280
  return "n-resize";
281
281
  }
282
282
  break;
283
283
  }
284
284
  }
285
- return Ne() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
285
+ return _e() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
286
286
  }
287
287
  }
288
- const _e = /* @__PURE__ */ new WeakMap();
288
+ const $e = /* @__PURE__ */ new WeakMap();
289
289
  function fe(e) {
290
290
  if (!e.defaultView || !e.adoptedStyleSheets)
291
291
  return;
292
- let { prevStyle: t, styleSheet: n } = _e.get(e) ?? {};
292
+ let { prevStyle: t, styleSheet: n } = $e.get(e) ?? {};
293
293
  n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && (Object.isExtensible(e.adoptedStyleSheets) ? e.adoptedStyleSheets.push(n) : e.adoptedStyleSheets = [
294
294
  ...e.adoptedStyleSheets,
295
295
  n
@@ -298,14 +298,14 @@ function fe(e) {
298
298
  switch (o.state) {
299
299
  case "active":
300
300
  case "hover": {
301
- const r = Gt({
301
+ const r = Ft({
302
302
  cursorFlags: o.cursorFlags,
303
- groups: o.hitRegions.map((c) => c.group),
303
+ groups: o.hitRegions.map((i) => i.group),
304
304
  state: o.state
305
- }), i = `*, *:hover {cursor: ${r} !important; }`;
306
- if (t === i)
305
+ }), s = `*, *:hover {cursor: ${r} !important; }`;
306
+ if (t === s)
307
307
  return;
308
- t = i, r ? n.cssRules.length === 0 ? n.insertRule(i) : n.replaceSync(i) : n.cssRules.length === 1 && n.deleteRule(0);
308
+ t = s, r ? n.cssRules.length === 0 ? n.insertRule(s) : n.replaceSync(s) : n.cssRules.length === 1 && n.deleteRule(0);
309
309
  break;
310
310
  }
311
311
  case "inactive": {
@@ -313,32 +313,32 @@ function fe(e) {
313
313
  break;
314
314
  }
315
315
  }
316
- _e.set(e, {
316
+ $e.set(e, {
317
317
  prevStyle: t,
318
318
  styleSheet: n
319
319
  });
320
320
  }
321
- function R(e, t = "Assertion error") {
321
+ function L(e, t = "Assertion error") {
322
322
  if (!e)
323
323
  throw Error(t);
324
324
  }
325
325
  function Ce(e, t) {
326
326
  return Array.from(t).sort(
327
- e === "horizontal" ? Ft : Nt
327
+ e === "horizontal" ? Nt : _t
328
328
  );
329
329
  }
330
- function Ft(e, t) {
330
+ function Nt(e, t) {
331
331
  const n = e.element.offsetLeft - t.element.offsetLeft;
332
332
  return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
333
333
  }
334
- function Nt(e, t) {
334
+ function _t(e, t) {
335
335
  const n = e.element.offsetTop - t.element.offsetTop;
336
336
  return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
337
337
  }
338
- function at(e) {
338
+ function lt(e) {
339
339
  return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
340
340
  }
341
- function lt(e, t) {
341
+ function ct(e, t) {
342
342
  return {
343
343
  x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
344
344
  Math.abs(e.x - t.left),
@@ -350,7 +350,7 @@ function lt(e, t) {
350
350
  )
351
351
  };
352
352
  }
353
- function _t({
353
+ function $t({
354
354
  orientation: e,
355
355
  rects: t,
356
356
  targetRect: n
@@ -359,15 +359,15 @@ function _t({
359
359
  x: n.x + n.width / 2,
360
360
  y: n.y + n.height / 2
361
361
  };
362
- let r, i = Number.MAX_VALUE;
363
- for (const c of t) {
364
- const { x: l, y: a } = lt(o, c), s = e === "horizontal" ? l : a;
365
- s < i && (i = s, r = c);
362
+ let r, s = Number.MAX_VALUE;
363
+ for (const i of t) {
364
+ const { x: u, y: c } = ct(o, i), a = e === "horizontal" ? u : c;
365
+ a < s && (s = a, r = i);
366
366
  }
367
- return R(r, "No rect found"), r;
367
+ return L(r, "No rect found"), r;
368
368
  }
369
369
  let ge;
370
- function $t() {
370
+ function Ht() {
371
371
  return ge === void 0 && (typeof matchMedia == "function" ? ge = !!matchMedia("(pointer:coarse)").matches : ge = !1), ge;
372
372
  }
373
373
  function Me({
@@ -375,158 +375,158 @@ function Me({
375
375
  group: t,
376
376
  includeDisabled: n = !1
377
377
  }) {
378
- const { element: o, orientation: r, panels: i, separators: c } = t, l = Ce(
378
+ const { element: o, orientation: r, panels: s, separators: i } = t, u = Ce(
379
379
  r,
380
- Array.from(o.children).filter(at).filter((h) => !h.hasAttribute("data-resize-preview")).map((h) => ({ element: h }))
381
- ).map(({ element: h }) => h), a = [];
382
- let s = !1, u = !1, f = -1, d = -1, v = 0, z, p = [];
380
+ Array.from(o.children).filter(lt).filter((m) => !m.hasAttribute("data-resize-preview")).map((m) => ({ element: m }))
381
+ ).map(({ element: m }) => m), c = [];
382
+ let a = !1, l = !1, f = -1, y, d = -1, p = 0, h, v = [];
383
383
  {
384
- let h = -1;
385
- for (const g of l)
386
- g.hasAttribute("data-panel") && (h++, g.hasAttribute("data-disabled") || (v++, f === -1 && (f = h), d = h));
384
+ let m = -1;
385
+ for (const g of u)
386
+ g.hasAttribute("data-panel") && (m++, g.hasAttribute("data-disabled") || (p++, f === -1 && (f = m), d = m));
387
387
  }
388
- if (n || v > 1) {
389
- let h = -1;
390
- for (const g of l)
388
+ if (n || p > 1) {
389
+ let m = -1;
390
+ for (const g of u)
391
391
  if (g.hasAttribute("data-panel")) {
392
- h++;
393
- const y = i.find(
394
- (m) => m.element === g
392
+ m++;
393
+ const x = s.find(
394
+ (b) => b.element === g
395
395
  );
396
- if (y) {
397
- if (z) {
398
- const m = z.element.getBoundingClientRect(), b = g.getBoundingClientRect();
399
- let x;
400
- if (u) {
401
- const L = r === "horizontal" ? new DOMRect(
402
- m.right,
403
- m.top,
396
+ if (x) {
397
+ if (h) {
398
+ const b = h.element.getBoundingClientRect(), z = g.getBoundingClientRect();
399
+ let E;
400
+ if (l) {
401
+ const R = r === "horizontal" ? new DOMRect(
402
+ b.right,
403
+ b.top,
404
404
  0,
405
- m.height
405
+ b.height
406
406
  ) : new DOMRect(
407
- m.left,
408
- m.bottom,
409
- m.width,
407
+ b.left,
408
+ b.bottom,
409
+ b.width,
410
410
  0
411
- ), w = r === "horizontal" ? new DOMRect(b.left, b.top, 0, b.height) : new DOMRect(b.left, b.top, b.width, 0);
412
- switch (p.length) {
411
+ ), w = r === "horizontal" ? new DOMRect(z.left, z.top, 0, z.height) : new DOMRect(z.left, z.top, z.width, 0);
412
+ switch (v.length) {
413
413
  case 0: {
414
- x = [
415
- L,
414
+ E = [
415
+ R,
416
416
  w
417
417
  ];
418
418
  break;
419
419
  }
420
420
  case 1: {
421
- const C = p[0], M = _t({
421
+ const C = v[0], F = $t({
422
422
  orientation: r,
423
- rects: [m, b],
423
+ rects: [b, z],
424
424
  targetRect: C.element.getBoundingClientRect()
425
425
  });
426
- x = [
426
+ E = [
427
427
  C,
428
- M === m ? w : L
428
+ F === b ? w : R
429
429
  ];
430
430
  break;
431
431
  }
432
432
  default: {
433
- x = p;
433
+ E = v;
434
434
  break;
435
435
  }
436
436
  }
437
437
  } else
438
- p.length ? x = p : x = [
438
+ v.length ? E = v : E = [
439
439
  r === "horizontal" ? new DOMRect(
440
- m.right,
441
- b.top,
442
- b.left - m.right,
443
- b.height
440
+ b.right,
441
+ z.top,
442
+ z.left - b.right,
443
+ z.height
444
444
  ) : new DOMRect(
445
- b.left,
446
- m.bottom,
447
- b.width,
448
- b.top - m.bottom
445
+ z.left,
446
+ b.bottom,
447
+ z.width,
448
+ z.top - b.bottom
449
449
  )
450
450
  ];
451
- for (const L of x) {
452
- let w = "width" in L ? L : L.element.getBoundingClientRect();
453
- const C = e ? $t() ? t.resizeTargetMinimumSize.coarse : t.resizeTargetMinimumSize.fine : 0;
451
+ for (const R of E) {
452
+ let w = "width" in R ? R : R.element.getBoundingClientRect();
453
+ const C = e ? Ht() ? t.resizeTargetMinimumSize.coarse : t.resizeTargetMinimumSize.fine : 0;
454
454
  if (w.width < C) {
455
- const T = C - w.width;
455
+ const I = C - w.width;
456
456
  w = new DOMRect(
457
- w.x - T / 2,
457
+ w.x - I / 2,
458
458
  w.y,
459
- w.width + T,
459
+ w.width + I,
460
460
  w.height
461
461
  );
462
462
  }
463
463
  if (w.height < C) {
464
- const T = C - w.height;
464
+ const I = C - w.height;
465
465
  w = new DOMRect(
466
466
  w.x,
467
- w.y - T / 2,
467
+ w.y - I / 2,
468
468
  w.width,
469
- w.height + T
469
+ w.height + I
470
470
  );
471
471
  }
472
- const M = h <= f || h > d;
473
- (n || !s && !M) && a.push({
472
+ const F = m <= f || m > d;
473
+ (n || !a && !F) && (y ??= ae({ group: t }), c.push({
474
474
  group: t,
475
- groupSize: ae({ group: t }),
476
- panels: [z, y],
477
- separator: "width" in L ? void 0 : L,
475
+ groupSize: y,
476
+ panels: [h, x],
477
+ separator: "width" in R ? void 0 : R,
478
478
  rect: w
479
- }), s = !1;
479
+ })), a = !1;
480
480
  }
481
481
  }
482
- u = !1, z = y, p = [];
482
+ l = !1, h = x, v = [];
483
483
  }
484
484
  } else if (g.hasAttribute("data-separator")) {
485
- g.ariaDisabled !== null && (s = !0);
486
- const y = c.find(
487
- (m) => m.element === g
485
+ g.ariaDisabled !== null && (a = !0);
486
+ const x = i.find(
487
+ (b) => b.element === g
488
488
  );
489
- y ? p.push(y) : (z = void 0, p = []);
489
+ x ? v.push(x) : (h = void 0, v = []);
490
490
  } else
491
- u = !0;
491
+ l = !0;
492
492
  }
493
- return a;
493
+ return c;
494
494
  }
495
- let V = /* @__PURE__ */ new Map();
496
- const ct = new tt();
497
- function jt(e) {
498
- V = new Map(V), V.delete(e);
495
+ let B = /* @__PURE__ */ new Map();
496
+ const ut = new nt();
497
+ function Vt(e) {
498
+ B = new Map(B), B.delete(e);
499
499
  }
500
- function ut(e, t) {
501
- for (const [n] of V)
500
+ function ft(e, t) {
501
+ for (const [n] of B)
502
502
  if (n.id === e)
503
503
  return n;
504
504
  }
505
505
  function Q(e, t) {
506
- for (const [n, o] of V)
506
+ for (const [n, o] of B)
507
507
  if (n.id === e)
508
508
  return o;
509
509
  if (t)
510
510
  throw Error(`Could not find data for Group with id ${e}`);
511
511
  }
512
512
  function ee() {
513
- return V;
513
+ return B;
514
514
  }
515
515
  function Ee(e, t) {
516
- return ct.addListener("groupChange", (n) => {
516
+ return ut.addListener("groupChange", (n) => {
517
517
  n.group.id === e && t(n);
518
518
  });
519
519
  }
520
- function K(e, t, n) {
521
- const o = V.get(e);
522
- V = new Map(V), V.set(e, t), ct.emit("groupChange", {
520
+ function q(e, t, n) {
521
+ const o = B.get(e);
522
+ B = new Map(B), B.set(e, t), ut.emit("groupChange", {
523
523
  group: e,
524
524
  isUserInteraction: n?.isUserInteraction === !0,
525
525
  prev: o,
526
526
  next: t
527
527
  });
528
528
  }
529
- function Ht(e, t) {
529
+ function jt(e, t) {
530
530
  if (e.length !== t.length)
531
531
  return !1;
532
532
  for (let n = 0; n < e.length; n++)
@@ -534,11 +534,11 @@ function Ht(e, t) {
534
534
  return !1;
535
535
  return !0;
536
536
  }
537
- function O(e, t, n = 0) {
537
+ function D(e, t, n = 0) {
538
538
  return Math.abs(A(e) - A(t)) <= n;
539
539
  }
540
- function H(e, t) {
541
- return O(e, t) ? 0 : e > t ? 1 : -1;
540
+ function j(e, t) {
541
+ return D(e, t) ? 0 : e > t ? 1 : -1;
542
542
  }
543
543
  function se({
544
544
  overrideDisabledPanels: e,
@@ -548,21 +548,21 @@ function se({
548
548
  }) {
549
549
  const {
550
550
  collapsedSize: r = 0,
551
- collapsedThreshold: i,
552
- collapsible: c,
553
- disabled: l,
554
- maxSize: a = 100,
555
- minSize: s = 0
551
+ collapsedThreshold: s,
552
+ collapsible: i,
553
+ disabled: u,
554
+ maxSize: c = 100,
555
+ minSize: a = 0
556
556
  } = t;
557
- if (l && !e)
557
+ if (u && !e)
558
558
  return n;
559
- if (H(o, s) < 0)
560
- if (c) {
561
- const u = i ?? (s - r) / 2, f = H(n, r) <= 0, d = f ? r + u : s - u, v = H(o, d);
562
- H(o, r) <= 0 || v < 0 || i !== void 0 && f && v === 0 ? o = r : o = s;
559
+ if (j(o, a) < 0)
560
+ if (i) {
561
+ const l = s ?? (a - r) / 2, f = j(n, r) <= 0, y = f ? r + l : a - l, d = j(o, y);
562
+ j(o, r) <= 0 || d < 0 || s !== void 0 && f && d === 0 ? o = r : o = a;
563
563
  } else
564
- o = s;
565
- return o = Math.min(a, o), o = A(o), o;
564
+ o = a;
565
+ return o = Math.min(c, o), o = A(o), o;
566
566
  }
567
567
  function de({
568
568
  delta: e,
@@ -570,73 +570,77 @@ function de({
570
570
  panelConstraints: n,
571
571
  pivotIndices: o,
572
572
  prevLayout: r,
573
- trigger: i
573
+ trigger: s
574
574
  }) {
575
- if (O(e, 0))
575
+ if (D(e, 0))
576
576
  return t;
577
- const c = i === "imperative-api", l = Object.values(t), a = Object.values(r), s = [...l], [u, f] = o;
578
- R(u != null, "Invalid first pivot index"), R(f != null, "Invalid second pivot index");
579
- let d = 0;
580
- switch (i) {
577
+ const i = s === "imperative-api", u = n.map(
578
+ ({ panelId: p }) => t[p]
579
+ ), c = n.map(
580
+ ({ panelId: p }) => r[p]
581
+ ), a = [...u], [l, f] = o;
582
+ L(l != null, "Invalid first pivot index"), L(f != null, "Invalid second pivot index");
583
+ let y = 0;
584
+ switch (s) {
581
585
  case "keyboard": {
582
586
  {
583
- const p = e < 0 ? f : u, h = n[p];
584
- R(
587
+ const p = e < 0 ? f : l, h = n[p];
588
+ L(
585
589
  h,
586
590
  `Panel constraints not found for index ${p}`
587
591
  );
588
592
  const {
589
- collapsedSize: g = 0,
590
- collapsible: y,
591
- minSize: m = 0
593
+ collapsedSize: v = 0,
594
+ collapsible: m,
595
+ minSize: g = 0
592
596
  } = h;
593
- if (y) {
594
- const b = l[p];
595
- if (R(
596
- b != null,
597
+ if (m) {
598
+ const x = u[p];
599
+ if (L(
600
+ x != null,
597
601
  `Previous layout not found for panel index ${p}`
598
- ), O(b, g)) {
599
- const x = m - b;
600
- H(x, Math.abs(e)) > 0 && (e = e < 0 ? 0 - x : x);
602
+ ), D(x, v)) {
603
+ const b = g - x;
604
+ j(b, Math.abs(e)) > 0 && (e = e < 0 ? 0 - b : b);
601
605
  }
602
606
  }
603
607
  }
604
608
  {
605
- const p = e < 0 ? u : f, h = n[p];
606
- R(
609
+ const p = e < 0 ? l : f, h = n[p];
610
+ L(
607
611
  h,
608
612
  `No panel constraints found for index ${p}`
609
613
  );
610
614
  const {
611
- collapsedSize: g = 0,
612
- collapsible: y,
613
- minSize: m = 0
615
+ collapsedSize: v = 0,
616
+ collapsible: m,
617
+ minSize: g = 0
614
618
  } = h;
615
- if (y) {
616
- const b = l[p];
617
- if (R(
618
- b != null,
619
+ if (m) {
620
+ const x = u[p];
621
+ if (L(
622
+ x != null,
619
623
  `Previous layout not found for panel index ${p}`
620
- ), O(b, m)) {
621
- const x = b - g;
622
- H(x, Math.abs(e)) > 0 && (e = e < 0 ? 0 - x : x);
624
+ ), D(x, g)) {
625
+ const b = x - v;
626
+ j(b, Math.abs(e)) > 0 && (e = e < 0 ? 0 - b : b);
623
627
  }
624
628
  }
625
629
  }
626
630
  break;
627
631
  }
628
632
  default: {
629
- const p = e < 0 ? f : u, h = n[p];
630
- R(
633
+ const p = e < 0 ? f : l, h = n[p];
634
+ L(
631
635
  h,
632
636
  `Panel constraints not found for index ${p}`
633
637
  );
634
- const g = l[p], { collapsedSize: y, collapsedThreshold: m, collapsible: b, minSize: x } = h;
635
- if (b && H(g, x) < 0) {
636
- const L = x - y, w = m ?? L / 2, C = g + Math.abs(e);
637
- if (H(C, x) < 0) {
638
- const M = H(Math.abs(e), w), T = m === void 0 && e < 0;
639
- M > 0 || M === 0 && T ? e = e < 0 ? -L : L : e = 0;
638
+ const v = u[p], { collapsedSize: m, collapsedThreshold: g, collapsible: x, minSize: b } = h;
639
+ if (x && j(v, b) < 0) {
640
+ const z = b - m, E = g ?? z / 2, R = v + Math.abs(e);
641
+ if (j(R, b) < 0) {
642
+ const w = j(Math.abs(e), E), C = g === void 0 && e < 0;
643
+ w > 0 || w === 0 && C ? e = e < 0 ? -z : z : e = 0;
640
644
  }
641
645
  }
642
646
  break;
@@ -644,94 +648,91 @@ function de({
644
648
  }
645
649
  {
646
650
  const p = e < 0 ? 1 : -1;
647
- let h = e < 0 ? f : u, g = 0;
651
+ let h = e < 0 ? f : l, v = 0;
648
652
  for (; ; ) {
649
- const m = l[h];
650
- R(
651
- m != null,
653
+ const g = u[h];
654
+ L(
655
+ g != null,
652
656
  `Previous layout not found for panel index ${h}`
653
657
  );
654
- const x = se({
655
- overrideDisabledPanels: c,
658
+ const b = se({
659
+ overrideDisabledPanels: i,
656
660
  panelConstraints: n[h],
657
- prevSize: m,
661
+ prevSize: g,
658
662
  size: 100
659
- }) - m;
660
- if (g += x, h += p, h < 0 || h >= n.length)
663
+ }) - g;
664
+ if (v += b, h += p, h < 0 || h >= n.length)
661
665
  break;
662
666
  }
663
- const y = Math.min(Math.abs(e), Math.abs(g));
664
- e = e < 0 ? 0 - y : y;
667
+ const m = Math.min(Math.abs(e), Math.abs(v));
668
+ e = e < 0 ? 0 - m : m;
665
669
  }
666
670
  {
667
- let h = e < 0 ? u : f;
671
+ let h = e < 0 ? l : f;
668
672
  for (; h >= 0 && h < n.length; ) {
669
- const g = Math.abs(e) - Math.abs(d), y = l[h];
670
- R(
671
- y != null,
673
+ const v = Math.abs(e) - Math.abs(y), m = u[h];
674
+ L(
675
+ m != null,
672
676
  `Previous layout not found for panel index ${h}`
673
677
  );
674
- const m = y - g, b = se({
675
- overrideDisabledPanels: c,
678
+ const g = m - v, x = se({
679
+ overrideDisabledPanels: i,
676
680
  panelConstraints: n[h],
677
- prevSize: y,
678
- size: m
681
+ prevSize: m,
682
+ size: g
679
683
  });
680
- if (!O(y, b) && (d += y - b, s[h] = b, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
684
+ if (!D(m, x) && (y += m - x, a[h] = x, y.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
681
685
  numeric: !0
682
686
  }) >= 0))
683
687
  break;
684
688
  e < 0 ? h-- : h++;
685
689
  }
686
690
  }
687
- if (Ht(a, s))
691
+ if (jt(c, a))
688
692
  return r;
689
693
  {
690
- const p = e < 0 ? f : u, h = l[p];
691
- R(
694
+ const p = e < 0 ? f : l, h = u[p];
695
+ L(
692
696
  h != null,
693
697
  `Previous layout not found for panel index ${p}`
694
698
  );
695
- const g = h + d, y = se({
696
- overrideDisabledPanels: c,
699
+ const v = h + y, m = se({
700
+ overrideDisabledPanels: i,
697
701
  panelConstraints: n[p],
698
702
  prevSize: h,
699
- size: g
703
+ size: v
700
704
  });
701
- if (s[p] = y, !O(y, g)) {
702
- let m = g - y, x = e < 0 ? f : u;
703
- for (; x >= 0 && x < n.length; ) {
704
- const L = s[x];
705
- R(
706
- L != null,
707
- `Previous layout not found for panel index ${x}`
705
+ if (a[p] = m, !D(m, v)) {
706
+ let g = v - m, b = e < 0 ? f : l;
707
+ for (; b >= 0 && b < n.length; ) {
708
+ const z = a[b];
709
+ L(
710
+ z != null,
711
+ `Previous layout not found for panel index ${b}`
708
712
  );
709
- const w = L + m, C = se({
710
- overrideDisabledPanels: c,
711
- panelConstraints: n[x],
712
- prevSize: L,
713
- size: w
713
+ const E = z + g, R = se({
714
+ overrideDisabledPanels: i,
715
+ panelConstraints: n[b],
716
+ prevSize: z,
717
+ size: E
714
718
  });
715
- if (O(L, C) || (m -= C - L, s[x] = C), O(m, 0))
719
+ if (D(z, R) || (g -= R - z, a[b] = R), D(g, 0))
716
720
  break;
717
- e > 0 ? x-- : x++;
721
+ e > 0 ? b-- : b++;
718
722
  }
719
723
  }
720
724
  }
721
- const v = Object.values(s).reduce(
725
+ const d = Object.values(a).reduce(
722
726
  (p, h) => h + p,
723
727
  0
724
728
  );
725
- if (!O(v, 100, 0.1))
726
- return r;
727
- const z = Object.keys(r);
728
- return s.reduce((p, h, g) => (p[z[g]] = h, p), {});
729
+ return D(d, 100, 0.1) ? a.reduce((p, h, v) => (p[n[v].panelId] = h, p), {}) : r;
729
730
  }
730
- function W(e, t) {
731
+ function K(e, t) {
731
732
  if (Object.keys(e).length !== Object.keys(t).length)
732
733
  return !1;
733
734
  for (const n in e)
734
- if (t[n] === void 0 || H(e[n], t[n]) !== 0)
735
+ if (t[n] === void 0 || j(e[n], t[n]) !== 0)
735
736
  return !1;
736
737
  return !0;
737
738
  }
@@ -741,77 +742,77 @@ function Ie({
741
742
  event: n,
742
743
  hitRegions: o,
743
744
  initialLayoutMap: r,
744
- mountedGroups: i,
745
- pointerDownAtPoint: c,
746
- prevCursorFlags: l
745
+ mountedGroups: s,
746
+ pointerDownAtPoint: i,
747
+ prevCursorFlags: u
747
748
  }) {
748
- let a = 0;
749
- const s = X();
750
- let u = s.state === "active" ? s.previews : [];
749
+ let c = 0;
750
+ const a = X();
751
+ let l = a.state === "active" ? a.previews : [];
751
752
  const f = new Map(
752
- s.state === "active" ? s.previewLayoutMap : void 0
753
+ a.state === "active" ? a.previewLayoutMap : void 0
753
754
  );
754
- o.forEach((v) => {
755
- const { group: z, groupSize: p } = v, { orientation: h, panels: g } = z;
756
- if (e && z.resizePreviewMode !== "separator")
755
+ o.forEach((d) => {
756
+ const { group: p, groupSize: h } = d, { orientation: v, panels: m } = p;
757
+ if (e && p.resizePreviewMode !== "separator")
757
758
  return;
758
- const { disableCursor: y } = z.mutableState;
759
- let m = 0;
760
- c ? h === "horizontal" ? m = (n.clientX - c.x) / p * 100 : m = (n.clientY - c.y) / p * 100 : h === "horizontal" ? m = n.clientX < 0 ? -100 : 100 : m = n.clientY < 0 ? -100 : 100;
761
- const b = r.get(z), x = i.get(z);
762
- if (!b || !x)
759
+ const { disableCursor: g } = p.mutableState;
760
+ let x = 0;
761
+ i ? v === "horizontal" ? x = (n.clientX - i.x) / h * 100 : x = (n.clientY - i.y) / h * 100 : v === "horizontal" ? x = n.clientX < 0 ? -100 : 100 : x = n.clientY < 0 ? -100 : 100;
762
+ const b = r.get(p), z = s.get(p);
763
+ if (!b || !z)
763
764
  return;
764
765
  const {
765
- defaultLayoutDeferred: L,
766
- derivedPanelConstraints: w,
767
- groupSize: C,
768
- layout: M,
769
- separatorToPanels: T
770
- } = x;
771
- if (w && M && T) {
772
- const G = z.resizePreviewMode === "separator" ? f.get(z) ?? M : M, E = de({
773
- delta: m,
766
+ defaultLayoutDeferred: E,
767
+ derivedPanelConstraints: R,
768
+ groupSize: w,
769
+ layout: C,
770
+ separatorToPanels: F
771
+ } = z;
772
+ if (R && C && F) {
773
+ const I = p.resizePreviewMode === "separator" ? f.get(p) ?? C : C, M = de({
774
+ delta: x,
774
775
  initialLayout: b,
775
- panelConstraints: w,
776
- pivotIndices: v.panels.map((N) => g.indexOf(N)),
777
- prevLayout: G,
776
+ panelConstraints: R,
777
+ pivotIndices: d.panels.map((N) => m.indexOf(N)),
778
+ prevLayout: I,
778
779
  trigger: "mouse-or-touch"
779
780
  });
780
- if (z.resizePreviewMode === "separator" && !e && !W(E, G)) {
781
- f.set(z, E);
781
+ if (p.resizePreviewMode === "separator" && !e && !K(M, I)) {
782
+ f.set(p, M);
782
783
  let N = 0;
783
- const _ = g.map((S) => (N += E[S.id] - b[S.id], N * (p / 100)));
784
- u = u.map((S) => {
785
- if (S.group !== z)
784
+ const _ = m.map((S) => (N += M[S.id] - b[S.id], N * (h / 100)));
785
+ l = l.map((S) => {
786
+ if (S.group !== p)
786
787
  return S;
787
788
  const P = _[S.panelIndex];
788
789
  return P === S.offset ? S : { ...S, offset: P };
789
790
  });
790
791
  }
791
- if (W(E, G) && m !== 0 && !y)
792
- switch (h) {
792
+ if (K(M, I) && x !== 0 && !g)
793
+ switch (v) {
793
794
  case "horizontal": {
794
- a |= m < 0 ? ot : rt;
795
+ c |= x < 0 ? rt : it;
795
796
  break;
796
797
  }
797
798
  case "vertical": {
798
- a |= m < 0 ? it : st;
799
+ c |= x < 0 ? st : at;
799
800
  break;
800
801
  }
801
802
  }
802
- (z.resizePreviewMode !== "separator" || e) && !W(E, M) && K(v.group, {
803
- defaultLayoutDeferred: L,
804
- derivedPanelConstraints: w,
805
- groupSize: C,
806
- layout: E,
807
- separatorToPanels: T
803
+ (p.resizePreviewMode !== "separator" || e) && !K(M, C) && q(d.group, {
804
+ defaultLayoutDeferred: E,
805
+ derivedPanelConstraints: R,
806
+ groupSize: w,
807
+ layout: M,
808
+ separatorToPanels: F
808
809
  });
809
810
  }
810
811
  });
811
- let d = 0;
812
- n.movementX === 0 ? d |= l & Ge : d |= a & Ge, n.movementY === 0 ? d |= l & Fe : d |= a & Fe, Tt(d, u, f), fe(t);
812
+ let y = 0;
813
+ n.movementX === 0 ? y |= u & Fe : y |= c & Fe, n.movementY === 0 ? y |= u & Ne : y |= c & Ne, Dt(y, l, f), fe(t);
813
814
  }
814
- function ft(e, t) {
815
+ function dt(e, t) {
815
816
  const n = X(), o = ee();
816
817
  let r = !1;
817
818
  switch (n.state) {
@@ -825,37 +826,37 @@ function ft(e, t) {
825
826
  mountedGroups: o,
826
827
  pointerDownAtPoint: n.pointerDownAtPoint,
827
828
  prevCursorFlags: n.cursorFlags
828
- }), U({
829
+ }), W({
829
830
  cursorFlags: 0,
830
831
  state: "inactive"
831
- }), n.hitRegions.length > 0 && (fe(e), r = !0, n.hitRegions.forEach((i) => {
832
- if (!o.has(i.group))
832
+ }), n.hitRegions.length > 0 && (fe(e), r = !0, n.hitRegions.forEach((s) => {
833
+ if (!o.has(s.group))
833
834
  return;
834
- const c = Q(i.group.id, !0);
835
- K(i.group, c, {
835
+ const i = Q(s.group.id, !0);
836
+ q(s.group, i, {
836
837
  isUserInteraction: !0
837
838
  });
838
839
  }));
839
840
  }
840
841
  return r;
841
842
  }
842
- function $e(e) {
843
- e.defaultPrevented || ft(e.currentTarget, e);
843
+ function He(e) {
844
+ e.defaultPrevented || dt(e.currentTarget, e);
844
845
  }
845
- function Vt(e, t, n) {
846
+ function Bt(e, t, n) {
846
847
  let o, r = {
847
848
  x: 1 / 0,
848
849
  y: 1 / 0
849
850
  };
850
- for (const i of t) {
851
- const c = lt(n, i.rect);
851
+ for (const s of t) {
852
+ const i = ct(n, s.rect);
852
853
  switch (e) {
853
854
  case "horizontal": {
854
- c.x <= r.x && (o = i, r = c);
855
+ i.x <= r.x && (o = s, r = i);
855
856
  break;
856
857
  }
857
858
  case "vertical": {
858
- c.y <= r.y && (o = i, r = c);
859
+ i.y <= r.y && (o = s, r = i);
859
860
  break;
860
861
  }
861
862
  }
@@ -865,86 +866,86 @@ function Vt(e, t, n) {
865
866
  hitRegion: o
866
867
  } : void 0;
867
868
  }
868
- function Bt(e) {
869
+ function Ut(e) {
869
870
  return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
870
871
  }
871
- function Ut(e, t) {
872
+ function Wt(e, t) {
872
873
  if (e === t) throw new Error("Cannot compare node with itself");
873
874
  const n = {
874
- a: Ve(e),
875
- b: Ve(t)
875
+ a: Be(e),
876
+ b: Be(t)
876
877
  };
877
878
  let o;
878
879
  for (; n.a.at(-1) === n.b.at(-1); )
879
880
  o = n.a.pop(), n.b.pop();
880
- R(
881
+ L(
881
882
  o,
882
883
  "Stacking order can only be calculated for elements with a common ancestor"
883
884
  );
884
885
  const r = {
885
- a: He(je(n.a)),
886
- b: He(je(n.b))
886
+ a: je(Ve(n.a)),
887
+ b: je(Ve(n.b))
887
888
  };
888
889
  if (r.a === r.b) {
889
- const i = o.childNodes, c = {
890
+ const s = o.childNodes, i = {
890
891
  a: n.a.at(-1),
891
892
  b: n.b.at(-1)
892
893
  };
893
- let l = i.length;
894
- for (; l--; ) {
895
- const a = i[l];
896
- if (a === c.a) return 1;
897
- if (a === c.b) return -1;
894
+ let u = s.length;
895
+ for (; u--; ) {
896
+ const c = s[u];
897
+ if (c === i.a) return 1;
898
+ if (c === i.b) return -1;
898
899
  }
899
900
  }
900
901
  return Math.sign(r.a - r.b);
901
902
  }
902
- const Wt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
903
- function Kt(e) {
904
- const t = getComputedStyle(dt(e) ?? e).display;
903
+ const Kt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
904
+ function qt(e) {
905
+ const t = getComputedStyle(pt(e) ?? e).display;
905
906
  return t === "flex" || t === "inline-flex";
906
907
  }
907
- function qt(e) {
908
+ function Xt(e) {
908
909
  const t = getComputedStyle(e);
909
- return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || Kt(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || Wt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
910
+ return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || qt(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || Kt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
910
911
  }
911
- function je(e) {
912
+ function Ve(e) {
912
913
  let t = e.length;
913
914
  for (; t--; ) {
914
915
  const n = e[t];
915
- if (R(n, "Missing node"), qt(n)) return n;
916
+ if (L(n, "Missing node"), Xt(n)) return n;
916
917
  }
917
918
  return null;
918
919
  }
919
- function He(e) {
920
+ function je(e) {
920
921
  return e && Number(getComputedStyle(e).zIndex) || 0;
921
922
  }
922
- function Ve(e) {
923
+ function Be(e) {
923
924
  const t = [];
924
925
  for (; e; )
925
- t.push(e), e = dt(e);
926
+ t.push(e), e = pt(e);
926
927
  return t;
927
928
  }
928
- function dt(e) {
929
+ function pt(e) {
929
930
  const { parentNode: t } = e;
930
- return Bt(t) ? t.host : t;
931
+ return Ut(t) ? t.host : t;
931
932
  }
932
- function Xt(e, t) {
933
+ function Yt(e, t) {
933
934
  return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
934
935
  }
935
- function Yt({
936
+ function Jt({
936
937
  groupElement: e,
937
938
  hitRegion: t,
938
939
  pointerEventTarget: n
939
940
  }) {
940
- if (!at(n) || n.contains(e) || e.contains(n))
941
+ if (!lt(n) || n.contains(e) || e.contains(n))
941
942
  return !0;
942
- if (Ut(n, e) > 0) {
943
+ if (Wt(n, e) > 0) {
943
944
  let o = n;
944
945
  for (; o; ) {
945
946
  if (o.contains(e))
946
947
  return !0;
947
- if (Xt(o.getBoundingClientRect(), t))
948
+ if (Yt(o.getBoundingClientRect(), t))
948
949
  return !1;
949
950
  o = o.parentElement;
950
951
  }
@@ -956,210 +957,209 @@ function ke(e, t) {
956
957
  return t.forEach((o, r) => {
957
958
  if (r.disabled)
958
959
  return;
959
- const i = Me({ group: r }), c = Vt(r.orientation, i, {
960
+ const s = Me({ group: r }), i = Bt(r.orientation, s, {
960
961
  x: e.clientX,
961
962
  y: e.clientY
962
963
  });
963
- c && c.distance.x <= 0 && c.distance.y <= 0 && Yt({
964
+ i && i.distance.x <= 0 && i.distance.y <= 0 && Jt({
964
965
  groupElement: r.element,
965
- hitRegion: c.hitRegion.rect,
966
+ hitRegion: i.hitRegion.rect,
966
967
  pointerEventTarget: e.target
967
- }) && n.push(c.hitRegion);
968
+ }) && n.push(i.hitRegion);
968
969
  }), n;
969
970
  }
970
971
  function ne({
971
972
  layout: e,
972
973
  panelConstraints: t
973
974
  }) {
974
- const n = Object.values(e), o = [...n], r = o.reduce(
975
- (l, a) => l + a,
975
+ const n = t.map(({ panelId: i }) => e[i]), o = [...n], r = o.reduce(
976
+ (i, u) => i + u,
976
977
  0
977
978
  );
978
- if (o.length !== t.length)
979
+ if (Object.keys(e).length !== t.length)
979
980
  throw Error(
980
- `Invalid ${t.length} panel layout: ${o.map((l) => `${l}%`).join(", ")}`
981
+ `Invalid ${t.length} panel layout: ${Object.values(e).map((i) => `${i}%`).join(", ")}`
981
982
  );
982
- if (!O(r, 100) && o.length > 0)
983
- for (let l = 0; l < t.length; l++) {
984
- const a = o[l];
985
- R(a != null, `No layout data found for index ${l}`);
986
- const s = 100 / r * a;
987
- o[l] = s;
983
+ if (!D(r, 100) && o.length > 0)
984
+ for (let i = 0; i < t.length; i++) {
985
+ const u = o[i];
986
+ L(u != null, `No layout data found for index ${i}`);
987
+ const c = 100 / r * u;
988
+ o[i] = c;
988
989
  }
989
- let i = 0;
990
- for (let l = 0; l < t.length; l++) {
991
- const a = n[l];
992
- R(a != null, `No layout data found for index ${l}`);
993
- const s = o[l];
994
- R(s != null, `No layout data found for index ${l}`);
995
- const u = se({
990
+ let s = 0;
991
+ for (let i = 0; i < t.length; i++) {
992
+ const u = n[i];
993
+ L(u != null, `No layout data found for index ${i}`);
994
+ const c = o[i];
995
+ L(c != null, `No layout data found for index ${i}`);
996
+ const a = se({
996
997
  overrideDisabledPanels: !0,
997
- panelConstraints: t[l],
998
- prevSize: a,
999
- size: s
998
+ panelConstraints: t[i],
999
+ prevSize: u,
1000
+ size: c
1000
1001
  });
1001
- s != u && (i += s - u, o[l] = u);
1002
+ c != a && (s += c - a, o[i] = a);
1002
1003
  }
1003
- if (!O(i, 0))
1004
- for (let l = 0; l < t.length; l++) {
1005
- const a = o[l];
1006
- R(a != null, `No layout data found for index ${l}`);
1007
- const s = a + i, u = se({
1004
+ if (!D(s, 0))
1005
+ for (let i = 0; i < t.length; i++) {
1006
+ const u = o[i];
1007
+ L(u != null, `No layout data found for index ${i}`);
1008
+ const c = u + s, a = se({
1008
1009
  overrideDisabledPanels: !0,
1009
- panelConstraints: t[l],
1010
- prevSize: a,
1011
- size: s
1010
+ panelConstraints: t[i],
1011
+ prevSize: u,
1012
+ size: c
1012
1013
  });
1013
- if (a !== u && (i -= u - a, o[l] = u, O(i, 0)))
1014
+ if (u !== a && (s -= a - u, o[i] = a, D(s, 0)))
1014
1015
  break;
1015
1016
  }
1016
- const c = Object.keys(e);
1017
- return o.reduce((l, a, s) => (l[c[s]] = a, l), {});
1017
+ return o.reduce((i, u, c) => (i[t[c].panelId] = u, i), {});
1018
1018
  }
1019
- function pt({
1019
+ function ht({
1020
1020
  groupId: e,
1021
1021
  panelId: t
1022
1022
  }) {
1023
1023
  const n = () => {
1024
- const a = ee();
1024
+ const c = ee();
1025
1025
  for (const [
1026
- s,
1026
+ a,
1027
1027
  {
1028
- defaultLayoutDeferred: u,
1028
+ defaultLayoutDeferred: l,
1029
1029
  derivedPanelConstraints: f,
1030
- layout: d,
1031
- groupSize: v,
1032
- separatorToPanels: z
1030
+ layout: y,
1031
+ groupSize: d,
1032
+ separatorToPanels: p
1033
1033
  }
1034
- ] of a)
1035
- if (s.id === e)
1034
+ ] of c)
1035
+ if (a.id === e)
1036
1036
  return {
1037
- defaultLayoutDeferred: u,
1037
+ defaultLayoutDeferred: l,
1038
1038
  derivedPanelConstraints: f,
1039
- group: s,
1040
- groupSize: v,
1041
- layout: d,
1042
- separatorToPanels: z
1039
+ group: a,
1040
+ groupSize: d,
1041
+ layout: y,
1042
+ separatorToPanels: p
1043
1043
  };
1044
1044
  throw Error(`Group ${e} not found`);
1045
1045
  }, o = () => {
1046
- const a = n().derivedPanelConstraints.find(
1047
- (s) => s.panelId === t
1046
+ const c = n().derivedPanelConstraints.find(
1047
+ (a) => a.panelId === t
1048
1048
  );
1049
- if (a !== void 0)
1050
- return a;
1049
+ if (c !== void 0)
1050
+ return c;
1051
1051
  throw Error(`Panel constraints not found for Panel ${t}`);
1052
1052
  }, r = () => {
1053
- const a = n().group.panels.find((s) => s.id === t);
1054
- if (a !== void 0)
1055
- return a;
1053
+ const c = n().group.panels.find((a) => a.id === t);
1054
+ if (c !== void 0)
1055
+ return c;
1056
1056
  throw Error(`Layout not found for Panel ${t}`);
1057
- }, i = () => {
1058
- const a = n().layout[t];
1059
- if (a !== void 0)
1060
- return a;
1057
+ }, s = () => {
1058
+ const c = n().layout[t];
1059
+ if (c !== void 0)
1060
+ return c;
1061
1061
  throw Error(`Layout not found for Panel ${t}`);
1062
- }, c = ({
1063
- nextSize: a,
1064
- panels: s,
1065
- prevLayout: u,
1062
+ }, i = ({
1063
+ nextSize: c,
1064
+ panels: a,
1065
+ prevLayout: l,
1066
1066
  derivedPanelConstraints: f
1067
1067
  }) => {
1068
- const d = i(), v = s.findIndex((g) => g.id === t), z = v === 0, p = v === s.length - 1;
1069
- if (p && a < d && (z || s.slice(0, v).every((g, y) => {
1070
- const m = f[y];
1071
- return m?.collapsible && O(m.collapsedSize, u[m.panelId]);
1068
+ const y = s(), d = a.findIndex((m) => m.id === t), p = d === 0, h = d === a.length - 1;
1069
+ if (h && c < y && (p || a.slice(0, d).every((m, g) => {
1070
+ const x = f[g];
1071
+ return x?.collapsible && D(x.collapsedSize, l[x.panelId]);
1072
1072
  }))) {
1073
- const g = s.slice(0, v).reduce((y, m) => y + u[m.id], 0);
1073
+ const m = a.slice(0, d).reduce((g, x) => g + l[x.id], 0);
1074
1074
  return {
1075
- ...u,
1076
- [t]: A(100 - g)
1075
+ ...l,
1076
+ [t]: A(100 - m)
1077
1077
  };
1078
1078
  }
1079
1079
  return de({
1080
- delta: p ? d - a : a - d,
1081
- initialLayout: u,
1080
+ delta: h ? y - c : c - y,
1081
+ initialLayout: l,
1082
1082
  panelConstraints: f,
1083
- pivotIndices: p ? [v - 1, v] : [v, v + 1],
1084
- prevLayout: u,
1083
+ pivotIndices: h ? [d - 1, d] : [d, d + 1],
1084
+ prevLayout: l,
1085
1085
  trigger: "imperative-api"
1086
1086
  });
1087
- }, l = (a) => {
1088
- const s = i();
1089
- if (a === s)
1087
+ }, u = (c) => {
1088
+ const a = s();
1089
+ if (c === a)
1090
1090
  return;
1091
1091
  const {
1092
- defaultLayoutDeferred: u,
1092
+ defaultLayoutDeferred: l,
1093
1093
  derivedPanelConstraints: f,
1094
- group: d,
1095
- groupSize: v,
1096
- layout: z,
1097
- separatorToPanels: p
1098
- } = n(), h = c({
1099
- nextSize: a,
1100
- panels: d.panels,
1101
- prevLayout: z,
1094
+ group: y,
1095
+ groupSize: d,
1096
+ layout: p,
1097
+ separatorToPanels: h
1098
+ } = n(), v = i({
1099
+ nextSize: c,
1100
+ panels: y.panels,
1101
+ prevLayout: p,
1102
1102
  derivedPanelConstraints: f
1103
- }), g = ne({
1104
- layout: h,
1103
+ }), m = ne({
1104
+ layout: v,
1105
1105
  panelConstraints: f
1106
1106
  });
1107
- W(z, g) || K(d, {
1108
- defaultLayoutDeferred: u,
1107
+ K(p, m) || q(y, {
1108
+ defaultLayoutDeferred: l,
1109
1109
  derivedPanelConstraints: f,
1110
- groupSize: v,
1111
- layout: g,
1112
- separatorToPanels: p
1110
+ groupSize: d,
1111
+ layout: m,
1112
+ separatorToPanels: h
1113
1113
  });
1114
1114
  };
1115
1115
  return {
1116
1116
  collapse: () => {
1117
- const { collapsible: a, collapsedSize: s } = o(), { mutableValues: u } = r(), f = i();
1118
- a && f !== s && (u.expandToSize = f, l(s));
1117
+ const { collapsible: c, collapsedSize: a } = o(), { mutableValues: l } = r(), f = s();
1118
+ c && f !== a && (l.expandToSize = f, u(a));
1119
1119
  },
1120
1120
  expand: () => {
1121
- const { collapsible: a, collapsedSize: s, minSize: u } = o(), { mutableValues: f } = r(), d = i();
1122
- if (a && d === s) {
1123
- let v = f.expandToSize ?? u;
1124
- v === 0 && (v = 1), l(v);
1121
+ const { collapsible: c, collapsedSize: a, minSize: l } = o(), { mutableValues: f } = r(), y = s();
1122
+ if (c && y === a) {
1123
+ let d = f.expandToSize ?? l;
1124
+ d === 0 && (d = 1), u(d);
1125
1125
  }
1126
1126
  },
1127
1127
  getSize: () => {
1128
- const { group: a } = n(), s = i(), { element: u } = r(), f = a.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
1128
+ const { group: c } = n(), a = s(), { element: l } = r(), f = c.orientation === "horizontal" ? l.offsetWidth : l.offsetHeight;
1129
1129
  return {
1130
- asPercentage: s,
1130
+ asPercentage: a,
1131
1131
  inPixels: f
1132
1132
  };
1133
1133
  },
1134
1134
  isCollapsed: () => {
1135
- const { collapsible: a, collapsedSize: s } = o(), u = i();
1136
- return a && O(s, u);
1135
+ const { collapsible: c, collapsedSize: a } = o(), l = s();
1136
+ return c && D(a, l);
1137
1137
  },
1138
- resize: (a) => {
1139
- const { group: s } = n(), { element: u } = r(), f = ae({ group: s }), d = ie({
1138
+ resize: (c) => {
1139
+ const { group: a } = n(), { element: l } = r(), f = ae({ group: a }), y = ie({
1140
1140
  groupSize: f,
1141
- panelElement: u,
1142
- styleProp: a
1143
- }), v = A(d / f * 100);
1144
- l(v);
1141
+ panelElement: l,
1142
+ styleProp: c
1143
+ }), d = A(y / f * 100);
1144
+ u(d);
1145
1145
  }
1146
1146
  };
1147
1147
  }
1148
- function Be(e) {
1148
+ function Ue(e) {
1149
1149
  if (e.defaultPrevented)
1150
1150
  return;
1151
1151
  const t = ee();
1152
1152
  ke(e, t).forEach((o) => {
1153
1153
  if (o.separator && !o.separator.disableDoubleClick) {
1154
1154
  const r = o.panels.find(
1155
- (i) => i.panelConstraints.defaultSize !== void 0
1155
+ (s) => s.panelConstraints.defaultSize !== void 0
1156
1156
  );
1157
1157
  if (r) {
1158
- const i = r.panelConstraints.defaultSize, c = pt({
1158
+ const s = r.panelConstraints.defaultSize, i = ht({
1159
1159
  groupId: o.group.id,
1160
1160
  panelId: r.id
1161
1161
  });
1162
- c && i !== void 0 && (c.resize(i), e.preventDefault());
1162
+ i && s !== void 0 && (i.resize(s), e.preventDefault());
1163
1163
  }
1164
1164
  }
1165
1165
  });
@@ -1173,7 +1173,7 @@ function ye(e) {
1173
1173
  return n;
1174
1174
  throw Error("Could not find parent Group for separator element");
1175
1175
  }
1176
- function ht({
1176
+ function mt({
1177
1177
  groupId: e
1178
1178
  }) {
1179
1179
  const t = () => {
@@ -1192,21 +1192,21 @@ function ht({
1192
1192
  const {
1193
1193
  defaultLayoutDeferred: o,
1194
1194
  derivedPanelConstraints: r,
1195
- group: i,
1196
- groupSize: c,
1197
- layout: l,
1198
- separatorToPanels: a
1199
- } = t(), s = ne({
1195
+ group: s,
1196
+ groupSize: i,
1197
+ layout: u,
1198
+ separatorToPanels: c
1199
+ } = t(), a = ne({
1200
1200
  layout: n,
1201
1201
  panelConstraints: r
1202
1202
  });
1203
- return o ? l : (W(l, s) || K(i, {
1203
+ return o ? u : (K(u, a) || q(s, {
1204
1204
  defaultLayoutDeferred: o,
1205
1205
  derivedPanelConstraints: r,
1206
- groupSize: c,
1207
- layout: s,
1208
- separatorToPanels: a
1209
- }), s);
1206
+ groupSize: i,
1207
+ layout: a,
1208
+ separatorToPanels: c
1209
+ }), a);
1210
1210
  }
1211
1211
  };
1212
1212
  }
@@ -1214,27 +1214,27 @@ function te(e, t) {
1214
1214
  const n = ye(e), o = Q(n.id, !0), r = n.separators.find(
1215
1215
  (f) => f.element === e
1216
1216
  );
1217
- R(r, "Matching separator not found");
1218
- const i = o.separatorToPanels.get(r);
1219
- R(i, "Matching panels not found");
1220
- const c = i.map((f) => n.panels.indexOf(f)), a = ht({ groupId: n.id }).getLayout(), s = de({
1217
+ L(r, "Matching separator not found");
1218
+ const s = o.separatorToPanels.get(r);
1219
+ L(s, "Matching panels not found");
1220
+ const i = s.map((f) => n.panels.indexOf(f)), c = mt({ groupId: n.id }).getLayout(), a = de({
1221
1221
  delta: t,
1222
- initialLayout: a,
1222
+ initialLayout: c,
1223
1223
  panelConstraints: o.derivedPanelConstraints,
1224
- pivotIndices: c,
1225
- prevLayout: a,
1224
+ pivotIndices: i,
1225
+ prevLayout: c,
1226
1226
  trigger: "keyboard"
1227
- }), u = ne({
1228
- layout: s,
1227
+ }), l = ne({
1228
+ layout: a,
1229
1229
  panelConstraints: o.derivedPanelConstraints
1230
1230
  });
1231
- W(a, u) || K(
1231
+ K(c, l) || q(
1232
1232
  n,
1233
1233
  {
1234
1234
  defaultLayoutDeferred: o.defaultLayoutDeferred,
1235
1235
  derivedPanelConstraints: o.derivedPanelConstraints,
1236
1236
  groupSize: o.groupSize,
1237
- layout: u,
1237
+ layout: l,
1238
1238
  separatorToPanels: o.separatorToPanels
1239
1239
  },
1240
1240
  // Keyboard resizes (arrow keys, Home/End, Enter collapse/expand) originate
@@ -1244,11 +1244,13 @@ function te(e, t) {
1244
1244
  { isUserInteraction: !0 }
1245
1245
  );
1246
1246
  }
1247
- function Ue(e) {
1247
+ function We(e) {
1248
1248
  if (e.defaultPrevented)
1249
1249
  return;
1250
1250
  const t = e.currentTarget, n = ye(t);
1251
- if (!n.disabled)
1251
+ if (!(n.disabled || n.separators.find(
1252
+ (r) => r.element === t
1253
+ )?.disabled))
1252
1254
  switch (e.key) {
1253
1255
  case "ArrowDown": {
1254
1256
  e.preventDefault(), n.orientation === "vertical" && te(t, 5);
@@ -1272,31 +1274,31 @@ function Ue(e) {
1272
1274
  }
1273
1275
  case "Enter": {
1274
1276
  e.preventDefault();
1275
- const o = ye(t), r = Q(o.id, !0), { derivedPanelConstraints: i, layout: c, separatorToPanels: l } = r, a = o.separators.find(
1277
+ const r = ye(t), s = Q(r.id, !0), { derivedPanelConstraints: i, layout: u, separatorToPanels: c } = s, a = r.separators.find(
1276
1278
  (d) => d.element === t
1277
1279
  );
1278
- R(a, "Matching separator not found");
1279
- const s = l.get(a);
1280
- R(s, "Matching panels not found");
1281
- const u = s[0], f = i.find(
1282
- (d) => d.panelId === u.id
1280
+ L(a, "Matching separator not found");
1281
+ const l = c.get(a);
1282
+ L(l, "Matching panels not found");
1283
+ const f = l[0], y = i.find(
1284
+ (d) => d.panelId === f.id
1283
1285
  );
1284
- if (R(f, "Panel metadata not found"), f.collapsible) {
1285
- const d = c[u.id], v = f.collapsedSize === d ? o.mutableState.expandedPanelSizes[u.id] ?? f.minSize : f.collapsedSize;
1286
- te(t, v - d);
1286
+ if (L(y, "Panel metadata not found"), y.collapsible) {
1287
+ const d = u[f.id], p = y.collapsedSize === d ? r.mutableState.expandedPanelSizes[f.id] ?? y.minSize : y.collapsedSize;
1288
+ te(t, p - d);
1287
1289
  }
1288
1290
  break;
1289
1291
  }
1290
1292
  case "F6": {
1291
1293
  e.preventDefault();
1292
- const r = ye(t).separators.map(
1294
+ const s = ye(t).separators.map(
1293
1295
  (a) => a.element
1294
- ), i = Array.from(r).findIndex(
1296
+ ), i = Array.from(s).findIndex(
1295
1297
  (a) => a === e.currentTarget
1296
1298
  );
1297
- R(i !== null, "Index not found");
1298
- const c = e.shiftKey ? i > 0 ? i - 1 : r.length - 1 : i + 1 < r.length ? i + 1 : 0;
1299
- r[c].focus({
1299
+ L(i !== null, "Index not found");
1300
+ const u = e.shiftKey ? i > 0 ? i - 1 : s.length - 1 : i + 1 < s.length ? i + 1 : 0;
1301
+ s[u].focus({
1300
1302
  preventScroll: !0
1301
1303
  });
1302
1304
  break;
@@ -1307,69 +1309,72 @@ function Ue(e) {
1307
1309
  }
1308
1310
  }
1309
1311
  }
1310
- function Jt(e, t) {
1311
- const { element: n, orientation: o, panels: r } = e, i = n.getBoundingClientRect(), c = o === "horizontal";
1312
+ function Zt(e, t) {
1313
+ const { element: n, orientation: o, panels: r } = e, s = n.getBoundingClientRect(), i = o === "horizontal";
1312
1314
  return Me({
1313
1315
  expandHitTargets: !1,
1314
1316
  group: e,
1315
1317
  includeDisabled: !0
1316
1318
  }).map(
1317
- ({ panels: a, rect: s, separator: u }, f) => {
1318
- const d = r.indexOf(a[0]), v = c ? s.left + s.width / 2 : s.top + s.height / 2;
1319
+ ({ panels: c, rect: a, separator: l }, f) => {
1320
+ const y = r.indexOf(c[0]), d = i ? a.left + a.width / 2 : a.top + a.height / 2;
1319
1321
  return {
1320
- active: t.some((p) => {
1321
- if (p.group !== e || p.panels[0] !== a[0])
1322
+ active: t.some((h) => {
1323
+ if (h.group !== e || h.panels[0] !== c[0])
1322
1324
  return !1;
1323
- if (u || p.separator)
1324
- return p.separator === u;
1325
- const h = c ? p.rect.left + p.rect.width / 2 : p.rect.top + p.rect.height / 2;
1326
- return O(v, h);
1325
+ if (l || h.separator)
1326
+ return h.separator === l;
1327
+ const v = i ? h.rect.left + h.rect.width / 2 : h.rect.top + h.rect.height / 2;
1328
+ return D(d, v);
1327
1329
  }),
1328
1330
  group: e,
1329
- key: u ? `separator-${u.id}` : `panel-${a[0].id}-${f}`,
1331
+ key: l ? `separator-${l.id}` : `panel-${c[0].id}-${f}`,
1330
1332
  offset: 0,
1331
- panelIndex: d,
1333
+ panelIndex: y,
1332
1334
  rect: new DOMRect(
1333
- (c && !u ? v : s.left) - i.left - n.clientLeft + n.scrollLeft,
1334
- (!c && !u ? v : s.top) - i.top - n.clientTop + n.scrollTop,
1335
- c && !u ? 0 : s.width,
1336
- !c && !u ? 0 : s.height
1335
+ (i && !l ? d : a.left) - s.left - n.clientLeft + n.scrollLeft,
1336
+ (!i && !l ? d : a.top) - s.top - n.clientTop + n.scrollTop,
1337
+ i && !l ? 0 : a.width,
1338
+ !i && !l ? 0 : a.height
1337
1339
  ),
1338
- separator: u
1340
+ separator: l
1339
1341
  };
1340
1342
  }
1341
1343
  );
1342
1344
  }
1343
- function We(e) {
1345
+ function Ke(e) {
1344
1346
  if (e.defaultPrevented)
1345
1347
  return;
1346
1348
  if (e.pointerType === "mouse" && e.button > 0)
1347
1349
  return;
1348
- const t = ee(), n = ke(e, t), o = /* @__PURE__ */ new Map();
1350
+ const t = ee(), n = ke(e, t);
1351
+ if (n.length === 0)
1352
+ return;
1353
+ const o = /* @__PURE__ */ new Map();
1349
1354
  let r = !1;
1350
- n.forEach((c) => {
1351
- c.separator && (r || (r = !0, c.separator.element.focus({
1355
+ n.forEach((i) => {
1356
+ i.separator && (r || (r = !0, i.separator.element.focus({
1352
1357
  // @ts-expect-error https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#browser_compatibility
1353
1358
  focusVisible: !1,
1354
1359
  preventScroll: !0
1355
1360
  })));
1356
- const l = t.get(c.group);
1357
- l && o.set(c.group, l.layout);
1361
+ const u = t.get(i.group);
1362
+ u && o.set(i.group, u.layout);
1358
1363
  });
1359
- const i = Array.from(o.keys()).flatMap(
1360
- (c) => c.resizePreviewMode === "separator" ? Jt(c, n) : []
1364
+ const s = Array.from(o.keys()).flatMap(
1365
+ (i) => i.resizePreviewMode === "separator" ? Zt(i, n) : []
1361
1366
  );
1362
- U({
1367
+ W({
1363
1368
  cursorFlags: 0,
1364
1369
  hitRegions: n,
1365
1370
  initialLayoutMap: o,
1366
1371
  pointerDownAtPoint: { x: e.clientX, y: e.clientY },
1367
1372
  previewLayoutMap: new Map(o),
1368
- previews: i,
1373
+ previews: s,
1369
1374
  state: "active"
1370
- }), n.length && e.preventDefault();
1375
+ }), e.preventDefault();
1371
1376
  }
1372
- function Ke(e) {
1377
+ function qe(e) {
1373
1378
  const t = ee(), n = X();
1374
1379
  switch (n.state) {
1375
1380
  case "active":
@@ -1384,7 +1389,7 @@ function Ke(e) {
1384
1389
  });
1385
1390
  }
1386
1391
  }
1387
- function qe(e) {
1392
+ function Xe(e) {
1388
1393
  if (e.defaultPrevented)
1389
1394
  return;
1390
1395
  const t = X(), n = ee();
@@ -1395,16 +1400,16 @@ function qe(e) {
1395
1400
  e.buttons === 0
1396
1401
  ) {
1397
1402
  t.previewLayoutMap.forEach((o, r) => {
1398
- const i = n.get(r);
1399
- r.resizePreviewMode === "separator" && i && !W(o, i.layout) && K(r, { ...i, layout: o });
1400
- }), U({
1403
+ const s = n.get(r);
1404
+ r.resizePreviewMode === "separator" && s && !K(o, s.layout) && q(r, { ...s, layout: o });
1405
+ }), W({
1401
1406
  cursorFlags: 0,
1402
1407
  state: "inactive"
1403
1408
  }), t.hitRegions.forEach((o) => {
1404
1409
  if (!n.has(o.group))
1405
1410
  return;
1406
1411
  const r = Q(o.group.id, !0);
1407
- K(o.group, r, {
1412
+ q(o.group, r, {
1408
1413
  isUserInteraction: !0
1409
1414
  });
1410
1415
  }), fe(e.currentTarget);
@@ -1429,10 +1434,10 @@ function qe(e) {
1429
1434
  }
1430
1435
  default: {
1431
1436
  const o = ke(e, n);
1432
- o.length === 0 ? t.state !== "inactive" && U({
1437
+ o.length === 0 ? t.state !== "inactive" && W({
1433
1438
  cursorFlags: 0,
1434
1439
  state: "inactive"
1435
- }) : U({
1440
+ }) : W({
1436
1441
  cursorFlags: 0,
1437
1442
  hitRegions: o,
1438
1443
  state: "hover"
@@ -1441,57 +1446,73 @@ function qe(e) {
1441
1446
  }
1442
1447
  }
1443
1448
  }
1444
- function Xe(e) {
1449
+ function Ye(e) {
1445
1450
  if (e.relatedTarget instanceof HTMLIFrameElement)
1446
1451
  switch (X().state) {
1447
1452
  case "hover":
1448
- U({
1453
+ W({
1449
1454
  cursorFlags: 0,
1450
1455
  state: "inactive"
1451
1456
  });
1452
1457
  }
1453
1458
  }
1454
- function Ye(e) {
1459
+ function Je(e) {
1455
1460
  if (e.defaultPrevented)
1456
1461
  return;
1457
1462
  if (e.pointerType === "mouse" && e.button > 0)
1458
1463
  return;
1459
- ft(
1464
+ dt(
1460
1465
  e.currentTarget,
1461
1466
  e
1462
1467
  ) && e.preventDefault();
1463
1468
  }
1464
- function Je(e) {
1469
+ function Qt(e) {
1465
1470
  let t = 0, n = 0;
1466
1471
  const o = {};
1467
- for (const i of e)
1468
- if (i.defaultSize !== void 0) {
1472
+ for (const s of e)
1473
+ if (s.defaultSize !== void 0) {
1469
1474
  t++;
1470
- const c = A(i.defaultSize);
1471
- n += c, o[i.panelId] = c;
1475
+ const i = A(s.defaultSize);
1476
+ n += i, o[s.panelId] = i;
1472
1477
  } else
1473
- o[i.panelId] = void 0;
1478
+ o[s.panelId] = void 0;
1474
1479
  const r = e.length - t;
1475
1480
  if (r !== 0) {
1476
- const i = A((100 - n) / r);
1477
- for (const c of e)
1478
- c.defaultSize === void 0 && (o[c.panelId] = i);
1481
+ const s = A((100 - n) / r);
1482
+ for (const i of e)
1483
+ i.defaultSize === void 0 && (o[i.panelId] = s);
1479
1484
  }
1480
1485
  return o;
1481
1486
  }
1482
- function Zt(e, t, n) {
1487
+ function en(e, t) {
1488
+ const n = e.map((r) => r.id), o = Object.keys(t);
1489
+ if (n.length !== o.length)
1490
+ return !1;
1491
+ for (const r of n)
1492
+ if (!o.includes(r))
1493
+ return !1;
1494
+ return !0;
1495
+ }
1496
+ function Ze({
1497
+ group: e,
1498
+ panelConstraints: t
1499
+ }) {
1500
+ const n = e.panels.map(({ id: r }) => r).join(","), o = e.mutableState.defaultLayout;
1501
+ return e.mutableState.layouts[n] ?? (o && en(e.panels, o) ? o : Qt(t));
1502
+ }
1503
+ function tn(e, t, n) {
1483
1504
  if (!n[0])
1484
1505
  return;
1485
- const r = e.panels.find((s) => s.element === t);
1506
+ const r = e.panels.find((a) => a.element === t);
1486
1507
  if (!r || !r.onResize)
1487
1508
  return;
1488
- const i = ae({ group: e }), c = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, l = r.mutableValues.prevSize, a = {
1489
- asPercentage: A(c / i * 100),
1490
- inPixels: c
1509
+ const s = ae({ group: e }), i = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, u = r.mutableValues.prevSize, c = {
1510
+ asPercentage: A(i / s * 100),
1511
+ inPixels: i
1491
1512
  };
1492
- r.mutableValues.prevSize = a, r.onResize(a, r.id, l);
1513
+ r.mutableValues.prevSize = c, r.onResize(c, r.id, u);
1493
1514
  }
1494
- function mt(e, t) {
1515
+ function gt(e, t) {
1495
1516
  if (Object.keys(e).length !== Object.keys(t).length)
1496
1517
  return !1;
1497
1518
  for (const o in e)
@@ -1499,10 +1520,10 @@ function mt(e, t) {
1499
1520
  return !1;
1500
1521
  return !0;
1501
1522
  }
1502
- function Qt(e, t) {
1503
- return e.length !== t.length ? !1 : e.every((n, o) => mt(n, t[o]));
1523
+ function nn(e, t) {
1524
+ return e.length !== t.length ? !1 : e.every((n, o) => gt(n, t[o]));
1504
1525
  }
1505
- function en({
1526
+ function on({
1506
1527
  group: e,
1507
1528
  nextGroupSize: t,
1508
1529
  prevGroupSize: n,
@@ -1510,171 +1531,165 @@ function en({
1510
1531
  }) {
1511
1532
  if (n <= 0 || t <= 0 || n === t)
1512
1533
  return o;
1513
- let r = 0, i = 0, c = !1;
1514
- const l = /* @__PURE__ */ new Map(), a = [];
1534
+ let r = 0, s = 0, i = !1;
1535
+ const u = /* @__PURE__ */ new Map(), c = [];
1515
1536
  for (const f of e.panels) {
1516
- const d = o[f.id] ?? 0;
1537
+ const y = o[f.id] ?? 0;
1517
1538
  switch (f.panelConstraints.groupResizeBehavior) {
1518
1539
  case "preserve-pixel-size": {
1519
- c = !0;
1520
- const v = d / 100 * n, z = A(
1521
- v / t * 100
1540
+ i = !0;
1541
+ const d = y / 100 * n, p = A(
1542
+ d / t * 100
1522
1543
  );
1523
- l.set(f.id, z), r += z;
1544
+ u.set(f.id, p), r += p;
1524
1545
  break;
1525
1546
  }
1526
1547
  case "preserve-relative-size":
1527
1548
  default: {
1528
- a.push(f.id), i += d;
1549
+ c.push(f.id), s += y;
1529
1550
  break;
1530
1551
  }
1531
1552
  }
1532
1553
  }
1533
- if (!c || a.length === 0)
1554
+ if (!i || c.length === 0)
1534
1555
  return o;
1535
- const s = 100 - r, u = { ...o };
1536
- if (l.forEach((f, d) => {
1537
- u[d] = f;
1538
- }), i > 0)
1539
- for (const f of a) {
1540
- const d = o[f] ?? 0;
1541
- u[f] = A(
1542
- d / i * s
1556
+ const a = 100 - r, l = { ...o };
1557
+ if (u.forEach((f, y) => {
1558
+ l[y] = f;
1559
+ }), s > 0)
1560
+ for (const f of c) {
1561
+ const y = o[f] ?? 0;
1562
+ l[f] = A(
1563
+ y / s * a
1543
1564
  );
1544
1565
  }
1545
1566
  else {
1546
1567
  const f = A(
1547
- s / a.length
1568
+ a / c.length
1548
1569
  );
1549
- for (const d of a)
1550
- u[d] = f;
1570
+ for (const y of c)
1571
+ l[y] = f;
1551
1572
  }
1552
- return u;
1553
- }
1554
- function tn(e, t) {
1555
- const n = e.map((r) => r.id), o = Object.keys(t);
1556
- if (n.length !== o.length)
1557
- return !1;
1558
- for (const r of n)
1559
- if (!o.includes(r))
1560
- return !1;
1561
- return !0;
1573
+ return l;
1562
1574
  }
1563
1575
  const re = /* @__PURE__ */ new Map();
1564
- function nn(e) {
1576
+ function rn(e) {
1565
1577
  let t = !0;
1566
- R(
1578
+ L(
1567
1579
  e.element.ownerDocument.defaultView,
1568
1580
  "Cannot register an unmounted Group"
1569
1581
  );
1570
- const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = new n((p) => {
1571
- for (const h of p) {
1572
- const { borderBoxSize: g, target: y } = h;
1573
- if (y === e.element) {
1582
+ const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = new n((d) => {
1583
+ for (const p of d) {
1584
+ const { borderBoxSize: h, target: v } = p;
1585
+ if (v === e.element) {
1574
1586
  if (t) {
1575
1587
  const m = ae({ group: e });
1576
1588
  if (m === 0)
1577
1589
  return;
1578
- const b = Q(e.id);
1579
- if (!b)
1590
+ const g = Q(e.id);
1591
+ if (!g)
1580
1592
  return;
1581
- const x = Le(e), L = b.defaultLayoutDeferred ? Je(x) : b.layout, w = en({
1593
+ const x = Le(e), b = g.defaultLayoutDeferred ? Ze({
1594
+ group: e,
1595
+ panelConstraints: x
1596
+ }) : g.layout, z = on({
1582
1597
  group: e,
1583
1598
  nextGroupSize: m,
1584
- prevGroupSize: b.groupSize,
1585
- prevLayout: L
1586
- }), C = ne({
1587
- layout: w,
1599
+ prevGroupSize: g.groupSize,
1600
+ prevLayout: b
1601
+ }), E = ne({
1602
+ layout: z,
1588
1603
  panelConstraints: x
1589
1604
  });
1590
- if (!b.defaultLayoutDeferred && W(b.layout, C) && Qt(
1591
- b.derivedPanelConstraints,
1605
+ if (!g.defaultLayoutDeferred && K(g.layout, E) && nn(
1606
+ g.derivedPanelConstraints,
1592
1607
  x
1593
- ) && b.groupSize === m)
1608
+ ) && g.groupSize === m)
1594
1609
  continue;
1595
- K(e, {
1610
+ q(e, {
1596
1611
  defaultLayoutDeferred: !1,
1597
1612
  derivedPanelConstraints: x,
1598
1613
  groupSize: m,
1599
- layout: C,
1600
- separatorToPanels: b.separatorToPanels
1614
+ layout: E,
1615
+ separatorToPanels: g.separatorToPanels
1601
1616
  });
1602
1617
  }
1603
1618
  } else
1604
- Zt(e, y, g);
1619
+ tn(e, v, h);
1605
1620
  }
1606
1621
  });
1607
- i.observe(e.element), e.panels.forEach((p) => {
1608
- R(
1609
- !o.has(p.id),
1610
- `Panel ids must be unique; id "${p.id}" was used more than once`
1611
- ), o.add(p.id), p.onResize && i.observe(p.element);
1622
+ s.observe(e.element), e.panels.forEach((d) => {
1623
+ L(
1624
+ !o.has(d.id),
1625
+ `Panel ids must be unique; id "${d.id}" was used more than once`
1626
+ ), o.add(d.id), d.onResize && s.observe(d.element);
1612
1627
  });
1613
- const c = ae({ group: e }), l = Le(e), a = e.panels.map(({ id: p }) => p).join(",");
1614
- let s = e.mutableState.defaultLayout;
1615
- s && (tn(e.panels, s) || (s = void 0));
1616
- const u = e.mutableState.layouts[a] ?? s ?? Je(l), f = ne({
1617
- layout: u,
1618
- panelConstraints: l
1619
- }), d = e.element.ownerDocument;
1628
+ const i = ae({ group: e }), u = Le(e), c = Ze({
1629
+ group: e,
1630
+ panelConstraints: u
1631
+ }), a = ne({
1632
+ layout: c,
1633
+ panelConstraints: u
1634
+ }), l = e.element.ownerDocument;
1620
1635
  re.set(
1621
- d,
1622
- (re.get(d) ?? 0) + 1
1636
+ l,
1637
+ (re.get(l) ?? 0) + 1
1623
1638
  );
1624
- const v = /* @__PURE__ */ new Map();
1625
- return Me({ group: e }).forEach((p) => {
1626
- p.separator && v.set(p.separator, p.panels);
1627
- }), K(e, {
1628
- defaultLayoutDeferred: c === 0,
1629
- derivedPanelConstraints: l,
1630
- groupSize: c,
1631
- layout: f,
1632
- separatorToPanels: v
1633
- }), e.separators.forEach((p) => {
1634
- R(
1635
- !r.has(p.id),
1636
- `Separator ids must be unique; id "${p.id}" was used more than once`
1637
- ), r.add(p.id), p.element.addEventListener("keydown", Ue);
1638
- }), re.get(d) === 1 && (d.addEventListener("contextmenu", $e, !0), d.addEventListener("dblclick", Be, !0), d.addEventListener("pointerdown", We, !0), d.addEventListener("pointerleave", Ke), d.addEventListener("pointermove", qe), d.addEventListener("pointerout", Xe), d.addEventListener("pointerup", Ye, !0)), function() {
1639
+ const f = /* @__PURE__ */ new Map();
1640
+ return Me({ group: e, includeDisabled: !0 }).forEach((d) => {
1641
+ d.separator && f.set(d.separator, d.panels);
1642
+ }), q(e, {
1643
+ defaultLayoutDeferred: i === 0,
1644
+ derivedPanelConstraints: u,
1645
+ groupSize: i,
1646
+ layout: a,
1647
+ separatorToPanels: f
1648
+ }), e.separators.forEach((d) => {
1649
+ L(
1650
+ !r.has(d.id),
1651
+ `Separator ids must be unique; id "${d.id}" was used more than once`
1652
+ ), r.add(d.id), d.element.addEventListener("keydown", We);
1653
+ }), re.get(l) === 1 && (l.addEventListener("contextmenu", He, !0), l.addEventListener("dblclick", Ue, !0), l.addEventListener("pointerdown", Ke, !0), l.addEventListener("pointerleave", qe), l.addEventListener("pointermove", Xe), l.addEventListener("pointerout", Ye), l.addEventListener("pointerup", Je, !0)), function() {
1639
1654
  t = !1, re.set(
1640
- d,
1641
- Math.max(0, (re.get(d) ?? 0) - 1)
1642
- ), jt(e), Dt(e) && fe(d), e.separators.forEach((h) => {
1643
- h.element.removeEventListener("keydown", Ue);
1644
- }), re.get(d) || (d.removeEventListener(
1655
+ l,
1656
+ Math.max(0, (re.get(l) ?? 0) - 1)
1657
+ ), Vt(e), Gt(e) && fe(l), e.separators.forEach((p) => {
1658
+ p.element.removeEventListener("keydown", We);
1659
+ }), re.get(l) || (l.removeEventListener(
1645
1660
  "contextmenu",
1646
- $e,
1661
+ He,
1647
1662
  !0
1648
- ), d.removeEventListener(
1663
+ ), l.removeEventListener(
1649
1664
  "dblclick",
1650
- Be,
1665
+ Ue,
1651
1666
  !0
1652
- ), d.removeEventListener(
1667
+ ), l.removeEventListener(
1653
1668
  "pointerdown",
1654
- We,
1669
+ Ke,
1655
1670
  !0
1656
- ), d.removeEventListener("pointerleave", Ke), d.removeEventListener("pointermove", qe), d.removeEventListener("pointerout", Xe), d.removeEventListener("pointerup", Ye, !0)), i.disconnect();
1671
+ ), l.removeEventListener("pointerleave", qe), l.removeEventListener("pointermove", Xe), l.removeEventListener("pointerout", Ye), l.removeEventListener("pointerup", Je, !0)), s.disconnect();
1657
1672
  };
1658
1673
  }
1659
- function on() {
1674
+ function sn() {
1660
1675
  const [e, t] = Z({}), n = ce(() => t({}), []);
1661
1676
  return [e, n];
1662
1677
  }
1663
1678
  function Te(e) {
1664
- const t = wt();
1679
+ const t = Pt();
1665
1680
  return `${e ?? t}`;
1666
1681
  }
1667
- const j = typeof window < "u" ? Ze : Se;
1682
+ const V = typeof window < "u" ? Qe : Se;
1668
1683
  function ue(e) {
1669
- const t = D(e);
1670
- return j(() => {
1684
+ const t = O(e);
1685
+ return V(() => {
1671
1686
  t.current = e;
1672
1687
  }, [e]), ce(
1673
1688
  (...n) => t.current?.(...n),
1674
1689
  [t]
1675
1690
  );
1676
1691
  }
1677
- function Oe(...e) {
1692
+ function De(...e) {
1678
1693
  return ue((t) => {
1679
1694
  e.forEach((n) => {
1680
1695
  if (n)
@@ -1691,33 +1706,33 @@ function Oe(...e) {
1691
1706
  });
1692
1707
  });
1693
1708
  }
1694
- function De(e) {
1695
- const t = D({ ...e });
1696
- return j(() => {
1709
+ function Oe(e) {
1710
+ const t = O({ ...e });
1711
+ return V(() => {
1697
1712
  for (const n in e)
1698
1713
  t.current[n] = e[n];
1699
1714
  }, [e]), t.current;
1700
1715
  }
1701
- const gt = Pt(null);
1702
- function rn({
1716
+ const yt = Lt(null);
1717
+ function an({
1703
1718
  separator: e
1704
1719
  }) {
1705
- const { element: t } = e, n = D(null);
1706
- return j(() => {
1707
- const o = t.cloneNode(!0), r = [t, ...t.querySelectorAll("*")], i = [o, ...o.querySelectorAll("*")], c = t.ownerDocument.defaultView;
1708
- return r.forEach((l, a) => {
1709
- const s = i[a];
1710
- if (s instanceof c.HTMLElement || s instanceof c.SVGElement) {
1711
- const u = c.getComputedStyle(l);
1712
- for (let f = 0; f < u.length; f++) {
1713
- const d = u.item(f);
1714
- s.style.setProperty(
1715
- d,
1716
- u.getPropertyValue(d)
1720
+ const { element: t } = e, n = O(null);
1721
+ return V(() => {
1722
+ const o = t.cloneNode(!0), r = [t, ...t.querySelectorAll("*")], s = [o, ...o.querySelectorAll("*")], i = t.ownerDocument.defaultView;
1723
+ return r.forEach((u, c) => {
1724
+ const a = s[c];
1725
+ if (a instanceof i.HTMLElement || a instanceof i.SVGElement) {
1726
+ const l = i.getComputedStyle(u);
1727
+ for (let f = 0; f < l.length; f++) {
1728
+ const y = l.item(f);
1729
+ a.style.setProperty(
1730
+ y,
1731
+ l.getPropertyValue(y)
1717
1732
  );
1718
1733
  }
1719
1734
  }
1720
- s.removeAttribute("data-testid"), s.removeAttribute("id");
1735
+ a.removeAttribute("data-testid"), a.removeAttribute("id");
1721
1736
  }), Object.assign(o.style, {
1722
1737
  boxSizing: "border-box",
1723
1738
  height: "100%",
@@ -1726,7 +1741,7 @@ function rn({
1726
1741
  transform: "none",
1727
1742
  width: "100%"
1728
1743
  }), n.current.appendChild(o), () => o.remove();
1729
- }, [t]), /* @__PURE__ */ B(
1744
+ }, [t]), /* @__PURE__ */ U(
1730
1745
  "div",
1731
1746
  {
1732
1747
  ref: n,
@@ -1740,23 +1755,23 @@ function rn({
1740
1755
  );
1741
1756
  }
1742
1757
  function be() {
1743
- const e = Lt(gt);
1744
- return R(
1758
+ const e = Ct(yt);
1759
+ return L(
1745
1760
  e,
1746
1761
  "Group Context not found; did you render a Panel or Separator outside of a Group?"
1747
1762
  ), e;
1748
1763
  }
1749
- function yt(e) {
1750
- const { registerOverlay: t } = be(), n = D(e);
1751
- mt(n.current, e) || (n.current = e);
1764
+ function vt(e) {
1765
+ const { registerOverlay: t } = be(), n = O(e);
1766
+ gt(n.current, e) || (n.current = e);
1752
1767
  const o = n.current;
1753
- return j(
1768
+ return V(
1754
1769
  () => t(o),
1755
1770
  [t, o]
1756
1771
  ), null;
1757
1772
  }
1758
- yt.displayName = "SeparatorOverlay";
1759
- function sn({
1773
+ vt.displayName = "SeparatorOverlay";
1774
+ function ln({
1760
1775
  active: e,
1761
1776
  orientation: t,
1762
1777
  style: n,
@@ -1779,7 +1794,7 @@ function sn({
1779
1794
  break;
1780
1795
  }
1781
1796
  }
1782
- return /* @__PURE__ */ B(
1797
+ return /* @__PURE__ */ U(
1783
1798
  "div",
1784
1799
  {
1785
1800
  ...o,
@@ -1793,20 +1808,20 @@ function sn({
1793
1808
  }
1794
1809
  );
1795
1810
  }
1796
- function an({
1811
+ function cn({
1797
1812
  overlay: e,
1798
1813
  preview: t
1799
1814
  }) {
1800
- const { group: n, offset: o, rect: r, separator: i } = t, c = n.orientation === "horizontal";
1801
- let l = i?.preview, a = e;
1802
- return Ct(l) && l.type === yt && (a = l.props, l = void 0), l == null && (a ? l = /* @__PURE__ */ B(
1803
- sn,
1815
+ const { group: n, offset: o, rect: r, separator: s } = t, i = n.orientation === "horizontal";
1816
+ let u = s?.preview, c = e;
1817
+ return Rt(u) && u.type === vt && (c = u.props, u = void 0), u == null && (c ? u = /* @__PURE__ */ U(
1818
+ ln,
1804
1819
  {
1805
- ...a,
1820
+ ...c,
1806
1821
  active: t.active,
1807
1822
  orientation: n.orientation
1808
1823
  }
1809
- ) : i && (l = /* @__PURE__ */ B(rn, { separator: i }))), /* @__PURE__ */ B(
1824
+ ) : s && (u = /* @__PURE__ */ U(an, { separator: s }))), /* @__PURE__ */ U(
1810
1825
  "div",
1811
1826
  {
1812
1827
  "aria-hidden": "true",
@@ -1818,260 +1833,262 @@ function an({
1818
1833
  pointerEvents: "none",
1819
1834
  position: "absolute",
1820
1835
  top: r.top,
1821
- transform: c ? `translateX(${o}px)` : `translateY(${o}px)`,
1836
+ transform: i ? `translateX(${o}px)` : `translateY(${o}px)`,
1822
1837
  width: r.width
1823
1838
  },
1824
- children: l
1839
+ children: u
1825
1840
  }
1826
1841
  );
1827
1842
  }
1828
- function ln(e, t) {
1829
- const n = D({
1843
+ function un(e, t) {
1844
+ const n = O({
1830
1845
  getLayout: () => ({}),
1831
1846
  setLayout: At
1832
1847
  });
1833
- Qe(t, () => n.current, []), j(() => {
1848
+ et(t, () => n.current, []), V(() => {
1834
1849
  Object.assign(
1835
1850
  n.current,
1836
- ht({ groupId: e })
1851
+ mt({ groupId: e })
1837
1852
  );
1838
1853
  });
1839
1854
  }
1840
- function cn({
1855
+ function fn({
1841
1856
  groupId: e,
1842
1857
  resizePreviewMode: t
1843
1858
  }) {
1844
- const [n, o] = Z([]), r = D(n);
1845
- return j(() => {
1846
- const i = (l) => {
1847
- const a = ut(e), s = t === "separator" && l.state === "active" ? l.previews.filter(
1848
- (f) => f.group === a && (f.active || !O(f.offset, 0))
1849
- ) : [], u = r.current;
1850
- u.length === s.length && s.every(
1851
- (f, d) => f === u[d]
1852
- ) || (r.current = s, o(s));
1859
+ const [n, o] = Z([]), r = O(n);
1860
+ return V(() => {
1861
+ const s = (u) => {
1862
+ const c = ft(e), a = t === "separator" && u.state === "active" ? u.previews.filter(
1863
+ (f) => f.group === c && (f.active || !D(f.offset, 0))
1864
+ ) : [], l = r.current;
1865
+ l.length === a.length && a.every(
1866
+ (f, y) => f === l[y]
1867
+ ) || (r.current = a, o(a));
1853
1868
  };
1854
1869
  if (t !== "separator") {
1855
- i(X());
1870
+ s(X());
1856
1871
  return;
1857
1872
  }
1858
- const c = nt(
1859
- ({ next: l }) => i(l)
1873
+ const i = ot(
1874
+ ({ next: u }) => s(u)
1860
1875
  );
1861
- return i(X()), c;
1876
+ return s(X()), i;
1862
1877
  }, [e, t]), n;
1863
1878
  }
1864
- function un({
1879
+ function dn({
1865
1880
  children: e,
1866
1881
  className: t,
1867
1882
  defaultLayout: n,
1868
1883
  disableCursor: o,
1869
1884
  disabled: r,
1870
- elementRef: i,
1871
- groupRef: c,
1872
- id: l,
1873
- onLayoutChange: a,
1874
- onLayoutChanged: s,
1875
- orientation: u = "horizontal",
1885
+ elementRef: s,
1886
+ groupRef: i,
1887
+ id: u,
1888
+ onLayoutChange: c,
1889
+ onLayoutChanged: a,
1890
+ orientation: l = "horizontal",
1876
1891
  resizePreviewMode: f = "panel",
1877
- resizeTargetMinimumSize: d = {
1892
+ resizeTargetMinimumSize: y = {
1878
1893
  coarse: 20,
1879
1894
  fine: 10
1880
1895
  },
1881
- style: v,
1882
- ...z
1896
+ style: d,
1897
+ ...p
1883
1898
  }) {
1884
- const p = D({
1899
+ const h = O({
1885
1900
  onLayoutChange: {},
1886
1901
  onLayoutChanged: {}
1887
- }), h = ue((S) => {
1888
- W(p.current.onLayoutChange, S) || (p.current.onLayoutChange = S, a?.(S));
1889
- }), g = ue(
1902
+ }), v = ue((S) => {
1903
+ K(h.current.onLayoutChange, S) || (h.current.onLayoutChange = S, c?.(S));
1904
+ }), m = ue(
1890
1905
  (S, P) => {
1891
- W(p.current.onLayoutChanged, S) || (p.current.onLayoutChanged = S, s?.(S, { isUserInteraction: P }));
1906
+ K(h.current.onLayoutChanged, S) || (h.current.onLayoutChanged = S, a?.(S, { isUserInteraction: P }));
1892
1907
  }
1893
- ), y = Te(l), [m, b] = Z(), x = cn({
1894
- groupId: y,
1908
+ ), g = Te(u), [x, b] = Z(), z = fn({
1909
+ groupId: g,
1895
1910
  resizePreviewMode: f
1896
- }), L = D(null), [w, C] = on(), M = D({
1911
+ }), E = O(null), [R, w] = sn(), C = O({
1897
1912
  lastExpandedPanelSizes: {},
1898
1913
  layouts: {},
1899
1914
  panels: [],
1900
- resizeTargetMinimumSize: d,
1901
1915
  separators: []
1902
- }), T = Oe(L, i);
1903
- ln(y, c);
1904
- const G = ue(
1916
+ }), F = De(E, s);
1917
+ un(g, i);
1918
+ const I = ue(
1905
1919
  (S, P) => {
1906
- const I = Q(S);
1907
- if (I)
1920
+ const k = Q(S);
1921
+ if (k)
1908
1922
  return {
1909
- flexGrow: I.layout[P] ?? 1
1923
+ flexGrow: k.layout[P] ?? 1
1910
1924
  };
1911
1925
  if (n?.[P])
1912
1926
  return {
1913
1927
  flexGrow: n?.[P]
1914
1928
  };
1915
1929
  }
1916
- ), E = De({
1930
+ ), M = Oe({
1917
1931
  defaultLayout: n,
1918
- disableCursor: o
1932
+ disableCursor: o,
1933
+ resizeTargetMinimumSize: y
1919
1934
  }), N = Pe(
1920
1935
  () => ({
1921
1936
  get disableCursor() {
1922
- return !!E.disableCursor;
1937
+ return !!M.disableCursor;
1923
1938
  },
1924
- getPanelStyles: G,
1925
- id: y,
1926
- orientation: u,
1939
+ getPanelStyles: I,
1940
+ id: g,
1941
+ orientation: l,
1927
1942
  registerPanel: (S) => {
1928
- const P = M.current;
1929
- return P.panels = Ce(u, [
1943
+ const P = C.current;
1944
+ return P.panels = Ce(l, [
1930
1945
  ...P.panels,
1931
1946
  S
1932
- ]), C(), () => {
1947
+ ]), w(), () => {
1933
1948
  P.panels = P.panels.filter(
1934
- (I) => I !== S
1935
- ), C();
1949
+ (k) => k !== S
1950
+ ), w();
1936
1951
  };
1937
1952
  },
1938
1953
  registerOverlay: (S) => (b(S), () => {
1939
1954
  b(void 0);
1940
1955
  }),
1941
1956
  registerSeparator: (S) => {
1942
- const P = M.current;
1943
- return P.separators = Ce(u, [
1957
+ const P = C.current;
1958
+ return P.separators = Ce(l, [
1944
1959
  ...P.separators,
1945
1960
  S
1946
- ]), C(), () => {
1961
+ ]), w(), () => {
1947
1962
  P.separators = P.separators.filter(
1948
- (I) => I !== S
1949
- ), C();
1963
+ (k) => k !== S
1964
+ ), w();
1950
1965
  };
1951
1966
  },
1952
1967
  updatePanelProps: (S, { disabled: P }) => {
1953
- const F = M.current.panels.find(
1968
+ const G = C.current.panels.find(
1954
1969
  (oe) => oe.id === S
1955
1970
  );
1956
- F && (F.panelConstraints.disabled = P);
1957
- const $ = ut(y), Y = Q(y);
1958
- $ && Y && K($, {
1971
+ G && (G.panelConstraints.disabled = P);
1972
+ const $ = ft(g), Y = Q(g);
1973
+ $ && Y && q($, {
1959
1974
  ...Y,
1960
1975
  derivedPanelConstraints: Le($)
1961
1976
  });
1962
1977
  },
1963
1978
  updateSeparatorProps: (S, {
1964
1979
  disabled: P,
1965
- disableDoubleClick: I
1980
+ disableDoubleClick: k
1966
1981
  }) => {
1967
- const $ = M.current.separators.find(
1982
+ const $ = C.current.separators.find(
1968
1983
  (Y) => Y.id === S
1969
1984
  );
1970
- $ && ($.disabled = P, $.disableDoubleClick = I);
1985
+ $ && ($.disabled = P, $.disableDoubleClick = k);
1971
1986
  }
1972
1987
  }),
1973
- [G, y, C, u, E]
1974
- ), _ = D(null);
1975
- return j(() => {
1976
- const S = L.current;
1988
+ [I, g, w, l, M]
1989
+ ), _ = O(null);
1990
+ return V(() => {
1991
+ const S = E.current;
1977
1992
  if (S === null)
1978
1993
  return;
1979
- const P = M.current;
1980
- let I;
1981
- if (E.defaultLayout !== void 0 && Object.keys(E.defaultLayout).length === P.panels.length) {
1982
- I = {};
1994
+ const P = C.current;
1995
+ let k;
1996
+ if (M.defaultLayout !== void 0 && Object.keys(M.defaultLayout).length === P.panels.length) {
1997
+ k = {};
1983
1998
  for (const J of P.panels) {
1984
- const pe = E.defaultLayout[J.id];
1985
- pe !== void 0 && (I[J.id] = pe);
1999
+ const pe = M.defaultLayout[J.id];
2000
+ pe !== void 0 && (k[J.id] = pe);
1986
2001
  }
1987
2002
  }
1988
- const F = {
2003
+ const G = {
1989
2004
  disabled: !!r,
1990
2005
  element: S,
1991
- id: y,
2006
+ id: g,
1992
2007
  mutableState: {
1993
- defaultLayout: I,
1994
- disableCursor: !!E.disableCursor,
1995
- expandedPanelSizes: M.current.lastExpandedPanelSizes,
1996
- layouts: M.current.layouts
2008
+ defaultLayout: k,
2009
+ disableCursor: !!M.disableCursor,
2010
+ expandedPanelSizes: C.current.lastExpandedPanelSizes,
2011
+ layouts: C.current.layouts
1997
2012
  },
1998
- orientation: u,
2013
+ orientation: l,
1999
2014
  panels: P.panels,
2000
2015
  resizePreviewMode: f,
2001
- resizeTargetMinimumSize: P.resizeTargetMinimumSize,
2016
+ get resizeTargetMinimumSize() {
2017
+ return M.resizeTargetMinimumSize;
2018
+ },
2002
2019
  separators: P.separators
2003
2020
  };
2004
- _.current = F;
2005
- const $ = nn(F), { defaultLayoutDeferred: Y, derivedPanelConstraints: oe, layout: le } = Q(F.id, !0);
2006
- !Y && oe.length > 0 && (h(le), g(le, !1));
2007
- const xe = Ee(y, (J) => {
2008
- const { defaultLayoutDeferred: pe, derivedPanelConstraints: Ae, layout: he } = J.next;
2009
- if (pe || Ae.length === 0)
2021
+ _.current = G;
2022
+ const $ = rn(G), { defaultLayoutDeferred: Y, derivedPanelConstraints: oe, layout: le } = Q(G.id, !0);
2023
+ !Y && oe.length > 0 && (v(le), m(le, !1));
2024
+ const xe = Ee(g, (J) => {
2025
+ const { defaultLayoutDeferred: pe, derivedPanelConstraints: Ge, layout: he } = J.next;
2026
+ if (pe || Ge.length === 0)
2010
2027
  return;
2011
- const vt = F.panels.map(({ id: q }) => q).join(",");
2012
- F.mutableState.layouts[vt] = he, Ae.forEach((q) => {
2013
- if (q.collapsible) {
2028
+ const St = G.panels.map(({ id: H }) => H).join(",");
2029
+ G.mutableState.layouts[St] = he, Ge.forEach((H) => {
2030
+ if (H.collapsible) {
2014
2031
  const { layout: ze } = J.prev ?? {};
2015
2032
  if (ze) {
2016
- const bt = O(
2017
- q.collapsedSize,
2018
- he[q.panelId]
2019
- ), xt = O(
2020
- q.collapsedSize,
2021
- ze[q.panelId]
2033
+ const xt = D(
2034
+ H.collapsedSize,
2035
+ he[H.panelId]
2036
+ ), zt = D(
2037
+ H.collapsedSize,
2038
+ ze[H.panelId]
2022
2039
  );
2023
- bt && !xt && (F.mutableState.expandedPanelSizes[q.panelId] = ze[q.panelId]);
2040
+ xt && !zt && (G.mutableState.expandedPanelSizes[H.panelId] = ze[H.panelId]);
2024
2041
  }
2025
2042
  }
2026
2043
  });
2027
- const St = X().state !== "active";
2028
- h(he), St && g(he, J.isUserInteraction);
2044
+ const Ae = X(), bt = Ae.state !== "active" || !Ae.hitRegions.some((H) => H.group === G);
2045
+ v(he), bt && m(he, J.isUserInteraction);
2029
2046
  });
2030
2047
  return () => {
2031
2048
  _.current = null, $(), xe();
2032
2049
  };
2033
2050
  }, [
2034
2051
  r,
2035
- y,
2036
2052
  g,
2037
- h,
2038
- u,
2039
- w,
2053
+ m,
2054
+ v,
2055
+ l,
2056
+ R,
2040
2057
  f,
2041
- E
2058
+ M
2042
2059
  ]), Se(() => {
2043
2060
  const S = _.current;
2044
2061
  S && (S.mutableState.defaultLayout = n, S.mutableState.disableCursor = !!o);
2045
- }), /* @__PURE__ */ B(gt.Provider, { value: N, children: /* @__PURE__ */ zt(
2062
+ }), /* @__PURE__ */ U(yt.Provider, { value: N, children: /* @__PURE__ */ wt(
2046
2063
  "div",
2047
2064
  {
2048
- ...z,
2065
+ ...p,
2049
2066
  className: t,
2050
2067
  "data-group": !0,
2051
- "data-testid": y,
2052
- id: y,
2053
- ref: T,
2068
+ "data-testid": g,
2069
+ id: g,
2070
+ ref: F,
2054
2071
  style: {
2055
2072
  height: "100%",
2056
2073
  width: "100%",
2057
2074
  overflow: "hidden",
2058
2075
  position: f === "separator" ? "relative" : void 0,
2059
- ...v,
2076
+ ...d,
2060
2077
  display: "flex",
2061
- flexDirection: u === "horizontal" ? "row" : "column",
2078
+ flexDirection: l === "horizontal" ? "row" : "column",
2062
2079
  flexWrap: "nowrap",
2063
2080
  // Inform the browser that the library is handling touch events for this element
2064
2081
  // but still allow users to scroll content within panels in the non-resizing direction
2065
2082
  // NOTE This is not an inherited style
2066
2083
  // See github.com/bvaughn/react-resizable-panels/issues/662
2067
- touchAction: u === "horizontal" ? "pan-y" : "pan-x"
2084
+ touchAction: l === "horizontal" ? "pan-y" : "pan-x"
2068
2085
  },
2069
2086
  children: [
2070
2087
  e,
2071
- x.map((S) => /* @__PURE__ */ B(
2072
- an,
2088
+ z.map((S) => /* @__PURE__ */ U(
2089
+ cn,
2073
2090
  {
2074
- overlay: m,
2091
+ overlay: x,
2075
2092
  preview: S
2076
2093
  },
2077
2094
  S.key
@@ -2080,11 +2097,11 @@ function un({
2080
2097
  }
2081
2098
  ) });
2082
2099
  }
2083
- un.displayName = "Group";
2100
+ dn.displayName = "Group";
2084
2101
  function ve(e, t) {
2085
2102
  return `react-resizable-panels:${[e, ...t].join(":")}`;
2086
2103
  }
2087
- function fn({
2104
+ function pn({
2088
2105
  id: e,
2089
2106
  panelIds: t,
2090
2107
  storage: n
@@ -2092,26 +2109,26 @@ function fn({
2092
2109
  const o = ve(e, []), r = n.getItem(o);
2093
2110
  if (r)
2094
2111
  try {
2095
- const i = JSON.parse(r);
2112
+ const s = JSON.parse(r);
2096
2113
  if (t) {
2097
- const c = t.join(","), l = i[c];
2098
- if (l && Array.isArray(l.layout) && t.length === l.layout.length) {
2099
- const a = {};
2100
- for (let s = 0; s < t.length; s++)
2101
- a[t[s]] = l.layout[s];
2102
- return a;
2114
+ const i = t.join(","), u = s[i];
2115
+ if (u && Array.isArray(u.layout) && t.length === u.layout.length) {
2116
+ const c = {};
2117
+ for (let a = 0; a < t.length; a++)
2118
+ c[t[a]] = u.layout[a];
2119
+ return c;
2103
2120
  }
2104
2121
  } else {
2105
- const c = Object.keys(i);
2106
- if (c.length === 1) {
2107
- const l = i[c[0]];
2108
- if (l && Array.isArray(l.layout)) {
2109
- const a = c[0].split(",");
2110
- if (a.length === l.layout.length) {
2111
- const s = {};
2112
- for (let u = 0; u < a.length; u++)
2113
- s[a[u]] = l.layout[u];
2114
- return s;
2122
+ const i = Object.keys(s);
2123
+ if (i.length === 1) {
2124
+ const u = s[i[0]];
2125
+ if (u && Array.isArray(u.layout)) {
2126
+ const c = i[0].split(",");
2127
+ if (c.length === u.layout.length) {
2128
+ const a = {};
2129
+ for (let l = 0; l < c.length; l++)
2130
+ a[c[l]] = u.layout[l];
2131
+ return a;
2115
2132
  }
2116
2133
  }
2117
2134
  }
@@ -2119,69 +2136,69 @@ function fn({
2119
2136
  } catch {
2120
2137
  }
2121
2138
  }
2122
- function xn({
2139
+ function zn({
2123
2140
  debounceSaveMs: e = 100,
2124
2141
  onlySaveAfterUserInteractions: t,
2125
2142
  panelIds: n,
2126
2143
  storage: o = localStorage,
2127
2144
  ...r
2128
2145
  }) {
2129
- const i = n !== void 0, c = "id" in r ? r.id : r.groupId, l = ve(c, n ?? []), a = et(
2130
- dn,
2131
- () => o.getItem(l),
2132
- () => o.getItem(l)
2133
- ), s = Pe(() => {
2134
- if (a) {
2135
- const h = JSON.parse(a), g = Object.values(h);
2136
- if (Array.from(g).every((y) => typeof y == "number"))
2137
- return h;
2146
+ const s = n !== void 0, i = "id" in r ? r.id : r.groupId, u = ve(i, n ?? []), c = tt(
2147
+ hn,
2148
+ () => o.getItem(u),
2149
+ () => o.getItem(u)
2150
+ ), a = Pe(() => {
2151
+ if (c) {
2152
+ const v = JSON.parse(c), m = Object.values(v);
2153
+ if (Array.from(m).every((g) => typeof g == "number"))
2154
+ return v;
2138
2155
  }
2139
- }, [a]), u = Pe(() => {
2140
- if (!s)
2141
- return fn({
2142
- id: c,
2156
+ }, [c]), l = Pe(() => {
2157
+ if (!a)
2158
+ return pn({
2159
+ id: i,
2143
2160
  panelIds: n,
2144
2161
  storage: o
2145
2162
  });
2146
- }, [s, c, n, o]), f = s ?? u, d = D(null), v = ce(() => {
2147
- const h = d.current;
2148
- h && (d.current = null, clearTimeout(h));
2163
+ }, [a, i, n, o]), f = a ?? l, y = O(null), d = ce(() => {
2164
+ const v = y.current;
2165
+ v && (y.current = null, clearTimeout(v));
2149
2166
  }, []);
2150
- Ze(() => () => {
2151
- v();
2152
- }, [v]);
2153
- const z = ce(
2167
+ Qe(() => () => {
2168
+ d();
2169
+ }, [d]);
2170
+ const p = ce(
2154
2171
  // The hook persists every layout commit -- including library-driven ones --
2155
2172
  // because it owns its own storage and the goal is to remember whatever
2156
2173
  // layout the user is currently looking at. Consumers that only want to
2157
2174
  // persist on user interaction should branch on `isUserInteraction` in
2158
2175
  // their own callback (see #716) rather than via this hook.
2159
- (h, g) => {
2160
- if (t && !g.isUserInteraction)
2176
+ (v, m) => {
2177
+ if (t && !m.isUserInteraction)
2161
2178
  return;
2162
- v();
2163
- let y;
2164
- i ? y = ve(c, Object.keys(h)) : y = ve(c, []);
2179
+ d();
2180
+ let g;
2181
+ s ? g = ve(i, Object.keys(v)) : g = ve(i, []);
2165
2182
  try {
2166
- o.setItem(y, JSON.stringify(h));
2167
- } catch (m) {
2168
- console.error(m);
2183
+ o.setItem(g, JSON.stringify(v));
2184
+ } catch (x) {
2185
+ console.error(x);
2169
2186
  }
2170
2187
  },
2171
2188
  [
2172
- v,
2189
+ d,
2190
+ s,
2173
2191
  i,
2174
- c,
2175
2192
  t,
2176
2193
  o
2177
2194
  ]
2178
- ), p = ce(
2179
- (h) => {
2180
- v(), e === 0 ? z(h, { isUserInteraction: !1 }) : d.current = setTimeout(() => {
2181
- z(h, { isUserInteraction: !1 });
2195
+ ), h = ce(
2196
+ (v) => {
2197
+ d(), e === 0 ? p(v, { isUserInteraction: !1 }) : y.current = setTimeout(() => {
2198
+ p(v, { isUserInteraction: !1 });
2182
2199
  }, e);
2183
2200
  },
2184
- [v, e, z]
2201
+ [d, e, p]
2185
2202
  );
2186
2203
  return {
2187
2204
  /**
@@ -2193,25 +2210,25 @@ function xn({
2193
2210
  *
2194
2211
  * @deprecated Use the {@link onLayoutChanged} prop instead.
2195
2212
  */
2196
- onLayoutChange: p,
2213
+ onLayoutChange: h,
2197
2214
  /**
2198
2215
  * Attach this callback on the `Group` as the `onLayoutChanged` prop.
2199
2216
  */
2200
- onLayoutChanged: z
2217
+ onLayoutChanged: p
2201
2218
  };
2202
2219
  }
2203
- function dn() {
2220
+ function hn() {
2204
2221
  return function() {
2205
2222
  };
2206
2223
  }
2207
- function zn() {
2224
+ function wn() {
2208
2225
  return Z(null);
2209
2226
  }
2210
- function wn() {
2211
- return D(null);
2227
+ function Pn() {
2228
+ return O(null);
2212
2229
  }
2213
- function pn(e, t) {
2214
- const { id: n } = be(), o = D({
2230
+ function mn(e, t) {
2231
+ const { id: n } = be(), o = O({
2215
2232
  collapse: we,
2216
2233
  expand: we,
2217
2234
  getSize: () => ({
@@ -2221,118 +2238,118 @@ function pn(e, t) {
2221
2238
  isCollapsed: () => !1,
2222
2239
  resize: we
2223
2240
  });
2224
- Qe(t, () => o.current, []), j(() => {
2241
+ et(t, () => o.current, []), V(() => {
2225
2242
  Object.assign(
2226
2243
  o.current,
2227
- pt({ groupId: n, panelId: e })
2244
+ ht({ groupId: n, panelId: e })
2228
2245
  );
2229
2246
  });
2230
2247
  }
2231
- function hn({
2248
+ function gn({
2232
2249
  children: e,
2233
2250
  className: t,
2234
2251
  collapsedSize: n = "0%",
2235
2252
  collapsedThreshold: o,
2236
2253
  collapsible: r = !1,
2237
- defaultSize: i,
2238
- disabled: c,
2239
- elementRef: l,
2240
- groupResizeBehavior: a = "preserve-relative-size",
2241
- id: s,
2242
- maxSize: u = "100%",
2254
+ defaultSize: s,
2255
+ disabled: i,
2256
+ elementRef: u,
2257
+ groupResizeBehavior: c = "preserve-relative-size",
2258
+ id: a,
2259
+ maxSize: l = "100%",
2243
2260
  minSize: f = "0%",
2244
- onResize: d,
2245
- panelRef: v,
2246
- style: z,
2247
- ...p
2261
+ onResize: y,
2262
+ panelRef: d,
2263
+ style: p,
2264
+ ...h
2248
2265
  }) {
2249
- const h = !!s, g = Te(s), y = De({
2250
- disabled: c
2251
- }), m = D(null), b = Oe(m, l), {
2252
- getPanelStyles: x,
2253
- id: L,
2254
- orientation: w,
2255
- registerPanel: C,
2256
- updatePanelProps: M
2257
- } = be(), T = d !== null, G = ue(
2258
- (S, P, I) => {
2259
- d?.(S, s, I);
2266
+ const v = !!a, m = Te(a), g = Oe({
2267
+ disabled: i
2268
+ }), x = O(null), b = De(x, u), {
2269
+ getPanelStyles: z,
2270
+ id: E,
2271
+ orientation: R,
2272
+ registerPanel: w,
2273
+ updatePanelProps: C
2274
+ } = be(), F = y !== null, I = ue(
2275
+ (S, P, k) => {
2276
+ y?.(S, a, k);
2260
2277
  }
2261
2278
  );
2262
- j(() => {
2263
- const S = m.current;
2279
+ V(() => {
2280
+ const S = x.current;
2264
2281
  if (S !== null) {
2265
2282
  const P = {
2266
2283
  element: S,
2267
- id: g,
2268
- idIsStable: h,
2284
+ id: m,
2285
+ idIsStable: v,
2269
2286
  mutableValues: {
2270
2287
  expandToSize: void 0,
2271
2288
  prevSize: void 0
2272
2289
  },
2273
- onResize: T ? G : void 0,
2290
+ onResize: F ? I : void 0,
2274
2291
  panelConstraints: {
2275
- groupResizeBehavior: a,
2292
+ groupResizeBehavior: c,
2276
2293
  collapsedSize: n,
2277
2294
  collapsedThreshold: o,
2278
2295
  collapsible: r,
2279
- defaultSize: i,
2280
- disabled: y.disabled,
2281
- maxSize: u,
2296
+ defaultSize: s,
2297
+ disabled: g.disabled,
2298
+ maxSize: l,
2282
2299
  minSize: f
2283
2300
  }
2284
2301
  };
2285
- return C(P);
2302
+ return w(P);
2286
2303
  }
2287
2304
  }, [
2288
- a,
2305
+ c,
2289
2306
  n,
2290
2307
  o,
2291
2308
  r,
2292
- i,
2293
- T,
2294
- g,
2295
- h,
2296
- u,
2309
+ s,
2310
+ F,
2311
+ m,
2312
+ v,
2313
+ l,
2297
2314
  f,
2298
- G,
2299
- C,
2300
- y
2315
+ I,
2316
+ w,
2317
+ g
2301
2318
  ]), Se(() => {
2302
- M(g, { disabled: c });
2303
- }, [c, g, M]), pn(g, v);
2304
- const E = () => {
2305
- const S = x(L, g);
2319
+ C(m, { disabled: i });
2320
+ }, [i, m, C]), mn(m, d);
2321
+ const M = () => {
2322
+ const S = z(E, m);
2306
2323
  if (S)
2307
2324
  return JSON.stringify(S);
2308
- }, N = et(
2309
- (S) => Ee(L, S),
2310
- E,
2311
- E
2325
+ }, N = tt(
2326
+ (S) => Ee(E, S),
2327
+ M,
2328
+ M
2312
2329
  );
2313
2330
  let _;
2314
- return N ? _ = JSON.parse(N) : i !== void 0 ? _ = {
2331
+ return N ? _ = JSON.parse(N) : s !== void 0 ? _ = {
2315
2332
  flexGrow: void 0,
2316
2333
  flexShrink: void 0,
2317
- flexBasis: i
2318
- } : _ = { flexGrow: 1 }, /* @__PURE__ */ B(
2334
+ flexBasis: s
2335
+ } : _ = { flexGrow: 1 }, /* @__PURE__ */ U(
2319
2336
  "div",
2320
2337
  {
2321
- ...p,
2322
- "data-disabled": c || void 0,
2338
+ ...h,
2339
+ "data-disabled": i || void 0,
2323
2340
  "data-panel": !0,
2324
- "data-testid": g,
2325
- id: g,
2341
+ "data-testid": m,
2342
+ id: m,
2326
2343
  ref: b,
2327
2344
  style: {
2328
- ...mn,
2345
+ ...yn,
2329
2346
  display: "flex",
2330
2347
  flexBasis: 0,
2331
2348
  flexShrink: 1,
2332
2349
  overflow: "visible",
2333
2350
  ..._
2334
2351
  },
2335
- children: /* @__PURE__ */ B(
2352
+ children: /* @__PURE__ */ U(
2336
2353
  "div",
2337
2354
  {
2338
2355
  className: t,
@@ -2341,12 +2358,12 @@ function hn({
2341
2358
  maxWidth: "100%",
2342
2359
  flexGrow: 1,
2343
2360
  overflow: "auto",
2344
- ...z,
2361
+ ...p,
2345
2362
  // Inform the browser that the library is handling touch events for this element
2346
2363
  // but still allow users to scroll content within panels in the non-resizing direction
2347
2364
  // NOTE This is not an inherited style
2348
2365
  // See github.com/bvaughn/react-resizable-panels/issues/662
2349
- touchAction: w === "horizontal" ? "pan-y" : "pan-x"
2366
+ touchAction: R === "horizontal" ? "pan-y" : "pan-x"
2350
2367
  },
2351
2368
  children: e
2352
2369
  }
@@ -2354,8 +2371,8 @@ function hn({
2354
2371
  }
2355
2372
  );
2356
2373
  }
2357
- hn.displayName = "Panel";
2358
- const mn = {
2374
+ gn.displayName = "Panel";
2375
+ const yn = {
2359
2376
  minHeight: 0,
2360
2377
  maxHeight: "100%",
2361
2378
  height: "auto",
@@ -2367,39 +2384,39 @@ const mn = {
2367
2384
  padding: 0,
2368
2385
  margin: 0
2369
2386
  };
2370
- function Pn() {
2387
+ function Ln() {
2371
2388
  return Z(null);
2372
2389
  }
2373
- function Ln() {
2374
- return D(null);
2390
+ function Cn() {
2391
+ return O(null);
2375
2392
  }
2376
- function gn({
2393
+ function vn({
2377
2394
  layout: e,
2378
2395
  panelConstraints: t,
2379
2396
  panelId: n,
2380
2397
  panelIndex: o
2381
2398
  }) {
2382
- let r, i;
2383
- const c = e[n], l = t.find(
2384
- (a) => a.panelId === n
2399
+ let r, s;
2400
+ const i = e[n], u = t.find(
2401
+ (c) => c.panelId === n
2385
2402
  );
2386
- if (l) {
2387
- const a = l.maxSize, s = l.collapsible ? l.collapsedSize : l.minSize, u = [o, o + 1];
2388
- i = ne({
2403
+ if (u) {
2404
+ const c = u.maxSize, a = u.collapsible ? u.collapsedSize : u.minSize, l = [o, o + 1];
2405
+ s = ne({
2389
2406
  layout: de({
2390
- delta: s - c,
2407
+ delta: a - i,
2391
2408
  initialLayout: e,
2392
2409
  panelConstraints: t,
2393
- pivotIndices: u,
2410
+ pivotIndices: l,
2394
2411
  prevLayout: e
2395
2412
  }),
2396
2413
  panelConstraints: t
2397
2414
  })[n], r = ne({
2398
2415
  layout: de({
2399
- delta: a - c,
2416
+ delta: c - i,
2400
2417
  initialLayout: e,
2401
2418
  panelConstraints: t,
2402
- pivotIndices: u,
2419
+ pivotIndices: l,
2403
2420
  prevLayout: e
2404
2421
  }),
2405
2422
  panelConstraints: t
@@ -2408,77 +2425,77 @@ function gn({
2408
2425
  return {
2409
2426
  valueControls: n,
2410
2427
  valueMax: r,
2411
- valueMin: i,
2412
- valueNow: c
2428
+ valueMin: s,
2429
+ valueNow: i
2413
2430
  };
2414
2431
  }
2415
- function yn({
2432
+ function Sn({
2416
2433
  children: e,
2417
2434
  className: t,
2418
2435
  disabled: n,
2419
2436
  disableDoubleClick: o,
2420
2437
  elementRef: r,
2421
- id: i,
2422
- preview: c,
2423
- style: l,
2424
- ...a
2438
+ id: s,
2439
+ preview: i,
2440
+ style: u,
2441
+ ...c
2425
2442
  }) {
2426
- const s = Te(i), u = De({
2443
+ const a = Te(s), l = Oe({
2427
2444
  disabled: n,
2428
2445
  disableDoubleClick: o,
2429
2446
  children: e,
2430
2447
  className: t,
2431
- preview: c,
2432
- style: l
2433
- }), [f, d] = Z({}), [v, z] = Z("inactive"), [p, h] = Z(!1), g = D(null), y = D(null), m = Oe(g, r), {
2448
+ preview: i,
2449
+ style: u
2450
+ }), [f, y] = Z({}), [d, p] = Z("inactive"), [h, v] = Z(!1), m = O(null), g = O(null), x = De(m, r), {
2434
2451
  disableCursor: b,
2435
- id: x,
2436
- orientation: L,
2437
- registerSeparator: w,
2438
- updateSeparatorProps: C
2439
- } = be(), M = L === "horizontal" ? "vertical" : "horizontal";
2440
- j(() => {
2441
- const E = g.current;
2442
- if (E !== null) {
2452
+ id: z,
2453
+ orientation: E,
2454
+ registerSeparator: R,
2455
+ updateSeparatorProps: w
2456
+ } = be(), C = E === "horizontal" ? "vertical" : "horizontal";
2457
+ V(() => {
2458
+ const M = m.current;
2459
+ if (M !== null) {
2443
2460
  const N = {
2444
- disabled: u.disabled,
2445
- disableDoubleClick: u.disableDoubleClick,
2446
- element: E,
2447
- id: s,
2461
+ disabled: l.disabled,
2462
+ disableDoubleClick: l.disableDoubleClick,
2463
+ element: M,
2464
+ id: a,
2448
2465
  get children() {
2449
- return u.children;
2466
+ return l.children;
2450
2467
  },
2451
2468
  get className() {
2452
- return u.className;
2469
+ return l.className;
2453
2470
  },
2454
2471
  get preview() {
2455
- return u.preview;
2472
+ return l.preview;
2456
2473
  },
2457
2474
  get style() {
2458
- return u.style;
2475
+ return l.style;
2459
2476
  }
2460
2477
  };
2461
- y.current = N;
2462
- const _ = w(N), S = nt(
2463
- (I) => {
2464
- z(
2465
- I.next.state !== "inactive" && I.next.hitRegions.some(
2466
- (F) => F.separator === N
2467
- ) ? I.next.state : "inactive"
2478
+ g.current = N;
2479
+ const _ = R(N), S = ot(
2480
+ (k) => {
2481
+ p(
2482
+ k.next.state !== "inactive" && k.next.hitRegions.some(
2483
+ (G) => G.separator === N
2484
+ ) ? k.next.state : "inactive"
2468
2485
  );
2469
2486
  }
2470
2487
  ), P = Ee(
2471
- x,
2472
- (I) => {
2473
- const { derivedPanelConstraints: F, layout: $, separatorToPanels: Y } = I.next, oe = Y.get(N);
2488
+ z,
2489
+ (k) => {
2490
+ const { derivedPanelConstraints: G, layout: $, separatorToPanels: Y } = k.next, oe = Y.get(N);
2474
2491
  if (oe) {
2475
- const le = oe[0], xe = F.findIndex(
2492
+ const le = oe[0], xe = G.findIndex(
2476
2493
  (J) => J.panelId === le.id
2477
2494
  );
2478
- d(
2479
- gn({
2495
+ y(
2496
+ vn({
2480
2497
  layout: $,
2481
- panelConstraints: F,
2498
+ panelConstraints: G,
2482
2499
  panelId: le.id,
2483
2500
  panelIndex: xe
2484
2501
  })
@@ -2487,52 +2504,52 @@ function yn({
2487
2504
  }
2488
2505
  );
2489
2506
  return () => {
2490
- y.current = null, S(), P(), _();
2507
+ g.current = null, S(), P(), _();
2491
2508
  };
2492
2509
  }
2493
- }, [x, s, w, u]), j(() => {
2494
- const E = y.current;
2495
- E && Ot(E);
2496
- }, [c]), Se(() => {
2497
- C(s, { disabled: n, disableDoubleClick: o });
2498
- }, [n, o, s, C]);
2499
- let T;
2500
- n && !b && (T = "not-allowed");
2501
- let G;
2510
+ }, [z, a, R, l]), V(() => {
2511
+ const M = g.current;
2512
+ M && Ot(M);
2513
+ }, [i]), Se(() => {
2514
+ w(a, { disabled: n, disableDoubleClick: o });
2515
+ }, [n, o, a, w]);
2516
+ let F;
2517
+ n && !b && (F = "not-allowed");
2518
+ let I;
2502
2519
  if (n)
2503
- G = "disabled";
2520
+ I = "disabled";
2504
2521
  else
2505
- switch (v) {
2522
+ switch (d) {
2506
2523
  case "active": {
2507
- G = "active";
2524
+ I = "active";
2508
2525
  break;
2509
2526
  }
2510
2527
  default:
2511
- p ? G = "focus" : G = v;
2528
+ h ? I = "focus" : I = d;
2512
2529
  }
2513
- return /* @__PURE__ */ B(
2530
+ return /* @__PURE__ */ U(
2514
2531
  "div",
2515
2532
  {
2516
- ...a,
2533
+ ...c,
2517
2534
  "aria-controls": f.valueControls,
2518
2535
  "aria-disabled": n || void 0,
2519
- "aria-orientation": M,
2536
+ "aria-orientation": C,
2520
2537
  "aria-valuemax": f.valueMax,
2521
2538
  "aria-valuemin": f.valueMin,
2522
2539
  "aria-valuenow": f.valueNow,
2523
2540
  children: e,
2524
2541
  className: t,
2525
- "data-separator": G,
2526
- "data-testid": s,
2527
- id: s,
2528
- onBlur: () => h(!1),
2529
- onFocus: () => h(!0),
2530
- ref: m,
2542
+ "data-separator": I,
2543
+ "data-testid": a,
2544
+ id: a,
2545
+ onBlur: () => v(!1),
2546
+ onFocus: () => v(!0),
2547
+ ref: x,
2531
2548
  role: "separator",
2532
2549
  style: {
2533
2550
  flexBasis: "auto",
2534
- cursor: T,
2535
- ...l,
2551
+ cursor: F,
2552
+ ...u,
2536
2553
  flexGrow: 0,
2537
2554
  flexShrink: 0,
2538
2555
  // Inform the browser that the library is handling touch events for this element
@@ -2543,17 +2560,17 @@ function yn({
2543
2560
  }
2544
2561
  );
2545
2562
  }
2546
- yn.displayName = "Separator";
2563
+ Sn.displayName = "Separator";
2547
2564
  export {
2548
- un as Group,
2549
- hn as Panel,
2550
- yn as Separator,
2551
- yt as SeparatorOverlay,
2552
- $t as isCoarsePointer,
2553
- xn as useDefaultLayout,
2554
- zn as useGroupCallbackRef,
2555
- wn as useGroupRef,
2556
- Pn as usePanelCallbackRef,
2557
- Ln as usePanelRef
2565
+ dn as Group,
2566
+ gn as Panel,
2567
+ Sn as Separator,
2568
+ vt as SeparatorOverlay,
2569
+ Ht as isCoarsePointer,
2570
+ zn as useDefaultLayout,
2571
+ wn as useGroupCallbackRef,
2572
+ Pn as useGroupRef,
2573
+ Ln as usePanelCallbackRef,
2574
+ Cn as usePanelRef
2558
2575
  };
2559
2576
  //# sourceMappingURL=react-resizable-panels.js.map