react-resizable-panels 4.14.2 → 4.14.3

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,13 +1,13 @@
1
1
  "use client";
2
- import { jsx as K, jsxs as dn } from "react/jsx-runtime";
3
- import { useId as fn, useLayoutEffect as Nt, useEffect as Be, useRef as q, useCallback as re, createContext as Gt, useContext as _t, useState as pe, useMemo as Pe, useImperativeHandle as it, useSyncExternalStore as Xe, Children as mn, isValidElement as Ft } from "react";
4
- function $e(e) {
5
- const t = fn();
2
+ import { jsx as K, jsxs as hn } from "react/jsx-runtime";
3
+ import { useId as gn, useLayoutEffect as Bt, useEffect as Be, useRef as B, useCallback as re, createContext as qt, useContext as Vt, useState as pe, useMemo as Pe, useImperativeHandle as st, useSyncExternalStore as Xe, Children as yn, isValidElement as Ht } from "react";
4
+ function Te(e) {
5
+ const t = gn();
6
6
  return `${e ?? t}`;
7
7
  }
8
- const ne = typeof window < "u" ? Nt : Be;
9
- function he(e) {
10
- const t = q(e);
8
+ const ne = typeof window < "u" ? Bt : Be;
9
+ function ge(e) {
10
+ const t = B(e);
11
11
  return ne(() => {
12
12
  t.current = e;
13
13
  }, [e]), re(
@@ -15,8 +15,8 @@ function he(e) {
15
15
  [t]
16
16
  );
17
17
  }
18
- function Ve(...e) {
19
- return he((t) => {
18
+ function qe(...e) {
19
+ return ge((t) => {
20
20
  e.forEach((n) => {
21
21
  if (n)
22
22
  switch (typeof n) {
@@ -32,20 +32,20 @@ function Ve(...e) {
32
32
  });
33
33
  });
34
34
  }
35
- function tt(e, t) {
35
+ function nt(e, t) {
36
36
  return t ? e * 2 + 1 : e + 1;
37
37
  }
38
- function pn(e, t) {
38
+ function Sn(e, t) {
39
39
  return t ? e * 2 - 1 : e;
40
40
  }
41
- function pt(e, t, n) {
42
- const o = tt(e, n);
43
- return t === void 0 ? `${o} / -1` : `${o} / span ${pn(t, n)}`;
41
+ function ht(e, t, n) {
42
+ const o = nt(e, n);
43
+ return t === void 0 ? `${o} / -1` : `${o} / span ${Sn(t, n)}`;
44
44
  }
45
- function hn(e) {
45
+ function vn(e) {
46
46
  return `${e * 2} / span 1`;
47
47
  }
48
- function gn({
48
+ function bn({
49
49
  crossCount: e,
50
50
  crossSpan: t,
51
51
  crossStart: n,
@@ -54,25 +54,25 @@ function gn({
54
54
  const r = t === void 0 ? e : n + t;
55
55
  if (n === 0 && r === e)
56
56
  return "1 / -1";
57
- let i = tt(n, o), s = tt(r - 1, o) + 1;
57
+ let i = nt(n, o), s = nt(r - 1, o) + 1;
58
58
  return o && (n > 0 && i--, r < e && s++), `${i} / ${s}`;
59
59
  }
60
- function st(e, t) {
60
+ function at(e, t) {
61
61
  return Number.isInteger(e) && e >= 1 && e < t;
62
62
  }
63
- function T(e, t = "Assertion error") {
63
+ function D(e, t = "Assertion error") {
64
64
  if (!e)
65
65
  throw Error(t);
66
66
  }
67
- const qt = Gt(null);
68
- function Bt() {
69
- const e = _t(qt);
70
- return T(
67
+ const jt = qt(null);
68
+ function Ut() {
69
+ const e = Vt(jt);
70
+ return D(
71
71
  e,
72
72
  "Grid Context not found; did you render a Cell or Gridline outside of a Grid?"
73
73
  ), e;
74
74
  }
75
- function yn({
75
+ function xn({
76
76
  children: e,
77
77
  className: t,
78
78
  column: n,
@@ -84,11 +84,11 @@ function yn({
84
84
  style: a,
85
85
  ...c
86
86
  }) {
87
- const u = $e(i), { gutters: d, registerCell: g } = Bt(), m = q(null), y = Ve(m, r);
87
+ const u = Te(i), { gutters: d, registerCell: p } = Ut(), y = B(null), m = qe(y, r);
88
88
  return ne(() => {
89
- const f = m.current;
89
+ const f = y.current;
90
90
  if (f !== null)
91
- return g({
91
+ return p({
92
92
  column: n,
93
93
  columnSpan: o,
94
94
  element: f,
@@ -96,7 +96,7 @@ function yn({
96
96
  row: s,
97
97
  rowSpan: l
98
98
  });
99
- }, [n, o, u, g, s, l]), /* @__PURE__ */ K(
99
+ }, [n, o, u, p, s, l]), /* @__PURE__ */ K(
100
100
  "div",
101
101
  {
102
102
  ...c,
@@ -104,31 +104,31 @@ function yn({
104
104
  "data-cell": !0,
105
105
  "data-testid": u,
106
106
  id: u,
107
- ref: y,
107
+ ref: m,
108
108
  style: {
109
109
  overflow: "auto",
110
110
  ...a,
111
111
  // Allow cells to shrink smaller than their content
112
112
  minHeight: 0,
113
113
  minWidth: 0,
114
- gridColumn: pt(n, o, d.column),
115
- gridRow: pt(s, l, d.row)
114
+ gridColumn: ht(n, o, d.column),
115
+ gridRow: ht(s, l, d.row)
116
116
  },
117
117
  children: e
118
118
  }
119
119
  );
120
120
  }
121
- yn.displayName = "Cell";
121
+ xn.displayName = "Cell";
122
122
  let We;
123
- function Sn() {
123
+ function wn() {
124
124
  return We === void 0 && (typeof matchMedia == "function" ? We = !!matchMedia("(pointer:coarse)").matches : We = !1), We;
125
125
  }
126
- function nt({
126
+ function ot({
127
127
  expandHitTargets: e,
128
128
  axis: t,
129
129
  rect: n
130
130
  }) {
131
- const o = e ? Sn() ? t.resizeTargetMinimumSize.coarse : t.resizeTargetMinimumSize.fine : 0;
131
+ const o = e ? wn() ? t.resizeTargetMinimumSize.coarse : t.resizeTargetMinimumSize.fine : 0;
132
132
  if (n.width < o) {
133
133
  const r = o - n.width;
134
134
  n = new DOMRect(
@@ -149,7 +149,7 @@ function nt({
149
149
  }
150
150
  return n;
151
151
  }
152
- function ht({
152
+ function gt({
153
153
  axis: e,
154
154
  cells: t,
155
155
  index: n,
@@ -162,20 +162,20 @@ function ht({
162
162
  continue;
163
163
  const a = i.element.getBoundingClientRect(), c = e === "column" ? a.top : a.left, u = e === "column" ? a.bottom : a.right;
164
164
  u <= c || (r = r.flatMap((d) => {
165
- const g = e === "column" ? d.top : d.left, m = e === "column" ? d.bottom : d.right;
166
- if (c >= m || u <= g)
165
+ const p = e === "column" ? d.top : d.left, y = e === "column" ? d.bottom : d.right;
166
+ if (c >= y || u <= p)
167
167
  return [d];
168
- const y = [], f = (S, p) => {
169
- y.push(
170
- e === "column" ? new DOMRect(d.x, S, d.width, p - S) : new DOMRect(S, d.y, p - S, d.height)
168
+ const m = [], f = (S, h) => {
169
+ m.push(
170
+ e === "column" ? new DOMRect(d.x, S, d.width, h - S) : new DOMRect(S, d.y, h - S, d.height)
171
171
  );
172
172
  };
173
- return g < c && f(g, c), m > u && f(u, m), y;
173
+ return p < c && f(p, c), y > u && f(u, y), m;
174
174
  }));
175
175
  }
176
176
  return r;
177
177
  }
178
- function vn({
178
+ function zn({
179
179
  axis: e,
180
180
  cells: t,
181
181
  crossTrackCount: n,
@@ -186,23 +186,23 @@ function vn({
186
186
  separatorPlacements: l
187
187
  }) {
188
188
  const { items: a, separators: c } = r, u = a.length;
189
- let d = -1, g = -1, m = 0;
189
+ let d = -1, p = -1, y = 0;
190
190
  if (a.forEach((b, w) => {
191
- b.constraintProps.disabled || (m++, d === -1 && (d = w), g = w);
192
- }), !s && m < 2)
191
+ b.constraintProps.disabled || (y++, d === -1 && (d = w), p = w);
192
+ }), !s && y < 2)
193
193
  return [];
194
- const y = (b) => s || b > d && b <= g, f = [], S = (b, w, v) => ({
194
+ const m = (b) => s || b > d && b <= p, f = [], S = (b, w, v) => ({
195
195
  axis: r,
196
196
  axisSize: i,
197
197
  items: [a[b - 1], a[b]],
198
198
  rect: w,
199
199
  separator: v
200
- }), p = (b, w) => {
200
+ }), h = (b, w) => {
201
201
  let v;
202
- for (const $ of t) {
203
- const O = e === "column" ? $.row : $.column, R = e === "column" ? $.rowSpan : $.columnSpan;
202
+ for (const T of t) {
203
+ const O = e === "column" ? T.row : T.column, R = e === "column" ? T.rowSpan : T.columnSpan;
204
204
  if (w === "start" ? O === b : O + R - 1 === b) {
205
- const E = $.element.getBoundingClientRect();
205
+ const E = T.element.getBoundingClientRect();
206
206
  if (w === "start") {
207
207
  const P = e === "column" ? E.top : E.left;
208
208
  v = v === void 0 ? P : Math.min(v, P);
@@ -213,23 +213,23 @@ function vn({
213
213
  }
214
214
  }
215
215
  return v;
216
- }, h = /* @__PURE__ */ new Set();
216
+ }, g = /* @__PURE__ */ new Set();
217
217
  for (const b of c) {
218
218
  const w = l.get(b);
219
- if (!w || w.index < 1 || w.index >= u || (h.add(w.index), !s && (b.disabled || b.element.hasAttribute("aria-disabled"))) || !y(w.index))
219
+ if (!w || w.index < 1 || w.index >= u || (g.add(w.index), !s && (b.disabled || b.element.hasAttribute("aria-disabled"))) || !m(w.index))
220
220
  continue;
221
221
  let v = b.element.getBoundingClientRect();
222
- const { crossSpan: $, crossStart: O } = w, R = $ === void 0 ? n : O + $;
222
+ const { crossSpan: T, crossStart: O } = w, R = T === void 0 ? n : O + T;
223
223
  let E = e === "column" ? v.top : v.left, P = e === "column" ? v.bottom : v.right;
224
224
  if (O > 0) {
225
- const z = p(O - 1, "end");
225
+ const z = h(O - 1, "end");
226
226
  z !== void 0 && z < E && (E = z);
227
227
  }
228
228
  if (R < n) {
229
- const z = p(R, "start");
229
+ const z = h(R, "start");
230
230
  z !== void 0 && z > P && (P = z);
231
231
  }
232
- v = e === "column" ? new DOMRect(v.x, E, v.width, P - E) : new DOMRect(E, v.y, P - E, v.height), v = nt({ expandHitTargets: o, axis: r, rect: v }), s ? f.push(S(w.index, v, b)) : ht({
232
+ v = e === "column" ? new DOMRect(v.x, E, v.width, P - E) : new DOMRect(E, v.y, P - E, v.height), v = ot({ expandHitTargets: o, axis: r, rect: v }), s ? f.push(S(w.index, v, b)) : gt({
233
233
  axis: e,
234
234
  cells: t,
235
235
  index: w.index,
@@ -239,11 +239,11 @@ function vn({
239
239
  });
240
240
  }
241
241
  const I = (b, w) => {
242
- ht({
242
+ gt({
243
243
  axis: e,
244
244
  cells: t,
245
245
  index: b,
246
- rect: nt({ expandHitTargets: o, axis: r, rect: w })
246
+ rect: ot({ expandHitTargets: o, axis: r, rect: w })
247
247
  }).forEach((v) => {
248
248
  f.push(S(b, v));
249
249
  });
@@ -252,12 +252,12 @@ function vn({
252
252
  () => new Array(u)
253
253
  );
254
254
  for (const b of t) {
255
- const [w, v, $, O] = e === "column" ? [b.column, b.columnSpan, b.row, b.rowSpan] : [b.row, b.rowSpan, b.column, b.columnSpan];
256
- for (let R = Math.max(0, $); R < Math.min(n, $ + O); R++)
255
+ const [w, v, T, O] = e === "column" ? [b.column, b.columnSpan, b.row, b.rowSpan] : [b.row, b.rowSpan, b.column, b.columnSpan];
256
+ for (let R = Math.max(0, T); R < Math.min(n, T + O); R++)
257
257
  for (let E = Math.max(0, w); E < Math.min(u, w + v); E++)
258
258
  x[R][E] ??= b;
259
259
  }
260
- const C = /* @__PURE__ */ new Map(), N = (b) => {
260
+ const C = /* @__PURE__ */ new Map(), A = (b) => {
261
261
  let w = C.get(b);
262
262
  if (!w) {
263
263
  const v = b.element.getBoundingClientRect();
@@ -274,16 +274,16 @@ function vn({
274
274
  }, C.set(b, w);
275
275
  }
276
276
  return w;
277
- }, D = ({ crossEnd: b, crossStart: w, end: v, start: $ }) => e === "column" ? new DOMRect($, w, v - $, b - w) : new DOMRect(w, $, b - w, v - $);
277
+ }, N = ({ crossEnd: b, crossStart: w, end: v, start: T }) => e === "column" ? new DOMRect(T, w, v - T, b - w) : new DOMRect(w, T, b - w, v - T);
278
278
  for (let b = 1; b < u; b++) {
279
- if (h.has(b) || !y(b))
279
+ if (g.has(b) || !m(b))
280
280
  continue;
281
281
  let w;
282
282
  for (let v = 0; v < n; v++) {
283
- const $ = x[v][b - 1], O = x[v][b];
283
+ const T = x[v][b - 1], O = x[v][b];
284
284
  let R;
285
- if (($ || O) && $ !== O) {
286
- const E = $ ? N($) : void 0, P = O ? N(O) : void 0, z = E?.end ?? P.start, M = P?.start ?? E.end, B = Math.max(
285
+ if ((T || O) && T !== O) {
286
+ const E = T ? A(T) : void 0, P = O ? A(O) : void 0, z = E?.end ?? P.start, M = P?.start ?? E.end, q = Math.max(
287
287
  E?.crossStart ?? -1 / 0,
288
288
  P?.crossStart ?? -1 / 0
289
289
  ), J = Math.min(
@@ -291,8 +291,8 @@ function vn({
291
291
  P?.crossEnd ?? 1 / 0
292
292
  );
293
293
  R = {
294
- crossEnd: Math.max(B, J),
295
- crossStart: B,
294
+ crossEnd: Math.max(q, J),
295
+ crossStart: q,
296
296
  end: Math.max(z, M),
297
297
  start: Math.min(z, M)
298
298
  };
@@ -302,17 +302,17 @@ function vn({
302
302
  crossStart: Math.min(w.crossStart, R.crossStart),
303
303
  end: Math.max(w.end, R.end),
304
304
  start: Math.min(w.start, R.start)
305
- } : R : w && (I(b, D(w)), w = void 0);
305
+ } : R : w && (I(b, N(w)), w = void 0);
306
306
  }
307
- w && I(b, D(w));
307
+ w && I(b, N(w));
308
308
  }
309
309
  return f;
310
310
  }
311
- function ae(e) {
311
+ function le(e) {
312
312
  const t = parseFloat(e ?? "");
313
313
  return Number.isFinite(t) ? t : 0;
314
314
  }
315
- function bn({
315
+ function In({
316
316
  axis: e,
317
317
  element: t,
318
318
  gutterSizes: n,
@@ -325,26 +325,26 @@ function bn({
325
325
  const f = c.trim().split(/\s+/);
326
326
  if (f.length === l && f.every((S) => /^-?[\d.]+px$/.test(S))) {
327
327
  const S = i.map(
328
- (p, h) => ae(f[o ? h * 2 : h])
328
+ (h, g) => le(f[o ? g * 2 : g])
329
329
  );
330
330
  return {
331
- availableSize: S.reduce((p, h) => p + h, 0),
331
+ availableSize: S.reduce((h, g) => h + g, 0),
332
332
  trackSizes: S
333
333
  };
334
334
  }
335
335
  }
336
- const u = e === "column" ? t.offsetWidth : t.offsetHeight, d = e === "column" ? ae(a?.paddingLeft) + ae(a?.paddingRight) + ae(a?.borderLeftWidth) + ae(a?.borderRightWidth) : ae(a?.paddingTop) + ae(a?.paddingBottom) + ae(a?.borderTopWidth) + ae(a?.borderBottomWidth), g = ae(e === "column" ? a?.columnGap : a?.rowGap), m = n.reduce((f, S) => f + S, 0), y = Math.max(
336
+ const u = e === "column" ? t.offsetWidth : t.offsetHeight, d = e === "column" ? le(a?.paddingLeft) + le(a?.paddingRight) + le(a?.borderLeftWidth) + le(a?.borderRightWidth) : le(a?.paddingTop) + le(a?.paddingBottom) + le(a?.borderTopWidth) + le(a?.borderBottomWidth), p = le(e === "column" ? a?.columnGap : a?.rowGap), y = n.reduce((f, S) => f + S, 0), m = Math.max(
337
337
  0,
338
- u - d - g * Math.max(0, l - 1) - m
338
+ u - d - p * Math.max(0, l - 1) - y
339
339
  );
340
340
  return {
341
- availableSize: y,
341
+ availableSize: m,
342
342
  trackSizes: i.map(
343
- (f) => r && r[f] !== void 0 ? r[f] / 100 * y : y / s
343
+ (f) => r && r[f] !== void 0 ? r[f] / 100 * m : m / s
344
344
  )
345
345
  };
346
346
  }
347
- function Vt(e) {
347
+ function Wt(e) {
348
348
  switch (typeof e) {
349
349
  case "number":
350
350
  return [e, "px"];
@@ -354,7 +354,7 @@ function Vt(e) {
354
354
  }
355
355
  }
356
356
  }
357
- class Ht {
357
+ class Yt {
358
358
  #e = {};
359
359
  addListener(t, n) {
360
360
  const o = this.#e[t];
@@ -397,48 +397,48 @@ let V = {
397
397
  cursorFlags: 0,
398
398
  state: "inactive"
399
399
  };
400
- const at = new Ht();
401
- function de() {
400
+ const lt = new Yt();
401
+ function se() {
402
402
  return V;
403
403
  }
404
- function jt(e) {
405
- return at.addListener("change", e);
404
+ function Kt(e) {
405
+ return lt.addListener("change", e);
406
406
  }
407
- function xn(e, t = [], n, o = !1) {
407
+ function Ln(e, t = [], n, o = !1) {
408
408
  const r = V, i = { ...V };
409
- i.cursorFlags = e, i.state === "active" && (i.didPointerMove ||= o, i.previews = t, n && (i.previewLayoutMap = n)), V = i, at.emit("change", {
409
+ i.cursorFlags = e, i.state === "active" && (i.didPointerMove ||= o, i.previews = t, n && (i.previewLayoutMap = n)), V = i, lt.emit("change", {
410
410
  prev: r,
411
411
  next: i
412
412
  });
413
413
  }
414
- function ue(e) {
414
+ function de(e) {
415
415
  const t = V;
416
416
  V = e, t.state === "active" && e.state !== "active" && t.didPointerMove && t.hitRegions.forEach(({ separator: n }) => {
417
417
  n && n.element.ownerDocument.activeElement === n.element && n.element.blur();
418
- }), at.emit("change", {
418
+ }), lt.emit("change", {
419
419
  prev: t,
420
420
  next: e
421
421
  });
422
422
  }
423
- function wn(e) {
424
- V.state !== "active" || !V.previews.some((t) => t.separator === e) || ue({
423
+ function Cn(e) {
424
+ V.state !== "active" || !V.previews.some((t) => t.separator === e) || de({
425
425
  ...V,
426
426
  previews: V.previews.map(
427
427
  (t) => t.separator === e ? { ...t } : t
428
428
  )
429
429
  });
430
430
  }
431
- function zn(e) {
431
+ function Rn(e) {
432
432
  if (V.state === "inactive")
433
433
  return !1;
434
434
  const t = V.hitRegions.filter((o) => o.axis !== e), n = V.state === "active" && V.previews.some((o) => o.axis === e);
435
435
  if (t.length === V.hitRegions.length && !n)
436
436
  return !1;
437
437
  if (t.length === 0)
438
- ue({ cursorFlags: 0, state: "inactive" });
438
+ de({ cursorFlags: 0, state: "inactive" });
439
439
  else if (V.state === "active") {
440
440
  const o = new Map(V.initialLayoutMap), r = new Map(V.previewLayoutMap);
441
- o.delete(e), r.delete(e), ue({
441
+ o.delete(e), r.delete(e), de({
442
442
  ...V,
443
443
  cursorFlags: 0,
444
444
  hitRegions: t,
@@ -447,16 +447,16 @@ function zn(e) {
447
447
  previews: V.previews.filter((i) => i.axis !== e)
448
448
  });
449
449
  } else
450
- ue({ ...V, hitRegions: t });
450
+ de({ ...V, hitRegions: t });
451
451
  return !0;
452
452
  }
453
- const In = (e) => e, et = () => {
454
- }, Ut = 1, Wt = 2, Yt = 4, Kt = 8, gt = 3, yt = 12;
453
+ const Mn = (e) => e, tt = () => {
454
+ }, Xt = 1, Jt = 2, Zt = 4, Qt = 8, yt = 3, St = 12;
455
455
  let Ye;
456
- function St() {
456
+ function vt() {
457
457
  return Ye === void 0 && (Ye = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (Ye = !0)), Ye;
458
458
  }
459
- function Ln({
459
+ function En({
460
460
  cursorFlags: e,
461
461
  axes: t,
462
462
  state: n
@@ -482,8 +482,8 @@ function Ln({
482
482
  if (!(o === 0 && r === 0)) {
483
483
  switch (n) {
484
484
  case "active": {
485
- if (e && St()) {
486
- const i = (e & Ut) !== 0, s = (e & Wt) !== 0, l = (e & Yt) !== 0, a = (e & Kt) !== 0;
485
+ if (e && vt()) {
486
+ const i = (e & Xt) !== 0, s = (e & Jt) !== 0, l = (e & Zt) !== 0, a = (e & Qt) !== 0;
487
487
  if (i)
488
488
  return l ? "se-resize" : a ? "ne-resize" : "e-resize";
489
489
  if (s)
@@ -496,23 +496,23 @@ function Ln({
496
496
  break;
497
497
  }
498
498
  }
499
- return St() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
499
+ return vt() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
500
500
  }
501
501
  }
502
- const vt = /* @__PURE__ */ new WeakMap();
503
- function _e(e) {
502
+ const bt = /* @__PURE__ */ new WeakMap();
503
+ function Ve(e) {
504
504
  if (!e.defaultView || !e.adoptedStyleSheets)
505
505
  return;
506
- let { prevStyle: t, styleSheet: n } = vt.get(e) ?? {};
506
+ let { prevStyle: t, styleSheet: n } = bt.get(e) ?? {};
507
507
  n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && (Object.isExtensible(e.adoptedStyleSheets) ? e.adoptedStyleSheets.push(n) : e.adoptedStyleSheets = [
508
508
  ...e.adoptedStyleSheets,
509
509
  n
510
510
  ]));
511
- const o = de();
511
+ const o = se();
512
512
  switch (o.state) {
513
513
  case "active":
514
514
  case "hover": {
515
- const r = Ln({
515
+ const r = En({
516
516
  cursorFlags: o.cursorFlags,
517
517
  axes: o.hitRegions.map((s) => s.axis),
518
518
  state: o.state
@@ -527,7 +527,7 @@ function _e(e) {
527
527
  break;
528
528
  }
529
529
  }
530
- vt.set(e, {
530
+ bt.set(e, {
531
531
  prevStyle: t,
532
532
  styleSheet: n
533
533
  });
@@ -538,28 +538,28 @@ function ke({
538
538
  const { layoutStrategy: t, orientation: n, items: o } = e;
539
539
  return t ? t.calculateAvailableSize() : o.reduce((r, i) => (r += n === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r), 0);
540
540
  }
541
- function lt(e, t) {
541
+ function ct(e, t) {
542
542
  const n = e.compareDocumentPosition(t);
543
543
  return n & Node.DOCUMENT_POSITION_DISCONNECTED ? 0 : n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
544
544
  }
545
545
  function Ne(e, t) {
546
546
  return Array.from(t).sort((n, o) => {
547
- const r = e === "horizontal" ? Cn(n, o) : Rn(n, o);
548
- return r !== 0 ? r : lt(n.element, o.element);
547
+ const r = e === "horizontal" ? Pn(n, o) : kn(n, o);
548
+ return r !== 0 ? r : ct(n.element, o.element);
549
549
  });
550
550
  }
551
- function Cn(e, t) {
551
+ function Pn(e, t) {
552
552
  const n = e.element.offsetLeft - t.element.offsetLeft;
553
553
  return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
554
554
  }
555
- function Rn(e, t) {
555
+ function kn(e, t) {
556
556
  const n = e.element.offsetTop - t.element.offsetTop;
557
557
  return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
558
558
  }
559
- function ot(e) {
559
+ function rt(e) {
560
560
  return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
561
561
  }
562
- function Xt(e, t) {
562
+ function en(e, t) {
563
563
  return {
564
564
  x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
565
565
  Math.abs(e.x - t.left),
@@ -571,7 +571,7 @@ function Xt(e, t) {
571
571
  )
572
572
  };
573
573
  }
574
- function Mn({
574
+ function Tn({
575
575
  orientation: e,
576
576
  rects: t,
577
577
  targetRect: n
@@ -582,12 +582,12 @@ function Mn({
582
582
  };
583
583
  let r, i = Number.MAX_VALUE;
584
584
  for (const s of t) {
585
- const { x: l, y: a } = Xt(o, s), c = e === "horizontal" ? l : a;
585
+ const { x: l, y: a } = en(o, s), c = e === "horizontal" ? l : a;
586
586
  c < i && (i = c, r = s);
587
587
  }
588
- return T(r, "No rect found"), r;
588
+ return D(r, "No rect found"), r;
589
589
  }
590
- function ct({
590
+ function ut({
591
591
  expandHitTargets: e = !0,
592
592
  axis: t,
593
593
  includeDisabled: n = !1
@@ -600,28 +600,28 @@ function ct({
600
600
  });
601
601
  const { element: o, orientation: r, items: i, separators: s } = t, l = Ne(
602
602
  r,
603
- Array.from(o.children).filter(ot).filter((p) => !p.hasAttribute("data-resize-preview")).map((p) => ({ element: p }))
604
- ).map(({ element: p }) => p), a = [];
605
- let c = !1, u = !1, d = -1, g, m = -1, y = 0, f, S = [];
603
+ Array.from(o.children).filter(rt).filter((h) => !h.hasAttribute("data-resize-preview")).map((h) => ({ element: h }))
604
+ ).map(({ element: h }) => h), a = [];
605
+ let c = !1, u = !1, d = -1, p, y = -1, m = 0, f, S = [];
606
606
  {
607
- let p = -1;
608
- for (const h of l)
609
- h.hasAttribute("data-panel") && (p++, h.hasAttribute("data-disabled") || (y++, d === -1 && (d = p), m = p));
607
+ let h = -1;
608
+ for (const g of l)
609
+ g.hasAttribute("data-panel") && (h++, g.hasAttribute("data-disabled") || (m++, d === -1 && (d = h), y = h));
610
610
  }
611
- if (n || y > 1) {
612
- let p = -1;
613
- for (const h of l)
614
- if (h.hasAttribute("data-panel")) {
615
- p++;
611
+ if (n || m > 1) {
612
+ let h = -1;
613
+ for (const g of l)
614
+ if (g.hasAttribute("data-panel")) {
615
+ h++;
616
616
  const I = i.find(
617
- (x) => x.element === h
617
+ (x) => x.element === g
618
618
  );
619
619
  if (I) {
620
620
  if (f) {
621
- const x = f.element.getBoundingClientRect(), C = h.getBoundingClientRect();
622
- let N;
621
+ const x = f.element.getBoundingClientRect(), C = g.getBoundingClientRect();
622
+ let A;
623
623
  if (u) {
624
- const D = r === "horizontal" ? new DOMRect(
624
+ const N = r === "horizontal" ? new DOMRect(
625
625
  x.right,
626
626
  x.top,
627
627
  0,
@@ -634,31 +634,31 @@ function ct({
634
634
  ), b = r === "horizontal" ? new DOMRect(C.left, C.top, 0, C.height) : new DOMRect(C.left, C.top, C.width, 0);
635
635
  switch (S.length) {
636
636
  case 0: {
637
- N = [
638
- D,
637
+ A = [
638
+ N,
639
639
  b
640
640
  ];
641
641
  break;
642
642
  }
643
643
  case 1: {
644
- const w = S[0], v = Mn({
644
+ const w = S[0], v = Tn({
645
645
  orientation: r,
646
646
  rects: [x, C],
647
647
  targetRect: w.element.getBoundingClientRect()
648
648
  });
649
- N = [
649
+ A = [
650
650
  w,
651
- v === x ? b : D
651
+ v === x ? b : N
652
652
  ];
653
653
  break;
654
654
  }
655
655
  default: {
656
- N = S;
656
+ A = S;
657
657
  break;
658
658
  }
659
659
  }
660
660
  } else
661
- S.length ? N = S : N = [
661
+ S.length ? A = S : A = [
662
662
  r === "horizontal" ? new DOMRect(
663
663
  x.right,
664
664
  C.top,
@@ -671,27 +671,27 @@ function ct({
671
671
  C.top - x.bottom
672
672
  )
673
673
  ];
674
- for (const D of N) {
675
- const b = nt({
674
+ for (const N of A) {
675
+ const b = ot({
676
676
  expandHitTargets: e,
677
677
  axis: t,
678
- rect: "width" in D ? D : D.element.getBoundingClientRect()
679
- }), w = p <= d || p > m;
680
- (n || !c && !w) && (g ??= ke({ axis: t }), a.push({
678
+ rect: "width" in N ? N : N.element.getBoundingClientRect()
679
+ }), w = h <= d || h > y;
680
+ (n || !c && !w) && (p ??= ke({ axis: t }), a.push({
681
681
  axis: t,
682
- axisSize: g,
682
+ axisSize: p,
683
683
  items: [f, I],
684
- separator: "width" in D ? void 0 : D,
684
+ separator: "width" in N ? void 0 : N,
685
685
  rect: b
686
686
  })), c = !1;
687
687
  }
688
688
  }
689
689
  u = !1, f = I, S = [];
690
690
  }
691
- } else if (h.hasAttribute("data-separator")) {
692
- h.ariaDisabled !== null && (c = !0);
691
+ } else if (g.hasAttribute("data-separator")) {
692
+ g.ariaDisabled !== null && (c = !0);
693
693
  const I = s.find(
694
- (x) => x.element === h
694
+ (x) => x.element === g
695
695
  );
696
696
  I ? S.push(I) : (f = void 0, S = []);
697
697
  } else
@@ -699,18 +699,18 @@ function ct({
699
699
  }
700
700
  return a;
701
701
  }
702
- function En(e, t) {
702
+ function $n(e, t) {
703
703
  const n = getComputedStyle(e), o = parseFloat(n.fontSize);
704
704
  return t * o;
705
705
  }
706
- function Pn(e, t) {
706
+ function An(e, t) {
707
707
  const n = getComputedStyle(e.ownerDocument.documentElement), o = parseFloat(n.fontSize);
708
708
  return t * o;
709
709
  }
710
- function kn(e) {
710
+ function Dn(e) {
711
711
  return e / 100 * window.innerHeight;
712
712
  }
713
- function $n(e) {
713
+ function On(e) {
714
714
  return e / 100 * window.innerWidth;
715
715
  }
716
716
  function Ce({
@@ -719,7 +719,7 @@ function Ce({
719
719
  styleProp: n
720
720
  }) {
721
721
  let o;
722
- const [r, i] = Vt(n);
722
+ const [r, i] = Wt(n);
723
723
  switch (i) {
724
724
  case "%": {
725
725
  o = r / 100 * e;
@@ -730,19 +730,19 @@ function Ce({
730
730
  break;
731
731
  }
732
732
  case "rem": {
733
- o = Pn(t, r);
733
+ o = An(t, r);
734
734
  break;
735
735
  }
736
736
  case "em": {
737
- o = En(t, r);
737
+ o = $n(t, r);
738
738
  break;
739
739
  }
740
740
  case "vh": {
741
- o = kn(r);
741
+ o = Dn(r);
742
742
  break;
743
743
  }
744
744
  case "vw": {
745
- o = $n(r);
745
+ o = On(r);
746
746
  break;
747
747
  }
748
748
  }
@@ -751,7 +751,7 @@ function Ce({
751
751
  function X(e) {
752
752
  return parseFloat(e.toFixed(3));
753
753
  }
754
- function rt(e) {
754
+ function it(e) {
755
755
  const { items: t } = e, n = ke({ axis: e });
756
756
  return n === 0 ? t.map((o) => ({
757
757
  groupResizeBehavior: o.constraintProps.groupResizeBehavior,
@@ -822,41 +822,41 @@ function rt(e) {
822
822
  };
823
823
  });
824
824
  }
825
- let ce = /* @__PURE__ */ new Map();
826
- const Jt = new Ht();
827
- function An(e) {
828
- ce = new Map(ce), ce.delete(e);
825
+ let ue = /* @__PURE__ */ new Map();
826
+ const tn = new Yt();
827
+ function Nn(e) {
828
+ ue = new Map(ue), ue.delete(e);
829
829
  }
830
830
  function Me(e, t) {
831
- for (const [n] of ce)
831
+ for (const [n] of ue)
832
832
  if (n.id === e)
833
833
  return n;
834
834
  }
835
- function se(e, t) {
836
- for (const [n, o] of ce)
835
+ function ae(e, t) {
836
+ for (const [n, o] of ue)
837
837
  if (n.id === e)
838
838
  return o;
839
839
  if (t)
840
840
  throw Error(`Could not find data for Group with id ${e}`);
841
841
  }
842
- function ye() {
843
- return ce;
842
+ function he() {
843
+ return ue;
844
844
  }
845
- function Fe(e, t) {
846
- return Jt.addListener("axisChange", (n) => {
845
+ function _e(e, t) {
846
+ return tn.addListener("axisChange", (n) => {
847
847
  n.axis.id === e && t(n);
848
848
  });
849
849
  }
850
850
  function fe(e, t, n) {
851
- const o = ce.get(e);
852
- ce = new Map(ce), ce.set(e, t), Jt.emit("axisChange", {
851
+ const o = ue.get(e);
852
+ ue = new Map(ue), ue.set(e, t), tn.emit("axisChange", {
853
853
  axis: e,
854
854
  isUserInteraction: n?.isUserInteraction === !0,
855
855
  prev: o,
856
856
  next: t
857
857
  });
858
858
  }
859
- function Tn(e, t) {
859
+ function Gn(e, t) {
860
860
  if (e.length !== t.length)
861
861
  return !1;
862
862
  for (let n = 0; n < e.length; n++)
@@ -867,7 +867,7 @@ function Tn(e, t) {
867
867
  function Y(e, t, n = 0) {
868
868
  return Math.abs(X(e) - X(t)) <= n;
869
869
  }
870
- function le(e, t) {
870
+ function ce(e, t) {
871
871
  return Y(e, t) ? 0 : e > t ? 1 : -1;
872
872
  }
873
873
  function Ee({
@@ -886,15 +886,15 @@ function Ee({
886
886
  } = t;
887
887
  if (l && !e)
888
888
  return n;
889
- if (le(o, c) < 0)
889
+ if (ce(o, c) < 0)
890
890
  if (s) {
891
- const u = i ?? (c - r) / 2, d = le(n, r) <= 0, g = d ? r + u : c - u, m = le(o, g);
892
- le(o, r) <= 0 || m < 0 || i !== void 0 && d && m === 0 ? o = r : o = c;
891
+ const u = i ?? (c - r) / 2, d = ce(n, r) <= 0, p = d ? r + u : c - u, y = ce(o, p);
892
+ ce(o, r) <= 0 || y < 0 || i !== void 0 && d && y === 0 ? o = r : o = c;
893
893
  } else
894
894
  o = c;
895
895
  return o = Math.min(a, o), o = X(o), o;
896
896
  }
897
- function qe({
897
+ function Fe({
898
898
  delta: e,
899
899
  initialLayout: t,
900
900
  itemConstraints: n,
@@ -905,71 +905,71 @@ function qe({
905
905
  if (Y(e, 0))
906
906
  return t;
907
907
  const s = i === "imperative-api", l = n.map(
908
- ({ itemId: y }) => t[y]
908
+ ({ itemId: m }) => t[m]
909
909
  ), a = n.map(
910
- ({ itemId: y }) => r[y]
910
+ ({ itemId: m }) => r[m]
911
911
  ), c = [...l], [u, d] = o;
912
- T(u != null, "Invalid first pivot index"), T(d != null, "Invalid second pivot index");
913
- let g = 0;
912
+ D(u != null, "Invalid first pivot index"), D(d != null, "Invalid second pivot index");
913
+ let p = 0;
914
914
  switch (i) {
915
915
  case "keyboard": {
916
916
  {
917
- const y = e < 0 ? d : u, f = n[y];
918
- T(
917
+ const m = e < 0 ? d : u, f = n[m];
918
+ D(
919
919
  f,
920
- `Panel constraints not found for index ${y}`
920
+ `Panel constraints not found for index ${m}`
921
921
  );
922
922
  const {
923
923
  collapsedSize: S = 0,
924
- collapsible: p,
925
- minSize: h = 0
924
+ collapsible: h,
925
+ minSize: g = 0
926
926
  } = f;
927
- if (p) {
928
- const I = l[y];
929
- if (T(
927
+ if (h) {
928
+ const I = l[m];
929
+ if (D(
930
930
  I != null,
931
- `Previous layout not found for panel index ${y}`
931
+ `Previous layout not found for panel index ${m}`
932
932
  ), Y(I, S)) {
933
- const x = h - I;
934
- le(x, Math.abs(e)) > 0 && (e = e < 0 ? 0 - x : x);
933
+ const x = g - I;
934
+ ce(x, Math.abs(e)) > 0 && (e = e < 0 ? 0 - x : x);
935
935
  }
936
936
  }
937
937
  }
938
938
  {
939
- const y = e < 0 ? u : d, f = n[y];
940
- T(
939
+ const m = e < 0 ? u : d, f = n[m];
940
+ D(
941
941
  f,
942
- `No panel constraints found for index ${y}`
942
+ `No panel constraints found for index ${m}`
943
943
  );
944
944
  const {
945
945
  collapsedSize: S = 0,
946
- collapsible: p,
947
- minSize: h = 0
946
+ collapsible: h,
947
+ minSize: g = 0
948
948
  } = f;
949
- if (p) {
950
- const I = l[y];
951
- if (T(
949
+ if (h) {
950
+ const I = l[m];
951
+ if (D(
952
952
  I != null,
953
- `Previous layout not found for panel index ${y}`
954
- ), Y(I, h)) {
953
+ `Previous layout not found for panel index ${m}`
954
+ ), Y(I, g)) {
955
955
  const x = I - S;
956
- le(x, Math.abs(e)) > 0 && (e = e < 0 ? 0 - x : x);
956
+ ce(x, Math.abs(e)) > 0 && (e = e < 0 ? 0 - x : x);
957
957
  }
958
958
  }
959
959
  }
960
960
  break;
961
961
  }
962
962
  default: {
963
- const y = e < 0 ? d : u, f = n[y];
964
- T(
963
+ const m = e < 0 ? d : u, f = n[m];
964
+ D(
965
965
  f,
966
- `Panel constraints not found for index ${y}`
966
+ `Panel constraints not found for index ${m}`
967
967
  );
968
- const S = l[y], { collapsedSize: p, collapsedThreshold: h, collapsible: I, minSize: x } = f;
969
- if (I && le(S, x) < 0) {
970
- const C = x - p, N = h ?? C / 2, D = S + Math.abs(e);
971
- if (le(D, x) < 0) {
972
- const b = le(Math.abs(e), N), w = h === void 0 && e < 0;
968
+ const S = l[m], { collapsedSize: h, collapsedThreshold: g, collapsible: I, minSize: x } = f;
969
+ if (I && ce(S, x) < 0) {
970
+ const C = x - h, A = g ?? C / 2, N = S + Math.abs(e);
971
+ if (ce(N, x) < 0) {
972
+ const b = ce(Math.abs(e), A), w = g === void 0 && e < 0;
973
973
  b > 0 || b === 0 && w ? e = e < 0 ? -C : C : e = 0;
974
974
  }
975
975
  }
@@ -977,96 +977,96 @@ function qe({
977
977
  }
978
978
  }
979
979
  {
980
- const y = e < 0 ? 1 : -1;
980
+ const m = e < 0 ? 1 : -1;
981
981
  let f = e < 0 ? d : u, S = 0;
982
982
  for (; ; ) {
983
- const h = l[f];
984
- T(
985
- h != null,
983
+ const g = l[f];
984
+ D(
985
+ g != null,
986
986
  `Previous layout not found for panel index ${f}`
987
987
  );
988
988
  const x = Ee({
989
989
  overrideDisabledItems: s,
990
990
  itemConstraints: n[f],
991
- prevSize: h,
991
+ prevSize: g,
992
992
  size: 100
993
- }) - h;
994
- if (S += x, f += y, f < 0 || f >= n.length)
993
+ }) - g;
994
+ if (S += x, f += m, f < 0 || f >= n.length)
995
995
  break;
996
996
  }
997
- const p = Math.min(Math.abs(e), Math.abs(S));
998
- e = e < 0 ? 0 - p : p;
997
+ const h = Math.min(Math.abs(e), Math.abs(S));
998
+ e = e < 0 ? 0 - h : h;
999
999
  }
1000
1000
  {
1001
1001
  let f = e < 0 ? u : d;
1002
1002
  for (; f >= 0 && f < n.length; ) {
1003
- const S = Math.abs(e) - Math.abs(g), p = l[f];
1004
- T(
1005
- p != null,
1003
+ const S = Math.abs(e) - Math.abs(p), h = l[f];
1004
+ D(
1005
+ h != null,
1006
1006
  `Previous layout not found for panel index ${f}`
1007
1007
  );
1008
- const h = p - S, I = Ee({
1008
+ const g = h - S, I = Ee({
1009
1009
  overrideDisabledItems: s,
1010
1010
  itemConstraints: n[f],
1011
- prevSize: p,
1012
- size: h
1011
+ prevSize: h,
1012
+ size: g
1013
1013
  });
1014
- if (!Y(p, I) && (g += p - I, c[f] = I, g.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
1014
+ if (!Y(h, I) && (p += h - I, c[f] = I, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
1015
1015
  numeric: !0
1016
1016
  }) >= 0))
1017
1017
  break;
1018
1018
  e < 0 ? f-- : f++;
1019
1019
  }
1020
1020
  }
1021
- if (Tn(a, c))
1021
+ if (Gn(a, c))
1022
1022
  return r;
1023
1023
  {
1024
- const y = e < 0 ? d : u, f = l[y];
1025
- T(
1024
+ const m = e < 0 ? d : u, f = l[m];
1025
+ D(
1026
1026
  f != null,
1027
- `Previous layout not found for panel index ${y}`
1027
+ `Previous layout not found for panel index ${m}`
1028
1028
  );
1029
- const S = f + g, p = Ee({
1029
+ const S = f + p, h = Ee({
1030
1030
  overrideDisabledItems: s,
1031
- itemConstraints: n[y],
1031
+ itemConstraints: n[m],
1032
1032
  prevSize: f,
1033
1033
  size: S
1034
1034
  });
1035
- if (c[y] = p, !Y(p, S)) {
1036
- let h = S - p, x = e < 0 ? d : u;
1035
+ if (c[m] = h, !Y(h, S)) {
1036
+ let g = S - h, x = e < 0 ? d : u;
1037
1037
  for (; x >= 0 && x < n.length; ) {
1038
1038
  const C = c[x];
1039
- T(
1039
+ D(
1040
1040
  C != null,
1041
1041
  `Previous layout not found for panel index ${x}`
1042
1042
  );
1043
- const N = C + h, D = Ee({
1043
+ const A = C + g, N = Ee({
1044
1044
  overrideDisabledItems: s,
1045
1045
  itemConstraints: n[x],
1046
1046
  prevSize: C,
1047
- size: N
1047
+ size: A
1048
1048
  });
1049
- if (Y(C, D) || (h -= D - C, c[x] = D), Y(h, 0))
1049
+ if (Y(C, N) || (g -= N - C, c[x] = N), Y(g, 0))
1050
1050
  break;
1051
1051
  e > 0 ? x-- : x++;
1052
1052
  }
1053
1053
  }
1054
1054
  }
1055
- const m = Object.values(c).reduce(
1056
- (y, f) => f + y,
1055
+ const y = Object.values(c).reduce(
1056
+ (m, f) => f + m,
1057
1057
  0
1058
1058
  );
1059
- return Y(m, 100, 0.1) ? c.reduce((y, f, S) => (y[n[S].itemId] = f, y), {}) : r;
1059
+ return Y(y, 100, 0.1) ? c.reduce((m, f, S) => (m[n[S].itemId] = f, m), {}) : r;
1060
1060
  }
1061
1061
  function ie(e, t) {
1062
1062
  if (Object.keys(e).length !== Object.keys(t).length)
1063
1063
  return !1;
1064
1064
  for (const n in e)
1065
- if (t[n] === void 0 || le(e[n], t[n]) !== 0)
1065
+ if (t[n] === void 0 || ce(e[n], t[n]) !== 0)
1066
1066
  return !1;
1067
1067
  return !0;
1068
1068
  }
1069
- function ut({
1069
+ function dt({
1070
1070
  commit: e,
1071
1071
  document: t,
1072
1072
  event: n,
@@ -1077,41 +1077,41 @@ function ut({
1077
1077
  prevCursorFlags: l
1078
1078
  }) {
1079
1079
  let a = 0;
1080
- const c = de();
1080
+ const c = se();
1081
1081
  let u = c.state === "active" ? c.previews : [];
1082
1082
  const d = new Map(
1083
1083
  c.state === "active" ? c.previewLayoutMap : void 0
1084
1084
  );
1085
- o.forEach((y) => {
1086
- const { axis: f, axisSize: S } = y, { orientation: p, items: h } = f;
1085
+ o.forEach((m) => {
1086
+ const { axis: f, axisSize: S } = m, { orientation: h, items: g } = f;
1087
1087
  if (e && f.resizePreviewMode !== "separator")
1088
1088
  return;
1089
1089
  const { disableCursor: I } = f.mutableState;
1090
1090
  let x = 0;
1091
- s ? p === "horizontal" ? x = (n.clientX - s.x) / S * 100 : x = (n.clientY - s.y) / S * 100 : p === "horizontal" ? x = n.clientX < 0 ? -100 : 100 : x = n.clientY < 0 ? -100 : 100;
1092
- const C = r.get(f), N = i.get(f);
1093
- if (!C || !N)
1091
+ s ? h === "horizontal" ? x = (n.clientX - s.x) / S * 100 : x = (n.clientY - s.y) / S * 100 : h === "horizontal" ? x = n.clientX < 0 ? -100 : 100 : x = n.clientY < 0 ? -100 : 100;
1092
+ const C = r.get(f), A = i.get(f);
1093
+ if (!C || !A)
1094
1094
  return;
1095
1095
  const {
1096
- defaultLayoutDeferred: D,
1096
+ defaultLayoutDeferred: N,
1097
1097
  derivedItemConstraints: b,
1098
1098
  axisSize: w,
1099
1099
  layout: v,
1100
- separatorToItems: $
1101
- } = N;
1102
- if (b && v && $) {
1103
- const O = f.resizePreviewMode === "separator" ? d.get(f) ?? v : v, R = qe({
1100
+ separatorToItems: T
1101
+ } = A;
1102
+ if (b && v && T) {
1103
+ const O = f.resizePreviewMode === "separator" ? d.get(f) ?? v : v, R = Fe({
1104
1104
  delta: x,
1105
1105
  initialLayout: C,
1106
1106
  itemConstraints: b,
1107
- pivotIndices: y.items.map((E) => h.indexOf(E)),
1107
+ pivotIndices: m.items.map((E) => g.indexOf(E)),
1108
1108
  prevLayout: O,
1109
1109
  trigger: "mouse-or-touch"
1110
1110
  });
1111
1111
  if (f.resizePreviewMode === "separator" && !e && !ie(R, O)) {
1112
1112
  d.set(f, R);
1113
1113
  let E = 0;
1114
- const P = h.map((z) => (E += R[z.id] - C[z.id], E * (S / 100)));
1114
+ const P = g.map((z) => (E += R[z.id] - C[z.id], E * (S / 100)));
1115
1115
  u = u.map((z) => {
1116
1116
  if (z.axis !== f)
1117
1117
  return z;
@@ -1120,38 +1120,38 @@ function ut({
1120
1120
  });
1121
1121
  }
1122
1122
  if (ie(R, O) && x !== 0 && !I)
1123
- switch (p) {
1123
+ switch (h) {
1124
1124
  case "horizontal": {
1125
- a |= x < 0 ? Ut : Wt;
1125
+ a |= x < 0 ? Xt : Jt;
1126
1126
  break;
1127
1127
  }
1128
1128
  case "vertical": {
1129
- a |= x < 0 ? Yt : Kt;
1129
+ a |= x < 0 ? Zt : Qt;
1130
1130
  break;
1131
1131
  }
1132
1132
  }
1133
- (f.resizePreviewMode !== "separator" || e) && !ie(R, v) && fe(y.axis, {
1134
- defaultLayoutDeferred: D,
1133
+ (f.resizePreviewMode !== "separator" || e) && !ie(R, v) && fe(m.axis, {
1134
+ defaultLayoutDeferred: N,
1135
1135
  derivedItemConstraints: b,
1136
1136
  axisSize: w,
1137
1137
  layout: R,
1138
1138
  requestedAxisSize: w,
1139
1139
  requestedLayout: R,
1140
- separatorToItems: $
1140
+ separatorToItems: T
1141
1141
  });
1142
1142
  }
1143
1143
  });
1144
- let g = 0;
1145
- n.movementX === 0 ? g |= l & gt : g |= a & gt, n.movementY === 0 ? g |= l & yt : g |= a & yt;
1146
- const m = c.state === "active" && (n.clientX !== c.pointerDownAtPoint.x || n.clientY !== c.pointerDownAtPoint.y);
1147
- xn(g, u, d, m), _e(t);
1144
+ let p = 0;
1145
+ n.movementX === 0 ? p |= l & yt : p |= a & yt, n.movementY === 0 ? p |= l & St : p |= a & St;
1146
+ const y = c.state === "active" && (n.clientX !== c.pointerDownAtPoint.x || n.clientY !== c.pointerDownAtPoint.y);
1147
+ Ln(p, u, d, y), Ve(t);
1148
1148
  }
1149
- function Zt(e, t) {
1150
- const n = de(), o = ye();
1149
+ function nn(e, t) {
1150
+ const n = se(), o = he();
1151
1151
  let r = !1;
1152
1152
  switch (n.state) {
1153
1153
  case "active":
1154
- ut({
1154
+ dt({
1155
1155
  commit: !0,
1156
1156
  document: e,
1157
1157
  event: t,
@@ -1160,13 +1160,13 @@ function Zt(e, t) {
1160
1160
  mountedAxes: o,
1161
1161
  pointerDownAtPoint: n.pointerDownAtPoint,
1162
1162
  prevCursorFlags: n.cursorFlags
1163
- }), ue({
1163
+ }), de({
1164
1164
  cursorFlags: 0,
1165
1165
  state: "inactive"
1166
- }), n.hitRegions.length > 0 && (_e(e), r = !0, n.hitRegions.forEach((i) => {
1166
+ }), n.hitRegions.length > 0 && (Ve(e), r = !0, n.hitRegions.forEach((i) => {
1167
1167
  if (!o.has(i.axis))
1168
1168
  return;
1169
- const s = se(i.axis.id, !0);
1169
+ const s = ae(i.axis.id, !0);
1170
1170
  fe(i.axis, s, {
1171
1171
  isUserInteraction: !0
1172
1172
  });
@@ -1174,16 +1174,16 @@ function Zt(e, t) {
1174
1174
  }
1175
1175
  return r;
1176
1176
  }
1177
- function bt(e) {
1178
- e.defaultPrevented || Zt(e.currentTarget, e);
1177
+ function xt(e) {
1178
+ e.defaultPrevented || nn(e.currentTarget, e);
1179
1179
  }
1180
- function Dn(e, t, n) {
1180
+ function _n(e, t, n) {
1181
1181
  let o, r = {
1182
1182
  x: 1 / 0,
1183
1183
  y: 1 / 0
1184
1184
  };
1185
1185
  for (const i of t) {
1186
- const s = Xt(n, i.rect);
1186
+ const s = en(n, i.rect);
1187
1187
  switch (e) {
1188
1188
  case "horizontal": {
1189
1189
  (s.x < r.x || s.x === r.x && s.y <= r.y) && (o = i, r = s);
@@ -1200,25 +1200,25 @@ function Dn(e, t, n) {
1200
1200
  hitRegion: o
1201
1201
  } : void 0;
1202
1202
  }
1203
- function On(e) {
1203
+ function Fn(e) {
1204
1204
  return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
1205
1205
  }
1206
- function Nn(e, t) {
1206
+ function Bn(e, t) {
1207
1207
  if (e === t) throw new Error("Cannot compare node with itself");
1208
1208
  const n = {
1209
- a: zt(e),
1210
- b: zt(t)
1209
+ a: It(e),
1210
+ b: It(t)
1211
1211
  };
1212
1212
  let o;
1213
1213
  for (; n.a.at(-1) === n.b.at(-1); )
1214
1214
  o = n.a.pop(), n.b.pop();
1215
- T(
1215
+ D(
1216
1216
  o,
1217
1217
  "Stacking order can only be calculated for elements with a common ancestor"
1218
1218
  );
1219
1219
  const r = {
1220
- a: wt(xt(n.a)),
1221
- b: wt(xt(n.b))
1220
+ a: zt(wt(n.a)),
1221
+ b: zt(wt(n.b))
1222
1222
  };
1223
1223
  if (r.a === r.b) {
1224
1224
  const i = o.childNodes, s = {
@@ -1234,87 +1234,87 @@ function Nn(e, t) {
1234
1234
  }
1235
1235
  return Math.sign(r.a - r.b);
1236
1236
  }
1237
- const Gn = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
1238
- function _n(e) {
1239
- const t = getComputedStyle(Qt(e) ?? e).display;
1237
+ const qn = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
1238
+ function Vn(e) {
1239
+ const t = getComputedStyle(on(e) ?? e).display;
1240
1240
  return t === "flex" || t === "inline-flex";
1241
1241
  }
1242
- function Fn(e) {
1242
+ function Hn(e) {
1243
1243
  const t = getComputedStyle(e);
1244
- return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || _n(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" || Gn.test(t.willChange) || t.webkitOverflowScrolling === "touch");
1244
+ return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || Vn(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" || qn.test(t.willChange) || t.webkitOverflowScrolling === "touch");
1245
1245
  }
1246
- function xt(e) {
1246
+ function wt(e) {
1247
1247
  let t = e.length;
1248
1248
  for (; t--; ) {
1249
1249
  const n = e[t];
1250
- if (T(n, "Missing node"), Fn(n)) return n;
1250
+ if (D(n, "Missing node"), Hn(n)) return n;
1251
1251
  }
1252
1252
  return null;
1253
1253
  }
1254
- function wt(e) {
1254
+ function zt(e) {
1255
1255
  return e && Number(getComputedStyle(e).zIndex) || 0;
1256
1256
  }
1257
- function zt(e) {
1257
+ function It(e) {
1258
1258
  const t = [];
1259
1259
  for (; e; )
1260
- t.push(e), e = Qt(e);
1260
+ t.push(e), e = on(e);
1261
1261
  return t;
1262
1262
  }
1263
- function Qt(e) {
1263
+ function on(e) {
1264
1264
  const { parentNode: t } = e;
1265
- return On(t) ? t.host : t;
1265
+ return Fn(t) ? t.host : t;
1266
1266
  }
1267
- function qn(e, t) {
1267
+ function jn(e, t) {
1268
1268
  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;
1269
1269
  }
1270
- function Bn(e) {
1270
+ function Un(e) {
1271
1271
  try {
1272
1272
  return e.matches(":modal");
1273
1273
  } catch {
1274
1274
  return !1;
1275
1275
  }
1276
1276
  }
1277
- function Vn({
1277
+ function Wn({
1278
1278
  axisElement: e,
1279
1279
  hitRegion: t,
1280
1280
  pointerEventTarget: n
1281
1281
  }) {
1282
- if (ot(n)) {
1282
+ if (rt(n)) {
1283
1283
  const o = n.closest("dialog");
1284
- if (o && !o.contains(e) && Bn(o))
1284
+ if (o && !o.contains(e) && Un(o))
1285
1285
  return !1;
1286
1286
  }
1287
- if (!ot(n) || n.contains(e) || e.contains(n))
1287
+ if (!rt(n) || n.contains(e) || e.contains(n))
1288
1288
  return !0;
1289
- if (Nn(n, e) > 0) {
1289
+ if (Bn(n, e) > 0) {
1290
1290
  let o = n;
1291
1291
  for (; o; ) {
1292
1292
  if (o.contains(e))
1293
1293
  return !0;
1294
- if (qn(o.getBoundingClientRect(), t))
1294
+ if (jn(o.getBoundingClientRect(), t))
1295
1295
  return !1;
1296
1296
  o = o.parentElement;
1297
1297
  }
1298
1298
  }
1299
1299
  return !0;
1300
1300
  }
1301
- function dt(e, t) {
1301
+ function ft(e, t) {
1302
1302
  const n = [];
1303
1303
  return t.forEach((o, r) => {
1304
1304
  if (r.disabled)
1305
1305
  return;
1306
- const i = ct({ axis: r }), s = Dn(r.orientation, i, {
1306
+ const i = ut({ axis: r }), s = _n(r.orientation, i, {
1307
1307
  x: e.clientX,
1308
1308
  y: e.clientY
1309
1309
  });
1310
- s && s.distance.x <= 0 && s.distance.y <= 0 && Vn({
1310
+ s && s.distance.x <= 0 && s.distance.y <= 0 && Wn({
1311
1311
  axisElement: r.element,
1312
1312
  hitRegion: s.hitRegion.rect,
1313
1313
  pointerEventTarget: e.target
1314
1314
  }) && n.push(s.hitRegion);
1315
1315
  }), n;
1316
1316
  }
1317
- function ge({
1317
+ function ye({
1318
1318
  layout: e,
1319
1319
  itemConstraints: t
1320
1320
  }) {
@@ -1329,16 +1329,16 @@ function ge({
1329
1329
  if (!Y(r, 100) && o.length > 0)
1330
1330
  for (let s = 0; s < t.length; s++) {
1331
1331
  const l = o[s];
1332
- T(l != null, `No layout data found for index ${s}`);
1332
+ D(l != null, `No layout data found for index ${s}`);
1333
1333
  const a = 100 / r * l;
1334
1334
  o[s] = a;
1335
1335
  }
1336
1336
  let i = 0;
1337
1337
  for (let s = 0; s < t.length; s++) {
1338
1338
  const l = n[s];
1339
- T(l != null, `No layout data found for index ${s}`);
1339
+ D(l != null, `No layout data found for index ${s}`);
1340
1340
  const a = o[s];
1341
- T(a != null, `No layout data found for index ${s}`);
1341
+ D(a != null, `No layout data found for index ${s}`);
1342
1342
  const c = Ee({
1343
1343
  overrideDisabledItems: !0,
1344
1344
  itemConstraints: t[s],
@@ -1350,7 +1350,7 @@ function ge({
1350
1350
  if (!Y(i, 0))
1351
1351
  for (let s = 0; s < t.length; s++) {
1352
1352
  const l = o[s];
1353
- T(l != null, `No layout data found for index ${s}`);
1353
+ D(l != null, `No layout data found for index ${s}`);
1354
1354
  const a = l + i, c = Ee({
1355
1355
  overrideDisabledItems: !0,
1356
1356
  itemConstraints: t[s],
@@ -1362,20 +1362,20 @@ function ge({
1362
1362
  }
1363
1363
  return o.reduce((s, l, a) => (s[t[a].itemId] = l, s), {});
1364
1364
  }
1365
- function ft({
1365
+ function mt({
1366
1366
  axisId: e,
1367
1367
  itemId: t
1368
1368
  }) {
1369
1369
  const n = () => {
1370
- const a = ye();
1370
+ const a = he();
1371
1371
  for (const [
1372
1372
  c,
1373
1373
  {
1374
1374
  defaultLayoutDeferred: u,
1375
1375
  derivedItemConstraints: d,
1376
- layout: g,
1377
- axisSize: m,
1378
- separatorToItems: y
1376
+ layout: p,
1377
+ axisSize: y,
1378
+ separatorToItems: m
1379
1379
  }
1380
1380
  ] of a)
1381
1381
  if (c.id === e)
@@ -1383,9 +1383,9 @@ function ft({
1383
1383
  defaultLayoutDeferred: u,
1384
1384
  derivedItemConstraints: d,
1385
1385
  axis: c,
1386
- axisSize: m,
1387
- layout: g,
1388
- separatorToItems: y
1386
+ axisSize: y,
1387
+ layout: p,
1388
+ separatorToItems: m
1389
1389
  };
1390
1390
  throw Error(`Group ${e} not found`);
1391
1391
  }, o = () => {
@@ -1411,22 +1411,22 @@ function ft({
1411
1411
  prevLayout: u,
1412
1412
  derivedItemConstraints: d
1413
1413
  }) => {
1414
- const g = i(), m = c.findIndex((p) => p.id === t), y = m === 0, f = m === c.length - 1;
1415
- if (f && a < g && (y || c.slice(0, m).every((p, h) => {
1416
- const I = d[h];
1414
+ const p = i(), y = c.findIndex((h) => h.id === t), m = y === 0, f = y === c.length - 1;
1415
+ if (f && a < p && (m || c.slice(0, y).every((h, g) => {
1416
+ const I = d[g];
1417
1417
  return I?.collapsible && Y(I.collapsedSize, u[I.itemId]);
1418
1418
  }))) {
1419
- const p = c.slice(0, m).reduce((h, I) => h + u[I.id], 0);
1419
+ const h = c.slice(0, y).reduce((g, I) => g + u[I.id], 0);
1420
1420
  return {
1421
1421
  ...u,
1422
- [t]: X(100 - p)
1422
+ [t]: X(100 - h)
1423
1423
  };
1424
1424
  }
1425
- return qe({
1426
- delta: f ? g - a : a - g,
1425
+ return Fe({
1426
+ delta: f ? p - a : a - p,
1427
1427
  initialLayout: u,
1428
1428
  itemConstraints: d,
1429
- pivotIndices: f ? [m - 1, m] : [m, m + 1],
1429
+ pivotIndices: f ? [y - 1, y] : [y, y + 1],
1430
1430
  prevLayout: u,
1431
1431
  trigger: "imperative-api"
1432
1432
  });
@@ -1437,26 +1437,26 @@ function ft({
1437
1437
  const {
1438
1438
  defaultLayoutDeferred: u,
1439
1439
  derivedItemConstraints: d,
1440
- axis: g,
1441
- axisSize: m,
1442
- layout: y,
1440
+ axis: p,
1441
+ axisSize: y,
1442
+ layout: m,
1443
1443
  separatorToItems: f
1444
1444
  } = n(), S = s({
1445
1445
  nextSize: a,
1446
- items: g.items,
1447
- prevLayout: y,
1446
+ items: p.items,
1447
+ prevLayout: m,
1448
1448
  derivedItemConstraints: d
1449
- }), p = ge({
1449
+ }), h = ye({
1450
1450
  layout: S,
1451
1451
  itemConstraints: d
1452
1452
  });
1453
- ie(y, p) || fe(g, {
1453
+ ie(m, h) || fe(p, {
1454
1454
  defaultLayoutDeferred: u,
1455
1455
  derivedItemConstraints: d,
1456
- axisSize: m,
1457
- layout: p,
1458
- requestedAxisSize: m,
1459
- requestedLayout: p,
1456
+ axisSize: y,
1457
+ layout: h,
1458
+ requestedAxisSize: y,
1459
+ requestedLayout: h,
1460
1460
  separatorToItems: f
1461
1461
  });
1462
1462
  };
@@ -1466,10 +1466,10 @@ function ft({
1466
1466
  a && d !== c && (u.expandToSize = d, l(c));
1467
1467
  },
1468
1468
  expand: () => {
1469
- const { collapsible: a, collapsedSize: c, minSize: u } = o(), { mutableValues: d } = r(), g = i();
1470
- if (a && g === c) {
1471
- let m = d.expandToSize ?? u;
1472
- m === 0 && (m = 1), l(m);
1469
+ const { collapsible: a, collapsedSize: c, minSize: u } = o(), { mutableValues: d } = r(), p = i();
1470
+ if (a && p === c) {
1471
+ let y = d.expandToSize ?? u;
1472
+ y === 0 && (y = 1), l(y);
1473
1473
  }
1474
1474
  },
1475
1475
  getSize: () => {
@@ -1484,26 +1484,26 @@ function ft({
1484
1484
  return a && Y(c, u);
1485
1485
  },
1486
1486
  resize: (a) => {
1487
- const { axis: c } = n(), { element: u } = r(), d = ke({ axis: c }), g = Ce({
1487
+ const { axis: c } = n(), { element: u } = r(), d = ke({ axis: c }), p = Ce({
1488
1488
  axisSize: d,
1489
1489
  itemElement: u,
1490
1490
  styleProp: a
1491
- }), m = X(g / d * 100);
1492
- l(m);
1491
+ }), y = X(p / d * 100);
1492
+ l(y);
1493
1493
  }
1494
1494
  };
1495
1495
  }
1496
- function It(e) {
1496
+ function Lt(e) {
1497
1497
  if (e.defaultPrevented)
1498
1498
  return;
1499
- const t = ye();
1500
- dt(e, t).forEach((o) => {
1499
+ const t = he();
1500
+ ft(e, t).forEach((o) => {
1501
1501
  if (o.separator && !o.separator.disableDoubleClick) {
1502
1502
  const r = o.items.find(
1503
1503
  (i) => i.constraintProps.defaultSize !== void 0
1504
1504
  );
1505
1505
  if (r) {
1506
- const i = r.constraintProps.defaultSize, s = ft({
1506
+ const i = r.constraintProps.defaultSize, s = mt({
1507
1507
  axisId: o.axis.id,
1508
1508
  itemId: r.id
1509
1509
  });
@@ -1512,8 +1512,8 @@ function It(e) {
1512
1512
  }
1513
1513
  });
1514
1514
  }
1515
- function en(e) {
1516
- const t = ye();
1515
+ function rn(e) {
1516
+ const t = he();
1517
1517
  for (const [n] of t)
1518
1518
  if (n.separators.some(
1519
1519
  (o) => o.element === e
@@ -1525,7 +1525,7 @@ function Ge({
1525
1525
  axisId: e
1526
1526
  }) {
1527
1527
  const t = () => {
1528
- const n = ye();
1528
+ const n = he();
1529
1529
  for (const [o, r] of n)
1530
1530
  if (o.id === e)
1531
1531
  return { axis: o, ...r };
@@ -1544,7 +1544,7 @@ function Ge({
1544
1544
  axisSize: s,
1545
1545
  layout: l,
1546
1546
  separatorToItems: a
1547
- } = t(), c = ge({
1547
+ } = t(), c = ye({
1548
1548
  layout: n,
1549
1549
  itemConstraints: r
1550
1550
  });
@@ -1561,20 +1561,20 @@ function Ge({
1561
1561
  };
1562
1562
  }
1563
1563
  function we(e, t) {
1564
- const n = en(e), o = se(n.id, !0), r = n.separators.find(
1564
+ const n = rn(e), o = ae(n.id, !0), r = n.separators.find(
1565
1565
  (d) => d.element === e
1566
1566
  );
1567
- T(r, "Matching separator not found");
1567
+ D(r, "Matching separator not found");
1568
1568
  const i = o.separatorToItems.get(r);
1569
- T(i, "Matching panels not found");
1570
- const s = i.map((d) => n.items.indexOf(d)), a = Ge({ axisId: n.id }).getLayout(), c = qe({
1569
+ D(i, "Matching panels not found");
1570
+ const s = i.map((d) => n.items.indexOf(d)), a = Ge({ axisId: n.id }).getLayout(), c = Fe({
1571
1571
  delta: t,
1572
1572
  initialLayout: a,
1573
1573
  itemConstraints: o.derivedItemConstraints,
1574
1574
  pivotIndices: s,
1575
1575
  prevLayout: a,
1576
1576
  trigger: "keyboard"
1577
- }), u = ge({
1577
+ }), u = ye({
1578
1578
  layout: c,
1579
1579
  itemConstraints: o.derivedItemConstraints
1580
1580
  });
@@ -1596,10 +1596,10 @@ function we(e, t) {
1596
1596
  { isUserInteraction: !0 }
1597
1597
  );
1598
1598
  }
1599
- function Lt(e) {
1599
+ function Ct(e) {
1600
1600
  if (e.defaultPrevented)
1601
1601
  return;
1602
- const t = e.currentTarget, n = en(t);
1602
+ const t = e.currentTarget, n = rn(t);
1603
1603
  if (!(n.disabled || n.separators.find(
1604
1604
  (r) => r.element === t
1605
1605
  )?.disabled))
@@ -1626,18 +1626,18 @@ function Lt(e) {
1626
1626
  }
1627
1627
  case "Enter": {
1628
1628
  e.preventDefault();
1629
- const r = se(n.id, !0), { derivedItemConstraints: i, layout: s, separatorToItems: l } = r, a = n.separators.find(
1630
- (g) => g.element === t
1629
+ const r = ae(n.id, !0), { derivedItemConstraints: i, layout: s, separatorToItems: l } = r, a = n.separators.find(
1630
+ (p) => p.element === t
1631
1631
  );
1632
- T(a, "Matching separator not found");
1632
+ D(a, "Matching separator not found");
1633
1633
  const c = l.get(a);
1634
- T(c, "Matching panels not found");
1634
+ D(c, "Matching panels not found");
1635
1635
  const u = c[0], d = i.find(
1636
- (g) => g.itemId === u.id
1636
+ (p) => p.itemId === u.id
1637
1637
  );
1638
- if (T(d, "Panel metadata not found"), d.collapsible) {
1639
- const g = s[u.id], m = d.collapsedSize === g ? n.mutableState.expandedItemSizes[u.id] ?? d.minSize : d.collapsedSize;
1640
- we(t, m - g);
1638
+ if (D(d, "Panel metadata not found"), d.collapsible) {
1639
+ const p = s[u.id], y = d.collapsedSize === p ? n.mutableState.expandedItemSizes[u.id] ?? d.minSize : d.collapsedSize;
1640
+ we(t, y - p);
1641
1641
  }
1642
1642
  break;
1643
1643
  }
@@ -1648,7 +1648,7 @@ function Lt(e) {
1648
1648
  ), i = Array.from(r).findIndex(
1649
1649
  (a) => a === e.currentTarget
1650
1650
  );
1651
- T(i !== null, "Index not found");
1651
+ D(i !== null, "Index not found");
1652
1652
  const s = e.shiftKey ? i > 0 ? i - 1 : r.length - 1 : i + 1 < r.length ? i + 1 : 0;
1653
1653
  r[s].focus({
1654
1654
  preventScroll: !0
@@ -1661,14 +1661,53 @@ function Lt(e) {
1661
1661
  }
1662
1662
  }
1663
1663
  }
1664
- function Hn(e, t) {
1664
+ function Je(e) {
1665
+ const t = se();
1666
+ if (t.state !== "active")
1667
+ return !1;
1668
+ const n = he();
1669
+ return t.previewLayoutMap.forEach((o, r) => {
1670
+ const i = n.get(r);
1671
+ r.resizePreviewMode === "separator" && i && !ie(o, i.layout) && fe(r, {
1672
+ ...i,
1673
+ layout: o,
1674
+ requestedAxisSize: i.axisSize,
1675
+ requestedLayout: o
1676
+ });
1677
+ }), de({
1678
+ cursorFlags: 0,
1679
+ state: "inactive"
1680
+ }), t.hitRegions.forEach((o) => {
1681
+ if (!n.has(o.axis))
1682
+ return;
1683
+ const r = ae(o.axis.id, !0);
1684
+ fe(o.axis, r, {
1685
+ isUserInteraction: !0
1686
+ });
1687
+ }), Ve(e), !0;
1688
+ }
1689
+ function Rt(e) {
1690
+ const t = se();
1691
+ if (t.state !== "active")
1692
+ return;
1693
+ const n = t.hitRegions.flatMap(
1694
+ ({ separator: o }) => o ? [o.element] : []
1695
+ );
1696
+ !n.some((o) => o === e.target) || n.some(
1697
+ (o) => o.hasPointerCapture?.(e.pointerId)
1698
+ ) || Je(e.currentTarget);
1699
+ }
1700
+ function Mt(e) {
1701
+ Je(e.currentTarget);
1702
+ }
1703
+ function Yn(e, t) {
1665
1704
  const { element: n, orientation: o, items: r } = e, i = n.getBoundingClientRect(), s = o === "horizontal";
1666
- return ct({
1705
+ return ut({
1667
1706
  expandHitTargets: !1,
1668
1707
  axis: e,
1669
1708
  includeDisabled: !0
1670
1709
  }).map(({ items: a, rect: c, separator: u }, d) => {
1671
- const g = r.indexOf(a[0]), m = s ? c.left + c.width / 2 : c.top + c.height / 2;
1710
+ const p = r.indexOf(a[0]), y = s ? c.left + c.width / 2 : c.top + c.height / 2;
1672
1711
  return {
1673
1712
  active: t.some((f) => {
1674
1713
  if (f.axis !== e || f.items[0] !== a[0])
@@ -1676,15 +1715,15 @@ function Hn(e, t) {
1676
1715
  if (u || f.separator)
1677
1716
  return f.separator === u;
1678
1717
  const S = s ? f.rect.left + f.rect.width / 2 : f.rect.top + f.rect.height / 2;
1679
- return Y(m, S);
1718
+ return Y(y, S);
1680
1719
  }),
1681
1720
  axis: e,
1682
1721
  key: u ? `separator-${u.id}` : `panel-${a[0].id}-${d}`,
1683
1722
  offset: 0,
1684
- itemIndex: g,
1723
+ itemIndex: p,
1685
1724
  rect: new DOMRect(
1686
- (s && !u ? m : c.left) - i.left - n.clientLeft + n.scrollLeft,
1687
- (!s && !u ? m : c.top) - i.top - n.clientTop + n.scrollTop,
1725
+ (s && !u ? y : c.left) - i.left - n.clientLeft + n.scrollLeft,
1726
+ (!s && !u ? y : c.top) - i.top - n.clientTop + n.scrollTop,
1688
1727
  s && !u ? 0 : c.width,
1689
1728
  !s && !u ? 0 : c.height
1690
1729
  ),
@@ -1692,12 +1731,12 @@ function Hn(e, t) {
1692
1731
  };
1693
1732
  });
1694
1733
  }
1695
- function Ct(e) {
1734
+ function Et(e) {
1696
1735
  if (e.defaultPrevented)
1697
1736
  return;
1698
1737
  if (e.pointerType === "mouse" && e.button > 0)
1699
1738
  return;
1700
- const t = ye(), n = dt(e, t);
1739
+ const t = he(), n = ft(e, t);
1701
1740
  if (n.length === 0)
1702
1741
  return;
1703
1742
  const o = /* @__PURE__ */ new Map();
@@ -1712,9 +1751,9 @@ function Ct(e) {
1712
1751
  l && o.set(s.axis, l.layout);
1713
1752
  });
1714
1753
  const i = Array.from(o.keys()).flatMap(
1715
- (s) => s.resizePreviewMode === "separator" ? Hn(s, n) : []
1754
+ (s) => s.resizePreviewMode === "separator" ? Yn(s, n) : []
1716
1755
  );
1717
- ue({
1756
+ de({
1718
1757
  cursorFlags: 0,
1719
1758
  didPointerMove: !1,
1720
1759
  hitRegions: n,
@@ -1725,11 +1764,11 @@ function Ct(e) {
1725
1764
  state: "active"
1726
1765
  }), e.preventDefault();
1727
1766
  }
1728
- function Rt(e) {
1729
- const t = ye(), n = de();
1767
+ function Pt(e) {
1768
+ const t = he(), n = se();
1730
1769
  switch (n.state) {
1731
1770
  case "active":
1732
- ut({
1771
+ dt({
1733
1772
  commit: !1,
1734
1773
  document: e.currentTarget,
1735
1774
  event: e,
@@ -1740,35 +1779,17 @@ function Rt(e) {
1740
1779
  });
1741
1780
  }
1742
1781
  }
1743
- function Mt(e) {
1782
+ function kt(e) {
1744
1783
  if (e.defaultPrevented)
1745
1784
  return;
1746
- const t = de(), n = ye();
1785
+ const t = se(), n = he();
1747
1786
  switch (t.state) {
1748
1787
  case "active": {
1749
1788
  if (
1750
1789
  // Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
1751
1790
  e.buttons === 0
1752
1791
  ) {
1753
- t.previewLayoutMap.forEach((o, r) => {
1754
- const i = n.get(r);
1755
- r.resizePreviewMode === "separator" && i && !ie(o, i.layout) && fe(r, {
1756
- ...i,
1757
- layout: o,
1758
- requestedAxisSize: i.axisSize,
1759
- requestedLayout: o
1760
- });
1761
- }), ue({
1762
- cursorFlags: 0,
1763
- state: "inactive"
1764
- }), t.hitRegions.forEach((o) => {
1765
- if (!n.has(o.axis))
1766
- return;
1767
- const r = se(o.axis.id, !0);
1768
- fe(o.axis, r, {
1769
- isUserInteraction: !0
1770
- });
1771
- }), _e(e.currentTarget);
1792
+ Je(e.currentTarget);
1772
1793
  return;
1773
1794
  }
1774
1795
  for (const o of t.hitRegions)
@@ -1776,7 +1797,7 @@ function Mt(e) {
1776
1797
  const { element: r } = o.separator;
1777
1798
  r.isConnected && !r.hasPointerCapture?.(e.pointerId) && r.setPointerCapture?.(e.pointerId);
1778
1799
  }
1779
- ut({
1800
+ dt({
1780
1801
  commit: !1,
1781
1802
  document: e.currentTarget,
1782
1803
  event: e,
@@ -1789,40 +1810,43 @@ function Mt(e) {
1789
1810
  break;
1790
1811
  }
1791
1812
  default: {
1792
- const o = dt(e, n);
1793
- o.length === 0 ? t.state !== "inactive" && ue({
1813
+ const o = ft(e, n);
1814
+ o.length === 0 ? t.state !== "inactive" && de({
1794
1815
  cursorFlags: 0,
1795
1816
  state: "inactive"
1796
- }) : ue({
1817
+ }) : de({
1797
1818
  cursorFlags: 0,
1798
1819
  hitRegions: o,
1799
1820
  state: "hover"
1800
- }), _e(e.currentTarget);
1821
+ }), Ve(e.currentTarget);
1801
1822
  break;
1802
1823
  }
1803
1824
  }
1804
1825
  }
1805
- function Et(e) {
1826
+ function Tt(e) {
1806
1827
  if (e.relatedTarget instanceof HTMLIFrameElement)
1807
- switch (de().state) {
1828
+ switch (se().state) {
1808
1829
  case "hover":
1809
- ue({
1830
+ de({
1810
1831
  cursorFlags: 0,
1811
1832
  state: "inactive"
1812
1833
  });
1813
1834
  }
1814
1835
  }
1815
- function Pt(e) {
1836
+ function $t(e) {
1816
1837
  if (e.defaultPrevented)
1817
1838
  return;
1818
1839
  if (e.pointerType === "mouse" && e.button > 0)
1819
1840
  return;
1820
- Zt(
1841
+ nn(
1821
1842
  e.currentTarget,
1822
1843
  e
1823
1844
  ) && e.preventDefault();
1824
1845
  }
1825
- function jn(e) {
1846
+ function At(e) {
1847
+ e.target === e.currentTarget && Je(e.currentTarget.document);
1848
+ }
1849
+ function Kn(e) {
1826
1850
  let t = 0, n = 0;
1827
1851
  const o = {};
1828
1852
  for (const i of e)
@@ -1840,7 +1864,7 @@ function jn(e) {
1840
1864
  }
1841
1865
  return o;
1842
1866
  }
1843
- function Un(e, t) {
1867
+ function Xn(e, t) {
1844
1868
  const n = e.map((r) => r.id), o = Object.keys(t);
1845
1869
  if (n.length !== o.length)
1846
1870
  return !1;
@@ -1849,18 +1873,18 @@ function Un(e, t) {
1849
1873
  return !1;
1850
1874
  return !0;
1851
1875
  }
1852
- function kt({
1876
+ function Dt({
1853
1877
  axis: e,
1854
1878
  itemConstraints: t
1855
1879
  }) {
1856
1880
  const n = e.items.map(({ id: r }) => r).join(","), o = e.mutableState.defaultLayout;
1857
- return e.mutableState.layouts[n] ?? (o && Un(e.items, o) ? o : jn(t));
1881
+ return e.mutableState.layouts[n] ?? (o && Xn(e.items, o) ? o : Kn(t));
1858
1882
  }
1859
- function $t({
1883
+ function Ot({
1860
1884
  itemIds: e,
1861
1885
  layout: t
1862
1886
  }) {
1863
- return ge({
1887
+ return ye({
1864
1888
  layout: t,
1865
1889
  itemConstraints: e.map((n) => ({
1866
1890
  collapsedSize: 0,
@@ -1873,7 +1897,7 @@ function $t({
1873
1897
  }))
1874
1898
  });
1875
1899
  }
1876
- function Wn(e, t, n) {
1900
+ function Jn(e, t, n) {
1877
1901
  if (!n[0])
1878
1902
  return;
1879
1903
  const r = e.items.find((c) => c.element === t);
@@ -1885,7 +1909,7 @@ function Wn(e, t, n) {
1885
1909
  };
1886
1910
  r.mutableValues.prevSize = a, r.onResize(a, r.id, l);
1887
1911
  }
1888
- function tn(e, t) {
1912
+ function sn(e, t) {
1889
1913
  if (Object.keys(e).length !== Object.keys(t).length)
1890
1914
  return !1;
1891
1915
  for (const o in e)
@@ -1893,10 +1917,10 @@ function tn(e, t) {
1893
1917
  return !1;
1894
1918
  return !0;
1895
1919
  }
1896
- function Yn(e, t) {
1897
- return e.length !== t.length ? !1 : e.every((n, o) => tn(n, t[o]));
1920
+ function Zn(e, t) {
1921
+ return e.length !== t.length ? !1 : e.every((n, o) => sn(n, t[o]));
1898
1922
  }
1899
- function Kn({
1923
+ function Qn({
1900
1924
  axis: e,
1901
1925
  nextAxisSize: t,
1902
1926
  prevAxisSize: n,
@@ -1907,19 +1931,19 @@ function Kn({
1907
1931
  let r = 0, i = 0, s = !1;
1908
1932
  const l = /* @__PURE__ */ new Map(), a = [];
1909
1933
  for (const d of e.items) {
1910
- const g = o[d.id] ?? 0;
1934
+ const p = o[d.id] ?? 0;
1911
1935
  switch (d.constraintProps.groupResizeBehavior) {
1912
1936
  case "preserve-pixel-size": {
1913
1937
  s = !0;
1914
- const m = g / 100 * n, y = X(
1915
- m / t * 100
1938
+ const y = p / 100 * n, m = X(
1939
+ y / t * 100
1916
1940
  );
1917
- l.set(d.id, y), r += y;
1941
+ l.set(d.id, m), r += m;
1918
1942
  break;
1919
1943
  }
1920
1944
  case "preserve-relative-size":
1921
1945
  default: {
1922
- a.push(d.id), i += g;
1946
+ a.push(d.id), i += p;
1923
1947
  break;
1924
1948
  }
1925
1949
  }
@@ -1927,135 +1951,151 @@ function Kn({
1927
1951
  if (!s || a.length === 0)
1928
1952
  return o;
1929
1953
  const c = 100 - r, u = { ...o };
1930
- if (l.forEach((d, g) => {
1931
- u[g] = d;
1954
+ if (l.forEach((d, p) => {
1955
+ u[p] = d;
1932
1956
  }), i > 0)
1933
1957
  for (const d of a) {
1934
- const g = o[d] ?? 0;
1958
+ const p = o[d] ?? 0;
1935
1959
  u[d] = X(
1936
- g / i * c
1960
+ p / i * c
1937
1961
  );
1938
1962
  }
1939
1963
  else {
1940
1964
  const d = X(c / a.length);
1941
- for (const g of a)
1942
- u[g] = d;
1965
+ for (const p of a)
1966
+ u[p] = d;
1943
1967
  }
1944
1968
  return u;
1945
1969
  }
1946
1970
  const Le = /* @__PURE__ */ new Map();
1947
- function nn(e) {
1971
+ function an(e) {
1948
1972
  let t = !0;
1949
- T(
1973
+ D(
1950
1974
  e.element.ownerDocument.defaultView,
1951
1975
  "Cannot register an unmounted Group"
1952
1976
  );
1953
1977
  const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = new n((m) => {
1954
- for (const y of m) {
1955
- const { borderBoxSize: f, target: S } = y;
1956
- if (S === e.element) {
1978
+ for (const f of m) {
1979
+ const { borderBoxSize: S, target: h } = f;
1980
+ if (h === e.element) {
1957
1981
  if (t) {
1958
- const p = ke({ axis: e });
1959
- if (p === 0)
1982
+ const g = ke({ axis: e });
1983
+ if (g === 0)
1960
1984
  return;
1961
- const h = se(e.id);
1962
- if (!h)
1985
+ const I = ae(e.id);
1986
+ if (!I)
1963
1987
  return;
1964
- const I = rt(e);
1965
- let x = h.requestedAxisSize, C = h.requestedLayout;
1966
- h.defaultLayoutDeferred && (x = p, C = $t({
1967
- itemIds: e.items.map(({ id: b }) => b),
1968
- layout: kt({
1988
+ const x = it(e);
1989
+ let C = I.requestedAxisSize, A = I.requestedLayout;
1990
+ I.defaultLayoutDeferred && (C = g, A = Ot({
1991
+ itemIds: e.items.map(({ id: w }) => w),
1992
+ layout: Dt({
1969
1993
  axis: e,
1970
- itemConstraints: I
1994
+ itemConstraints: x
1971
1995
  })
1972
1996
  }));
1973
- const N = Kn({
1997
+ const N = Qn({
1974
1998
  axis: e,
1975
- nextAxisSize: p,
1976
- prevAxisSize: x,
1977
- prevLayout: C
1978
- }), D = ge({
1999
+ nextAxisSize: g,
2000
+ prevAxisSize: C,
2001
+ prevLayout: A
2002
+ }), b = ye({
1979
2003
  layout: N,
1980
- itemConstraints: I
2004
+ itemConstraints: x
1981
2005
  });
1982
- if (!h.defaultLayoutDeferred && ie(h.layout, D) && Yn(
1983
- h.derivedItemConstraints,
1984
- I
1985
- ) && h.axisSize === p)
2006
+ if (!I.defaultLayoutDeferred && ie(I.layout, b) && Zn(
2007
+ I.derivedItemConstraints,
2008
+ x
2009
+ ) && I.axisSize === g)
1986
2010
  continue;
1987
2011
  fe(e, {
1988
2012
  defaultLayoutDeferred: !1,
1989
- derivedItemConstraints: I,
1990
- axisSize: p,
1991
- layout: D,
1992
- requestedAxisSize: x,
1993
- requestedLayout: C,
1994
- separatorToItems: h.separatorToItems
2013
+ derivedItemConstraints: x,
2014
+ axisSize: g,
2015
+ layout: b,
2016
+ requestedAxisSize: C,
2017
+ requestedLayout: A,
2018
+ separatorToItems: I.separatorToItems
1995
2019
  });
1996
2020
  }
1997
2021
  } else
1998
- Wn(e, S, f);
2022
+ Jn(e, h, S);
1999
2023
  }
2000
2024
  });
2001
2025
  i.observe(e.element), e.items.forEach((m) => {
2002
- T(
2026
+ D(
2003
2027
  !o.has(m.id),
2004
2028
  `Panel ids must be unique; id "${m.id}" was used more than once`
2005
2029
  ), o.add(m.id), m.onResize && i.observe(m.element);
2006
2030
  });
2007
- const s = ke({ axis: e }), l = rt(e), a = kt({
2031
+ const s = ke({ axis: e }), l = it(e), a = Dt({
2008
2032
  axis: e,
2009
2033
  itemConstraints: l
2010
- }), c = ge({
2034
+ }), c = ye({
2011
2035
  layout: a,
2012
2036
  itemConstraints: l
2013
- }), u = e.element.ownerDocument;
2037
+ }), u = e.element.ownerDocument, d = u.defaultView;
2014
2038
  Le.set(
2015
2039
  u,
2016
2040
  (Le.get(u) ?? 0) + 1
2017
2041
  );
2018
- const d = /* @__PURE__ */ new Map();
2019
- return ct({ axis: e, includeDisabled: !0 }).forEach((m) => {
2020
- m.separator && d.set(m.separator, m.items);
2042
+ const p = /* @__PURE__ */ new Map();
2043
+ return ut({ axis: e, includeDisabled: !0 }).forEach((m) => {
2044
+ m.separator && p.set(m.separator, m.items);
2021
2045
  }), fe(e, {
2022
2046
  defaultLayoutDeferred: s === 0,
2023
2047
  derivedItemConstraints: l,
2024
2048
  axisSize: s,
2025
2049
  layout: c,
2026
2050
  requestedAxisSize: s,
2027
- requestedLayout: $t({
2051
+ requestedLayout: Ot({
2028
2052
  itemIds: e.items.map(({ id: m }) => m),
2029
2053
  layout: a
2030
2054
  }),
2031
- separatorToItems: d
2055
+ separatorToItems: p
2032
2056
  }), e.separators.forEach((m) => {
2033
- T(
2057
+ D(
2034
2058
  !r.has(m.id),
2035
2059
  `Separator ids must be unique; id "${m.id}" was used more than once`
2036
- ), r.add(m.id), m.element.addEventListener("keydown", Lt);
2037
- }), Le.get(u) === 1 && (u.addEventListener("contextmenu", bt, !0), u.addEventListener("dblclick", It, !0), u.addEventListener("pointerdown", Ct, !0), u.addEventListener("pointerleave", Rt), u.addEventListener("pointermove", Mt), u.addEventListener("pointerout", Et), u.addEventListener("pointerup", Pt, !0)), function() {
2060
+ ), r.add(m.id), m.element.addEventListener("keydown", Ct);
2061
+ }), Le.get(u) === 1 && (u.addEventListener("contextmenu", xt, !0), u.addEventListener("dblclick", Lt, !0), u.addEventListener(
2062
+ "lostpointercapture",
2063
+ Rt,
2064
+ !0
2065
+ ), u.addEventListener(
2066
+ "pointercancel",
2067
+ Mt,
2068
+ !0
2069
+ ), u.addEventListener("pointerdown", Et, !0), u.addEventListener("pointerleave", Pt), u.addEventListener("pointermove", kt), u.addEventListener("pointerout", Tt), u.addEventListener("pointerup", $t, !0), d?.addEventListener("blur", At)), function() {
2038
2070
  t = !1, Le.set(
2039
2071
  u,
2040
2072
  Math.max(0, (Le.get(u) ?? 0) - 1)
2041
- ), An(e), zn(e) && _e(u), e.separators.forEach((y) => {
2042
- y.element.removeEventListener("keydown", Lt);
2073
+ ), Nn(e), Rn(e) && Ve(u), e.separators.forEach((f) => {
2074
+ f.element.removeEventListener("keydown", Ct);
2043
2075
  }), Le.get(u) || (u.removeEventListener(
2044
2076
  "contextmenu",
2045
- bt,
2077
+ xt,
2046
2078
  !0
2047
2079
  ), u.removeEventListener(
2048
2080
  "dblclick",
2049
- It,
2081
+ Lt,
2082
+ !0
2083
+ ), u.removeEventListener(
2084
+ "lostpointercapture",
2085
+ Rt,
2086
+ !0
2087
+ ), u.removeEventListener(
2088
+ "pointercancel",
2089
+ Mt,
2050
2090
  !0
2051
2091
  ), u.removeEventListener(
2052
2092
  "pointerdown",
2053
- Ct,
2093
+ Et,
2054
2094
  !0
2055
- ), u.removeEventListener("pointerleave", Rt), u.removeEventListener("pointermove", Mt), u.removeEventListener("pointerout", Et), u.removeEventListener("pointerup", Pt, !0)), i.disconnect();
2095
+ ), u.removeEventListener("pointerleave", Pt), u.removeEventListener("pointermove", kt), u.removeEventListener("pointerout", Tt), u.removeEventListener("pointerup", $t, !0), d?.removeEventListener("blur", At)), i.disconnect();
2056
2096
  };
2057
2097
  }
2058
- function on({
2098
+ function ln({
2059
2099
  derivedItemConstraints: e,
2060
2100
  axis: t,
2061
2101
  layout: n,
@@ -2076,19 +2116,19 @@ function on({
2076
2116
  }
2077
2117
  });
2078
2118
  }
2079
- function rn() {
2119
+ function cn() {
2080
2120
  const [e, t] = pe({}), n = re(() => t({}), []);
2081
2121
  return [e, n];
2082
2122
  }
2083
- function Je(e) {
2084
- const t = q({ ...e });
2123
+ function Ze(e) {
2124
+ const t = B({ ...e });
2085
2125
  return ne(() => {
2086
2126
  for (const n in e)
2087
2127
  t.current[n] = e[n];
2088
2128
  }, [e]), t.current;
2089
2129
  }
2090
- const mt = Gt(null);
2091
- function Xn({
2130
+ const pt = qt(null);
2131
+ function eo({
2092
2132
  layout: e,
2093
2133
  itemConstraints: t,
2094
2134
  itemId: n,
@@ -2100,8 +2140,8 @@ function Xn({
2100
2140
  );
2101
2141
  if (l) {
2102
2142
  const a = l.maxSize, c = l.collapsible ? l.collapsedSize : l.minSize, u = [o, o + 1];
2103
- i = ge({
2104
- layout: qe({
2143
+ i = ye({
2144
+ layout: Fe({
2105
2145
  delta: c - s,
2106
2146
  initialLayout: e,
2107
2147
  itemConstraints: t,
@@ -2109,8 +2149,8 @@ function Xn({
2109
2149
  prevLayout: e
2110
2150
  }),
2111
2151
  itemConstraints: t
2112
- })[n], r = ge({
2113
- layout: qe({
2152
+ })[n], r = ye({
2153
+ layout: Fe({
2114
2154
  delta: a - s,
2115
2155
  initialLayout: e,
2116
2156
  itemConstraints: t,
@@ -2127,7 +2167,7 @@ function Xn({
2127
2167
  valueNow: s
2128
2168
  };
2129
2169
  }
2130
- function sn({
2170
+ function un({
2131
2171
  attributes: e,
2132
2172
  axisId: t,
2133
2173
  axisOrientation: n,
@@ -2140,52 +2180,52 @@ function sn({
2140
2180
  id: c,
2141
2181
  isSharedHitRegion: u,
2142
2182
  preview: d,
2143
- registerSeparator: g,
2144
- requiredStyle: m,
2145
- style: y,
2183
+ registerSeparator: p,
2184
+ requiredStyle: y,
2185
+ style: m,
2146
2186
  styleDefaults: f,
2147
2187
  tabIndex: S = 0,
2148
- updateSeparatorProps: p
2188
+ updateSeparatorProps: h
2149
2189
  }) {
2150
- const h = Je({
2190
+ const g = Ze({
2151
2191
  disabled: s,
2152
2192
  disableDoubleClick: l,
2153
2193
  children: o,
2154
2194
  className: r,
2155
2195
  preview: d,
2156
- style: y
2157
- }), [I, x] = pe({}), [C, N] = pe("inactive"), [D, b] = pe(!1), w = q(null), v = q(null), $ = Ve(w, a), O = n === "horizontal" ? "vertical" : "horizontal";
2196
+ style: m
2197
+ }), [I, x] = pe({}), [C, A] = pe("inactive"), [N, b] = pe(!1), w = B(null), v = B(null), T = qe(w, a), O = n === "horizontal" ? "vertical" : "horizontal";
2158
2198
  ne(() => {
2159
2199
  const P = w.current;
2160
2200
  if (P !== null) {
2161
2201
  const z = {
2162
- disabled: h.disabled,
2163
- disableDoubleClick: h.disableDoubleClick,
2202
+ disabled: g.disabled,
2203
+ disableDoubleClick: g.disableDoubleClick,
2164
2204
  element: P,
2165
2205
  id: c,
2166
2206
  get children() {
2167
- return h.children;
2207
+ return g.children;
2168
2208
  },
2169
2209
  get className() {
2170
- return h.className;
2210
+ return g.className;
2171
2211
  },
2172
2212
  get preview() {
2173
- return h.preview;
2213
+ return g.preview;
2174
2214
  },
2175
2215
  get style() {
2176
- return h.style;
2216
+ return g.style;
2177
2217
  }
2178
2218
  };
2179
2219
  v.current = z;
2180
- const M = g(z), B = jt(
2220
+ const M = p(z), q = Kt(
2181
2221
  (H) => {
2182
- N(
2222
+ A(
2183
2223
  H.next.state !== "inactive" && H.next.hitRegions.some(
2184
2224
  (Z) => Z.separator === z || (u?.(Z) ?? !1)
2185
2225
  ) ? H.next.state : "inactive"
2186
2226
  );
2187
2227
  }
2188
- ), J = Fe(
2228
+ ), J = _e(
2189
2229
  t,
2190
2230
  (H) => {
2191
2231
  const { derivedItemConstraints: Z, layout: Se, separatorToItems: ze } = H.next, Ie = ze.get(z);
@@ -2194,7 +2234,7 @@ function sn({
2194
2234
  (_) => _.itemId === ve.id
2195
2235
  ), { layoutStrategy: k } = H.axis;
2196
2236
  x({
2197
- ...Xn({
2237
+ ...eo({
2198
2238
  layout: Se,
2199
2239
  itemConstraints: Z,
2200
2240
  itemId: ve.id,
@@ -2211,15 +2251,15 @@ function sn({
2211
2251
  }
2212
2252
  );
2213
2253
  return () => {
2214
- v.current = null, B(), J(), M();
2254
+ v.current = null, q(), J(), M();
2215
2255
  };
2216
2256
  }
2217
- }, [t, c, u, g, h]), ne(() => {
2257
+ }, [t, c, u, p, g]), ne(() => {
2218
2258
  const P = v.current;
2219
- P && wn(P);
2259
+ P && Cn(P);
2220
2260
  }, [d]), Be(() => {
2221
- p(c, { disabled: s, disableDoubleClick: l });
2222
- }, [s, l, c, p]);
2261
+ h(c, { disabled: s, disableDoubleClick: l });
2262
+ }, [s, l, c, h]);
2223
2263
  let R;
2224
2264
  s && !i && (R = "not-allowed");
2225
2265
  let E;
@@ -2232,7 +2272,7 @@ function sn({
2232
2272
  break;
2233
2273
  }
2234
2274
  default:
2235
- D ? E = "focus" : E = C;
2275
+ N ? E = "focus" : E = C;
2236
2276
  }
2237
2277
  return /* @__PURE__ */ K(
2238
2278
  "div",
@@ -2251,13 +2291,13 @@ function sn({
2251
2291
  id: c,
2252
2292
  onBlur: () => b(!1),
2253
2293
  onFocus: () => b(!0),
2254
- ref: $,
2294
+ ref: T,
2255
2295
  role: "separator",
2256
2296
  style: {
2257
2297
  ...f,
2258
2298
  cursor: R,
2259
- ...y,
2260
2299
  ...m,
2300
+ ...y,
2261
2301
  // Inform the browser that the library is handling touch events for this element
2262
2302
  // See github.com/bvaughn/react-resizable-panels/issues/662
2263
2303
  touchAction: "none"
@@ -2266,7 +2306,7 @@ function sn({
2266
2306
  }
2267
2307
  );
2268
2308
  }
2269
- function At({
2309
+ function Nt({
2270
2310
  axis: e,
2271
2311
  children: t,
2272
2312
  className: n,
@@ -2277,26 +2317,26 @@ function At({
2277
2317
  index: l,
2278
2318
  style: a
2279
2319
  }) {
2280
- const c = $e(void 0), {
2320
+ const c = Te(void 0), {
2281
2321
  getDisableCursor: u,
2282
2322
  getResizeAxisId: d,
2283
- gutters: g,
2284
- registerSeparator: m,
2285
- separatorPlacements: y,
2323
+ gutters: p,
2324
+ registerSeparator: y,
2325
+ separatorPlacements: m,
2286
2326
  trackCounts: f,
2287
2327
  updateSeparatorProps: S
2288
- } = Bt(), p = d(e), h = e === "column" ? "row" : "column", I = f[h], x = !!i || !st(l, f[e]);
2328
+ } = Ut(), h = d(e), g = e === "column" ? "row" : "column", I = f[g], x = !!i || !at(l, f[e]);
2289
2329
  let C = !0;
2290
- for (const v of y.values())
2330
+ for (const v of m.values())
2291
2331
  if (v.axis === e && v.index === l && !v.disabled && v.crossStart < r) {
2292
2332
  C = !1;
2293
2333
  break;
2294
2334
  }
2295
- const N = re(
2296
- (v) => v.axis.id === p && v.axis.items.indexOf(v.items[1]) === l,
2297
- [p, l]
2298
- ), D = re(
2299
- (v) => m(
2335
+ const A = re(
2336
+ (v) => v.axis.id === h && v.axis.items.indexOf(v.items[1]) === l,
2337
+ [h, l]
2338
+ ), N = re(
2339
+ (v) => y(
2300
2340
  {
2301
2341
  axis: e,
2302
2342
  crossSpan: o,
@@ -2306,17 +2346,17 @@ function At({
2306
2346
  },
2307
2347
  v
2308
2348
  ),
2309
- [e, o, r, i, l, m]
2310
- ), b = hn(l), w = gn({
2349
+ [e, o, r, i, l, y]
2350
+ ), b = vn(l), w = bn({
2311
2351
  crossCount: I,
2312
2352
  crossSpan: o,
2313
2353
  crossStart: r,
2314
- hasGutters: g[h]
2354
+ hasGutters: p[g]
2315
2355
  });
2316
2356
  return /* @__PURE__ */ K(
2317
- sn,
2357
+ un,
2318
2358
  {
2319
- axisId: p,
2359
+ axisId: h,
2320
2360
  axisOrientation: e === "column" ? "horizontal" : "vertical",
2321
2361
  className: n,
2322
2362
  disableCursor: u(),
@@ -2324,8 +2364,8 @@ function At({
2324
2364
  disableDoubleClick: void 0,
2325
2365
  elementRef: s,
2326
2366
  id: c,
2327
- isSharedHitRegion: N,
2328
- registerSeparator: D,
2367
+ isSharedHitRegion: A,
2368
+ registerSeparator: N,
2329
2369
  requiredStyle: {
2330
2370
  gridColumn: e === "column" ? b : w,
2331
2371
  gridRow: e === "row" ? b : w
@@ -2337,10 +2377,10 @@ function At({
2337
2377
  }
2338
2378
  );
2339
2379
  }
2340
- function an(e) {
2380
+ function dn(e) {
2341
2381
  const { children: t, className: n, disabled: o, elementRef: r, style: i } = e;
2342
2382
  return e.type === "column" ? /* @__PURE__ */ K(
2343
- At,
2383
+ Nt,
2344
2384
  {
2345
2385
  axis: "column",
2346
2386
  className: n,
@@ -2353,7 +2393,7 @@ function an(e) {
2353
2393
  children: t
2354
2394
  }
2355
2395
  ) : /* @__PURE__ */ K(
2356
- At,
2396
+ Nt,
2357
2397
  {
2358
2398
  axis: "row",
2359
2399
  className: n,
@@ -2367,9 +2407,9 @@ function an(e) {
2367
2407
  }
2368
2408
  );
2369
2409
  }
2370
- an.displayName = "Gridline";
2371
- const Re = ["column", "row"], Tt = { columns: {}, rows: {} };
2372
- function Jn({
2410
+ dn.displayName = "Gridline";
2411
+ const Re = ["column", "row"], Gt = { columns: {}, rows: {} };
2412
+ function to({
2373
2413
  children: e,
2374
2414
  className: t,
2375
2415
  columns: n,
@@ -2385,39 +2425,39 @@ function Jn({
2385
2425
  coarse: 20,
2386
2426
  fine: 10
2387
2427
  },
2388
- rows: g,
2389
- style: m,
2390
- ...y
2428
+ rows: p,
2429
+ style: y,
2430
+ ...m
2391
2431
  }) {
2392
- const f = $e(a), S = re(
2432
+ const f = Te(a), S = re(
2393
2433
  (L) => L === "column" ? `${f}:columns` : `${f}:rows`,
2394
2434
  [f]
2395
- ), p = Dt(n, "columns"), h = Dt(g, "rows"), I = (L) => L === "column" ? p : h, x = q({
2396
- onLayoutChange: Tt,
2397
- onLayoutChanged: Tt
2398
- }), C = he((L) => {
2399
- Ot(x.current.onLayoutChange, L) || (x.current.onLayoutChange = L, c?.(L));
2400
- }), N = he(
2435
+ ), h = _t(n, "columns"), g = _t(p, "rows"), I = (L) => L === "column" ? h : g, x = B({
2436
+ onLayoutChange: Gt,
2437
+ onLayoutChanged: Gt
2438
+ }), C = ge((L) => {
2439
+ Ft(x.current.onLayoutChange, L) || (x.current.onLayoutChange = L, c?.(L));
2440
+ }), A = ge(
2401
2441
  (L, k, _) => {
2402
- Ot(x.current.onLayoutChanged, L) || (x.current.onLayoutChanged = L, u?.(L, { isUserInteraction: k, requestedLayout: _ }));
2442
+ Ft(x.current.onLayoutChanged, L) || (x.current.onLayoutChanged = L, u?.(L, { isUserInteraction: k, requestedLayout: _ }));
2403
2443
  }
2404
- ), D = q(null), b = Ve(D, s), [w, v] = rn(), $ = q({
2444
+ ), N = B(null), b = qe(N, s), [w, v] = cn(), T = B({
2405
2445
  cells: [],
2406
2446
  column: { expandedItemSizes: {}, layouts: {} },
2407
2447
  loggedErrors: /* @__PURE__ */ new Set(),
2408
2448
  row: { expandedItemSizes: {}, layouts: {} },
2409
2449
  separators: /* @__PURE__ */ new Map()
2410
2450
  }), O = { column: !1, row: !1 };
2411
- for (const L of $.current.separators.values())
2451
+ for (const L of T.current.separators.values())
2412
2452
  O[L.axis] = !0;
2413
- ln(e, O);
2414
- const R = Je({
2453
+ fn(e, O);
2454
+ const R = Ze({
2415
2455
  defaultLayout: o,
2416
2456
  disableCursor: r,
2417
2457
  resizeTargetMinimumSize: d
2418
- }), E = he(() => !!R.disableCursor), P = re(
2458
+ }), E = ge(() => !!R.disableCursor), P = re(
2419
2459
  (L) => {
2420
- const k = $.current;
2460
+ const k = T.current;
2421
2461
  return k.cells = [...k.cells, L], v(), () => {
2422
2462
  k.cells = k.cells.filter(
2423
2463
  (_) => _ !== L
@@ -2427,7 +2467,7 @@ function Jn({
2427
2467
  [v]
2428
2468
  ), z = re(
2429
2469
  (L, k) => {
2430
- const _ = $.current;
2470
+ const _ = T.current;
2431
2471
  return _.separators = new Map(_.separators), _.separators.set(k, L), v(), () => {
2432
2472
  _.separators = new Map(_.separators), _.separators.delete(k), v();
2433
2473
  };
@@ -2438,11 +2478,11 @@ function Jn({
2438
2478
  disabled: k,
2439
2479
  disableDoubleClick: _
2440
2480
  }) => {
2441
- for (const G of $.current.separators.keys())
2481
+ for (const G of T.current.separators.keys())
2442
2482
  G.id === L && (G.disabled = k, G.disableDoubleClick = _);
2443
2483
  },
2444
2484
  []
2445
- ), B = $.current.separators, J = Pe(
2485
+ ), q = T.current.separators, J = Pe(
2446
2486
  () => ({
2447
2487
  getDisableCursor: E,
2448
2488
  getResizeAxisId: S,
@@ -2453,15 +2493,15 @@ function Jn({
2453
2493
  id: f,
2454
2494
  registerCell: P,
2455
2495
  registerSeparator: z,
2456
- separatorPlacements: B,
2496
+ separatorPlacements: q,
2457
2497
  trackCounts: {
2458
- column: p.length,
2459
- row: h.length
2498
+ column: h.length,
2499
+ row: g.length
2460
2500
  },
2461
2501
  updateSeparatorProps: M
2462
2502
  }),
2463
2503
  [
2464
- p.length,
2504
+ h.length,
2465
2505
  E,
2466
2506
  S,
2467
2507
  O.column,
@@ -2469,25 +2509,25 @@ function Jn({
2469
2509
  f,
2470
2510
  P,
2471
2511
  z,
2472
- h.length,
2473
- B,
2512
+ g.length,
2513
+ q,
2474
2514
  M
2475
2515
  ]
2476
- ), H = q([]);
2516
+ ), H = B([]);
2477
2517
  ne(() => {
2478
- const L = D.current;
2518
+ const L = N.current;
2479
2519
  if (L === null)
2480
2520
  return;
2481
- const k = $.current, _ = Qn({
2521
+ const k = T.current, _ = oo({
2482
2522
  cells: k.cells,
2483
2523
  separatorPlacements: k.separators,
2484
- trackCounts: { column: p.length, row: h.length }
2524
+ trackCounts: { column: h.length, row: g.length }
2485
2525
  });
2486
- _.forEach((A) => {
2487
- k.loggedErrors.has(A) || console.error(A);
2526
+ _.forEach(($) => {
2527
+ k.loggedErrors.has($) || console.error($);
2488
2528
  }), k.loggedErrors = new Set(_);
2489
- const G = (A) => Array.from(k.separators.entries()).filter(([, W]) => W.axis === A).sort(([, W], [, be]) => W.index - be.index).map(([W]) => W), F = (A) => {
2490
- const W = A === "column" ? p : h, be = A === "column" ? h : p, me = W.map((Q) => Q.id), He = S(A), je = G(A), xe = je.length > 0, Ue = W.map(
2529
+ const G = ($) => Array.from(k.separators.entries()).filter(([, W]) => W.axis === $).sort(([, W], [, be]) => W.index - be.index).map(([W]) => W), F = ($) => {
2530
+ const W = $ === "column" ? h : g, be = $ === "column" ? g : h, me = W.map((Q) => Q.id), He = S($), je = G($), xe = je.length > 0, Ue = W.map(
2491
2531
  ({ id: Q, ...oe }, ee) => ({
2492
2532
  // Tracks don't have DOM elements of their own;
2493
2533
  // the Grid element is used to resolve relative size constraints (e.g. "em")
@@ -2501,33 +2541,33 @@ function Jn({
2501
2541
  onResize: void 0,
2502
2542
  constraintProps: oe
2503
2543
  })
2504
- ), Te = () => {
2544
+ ), Ae = () => {
2505
2545
  const Q = [];
2506
2546
  if (xe) {
2507
2547
  for (const [oe, ee] of k.separators)
2508
- if (ee.axis === A && st(ee.index, W.length)) {
2548
+ if (ee.axis === $ && at(ee.index, W.length)) {
2509
2549
  const Oe = oe.element.getBoundingClientRect();
2510
2550
  Q[ee.index] = Math.max(
2511
2551
  Q[ee.index] ?? 0,
2512
- A === "column" ? Oe.width : Oe.height
2552
+ $ === "column" ? Oe.width : Oe.height
2513
2553
  );
2514
2554
  }
2515
2555
  }
2516
- return bn({
2517
- axis: A,
2556
+ return In({
2557
+ axis: $,
2518
2558
  element: L,
2519
2559
  gutterSizes: Q.filter((oe) => oe !== void 0),
2520
2560
  hasGutters: xe,
2521
- layout: se(He)?.layout,
2561
+ layout: ae(He)?.layout,
2522
2562
  trackIds: me
2523
2563
  });
2524
2564
  };
2525
2565
  let De;
2526
- const Qe = R.defaultLayout?.[A === "column" ? "columns" : "rows"];
2527
- if (Qe !== void 0 && Object.keys(Qe).length === me.length) {
2566
+ const et = R.defaultLayout?.[$ === "column" ? "columns" : "rows"];
2567
+ if (et !== void 0 && Object.keys(et).length === me.length) {
2528
2568
  De = {};
2529
2569
  for (const Q of me) {
2530
- const oe = Qe[Q];
2570
+ const oe = et[Q];
2531
2571
  oe !== void 0 && (De[Q] = oe);
2532
2572
  }
2533
2573
  }
@@ -2539,34 +2579,34 @@ function Jn({
2539
2579
  getItemAriaControls: (Q) => {
2540
2580
  const oe = me.indexOf(Q);
2541
2581
  return k.cells.filter((ee) => {
2542
- const Oe = A === "column" ? ee.column : ee.row, un = A === "column" ? ee.columnSpan : ee.rowSpan;
2543
- return Oe <= oe && oe < Oe + un;
2582
+ const Oe = $ === "column" ? ee.column : ee.row, pn = $ === "column" ? ee.columnSpan : ee.rowSpan;
2583
+ return Oe <= oe && oe < Oe + pn;
2544
2584
  }).map((ee) => ee.element.id).filter(Boolean).join(" ") || void 0;
2545
2585
  },
2546
- calculateAvailableSize: () => Te().availableSize,
2586
+ calculateAvailableSize: () => Ae().availableSize,
2547
2587
  calculateHitRegions: ({
2548
2588
  expandHitTargets: Q,
2549
2589
  axis: oe,
2550
2590
  includeDisabled: ee
2551
- }) => vn({
2552
- axis: A,
2591
+ }) => zn({
2592
+ axis: $,
2553
2593
  cells: k.cells,
2554
2594
  crossTrackCount: be.length,
2555
2595
  expandHitTargets: Q,
2556
2596
  resizeAxis: oe,
2557
- axisSize: Te().availableSize,
2597
+ axisSize: Ae().availableSize,
2558
2598
  includeDisabled: ee,
2559
2599
  separatorPlacements: k.separators
2560
2600
  }),
2561
- getItemSizeInPixels: (Q) => Te().trackSizes[me.indexOf(Q)] ?? 0
2601
+ getItemSizeInPixels: (Q) => Ae().trackSizes[me.indexOf(Q)] ?? 0
2562
2602
  },
2563
2603
  mutableState: {
2564
2604
  defaultLayout: De,
2565
2605
  disableCursor: !!R.disableCursor,
2566
- expandedItemSizes: k[A].expandedItemSizes,
2567
- layouts: k[A].layouts
2606
+ expandedItemSizes: k[$].expandedItemSizes,
2607
+ layouts: k[$].layouts
2568
2608
  },
2569
- orientation: A === "column" ? "horizontal" : "vertical",
2609
+ orientation: $ === "column" ? "horizontal" : "vertical",
2570
2610
  items: Ue,
2571
2611
  resizePreviewMode: "panel",
2572
2612
  get resizeTargetMinimumSize() {
@@ -2576,25 +2616,25 @@ function Jn({
2576
2616
  };
2577
2617
  }, j = Re.map(F);
2578
2618
  H.current = j;
2579
- const U = j.map((A) => nn(A)), te = () => {
2580
- const [A, W] = j.map(
2581
- (be) => se(be.id)
2619
+ const U = j.map(($) => an($)), te = () => {
2620
+ const [$, W] = j.map(
2621
+ (be) => ae(be.id)
2582
2622
  );
2583
- if (!(!A || !W || A.defaultLayoutDeferred || W.defaultLayoutDeferred))
2623
+ if (!(!$ || !W || $.defaultLayoutDeferred || W.defaultLayoutDeferred))
2584
2624
  return {
2585
- layout: { columns: A.layout, rows: W.layout },
2625
+ layout: { columns: $.layout, rows: W.layout },
2586
2626
  requestedLayout: {
2587
- columns: A.requestedLayout,
2627
+ columns: $.requestedLayout,
2588
2628
  rows: W.requestedLayout
2589
2629
  }
2590
2630
  };
2591
2631
  };
2592
2632
  {
2593
- const A = te();
2594
- A && (C(A.layout), N(A.layout, !1, A.requestedLayout));
2633
+ const $ = te();
2634
+ $ && (C($.layout), A($.layout, !1, $.requestedLayout));
2595
2635
  }
2596
- const Ae = j.map(
2597
- (A) => Fe(A.id, (W) => {
2636
+ const $e = j.map(
2637
+ ($) => _e($.id, (W) => {
2598
2638
  const {
2599
2639
  defaultLayoutDeferred: be,
2600
2640
  derivedItemConstraints: me,
@@ -2603,19 +2643,19 @@ function Jn({
2603
2643
  } = W.next;
2604
2644
  if (be || me.length === 0)
2605
2645
  return;
2606
- on({
2646
+ ln({
2607
2647
  derivedItemConstraints: me,
2608
- axis: A,
2648
+ axis: $,
2609
2649
  layout: He,
2610
2650
  prevLayout: W.prev?.layout,
2611
2651
  requestedLayout: je
2612
2652
  });
2613
2653
  const xe = te();
2614
2654
  if (xe) {
2615
- const Ue = de(), Te = Ue.state !== "active" || !Ue.hitRegions.some(
2655
+ const Ue = se(), Ae = Ue.state !== "active" || !Ue.hitRegions.some(
2616
2656
  (De) => j.includes(De.axis)
2617
2657
  );
2618
- C(xe.layout), Te && N(
2658
+ C(xe.layout), Ae && A(
2619
2659
  xe.layout,
2620
2660
  W.isUserInteraction,
2621
2661
  xe.requestedLayout
@@ -2624,23 +2664,23 @@ function Jn({
2624
2664
  })
2625
2665
  );
2626
2666
  return () => {
2627
- H.current = [], U.forEach((A) => A()), Ae.forEach((A) => A());
2667
+ H.current = [], U.forEach(($) => $()), $e.forEach(($) => $());
2628
2668
  };
2629
2669
  }, [
2630
- p,
2670
+ h,
2631
2671
  i,
2632
2672
  S,
2633
2673
  f,
2634
- N,
2674
+ A,
2635
2675
  C,
2636
- h,
2676
+ g,
2637
2677
  w,
2638
2678
  R
2639
2679
  ]), Be(() => {
2640
2680
  H.current.forEach((L) => {
2641
2681
  L.mutableState.defaultLayout = o?.[L.orientation === "horizontal" ? "columns" : "rows"], L.mutableState.disableCursor = !!r;
2642
2682
  });
2643
- }), it(l, () => {
2683
+ }), st(l, () => {
2644
2684
  const L = () => {
2645
2685
  const [G, F] = Re.map(S);
2646
2686
  return !Me(G) || !Me(F) ? { columns: {}, rows: {} } : {
@@ -2652,10 +2692,10 @@ function Jn({
2652
2692
  }, k = (G) => G.map((F) => `"${F}"`).join(", "), _ = (G, F) => {
2653
2693
  const j = S(G), U = () => {
2654
2694
  const te = Me(j);
2655
- return T(te, `Grid "${f}" has not been mounted`), T(
2656
- te.items.some((Ae) => Ae.id === F),
2657
- `Grid "${f}" no longer contains a ${G} with id "${F}"; ${G} ids are ${k(te.items.map((Ae) => Ae.id))}`
2658
- ), ft({ axisId: j, itemId: F });
2695
+ return D(te, `Grid "${f}" has not been mounted`), D(
2696
+ te.items.some(($e) => $e.id === F),
2697
+ `Grid "${f}" no longer contains a ${G} with id "${F}"; ${G} ids are ${k(te.items.map(($e) => $e.id))}`
2698
+ ), mt({ axisId: j, itemId: F });
2659
2699
  };
2660
2700
  return {
2661
2701
  collapse: () => U().collapse(),
@@ -2668,15 +2708,15 @@ function Jn({
2668
2708
  return {
2669
2709
  getLayout: L,
2670
2710
  getTrackById: (G, F) => {
2671
- const j = G === "column" ? p : h, U = `${F}`;
2672
- return T(
2711
+ const j = G === "column" ? h : g, U = `${F}`;
2712
+ return D(
2673
2713
  j.some((te) => te.id === U),
2674
2714
  `Grid "${f}" does not contain a ${G} with id "${U}"; ${G} ids are ${k(j.map((te) => te.id))}`
2675
2715
  ), _(G, U);
2676
2716
  },
2677
2717
  getTrackByIndex: (G, F) => {
2678
- const j = G === "column" ? p : h, U = Number.isInteger(F) ? j[F] : void 0;
2679
- return T(
2718
+ const j = G === "column" ? h : g, U = Number.isInteger(F) ? j[F] : void 0;
2719
+ return D(
2680
2720
  U,
2681
2721
  `Grid "${f}" does not contain a ${G} at index ${F}; it has ${j.length} ${G}s`
2682
2722
  ), _(G, U.id);
@@ -2686,17 +2726,17 @@ function Jn({
2686
2726
  j && Me(U) && Ge({ axisId: U }).setLayout(j);
2687
2727
  }), L())
2688
2728
  };
2689
- }, [p, S, f, h]);
2729
+ }, [h, S, f, g]);
2690
2730
  const Z = () => Re.map((L) => {
2691
- const k = se(S(L)), _ = I(L);
2692
- return (k && !k.defaultLayoutDeferred ? _.map((F) => `minmax(0, ${k.layout[F.id] ?? 1}fr)`) : Zn(
2731
+ const k = ae(S(L)), _ = I(L);
2732
+ return (k && !k.defaultLayoutDeferred ? _.map((F) => `minmax(0, ${k.layout[F.id] ?? 1}fr)`) : no(
2693
2733
  _,
2694
2734
  o?.[L === "column" ? "columns" : "rows"]
2695
2735
  )).join(O[L] ? " auto " : " ");
2696
2736
  }).join("|"), Se = re(
2697
2737
  (L) => {
2698
2738
  const k = Re.map(
2699
- (_) => Fe(S(_), L)
2739
+ (_) => _e(S(_), L)
2700
2740
  );
2701
2741
  return () => k.forEach((_) => _());
2702
2742
  },
@@ -2706,10 +2746,10 @@ function Jn({
2706
2746
  Z,
2707
2747
  Z
2708
2748
  ), [Ie, ve] = ze.split("|");
2709
- return /* @__PURE__ */ K(qt.Provider, { value: J, children: /* @__PURE__ */ K(
2749
+ return /* @__PURE__ */ K(jt.Provider, { value: J, children: /* @__PURE__ */ K(
2710
2750
  "div",
2711
2751
  {
2712
- ...y,
2752
+ ...m,
2713
2753
  className: t,
2714
2754
  "data-grid": !0,
2715
2755
  "data-testid": f,
@@ -2719,7 +2759,7 @@ function Jn({
2719
2759
  height: "100%",
2720
2760
  width: "100%",
2721
2761
  overflow: "hidden",
2722
- ...m,
2762
+ ...y,
2723
2763
  display: "grid",
2724
2764
  gridTemplateColumns: Ie,
2725
2765
  gridTemplateRows: ve,
@@ -2727,41 +2767,41 @@ function Jn({
2727
2767
  // NOTE This is not an inherited style
2728
2768
  touchAction: "none"
2729
2769
  },
2730
- children: /* @__PURE__ */ K(mt.Provider, { value: null, children: e })
2770
+ children: /* @__PURE__ */ K(pt.Provider, { value: null, children: e })
2731
2771
  }
2732
2772
  ) });
2733
2773
  }
2734
- Jn.displayName = "Grid";
2735
- function Dt(e, t) {
2774
+ to.displayName = "Grid";
2775
+ function _t(e, t) {
2736
2776
  const n = JSON.stringify(e);
2737
2777
  return Pe(() => {
2738
2778
  const o = typeof e == "number" ? Array.from({ length: e }, (r, i) => ({ id: `${i}` })) : e.map((r, i) => ({
2739
2779
  ...r,
2740
2780
  id: `${r.id ?? i}`
2741
2781
  }));
2742
- return T(
2782
+ return D(
2743
2783
  o.length > 0,
2744
2784
  `Grid must have at least one track; "${t}" is ${n}`
2745
2785
  ), o;
2746
2786
  }, [n]);
2747
2787
  }
2748
- function ln(e, t) {
2749
- mn.forEach(e, (n) => {
2750
- if (Ft(n))
2751
- if (n.type === an) {
2788
+ function fn(e, t) {
2789
+ yn.forEach(e, (n) => {
2790
+ if (Ht(n))
2791
+ if (n.type === dn) {
2752
2792
  const { type: o } = n.props;
2753
2793
  o === "column" ? t.column = !0 : o === "row" && (t.row = !0);
2754
2794
  } else // Fragments
2755
- typeof n.type == "symbol" && n.props !== null && typeof n.props == "object" && "children" in n.props && ln(n.props.children, t);
2795
+ typeof n.type == "symbol" && n.props !== null && typeof n.props == "object" && "children" in n.props && fn(n.props.children, t);
2756
2796
  });
2757
2797
  }
2758
- function Zn(e, t) {
2798
+ function no(e, t) {
2759
2799
  if (t)
2760
2800
  return e.map(
2761
2801
  (i) => `minmax(0, ${t[i.id] ?? 1}fr)`
2762
2802
  );
2763
2803
  const n = e.map(
2764
- (i) => i.defaultSize === void 0 ? void 0 : Vt(i.defaultSize)
2804
+ (i) => i.defaultSize === void 0 ? void 0 : Wt(i.defaultSize)
2765
2805
  );
2766
2806
  let o = 100, r = 0;
2767
2807
  return n.forEach((i) => {
@@ -2773,7 +2813,7 @@ function Zn(e, t) {
2773
2813
  return l === "%" ? `minmax(0, ${s}fr)` : `${s}${l}`;
2774
2814
  });
2775
2815
  }
2776
- function Qn({
2816
+ function oo({
2777
2817
  cells: e,
2778
2818
  separatorPlacements: t,
2779
2819
  trackCounts: n
@@ -2793,19 +2833,19 @@ function Qn({
2793
2833
  disabled: u,
2794
2834
  index: d
2795
2835
  }) => {
2796
- const g = l === "column" ? "row" : "column";
2797
- let m = `type="${l}" ${l}={${d}}`;
2798
- return (c !== 0 || a !== void 0) && (m += ` ${g}={${c}}`), a !== void 0 && (m += ` ${g}Span={${a}}`), u && (m += " disabled"), `<Gridline ${m} />`;
2836
+ const p = l === "column" ? "row" : "column";
2837
+ let y = `type="${l}" ${l}={${d}}`;
2838
+ return (c !== 0 || a !== void 0) && (y += ` ${p}={${c}}`), a !== void 0 && (y += ` ${p}Span={${a}}`), u && (y += " disabled"), `<Gridline ${y} />`;
2799
2839
  }, i = Array.from(t.values()).filter(
2800
2840
  (l) => {
2801
- const { axis: a, crossSpan: c, crossStart: u, index: d } = l, g = a === "column" ? "row" : "column", m = n[a], y = n[g];
2841
+ const { axis: a, crossSpan: c, crossStart: u, index: d } = l, p = a === "column" ? "row" : "column", y = n[a], m = n[p];
2802
2842
  let f = !0;
2803
- return st(d, m) || (o.push(
2804
- `Invalid ${a} Gridline ${a} (${d}); must be between 1 and ${m - 1}`
2805
- ), f = !1), !Number.isInteger(u) || u < 0 || u >= y ? (o.push(
2806
- `Invalid ${a} Gridline ${g} (${u}); must be between 0 and ${y - 1}`
2807
- ), f = !1) : c !== void 0 && (!Number.isInteger(c) || c < 1 || u + c > y) && (o.push(
2808
- `Invalid ${a} Gridline ${g}Span (${c}); Grid has ${y} ${g}s`
2843
+ return at(d, y) || (o.push(
2844
+ `Invalid ${a} Gridline ${a} (${d}); must be between 1 and ${y - 1}`
2845
+ ), f = !1), !Number.isInteger(u) || u < 0 || u >= m ? (o.push(
2846
+ `Invalid ${a} Gridline ${p} (${u}); must be between 0 and ${m - 1}`
2847
+ ), f = !1) : c !== void 0 && (!Number.isInteger(c) || c < 1 || u + c > m) && (o.push(
2848
+ `Invalid ${a} Gridline ${p}Span (${c}); Grid has ${m} ${p}s`
2809
2849
  ), f = !1), f;
2810
2850
  }
2811
2851
  ), s = (l) => {
@@ -2816,33 +2856,33 @@ function Qn({
2816
2856
  ];
2817
2857
  };
2818
2858
  return i.forEach((l, a) => {
2819
- const { axis: c, index: u } = l, [d, g] = s(l);
2820
- for (const m of e) {
2821
- const [y, f, S, p] = c === "column" ? [m.column, m.columnSpan, m.row, m.rowSpan] : [m.row, m.rowSpan, m.column, m.columnSpan];
2822
- if (y < u && u < y + f && S < g && d < S + p) {
2823
- const h = c === "column" ? "row" : "column";
2859
+ const { axis: c, index: u } = l, [d, p] = s(l);
2860
+ for (const y of e) {
2861
+ const [m, f, S, h] = c === "column" ? [y.column, y.columnSpan, y.row, y.rowSpan] : [y.row, y.rowSpan, y.column, y.columnSpan];
2862
+ if (m < u && u < m + f && S < p && d < S + h) {
2863
+ const g = c === "column" ? "row" : "column";
2824
2864
  o.push(
2825
- `${r(l)} overlaps a Cell that spans across it (${c}: ${y}, ${c}Span: ${f}, ${h}: ${S}, ${h}Span: ${p}); use the ${h} and ${h}Span props to render gridlines beside the Cell instead`
2865
+ `${r(l)} overlaps a Cell that spans across it (${c}: ${m}, ${c}Span: ${f}, ${g}: ${S}, ${g}Span: ${h}); use the ${g} and ${g}Span props to render gridlines beside the Cell instead`
2826
2866
  );
2827
2867
  }
2828
2868
  }
2829
- for (const m of i.slice(a + 1))
2830
- if (m.axis === c && m.index === u) {
2831
- const [y, f] = s(m);
2832
- y < g && d < f && o.push(`${r(l)} overlaps ${r(m)}`);
2869
+ for (const y of i.slice(a + 1))
2870
+ if (y.axis === c && y.index === u) {
2871
+ const [m, f] = s(y);
2872
+ m < p && d < f && o.push(`${r(l)} overlaps ${r(y)}`);
2833
2873
  }
2834
2874
  }), o;
2835
2875
  }
2836
- function Ot(e, t) {
2876
+ function Ft(e, t) {
2837
2877
  return ie(e.columns, t.columns) && ie(e.rows, t.rows);
2838
2878
  }
2839
- function bo({
2879
+ function Io({
2840
2880
  id: e,
2841
2881
  onlySaveAfterUserInteractions: t,
2842
2882
  storage: n = localStorage
2843
2883
  }) {
2844
2884
  const o = `react-resizable-panels:grid:${e}`, r = Xe(
2845
- eo,
2885
+ ro,
2846
2886
  () => n.getItem(o),
2847
2887
  () => n.getItem(o)
2848
2888
  ), i = Pe(() => {
@@ -2878,26 +2918,26 @@ function bo({
2878
2918
  onLayoutChanged: s
2879
2919
  };
2880
2920
  }
2881
- function eo() {
2921
+ function ro() {
2882
2922
  return function() {
2883
2923
  };
2884
2924
  }
2885
- function xo() {
2925
+ function Lo() {
2886
2926
  return pe(null);
2887
2927
  }
2888
- function wo() {
2889
- return q(null);
2928
+ function Co() {
2929
+ return B(null);
2890
2930
  }
2891
- function to(e) {
2931
+ function io(e) {
2892
2932
  for (let t = 1; t < e.length; t++)
2893
- if (lt(e[t - 1], e[t]) > 0)
2933
+ if (ct(e[t - 1], e[t]) > 0)
2894
2934
  return !1;
2895
2935
  return !0;
2896
2936
  }
2897
- function no({
2937
+ function so({
2898
2938
  separator: e
2899
2939
  }) {
2900
- const { element: t } = e, n = q(null);
2940
+ const { element: t } = e, n = B(null);
2901
2941
  return ne(() => {
2902
2942
  const o = t.cloneNode(!0), r = [t, ...t.querySelectorAll("*")], i = [o, ...o.querySelectorAll("*")], s = t.ownerDocument.defaultView;
2903
2943
  return r.forEach((l, a) => {
@@ -2905,10 +2945,10 @@ function no({
2905
2945
  if (c instanceof s.HTMLElement || c instanceof s.SVGElement) {
2906
2946
  const u = s.getComputedStyle(l);
2907
2947
  for (let d = 0; d < u.length; d++) {
2908
- const g = u.item(d);
2948
+ const p = u.item(d);
2909
2949
  c.style.setProperty(
2910
- g,
2911
- u.getPropertyValue(g)
2950
+ p,
2951
+ u.getPropertyValue(p)
2912
2952
  );
2913
2953
  }
2914
2954
  }
@@ -2934,24 +2974,24 @@ function no({
2934
2974
  }
2935
2975
  );
2936
2976
  }
2937
- function Ze() {
2938
- const e = _t(mt);
2939
- return T(
2977
+ function Qe() {
2978
+ const e = Vt(pt);
2979
+ return D(
2940
2980
  e,
2941
2981
  "Group Context not found; did you render a Panel or Separator outside of a Group?"
2942
2982
  ), e;
2943
2983
  }
2944
- function cn(e) {
2945
- const { registerOverlay: t } = Ze(), n = q(e);
2946
- tn(n.current, e) || (n.current = e);
2984
+ function mn(e) {
2985
+ const { registerOverlay: t } = Qe(), n = B(e);
2986
+ sn(n.current, e) || (n.current = e);
2947
2987
  const o = n.current;
2948
2988
  return ne(
2949
2989
  () => t(o),
2950
2990
  [t, o]
2951
2991
  ), null;
2952
2992
  }
2953
- cn.displayName = "SeparatorOverlay";
2954
- function oo({
2993
+ mn.displayName = "SeparatorOverlay";
2994
+ function ao({
2955
2995
  active: e,
2956
2996
  orientation: t,
2957
2997
  style: n,
@@ -2988,20 +3028,20 @@ function oo({
2988
3028
  }
2989
3029
  );
2990
3030
  }
2991
- function ro({
3031
+ function lo({
2992
3032
  overlay: e,
2993
3033
  preview: t
2994
3034
  }) {
2995
3035
  const { axis: n, offset: o, rect: r, separator: i } = t, s = n.orientation === "horizontal";
2996
3036
  let l = i?.preview, a = e;
2997
- return Ft(l) && l.type === cn && (a = l.props, l = void 0), l == null && (a ? l = /* @__PURE__ */ K(
2998
- oo,
3037
+ return Ht(l) && l.type === mn && (a = l.props, l = void 0), l == null && (a ? l = /* @__PURE__ */ K(
3038
+ ao,
2999
3039
  {
3000
3040
  ...a,
3001
3041
  active: t.active,
3002
3042
  orientation: n.orientation
3003
3043
  }
3004
- ) : i && (l = /* @__PURE__ */ K(no, { separator: i }))), /* @__PURE__ */ K(
3044
+ ) : i && (l = /* @__PURE__ */ K(so, { separator: i }))), /* @__PURE__ */ K(
3005
3045
  "div",
3006
3046
  {
3007
3047
  "aria-hidden": "true",
@@ -3020,46 +3060,46 @@ function ro({
3020
3060
  }
3021
3061
  );
3022
3062
  }
3023
- function io(e) {
3024
- return Array.from(e).sort(lt);
3063
+ function co(e) {
3064
+ return Array.from(e).sort(ct);
3025
3065
  }
3026
- function so(e, t) {
3027
- const n = q({
3066
+ function uo(e, t) {
3067
+ const n = B({
3028
3068
  getLayout: () => ({}),
3029
- setLayout: In
3069
+ setLayout: Mn
3030
3070
  });
3031
- it(t, () => n.current, []), ne(() => {
3071
+ st(t, () => n.current, []), ne(() => {
3032
3072
  Object.assign(
3033
3073
  n.current,
3034
3074
  Ge({ axisId: e })
3035
3075
  );
3036
3076
  });
3037
3077
  }
3038
- function ao({
3078
+ function fo({
3039
3079
  groupId: e,
3040
3080
  resizePreviewMode: t
3041
3081
  }) {
3042
- const [n, o] = pe([]), r = q(n);
3082
+ const [n, o] = pe([]), r = B(n);
3043
3083
  return ne(() => {
3044
3084
  const i = (l) => {
3045
3085
  const a = Me(e), c = t === "separator" && l.state === "active" ? l.previews.filter(
3046
3086
  (d) => d.axis === a && (d.active || !Y(d.offset, 0))
3047
3087
  ) : [], u = r.current;
3048
3088
  u.length === c.length && c.every(
3049
- (d, g) => d === u[g]
3089
+ (d, p) => d === u[p]
3050
3090
  ) || (r.current = c, o(c));
3051
3091
  };
3052
3092
  if (t !== "separator") {
3053
- i(de());
3093
+ i(se());
3054
3094
  return;
3055
3095
  }
3056
- const s = jt(
3096
+ const s = Kt(
3057
3097
  ({ next: l }) => i(l)
3058
3098
  );
3059
- return i(de()), s;
3099
+ return i(se()), s;
3060
3100
  }, [e, t]), n;
3061
3101
  }
3062
- function lo({
3102
+ function mo({
3063
3103
  children: e,
3064
3104
  className: t,
3065
3105
  defaultLayout: n,
@@ -3072,55 +3112,55 @@ function lo({
3072
3112
  onLayoutChanged: c,
3073
3113
  orientation: u = "horizontal",
3074
3114
  resizePreviewMode: d = "panel",
3075
- resizeTargetMinimumSize: g = {
3115
+ resizeTargetMinimumSize: p = {
3076
3116
  coarse: 20,
3077
3117
  fine: 10
3078
3118
  },
3079
- style: m,
3080
- ...y
3119
+ style: y,
3120
+ ...m
3081
3121
  }) {
3082
- const f = q({
3122
+ const f = B({
3083
3123
  onLayoutChange: {},
3084
3124
  onLayoutChanged: {}
3085
- }), S = he((z) => {
3125
+ }), S = ge((z) => {
3086
3126
  ie(f.current.onLayoutChange, z) || (f.current.onLayoutChange = z, a?.(z));
3087
- }), p = he(
3088
- (z, M, B) => {
3089
- ie(f.current.onLayoutChanged, z) || (f.current.onLayoutChanged = z, c?.(z, { isUserInteraction: M, requestedLayout: B }));
3127
+ }), h = ge(
3128
+ (z, M, q) => {
3129
+ ie(f.current.onLayoutChanged, z) || (f.current.onLayoutChanged = z, c?.(z, { isUserInteraction: M, requestedLayout: q }));
3090
3130
  }
3091
- ), h = $e(l), [I, x] = pe(), C = ao({
3092
- groupId: h,
3131
+ ), g = Te(l), [I, x] = pe(), C = fo({
3132
+ groupId: g,
3093
3133
  resizePreviewMode: d
3094
- }), N = q(null), [D, b] = rn(), w = q([]), v = q({
3134
+ }), A = B(null), [N, b] = cn(), w = B([]), v = B({
3095
3135
  lastExpandedPanelSizes: {},
3096
3136
  layouts: {},
3097
3137
  panels: [],
3098
3138
  separators: []
3099
- }), $ = Ve(N, i);
3100
- so(h, s);
3101
- const O = he(
3139
+ }), T = qe(A, i);
3140
+ uo(g, s);
3141
+ const O = ge(
3102
3142
  (z, M) => {
3103
- const B = se(z);
3104
- if (B)
3143
+ const q = ae(z);
3144
+ if (q)
3105
3145
  return {
3106
- flexGrow: B.layout[M] ?? 1
3146
+ flexGrow: q.layout[M] ?? 1
3107
3147
  };
3108
3148
  if (n?.[M])
3109
3149
  return {
3110
3150
  flexGrow: n?.[M]
3111
3151
  };
3112
3152
  }
3113
- ), R = Je({
3153
+ ), R = Ze({
3114
3154
  defaultLayout: n,
3115
3155
  disableCursor: o,
3116
- resizeTargetMinimumSize: g
3156
+ resizeTargetMinimumSize: p
3117
3157
  }), E = Pe(
3118
3158
  () => ({
3119
3159
  get disableCursor() {
3120
3160
  return !!R.disableCursor;
3121
3161
  },
3122
3162
  getPanelStyles: O,
3123
- id: h,
3163
+ id: g,
3124
3164
  orientation: u,
3125
3165
  registerPanel: (z) => {
3126
3166
  const M = v.current;
@@ -3129,7 +3169,7 @@ function lo({
3129
3169
  z
3130
3170
  ]), b(), () => {
3131
3171
  M.panels = M.panels.filter(
3132
- (B) => B !== z
3172
+ (q) => q !== z
3133
3173
  ), b();
3134
3174
  };
3135
3175
  },
@@ -3143,7 +3183,7 @@ function lo({
3143
3183
  z
3144
3184
  ]), b(), () => {
3145
3185
  M.separators = M.separators.filter(
3146
- (B) => B !== z
3186
+ (q) => q !== z
3147
3187
  ), b();
3148
3188
  };
3149
3189
  },
@@ -3152,26 +3192,26 @@ function lo({
3152
3192
  (Se) => Se.id === z
3153
3193
  );
3154
3194
  J && (J.constraintProps.disabled = M);
3155
- const H = Me(h), Z = se(h);
3195
+ const H = Me(g), Z = ae(g);
3156
3196
  H && Z && fe(H, {
3157
3197
  ...Z,
3158
- derivedItemConstraints: rt(H)
3198
+ derivedItemConstraints: it(H)
3159
3199
  });
3160
3200
  },
3161
3201
  updateSeparatorProps: (z, {
3162
3202
  disabled: M,
3163
- disableDoubleClick: B
3203
+ disableDoubleClick: q
3164
3204
  }) => {
3165
3205
  const H = v.current.separators.find(
3166
3206
  (Z) => Z.id === z
3167
3207
  );
3168
- H && (H.disabled = M, H.disableDoubleClick = B);
3208
+ H && (H.disabled = M, H.disableDoubleClick = q);
3169
3209
  }
3170
3210
  }),
3171
- [O, h, b, u, R]
3172
- ), P = q(null);
3211
+ [O, g, b, u, R]
3212
+ ), P = B(null);
3173
3213
  return ne(() => {
3174
- const z = N.current;
3214
+ const z = A.current;
3175
3215
  if (z === null)
3176
3216
  return;
3177
3217
  const M = v.current;
@@ -3181,24 +3221,24 @@ function lo({
3181
3221
  ), M.separators = Ne(
3182
3222
  u,
3183
3223
  M.separators
3184
- ), w.current = io([
3224
+ ), w.current = co([
3185
3225
  ...M.panels.map(({ element: L }) => L),
3186
3226
  ...M.separators.map(({ element: L }) => L)
3187
3227
  ]);
3188
- let B;
3228
+ let q;
3189
3229
  if (R.defaultLayout !== void 0 && Object.keys(R.defaultLayout).length === M.panels.length) {
3190
- B = {};
3230
+ q = {};
3191
3231
  for (const L of M.panels) {
3192
3232
  const k = R.defaultLayout[L.id];
3193
- k !== void 0 && (B[L.id] = k);
3233
+ k !== void 0 && (q[L.id] = k);
3194
3234
  }
3195
3235
  }
3196
3236
  const J = {
3197
3237
  disabled: !!r,
3198
3238
  element: z,
3199
- id: h,
3239
+ id: g,
3200
3240
  mutableState: {
3201
- defaultLayout: B,
3241
+ defaultLayout: q,
3202
3242
  disableCursor: !!R.disableCursor,
3203
3243
  expandedItemSizes: v.current.lastExpandedPanelSizes,
3204
3244
  layouts: v.current.layouts
@@ -3212,14 +3252,14 @@ function lo({
3212
3252
  separators: M.separators
3213
3253
  };
3214
3254
  P.current = J;
3215
- const H = nn(J), {
3255
+ const H = an(J), {
3216
3256
  defaultLayoutDeferred: Z,
3217
3257
  derivedItemConstraints: Se,
3218
3258
  layout: ze,
3219
3259
  requestedLayout: Ie
3220
- } = se(J.id, !0);
3221
- !Z && Se.length > 0 && (S(ze), p(ze, !1, Ie));
3222
- const ve = Fe(h, (L) => {
3260
+ } = ae(J.id, !0);
3261
+ !Z && Se.length > 0 && (S(ze), h(ze, !1, Ie));
3262
+ const ve = _e(g, (L) => {
3223
3263
  const {
3224
3264
  defaultLayoutDeferred: k,
3225
3265
  derivedItemConstraints: _,
@@ -3228,48 +3268,48 @@ function lo({
3228
3268
  } = L.next;
3229
3269
  if (k || _.length === 0)
3230
3270
  return;
3231
- on({
3271
+ ln({
3232
3272
  derivedItemConstraints: _,
3233
3273
  axis: J,
3234
3274
  layout: G,
3235
3275
  prevLayout: L.prev?.layout,
3236
3276
  requestedLayout: F
3237
3277
  });
3238
- const j = de(), U = j.state !== "active" || !j.hitRegions.some((te) => te.axis === J);
3239
- S(G), U && p(G, L.isUserInteraction, F);
3278
+ const j = se(), U = j.state !== "active" || !j.hitRegions.some((te) => te.axis === J);
3279
+ S(G), U && h(G, L.isUserInteraction, F);
3240
3280
  });
3241
3281
  return () => {
3242
3282
  P.current = null, H(), ve();
3243
3283
  };
3244
3284
  }, [
3245
3285
  r,
3286
+ g,
3246
3287
  h,
3247
- p,
3248
3288
  S,
3249
3289
  u,
3250
- D,
3290
+ N,
3251
3291
  d,
3252
3292
  R
3253
3293
  ]), ne(() => {
3254
- to(w.current) || b();
3294
+ io(w.current) || b();
3255
3295
  }), Be(() => {
3256
3296
  const z = P.current;
3257
3297
  z && (z.mutableState.defaultLayout = n, z.mutableState.disableCursor = !!o);
3258
- }), /* @__PURE__ */ K(mt.Provider, { value: E, children: /* @__PURE__ */ dn(
3298
+ }), /* @__PURE__ */ K(pt.Provider, { value: E, children: /* @__PURE__ */ hn(
3259
3299
  "div",
3260
3300
  {
3261
- ...y,
3301
+ ...m,
3262
3302
  className: t,
3263
3303
  "data-group": !0,
3264
- "data-testid": h,
3265
- id: h,
3266
- ref: $,
3304
+ "data-testid": g,
3305
+ id: g,
3306
+ ref: T,
3267
3307
  style: {
3268
3308
  height: "100%",
3269
3309
  width: "100%",
3270
3310
  overflow: "hidden",
3271
3311
  position: d === "separator" ? "relative" : void 0,
3272
- ...m,
3312
+ ...y,
3273
3313
  display: "flex",
3274
3314
  flexDirection: u === "horizontal" ? "row" : "column",
3275
3315
  flexWrap: "nowrap",
@@ -3282,7 +3322,7 @@ function lo({
3282
3322
  children: [
3283
3323
  e,
3284
3324
  C.map((z) => /* @__PURE__ */ K(
3285
- ro,
3325
+ lo,
3286
3326
  {
3287
3327
  overlay: I,
3288
3328
  preview: z
@@ -3293,11 +3333,11 @@ function lo({
3293
3333
  }
3294
3334
  ) });
3295
3335
  }
3296
- lo.displayName = "Group";
3336
+ mo.displayName = "Group";
3297
3337
  function Ke(e, t) {
3298
3338
  return `react-resizable-panels:${[e, ...t].join(":")}`;
3299
3339
  }
3300
- function co({
3340
+ function po({
3301
3341
  id: e,
3302
3342
  panelIds: t,
3303
3343
  storage: n
@@ -3332,7 +3372,7 @@ function co({
3332
3372
  } catch {
3333
3373
  }
3334
3374
  }
3335
- function zo({
3375
+ function Ro({
3336
3376
  debounceSaveMs: e = 100,
3337
3377
  onlySaveAfterUserInteractions: t,
3338
3378
  panelIds: n,
@@ -3340,50 +3380,50 @@ function zo({
3340
3380
  ...r
3341
3381
  }) {
3342
3382
  const i = n !== void 0, s = "id" in r ? r.id : r.groupId, l = Ke(s, n ?? []), a = Xe(
3343
- uo,
3383
+ ho,
3344
3384
  () => o.getItem(l),
3345
3385
  () => o.getItem(l)
3346
3386
  ), c = Pe(() => {
3347
3387
  if (a) {
3348
- const S = JSON.parse(a), p = Object.values(S);
3349
- if (Array.from(p).every((h) => typeof h == "number"))
3388
+ const S = JSON.parse(a), h = Object.values(S);
3389
+ if (Array.from(h).every((g) => typeof g == "number"))
3350
3390
  return S;
3351
3391
  }
3352
3392
  }, [a]), u = Pe(() => {
3353
3393
  if (!c)
3354
- return co({
3394
+ return po({
3355
3395
  id: s,
3356
3396
  panelIds: n,
3357
3397
  storage: o
3358
3398
  });
3359
- }, [c, s, n, o]), d = c ?? u, g = q(null), m = re(() => {
3360
- const S = g.current;
3361
- S && (g.current = null, clearTimeout(S));
3399
+ }, [c, s, n, o]), d = c ?? u, p = B(null), y = re(() => {
3400
+ const S = p.current;
3401
+ S && (p.current = null, clearTimeout(S));
3362
3402
  }, []);
3363
- Nt(() => () => {
3364
- m();
3365
- }, [m]);
3366
- const y = re(
3403
+ Bt(() => () => {
3404
+ y();
3405
+ }, [y]);
3406
+ const m = re(
3367
3407
  // The hook persists every layout commit -- including library-driven ones --
3368
3408
  // because it owns its own storage and the goal is to remember whatever
3369
3409
  // layout the user is currently looking at. Consumers that only want to
3370
3410
  // persist on user interaction should branch on `isUserInteraction` in
3371
3411
  // their own callback (see #716) rather than via this hook.
3372
- (S, p) => {
3373
- if (t && !p.isUserInteraction)
3412
+ (S, h) => {
3413
+ if (t && !h.isUserInteraction)
3374
3414
  return;
3375
- m();
3376
- const h = p.requestedLayout ?? S;
3415
+ y();
3416
+ const g = h.requestedLayout ?? S;
3377
3417
  let I;
3378
- i ? I = Ke(s, Object.keys(h)) : I = Ke(s, []);
3418
+ i ? I = Ke(s, Object.keys(g)) : I = Ke(s, []);
3379
3419
  try {
3380
- o.setItem(I, JSON.stringify(h));
3420
+ o.setItem(I, JSON.stringify(g));
3381
3421
  } catch (x) {
3382
3422
  console.error(x);
3383
3423
  }
3384
3424
  },
3385
3425
  [
3386
- m,
3426
+ y,
3387
3427
  i,
3388
3428
  s,
3389
3429
  t,
@@ -3391,11 +3431,11 @@ function zo({
3391
3431
  ]
3392
3432
  ), f = re(
3393
3433
  (S) => {
3394
- m(), e === 0 ? y(S, { isUserInteraction: !1 }) : g.current = setTimeout(() => {
3395
- y(S, { isUserInteraction: !1 });
3434
+ y(), e === 0 ? m(S, { isUserInteraction: !1 }) : p.current = setTimeout(() => {
3435
+ m(S, { isUserInteraction: !1 });
3396
3436
  }, e);
3397
3437
  },
3398
- [m, e, y]
3438
+ [y, e, m]
3399
3439
  );
3400
3440
  return {
3401
3441
  /**
@@ -3411,38 +3451,38 @@ function zo({
3411
3451
  /**
3412
3452
  * Attach this callback on the `Group` as the `onLayoutChanged` prop.
3413
3453
  */
3414
- onLayoutChanged: y
3454
+ onLayoutChanged: m
3415
3455
  };
3416
3456
  }
3417
- function uo() {
3457
+ function ho() {
3418
3458
  return function() {
3419
3459
  };
3420
3460
  }
3421
- function Io() {
3461
+ function Mo() {
3422
3462
  return pe(null);
3423
3463
  }
3424
- function Lo() {
3425
- return q(null);
3464
+ function Eo() {
3465
+ return B(null);
3426
3466
  }
3427
- function fo(e, t) {
3428
- const { id: n } = Ze(), o = q({
3429
- collapse: et,
3430
- expand: et,
3467
+ function go(e, t) {
3468
+ const { id: n } = Qe(), o = B({
3469
+ collapse: tt,
3470
+ expand: tt,
3431
3471
  getSize: () => ({
3432
3472
  asPercentage: 0,
3433
3473
  inPixels: 0
3434
3474
  }),
3435
3475
  isCollapsed: () => !1,
3436
- resize: et
3476
+ resize: tt
3437
3477
  });
3438
- it(t, () => o.current, []), ne(() => {
3478
+ st(t, () => o.current, []), ne(() => {
3439
3479
  Object.assign(
3440
3480
  o.current,
3441
- ft({ axisId: n, itemId: e })
3481
+ mt({ axisId: n, itemId: e })
3442
3482
  );
3443
3483
  });
3444
3484
  }
3445
- function mo({
3485
+ function yo({
3446
3486
  children: e,
3447
3487
  className: t,
3448
3488
  collapsedSize: n = "0%",
@@ -3455,22 +3495,22 @@ function mo({
3455
3495
  id: c,
3456
3496
  maxSize: u = "100%",
3457
3497
  minSize: d = "0%",
3458
- onResize: g,
3459
- panelRef: m,
3460
- style: y,
3498
+ onResize: p,
3499
+ panelRef: y,
3500
+ style: m,
3461
3501
  ...f
3462
3502
  }) {
3463
- const S = !!c, p = $e(c), h = Je({
3503
+ const S = !!c, h = Te(c), g = Ze({
3464
3504
  disabled: s
3465
- }), I = q(null), x = Ve(I, l), {
3505
+ }), I = B(null), x = qe(I, l), {
3466
3506
  getPanelStyles: C,
3467
- id: N,
3468
- orientation: D,
3507
+ id: A,
3508
+ orientation: N,
3469
3509
  registerPanel: b,
3470
3510
  updatePanelProps: w
3471
- } = Ze(), v = g !== null, $ = he(
3511
+ } = Qe(), v = p !== null, T = ge(
3472
3512
  (P, z, M) => {
3473
- g?.(P, c, M);
3513
+ p?.(P, c, M);
3474
3514
  }
3475
3515
  );
3476
3516
  ne(() => {
@@ -3478,20 +3518,20 @@ function mo({
3478
3518
  if (P !== null) {
3479
3519
  const z = {
3480
3520
  element: P,
3481
- id: p,
3521
+ id: h,
3482
3522
  idIsStable: S,
3483
3523
  mutableValues: {
3484
3524
  expandToSize: void 0,
3485
3525
  prevSize: void 0
3486
3526
  },
3487
- onResize: v ? $ : void 0,
3527
+ onResize: v ? T : void 0,
3488
3528
  constraintProps: {
3489
3529
  groupResizeBehavior: a,
3490
3530
  collapsedSize: n,
3491
3531
  collapsedThreshold: o,
3492
3532
  collapsible: r,
3493
3533
  defaultSize: i,
3494
- disabled: h.disabled,
3534
+ disabled: g.disabled,
3495
3535
  maxSize: u,
3496
3536
  minSize: d
3497
3537
  }
@@ -3505,22 +3545,22 @@ function mo({
3505
3545
  r,
3506
3546
  i,
3507
3547
  v,
3508
- p,
3548
+ h,
3509
3549
  S,
3510
3550
  u,
3511
3551
  d,
3512
- $,
3552
+ T,
3513
3553
  b,
3514
- h
3554
+ g
3515
3555
  ]), Be(() => {
3516
- w(p, { disabled: s });
3517
- }, [s, p, w]), fo(p, m);
3556
+ w(h, { disabled: s });
3557
+ }, [s, h, w]), go(h, y);
3518
3558
  const O = () => {
3519
- const P = C(N, p);
3559
+ const P = C(A, h);
3520
3560
  if (P)
3521
3561
  return JSON.stringify(P);
3522
3562
  }, R = Xe(
3523
- (P) => Fe(N, P),
3563
+ (P) => _e(A, P),
3524
3564
  O,
3525
3565
  O
3526
3566
  );
@@ -3535,11 +3575,11 @@ function mo({
3535
3575
  ...f,
3536
3576
  "data-disabled": s || void 0,
3537
3577
  "data-panel": !0,
3538
- "data-testid": p,
3539
- id: p,
3578
+ "data-testid": h,
3579
+ id: h,
3540
3580
  ref: x,
3541
3581
  style: {
3542
- ...po,
3582
+ ...So,
3543
3583
  display: "flex",
3544
3584
  flexBasis: 0,
3545
3585
  flexShrink: 1,
@@ -3555,12 +3595,12 @@ function mo({
3555
3595
  maxWidth: "100%",
3556
3596
  flexGrow: 1,
3557
3597
  overflow: "auto",
3558
- ...y,
3598
+ ...m,
3559
3599
  // Inform the browser that the library is handling touch events for this element
3560
3600
  // but still allow users to scroll content within panels in the non-resizing direction
3561
3601
  // NOTE This is not an inherited style
3562
3602
  // See github.com/bvaughn/react-resizable-panels/issues/662
3563
- touchAction: D === "horizontal" ? "pan-y" : "pan-x"
3603
+ touchAction: N === "horizontal" ? "pan-y" : "pan-x"
3564
3604
  },
3565
3605
  children: e
3566
3606
  }
@@ -3568,8 +3608,8 @@ function mo({
3568
3608
  }
3569
3609
  );
3570
3610
  }
3571
- mo.displayName = "Panel";
3572
- const po = {
3611
+ yo.displayName = "Panel";
3612
+ const So = {
3573
3613
  minHeight: 0,
3574
3614
  maxHeight: "100%",
3575
3615
  height: "auto",
@@ -3581,14 +3621,14 @@ const po = {
3581
3621
  padding: 0,
3582
3622
  margin: 0
3583
3623
  };
3584
- function Co() {
3624
+ function Po() {
3585
3625
  return pe(null);
3586
3626
  }
3587
- function Ro() {
3588
- return q(null);
3627
+ function ko() {
3628
+ return B(null);
3589
3629
  }
3590
- const ho = { flexBasis: "auto" }, go = { flexGrow: 0, flexShrink: 0 };
3591
- function yo({
3630
+ const vo = { flexBasis: "auto" }, bo = { flexGrow: 0, flexShrink: 0 };
3631
+ function xo({
3592
3632
  children: e,
3593
3633
  className: t,
3594
3634
  disabled: n,
@@ -3599,19 +3639,19 @@ function yo({
3599
3639
  style: l,
3600
3640
  ...a
3601
3641
  }) {
3602
- const c = $e(i), {
3642
+ const c = Te(i), {
3603
3643
  disableCursor: u,
3604
3644
  id: d,
3605
- orientation: g,
3606
- registerSeparator: m,
3607
- updateSeparatorProps: y
3608
- } = Ze();
3645
+ orientation: p,
3646
+ registerSeparator: y,
3647
+ updateSeparatorProps: m
3648
+ } = Qe();
3609
3649
  return /* @__PURE__ */ K(
3610
- sn,
3650
+ un,
3611
3651
  {
3612
3652
  attributes: a,
3613
3653
  axisId: d,
3614
- axisOrientation: g,
3654
+ axisOrientation: p,
3615
3655
  className: t,
3616
3656
  disableCursor: u,
3617
3657
  disabled: n,
@@ -3619,32 +3659,32 @@ function yo({
3619
3659
  elementRef: r,
3620
3660
  id: c,
3621
3661
  preview: s,
3622
- registerSeparator: m,
3623
- requiredStyle: go,
3662
+ registerSeparator: y,
3663
+ requiredStyle: bo,
3624
3664
  style: l,
3625
- styleDefaults: ho,
3626
- updateSeparatorProps: y,
3665
+ styleDefaults: vo,
3666
+ updateSeparatorProps: m,
3627
3667
  children: e
3628
3668
  }
3629
3669
  );
3630
3670
  }
3631
- yo.displayName = "Separator";
3671
+ xo.displayName = "Separator";
3632
3672
  export {
3633
- yn as Cell,
3634
- Jn as Grid,
3635
- an as Gridline,
3636
- lo as Group,
3637
- mo as Panel,
3638
- yo as Separator,
3639
- cn as SeparatorOverlay,
3640
- Sn as isCoarsePointer,
3641
- bo as useDefaultGridLayout,
3642
- zo as useDefaultLayout,
3643
- xo as useGridCallbackRef,
3644
- wo as useGridRef,
3645
- Io as useGroupCallbackRef,
3646
- Lo as useGroupRef,
3647
- Co as usePanelCallbackRef,
3648
- Ro as usePanelRef
3673
+ xn as Cell,
3674
+ to as Grid,
3675
+ dn as Gridline,
3676
+ mo as Group,
3677
+ yo as Panel,
3678
+ xo as Separator,
3679
+ mn as SeparatorOverlay,
3680
+ wn as isCoarsePointer,
3681
+ Io as useDefaultGridLayout,
3682
+ Ro as useDefaultLayout,
3683
+ Lo as useGridCallbackRef,
3684
+ Co as useGridRef,
3685
+ Mo as useGroupCallbackRef,
3686
+ Eo as useGroupRef,
3687
+ Po as usePanelCallbackRef,
3688
+ ko as usePanelRef
3649
3689
  };
3650
3690
  //# sourceMappingURL=react-resizable-panels.js.map