react-resizable-panels 4.14.3 → 4.14.4

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