react-resizable-panels 4.0.9-alpha.0 → 4.0.9

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,85 +1,85 @@
1
1
  "use client";
2
- import { jsx as B } from "react/jsx-runtime";
3
- import { useId as We, useLayoutEffect as je, useEffect as Be, useRef as T, useCallback as Le, createContext as Ue, useImperativeHandle as Pe, useState as I, useMemo as Ce, useSyncExternalStore as Ve, useContext as Ke } from "react";
4
- function x(e, t = "Assertion error") {
2
+ import { jsx as K } from "react/jsx-runtime";
3
+ import { useId as Ke, useLayoutEffect as Xe, useEffect as Re, useRef as O, useCallback as Ee, createContext as Ye, useImperativeHandle as Me, useState as G, useMemo as Ge, useSyncExternalStore as qe, useContext as Ze } from "react";
4
+ function z(e, t = "Assertion error") {
5
5
  if (!e)
6
6
  throw Error(t);
7
7
  }
8
- function H({
8
+ function B({
9
9
  group: e
10
10
  }) {
11
11
  const { orientation: t, panels: n } = e;
12
- return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
12
+ return n.reduce((o, s) => (o += t === "horizontal" ? s.element.offsetWidth : s.element.offsetHeight, o), 0);
13
13
  }
14
14
  function se(e, t) {
15
15
  return t.sort(
16
- e === "horizontal" ? Xe : Ye
16
+ e === "horizontal" ? Je : Qe
17
17
  );
18
18
  }
19
- function Xe(e, t) {
19
+ function Je(e, t) {
20
20
  const n = e.element.offsetLeft - t.element.offsetLeft;
21
21
  return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
22
22
  }
23
- function Ye(e, t) {
23
+ function Qe(e, t) {
24
24
  const n = e.element.offsetTop - t.element.offsetTop;
25
25
  return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
26
26
  }
27
- function Re(e) {
28
- const { element: t, orientation: n, panels: o, separators: r } = e, a = se(
27
+ function Ie(e) {
28
+ const { element: t, orientation: n, panels: o, separators: s } = e, a = se(
29
29
  n,
30
- Array.from(t.children).filter((l) => l instanceof HTMLElement).map((l) => ({ element: l }))
31
- ).map(({ element: l }) => l), u = [];
32
- let i, s;
33
- for (const l of a) {
30
+ Array.from(t.children).filter((u) => u instanceof HTMLElement).map((u) => ({ element: u }))
31
+ ).map(({ element: u }) => u), l = [];
32
+ let i, r;
33
+ for (const u of a) {
34
34
  const c = o.find(
35
- (d) => d.element === l
35
+ (d) => d.element === u
36
36
  );
37
37
  if (c) {
38
38
  if (i) {
39
- const d = i.element.getBoundingClientRect(), z = l.getBoundingClientRect();
40
- u.push({
39
+ const d = i.element.getBoundingClientRect(), x = u.getBoundingClientRect();
40
+ l.push({
41
41
  group: e,
42
- groupSize: H({ group: e }),
42
+ groupSize: B({ group: e }),
43
43
  panels: [i, c],
44
- separator: s,
44
+ separator: r,
45
45
  rect: n === "horizontal" ? new DOMRect(
46
46
  d.right,
47
- z.top,
48
- z.left - d.right,
49
- z.height
47
+ x.top,
48
+ x.left - d.right,
49
+ x.height
50
50
  ) : new DOMRect(
51
- z.left,
51
+ x.left,
52
52
  d.bottom,
53
- z.width,
54
- z.top - d.bottom
53
+ x.width,
54
+ x.top - d.bottom
55
55
  )
56
56
  });
57
57
  }
58
- i = c, s = void 0;
58
+ i = c, r = void 0;
59
59
  } else {
60
- const d = r.find(
61
- (z) => z.element === l
60
+ const d = s.find(
61
+ (x) => x.element === u
62
62
  );
63
- d ? s = d : (i = void 0, s = void 0);
63
+ d ? r = d : (i = void 0, r = void 0);
64
64
  }
65
65
  }
66
- return u;
66
+ return l;
67
67
  }
68
- function qe(e, t) {
68
+ function et(e, t) {
69
69
  const n = getComputedStyle(e), o = parseFloat(n.fontSize);
70
70
  return t * o;
71
71
  }
72
- function Ze(e, t) {
72
+ function tt(e, t) {
73
73
  const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
74
74
  return t * o;
75
75
  }
76
- function Je(e) {
76
+ function nt(e) {
77
77
  return e / 100 * window.innerHeight;
78
78
  }
79
- function Qe(e) {
79
+ function ot(e) {
80
80
  return e / 100 * window.innerWidth;
81
81
  }
82
- function et(e) {
82
+ function it(e) {
83
83
  switch (typeof e) {
84
84
  case "number":
85
85
  return [e, "px"];
@@ -89,46 +89,46 @@ function et(e) {
89
89
  }
90
90
  }
91
91
  }
92
- function Q({
92
+ function te({
93
93
  groupSize: e,
94
94
  panelElement: t,
95
95
  styleProp: n
96
96
  }) {
97
97
  let o;
98
- const [r, a] = et(n);
98
+ const [s, a] = it(n);
99
99
  switch (a) {
100
100
  case "%": {
101
- o = r / 100 * e;
101
+ o = s / 100 * e;
102
102
  break;
103
103
  }
104
104
  case "px": {
105
- o = r;
105
+ o = s;
106
106
  break;
107
107
  }
108
108
  case "rem": {
109
- o = Ze(t, r);
109
+ o = tt(t, s);
110
110
  break;
111
111
  }
112
112
  case "em": {
113
- o = qe(t, r);
113
+ o = et(t, s);
114
114
  break;
115
115
  }
116
116
  case "vh": {
117
- o = Je(r);
117
+ o = nt(s);
118
118
  break;
119
119
  }
120
120
  case "vw": {
121
- o = Qe(r);
121
+ o = ot(s);
122
122
  break;
123
123
  }
124
124
  }
125
125
  return o;
126
126
  }
127
- function G(e) {
127
+ function I(e) {
128
128
  return parseFloat(e.toFixed(3));
129
129
  }
130
- function pe(e) {
131
- const { panels: t } = e, n = H({ group: e });
130
+ function ye(e) {
131
+ const { panels: t } = e, n = B({ group: e });
132
132
  return n === 0 ? t.map((o) => ({
133
133
  collapsedSize: 0,
134
134
  collapsible: o.panelConstraints.collapsible === !0,
@@ -137,54 +137,54 @@ function pe(e) {
137
137
  maxSize: 100,
138
138
  panelId: o.id
139
139
  })) : t.map((o) => {
140
- const { element: r, panelConstraints: a } = o;
141
- let u = 0;
140
+ const { element: s, panelConstraints: a } = o;
141
+ let l = 0;
142
142
  if (a.collapsedSize) {
143
- const c = Q({
143
+ const c = te({
144
144
  groupSize: n,
145
- panelElement: r,
145
+ panelElement: s,
146
146
  styleProp: a.collapsedSize
147
147
  });
148
- u = G(c / n * 100);
148
+ l = I(c / n * 100);
149
149
  }
150
150
  let i;
151
151
  if (a.defaultSize) {
152
- const c = Q({
152
+ const c = te({
153
153
  groupSize: n,
154
- panelElement: r,
154
+ panelElement: s,
155
155
  styleProp: a.defaultSize
156
156
  });
157
- i = G(c / n * 100);
157
+ i = I(c / n * 100);
158
158
  }
159
- let s = 0;
159
+ let r = 0;
160
160
  if (a.minSize) {
161
- const c = Q({
161
+ const c = te({
162
162
  groupSize: n,
163
- panelElement: r,
163
+ panelElement: s,
164
164
  styleProp: a.minSize
165
165
  });
166
- s = G(c / n * 100);
166
+ r = I(c / n * 100);
167
167
  }
168
- let l = 100;
168
+ let u = 100;
169
169
  if (a.maxSize) {
170
- const c = Q({
170
+ const c = te({
171
171
  groupSize: n,
172
- panelElement: r,
172
+ panelElement: s,
173
173
  styleProp: a.maxSize
174
174
  });
175
- l = G(c / n * 100);
175
+ u = I(c / n * 100);
176
176
  }
177
177
  return {
178
- collapsedSize: u,
178
+ collapsedSize: l,
179
179
  collapsible: a.collapsible === !0,
180
180
  defaultSize: i,
181
- minSize: s,
182
- maxSize: l,
181
+ minSize: r,
182
+ maxSize: u,
183
183
  panelId: o.id
184
184
  };
185
185
  });
186
186
  }
187
- class tt {
187
+ class rt {
188
188
  #e = {};
189
189
  addListener(t, n) {
190
190
  const o = this.#e[t];
@@ -198,17 +198,17 @@ class tt {
198
198
  if (o.length === 1)
199
199
  o[0].call(null, n);
200
200
  else {
201
- let r = !1, a = null;
202
- const u = Array.from(o);
203
- for (let i = 0; i < u.length; i++) {
204
- const s = u[i];
201
+ let s = !1, a = null;
202
+ const l = Array.from(o);
203
+ for (let i = 0; i < l.length; i++) {
204
+ const r = l[i];
205
205
  try {
206
- s.call(null, n);
207
- } catch (l) {
208
- a === null && (r = !0, a = l);
206
+ r.call(null, n);
207
+ } catch (u) {
208
+ a === null && (s = !0, a = u);
209
209
  }
210
210
  }
211
- if (r)
211
+ if (s)
212
212
  throw a;
213
213
  }
214
214
  }
@@ -218,13 +218,13 @@ class tt {
218
218
  removeListener(t, n) {
219
219
  const o = this.#e[t];
220
220
  if (o !== void 0) {
221
- const r = o.indexOf(n);
222
- r >= 0 && o.splice(r, 1);
221
+ const s = o.indexOf(n);
222
+ s >= 0 && o.splice(s, 1);
223
223
  }
224
224
  }
225
225
  }
226
226
  function P(e, t, n = 0) {
227
- return Math.abs(G(e) - G(t)) <= n;
227
+ return Math.abs(I(e) - I(t)) <= n;
228
228
  }
229
229
  let R = {
230
230
  cursorFlags: 0,
@@ -233,8 +233,8 @@ let R = {
233
233
  },
234
234
  mountedGroups: /* @__PURE__ */ new Map()
235
235
  };
236
- const D = new tt();
237
- function O() {
236
+ const _ = new rt();
237
+ function D() {
238
238
  return R;
239
239
  }
240
240
  function E(e) {
@@ -245,35 +245,35 @@ function E(e) {
245
245
  return R = {
246
246
  ...R,
247
247
  ...t
248
- }, t.cursorFlags !== void 0 && D.emit("cursorFlagsChange", R.cursorFlags), t.interactionState !== void 0 && D.emit("interactionStateChange", R.interactionState), t.mountedGroups !== void 0 && (R.mountedGroups.forEach((o, r) => {
248
+ }, t.cursorFlags !== void 0 && _.emit("cursorFlagsChange", R.cursorFlags), t.interactionState !== void 0 && _.emit("interactionStateChange", R.interactionState), t.mountedGroups !== void 0 && (R.mountedGroups.forEach((o, s) => {
249
249
  o.derivedPanelConstraints.forEach((a) => {
250
250
  if (a.collapsible) {
251
- const { layout: u } = n.mountedGroups.get(r) ?? {};
252
- if (u) {
251
+ const { layout: l } = n.mountedGroups.get(s) ?? {};
252
+ if (l) {
253
253
  const i = P(
254
254
  a.collapsedSize,
255
255
  o.layout[a.panelId]
256
- ), s = P(
256
+ ), r = P(
257
257
  a.collapsedSize,
258
- u[a.panelId]
258
+ l[a.panelId]
259
259
  );
260
- i && !s && (r.inMemoryLastExpandedPanelSizes[a.panelId] = u[a.panelId]);
260
+ i && !r && (s.inMemoryLastExpandedPanelSizes[a.panelId] = l[a.panelId]);
261
261
  }
262
262
  }
263
263
  });
264
- }), D.emit("mountedGroupsChange", R.mountedGroups)), R;
264
+ }), _.emit("mountedGroupsChange", R.mountedGroups)), R;
265
265
  }
266
- const nt = (e) => e, ie = () => {
267
- }, Ee = 1, Me = 2, Ie = 4, Ge = 8, me = {
266
+ const st = (e) => e, ie = () => {
267
+ }, ke = 1, De = 2, Oe = 4, Te = 8, ge = {
268
268
  coarse: 10,
269
269
  precise: 5
270
270
  };
271
- function ot({
271
+ function at({
272
272
  cursorFlags: e,
273
273
  groups: t,
274
274
  state: n
275
275
  }) {
276
- let o = 0, r = 0;
276
+ let o = 0, s = 0;
277
277
  switch (n) {
278
278
  case "active":
279
279
  case "hover":
@@ -285,42 +285,42 @@ function ot({
285
285
  break;
286
286
  }
287
287
  case "vertical": {
288
- r++;
288
+ s++;
289
289
  break;
290
290
  }
291
291
  }
292
292
  });
293
293
  }
294
- if (o === 0 && r === 0)
294
+ if (o === 0 && s === 0)
295
295
  return null;
296
296
  switch (n) {
297
297
  case "active": {
298
- const a = (e & Ee) !== 0, u = (e & Me) !== 0, i = (e & Ie) !== 0, s = (e & Ge) !== 0;
298
+ const a = (e & ke) !== 0, l = (e & De) !== 0, i = (e & Oe) !== 0, r = (e & Te) !== 0;
299
299
  if (e) {
300
300
  if (a)
301
- return i ? "se-resize" : s ? "ne-resize" : "e-resize";
302
- if (u)
303
- return i ? "sw-resize" : s ? "nw-resize" : "w-resize";
301
+ return i ? "se-resize" : r ? "ne-resize" : "e-resize";
302
+ if (l)
303
+ return i ? "sw-resize" : r ? "nw-resize" : "w-resize";
304
304
  if (i)
305
305
  return "s-resize";
306
- if (s)
306
+ if (r)
307
307
  return "n-resize";
308
308
  }
309
309
  break;
310
310
  }
311
311
  }
312
- return o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
312
+ return o > 0 && s > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
313
313
  }
314
314
  let re, k;
315
315
  function le() {
316
316
  k === void 0 && (k = new CSSStyleSheet(), document.adoptedStyleSheets = [k]);
317
- const { cursorFlags: e, interactionState: t } = O();
317
+ const { cursorFlags: e, interactionState: t } = D();
318
318
  switch (t.state) {
319
319
  case "active":
320
320
  case "hover": {
321
- const n = ot({
321
+ const n = at({
322
322
  cursorFlags: e,
323
- groups: t.hitRegions.map((r) => r.group),
323
+ groups: t.hitRegions.map((s) => s.group),
324
324
  state: t.state
325
325
  }), o = `*{cursor: ${n} !important; ${t.state === "active" ? "touch-action: none;" : ""} }`;
326
326
  if (re === o)
@@ -334,7 +334,7 @@ function le() {
334
334
  }
335
335
  }
336
336
  }
337
- function it(e, t) {
337
+ function lt(e, t) {
338
338
  if (e.length !== t.length)
339
339
  return !1;
340
340
  for (let n = 0; n < e.length; n++)
@@ -342,237 +342,239 @@ function it(e, t) {
342
342
  return !1;
343
343
  return !0;
344
344
  }
345
- function U(e, t) {
345
+ function X(e, t) {
346
346
  return P(e, t) ? 0 : e > t ? 1 : -1;
347
347
  }
348
- function F({
348
+ function j({
349
349
  panelConstraints: e,
350
350
  size: t
351
351
  }) {
352
352
  const {
353
353
  collapsedSize: n = 0,
354
354
  collapsible: o,
355
- maxSize: r = 100,
355
+ maxSize: s = 100,
356
356
  minSize: a = 0
357
357
  } = e;
358
- if (U(t, a) < 0)
358
+ if (X(t, a) < 0)
359
359
  if (o) {
360
- const u = (n + a) / 2;
361
- U(t, u) < 0 ? t = n : t = a;
360
+ const l = (n + a) / 2;
361
+ X(t, l) < 0 ? t = n : t = a;
362
362
  } else
363
363
  t = a;
364
- return t = Math.min(r, t), t = G(t), t;
364
+ return t = Math.min(s, t), t = I(t), t;
365
365
  }
366
- function V({
366
+ function Y({
367
367
  delta: e,
368
368
  initialLayout: t,
369
369
  panelConstraints: n,
370
370
  pivotIndices: o,
371
- prevLayout: r,
371
+ prevLayout: s,
372
372
  trigger: a
373
373
  }) {
374
374
  if (P(e, 0))
375
375
  return t;
376
- const u = Object.values(t), i = Object.values(r), s = [...u], [l, c] = o;
377
- x(l != null, "Invalid first pivot index"), x(c != null, "Invalid second pivot index");
376
+ const l = Object.values(t), i = Object.values(s), r = [...l], [u, c] = o;
377
+ z(u != null, "Invalid first pivot index"), z(c != null, "Invalid second pivot index");
378
378
  let d = 0;
379
379
  if (a === "keyboard") {
380
380
  {
381
- const f = e < 0 ? c : l, p = n[f];
382
- x(
381
+ const f = e < 0 ? c : u, p = n[f];
382
+ z(
383
383
  p,
384
384
  `Panel constraints not found for index ${f}`
385
385
  );
386
386
  const {
387
387
  collapsedSize: h = 0,
388
- collapsible: y,
389
- minSize: S = 0
388
+ collapsible: v,
389
+ minSize: g = 0
390
390
  } = p;
391
- if (y) {
392
- const v = u[f];
393
- if (x(
394
- v != null,
391
+ if (v) {
392
+ const S = l[f];
393
+ if (z(
394
+ S != null,
395
395
  `Previous layout not found for panel index ${f}`
396
- ), P(v, h)) {
397
- const g = S - v;
398
- U(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
396
+ ), P(S, h)) {
397
+ const y = g - S;
398
+ X(y, Math.abs(e)) > 0 && (e = e < 0 ? 0 - y : y);
399
399
  }
400
400
  }
401
401
  }
402
402
  {
403
- const f = e < 0 ? l : c, p = n[f];
404
- x(
403
+ const f = e < 0 ? u : c, p = n[f];
404
+ z(
405
405
  p,
406
406
  `No panel constraints found for index ${f}`
407
407
  );
408
408
  const {
409
409
  collapsedSize: h = 0,
410
- collapsible: y,
411
- minSize: S = 0
410
+ collapsible: v,
411
+ minSize: g = 0
412
412
  } = p;
413
- if (y) {
414
- const v = u[f];
415
- if (x(
416
- v != null,
413
+ if (v) {
414
+ const S = l[f];
415
+ if (z(
416
+ S != null,
417
417
  `Previous layout not found for panel index ${f}`
418
- ), P(v, S)) {
419
- const g = v - h;
420
- U(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
418
+ ), P(S, g)) {
419
+ const y = S - h;
420
+ X(y, Math.abs(e)) > 0 && (e = e < 0 ? 0 - y : y);
421
421
  }
422
422
  }
423
423
  }
424
424
  }
425
425
  {
426
426
  const f = e < 0 ? 1 : -1;
427
- let p = e < 0 ? c : l, h = 0;
427
+ let p = e < 0 ? c : u, h = 0;
428
428
  for (; ; ) {
429
- const S = u[p];
430
- x(
431
- S != null,
429
+ const g = l[p];
430
+ z(
431
+ g != null,
432
432
  `Previous layout not found for panel index ${p}`
433
433
  );
434
- const g = F({
434
+ const y = j({
435
435
  panelConstraints: n[p],
436
436
  size: 100
437
- }) - S;
438
- if (h += g, p += f, p < 0 || p >= n.length)
437
+ }) - g;
438
+ if (h += y, p += f, p < 0 || p >= n.length)
439
439
  break;
440
440
  }
441
- const y = Math.min(Math.abs(e), Math.abs(h));
442
- e = e < 0 ? 0 - y : y;
441
+ const v = Math.min(Math.abs(e), Math.abs(h));
442
+ e = e < 0 ? 0 - v : v;
443
443
  }
444
444
  {
445
- let p = e < 0 ? l : c;
445
+ let p = e < 0 ? u : c;
446
446
  for (; p >= 0 && p < n.length; ) {
447
- const h = Math.abs(e) - Math.abs(d), y = u[p];
448
- x(
449
- y != null,
447
+ const h = Math.abs(e) - Math.abs(d), v = l[p];
448
+ z(
449
+ v != null,
450
450
  `Previous layout not found for panel index ${p}`
451
451
  );
452
- const S = y - h, v = F({
452
+ const g = v - h, S = j({
453
453
  panelConstraints: n[p],
454
- size: S
454
+ size: g
455
455
  });
456
- if (!P(y, v) && (d += y - v, s[p] = v, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
456
+ if (!P(v, S) && (d += v - S, r[p] = S, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
457
457
  numeric: !0
458
458
  }) >= 0))
459
459
  break;
460
460
  e < 0 ? p-- : p++;
461
461
  }
462
462
  }
463
- if (it(i, s))
464
- return r;
463
+ if (lt(i, r))
464
+ return s;
465
465
  {
466
- const f = e < 0 ? c : l, p = u[f];
467
- x(
466
+ const f = e < 0 ? c : u, p = l[f];
467
+ z(
468
468
  p != null,
469
469
  `Previous layout not found for panel index ${f}`
470
470
  );
471
- const h = p + d, y = F({
471
+ const h = p + d, v = j({
472
472
  panelConstraints: n[f],
473
473
  size: h
474
474
  });
475
- if (s[f] = y, !P(y, h)) {
476
- let S = h - y, g = e < 0 ? c : l;
477
- for (; g >= 0 && g < n.length; ) {
478
- const w = s[g];
479
- x(
480
- w != null,
481
- `Previous layout not found for panel index ${g}`
475
+ if (r[f] = v, !P(v, h)) {
476
+ let g = h - v, y = e < 0 ? c : u;
477
+ for (; y >= 0 && y < n.length; ) {
478
+ const b = r[y];
479
+ z(
480
+ b != null,
481
+ `Previous layout not found for panel index ${y}`
482
482
  );
483
- const L = w + S, C = F({
484
- panelConstraints: n[g],
483
+ const L = b + g, C = j({
484
+ panelConstraints: n[y],
485
485
  size: L
486
486
  });
487
- if (P(w, C) || (S -= C - w, s[g] = C), P(S, 0))
487
+ if (P(b, C) || (g -= C - b, r[y] = C), P(g, 0))
488
488
  break;
489
- e > 0 ? g-- : g++;
489
+ e > 0 ? y-- : y++;
490
490
  }
491
491
  }
492
492
  }
493
- const z = Object.values(s).reduce(
493
+ const x = Object.values(r).reduce(
494
494
  (f, p) => p + f,
495
495
  0
496
496
  );
497
- if (!P(z, 100, 0.1))
498
- return r;
499
- const m = Object.keys(r);
500
- return s.reduce((f, p, h) => (f[m[h]] = p, f), {});
497
+ if (!P(x, 100, 0.1))
498
+ return s;
499
+ const m = Object.keys(s);
500
+ return r.reduce((f, p, h) => (f[m[h]] = p, f), {});
501
501
  }
502
- function W(e, t) {
502
+ function U(e, t) {
503
503
  if (Object.keys(e).length !== Object.keys(t).length)
504
504
  return !1;
505
505
  for (const n in e)
506
- if (U(e[n], t[n]) !== 0)
506
+ if (t[n] === void 0 || X(e[n], t[n]) !== 0)
507
507
  return !1;
508
508
  return !0;
509
509
  }
510
- function ke({
510
+ function _e({
511
511
  event: e,
512
512
  hitRegions: t,
513
513
  initialLayoutMap: n,
514
514
  mountedGroups: o,
515
- pointerDownAtPoint: r
515
+ pointerDownAtPoint: s
516
516
  }) {
517
517
  let a = 0;
518
- const u = new Map(o);
518
+ const l = new Map(o);
519
519
  t.forEach((i) => {
520
- const { group: s, groupSize: l } = i, { disableCursor: c, orientation: d, panels: z } = s;
520
+ const { group: r, groupSize: u } = i, { disableCursor: c, orientation: d, panels: x } = r;
521
521
  let m = 0;
522
- r ? d === "horizontal" ? m = (e.clientX - r.x) / l * 100 : m = (e.clientY - r.y) / l * 100 : d === "horizontal" ? m = e.clientX < 0 ? -100 : 100 : m = e.clientY < 0 ? -100 : 100;
523
- const f = n.get(s), {
524
- derivedPanelConstraints: p,
525
- layout: h,
526
- separatorToPanels: y
527
- } = o.get(s) ?? {};
528
- if (p && f && h && y) {
529
- const S = V({
522
+ s ? d === "horizontal" ? m = (e.clientX - s.x) / u * 100 : m = (e.clientY - s.y) / u * 100 : d === "horizontal" ? m = e.clientX < 0 ? -100 : 100 : m = e.clientY < 0 ? -100 : 100;
523
+ const f = n.get(r), {
524
+ defaultLayoutDeferred: p,
525
+ derivedPanelConstraints: h,
526
+ layout: v,
527
+ separatorToPanels: g
528
+ } = o.get(r) ?? { defaultLayoutDeferred: !1 };
529
+ if (h && f && v && g) {
530
+ const S = Y({
530
531
  delta: m,
531
532
  initialLayout: f,
532
- panelConstraints: p,
533
- pivotIndices: i.panels.map((v) => z.indexOf(v)),
534
- prevLayout: h,
533
+ panelConstraints: h,
534
+ pivotIndices: i.panels.map((y) => x.indexOf(y)),
535
+ prevLayout: v,
535
536
  trigger: "mouse-or-touch"
536
537
  });
537
- if (W(S, h)) {
538
+ if (U(S, v)) {
538
539
  if (m !== 0 && !c)
539
540
  switch (d) {
540
541
  case "horizontal": {
541
- a |= m < 0 ? Ee : Me;
542
+ a |= m < 0 ? ke : De;
542
543
  break;
543
544
  }
544
545
  case "vertical": {
545
- a |= m < 0 ? Ie : Ge;
546
+ a |= m < 0 ? Oe : Te;
546
547
  break;
547
548
  }
548
549
  }
549
550
  } else {
550
- u.set(i.group, {
551
- derivedPanelConstraints: p,
551
+ l.set(i.group, {
552
+ defaultLayoutDeferred: p,
553
+ derivedPanelConstraints: h,
552
554
  layout: S,
553
- separatorToPanels: y
555
+ separatorToPanels: g
554
556
  });
555
- const v = i.group.panels.map(({ id: g }) => g).join(",");
556
- i.group.inMemoryLayouts[v] = S;
557
+ const y = i.group.panels.map(({ id: b }) => b).join(",");
558
+ i.group.inMemoryLayouts[y] = S;
557
559
  }
558
560
  }
559
561
  }), E({
560
562
  cursorFlags: a,
561
- mountedGroups: u
563
+ mountedGroups: l
562
564
  }), le();
563
565
  }
564
- function he(e) {
566
+ function ve(e) {
565
567
  if (e.defaultPrevented)
566
568
  return;
567
569
  if (e.relatedTarget !== null)
568
570
  return;
569
571
  if (e.clientX === 0 && e.clientY === 0)
570
572
  return;
571
- const { interactionState: t, mountedGroups: n } = O();
573
+ const { interactionState: t, mountedGroups: n } = D();
572
574
  switch (t.state) {
573
575
  case "active":
574
576
  t.hitRegions.forEach((o) => {
575
- e.currentTarget === o.group.element && ke({
577
+ e.currentTarget === o.group.element && _e({
576
578
  event: e,
577
579
  hitRegions: t.hitRegions,
578
580
  initialLayoutMap: t.initialLayoutMap,
@@ -581,10 +583,10 @@ function he(e) {
581
583
  });
582
584
  }
583
585
  }
584
- function te(e) {
586
+ function oe(e) {
585
587
  const t = e.parentElement;
586
- x(t, "Parent group element not found");
587
- const { mountedGroups: n } = O();
588
+ z(t, "Parent group element not found");
589
+ const { mountedGroups: n } = D();
588
590
  for (const [o] of n)
589
591
  if (o.element === t)
590
592
  return o;
@@ -594,172 +596,175 @@ function A({
594
596
  layout: e,
595
597
  panelConstraints: t
596
598
  }) {
597
- const o = [...Object.values(e)], r = o.reduce(
598
- (i, s) => i + s,
599
+ const o = [...Object.values(e)], s = o.reduce(
600
+ (i, r) => i + r,
599
601
  0
600
602
  );
601
603
  if (o.length !== t.length)
602
604
  throw Error(
603
605
  `Invalid ${t.length} panel layout: ${o.map((i) => `${i}%`).join(", ")}`
604
606
  );
605
- if (!P(r, 100) && o.length > 0)
607
+ if (!P(s, 100) && o.length > 0)
606
608
  for (let i = 0; i < t.length; i++) {
607
- const s = o[i];
608
- x(s != null, `No layout data found for index ${i}`);
609
- const l = 100 / r * s;
610
- o[i] = l;
609
+ const r = o[i];
610
+ z(r != null, `No layout data found for index ${i}`);
611
+ const u = 100 / s * r;
612
+ o[i] = u;
611
613
  }
612
614
  let a = 0;
613
615
  for (let i = 0; i < t.length; i++) {
614
- const s = o[i];
615
- x(s != null, `No layout data found for index ${i}`);
616
- const l = F({
616
+ const r = o[i];
617
+ z(r != null, `No layout data found for index ${i}`);
618
+ const u = j({
617
619
  panelConstraints: t[i],
618
- size: s
620
+ size: r
619
621
  });
620
- s != l && (a += s - l, o[i] = l);
622
+ r != u && (a += r - u, o[i] = u);
621
623
  }
622
624
  if (!P(a, 0))
623
625
  for (let i = 0; i < t.length; i++) {
624
- const s = o[i];
625
- x(s != null, `No layout data found for index ${i}`);
626
- const l = s + a, c = F({
626
+ const r = o[i];
627
+ z(r != null, `No layout data found for index ${i}`);
628
+ const u = r + a, c = j({
627
629
  panelConstraints: t[i],
628
- size: l
630
+ size: u
629
631
  });
630
- if (s !== c && (a -= c - s, o[i] = c, P(a, 0)))
632
+ if (r !== c && (a -= c - r, o[i] = c, P(a, 0)))
631
633
  break;
632
634
  }
633
- const u = Object.keys(e);
634
- return o.reduce((i, s, l) => (i[u[l]] = s, i), {});
635
+ const l = Object.keys(e);
636
+ return o.reduce((i, r, u) => (i[l[u]] = r, i), {});
635
637
  }
636
- function Oe({
638
+ function Ae({
637
639
  groupId: e
638
640
  }) {
639
641
  const t = () => {
640
- const { mountedGroups: n } = O();
641
- for (const [o, r] of n)
642
+ const { mountedGroups: n } = D();
643
+ for (const [o, s] of n)
642
644
  if (o.id === e)
643
- return { group: o, ...r };
644
- throw Error(`Group ${e} not found`);
645
+ return { group: o, ...s };
646
+ throw Error(`Could not find Group with id "${e}"`);
645
647
  };
646
648
  return {
647
649
  getLayout() {
648
- const { layout: n } = t();
649
- return n;
650
+ const { defaultLayoutDeferred: n, layout: o } = t();
651
+ return n ? {} : o;
650
652
  },
651
653
  setLayout(n) {
652
654
  const {
653
- derivedPanelConstraints: o,
654
- group: r,
655
- layout: a,
656
- separatorToPanels: u
657
- } = t(), i = A({
655
+ defaultLayoutDeferred: o,
656
+ derivedPanelConstraints: s,
657
+ group: a,
658
+ layout: l,
659
+ separatorToPanels: i
660
+ } = t(), r = A({
658
661
  layout: n,
659
- panelConstraints: o
662
+ panelConstraints: s
660
663
  });
661
- return W(a, i) || E((s) => ({
662
- mountedGroups: new Map(s.mountedGroups).set(r, {
663
- derivedPanelConstraints: o,
664
- layout: i,
665
- separatorToPanels: u
664
+ return o ? l : (U(l, r) || E((u) => ({
665
+ mountedGroups: new Map(u.mountedGroups).set(a, {
666
+ defaultLayoutDeferred: o,
667
+ derivedPanelConstraints: s,
668
+ layout: r,
669
+ separatorToPanels: i
666
670
  })
667
- })), i;
671
+ })), r);
668
672
  }
669
673
  };
670
674
  }
671
- function Te(e) {
672
- const { mountedGroups: t } = O(), n = t.get(e);
673
- return x(n, `Mounted Group ${e.id} not found`), n;
675
+ function Ne(e) {
676
+ const { mountedGroups: t } = D(), n = t.get(e);
677
+ return z(n, `Mounted Group ${e.id} not found`), n;
674
678
  }
675
- function _(e, t) {
676
- const n = te(e), o = Te(n), r = n.separators.find(
679
+ function T(e, t) {
680
+ const n = oe(e), o = Ne(n), s = n.separators.find(
677
681
  (d) => d.element === e
678
682
  );
679
- x(r, "Matching separator not found");
680
- const a = o.separatorToPanels.get(r);
681
- x(a, "Matching panels not found");
682
- const u = a.map((d) => n.panels.indexOf(d)), s = Oe({ groupId: n.id }).getLayout(), l = V({
683
+ z(s, "Matching separator not found");
684
+ const a = o.separatorToPanels.get(s);
685
+ z(a, "Matching panels not found");
686
+ const l = a.map((d) => n.panels.indexOf(d)), r = Ae({ groupId: n.id }).getLayout(), u = Y({
683
687
  delta: t,
684
- initialLayout: s,
688
+ initialLayout: r,
685
689
  panelConstraints: o.derivedPanelConstraints,
686
- pivotIndices: u,
687
- prevLayout: s,
690
+ pivotIndices: l,
691
+ prevLayout: r,
688
692
  trigger: "keyboard"
689
693
  }), c = A({
690
- layout: l,
694
+ layout: u,
691
695
  panelConstraints: o.derivedPanelConstraints
692
696
  });
693
- W(s, c) || E((d) => ({
697
+ U(r, c) || E((d) => ({
694
698
  mountedGroups: new Map(d.mountedGroups).set(n, {
699
+ defaultLayoutDeferred: o.defaultLayoutDeferred,
695
700
  derivedPanelConstraints: o.derivedPanelConstraints,
696
701
  layout: c,
697
702
  separatorToPanels: o.separatorToPanels
698
703
  })
699
704
  }));
700
705
  }
701
- function ge(e) {
706
+ function Se(e) {
702
707
  if (e.defaultPrevented)
703
708
  return;
704
- const t = e.currentTarget, n = te(t);
709
+ const t = e.currentTarget, n = oe(t);
705
710
  if (!n.disabled)
706
711
  switch (e.key) {
707
712
  case "ArrowDown": {
708
- e.preventDefault(), n.orientation === "vertical" && _(t, 5);
713
+ e.preventDefault(), n.orientation === "vertical" && T(t, 5);
709
714
  break;
710
715
  }
711
716
  case "ArrowLeft": {
712
- e.preventDefault(), n.orientation === "horizontal" && _(t, -5);
717
+ e.preventDefault(), n.orientation === "horizontal" && T(t, -5);
713
718
  break;
714
719
  }
715
720
  case "ArrowRight": {
716
- e.preventDefault(), n.orientation === "horizontal" && _(t, 5);
721
+ e.preventDefault(), n.orientation === "horizontal" && T(t, 5);
717
722
  break;
718
723
  }
719
724
  case "ArrowUp": {
720
- e.preventDefault(), n.orientation === "vertical" && _(t, -5);
725
+ e.preventDefault(), n.orientation === "vertical" && T(t, -5);
721
726
  break;
722
727
  }
723
728
  case "End": {
724
- e.preventDefault(), _(t, 100);
729
+ e.preventDefault(), T(t, 100);
725
730
  break;
726
731
  }
727
732
  case "Enter": {
728
733
  e.preventDefault();
729
- const o = te(t), { derivedPanelConstraints: r, layout: a, separatorToPanels: u } = Te(o), i = o.separators.find(
734
+ const o = oe(t), { derivedPanelConstraints: s, layout: a, separatorToPanels: l } = Ne(o), i = o.separators.find(
730
735
  (d) => d.element === t
731
736
  );
732
- x(i, "Matching separator not found");
733
- const s = u.get(i);
734
- x(s, "Matching panels not found");
735
- const l = s[0], c = r.find(
736
- (d) => d.panelId === l.id
737
+ z(i, "Matching separator not found");
738
+ const r = l.get(i);
739
+ z(r, "Matching panels not found");
740
+ const u = r[0], c = s.find(
741
+ (d) => d.panelId === u.id
737
742
  );
738
- if (x(c, "Panel metadata not found"), c.collapsible) {
739
- const d = a[l.id], z = c.collapsedSize === d ? o.inMemoryLastExpandedPanelSizes[l.id] ?? c.minSize : c.collapsedSize;
740
- _(t, z - d);
743
+ if (z(c, "Panel metadata not found"), c.collapsible) {
744
+ const d = a[u.id], x = c.collapsedSize === d ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
745
+ T(t, x - d);
741
746
  }
742
747
  break;
743
748
  }
744
749
  case "F6": {
745
750
  e.preventDefault();
746
- const r = te(t).separators.map(
747
- (s) => s.element
748
- ), a = Array.from(r).findIndex(
749
- (s) => s === e.currentTarget
751
+ const s = oe(t).separators.map(
752
+ (r) => r.element
753
+ ), a = Array.from(s).findIndex(
754
+ (r) => r === e.currentTarget
750
755
  );
751
- x(a !== null, "Index not found");
752
- const u = e.shiftKey ? a > 0 ? a - 1 : r.length - 1 : a + 1 < r.length ? a + 1 : 0;
753
- r[u].focus();
756
+ z(a !== null, "Index not found");
757
+ const l = e.shiftKey ? a > 0 ? a - 1 : s.length - 1 : a + 1 < s.length ? a + 1 : 0;
758
+ s[l].focus();
754
759
  break;
755
760
  }
756
761
  case "Home": {
757
- e.preventDefault(), _(t, -100);
762
+ e.preventDefault(), T(t, -100);
758
763
  break;
759
764
  }
760
765
  }
761
766
  }
762
- function rt(e, t) {
767
+ function ut(e, t) {
763
768
  return {
764
769
  x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
765
770
  Math.abs(e.x - t.left),
@@ -771,156 +776,156 @@ function rt(e, t) {
771
776
  )
772
777
  };
773
778
  }
774
- function st(e, t, n) {
775
- let o, r = {
779
+ function ct(e, t, n) {
780
+ let o, s = {
776
781
  x: 1 / 0,
777
782
  y: 1 / 0
778
783
  };
779
784
  for (const a of t) {
780
- const u = rt(n, a.rect);
785
+ const l = ut(n, a.rect);
781
786
  switch (e) {
782
787
  case "horizontal": {
783
- u.x <= r.x && (o = a, r = u);
788
+ l.x <= s.x && (o = a, s = l);
784
789
  break;
785
790
  }
786
791
  case "vertical": {
787
- u.y <= r.y && (o = a, r = u);
792
+ l.y <= s.y && (o = a, s = l);
788
793
  break;
789
794
  }
790
795
  }
791
796
  }
792
797
  return o ? {
793
- distance: r,
798
+ distance: s,
794
799
  hitRegion: o
795
800
  } : void 0;
796
801
  }
797
- let ee;
798
- function at() {
799
- return ee === void 0 && (typeof matchMedia == "function" ? ee = !!matchMedia("(pointer:coarse)").matches : ee = !1), ee;
802
+ let ne;
803
+ function ft() {
804
+ return ne === void 0 && (typeof matchMedia == "function" ? ne = !!matchMedia("(pointer:coarse)").matches : ne = !1), ne;
800
805
  }
801
- function lt(e, t) {
806
+ function dt(e, t) {
802
807
  if (e === t) throw new Error("Cannot compare node with itself");
803
808
  const n = {
804
- a: Se(e),
805
- b: Se(t)
809
+ a: we(e),
810
+ b: we(t)
806
811
  };
807
812
  let o;
808
813
  for (; n.a.at(-1) === n.b.at(-1); )
809
814
  e = n.a.pop(), t = n.b.pop(), o = e;
810
- x(
815
+ z(
811
816
  o,
812
817
  "Stacking order can only be calculated for elements with a common ancestor"
813
818
  );
814
- const r = {
815
- a: ve(ye(n.a)),
816
- b: ve(ye(n.b))
819
+ const s = {
820
+ a: ze(xe(n.a)),
821
+ b: ze(xe(n.b))
817
822
  };
818
- if (r.a === r.b) {
819
- const a = o.childNodes, u = {
823
+ if (s.a === s.b) {
824
+ const a = o.childNodes, l = {
820
825
  a: n.a.at(-1),
821
826
  b: n.b.at(-1)
822
827
  };
823
828
  let i = a.length;
824
829
  for (; i--; ) {
825
- const s = a[i];
826
- if (s === u.a) return 1;
827
- if (s === u.b) return -1;
830
+ const r = a[i];
831
+ if (r === l.a) return 1;
832
+ if (r === l.b) return -1;
828
833
  }
829
834
  }
830
- return Math.sign(r.a - r.b);
835
+ return Math.sign(s.a - s.b);
831
836
  }
832
- const ut = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
833
- function ct(e) {
834
- const t = getComputedStyle(_e(e) ?? e).display;
837
+ const pt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
838
+ function mt(e) {
839
+ const t = getComputedStyle($e(e) ?? e).display;
835
840
  return t === "flex" || t === "inline-flex";
836
841
  }
837
- function ft(e) {
842
+ function ht(e) {
838
843
  const t = getComputedStyle(e);
839
- return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || ct(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" || ut.test(t.willChange) || t.webkitOverflowScrolling === "touch");
844
+ return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || mt(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" || pt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
840
845
  }
841
- function ye(e) {
846
+ function xe(e) {
842
847
  let t = e.length;
843
848
  for (; t--; ) {
844
849
  const n = e[t];
845
- if (x(n, "Missing node"), ft(n)) return n;
850
+ if (z(n, "Missing node"), ht(n)) return n;
846
851
  }
847
852
  return null;
848
853
  }
849
- function ve(e) {
854
+ function ze(e) {
850
855
  return e && Number(getComputedStyle(e).zIndex) || 0;
851
856
  }
852
- function Se(e) {
857
+ function we(e) {
853
858
  const t = [];
854
859
  for (; e; )
855
- t.push(e), e = _e(e);
860
+ t.push(e), e = $e(e);
856
861
  return t;
857
862
  }
858
- function _e(e) {
863
+ function $e(e) {
859
864
  const { parentNode: t } = e;
860
865
  return t && t instanceof ShadowRoot ? t.host : t;
861
866
  }
862
- function dt(e, t) {
867
+ function yt(e, t) {
863
868
  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;
864
869
  }
865
- function pt({
870
+ function gt({
866
871
  groupElement: e,
867
872
  hitRegion: t,
868
873
  pointerEventTarget: n
869
874
  }) {
870
875
  if (!(n instanceof HTMLElement) || n.contains(e) || e.contains(n))
871
876
  return !0;
872
- if (lt(n, e) > 0) {
877
+ if (dt(n, e) > 0) {
873
878
  let o = n;
874
879
  for (; o; ) {
875
880
  if (o.contains(e))
876
881
  return !0;
877
- if (dt(o.getBoundingClientRect(), t))
882
+ if (yt(o.getBoundingClientRect(), t))
878
883
  return !1;
879
884
  o = o.parentElement;
880
885
  }
881
886
  }
882
887
  return !0;
883
888
  }
884
- function De(e, t) {
889
+ function Fe(e, t) {
885
890
  const n = [];
886
- return t.forEach((o, r) => {
887
- if (r.disabled)
891
+ return t.forEach((o, s) => {
892
+ if (s.disabled)
888
893
  return;
889
- const a = at() ? me.coarse : me.precise, u = Re(r), i = st(r.orientation, u, {
894
+ const a = ft() ? ge.coarse : ge.precise, l = Ie(s), i = ct(s.orientation, l, {
890
895
  x: e.clientX,
891
896
  y: e.clientY
892
897
  });
893
- i && i.distance.x <= a && i.distance.y <= a && pt({
894
- groupElement: r.element,
898
+ i && i.distance.x <= a && i.distance.y <= a && gt({
899
+ groupElement: s.element,
895
900
  hitRegion: i.hitRegion.rect,
896
901
  pointerEventTarget: e.target
897
902
  }) && n.push(i.hitRegion);
898
903
  }), n;
899
904
  }
900
- function xe(e) {
905
+ function be(e) {
901
906
  if (e.defaultPrevented)
902
907
  return;
903
- const { mountedGroups: t } = O(), n = De(e, t), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map();
908
+ const { mountedGroups: t } = D(), n = Fe(e, t), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
904
909
  let i = !1;
905
- n.forEach((s) => {
906
- o.add(s.group), s.panels.forEach((c) => {
907
- r.add(c);
908
- }), s.separator && (a.add(s.separator), i || (i = !0, s.separator.element.focus()));
909
- const l = t.get(s.group);
910
- l && u.set(s.group, l.layout);
910
+ n.forEach((r) => {
911
+ o.add(r.group), r.panels.forEach((c) => {
912
+ s.add(c);
913
+ }), r.separator && (a.add(r.separator), i || (i = !0, r.separator.element.focus()));
914
+ const u = t.get(r.group);
915
+ u && l.set(r.group, u.layout);
911
916
  }), E({
912
917
  interactionState: {
913
918
  hitRegions: n,
914
- initialLayoutMap: u,
919
+ initialLayoutMap: l,
915
920
  pointerDownAtPoint: { x: e.clientX, y: e.clientY },
916
921
  state: "active"
917
922
  }
918
923
  }), n.length && e.preventDefault();
919
924
  }
920
- function ze(e) {
925
+ function Le(e) {
921
926
  if (e.defaultPrevented)
922
927
  return;
923
- const { interactionState: t, mountedGroups: n } = O();
928
+ const { interactionState: t, mountedGroups: n } = D();
924
929
  switch (t.state) {
925
930
  case "active": {
926
931
  if (
@@ -937,7 +942,7 @@ function ze(e) {
937
942
  );
938
943
  return;
939
944
  }
940
- ke({
945
+ _e({
941
946
  event: e,
942
947
  hitRegions: t.hitRegions,
943
948
  initialLayoutMap: t.initialLayoutMap,
@@ -947,7 +952,7 @@ function ze(e) {
947
952
  break;
948
953
  }
949
954
  default: {
950
- const o = De(e, n);
955
+ const o = Fe(e, n);
951
956
  o.length === 0 ? t.state !== "inactive" && E({
952
957
  interactionState: { state: "inactive" }
953
958
  }) : E({
@@ -960,11 +965,11 @@ function ze(e) {
960
965
  }
961
966
  }
962
967
  }
963
- function be(e) {
968
+ function Pe(e) {
964
969
  if (e.defaultPrevented)
965
970
  return;
966
971
  e.preventDefault();
967
- const { interactionState: t } = O();
972
+ const { interactionState: t } = D();
968
973
  switch (t.state) {
969
974
  case "active":
970
975
  E({
@@ -975,125 +980,126 @@ function be(e) {
975
980
  }), le();
976
981
  }
977
982
  }
978
- function we(e) {
983
+ function Ce(e) {
979
984
  let t = 0, n = 0;
980
985
  const o = {};
981
986
  for (const a of e)
982
987
  if (a.defaultSize !== void 0) {
983
988
  t++;
984
- const u = G(a.defaultSize);
985
- n += u, o[a.panelId] = u;
989
+ const l = I(a.defaultSize);
990
+ n += l, o[a.panelId] = l;
986
991
  } else
987
992
  o[a.panelId] = void 0;
988
- const r = e.length - t;
989
- if (r !== 0) {
990
- const a = G((100 - n) / r);
991
- for (const u of e)
992
- u.defaultSize === void 0 && (o[u.panelId] = a);
993
+ const s = e.length - t;
994
+ if (s !== 0) {
995
+ const a = I((100 - n) / s);
996
+ for (const l of e)
997
+ l.defaultSize === void 0 && (o[l.panelId] = a);
993
998
  }
994
999
  return o;
995
1000
  }
996
- function mt(e, t, n) {
1001
+ function vt(e, t, n) {
997
1002
  const o = n[0];
998
1003
  if (!o)
999
1004
  return;
1000
- const r = e.panels.find((u) => u.element === t);
1001
- if (!r || !r.onResize)
1005
+ const s = e.panels.find((l) => l.element === t);
1006
+ if (!s || !s.onResize)
1002
1007
  return;
1003
- const a = H({ group: e });
1004
- r.onResize(
1008
+ const a = B({ group: e });
1009
+ s.onResize(
1005
1010
  {
1006
- asPercentage: G(
1011
+ asPercentage: I(
1007
1012
  o.inlineSize / a * 100
1008
1013
  ),
1009
1014
  inPixels: o.inlineSize
1010
1015
  },
1011
- r.id
1016
+ s.id
1012
1017
  );
1013
1018
  }
1014
- function ht(e) {
1019
+ function St(e) {
1015
1020
  let t = !0;
1016
- x(
1021
+ z(
1017
1022
  e.separators.length === 0 || e.separators.length < e.panels.length,
1018
1023
  "Invalid Group configuration; too many Separator components"
1019
1024
  );
1020
- const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), r = new ResizeObserver((m) => {
1025
+ const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = new ResizeObserver((m) => {
1021
1026
  for (const f of m) {
1022
1027
  const { borderBoxSize: p, target: h } = f;
1023
1028
  if (h === e.element) {
1024
1029
  if (t) {
1025
- if (H({ group: e }) === 0)
1030
+ if (B({ group: e }) === 0)
1026
1031
  return;
1027
- E((S) => {
1028
- const v = S.mountedGroups.get(e);
1029
- if (v) {
1030
- const g = pe(e), w = v.defaultLayoutDeferred ? we(g) : v.layout, L = A({
1031
- layout: w,
1032
- panelConstraints: g
1032
+ E((g) => {
1033
+ const S = g.mountedGroups.get(e);
1034
+ if (S) {
1035
+ const y = ye(e), b = S.defaultLayoutDeferred ? Ce(y) : S.layout, L = A({
1036
+ layout: b,
1037
+ panelConstraints: y
1033
1038
  });
1034
- return !v.defaultLayoutDeferred && W(w, L) ? S : {
1035
- mountedGroups: new Map(S.mountedGroups).set(e, {
1036
- derivedPanelConstraints: g,
1039
+ return !S.defaultLayoutDeferred && U(b, L) ? g : {
1040
+ mountedGroups: new Map(g.mountedGroups).set(e, {
1041
+ defaultLayoutDeferred: !1,
1042
+ derivedPanelConstraints: y,
1037
1043
  layout: L,
1038
- separatorToPanels: v.separatorToPanels
1044
+ separatorToPanels: S.separatorToPanels
1039
1045
  })
1040
1046
  };
1041
1047
  }
1042
- return S;
1048
+ return g;
1043
1049
  });
1044
1050
  }
1045
1051
  } else
1046
- mt(e, h, p);
1052
+ vt(e, h, p);
1047
1053
  }
1048
1054
  });
1049
- r.observe(e.element), e.panels.forEach((m) => {
1050
- x(
1055
+ s.observe(e.element), e.panels.forEach((m) => {
1056
+ z(
1051
1057
  !n.has(m.id),
1052
1058
  `Panel ids must be unique; id "${m.id}" was used more than once`
1053
- ), n.add(m.id), m.onResize && r.observe(m.element);
1059
+ ), n.add(m.id), m.onResize && s.observe(m.element);
1054
1060
  });
1055
- const a = H({ group: e }), u = pe(e), i = e.panels.map(({ id: m }) => m).join(",");
1056
- let s = e.defaultLayout;
1057
- s && e.panels.length !== Object.keys(s).length && (s = void 0);
1058
- const l = e.inMemoryLayouts[i] ?? s ?? we(u), c = A({
1059
- layout: l,
1060
- panelConstraints: u
1061
- }), d = Re(e), z = E((m) => ({
1061
+ const a = B({ group: e }), l = ye(e), i = e.panels.map(({ id: m }) => m).join(",");
1062
+ let r = e.defaultLayout;
1063
+ r && e.panels.length !== Object.keys(r).length && (r = void 0);
1064
+ const u = e.inMemoryLayouts[i] ?? r ?? Ce(l), c = A({
1065
+ layout: u,
1066
+ panelConstraints: l
1067
+ }), d = Ie(e), x = E((m) => ({
1062
1068
  mountedGroups: new Map(m.mountedGroups).set(e, {
1063
1069
  defaultLayoutDeferred: a === 0,
1064
- derivedPanelConstraints: u,
1070
+ derivedPanelConstraints: l,
1065
1071
  layout: c,
1066
1072
  separatorToPanels: new Map(
1067
1073
  d.filter((f) => f.separator).map((f) => [f.separator, f.panels])
1068
1074
  )
1069
1075
  })
1070
1076
  }));
1071
- return e.element.addEventListener("pointerleave", he), e.separators.forEach((m) => {
1072
- x(
1077
+ return e.element.addEventListener("pointerleave", ve), e.separators.forEach((m) => {
1078
+ z(
1073
1079
  !o.has(m.id),
1074
1080
  `Separator ids must be unique; id "${m.id}" was used more than once`
1075
- ), o.add(m.id), m.element.addEventListener("keydown", ge);
1076
- }), z.mountedGroups.size === 1 && (window.addEventListener("pointerdown", xe), window.addEventListener("pointermove", ze), window.addEventListener("pointerup", be)), function() {
1081
+ ), o.add(m.id), m.element.addEventListener("keydown", Se);
1082
+ }), x.mountedGroups.size === 1 && (window.addEventListener("pointerdown", be), window.addEventListener("pointermove", Le), window.addEventListener("pointerup", Pe)), function() {
1077
1083
  t = !1;
1078
1084
  const f = E((p) => {
1079
1085
  const h = new Map(p.mountedGroups);
1080
1086
  return h.delete(e), { mountedGroups: h };
1081
1087
  });
1082
- e.element.removeEventListener("pointerleave", he), e.separators.forEach((p) => {
1083
- p.element.removeEventListener("keydown", ge);
1084
- }), f.mountedGroups.size === 0 && (window.removeEventListener("pointerdown", xe), window.removeEventListener("pointermove", ze), window.removeEventListener("pointerup", be)), r.disconnect();
1088
+ e.element.removeEventListener("pointerleave", ve), e.separators.forEach((p) => {
1089
+ p.element.removeEventListener("keydown", Se);
1090
+ }), f.mountedGroups.size === 0 && (window.removeEventListener("pointerdown", be), window.removeEventListener("pointermove", Le), window.removeEventListener("pointerup", Pe)), s.disconnect();
1085
1091
  };
1086
1092
  }
1087
1093
  function ue(e) {
1088
- const t = We();
1094
+ const t = Ke();
1089
1095
  return `${e ?? t}`;
1090
1096
  }
1091
- const j = typeof window < "u" ? je : Be;
1097
+ const N = typeof window < "u" ? Xe : Re;
1092
1098
  function ce(e) {
1093
- const t = T(e);
1094
- return j(() => {
1099
+ const t = O(e);
1100
+ return N(() => {
1095
1101
  t.current = e;
1096
- }, [e]), Le((n) => t.current?.(n), [t]);
1102
+ }, [e]), Ee((n) => t.current?.(n), [t]);
1097
1103
  }
1098
1104
  function fe(...e) {
1099
1105
  return ce((t) => {
@@ -1112,83 +1118,101 @@ function fe(...e) {
1112
1118
  });
1113
1119
  });
1114
1120
  }
1115
- const Ae = "--react-resizable-panels--panel--pointer-events";
1116
- function Ne(e, t) {
1121
+ function xt(e) {
1122
+ const t = O({ ...e });
1123
+ return N(() => {
1124
+ for (const n in e)
1125
+ t.current[n] = e[n];
1126
+ }, [e]), t.current;
1127
+ }
1128
+ const He = "--react-resizable-panels--panel--pointer-events";
1129
+ function We(e, t) {
1117
1130
  const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
1118
1131
  return `--react-resizable-panels--${n}--${o}`;
1119
1132
  }
1120
- const $e = Ue(null);
1121
- function gt(e, t) {
1122
- const n = T({
1133
+ const je = Ye(null);
1134
+ function zt(e, t) {
1135
+ const n = O({
1123
1136
  getLayout: () => ({}),
1124
- setLayout: nt
1137
+ setLayout: st
1125
1138
  });
1126
- Pe(t, () => n.current, []), j(() => {
1139
+ Me(t, () => n.current, []), N(() => {
1127
1140
  Object.assign(
1128
1141
  n.current,
1129
- Oe({ groupId: e })
1142
+ Ae({ groupId: e })
1130
1143
  );
1131
1144
  });
1132
1145
  }
1133
- function Pt({
1146
+ function Gt({
1134
1147
  children: e,
1135
1148
  className: t,
1136
1149
  defaultLayout: n,
1137
1150
  disableCursor: o,
1138
- disabled: r,
1151
+ disabled: s,
1139
1152
  elementRef: a,
1140
- groupRef: u,
1153
+ groupRef: l,
1141
1154
  id: i,
1142
- onLayoutChange: s,
1143
- orientation: l = "horizontal",
1155
+ onLayoutChange: r,
1156
+ orientation: u = "horizontal",
1144
1157
  style: c,
1145
1158
  ...d
1146
1159
  }) {
1147
- const z = T({}), m = ce((b) => {
1148
- W(z.current, b) || (z.current = b, s?.(b));
1149
- }), f = ue(i), [p, h] = I(!1), [y, S] = I(null), [v, g] = I(n ?? {}), [w, L] = I([]), [C, K] = I([]), ne = T({}), X = T({}), Y = fe(S, a);
1150
- gt(f, u);
1151
- const q = Ce(
1160
+ const x = O({}), m = ce((w) => {
1161
+ U(x.current, w) || (x.current = w, r?.(w));
1162
+ }), f = ue(i), [p, h] = G(!1), [v, g] = G(null), [S, y] = G(n ?? {}), [b, L] = G([]), [C, q] = G([]), Z = O({
1163
+ lastExpandedPanelSizes: {},
1164
+ layouts: {}
1165
+ }), J = fe(g, a);
1166
+ zt(f, l);
1167
+ const Q = Ge(
1152
1168
  () => ({
1153
1169
  id: f,
1154
- orientation: l,
1155
- registerPanel: (b) => (L((M) => se(l, [...M, b])), () => {
1156
- L((M) => M.filter((N) => N !== b));
1170
+ orientation: u,
1171
+ registerPanel: (w) => (L((M) => se(u, [...M, w])), () => {
1172
+ L((M) => M.filter((F) => F !== w));
1157
1173
  }),
1158
- registerSeparator: (b) => (K(
1159
- (M) => se(l, [...M, b])
1174
+ registerSeparator: (w) => (q(
1175
+ (M) => se(u, [...M, w])
1160
1176
  ), () => {
1161
- K(
1162
- (M) => M.filter((N) => N !== b)
1177
+ q(
1178
+ (M) => M.filter((F) => F !== w)
1163
1179
  );
1164
1180
  })
1165
1181
  }),
1166
- [f, l]
1167
- );
1168
- j(() => {
1169
- if (y === null || w.length === 0)
1182
+ [f, u]
1183
+ ), $ = xt({
1184
+ defaultLayout: n,
1185
+ disableCursor: o
1186
+ }), V = O(null);
1187
+ N(() => {
1188
+ if (v === null)
1170
1189
  return;
1171
- const b = {
1172
- defaultLayout: n,
1173
- disableCursor: !!o,
1174
- disabled: !!r,
1175
- element: y,
1190
+ const w = {
1191
+ defaultLayout: $.defaultLayout,
1192
+ disableCursor: !!$.disableCursor,
1193
+ disabled: !!s,
1194
+ element: v,
1176
1195
  id: f,
1177
- inMemoryLastExpandedPanelSizes: ne.current,
1178
- inMemoryLayouts: X.current,
1179
- orientation: l,
1180
- panels: w,
1196
+ inMemoryLastExpandedPanelSizes: Z.current.lastExpandedPanelSizes,
1197
+ inMemoryLayouts: Z.current.layouts,
1198
+ orientation: u,
1199
+ panels: b,
1181
1200
  separators: C
1182
- }, M = ht(b), oe = O().mountedGroups.get(b);
1183
- oe && (g(oe.layout), m?.(oe.layout));
1184
- const Fe = D.addListener(
1201
+ };
1202
+ V.current = w;
1203
+ const M = St(w), me = D().mountedGroups.get(w);
1204
+ if (me) {
1205
+ const { defaultLayoutDeferred: H, derivedPanelConstraints: W, layout: ee } = me;
1206
+ !H && W.length > 0 && (y(ee), m?.(ee));
1207
+ }
1208
+ const Be = _.addListener(
1185
1209
  "interactionStateChange",
1186
- (J) => {
1187
- switch (J.state) {
1210
+ (H) => {
1211
+ switch (H.state) {
1188
1212
  case "active": {
1189
1213
  h(
1190
- J.hitRegions.some(
1191
- ($) => $.group === b
1214
+ H.hitRegions.some(
1215
+ (W) => W.group === w
1192
1216
  )
1193
1217
  );
1194
1218
  break;
@@ -1199,49 +1223,56 @@ function Pt({
1199
1223
  }
1200
1224
  }
1201
1225
  }
1202
- ), He = D.addListener(
1226
+ ), Ue = _.addListener(
1203
1227
  "mountedGroupsChange",
1204
- (J) => {
1205
- const $ = J.get(b);
1206
- $ && $.derivedPanelConstraints.length > 0 && (g($.layout), m?.($.layout));
1228
+ (H) => {
1229
+ const W = H.get(w);
1230
+ if (W) {
1231
+ const { defaultLayoutDeferred: ee, derivedPanelConstraints: Ve, layout: he } = W;
1232
+ if (ee || Ve.length === 0)
1233
+ return;
1234
+ y(he), m?.(he);
1235
+ }
1207
1236
  }
1208
1237
  );
1209
1238
  return () => {
1210
- M(), Fe(), He();
1239
+ V.current = null, M(), Be(), Ue();
1211
1240
  };
1212
1241
  }, [
1213
- n,
1214
- o,
1215
- r,
1216
- y,
1242
+ s,
1243
+ v,
1217
1244
  f,
1218
1245
  m,
1219
- l,
1220
- w,
1221
- C
1222
- ]);
1223
- const Z = {
1224
- [Ae]: p ? "none" : void 0
1246
+ u,
1247
+ b,
1248
+ C,
1249
+ $
1250
+ ]), Re(() => {
1251
+ const w = V.current;
1252
+ w && (w.defaultLayout = n, w.disableCursor = !!o);
1253
+ });
1254
+ const pe = {
1255
+ [He]: p ? "none" : void 0
1225
1256
  };
1226
- for (const b in v) {
1227
- const M = Ne(f, b), N = v[b];
1228
- Z[M] = N;
1257
+ for (const w in S) {
1258
+ const M = We(f, w), F = S[w];
1259
+ pe[M] = F;
1229
1260
  }
1230
- return /* @__PURE__ */ B($e.Provider, { value: q, children: /* @__PURE__ */ B(
1261
+ return /* @__PURE__ */ K(je.Provider, { value: Q, children: /* @__PURE__ */ K(
1231
1262
  "div",
1232
1263
  {
1233
1264
  ...d,
1234
- "aria-orientation": l,
1265
+ "aria-orientation": u,
1235
1266
  className: t,
1236
1267
  "data-group": !0,
1237
1268
  "data-testid": f,
1238
1269
  id: f,
1239
- ref: Y,
1270
+ ref: J,
1240
1271
  style: {
1241
1272
  ...c,
1242
- ...Z,
1273
+ ...pe,
1243
1274
  display: "flex",
1244
- flexDirection: l === "horizontal" ? "row" : "column",
1275
+ flexDirection: u === "horizontal" ? "row" : "column",
1245
1276
  flexWrap: "nowrap"
1246
1277
  },
1247
1278
  children: e
@@ -1251,7 +1282,7 @@ function Pt({
1251
1282
  function ae(e) {
1252
1283
  return `react-resizable-panels:${e}`;
1253
1284
  }
1254
- function yt({
1285
+ function wt({
1255
1286
  id: e,
1256
1287
  layout: t,
1257
1288
  storage: n
@@ -1263,19 +1294,19 @@ function yt({
1263
1294
  console.error(o);
1264
1295
  }
1265
1296
  }
1266
- function Ct({
1297
+ function It({
1267
1298
  groupId: e,
1268
1299
  storage: t
1269
1300
  }) {
1270
- const n = Ve(
1271
- vt,
1301
+ const n = qe(
1302
+ bt,
1272
1303
  () => t.getItem(ae(e)),
1273
1304
  () => t.getItem(ae(e))
1274
- ), o = Ce(
1305
+ ), o = Ge(
1275
1306
  () => n ? JSON.parse(n) : void 0,
1276
1307
  [n]
1277
- ), r = Le(
1278
- (a) => yt({
1308
+ ), s = Ee(
1309
+ (a) => wt({
1279
1310
  id: e,
1280
1311
  layout: a,
1281
1312
  storage: t
@@ -1284,48 +1315,59 @@ function Ct({
1284
1315
  );
1285
1316
  return {
1286
1317
  defaultLayout: o,
1287
- onLayoutChange: r
1318
+ onLayoutChange: s
1288
1319
  };
1289
1320
  }
1290
- function vt() {
1321
+ function bt() {
1291
1322
  return function() {
1292
1323
  };
1293
1324
  }
1294
- function Rt() {
1295
- return I(null);
1325
+ function kt() {
1326
+ return G(null);
1296
1327
  }
1297
- function Et() {
1298
- return T(null);
1328
+ function Dt() {
1329
+ return O(null);
1299
1330
  }
1300
1331
  function de() {
1301
- const e = Ke($e);
1302
- return x(
1332
+ const e = Ze(je);
1333
+ return z(
1303
1334
  e,
1304
1335
  "Group Context not found; did you render a Panel or Separator outside of a Group?"
1305
1336
  ), e;
1306
1337
  }
1307
- function St({
1338
+ function Lt({
1308
1339
  groupId: e,
1309
1340
  panelId: t
1310
1341
  }) {
1311
1342
  const n = () => {
1312
- const { mountedGroups: i } = O();
1343
+ const { mountedGroups: i } = D();
1313
1344
  for (const [
1314
- s,
1315
- { derivedPanelConstraints: l, layout: c, separatorToPanels: d }
1345
+ r,
1346
+ {
1347
+ defaultLayoutDeferred: u,
1348
+ derivedPanelConstraints: c,
1349
+ layout: d,
1350
+ separatorToPanels: x
1351
+ }
1316
1352
  ] of i)
1317
- if (s.id === e)
1318
- return { derivedPanelConstraints: l, group: s, layout: c, separatorToPanels: d };
1353
+ if (r.id === e)
1354
+ return {
1355
+ defaultLayoutDeferred: u,
1356
+ derivedPanelConstraints: c,
1357
+ group: r,
1358
+ layout: d,
1359
+ separatorToPanels: x
1360
+ };
1319
1361
  throw Error(`Group ${e} not found`);
1320
1362
  }, o = () => {
1321
1363
  const i = n().derivedPanelConstraints.find(
1322
- (s) => s.panelId === t
1364
+ (r) => r.panelId === t
1323
1365
  );
1324
1366
  if (i !== void 0)
1325
1367
  return i;
1326
1368
  throw Error(`Panel constraints not found for Panel ${t}`);
1327
- }, r = () => {
1328
- const i = n().group.panels.find((s) => s.id === t);
1369
+ }, s = () => {
1370
+ const i = n().group.panels.find((r) => r.id === t);
1329
1371
  if (i !== void 0)
1330
1372
  return i;
1331
1373
  throw Error(`Layout not found for Panel ${t}`);
@@ -1334,75 +1376,77 @@ function St({
1334
1376
  if (i !== void 0)
1335
1377
  return i;
1336
1378
  throw Error(`Layout not found for Panel ${t}`);
1337
- }, u = (i) => {
1338
- const s = a();
1339
- if (i === s)
1379
+ }, l = (i) => {
1380
+ const r = a();
1381
+ if (i === r)
1340
1382
  return;
1341
1383
  const {
1342
- derivedPanelConstraints: l,
1343
- group: c,
1344
- layout: d,
1345
- separatorToPanels: z
1346
- } = n(), m = c.panels.findIndex((y) => y.id === t), f = m === c.panels.length - 1, p = V({
1347
- delta: f ? s - i : i - s,
1348
- initialLayout: d,
1349
- panelConstraints: l,
1350
- pivotIndices: f ? [m - 1, m] : [m, m + 1],
1351
- prevLayout: d,
1384
+ defaultLayoutDeferred: u,
1385
+ derivedPanelConstraints: c,
1386
+ group: d,
1387
+ layout: x,
1388
+ separatorToPanels: m
1389
+ } = n(), f = d.panels.findIndex((g) => g.id === t), p = f === d.panels.length - 1, h = Y({
1390
+ delta: p ? r - i : i - r,
1391
+ initialLayout: x,
1392
+ panelConstraints: c,
1393
+ pivotIndices: p ? [f - 1, f] : [f, f + 1],
1394
+ prevLayout: x,
1352
1395
  trigger: "imperative-api"
1353
- }), h = A({
1354
- layout: p,
1355
- panelConstraints: l
1396
+ }), v = A({
1397
+ layout: h,
1398
+ panelConstraints: c
1356
1399
  });
1357
- W(d, h) || E((y) => ({
1358
- mountedGroups: new Map(y.mountedGroups).set(c, {
1359
- derivedPanelConstraints: l,
1360
- layout: h,
1361
- separatorToPanels: z
1400
+ U(x, v) || E((g) => ({
1401
+ mountedGroups: new Map(g.mountedGroups).set(d, {
1402
+ defaultLayoutDeferred: u,
1403
+ derivedPanelConstraints: c,
1404
+ layout: v,
1405
+ separatorToPanels: m
1362
1406
  })
1363
1407
  }));
1364
1408
  };
1365
1409
  return {
1366
1410
  collapse: () => {
1367
- const { collapsible: i, collapsedSize: s } = o(), l = a();
1368
- i && l !== s && u(s);
1411
+ const { collapsible: i, collapsedSize: r } = o(), u = a();
1412
+ i && u !== r && l(r);
1369
1413
  },
1370
1414
  expand: () => {
1371
- const { collapsible: i, collapsedSize: s, minSize: l } = o(), c = a();
1372
- i && c === s && u(l);
1415
+ const { collapsible: i, collapsedSize: r, minSize: u } = o(), c = a();
1416
+ i && c === r && l(u);
1373
1417
  },
1374
1418
  getSize: () => {
1375
- const { group: i } = n(), s = a(), { element: l } = r(), c = i.orientation === "horizontal" ? l.offsetWidth : l.offsetHeight;
1419
+ const { group: i } = n(), r = a(), { element: u } = s(), c = i.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
1376
1420
  return {
1377
- asPercentage: s,
1421
+ asPercentage: r,
1378
1422
  inPixels: c
1379
1423
  };
1380
1424
  },
1381
1425
  isCollapsed: () => {
1382
- const { collapsible: i, collapsedSize: s } = o(), l = a();
1383
- return i && P(s, l);
1426
+ const { collapsible: i, collapsedSize: r } = o(), u = a();
1427
+ return i && P(r, u);
1384
1428
  },
1385
1429
  resize: (i) => {
1386
1430
  if (a() !== i) {
1387
- let l;
1431
+ let u;
1388
1432
  switch (typeof i) {
1389
1433
  case "number": {
1390
- const { group: c } = n(), d = H({ group: c });
1391
- l = G(i / d * 100);
1434
+ const { group: c } = n(), d = B({ group: c });
1435
+ u = I(i / d * 100);
1392
1436
  break;
1393
1437
  }
1394
1438
  case "string": {
1395
- l = parseFloat(i);
1439
+ u = parseFloat(i);
1396
1440
  break;
1397
1441
  }
1398
1442
  }
1399
- u(l);
1443
+ l(u);
1400
1444
  }
1401
1445
  }
1402
1446
  };
1403
1447
  }
1404
- function xt(e, t) {
1405
- const { id: n } = de(), o = T({
1448
+ function Pt(e, t) {
1449
+ const { id: n } = de(), o = O({
1406
1450
  collapse: ie,
1407
1451
  expand: ie,
1408
1452
  getSize: () => ({
@@ -1412,70 +1456,70 @@ function xt(e, t) {
1412
1456
  isCollapsed: () => !1,
1413
1457
  resize: ie
1414
1458
  });
1415
- Pe(t, () => o.current, []), j(() => {
1459
+ Me(t, () => o.current, []), N(() => {
1416
1460
  Object.assign(
1417
1461
  o.current,
1418
- St({ groupId: n, panelId: e })
1462
+ Lt({ groupId: n, panelId: e })
1419
1463
  );
1420
1464
  });
1421
1465
  }
1422
- function Mt({
1466
+ function Ot({
1423
1467
  children: e,
1424
1468
  className: t,
1425
1469
  collapsedSize: n = "0%",
1426
1470
  collapsible: o = !1,
1427
- defaultSize: r,
1471
+ defaultSize: s,
1428
1472
  elementRef: a,
1429
- id: u,
1473
+ id: l,
1430
1474
  maxSize: i = "100%",
1431
- minSize: s = "0%",
1432
- onResize: l,
1475
+ minSize: r = "0%",
1476
+ onResize: u,
1433
1477
  panelRef: c,
1434
1478
  style: d,
1435
- ...z
1479
+ ...x
1436
1480
  }) {
1437
- const m = !!u, f = ue(u), [p, h] = I(null), y = fe(h, a), { id: S, registerPanel: v } = de(), g = l !== null, w = ce((C) => {
1438
- l?.(C, u);
1481
+ const m = !!l, f = ue(l), [p, h] = G(null), v = fe(h, a), { id: g, registerPanel: S } = de(), y = u !== null, b = ce((C) => {
1482
+ u?.(C, l);
1439
1483
  });
1440
- j(() => {
1484
+ N(() => {
1441
1485
  if (p !== null)
1442
- return v({
1486
+ return S({
1443
1487
  element: p,
1444
1488
  id: f,
1445
1489
  idIsStable: m,
1446
- onResize: g ? w : void 0,
1490
+ onResize: y ? b : void 0,
1447
1491
  panelConstraints: {
1448
1492
  collapsedSize: n,
1449
1493
  collapsible: o,
1450
- defaultSize: r,
1494
+ defaultSize: s,
1451
1495
  maxSize: i,
1452
- minSize: s
1496
+ minSize: r
1453
1497
  }
1454
1498
  });
1455
1499
  }, [
1456
1500
  n,
1457
1501
  o,
1458
- r,
1502
+ s,
1459
1503
  p,
1460
- g,
1504
+ y,
1461
1505
  f,
1462
1506
  m,
1463
1507
  i,
1464
- s,
1465
- w,
1466
- v
1467
- ]), xt(f, c);
1468
- const L = Ne(S, f);
1469
- return /* @__PURE__ */ B(
1508
+ r,
1509
+ b,
1510
+ S
1511
+ ]), Pt(f, c);
1512
+ const L = We(g, f);
1513
+ return /* @__PURE__ */ K(
1470
1514
  "div",
1471
1515
  {
1472
- ...z,
1516
+ ...x,
1473
1517
  "data-panel": !0,
1474
1518
  "data-testid": f,
1475
1519
  id: f,
1476
- ref: y,
1520
+ ref: v,
1477
1521
  style: {
1478
- ...zt,
1522
+ ...Ct,
1479
1523
  flexBasis: 0,
1480
1524
  flexGrow: `var(${L}, 1)`,
1481
1525
  flexShrink: 1,
@@ -1483,9 +1527,9 @@ function Mt({
1483
1527
  overflow: "hidden",
1484
1528
  // Disable pointer events inside of a panel during resize
1485
1529
  // This avoid edge cases like nested iframes
1486
- pointerEvents: `var(${Ae})`
1530
+ pointerEvents: `var(${He})`
1487
1531
  },
1488
- children: /* @__PURE__ */ B(
1532
+ children: /* @__PURE__ */ K(
1489
1533
  "div",
1490
1534
  {
1491
1535
  className: t,
@@ -1500,7 +1544,7 @@ function Mt({
1500
1544
  }
1501
1545
  );
1502
1546
  }
1503
- const zt = {
1547
+ const Ct = {
1504
1548
  minHeight: "unset",
1505
1549
  maxHeight: "unset",
1506
1550
  height: "unset",
@@ -1516,27 +1560,27 @@ const zt = {
1516
1560
  padding: "unset",
1517
1561
  margin: "unset"
1518
1562
  };
1519
- function It() {
1520
- return I(null);
1563
+ function Tt() {
1564
+ return G(null);
1521
1565
  }
1522
- function Gt() {
1523
- return T(null);
1566
+ function _t() {
1567
+ return O(null);
1524
1568
  }
1525
- function bt({
1569
+ function Rt({
1526
1570
  layout: e,
1527
1571
  panelConstraints: t,
1528
1572
  panelId: n,
1529
1573
  panelIndex: o
1530
1574
  }) {
1531
- let r, a;
1532
- const u = e[n], i = t.find(
1533
- (s) => s.panelId === n
1575
+ let s, a;
1576
+ const l = e[n], i = t.find(
1577
+ (r) => r.panelId === n
1534
1578
  );
1535
1579
  if (i) {
1536
- const s = i.maxSize, l = a = i.collapsible ? i.collapsedSize : i.minSize, c = [o, o + 1];
1580
+ const r = i.maxSize, u = a = i.collapsible ? i.collapsedSize : i.minSize, c = [o, o + 1];
1537
1581
  a = A({
1538
- layout: V({
1539
- delta: l - u,
1582
+ layout: Y({
1583
+ delta: u - l,
1540
1584
  initialLayout: e,
1541
1585
  panelConstraints: t,
1542
1586
  pivotIndices: c,
@@ -1544,9 +1588,9 @@ function bt({
1544
1588
  trigger: "keyboard"
1545
1589
  }),
1546
1590
  panelConstraints: t
1547
- })[n], r = A({
1548
- layout: V({
1549
- delta: s - u,
1591
+ })[n], s = A({
1592
+ layout: Y({
1593
+ delta: r - l,
1550
1594
  initialLayout: e,
1551
1595
  panelConstraints: t,
1552
1596
  pivotIndices: c,
@@ -1558,53 +1602,53 @@ function bt({
1558
1602
  }
1559
1603
  return {
1560
1604
  valueControls: n,
1561
- valueMax: r,
1605
+ valueMax: s,
1562
1606
  valueMin: a,
1563
- valueNow: u
1607
+ valueNow: l
1564
1608
  };
1565
1609
  }
1566
- function kt({
1610
+ function At({
1567
1611
  children: e,
1568
1612
  className: t,
1569
1613
  elementRef: n,
1570
1614
  id: o,
1571
- style: r,
1615
+ style: s,
1572
1616
  ...a
1573
1617
  }) {
1574
- const u = ue(o), [i, s] = I({}), [l, c] = I("inactive"), [d, z] = I(null), m = fe(z, n), {
1618
+ const l = ue(o), [i, r] = G({}), [u, c] = G("inactive"), [d, x] = G(null), m = fe(x, n), {
1575
1619
  id: f,
1576
1620
  orientation: p,
1577
1621
  registerSeparator: h
1578
- } = de(), y = p === "horizontal" ? "vertical" : "horizontal";
1579
- return j(() => {
1622
+ } = de(), v = p === "horizontal" ? "vertical" : "horizontal";
1623
+ return N(() => {
1580
1624
  if (d !== null) {
1581
- const S = {
1625
+ const g = {
1582
1626
  element: d,
1583
- id: u
1584
- }, v = h(S), g = D.addListener(
1627
+ id: l
1628
+ }, S = h(g), y = _.addListener(
1585
1629
  "interactionStateChange",
1586
1630
  (L) => {
1587
1631
  c(
1588
1632
  L.state !== "inactive" && L.hitRegions.some(
1589
- (C) => C.separator === S
1633
+ (C) => C.separator === g
1590
1634
  ) ? L.state : "inactive"
1591
1635
  );
1592
1636
  }
1593
- ), w = D.addListener(
1637
+ ), b = _.addListener(
1594
1638
  "mountedGroupsChange",
1595
1639
  (L) => {
1596
1640
  L.forEach(
1597
- ({ derivedPanelConstraints: C, layout: K, separatorToPanels: ne }, X) => {
1598
- if (X.id === f) {
1599
- const Y = ne.get(S);
1600
- if (Y) {
1601
- const q = Y[0], Z = X.panels.indexOf(q);
1602
- s(
1603
- bt({
1604
- layout: K,
1641
+ ({ derivedPanelConstraints: C, layout: q, separatorToPanels: Z }, J) => {
1642
+ if (J.id === f) {
1643
+ const Q = Z.get(g);
1644
+ if (Q) {
1645
+ const $ = Q[0], V = J.panels.indexOf($);
1646
+ r(
1647
+ Rt({
1648
+ layout: q,
1605
1649
  panelConstraints: C,
1606
- panelId: q.id,
1607
- panelIndex: Z
1650
+ panelId: $.id,
1651
+ panelIndex: V
1608
1652
  })
1609
1653
  );
1610
1654
  }
@@ -1614,28 +1658,28 @@ function kt({
1614
1658
  }
1615
1659
  );
1616
1660
  return () => {
1617
- g(), w(), v();
1661
+ y(), b(), S();
1618
1662
  };
1619
1663
  }
1620
- }, [d, f, u, h]), /* @__PURE__ */ B(
1664
+ }, [d, f, l, h]), /* @__PURE__ */ K(
1621
1665
  "div",
1622
1666
  {
1623
1667
  ...a,
1624
1668
  "aria-controls": i.valueControls,
1625
- "aria-orientation": y,
1669
+ "aria-orientation": v,
1626
1670
  "aria-valuemax": i.valueMax,
1627
1671
  "aria-valuemin": i.valueMin,
1628
1672
  "aria-valuenow": i.valueNow,
1629
1673
  children: e,
1630
1674
  className: t,
1631
- "data-separator": l,
1632
- "data-testid": u,
1633
- id: u,
1675
+ "data-separator": u,
1676
+ "data-testid": l,
1677
+ id: l,
1634
1678
  ref: m,
1635
1679
  role: "separator",
1636
1680
  style: {
1637
1681
  flexBasis: "auto",
1638
- ...r,
1682
+ ...s,
1639
1683
  flexGrow: 0,
1640
1684
  flexShrink: 0
1641
1685
  },
@@ -1644,13 +1688,13 @@ function kt({
1644
1688
  );
1645
1689
  }
1646
1690
  export {
1647
- Pt as Group,
1648
- Mt as Panel,
1649
- kt as Separator,
1650
- Ct as useDefaultLayout,
1651
- Rt as useGroupCallbackRef,
1652
- Et as useGroupRef,
1653
- It as usePanelCallbackRef,
1654
- Gt as usePanelRef
1691
+ Gt as Group,
1692
+ Ot as Panel,
1693
+ At as Separator,
1694
+ It as useDefaultLayout,
1695
+ kt as useGroupCallbackRef,
1696
+ Dt as useGroupRef,
1697
+ Tt as usePanelCallbackRef,
1698
+ _t as usePanelRef
1655
1699
  };
1656
1700
  //# sourceMappingURL=react-resizable-panels.js.map