@window-splitter/vue 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,27 +1,27 @@
1
- import { defineComponent as ze, useId as be, inject as G, computed as N, onMounted as W, watchEffect as se, onUnmounted as De, createElementBlock as ye, openBlock as Ie, normalizeProps as Te, guardReactiveProps as Fe, renderSlot as Pe, createPropsRestProxy as ke, ref as de, provide as oe, onWatcherCleanup as je, mergeProps as Ee, unref as Ue } from "vue";
2
- var We = 20, Ge = 1, J = 1e6, Xe = 1e6, Ye = -7, Je = 21, Qe = !1, ne = "[big.js] ", F = ne + "Invalid ", ue = F + "decimal places", Ze = F + "rounding mode", Be = ne + "Division by zero", b = {}, B = void 0, _e = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
3
- function Ke() {
1
+ import { defineComponent as be, useId as Ie, inject as X, computed as $, onMounted as G, watchEffect as ue, onUnmounted as Be, createElementBlock as ye, openBlock as Pe, normalizeProps as Te, guardReactiveProps as je, renderSlot as Se, createPropsRestProxy as Ee, ref as me, provide as ie, onWatcherCleanup as We, mergeProps as Ke, unref as Ue } from "vue";
2
+ var Ge = 20, Xe = 1, J = 1e6, Ye = 1e6, Je = -7, Qe = 21, Ze = !1, ne = "[big.js] ", j = ne + "Invalid ", fe = j + "decimal places", _e = j + "rounding mode", Ne = ne + "Division by zero", I = {}, N = void 0, et = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
3
+ function Oe() {
4
4
  function e(t) {
5
5
  var a = this;
6
- if (!(a instanceof e)) return t === B ? Ke() : new e(t);
6
+ if (!(a instanceof e)) return t === N ? Oe() : new e(t);
7
7
  if (t instanceof e)
8
8
  a.s = t.s, a.e = t.e, a.c = t.c.slice();
9
9
  else {
10
10
  if (typeof t != "string") {
11
11
  if (e.strict === !0 && typeof t != "bigint")
12
- throw TypeError(F + "value");
12
+ throw TypeError(j + "value");
13
13
  t = t === 0 && 1 / t < 0 ? "-0" : String(t);
14
14
  }
15
- et(a, t);
15
+ tt(a, t);
16
16
  }
17
17
  a.constructor = e;
18
18
  }
19
- return e.prototype = b, e.DP = We, e.RM = Ge, e.NE = Ye, e.PE = Je, e.strict = Qe, e.roundDown = 0, e.roundHalfUp = 1, e.roundHalfEven = 2, e.roundUp = 3, e;
19
+ return e.prototype = I, e.DP = Ge, e.RM = Xe, e.NE = Je, e.PE = Qe, e.strict = Ze, e.roundDown = 0, e.roundHalfUp = 1, e.roundHalfEven = 2, e.roundUp = 3, e;
20
20
  }
21
- function et(e, t) {
21
+ function tt(e, t) {
22
22
  var a, r, l;
23
- if (!_e.test(t))
24
- throw Error(F + "number");
23
+ if (!et.test(t))
24
+ throw Error(j + "number");
25
25
  for (e.s = t.charAt(0) == "-" ? (t = t.slice(1), -1) : 1, (a = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (r = t.search(/e/i)) > 0 ? (a < 0 && (a = r), a += +t.slice(r + 1), t = t.substring(0, r)) : a < 0 && (a = t.length), l = t.length, r = 0; r < l && t.charAt(r) == "0"; ) ++r;
26
26
  if (r == l)
27
27
  e.c = [e.e = 0];
@@ -31,14 +31,14 @@ function et(e, t) {
31
31
  }
32
32
  return e;
33
33
  }
34
- function j(e, t, a, r) {
34
+ function W(e, t, a, r) {
35
35
  var l = e.c;
36
- if (a === B && (a = e.constructor.RM), a !== 0 && a !== 1 && a !== 2 && a !== 3)
37
- throw Error(Ze);
36
+ if (a === N && (a = e.constructor.RM), a !== 0 && a !== 1 && a !== 2 && a !== 3)
37
+ throw Error(_e);
38
38
  if (t < 1)
39
- r = a === 3 && (r || !!l[0]) || t === 0 && (a === 1 && l[0] >= 5 || a === 2 && (l[0] > 5 || l[0] === 5 && (r || l[1] !== B))), l.length = 1, r ? (e.e = e.e - t + 1, l[0] = 1) : l[0] = e.e = 0;
39
+ r = a === 3 && (r || !!l[0]) || t === 0 && (a === 1 && l[0] >= 5 || a === 2 && (l[0] > 5 || l[0] === 5 && (r || l[1] !== N))), l.length = 1, r ? (e.e = e.e - t + 1, l[0] = 1) : l[0] = e.e = 0;
40
40
  else if (t < l.length) {
41
- if (r = a === 1 && l[t] >= 5 || a === 2 && (l[t] > 5 || l[t] === 5 && (r || l[t + 1] !== B || l[t - 1] & 1)) || a === 3 && (r || !!l[0]), l.length = t, r) {
41
+ if (r = a === 1 && l[t] >= 5 || a === 2 && (l[t] > 5 || l[t] === 5 && (r || l[t + 1] !== N || l[t - 1] & 1)) || a === 3 && (r || !!l[0]), l.length = t, r) {
42
42
  for (; ++l[--t] > 9; )
43
43
  if (l[t] = 0, t === 0) {
44
44
  ++e.e, l.unshift(1);
@@ -63,41 +63,41 @@ function Q(e, t, a) {
63
63
  else n > 1 && (l = l.charAt(0) + "." + l.slice(1));
64
64
  return e.s < 0 && a ? "-" + l : l;
65
65
  }
66
- b.abs = function() {
66
+ I.abs = function() {
67
67
  var e = new this.constructor(this);
68
68
  return e.s = 1, e;
69
69
  };
70
- b.cmp = function(e) {
71
- var t, a = this, r = a.c, l = (e = new a.constructor(e)).c, n = a.s, o = e.s, i = a.e, u = e.e;
72
- if (!r[0] || !l[0]) return r[0] ? n : l[0] ? -o : 0;
73
- if (n != o) return n;
74
- if (t = n < 0, i != u) return i > u ^ t ? 1 : -1;
75
- for (o = (i = r.length) < (u = l.length) ? i : u, n = -1; ++n < o; )
70
+ I.cmp = function(e) {
71
+ var t, a = this, r = a.c, l = (e = new a.constructor(e)).c, n = a.s, i = e.s, o = a.e, u = e.e;
72
+ if (!r[0] || !l[0]) return r[0] ? n : l[0] ? -i : 0;
73
+ if (n != i) return n;
74
+ if (t = n < 0, o != u) return o > u ^ t ? 1 : -1;
75
+ for (i = (o = r.length) < (u = l.length) ? o : u, n = -1; ++n < i; )
76
76
  if (r[n] != l[n]) return r[n] > l[n] ^ t ? 1 : -1;
77
- return i == u ? 0 : i > u ^ t ? 1 : -1;
77
+ return o == u ? 0 : o > u ^ t ? 1 : -1;
78
78
  };
79
- b.div = function(e) {
80
- var t = this, a = t.constructor, r = t.c, l = (e = new a(e)).c, n = t.s == e.s ? 1 : -1, o = a.DP;
81
- if (o !== ~~o || o < 0 || o > J)
82
- throw Error(ue);
79
+ I.div = function(e) {
80
+ var t = this, a = t.constructor, r = t.c, l = (e = new a(e)).c, n = t.s == e.s ? 1 : -1, i = a.DP;
81
+ if (i !== ~~i || i < 0 || i > J)
82
+ throw Error(fe);
83
83
  if (!l[0])
84
- throw Error(Be);
84
+ throw Error(Ne);
85
85
  if (!r[0])
86
86
  return e.s = n, e.c = [e.e = 0], e;
87
- var i, u, d, c, m, s = l.slice(), f = i = l.length, g = r.length, p = r.slice(0, i), v = p.length, h = e, z = h.c = [], I = 0, C = o + (h.e = t.e - e.e) + 1;
88
- for (h.s = n, n = C < 0 ? 0 : C, s.unshift(0); v++ < i; ) p.push(0);
87
+ var o, u, d, c, m, s = l.slice(), f = o = l.length, h = r.length, p = r.slice(0, o), v = p.length, g = e, z = g.c = [], S = 0, x = i + (g.e = t.e - e.e) + 1;
88
+ for (g.s = n, n = x < 0 ? 0 : x, s.unshift(0); v++ < o; ) p.push(0);
89
89
  do {
90
90
  for (d = 0; d < 10; d++) {
91
- if (i != (v = p.length))
92
- c = i > v ? 1 : -1;
91
+ if (o != (v = p.length))
92
+ c = o > v ? 1 : -1;
93
93
  else
94
- for (m = -1, c = 0; ++m < i; )
94
+ for (m = -1, c = 0; ++m < o; )
95
95
  if (l[m] != p[m]) {
96
96
  c = l[m] > p[m] ? 1 : -1;
97
97
  break;
98
98
  }
99
99
  if (c < 0) {
100
- for (u = v == i ? l : s; v; ) {
100
+ for (u = v == o ? l : s; v; ) {
101
101
  if (p[--v] < u[v]) {
102
102
  for (m = v; m && !p[--m]; ) p[m] = 9;
103
103
  --p[m], p[v] += 10;
@@ -108,43 +108,43 @@ b.div = function(e) {
108
108
  } else
109
109
  break;
110
110
  }
111
- z[I++] = c ? d : ++d, p[0] && c ? p[v] = r[f] || 0 : p = [r[f]];
112
- } while ((f++ < g || p[0] !== B) && n--);
113
- return !z[0] && I != 1 && (z.shift(), h.e--, C--), I > C && j(h, C, a.RM, p[0] !== B), h;
111
+ z[S++] = c ? d : ++d, p[0] && c ? p[v] = r[f] || 0 : p = [r[f]];
112
+ } while ((f++ < h || p[0] !== N) && n--);
113
+ return !z[0] && S != 1 && (z.shift(), g.e--, x--), S > x && W(g, x, a.RM, p[0] !== N), g;
114
114
  };
115
- b.eq = function(e) {
115
+ I.eq = function(e) {
116
116
  return this.cmp(e) === 0;
117
117
  };
118
- b.gt = function(e) {
118
+ I.gt = function(e) {
119
119
  return this.cmp(e) > 0;
120
120
  };
121
- b.gte = function(e) {
121
+ I.gte = function(e) {
122
122
  return this.cmp(e) > -1;
123
123
  };
124
- b.lt = function(e) {
124
+ I.lt = function(e) {
125
125
  return this.cmp(e) < 0;
126
126
  };
127
- b.lte = function(e) {
127
+ I.lte = function(e) {
128
128
  return this.cmp(e) < 1;
129
129
  };
130
- b.minus = b.sub = function(e) {
131
- var t, a, r, l, n = this, o = n.constructor, i = n.s, u = (e = new o(e)).s;
132
- if (i != u)
130
+ I.minus = I.sub = function(e) {
131
+ var t, a, r, l, n = this, i = n.constructor, o = n.s, u = (e = new i(e)).s;
132
+ if (o != u)
133
133
  return e.s = -u, n.plus(e);
134
134
  var d = n.c.slice(), c = n.e, m = e.c, s = e.e;
135
135
  if (!d[0] || !m[0])
136
- return m[0] ? e.s = -u : d[0] ? e = new o(n) : e.s = 1, e;
137
- if (i = c - s) {
138
- for ((l = i < 0) ? (i = -i, r = d) : (s = c, r = m), r.reverse(), u = i; u--; ) r.push(0);
136
+ return m[0] ? e.s = -u : d[0] ? e = new i(n) : e.s = 1, e;
137
+ if (o = c - s) {
138
+ for ((l = o < 0) ? (o = -o, r = d) : (s = c, r = m), r.reverse(), u = o; u--; ) r.push(0);
139
139
  r.reverse();
140
140
  } else
141
- for (a = ((l = d.length < m.length) ? d : m).length, i = u = 0; u < a; u++)
141
+ for (a = ((l = d.length < m.length) ? d : m).length, o = u = 0; u < a; u++)
142
142
  if (d[u] != m[u]) {
143
143
  l = d[u] < m[u];
144
144
  break;
145
145
  }
146
146
  if (l && (r = d, d = m, m = r, e.s = -e.s), (u = (a = m.length) - (t = d.length)) > 0) for (; u--; ) d[t++] = 0;
147
- for (u = t; a > i; ) {
147
+ for (u = t; a > o; ) {
148
148
  if (d[--a] < m[a]) {
149
149
  for (t = a; t && !d[--t]; ) d[t] = 9;
150
150
  --d[t], d[a] += 10;
@@ -156,119 +156,119 @@ b.minus = b.sub = function(e) {
156
156
  d.shift(), --s;
157
157
  return d[0] || (e.s = 1, d = [s = 0]), e.c = d, e.e = s, e;
158
158
  };
159
- b.mod = function(e) {
159
+ I.mod = function(e) {
160
160
  var t, a = this, r = a.constructor, l = a.s, n = (e = new r(e)).s;
161
161
  if (!e.c[0])
162
- throw Error(Be);
162
+ throw Error(Ne);
163
163
  return a.s = e.s = 1, t = e.cmp(a) == 1, a.s = l, e.s = n, t ? new r(a) : (l = r.DP, n = r.RM, r.DP = r.RM = 0, a = a.div(e), r.DP = l, r.RM = n, this.minus(a.times(e)));
164
164
  };
165
- b.neg = function() {
165
+ I.neg = function() {
166
166
  var e = new this.constructor(this);
167
167
  return e.s = -e.s, e;
168
168
  };
169
- b.plus = b.add = function(e) {
169
+ I.plus = I.add = function(e) {
170
170
  var t, a, r, l = this, n = l.constructor;
171
171
  if (e = new n(e), l.s != e.s)
172
172
  return e.s = -e.s, l.minus(e);
173
- var o = l.e, i = l.c, u = e.e, d = e.c;
174
- if (!i[0] || !d[0])
175
- return d[0] || (i[0] ? e = new n(l) : e.s = l.s), e;
176
- if (i = i.slice(), t = o - u) {
177
- for (t > 0 ? (u = o, r = d) : (t = -t, r = i), r.reverse(); t--; ) r.push(0);
173
+ var i = l.e, o = l.c, u = e.e, d = e.c;
174
+ if (!o[0] || !d[0])
175
+ return d[0] || (o[0] ? e = new n(l) : e.s = l.s), e;
176
+ if (o = o.slice(), t = i - u) {
177
+ for (t > 0 ? (u = i, r = d) : (t = -t, r = o), r.reverse(); t--; ) r.push(0);
178
178
  r.reverse();
179
179
  }
180
- for (i.length - d.length < 0 && (r = d, d = i, i = r), t = d.length, a = 0; t; i[t] %= 10) a = (i[--t] = i[t] + d[t] + a) / 10 | 0;
181
- for (a && (i.unshift(a), ++u), t = i.length; i[--t] === 0; ) i.pop();
182
- return e.c = i, e.e = u, e;
180
+ for (o.length - d.length < 0 && (r = d, d = o, o = r), t = d.length, a = 0; t; o[t] %= 10) a = (o[--t] = o[t] + d[t] + a) / 10 | 0;
181
+ for (a && (o.unshift(a), ++u), t = o.length; o[--t] === 0; ) o.pop();
182
+ return e.c = o, e.e = u, e;
183
183
  };
184
- b.pow = function(e) {
184
+ I.pow = function(e) {
185
185
  var t = this, a = new t.constructor("1"), r = a, l = e < 0;
186
- if (e !== ~~e || e < -1e6 || e > Xe)
187
- throw Error(F + "exponent");
186
+ if (e !== ~~e || e < -1e6 || e > Ye)
187
+ throw Error(j + "exponent");
188
188
  for (l && (e = -e); e & 1 && (r = r.times(t)), e >>= 1, !!e; )
189
189
  t = t.times(t);
190
190
  return l ? a.div(r) : r;
191
191
  };
192
- b.prec = function(e, t) {
192
+ I.prec = function(e, t) {
193
193
  if (e !== ~~e || e < 1 || e > J)
194
- throw Error(F + "precision");
195
- return j(new this.constructor(this), e, t);
194
+ throw Error(j + "precision");
195
+ return W(new this.constructor(this), e, t);
196
196
  };
197
- b.round = function(e, t) {
198
- if (e === B) e = 0;
197
+ I.round = function(e, t) {
198
+ if (e === N) e = 0;
199
199
  else if (e !== ~~e || e < -1e6 || e > J)
200
- throw Error(ue);
201
- return j(new this.constructor(this), e + this.e + 1, t);
200
+ throw Error(fe);
201
+ return W(new this.constructor(this), e + this.e + 1, t);
202
202
  };
203
- b.sqrt = function() {
204
- var e, t, a, r = this, l = r.constructor, n = r.s, o = r.e, i = new l("0.5");
203
+ I.sqrt = function() {
204
+ var e, t, a, r = this, l = r.constructor, n = r.s, i = r.e, o = new l("0.5");
205
205
  if (!r.c[0]) return new l(r);
206
206
  if (n < 0)
207
207
  throw Error(ne + "No square root");
208
- n = Math.sqrt(r + ""), n === 0 || n === 1 / 0 ? (t = r.c.join(""), t.length + o & 1 || (t += "0"), n = Math.sqrt(t), o = ((o + 1) / 2 | 0) - (o < 0 || o & 1), e = new l((n == 1 / 0 ? "5e" : (n = n.toExponential()).slice(0, n.indexOf("e") + 1)) + o)) : e = new l(n + ""), o = e.e + (l.DP += 4);
208
+ n = Math.sqrt(r + ""), n === 0 || n === 1 / 0 ? (t = r.c.join(""), t.length + i & 1 || (t += "0"), n = Math.sqrt(t), i = ((i + 1) / 2 | 0) - (i < 0 || i & 1), e = new l((n == 1 / 0 ? "5e" : (n = n.toExponential()).slice(0, n.indexOf("e") + 1)) + i)) : e = new l(n + ""), i = e.e + (l.DP += 4);
209
209
  do
210
- a = e, e = i.times(a.plus(r.div(a)));
211
- while (a.c.slice(0, o).join("") !== e.c.slice(0, o).join(""));
212
- return j(e, (l.DP -= 4) + e.e + 1, l.RM);
210
+ a = e, e = o.times(a.plus(r.div(a)));
211
+ while (a.c.slice(0, i).join("") !== e.c.slice(0, i).join(""));
212
+ return W(e, (l.DP -= 4) + e.e + 1, l.RM);
213
213
  };
214
- b.times = b.mul = function(e) {
215
- var t, a = this, r = a.constructor, l = a.c, n = (e = new r(e)).c, o = l.length, i = n.length, u = a.e, d = e.e;
214
+ I.times = I.mul = function(e) {
215
+ var t, a = this, r = a.constructor, l = a.c, n = (e = new r(e)).c, i = l.length, o = n.length, u = a.e, d = e.e;
216
216
  if (e.s = a.s == e.s ? 1 : -1, !l[0] || !n[0])
217
217
  return e.c = [e.e = 0], e;
218
- for (e.e = u + d, o < i && (t = l, l = n, n = t, d = o, o = i, i = d), t = new Array(d = o + i); d--; ) t[d] = 0;
219
- for (u = i; u--; ) {
220
- for (i = 0, d = o + u; d > u; )
221
- i = t[d] + n[u] * l[d - u - 1] + i, t[d--] = i % 10, i = i / 10 | 0;
222
- t[d] = i;
218
+ for (e.e = u + d, i < o && (t = l, l = n, n = t, d = i, i = o, o = d), t = new Array(d = i + o); d--; ) t[d] = 0;
219
+ for (u = o; u--; ) {
220
+ for (o = 0, d = i + u; d > u; )
221
+ o = t[d] + n[u] * l[d - u - 1] + o, t[d--] = o % 10, o = o / 10 | 0;
222
+ t[d] = o;
223
223
  }
224
- for (i ? ++e.e : t.shift(), u = t.length; !t[--u]; ) t.pop();
224
+ for (o ? ++e.e : t.shift(), u = t.length; !t[--u]; ) t.pop();
225
225
  return e.c = t, e;
226
226
  };
227
- b.toExponential = function(e, t) {
227
+ I.toExponential = function(e, t) {
228
228
  var a = this, r = a.c[0];
229
- if (e !== B) {
229
+ if (e !== N) {
230
230
  if (e !== ~~e || e < 0 || e > J)
231
- throw Error(ue);
232
- for (a = j(new a.constructor(a), ++e, t); a.c.length < e; ) a.c.push(0);
231
+ throw Error(fe);
232
+ for (a = W(new a.constructor(a), ++e, t); a.c.length < e; ) a.c.push(0);
233
233
  }
234
234
  return Q(a, !0, !!r);
235
235
  };
236
- b.toFixed = function(e, t) {
236
+ I.toFixed = function(e, t) {
237
237
  var a = this, r = a.c[0];
238
- if (e !== B) {
238
+ if (e !== N) {
239
239
  if (e !== ~~e || e < 0 || e > J)
240
- throw Error(ue);
241
- for (a = j(new a.constructor(a), e + a.e + 1, t), e = e + a.e + 1; a.c.length < e; ) a.c.push(0);
240
+ throw Error(fe);
241
+ for (a = W(new a.constructor(a), e + a.e + 1, t), e = e + a.e + 1; a.c.length < e; ) a.c.push(0);
242
242
  }
243
243
  return Q(a, !1, !!r);
244
244
  };
245
- b[Symbol.for("nodejs.util.inspect.custom")] = b.toJSON = b.toString = function() {
245
+ I[Symbol.for("nodejs.util.inspect.custom")] = I.toJSON = I.toString = function() {
246
246
  var e = this, t = e.constructor;
247
247
  return Q(e, e.e <= t.NE || e.e >= t.PE, !!e.c[0]);
248
248
  };
249
- b.toNumber = function() {
249
+ I.toNumber = function() {
250
250
  var e = Number(Q(this, !0, !0));
251
251
  if (this.constructor.strict === !0 && !this.eq(e.toString()))
252
252
  throw Error(ne + "Imprecise conversion");
253
253
  return e;
254
254
  };
255
- b.toPrecision = function(e, t) {
255
+ I.toPrecision = function(e, t) {
256
256
  var a = this, r = a.constructor, l = a.c[0];
257
- if (e !== B) {
257
+ if (e !== N) {
258
258
  if (e !== ~~e || e < 1 || e > J)
259
- throw Error(F + "precision");
260
- for (a = j(new r(a), e, t); a.c.length < e; ) a.c.push(0);
259
+ throw Error(j + "precision");
260
+ for (a = W(new r(a), e, t); a.c.length < e; ) a.c.push(0);
261
261
  }
262
262
  return Q(a, e <= a.e || a.e <= r.NE || a.e >= r.PE, !!l);
263
263
  };
264
- b.valueOf = function() {
264
+ I.valueOf = function() {
265
265
  var e = this, t = e.constructor;
266
266
  if (t.strict === !0)
267
267
  throw Error(ne + "valueOf disallowed");
268
268
  return Q(e, e.e <= t.NE || e.e >= t.PE, !0);
269
269
  };
270
- var y = Ke();
271
- function tt(e, t) {
270
+ var b = Oe();
271
+ function nt(e, t) {
272
272
  e.forEach((a) => {
273
273
  try {
274
274
  t(a);
@@ -278,7 +278,7 @@ function tt(e, t) {
278
278
  });
279
279
  }
280
280
  let _ = 0;
281
- function nt() {
281
+ function at() {
282
282
  let e = /* @__PURE__ */ new Set(), t = e;
283
283
  return {
284
284
  add(a) {
@@ -288,47 +288,47 @@ function nt() {
288
288
  return _ -= t == e && e.has(a) ? 1 : 0, e.delete(a);
289
289
  },
290
290
  flush(a) {
291
- t.size && (e = /* @__PURE__ */ new Set(), _ -= t.size, tt(t, (r) => r(a) && e.add(r)), _ += e.size, t = e);
291
+ t.size && (e = /* @__PURE__ */ new Set(), _ -= t.size, nt(t, (r) => r(a) && e.add(r)), _ += e.size, t = e);
292
292
  }
293
293
  };
294
294
  }
295
- const Ne = nt(), Oe = typeof window < "u" ? window.requestAnimationFrame : () => {
296
- }, ae = (e) => at(e, Ne);
295
+ const He = at(), $e = typeof window < "u" ? window.requestAnimationFrame : () => {
296
+ }, ae = (e) => rt(e, He);
297
297
  ae.now = typeof performance < "u" ? () => performance.now() : Date.now;
298
298
  ae.batchedUpdates = (e) => e();
299
- let T = -1;
300
- function at(e, t) {
301
- t.add(e), rt();
302
- }
303
- function rt() {
304
- T < 0 && (T = 0, Oe($e));
299
+ let F = -1;
300
+ function rt(e, t) {
301
+ t.add(e), lt();
305
302
  }
306
303
  function lt() {
307
- T = -1;
304
+ F < 0 && (F = 0, $e(Le));
308
305
  }
309
- function $e() {
310
- ~T && (Oe($e), ae.batchedUpdates(ot));
306
+ function it() {
307
+ F = -1;
308
+ }
309
+ function Le() {
310
+ ~F && ($e(Le), ae.batchedUpdates(ot));
311
311
  }
312
312
  function ot() {
313
- const e = T;
314
- if (T = ae.now(), !_) {
315
- lt();
313
+ const e = F;
314
+ if (F = ae.now(), !_) {
315
+ it();
316
316
  return;
317
317
  }
318
- Ne.flush(e ? Math.min(64, T - e) : 16.667);
318
+ He.flush(e ? Math.min(64, F - e) : 16.667);
319
319
  }
320
- const Ce = 50;
321
- function it(e) {
322
- return { type: "percent", value: new y(e) };
320
+ const xe = 50;
321
+ function st(e) {
322
+ return { type: "percent", value: new b(e) };
323
323
  }
324
- function H(e) {
325
- return { type: "pixel", value: new y(e) };
324
+ function L(e) {
325
+ return { type: "pixel", value: new b(e) };
326
326
  }
327
- function st(e) {
328
- let t = fe.linear, a = 300;
329
- return e.collapseAnimation && (typeof e.collapseAnimation == "string" ? t = fe[e.collapseAnimation] : (a = e.collapseAnimation.duration, t = typeof e.collapseAnimation.easing == "function" ? e.collapseAnimation.easing : fe[e.collapseAnimation.easing])), { ease: t, duration: a };
327
+ function ut(e) {
328
+ let t = he.linear, a = 300;
329
+ return e.collapseAnimation && (typeof e.collapseAnimation == "string" ? t = he[e.collapseAnimation] : (a = e.collapseAnimation.duration, t = typeof e.collapseAnimation.easing == "function" ? e.collapseAnimation.easing : he[e.collapseAnimation.easing])), { ease: t, duration: a };
330
330
  }
331
- const fe = {
331
+ const he = {
332
332
  "ease-in-out": function(t) {
333
333
  return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;
334
334
  },
@@ -339,40 +339,40 @@ const fe = {
339
339
  return +t;
340
340
  }
341
341
  };
342
- function Ae(e) {
342
+ function Ve(e) {
343
343
  return e.orientation === "horizontal" ? e.dragOvershoot.gt(0) ? "w-resize" : e.dragOvershoot.lt(0) ? "e-resize" : "ew-resize" : e.dragOvershoot.gt(0) ? "n-resize" : e.dragOvershoot.lt(0) ? "s-resize" : "ns-resize";
344
344
  }
345
- function ut(e) {
345
+ function ct(e) {
346
346
  if ("context" in e && (e = e.context), "items" in e) {
347
- e.dragOvershoot = new y(e.dragOvershoot || 0);
347
+ e.dragOvershoot = new b(e.dragOvershoot || 0);
348
348
  for (const t of e.items)
349
- P(t) ? (t.currentValue.value = new y(t.currentValue.value), t.collapsedSize.value = new y(t.collapsedSize.value), t.min.value = new y(t.min.value), t.max && t.max !== "1fr" && (t.max.value = new y(t.max.value))) : t.size.value = new y(t.size.value);
349
+ y(t) ? (t.currentValue.value = new b(t.currentValue.value), t.collapsedSize.value = new b(t.collapsedSize.value), t.min.value = new b(t.min.value), t.default && (t.default.value = new b(t.default.value)), t.max && t.max !== "1fr" && (t.max.value = new b(t.max.value))) : t.size.value = new b(t.size.value);
350
350
  return e;
351
351
  }
352
352
  }
353
- function Y(e, t) {
353
+ function T(e, t) {
354
354
  if (!e)
355
355
  throw new Error(t);
356
356
  }
357
357
  function Z(e, t) {
358
- Y(t.includes(e.type), `Invalid event type: ${t}. Expected: ${t.join(" | ")}`);
358
+ T(t.includes(e.type), `Invalid event type: ${t}. Expected: ${t.join(" | ")}`);
359
359
  }
360
- function P(e) {
360
+ function y(e) {
361
361
  return !!(e && typeof e == "object" && "type" in e && e.type === "panel");
362
362
  }
363
- function $(e) {
363
+ function k(e) {
364
364
  return !!(e && typeof e == "object" && "type" in e && e.type === "handle");
365
365
  }
366
- function ct(e) {
366
+ function dt(e) {
367
367
  const t = () => {
368
368
  let r = null;
369
369
  return (l) => {
370
- var n, o;
370
+ var n, i;
371
371
  if (!r || r.pixel === l.pixel && r.percentage === l.percentage) {
372
372
  r = l;
373
373
  return;
374
374
  }
375
- r = l, (o = (n = e.onResize) == null ? void 0 : n.current) == null || o.call(n, l);
375
+ r = l, (i = (n = e.onResize) == null ? void 0 : n.current) == null || i.call(n, l);
376
376
  };
377
377
  };
378
378
  return { ...{
@@ -390,18 +390,18 @@ function ct(e) {
390
390
  collapseAnimation: e.collapseAnimation,
391
391
  default: e.default ? q(e.default) : void 0,
392
392
  isStaticAtRest: e.isStaticAtRest
393
- }, currentValue: H(-1) };
393
+ }, currentValue: L(-1) };
394
394
  }
395
395
  function ee(e, t) {
396
396
  return e.type === t.type && e.value.eq(t.value);
397
397
  }
398
- function dt(e, t) {
398
+ function ft(e, t) {
399
399
  return !!(!t || !ee(e.min, t.min) || e.max === "1fr" && t.max !== "1fr" || e.max !== "1fr" && t.max === "1fr" || e.max !== "1fr" && t.max !== "1fr" && !ee(e.max, t.max) || e.default && !t.default || !e.default && t.default || e.default && t.default && !ee(e.default, t.default) || !ee(e.collapsedSize, t.collapsedSize) || e.isStaticAtRest !== t.isStaticAtRest || e.collapseAnimation && !t.collapseAnimation || !e.collapseAnimation && t.collapseAnimation || typeof e.collapseAnimation == "string" && typeof t.collapseAnimation == "string" && e.collapseAnimation !== t.collapseAnimation || typeof e.collapseAnimation == "object" && typeof t.collapseAnimation == "object" && (e.collapseAnimation.duration !== t.collapseAnimation.duration || e.collapseAnimation.easing !== t.collapseAnimation.easing) || e.collapsible !== t.collapsible);
400
400
  }
401
- function ft(e, t) {
401
+ function pt(e, t) {
402
402
  return !t || !ee(e.size, t.size);
403
403
  }
404
- function pt(e) {
404
+ function mt(e) {
405
405
  return {
406
406
  type: "handle",
407
407
  ...e,
@@ -410,164 +410,178 @@ function pt(e) {
410
410
  }
411
411
  function q(e) {
412
412
  if (e === "1fr" && (e = "100%"), e.endsWith("px"))
413
- return H(parseFloat(e));
413
+ return L(parseFloat(e));
414
414
  if (e.endsWith("%"))
415
- return it(parseFloat(e) / 100);
415
+ return st(parseFloat(e) / 100);
416
416
  throw new Error(`Invalid unit: ${e}`);
417
417
  }
418
- function X(e, t) {
418
+ function Y(e, t) {
419
419
  return t.type === "pixel" ? e === 0 ? 0 : t.value.div(e).toNumber() : t.value.toNumber();
420
420
  }
421
- function V(e) {
421
+ function D(e) {
422
422
  return e.orientation === "horizontal" ? e.size.width : e.size.height;
423
423
  }
424
- function S(e, t) {
424
+ function A(e, t) {
425
425
  const a = t === "1fr" ? q(t) : t;
426
- return a.type === "pixel" ? a.value : a.value.mul(V(e));
426
+ return a.type === "pixel" ? a.value : a.value.mul(D(e));
427
427
  }
428
- function K(e, t, a) {
429
- const r = S(e, t.min), l = S(e, t.max);
428
+ function H(e, t, a) {
429
+ const r = A(e, t.min), l = A(e, t.max);
430
430
  return a.gte(r) && a.lte(l) ? a : a.lt(r) ? r : l;
431
431
  }
432
- function k(e, t) {
432
+ function E(e, t) {
433
433
  const a = e.items.find((r) => r.id === t);
434
- if (a && P(a))
434
+ if (a && y(a))
435
435
  return a;
436
436
  throw new Error(`Expected panel with id: ${t}`);
437
437
  }
438
- function He(e, t) {
438
+ function Ce(e, t) {
439
439
  const a = e.items.findIndex((r) => r.id === t);
440
- if (a !== -1 && $(e.items[a]))
440
+ if (a !== -1 && k(e.items[a]))
441
441
  return a;
442
442
  throw new Error(`Expected panel handle with id: ${t}`);
443
443
  }
444
- function mt(e, t) {
444
+ function ht(e, t) {
445
445
  if (!e.items.length)
446
446
  throw new Error("No items in group");
447
- const a = He(e, t), r = e.items[a - 1], l = e.items[a + 1];
448
- if (r && P(r) && r.collapsible)
447
+ const a = Ce(e, t), r = e.items[a - 1], l = e.items[a + 1];
448
+ if (r && y(r) && r.collapsible)
449
449
  return r;
450
- if (l && P(l) && l.collapsible)
450
+ if (l && y(l) && l.collapsible)
451
451
  return l;
452
452
  throw new Error(`No collapsible panel found for handle: ${t}`);
453
453
  }
454
- function te(e, t) {
454
+ function ce(e, t) {
455
455
  const a = e.items.findIndex((l) => l.id === t);
456
- Y(a !== -1, `Expected panel before: ${t}`);
456
+ if (e.activeDragHandleId) {
457
+ const l = Ce(e, e.activeDragHandleId), n = e.items[l];
458
+ if (n && k(n))
459
+ return {
460
+ item: n,
461
+ direction: l > a ? 1 : -1
462
+ };
463
+ }
464
+ T(a !== -1, `Expected panel before: ${t}`);
457
465
  let r = e.items[a + 1];
458
- if (r && $(r))
466
+ if (r && k(r))
459
467
  return { item: r, direction: 1 };
460
- if (r = e.items[a - 1], r && $(r))
468
+ if (r = e.items[a - 1], r && k(r))
461
469
  return { item: r, direction: -1 };
462
470
  throw new Error(`Cant find handle for panel: ${t}`);
463
471
  }
472
+ function Me(e, t) {
473
+ const a = e.items.findIndex((l) => l.id === t);
474
+ T(a !== -1, `Expected panel before: ${t}`);
475
+ let r = e.items[a + 1];
476
+ return r && k(r) && te(e, e.items, a + 1, 1, "add") ? { item: r, direction: 1 } : (r = e.items[a - 1], r && k(r) && te(e, e.items, a - 1, -1, "add") ? { item: r, direction: -1 } : ce(e, t));
477
+ }
464
478
  function gt(e) {
465
- const t = {}, a = e.map((o) => o.order).filter((o) => o !== void 0);
479
+ const t = {}, a = e.map((i) => i.order).filter((i) => i !== void 0);
466
480
  let r = 0;
467
- for (const o of e)
468
- if (o.order === void 0) {
481
+ for (const i of e)
482
+ if (i.order === void 0) {
469
483
  for (; a.includes(r) || Object.values(t).includes(r); )
470
484
  r++;
471
- t[o.id] = r;
485
+ t[i.id] = r;
472
486
  }
473
- const l = e.filter((o) => o.order === void 0), n = e.filter((o) => o.order !== void 0).sort((o, i) => o.order - i.order);
474
- for (const o of n)
475
- l.splice(o.order, 0, o);
487
+ const l = e.filter((i) => i.order === void 0), n = e.filter((i) => i.order !== void 0).sort((i, o) => i.order - o.order);
488
+ for (const i of n)
489
+ l.splice(i.order, 0, i);
476
490
  return l;
477
491
  }
478
- function ht(e, t, a) {
479
- return Y(t.currentValue.type === "pixel", `panelHasSpace only works with number values: ${t.id} ${t.currentValue}`), t.collapsible && !t.collapsed ? !0 : a === "add" ? t.currentValue.value.gte(S(e, t.min)) && t.currentValue.value.lt(S(e, t.max)) : t.currentValue.value.gt(S(e, t.min));
492
+ function vt(e, t, a) {
493
+ return T(t.currentValue.type === "pixel", `panelHasSpace only works with number values: ${t.id} ${t.currentValue}`), t.collapsible ? !t.collapsed : a === "add" ? t.currentValue.value.gte(A(e, t.min)) && t.currentValue.value.lt(A(e, t.max)) : t.currentValue.value.gt(A(e, t.min));
480
494
  }
481
- function Le(e, t, a, r, l, n) {
482
- const o = r === -1 ? t.slice(0, a + 1).reverse() : t.slice(a);
483
- for (const i of o) {
484
- if (!P(i))
495
+ function te(e, t, a, r, l, n) {
496
+ const i = r === -1 ? t.slice(0, a + 1).reverse() : t.slice(a);
497
+ for (const o of i) {
498
+ if (!y(o))
485
499
  continue;
486
- const u = n ? ge(e, i) : i;
487
- if (ht(e, u, l))
488
- return i;
500
+ const u = n ? ve(e, o) : o;
501
+ if (vt(e, u, l))
502
+ return o;
489
503
  }
490
504
  }
491
- function ce(e) {
492
- let t = new y(0);
505
+ function pe(e) {
506
+ let t = new b(0);
493
507
  for (const a of e.items)
494
- $(a) ? t = t.add(a.size.value) : (a.collapsed && a.currentValue.type === "pixel" || a.isStaticAtRest) && (t = t.add(a.currentValue.value));
508
+ k(a) ? t = t.add(a.size.value) : (a.collapsed && a.currentValue.type === "pixel" || a.isStaticAtRest) && (t = t.add(a.currentValue.value));
495
509
  return t;
496
510
  }
497
- function D(e) {
511
+ function B(e) {
498
512
  return e.type === "pixel" ? `${e.value.toNumber()}px` : `${e.value.mul(100).toNumber()}%`;
499
513
  }
500
- function vt(e) {
501
- return O(e).map((t) => P(t) ? t.currentValue.value.toNumber() : S(e, t.size).toNumber());
514
+ function wt(e) {
515
+ return O(e).map((t) => y(t) ? t.currentValue.value.toNumber() : A(e, t.size).toNumber());
502
516
  }
503
- function wt(e, t) {
504
- return k({ ...e, items: O(e) }, t).currentValue.value.toNumber();
517
+ function zt(e, t) {
518
+ return E({ ...e, items: O(e) }, t).currentValue.value.toNumber();
505
519
  }
506
- function zt(e) {
507
- return Se({
520
+ function bt(e) {
521
+ return Ae({
508
522
  ...e,
509
523
  items: O(e)
510
- }).map((a) => $(a) ? X(V(e), a.size) : X(V(e), a.currentValue));
524
+ }).map((a) => k(a) ? Y(D(e), a.size) : Y(D(e), a.currentValue));
511
525
  }
512
- function bt(e, t) {
513
- const a = O(e), r = k({ ...e, items: a }, t);
514
- return X(V(e), r.currentValue);
526
+ function It(e, t) {
527
+ const a = O(e), r = E({ ...e, items: a }, t);
528
+ return Y(D(e), r.currentValue);
515
529
  }
516
- function xe(e) {
517
- const t = ce(e);
530
+ function De(e) {
531
+ const t = pe(e);
518
532
  let a = !1;
519
533
  return e.items.map((r) => {
520
534
  if (r.type === "panel") {
521
- const l = D(r.min);
535
+ const l = B(r.min);
522
536
  if (r.currentValue.type === "pixel" && r.currentValue.value.toNumber() !== -1) {
523
537
  if (r.isStaticAtRest) {
524
- const n = r.max === "1fr" ? "100%" : D(r.max);
525
- return `clamp(${l}, ${D(r.currentValue)}, ${n})`;
538
+ const n = r.max === "1fr" ? "100%" : B(r.max);
539
+ return `clamp(${l}, ${B(r.currentValue)}, ${n})`;
526
540
  }
527
- return D(r.currentValue);
541
+ return B(r.currentValue);
528
542
  } else if (r.currentValue.type === "percent") {
529
543
  if (!a && (r.max === "1fr" || r.max.type === "percent" && r.max.value.eq(100)))
530
544
  return a = !0, `minmax(${l}, 1fr)`;
531
- const n = r.max === "1fr" ? "100%" : D(r.max);
545
+ const n = r.max === "1fr" ? "100%" : B(r.max);
532
546
  return `minmax(${l}, min(calc(${r.currentValue.value} * (100% - ${t}px)), ${n}))`;
533
547
  } else {
534
548
  if (r.collapsible && r.collapsed)
535
- return D(r.collapsedSize);
549
+ return B(r.collapsedSize);
536
550
  if (r.default) {
537
- if (e.items.some((i) => P(i) && i.id !== r.id && !i.collapsed && (i.max === "1fr" || i.max.type === "percent" && i.max.value.eq(100))))
538
- return D(r.default);
539
- const o = r.max === "1fr" ? "1fr" : D(r.max);
540
- return `minmax(${D(r.default)}, ${o})`;
551
+ if (e.items.some((o) => y(o) && o.id !== r.id && !o.collapsed && (o.max === "1fr" || o.max.type === "percent" && o.max.value.eq(100))))
552
+ return B(r.default);
553
+ const i = r.max === "1fr" ? "1fr" : B(r.max);
554
+ return `minmax(${B(r.default)}, ${i})`;
541
555
  } else {
542
- const n = r.max === "1fr" ? "1fr" : D(r.max);
556
+ const n = r.max === "1fr" ? "1fr" : B(r.max);
543
557
  return `minmax(${l}, ${n})`;
544
558
  }
545
559
  }
546
560
  }
547
- return D(r.size);
561
+ return B(r.size);
548
562
  }).join(" ");
549
563
  }
550
- function pe(e, t) {
564
+ function ge(e, t) {
551
565
  const a = e.findIndex((l) => l.id === t.id || typeof l.order == "number" && l.order === t.order);
552
566
  let r = e;
553
567
  return a !== -1 && (r = e.filter((l, n) => n !== a)), gt([...r, t]);
554
568
  }
555
- function ge(e, t) {
569
+ function ve(e, t) {
556
570
  return {
557
571
  ...t,
558
- min: H(-1e5),
559
- max: H(1e5)
572
+ min: L(-1e5),
573
+ max: L(1e5)
560
574
  };
561
575
  }
562
576
  function O(e) {
563
- const t = ce(e), a = [];
577
+ const t = pe(e), a = [];
564
578
  for (const r of e.items) {
565
- if (!r || !P(r)) {
579
+ if (!r || !y(r)) {
566
580
  a.push({ ...r });
567
581
  continue;
568
582
  }
569
583
  if (r.lastKnownSize) {
570
- const n = H(e.orientation === "horizontal" ? r.lastKnownSize.width : r.lastKnownSize.height);
584
+ const n = L(e.orientation === "horizontal" ? r.lastKnownSize.width : r.lastKnownSize.height);
571
585
  a.push({ ...r, currentValue: n });
572
586
  continue;
573
587
  }
@@ -575,71 +589,73 @@ function O(e) {
575
589
  a.push({ ...r });
576
590
  continue;
577
591
  }
578
- const l = new y(V(e)).minus(t).mul(r.currentValue.value);
592
+ const l = new b(D(e)).minus(t).mul(r.currentValue.value);
579
593
  a.push({
580
594
  ...r,
581
- currentValue: H(l.toNumber())
595
+ currentValue: L(l.toNumber())
582
596
  });
583
597
  }
584
598
  return a;
585
599
  }
586
- function ie(e, t) {
587
- var x, E, L, M;
588
- const a = He(e, t.handleId), r = e.items[a], l = [...e.items];
600
+ function oe(e, t) {
601
+ var C, R, K, M;
602
+ const a = Ce(e, t.handleId), r = e.items[a], l = [...e.items];
589
603
  let n = e.orientation === "horizontal" ? t.value.deltaX : t.value.deltaY;
590
604
  if (t.value.shiftKey && (n *= e.shiftAmount ?? 15), n === 0)
591
605
  return {};
592
- const o = n / Math.abs(n), i = Le(e, l, a + o, o, "subtract", t.disregardCollapseBuffer);
593
- if (!i)
606
+ const i = n / Math.abs(n), o = te(e, l, a + i, i, "subtract", t.disregardCollapseBuffer);
607
+ if (!o)
594
608
  return {
595
609
  dragOvershoot: e.dragOvershoot.add(n)
596
610
  };
597
- Y(P(i), `Expected panel before: ${r.id}`);
598
- const u = l[a - o];
599
- if (Y(u && P(u), `Expected panel after: ${r.id}`), u.currentValue.value.eq(S(e, u.max)))
611
+ T(y(o), `Expected panel before: ${r.id}`);
612
+ const u = t.type === "collapsePanel" && // If we have the panel id just use that
613
+ (l.find((V) => V.id === t.panelId && o.id !== t.panelId) || // otherwise fallback to the next panel with space
614
+ te(e, l, a - i, i * -1, "add", t.disregardCollapseBuffer)) || l[a - i];
615
+ if (T(u && y(u), `Expected panel after: ${r.id}`), u.currentValue.value.eq(A(e, u.max)))
600
616
  return {
601
617
  dragOvershoot: e.dragOvershoot.add(n)
602
618
  };
603
619
  const d = e.dragOvershoot.add(n);
604
- if (!t.disregardCollapseBuffer) {
605
- const R = d.lt(0) && o > 0, w = d.gt(0) && o > 0, A = d.gt(0) && o < 0, U = d.lt(0) && o < 0, re = u.currentValue.value.add(new y(d).mul(A ? o : 1)), le = S(e, u.min), qe = d.abs().lt(Ce) && // Let the panel expand at it's min size
620
+ if (!t.disregardCollapseBuffer && !t.controlled) {
621
+ const V = d.lt(0) && i > 0, w = d.gt(0) && i > 0, P = d.gt(0) && i < 0, U = d.lt(0) && i < 0, re = u.currentValue.value.add(new b(d).mul(P ? i : 1)), le = A(e, u.min), Fe = d.abs().lt(xe) && // Let the panel expand at it's min size
606
622
  !u.currentValue.value.add(d.abs()).gte(u.min.value) && u.collapsible && u.collapsed && (w || U);
607
- if (re.lte(le) && (d.eq(0) || A || R || qe))
623
+ if (re.lte(le) && (d.eq(0) || P || V || Fe))
608
624
  return { dragOvershoot: d };
609
625
  }
610
- if (!t.disregardCollapseBuffer && i.collapsible && i.currentValue.value.eq(S(e, i.min))) {
611
- const R = i.currentValue.value.sub(d.abs());
612
- if (d.abs().lt(Ce) && R.gt(S(e, i.collapsedSize)))
626
+ if (!t.disregardCollapseBuffer && !t.controlled && o.collapsible && o.currentValue.value.eq(A(e, o.min))) {
627
+ const V = o.currentValue.value.sub(d.abs());
628
+ if (d.abs().lt(xe) && V.gt(A(e, o.collapsedSize)))
613
629
  return { dragOvershoot: d };
614
630
  }
615
- const c = ge(e, i), m = i.currentValue.value, s = i.currentValue.value.minus(new y(n).mul(o));
616
- let f = t.disregardCollapseBuffer ? K(e, c, s) : K(e, i, s);
617
- const g = ge(e, u), p = u.currentValue.value, v = m.minus(f), h = u.currentValue.value.add(v);
618
- let z = t.disregardCollapseBuffer ? K(e, g, h) : K(e, u, h);
631
+ const c = ve(e, o), m = o.currentValue.value, s = o.currentValue.value.minus(new b(n).mul(i));
632
+ let f = t.disregardCollapseBuffer ? H(e, c, s) : H(e, o, s);
633
+ const h = ve(e, u), p = u.currentValue.value, v = m.minus(f), g = u.currentValue.value.add(v);
634
+ let z = t.disregardCollapseBuffer ? H(e, h, g) : H(e, u, g);
619
635
  if (t.disregardCollapseBuffer)
620
636
  u.collapsible && u.collapsed && (u.collapsed = !1);
621
637
  else if (u.collapsible && u.collapsed) {
622
- if ((x = u.onCollapseChange) != null && x.current && u.collapseIsControlled && !t.controlled && !t.isVirtual)
638
+ if ((C = u.onCollapseChange) != null && C.current && u.collapseIsControlled && !t.controlled && !t.isVirtual)
623
639
  return u.onCollapseChange.current(!1), { dragOvershoot: d };
624
- const R = (
640
+ const V = (
625
641
  // Take the size it was at
626
- S(e, u.collapsedSize).add(e.dragOvershoot.abs()).sub(z.add(Math.abs(n)))
642
+ A(e, u.collapsedSize).add(e.dragOvershoot.abs()).sub(z.add(Math.abs(n)))
627
643
  );
628
- if (R.gt(0) && (z = z.add(R)), f = f.minus(z.minus(p).minus(Math.abs(n))), f.lt(i.min.value))
644
+ if (V.gt(0) && (z = z.add(V)), f = f.minus(z.minus(p).minus(Math.abs(n))), f.lt(o.min.value) && !o.collapsible)
629
645
  return { dragOvershoot: d };
630
- u.collapsed = !1, (E = u.onCollapseChange) != null && E.current && !u.collapseIsControlled && !t.controlled && !t.isVirtual && u.onCollapseChange.current(!1);
646
+ u.collapsed = !1, (R = u.onCollapseChange) != null && R.current && !u.collapseIsControlled && !t.controlled && !t.isVirtual && u.onCollapseChange.current(!1);
631
647
  }
632
- const I = i.currentValue.value.eq(S(e, i.min));
633
- if (!t.disregardCollapseBuffer && i.collapsible && I) {
634
- if ((L = i.onCollapseChange) != null && L.current && i.collapseIsControlled && !t.controlled && !t.isVirtual)
635
- return i.onCollapseChange.current(!0), { dragOvershoot: d };
636
- i.collapsed = !0, f = S(e, i.collapsedSize), z = z.add(m.minus(f)), (M = i.onCollapseChange) != null && M.current && !i.collapseIsControlled && !t.controlled && !t.isVirtual && i.onCollapseChange.current(!0);
648
+ const S = o.currentValue.value.eq(A(e, o.min));
649
+ if (!t.disregardCollapseBuffer && o.collapsible && S) {
650
+ if ((K = o.onCollapseChange) != null && K.current && o.collapseIsControlled && !t.controlled && !t.isVirtual)
651
+ return o.onCollapseChange.current(!0), { dragOvershoot: d };
652
+ o.collapsed = !0, f = A(e, o.collapsedSize), z = u.currentValue.value.add(m.minus(f)), (M = o.onCollapseChange) != null && M.current && !o.collapseIsControlled && !t.controlled && !t.isVirtual && o.onCollapseChange.current(!0);
637
653
  }
638
- i.currentValue = { type: "pixel", value: f }, u.currentValue = { type: "pixel", value: z };
639
- const C = new y(V(e)).minus(l.reduce((R, w) => R.add(P(w) ? w.currentValue.value : w.size.value), new y(0)));
640
- return C.eq(0) || (i.currentValue.value = K(e, i, i.currentValue.value.add(C))), { items: l };
654
+ o.currentValue = { type: "pixel", value: f }, u.currentValue = { type: "pixel", value: z };
655
+ const x = new b(D(e)).minus(l.reduce((V, w) => V.add(y(w) ? w.currentValue.value : w.size.value), new b(0)));
656
+ return x.eq(0) || (o.currentValue.value = H(e, o, o.currentValue.value.add(x))), { items: l };
641
657
  }
642
- function Se(e) {
658
+ function Ae(e) {
643
659
  const t = [...e.items];
644
660
  t.forEach((r, l) => {
645
661
  r.type === "panel" && r.collapsed && (t[l] = {
@@ -647,18 +663,18 @@ function Se(e) {
647
663
  currentValue: r.collapsedSize
648
664
  });
649
665
  });
650
- const a = ce({ ...e, items: t });
666
+ const a = pe({ ...e, items: t });
651
667
  return t.forEach((r, l) => {
652
668
  r.type !== "panel" || r.collapsed || r.isStaticAtRest || (t[l] = {
653
669
  ...r,
654
670
  currentValue: {
655
671
  type: "percent",
656
- value: r.currentValue.value.div(new y(V(e)).sub(a))
672
+ value: r.currentValue.value.div(new b(D(e)).sub(a))
657
673
  }
658
674
  });
659
675
  }), t;
660
676
  }
661
- function he({ delta: e, orientation: t = "horizontal", shiftKey: a = !1 }) {
677
+ function we({ delta: e, orientation: t = "horizontal", shiftKey: a = !1 }) {
662
678
  return {
663
679
  type: "move",
664
680
  pointerType: "keyboard",
@@ -670,115 +686,127 @@ function he({ delta: e, orientation: t = "horizontal", shiftKey: a = !1 }) {
670
686
  deltaY: t === "horizontal" ? 0 : e
671
687
  };
672
688
  }
673
- function ve({ context: e, handleId: t, delta: a, direction: r, controlled: l, disregardCollapseBuffer: n, isVirtual: o }) {
674
- let i = e;
675
- for (let u = 0; u < a.abs().toNumber(); u++)
676
- i = ie({
689
+ function de({ context: e, handleId: t, delta: a, direction: r, controlled: l, disregardCollapseBuffer: n, isVirtual: i, panelId: o }) {
690
+ let u = e;
691
+ for (let d = 0; d < a.abs().toNumber(); d++)
692
+ u = oe({
677
693
  ...e,
678
- ...i
694
+ ...u
679
695
  }, {
680
696
  handleId: t,
697
+ type: "collapsePanel",
681
698
  controlled: l,
682
699
  disregardCollapseBuffer: n,
683
- isVirtual: o,
684
- value: he({
700
+ isVirtual: i,
701
+ panelId: o,
702
+ value: we({
685
703
  delta: r,
686
704
  orientation: e.orientation
687
705
  })
688
706
  });
689
- return i;
707
+ return u;
690
708
  }
691
- function we(e, t, a, r) {
692
- let l = !1, n = 1, o = new y(r);
693
- for (; o.toNumber() !== 0; ) {
694
- const i = Le(e, t, a + n, n, r.gt(0) ? "add" : "subtract");
695
- if (!i) {
709
+ function ze(e, t, a, r) {
710
+ let l = !1, n = 1, i = new b(r);
711
+ for (; i.toNumber() !== 0; ) {
712
+ const o = te(e, t, a + n, n, r.gt(0) ? "add" : "subtract");
713
+ if (!o) {
696
714
  if (l)
697
715
  break;
698
716
  n = n === 1 ? -1 : 1, l = !0;
699
717
  continue;
700
718
  }
701
- const u = i.currentValue.value, d = K(e, i, u.add(o));
702
- i.currentValue.value = d, o = o.sub(d.sub(u)), n = n === 1 ? -1 : 1;
719
+ const u = o.currentValue.value, d = H(e, o, u.add(i));
720
+ o.currentValue.value = d, i = i.sub(d.sub(u)), n = n === 1 ? -1 : 1;
703
721
  }
704
722
  }
705
723
  function yt(e) {
706
- if (e.items.some((u) => P(u) && u.currentValue.value.eq(-1)))
724
+ if (e.items.some((u) => y(u) && u.currentValue.value.eq(-1)))
707
725
  return e;
708
- const t = new y(V(e)), a = t.sub(ce(e).toNumber()), l = e.items.map((u) => {
709
- if ($(u))
726
+ const t = new b(D(e)), a = t.sub(pe(e).toNumber()), l = e.items.map((u) => {
727
+ if (k(u))
710
728
  return u.size.value;
711
729
  if (u.collapsed)
712
- return S(e, u.currentValue);
730
+ return A(e, u.currentValue);
713
731
  const d = u.currentValue.type === "pixel" && u.currentValue.value || u.currentValue.value.mul(a);
714
- return K(e, u, d);
715
- }).reduce((u, d) => u.add(d), new y(0)), n = l.abs().sub(t);
732
+ return H(e, u, d);
733
+ }).reduce((u, d) => u.add(d), new b(0)), n = l.abs().sub(t);
716
734
  if (n.eq(0) || t.eq(0))
717
735
  return e;
718
- let o = { ...e, items: O(e) };
719
- const i = o.items.find((u) => !!(P(u) && u.collapsible));
720
- if (i) {
721
- const u = o.items.findIndex((m) => m.id === i.id), d = te(o, i.id), c = i.currentValue.value.sub(S(o, i.collapsedSize));
722
- o = {
723
- ...o,
724
- ...ve({
736
+ let i = { ...e, items: O(e) };
737
+ const o = i.items.find((u) => !!(y(u) && u.collapsible));
738
+ if (o) {
739
+ const u = i.items.findIndex((m) => m.id === o.id), d = ce(i, o.id), c = o.currentValue.value.sub(A(i, o.collapsedSize));
740
+ i = {
741
+ ...i,
742
+ ...de({
725
743
  handleId: d.item.id,
726
744
  delta: c,
727
745
  direction: d.direction * -1,
746
+ panelId: o.id,
728
747
  context: {
729
- ...o,
748
+ ...i,
730
749
  // act like its the old size so the space is distributed correctly
731
750
  size: { width: l.toNumber(), height: l.toNumber() }
732
751
  }
733
752
  })
734
- }, we(o, o.items, u, n.neg());
753
+ }, ze(i, i.items, u, n.neg());
735
754
  }
736
- return { ...o, items: Se(o) };
755
+ return { ...i, items: Ae(i) };
737
756
  }
738
- function Ve(e) {
757
+ function Re(e) {
739
758
  return e.map((t) => ({ ...t, lastKnownSize: void 0 }));
740
759
  }
741
- function It(e, t) {
760
+ function Pt(e, t) {
742
761
  document.cookie = `${e}=${encodeURIComponent(`${t}`)};path=/;max-age=31536000`;
743
762
  }
744
- function Me(e, t) {
745
- const a = k(e, t.panelId);
763
+ function qe(e, t) {
764
+ const a = E(e, t.panelId);
746
765
  if (t.type === "expandPanel")
747
- return new y(a.sizeBeforeCollapse ?? S(e, a.min)).minus(a.currentValue.value);
748
- const r = S(e, a.collapsedSize);
766
+ return new b(a.sizeBeforeCollapse ?? A(e, a.min)).minus(a.currentValue.value);
767
+ const r = A(e, a.collapsedSize);
749
768
  return a.currentValue.value.minus(r);
750
769
  }
751
- function Re(e, t, a, r) {
752
- const l = k(e, t.panelId), n = te(e, t.panelId);
753
- let o = new y(n.direction);
754
- const i = Me(e, t);
755
- return new Promise((u, d) => {
770
+ function ke(e, t, a, r) {
771
+ const l = E(e, t.panelId), n = Me(e, t.panelId);
772
+ let i = new b(n.direction);
773
+ const o = qe(e, t), u = { ...e, items: O(e) }, d = de({
774
+ context: u,
775
+ panelId: t.panelId,
776
+ handleId: n.item.id,
777
+ delta: o,
778
+ direction: n.direction,
779
+ isVirtual: !0
780
+ });
781
+ return new Promise((c, m) => {
756
782
  r.signal.addEventListener("abort", () => {
757
- d(new Error("Operation was canceled"));
758
- }), t.type === "collapsePanel" && (l.sizeBeforeCollapse = l.currentValue.value.toNumber(), o = o.mul(new y(-1)));
759
- const c = 60, { duration: m, ease: s } = st(l), f = Math.ceil(l.collapseAnimation ? m / (1e3 / c) : 1);
760
- let g = 0, p = new y(0);
761
- function v() {
762
- const h = ++g / f, z = new y(l.collapseAnimation ? s(h) : 1), I = z.mul(i).sub(p).mul(o);
783
+ m(new Error("Operation was canceled"));
784
+ }), t.type === "collapsePanel" && (l.sizeBeforeCollapse = l.currentValue.value.toNumber(), i = i.mul(new b(-1)));
785
+ const s = 60, { duration: f, ease: h } = ut(l), p = Math.ceil(l.collapseAnimation ? f / (1e3 / s) : 1);
786
+ let v = 0, g = new b(0);
787
+ function z() {
788
+ const S = ++v / p, x = new b(l.collapseAnimation ? h(S) : 1), C = x.mul(o).sub(g).mul(i);
763
789
  if (a({
764
790
  type: "applyDelta",
765
791
  handleId: n.item.id,
766
- delta: I.toNumber()
767
- }), p = p.add(I.abs().mul(I.gt(0) && o.lt(0) || I.lt(0) && o.gt(0) ? -1 : 1)), z.eq(1)) {
768
- const C = t.type === "expandPanel" ? "expand" : "collapse";
769
- return u({ panelId: l.id, action: C }), !1;
792
+ delta: C.toNumber(),
793
+ panelId: l.id
794
+ }), g = g.add(C.abs().mul(C.gt(0) && i.lt(0) || C.lt(0) && i.gt(0) ? -1 : 1)), x.eq(1)) {
795
+ e.items.find((K) => y(K) && K.currentValue.value.round(void 0, b.roundHalfEven).lt(0)) && se(e, d);
796
+ const R = t.type === "expandPanel" ? "expand" : "collapse";
797
+ return c({ panelId: l.id, action: R, resolve: t.resolve }), !1;
770
798
  }
771
799
  return !0;
772
800
  }
773
- ae(v);
801
+ ae(z);
774
802
  });
775
803
  }
776
- function me(e, t) {
804
+ function se(e, t) {
777
805
  for (const a in t)
778
806
  e[a] = t[a];
779
807
  }
780
- let Pt = 0;
781
- function St(e, t) {
808
+ let St = 0;
809
+ function Ct(e, t) {
782
810
  const a = new AbortController(), r = {
783
811
  current: "idle"
784
812
  };
@@ -787,28 +815,28 @@ function St(e, t) {
787
815
  size: e.size || { width: 0, height: 0 },
788
816
  items: e.items || [],
789
817
  orientation: e.orientation || "horizontal",
790
- dragOvershoot: new y(0),
791
- groupId: e.groupId || `group-${Pt++}`,
818
+ dragOvershoot: new b(0),
819
+ groupId: e.groupId || `group-${St++}`,
792
820
  autosaveStrategy: e.autosaveStrategy,
793
821
  shiftAmount: e.shiftAmount ?? 15
794
- }, o = {
822
+ }, i = {
795
823
  prepare: () => {
796
824
  n.items = O(n);
797
825
  },
798
826
  clearLastKnownSize: () => {
799
- n.items = Ve(n.items);
827
+ n.items = Re(n.items);
800
828
  },
801
829
  commit: () => {
802
- n.dragOvershoot = new y(0), n.items = Se(n);
830
+ n.dragOvershoot = new b(0), n.items = Ae(n);
803
831
  },
804
832
  onResize: () => {
805
833
  var c, m;
806
834
  for (const s of n.items)
807
- if (P(s)) {
808
- const f = s.lastKnownSize ? new y(n.orientation === "horizontal" ? s.lastKnownSize.width : s.lastKnownSize.height) : K(n, s, S(n, s.currentValue)), g = V(n);
835
+ if (y(s)) {
836
+ const f = s.lastKnownSize ? new b(n.orientation === "horizontal" ? s.lastKnownSize.width : s.lastKnownSize.height) : H(n, s, A(n, s.currentValue)), h = D(n);
809
837
  (m = (c = s.onResize) == null ? void 0 : c.current) == null || m.call(c, {
810
838
  pixel: f.toNumber(),
811
- percentage: g > 0 ? f.div(V(n)).toNumber() : -1
839
+ percentage: h > 0 ? f.div(D(n)).toNumber() : -1
812
840
  });
813
841
  }
814
842
  },
@@ -816,87 +844,91 @@ function St(e, t) {
816
844
  if (!n.autosaveStrategy || typeof window > "u")
817
845
  return;
818
846
  const c = { ...n };
819
- c.items = Ve(n.items), c.activeDragHandleId = n.activeDragHandleId;
847
+ c.items = Re(n.items), c.activeDragHandleId = n.activeDragHandleId;
820
848
  const m = JSON.stringify(c);
821
- n.autosaveStrategy === "localStorage" ? localStorage.setItem(n.groupId, m) : It(n.groupId, m);
849
+ n.autosaveStrategy === "localStorage" ? localStorage.setItem(n.groupId, m) : Pt(n.groupId, m);
822
850
  },
823
851
  removeItem: (c) => {
824
852
  const m = n.items.findIndex((p) => p.id === c), s = n.items[m];
825
853
  if (!s)
826
854
  return;
827
- const f = n.items.filter((p) => p.id !== c), g = P(s) ? s.currentValue.value : s.size.value;
828
- we(n, f, m, g), n.items = f;
855
+ const f = n.items.filter((p) => p.id !== c), h = y(s) ? s.currentValue.value : s.size.value;
856
+ ze(n, f, m, h), n.items = f;
829
857
  },
830
858
  notifyCollapseToggle: (c) => {
831
859
  var s, f;
832
860
  Z(c, ["collapsePanel", "expandPanel"]);
833
- const m = k(n, c.panelId);
861
+ const m = E(n, c.panelId);
834
862
  (f = (s = m.onCollapseChange) == null ? void 0 : s.current) == null || f.call(s, !m.collapsed);
835
863
  },
836
864
  runCollapseToggle: (c) => {
837
865
  Z(c, ["collapsePanel", "expandPanel"]);
838
- const m = te(n, c.panelId), s = c.type === "collapsePanel" ? m.direction * -1 : m.direction, f = ie(n, {
866
+ const m = ce(n, c.panelId), s = c.type === "collapsePanel" ? m.direction * -1 : m.direction, f = oe(n, {
867
+ panelId: c.panelId,
839
868
  handleId: m.item.id,
869
+ type: "dragHandle",
840
870
  controlled: c.controlled,
841
- value: he({
871
+ value: we({
842
872
  delta: s,
843
873
  orientation: n.orientation
844
874
  })
845
875
  });
846
- me(n, f);
876
+ se(n, f);
847
877
  },
848
878
  onAnimationEnd: (c) => {
849
879
  var s, f;
850
- Y(c, "Expected output from animation actor");
851
- const m = k(n, c.panelId);
852
- m.collapsed = c.action === "collapse", m.collapsed && (m.currentValue = m.collapsedSize), m.collapseIsControlled || (f = (s = m.onCollapseChange) == null ? void 0 : s.current) == null || f.call(s, m.collapsed), o.commit();
880
+ T(c, "Expected output from animation actor");
881
+ const m = E(n, c.panelId);
882
+ m.collapsed = c.action === "collapse", m.collapsed && (m.currentValue = m.collapsedSize), m.collapseIsControlled || (f = (s = m.onCollapseChange) == null ? void 0 : s.current) == null || f.call(s, m.collapsed), i.commit();
853
883
  }
854
884
  };
855
- o.onAutosave();
856
- const i = {
885
+ i.onAutosave();
886
+ const o = {
857
887
  shouldNotifyCollapseToggle: (c) => {
858
888
  Z(c, ["collapsePanel", "expandPanel"]);
859
- const m = k(n, c.panelId);
889
+ const m = E(n, c.panelId);
860
890
  return !c.controlled && m.collapseIsControlled === !0;
861
891
  },
862
- shouldCollapseToggle: (c) => (Z(c, ["collapsePanel", "expandPanel"]), k(n, c.panelId).collapseIsControlled === !0),
892
+ shouldCollapseToggle: (c) => (Z(c, ["collapsePanel", "expandPanel"]), E(n, c.panelId).collapseIsControlled === !0),
863
893
  cannotExpandPanel: (c) => {
864
894
  Z(c, ["expandPanel"]);
865
- const m = Me(n, c), s = te(n, c.panelId), f = O(n);
866
- let g = { ...n, items: f };
867
- g = {
868
- ...g,
869
- ...ve({
870
- context: g,
871
- handleId: s.item.id,
895
+ const m = O(n);
896
+ let s = { ...n, items: m };
897
+ const f = qe(n, c), h = Me(s, c.panelId);
898
+ s = {
899
+ ...s,
900
+ ...de({
901
+ context: s,
902
+ panelId: c.panelId,
903
+ handleId: h.item.id,
872
904
  controlled: c.controlled,
873
- delta: m,
874
- direction: s.direction,
905
+ delta: f,
906
+ direction: h.direction,
875
907
  isVirtual: !0
876
908
  })
877
909
  };
878
- const p = g.items.find((z) => z.id === c.panelId), v = g.items.reduce((z, I) => z.add(P(I) ? I.currentValue.value : I.size.value), new y(0)), h = p && P(p) && !p.currentValue.value.eq(p.collapsedSize.value);
879
- return v.gt(V(n)) || !h;
910
+ const p = s.items.find((z) => z.id === c.panelId), v = s.items.reduce((z, S) => z.add(y(S) ? S.currentValue.value : S.size.value), new b(0)), g = p && y(p) && !p.currentValue.value.eq(p.collapsedSize.value);
911
+ return v.gt(D(n)) || !g;
880
912
  }
881
913
  };
882
914
  function u(c) {
883
915
  switch (r.current) {
884
916
  case "dragging":
885
- o.commit(), n.activeDragHandleId = void 0;
917
+ i.commit(), n.activeDragHandleId = void 0;
886
918
  break;
887
919
  }
888
920
  switch (c) {
889
921
  case "idle":
890
- o.onAutosave();
922
+ i.onAutosave();
891
923
  break;
892
924
  case "dragging":
893
- o.prepare();
925
+ i.prepare();
894
926
  break;
895
927
  case "togglingCollapse":
896
- o.prepare(), o.clearLastKnownSize();
928
+ i.prepare(), i.clearLastKnownSize();
897
929
  break;
898
930
  }
899
- r.current = c;
931
+ r.current = c, t == null || t(n);
900
932
  }
901
933
  function d(c) {
902
934
  var m;
@@ -911,80 +943,80 @@ function St(e, t) {
911
943
  if (!l) {
912
944
  switch (c.type) {
913
945
  case "registerPanel":
914
- n.items = pe(n.items, {
946
+ n.items = ge(n.items, {
915
947
  type: "panel",
916
- currentValue: H(-1),
948
+ currentValue: L(-1),
917
949
  ...c.data
918
950
  });
919
951
  break;
920
952
  case "unregisterPanel":
921
- o.prepare(), o.removeItem(c.id), o.clearLastKnownSize(), o.commit(), o.onResize(), o.onAutosave();
953
+ i.prepare(), i.removeItem(c.id), i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
922
954
  break;
923
955
  case "registerPanelHandle": {
924
- n.items = pe(n.items, c.data);
956
+ n.items = ge(n.items, c.data);
925
957
  break;
926
958
  }
927
959
  case "unregisterPanelHandle":
928
- o.prepare(), o.removeItem(c.id), o.clearLastKnownSize(), o.commit(), o.onResize(), o.onAutosave();
960
+ i.prepare(), i.removeItem(c.id), i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
929
961
  break;
930
962
  case "registerDynamicPanel": {
931
- o.prepare();
932
- let s = H(0);
963
+ i.prepare();
964
+ let s = L(0);
933
965
  c.data.collapsible && c.data.collapsed && c.data.collapsedSize ? s = c.data.collapsedSize : c.data.default ? s = c.data.default : s = c.data.min;
934
- const f = pe(n.items, {
966
+ const f = ge(n.items, {
935
967
  type: "panel",
936
968
  ...c.data,
937
969
  currentValue: s
938
- }), g = f.findIndex((h) => h.id === c.data.id), p = { ...n }, v = n.items.reduce((h, z) => $(z) ? h.add(S(n, z.size)) : h.add(z.currentValue.value), new y(0)).minus(V(n));
939
- we(p, f, g, s.value.add(v).neg()), n.items = f, o.clearLastKnownSize(), o.commit(), o.onResize(), o.onAutosave();
970
+ }), h = f.findIndex((g) => g.id === c.data.id), p = { ...n }, v = n.items.reduce((g, z) => k(z) ? g.add(A(n, z.size)) : g.add(z.currentValue.value), new b(0)).minus(D(n));
971
+ ze(p, f, h, s.value.add(v).neg()), n.items = f, i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
940
972
  break;
941
973
  }
942
974
  case "rebindPanelCallbacks":
943
975
  for (const s of n.items)
944
- P(s) && s.id === c.data.id && (s.onCollapseChange = c.data.onCollapseChange, s.onResize = c.data.onResize);
976
+ y(s) && s.id === c.data.id && (s.onCollapseChange = c.data.onCollapseChange, s.onResize = c.data.onResize);
945
977
  break;
946
978
  case "updateConstraints":
947
- o.prepare();
979
+ i.prepare();
948
980
  for (const s of n.items)
949
- if (P(s) && s.id === c.data.id) {
981
+ if (y(s) && s.id === c.data.id) {
950
982
  const f = c.data;
951
983
  s.min = f.min, s.max = f.max, s.default = f.default, s.collapsedSize = f.collapsedSize, s.isStaticAtRest = f.isStaticAtRest, s.collapseAnimation = f.collapseAnimation, s.collapsible = f.collapsible;
952
- } else if ($(s) && s.id === c.data.id) {
984
+ } else if (k(s) && s.id === c.data.id) {
953
985
  const f = c.data;
954
986
  s.size = f.size;
955
987
  }
956
- o.clearLastKnownSize(), o.commit(), o.onResize(), o.onAutosave();
988
+ i.clearLastKnownSize(), i.commit(), i.onResize(), i.onAutosave();
957
989
  break;
958
990
  case "setActualItemsSize": {
959
991
  const s = n.items.map((p) => {
960
- if (!P(p))
992
+ if (!y(p))
961
993
  return p;
962
994
  const v = c.childrenSizes[p.id] || p.lastKnownSize;
963
995
  return { ...p, lastKnownSize: v };
964
996
  });
965
- let f = 0, g = !1;
997
+ let f = 0, h = !1;
966
998
  for (const p of s)
967
- if (P(p)) {
999
+ if (y(p)) {
968
1000
  const v = (m = p.lastKnownSize) == null ? void 0 : m[n.orientation === "horizontal" ? "width" : "height"];
969
1001
  if (!v) {
970
- n.items = s, g = !0;
1002
+ n.items = s, h = !0;
971
1003
  break;
972
1004
  }
973
1005
  f += v;
974
1006
  } else
975
1007
  f += p.size.value.toNumber();
976
- g ? n.items = s : f > V(n) && r.current !== "dragging" ? n.items = yt({
1008
+ h ? n.items = s : f > D(n) && r.current !== "dragging" ? n.items = yt({
977
1009
  ...n,
978
1010
  items: O({ ...n, items: s })
979
- }).items : n.items = s, o.onResize();
1011
+ }).items : n.items = s, i.onResize();
980
1012
  break;
981
1013
  }
982
1014
  case "setSize": {
983
- n.size = c.size, o.onResize();
1015
+ n.size = c.size, i.onResize();
984
1016
  break;
985
1017
  }
986
1018
  case "setOrientation":
987
- n.orientation = c.orientation, o.clearLastKnownSize(), o.onResize();
1019
+ n.orientation = c.orientation, i.clearLastKnownSize(), i.onResize();
988
1020
  break;
989
1021
  }
990
1022
  if (r.current === "idle")
@@ -993,53 +1025,56 @@ function St(e, t) {
993
1025
  u("dragging"), n.activeDragHandleId = c.handleId;
994
1026
  break;
995
1027
  case "setPanelPixelSize": {
996
- o.prepare(), o.clearLastKnownSize();
997
- const s = k(n, c.panelId), f = te(n, c.panelId), g = s.currentValue.value, p = K(n, s, S(n, q(c.size))), v = p > g, h = v ? p.minus(g) : g.minus(p);
998
- Object.assign(n, ve({
1028
+ i.prepare(), i.clearLastKnownSize();
1029
+ const s = E(n, c.panelId), f = ce(n, c.panelId), h = s.currentValue.value, p = H(n, s, A(n, q(c.size))), v = p > h, g = v ? p.minus(h) : h.minus(p);
1030
+ s.sizeBeforeCollapse = p.toNumber(), Object.assign(n, de({
999
1031
  context: n,
1032
+ panelId: c.panelId,
1000
1033
  direction: f.direction * (v ? 1 : -1),
1001
1034
  handleId: f.item.id,
1002
- delta: h
1003
- })), o.commit(), o.onResize(), o.onAutosave();
1035
+ delta: g
1036
+ })), i.commit(), i.onResize(), i.onAutosave();
1004
1037
  break;
1005
1038
  }
1006
1039
  case "collapsePanel":
1007
- i.shouldNotifyCollapseToggle(c) ? o.notifyCollapseToggle(c) : k(n, c.panelId).collapsed || (u("togglingCollapse"), a.abort(), Re(n, c, d, a).then((f) => {
1008
- o.onAnimationEnd(f), u("idle");
1040
+ o.shouldNotifyCollapseToggle(c) ? i.notifyCollapseToggle(c) : E(n, c.panelId).collapsed || (u("togglingCollapse"), a.abort(), ke(n, c, d, a).then((f) => {
1041
+ i.onAnimationEnd(f), u("idle"), c.resolve && requestAnimationFrame(c.resolve);
1009
1042
  }));
1010
1043
  break;
1011
1044
  case "expandPanel":
1012
- if (i.cannotExpandPanel(c))
1045
+ if (o.cannotExpandPanel(c))
1013
1046
  break;
1014
- i.shouldNotifyCollapseToggle(c) ? o.notifyCollapseToggle(c) : k(n, c.panelId).collapsed && (u("togglingCollapse"), a.abort(), Re(n, c, d, a).then((f) => {
1015
- o.onAnimationEnd(f), u("idle");
1047
+ o.shouldNotifyCollapseToggle(c) ? i.notifyCollapseToggle(c) : E(n, c.panelId).collapsed && (u("togglingCollapse"), a.abort(), ke(n, c, d, a).then((f) => {
1048
+ i.onAnimationEnd(f), u("idle"), c.resolve && requestAnimationFrame(c.resolve);
1016
1049
  }));
1017
1050
  break;
1018
1051
  }
1019
1052
  else if (r.current === "dragging")
1020
1053
  switch (c.type) {
1021
1054
  case "dragHandle":
1022
- o.clearLastKnownSize(), me(n, ie(n, c)), o.onResize();
1055
+ i.clearLastKnownSize(), se(n, oe(n, c)), i.onResize();
1023
1056
  break;
1024
1057
  case "dragHandleEnd":
1025
1058
  u("idle");
1026
1059
  break;
1027
1060
  case "expandPanel":
1028
1061
  case "collapsePanel":
1029
- i.shouldCollapseToggle(c) && o.runCollapseToggle(c);
1062
+ o.shouldCollapseToggle(c) && i.runCollapseToggle(c);
1030
1063
  break;
1031
1064
  }
1032
1065
  else if (r.current === "togglingCollapse")
1033
1066
  switch (c.type) {
1034
1067
  case "applyDelta":
1035
- me(n, ie(n, {
1068
+ se(n, oe(n, {
1069
+ panelId: c.panelId,
1036
1070
  handleId: c.handleId,
1071
+ type: "collapsePanel",
1037
1072
  disregardCollapseBuffer: !0,
1038
- value: he({
1073
+ value: we({
1039
1074
  delta: c.delta,
1040
1075
  orientation: n.orientation
1041
1076
  })
1042
- })), o.onResize();
1077
+ })), i.onResize();
1043
1078
  break;
1044
1079
  }
1045
1080
  t == null || t(n);
@@ -1047,7 +1082,7 @@ function St(e, t) {
1047
1082
  }
1048
1083
  return [n, d, r];
1049
1084
  }
1050
- function Ct({ groupId: e, id: t, collapsible: a, collapsed: r }) {
1085
+ function At({ groupId: e, id: t, collapsible: a, collapsed: r }) {
1051
1086
  const l = {
1052
1087
  id: t,
1053
1088
  "data-splitter-group-id": e,
@@ -1056,7 +1091,7 @@ function Ct({ groupId: e, id: t, collapsible: a, collapsed: r }) {
1056
1091
  };
1057
1092
  return a && (l["data-collapsed"] = r), l;
1058
1093
  }
1059
- function At({ groupId: e, id: t, orientation: a, isDragging: r, activeDragHandleId: l, disabled: n, controlsId: o, min: i, max: u, currentValue: d, groupSize: c }) {
1094
+ function xt({ groupId: e, id: t, orientation: a, isDragging: r, activeDragHandleId: l, disabled: n, controlsId: i, min: o, max: u, currentValue: d, groupSize: c }) {
1060
1095
  return {
1061
1096
  id: t,
1062
1097
  role: "separator",
@@ -1067,17 +1102,17 @@ function At({ groupId: e, id: t, orientation: a, isDragging: r, activeDragHandle
1067
1102
  "data-state": r ? "dragging" : l ? "inactive" : "idle",
1068
1103
  "aria-label": "Resize Handle",
1069
1104
  "aria-disabled": n,
1070
- "aria-controls": o,
1071
- "aria-valuemin": i ? X(c, i) : void 0,
1072
- "aria-valuemax": u === "1fr" ? 100 : u ? X(c, u) : void 0,
1073
- "aria-valuenow": d ? X(c, d) : void 0
1105
+ "aria-controls": i,
1106
+ "aria-valuemin": o ? Y(c, o) : void 0,
1107
+ "aria-valuemax": u === "1fr" ? 100 : u ? Y(c, u) : void 0,
1108
+ "aria-valuenow": d ? Y(c, d) : void 0
1074
1109
  };
1075
1110
  }
1076
- function xt(e, t) {
1111
+ function Vt(e, t) {
1077
1112
  const a = new ResizeObserver((l) => {
1078
1113
  const n = {};
1079
- for (const o of l) {
1080
- const u = o.target.getAttribute("data-splitter-id"), d = o.borderBoxSize[0];
1114
+ for (const i of l) {
1115
+ const u = i.target.getAttribute("data-splitter-id"), d = i.borderBoxSize[0];
1081
1116
  u && d && (n[u] = {
1082
1117
  width: d.inlineSize,
1083
1118
  height: d.blockSize
@@ -1091,9 +1126,9 @@ function xt(e, t) {
1091
1126
  a.disconnect();
1092
1127
  };
1093
1128
  }
1094
- function Vt(e) {
1095
- const { onMoveStart: t, onMove: a, onMoveEnd: r } = e, l = { didMove: !1, lastPosition: null, id: null }, n = (s, f, g, p) => {
1096
- g === 0 && p === 0 || (l.didMove || (l.didMove = !0, t == null || t({
1129
+ function Dt(e) {
1130
+ const { onMoveStart: t, onMove: a, onMoveEnd: r } = e, l = { didMove: !1, lastPosition: null, id: null }, n = (s, f, h, p) => {
1131
+ h === 0 && p === 0 || (l.didMove || (l.didMove = !0, t == null || t({
1097
1132
  type: "movestart",
1098
1133
  pointerType: f,
1099
1134
  shiftKey: s.shiftKey,
@@ -1103,14 +1138,14 @@ function Vt(e) {
1103
1138
  })), a == null || a({
1104
1139
  type: "move",
1105
1140
  pointerType: f,
1106
- deltaX: g,
1141
+ deltaX: h,
1107
1142
  deltaY: p,
1108
1143
  shiftKey: s.shiftKey,
1109
1144
  metaKey: s.metaKey,
1110
1145
  ctrlKey: s.ctrlKey,
1111
1146
  altKey: s.altKey
1112
1147
  }));
1113
- }, o = (s, f) => {
1148
+ }, i = (s, f) => {
1114
1149
  l.didMove && (r == null || r({
1115
1150
  type: "moveend",
1116
1151
  pointerType: f,
@@ -1119,27 +1154,27 @@ function Vt(e) {
1119
1154
  ctrlKey: s.ctrlKey,
1120
1155
  altKey: s.altKey
1121
1156
  }));
1122
- }, i = {}, u = () => {
1157
+ }, o = {}, u = () => {
1123
1158
  l.didMove = !1;
1124
1159
  }, d = (s) => {
1125
- var f, g;
1160
+ var f, h;
1126
1161
  if (s.pointerId === l.id) {
1127
1162
  const p = s.pointerType || "mouse";
1128
- n(s, p, s.pageX - (((f = l.lastPosition) == null ? void 0 : f.pageX) ?? 0), s.pageY - (((g = l.lastPosition) == null ? void 0 : g.pageY) ?? 0)), l.lastPosition = { pageX: s.pageX, pageY: s.pageY };
1163
+ n(s, p, s.pageX - (((f = l.lastPosition) == null ? void 0 : f.pageX) ?? 0), s.pageY - (((h = l.lastPosition) == null ? void 0 : h.pageY) ?? 0)), l.lastPosition = { pageX: s.pageX, pageY: s.pageY };
1129
1164
  }
1130
1165
  }, c = (s) => {
1131
1166
  if (s.pointerId === l.id) {
1132
1167
  const f = s.pointerType || "mouse";
1133
- o(s, f), l.id = null, window.removeEventListener("pointermove", d, !1), window.removeEventListener("pointerup", c, !1), window.removeEventListener("pointercancel", c, !1);
1168
+ i(s, f), l.id = null, window.removeEventListener("pointermove", d, !1), window.removeEventListener("pointerup", c, !1), window.removeEventListener("pointercancel", c, !1);
1134
1169
  }
1135
1170
  };
1136
- i.onPointerDown = (s) => {
1171
+ o.onPointerDown = (s) => {
1137
1172
  s.button === 0 && l.id == null && (u(), s.stopPropagation(), s.preventDefault(), l.lastPosition = { pageX: s.pageX, pageY: s.pageY }, l.id = s.pointerId, window.addEventListener("pointermove", d, !1), window.addEventListener("pointerup", c, !1), window.addEventListener("pointercancel", c, !1));
1138
1173
  };
1139
- const m = (s, f, g) => {
1140
- u(), n(s, "keyboard", f, g), o(s, "keyboard");
1174
+ const m = (s, f, h) => {
1175
+ u(), n(s, "keyboard", f, h), i(s, "keyboard");
1141
1176
  };
1142
- return i.onKeyDown = (s) => {
1177
+ return o.onKeyDown = (s) => {
1143
1178
  switch (s.key) {
1144
1179
  case "Left":
1145
1180
  case "ArrowLeft":
@@ -1158,9 +1193,9 @@ function Vt(e) {
1158
1193
  s.preventDefault(), s.stopPropagation(), m(s, 0, 1);
1159
1194
  break;
1160
1195
  }
1161
- }, { moveProps: i };
1196
+ }, { moveProps: o };
1162
1197
  }
1163
- const Et = /* @__PURE__ */ ze({
1198
+ const Et = /* @__PURE__ */ be({
1164
1199
  __name: "Panel",
1165
1200
  props: {
1166
1201
  onResize: {},
@@ -1181,17 +1216,17 @@ const Et = /* @__PURE__ */ ze({
1181
1216
  min: r,
1182
1217
  max: l,
1183
1218
  id: n,
1184
- collapsible: o,
1185
- collapsedSize: i,
1219
+ collapsible: i,
1220
+ collapsedSize: o,
1186
1221
  onCollapseChange: u,
1187
1222
  collapseAnimation: d,
1188
1223
  onResize: c,
1189
1224
  defaultCollapsed: m,
1190
1225
  default: s,
1191
1226
  isStaticAtRest: f,
1192
- collapsed: g,
1227
+ collapsed: h,
1193
1228
  ...p
1194
- } = a, v = n || be(), h = G("send"), z = G("state"), I = G("isPrerender"), C = () => ct({
1229
+ } = a, v = n || Ie(), g = X("send"), z = X("state"), S = X("isPrerender"), x = () => dt({
1195
1230
  id: v,
1196
1231
  min: a.min,
1197
1232
  max: a.max,
@@ -1204,81 +1239,87 @@ const Et = /* @__PURE__ */ ze({
1204
1239
  defaultCollapsed: m,
1205
1240
  default: s,
1206
1241
  isStaticAtRest: f
1207
- }), x = N(() => {
1208
- var A;
1209
- const w = (A = z == null ? void 0 : z.value) == null ? void 0 : A.items.find((U) => U.id === v);
1210
- if (!(!w || !P(w)))
1242
+ }), C = $(() => {
1243
+ var P;
1244
+ const w = (P = z == null ? void 0 : z.value) == null ? void 0 : P.items.find((U) => U.id === v);
1245
+ if (!(!w || !y(w)))
1211
1246
  return w;
1212
1247
  });
1213
- let E = !1;
1214
- x.value ? h == null || h({
1248
+ let R = !1;
1249
+ C.value ? g == null || g({
1215
1250
  type: "rebindPanelCallbacks",
1216
1251
  data: {
1217
1252
  id: v,
1218
1253
  onCollapseChange: a.onCollapseChange ? { current: a.onCollapseChange } : void 0,
1219
1254
  onResize: a.onResize ? { current: a.onResize } : void 0
1220
1255
  }
1221
- }) : I != null && I.value ? h == null || h({ type: "registerPanel", data: C() }) : E = !0, W(() => {
1256
+ }) : S != null && S.value ? g == null || g({ type: "registerPanel", data: x() }) : R = !0, G(() => {
1222
1257
  var le;
1223
1258
  const w = (le = z == null ? void 0 : z.value) == null ? void 0 : le.groupId;
1224
- if (!w || !E) return;
1225
- const A = document.getElementById(w);
1226
- if (!A) return;
1259
+ if (!w || !R) return;
1260
+ const P = document.getElementById(w);
1261
+ if (!P) return;
1227
1262
  const U = document.getElementById(v);
1228
1263
  if (!U) return;
1229
- const re = Array.from(A.children).indexOf(U);
1230
- typeof re == "number" && (h == null || h({
1264
+ const re = Array.from(P.children).indexOf(U);
1265
+ typeof re == "number" && (g == null || g({
1231
1266
  type: "registerDynamicPanel",
1232
- data: { ...C(), order: re }
1233
- }), E = !1);
1267
+ data: { ...x(), order: re }
1268
+ }), R = !1);
1234
1269
  });
1235
- const L = N(
1236
- () => !E && dt(C(), x.value)
1270
+ const K = $(
1271
+ () => !R && ft(x(), C.value)
1237
1272
  );
1238
- se(() => {
1239
- L.value && (h == null || h({ type: "updateConstraints", data: C() }));
1240
- }), De(() => {
1241
- requestAnimationFrame(() => h == null ? void 0 : h({ type: "unregisterPanel", id: v }));
1273
+ ue(() => {
1274
+ K.value && (g == null || g({ type: "updateConstraints", data: x() }));
1275
+ }), Be(() => {
1276
+ requestAnimationFrame(() => g == null ? void 0 : g({ type: "unregisterPanel", id: v }));
1242
1277
  }), t({
1243
1278
  getId: () => v,
1244
- collapse: () => {
1279
+ collapse: async () => {
1245
1280
  var w;
1246
- (w = x.value) != null && w.collapsible && (h == null || h({ type: "collapsePanel", panelId: v, controlled: !0 }));
1281
+ if ((w = C.value) != null && w.collapsible)
1282
+ return await new Promise((P) => {
1283
+ g == null || g({ type: "collapsePanel", panelId: v, controlled: !0, resolve: P });
1284
+ });
1247
1285
  },
1248
1286
  isCollapsed: () => {
1249
- var w, A;
1250
- return !!((w = x.value) != null && w.collapsible && ((A = x.value) != null && A.collapsed));
1287
+ var w, P;
1288
+ return !!((w = C.value) != null && w.collapsible && ((P = C.value) != null && P.collapsed));
1251
1289
  },
1252
- expand: () => {
1290
+ expand: async () => {
1253
1291
  var w;
1254
- (w = x.value) != null && w.collapsible && (h == null || h({ type: "expandPanel", panelId: v, controlled: !0 }));
1292
+ if ((w = C.value) != null && w.collapsible)
1293
+ return await new Promise((P) => {
1294
+ g == null || g({ type: "expandPanel", panelId: v, controlled: !0, resolve: P });
1295
+ });
1255
1296
  },
1256
1297
  isExpanded: () => {
1257
- var w, A;
1258
- return !!((w = x.value) != null && w.collapsible && !((A = x.value) != null && A.collapsed));
1298
+ var w, P;
1299
+ return !!((w = C.value) != null && w.collapsible && !((P = C.value) != null && P.collapsed));
1259
1300
  },
1260
- getPixelSize: () => wt(z.value, v),
1261
- getPercentageSize: () => bt(z.value, v),
1262
- setSize: (w) => h == null ? void 0 : h({ type: "setPanelPixelSize", panelId: v, size: w })
1301
+ getPixelSize: () => zt(z.value, v),
1302
+ getPercentageSize: () => It(z.value, v),
1303
+ setSize: (w) => g == null ? void 0 : g({ type: "setPanelPixelSize", panelId: v, size: w })
1263
1304
  });
1264
- const M = N(
1305
+ const M = $(
1265
1306
  () => {
1266
1307
  var w;
1267
- return (w = x.value) == null ? void 0 : w.collapseIsControlled;
1308
+ return (w = C.value) == null ? void 0 : w.collapseIsControlled;
1268
1309
  }
1269
1310
  );
1270
- se(() => {
1311
+ ue(() => {
1271
1312
  a.collapsed, requestAnimationFrame(() => {
1272
- M.value && (a.collapsed ? h == null || h({ type: "collapsePanel", panelId: v, controlled: !0 }) : h == null || h({ type: "expandPanel", panelId: v, controlled: !0 }));
1313
+ M.value && (a.collapsed ? g == null || g({ type: "collapsePanel", panelId: v, controlled: !0 }) : g == null || g({ type: "expandPanel", panelId: v, controlled: !0 }));
1273
1314
  });
1274
1315
  });
1275
- const R = N(() => {
1276
- var A;
1277
- const w = x.value;
1316
+ const V = $(() => {
1317
+ var P;
1318
+ const w = C.value;
1278
1319
  return {
1279
1320
  ...p,
1280
- ...Ct({
1281
- groupId: (A = z == null ? void 0 : z.value) == null ? void 0 : A.groupId,
1321
+ ...At({
1322
+ groupId: (P = z == null ? void 0 : z.value) == null ? void 0 : P.groupId,
1282
1323
  id: v,
1283
1324
  collapsible: w == null ? void 0 : w.collapsible,
1284
1325
  collapsed: w == null ? void 0 : w.collapsed
@@ -1290,11 +1331,11 @@ const Et = /* @__PURE__ */ ze({
1290
1331
  }
1291
1332
  };
1292
1333
  });
1293
- return (w, A) => (Ie(), ye("div", Te(Fe(R.value)), [
1294
- Pe(w.$slots, "default")
1334
+ return (w, P) => (Pe(), ye("div", Te(je(V.value)), [
1335
+ Se(w.$slots, "default")
1295
1336
  ], 16));
1296
1337
  }
1297
- }), Rt = ["id"], Bt = /* @__PURE__ */ ze({
1338
+ }), Rt = ["id"], Kt = /* @__PURE__ */ be({
1298
1339
  __name: "PanelGroup",
1299
1340
  props: {
1300
1341
  snapshot: {},
@@ -1305,31 +1346,31 @@ const Et = /* @__PURE__ */ ze({
1305
1346
  id: {}
1306
1347
  },
1307
1348
  setup(e, { expose: t }) {
1308
- const a = ke(e, ["orientation", "autosaveStrategy", "snapshot", "autosaveId", "id", "shiftAmount"]);
1349
+ const a = Ee(e, ["orientation", "autosaveStrategy", "snapshot", "autosaveId", "id", "shiftAmount"]);
1309
1350
  let r = e.snapshot;
1310
1351
  if (!r && typeof window < "u" && e.autosaveId && e.autosaveStrategy === "localStorage") {
1311
1352
  const f = localStorage.getItem(e.autosaveId);
1312
1353
  f && (r = JSON.parse(f));
1313
1354
  }
1314
- const l = de(!0);
1315
- oe("isPrerender", l);
1316
- const n = e.autosaveId || e.id || be(), [o, i, u] = St(
1355
+ const l = me(!0);
1356
+ ie("isPrerender", l);
1357
+ const n = e.autosaveId || e.id || Ie(), [i, o, u] = Ct(
1317
1358
  {
1318
1359
  orientation: e.orientation,
1319
1360
  groupId: n,
1320
1361
  autosaveStrategy: e.autosaveStrategy,
1321
1362
  shiftAmount: e.shiftAmount,
1322
- ...r ? ut(r) : void 0
1363
+ ...r ? ct(r) : void 0
1323
1364
  },
1324
1365
  (f) => {
1325
1366
  d.value = { ...f };
1326
1367
  }
1327
1368
  );
1328
- W(() => {
1369
+ G(() => {
1329
1370
  l.value = !1;
1330
1371
  });
1331
- const d = de(o), c = N(() => {
1332
- const f = xe(d.value);
1372
+ const d = me(i), c = $(() => {
1373
+ const f = De(d.value);
1333
1374
  return {
1334
1375
  height: "100%",
1335
1376
  display: "grid",
@@ -1337,59 +1378,59 @@ const Et = /* @__PURE__ */ ze({
1337
1378
  gridTemplateRows: e.orientation === "vertical" ? f : void 0
1338
1379
  };
1339
1380
  });
1340
- oe("send", i), oe("state", d), oe("id", u);
1341
- const m = de(null);
1342
- W(() => {
1343
- const f = new ResizeObserver(([g]) => {
1344
- g && g.contentRect.width > 0 && g.contentRect.height > 0 && (i == null || i({ type: "setSize", size: g.contentRect }));
1381
+ ie("send", o), ie("state", d), ie("id", u);
1382
+ const m = me(null);
1383
+ G(() => {
1384
+ const f = new ResizeObserver(([h]) => {
1385
+ h && h.contentRect.width > 0 && h.contentRect.height > 0 && (o == null || o({ type: "setSize", size: h.contentRect }));
1345
1386
  });
1346
1387
  return m.value && f.observe(m.value), () => f.disconnect();
1347
1388
  });
1348
- const s = N(
1389
+ const s = $(
1349
1390
  () => {
1350
1391
  var f;
1351
- return (f = d.value) == null ? void 0 : f.items.map((g) => g.id).join(",");
1392
+ return (f = d.value) == null ? void 0 : f.items.map((h) => h.id).join(",");
1352
1393
  }
1353
1394
  );
1354
- return W(() => {
1355
- se(() => {
1395
+ return G(() => {
1396
+ ue(() => {
1356
1397
  s.value;
1357
- const f = xt(n, (g) => {
1358
- i({ type: "setActualItemsSize", childrenSizes: g });
1398
+ const f = Vt(n, (h) => {
1399
+ o({ type: "setActualItemsSize", childrenSizes: h });
1359
1400
  });
1360
- je(f);
1401
+ We(f);
1361
1402
  });
1362
- }), W(() => (i({ type: "unlockGroup" }), () => i({ type: "lockGroup" }))), t({
1403
+ }), G(() => (o({ type: "unlockGroup" }), () => o({ type: "lockGroup" }))), t({
1363
1404
  getId: () => n,
1364
- getPixelSizes: () => vt(d.value),
1365
- getPercentageSizes: () => zt(d.value),
1366
- getTemplate: () => xe({
1405
+ getPixelSizes: () => wt(d.value),
1406
+ getPercentageSizes: () => bt(d.value),
1407
+ getTemplate: () => De({
1367
1408
  ...d.value,
1368
1409
  items: O(d.value)
1369
1410
  }),
1370
1411
  getState: () => u.current === "idle" ? "idle" : "dragging",
1371
1412
  setSizes: (f) => {
1372
- var g;
1413
+ var h;
1373
1414
  for (let p = 0; p < f.length; p++) {
1374
- const v = (g = d.value) == null ? void 0 : g.items[p], h = f[p];
1375
- v && P(v) && h && i({
1415
+ const v = (h = d.value) == null ? void 0 : h.items[p], g = f[p];
1416
+ v && y(v) && g && o({
1376
1417
  type: "setPanelPixelSize",
1377
1418
  panelId: v.id,
1378
- size: h
1419
+ size: g
1379
1420
  });
1380
1421
  }
1381
1422
  }
1382
- }), (f, g) => (Ie(), ye("div", Ee(a, {
1423
+ }), (f, h) => (Pe(), ye("div", Ke(a, {
1383
1424
  id: Ue(n),
1384
1425
  ref_key: "elementRef",
1385
1426
  ref: m,
1386
1427
  "data-panel-group-wrapper": "",
1387
1428
  style: c.value
1388
1429
  }), [
1389
- Pe(f.$slots, "default")
1430
+ Se(f.$slots, "default")
1390
1431
  ], 16, Rt));
1391
1432
  }
1392
- }), Dt = ["tabindex"], Kt = /* @__PURE__ */ ze({
1433
+ }), kt = ["tabindex"], Nt = /* @__PURE__ */ be({
1393
1434
  __name: "PanelResizer",
1394
1435
  props: {
1395
1436
  disabled: { type: Boolean },
@@ -1401,95 +1442,95 @@ const Et = /* @__PURE__ */ ze({
1401
1442
  id: {}
1402
1443
  },
1403
1444
  setup(e) {
1404
- const t = ke(e, ["size", "id", "onDragStart", "onDrag", "onDragEnd", "disabled"]), r = e.id || be(), l = G("send"), n = G("state"), o = G("isPrerender"), i = () => pt({ size: e.size, id: r }), u = N(() => {
1445
+ const t = Ee(e, ["size", "id", "onDragStart", "onDrag", "onDragEnd", "disabled"]), r = e.id || Ie(), l = X("send"), n = X("state"), i = X("isPrerender"), o = () => mt({ size: e.size, id: r }), u = $(() => {
1405
1446
  var p;
1406
- const g = (p = n == null ? void 0 : n.value) == null ? void 0 : p.items.find((v) => v.id === r);
1407
- if (!(!g || !$(g)))
1408
- return g;
1447
+ const h = (p = n == null ? void 0 : n.value) == null ? void 0 : p.items.find((v) => v.id === r);
1448
+ if (!(!h || !k(h)))
1449
+ return h;
1409
1450
  });
1410
1451
  let d = !1;
1411
- u.value || (o != null && o.value ? l == null || l({ type: "registerPanelHandle", data: i() }) : d = !0), W(() => {
1412
- var z, I;
1452
+ u.value || (i != null && i.value ? l == null || l({ type: "registerPanelHandle", data: o() }) : d = !0), G(() => {
1453
+ var z, S;
1413
1454
  if (!((z = n == null ? void 0 : n.value) == null ? void 0 : z.groupId) || !d) return;
1414
- const p = document.getElementById((I = n == null ? void 0 : n.value) == null ? void 0 : I.groupId);
1455
+ const p = document.getElementById((S = n == null ? void 0 : n.value) == null ? void 0 : S.groupId);
1415
1456
  if (!p) return;
1416
1457
  const v = document.getElementById(r);
1417
1458
  if (!v) return;
1418
- const h = Array.from(p.children).indexOf(v);
1419
- typeof h == "number" && (l == null || l({
1459
+ const g = Array.from(p.children).indexOf(v);
1460
+ typeof g == "number" && (l == null || l({
1420
1461
  type: "registerPanelHandle",
1421
- data: { ...i(), order: h }
1462
+ data: { ...o(), order: g }
1422
1463
  }), d = !1);
1423
1464
  });
1424
- const c = N(
1425
- () => !d && ft(i(), u.value)
1465
+ const c = $(
1466
+ () => !d && pt(o(), u.value)
1426
1467
  );
1427
- se(() => {
1428
- c.value && (l == null || l({ type: "updateConstraints", data: i() }));
1429
- }), De(() => {
1468
+ ue(() => {
1469
+ c.value && (l == null || l({ type: "updateConstraints", data: o() }));
1470
+ }), Be(() => {
1430
1471
  requestAnimationFrame(() => l == null ? void 0 : l({ type: "unregisterPanelHandle", id: r }));
1431
1472
  });
1432
- const { moveProps: m } = Vt({
1473
+ const { moveProps: m } = Dt({
1433
1474
  onMoveStart: () => {
1434
- var g;
1435
- l == null || l({ type: "dragHandleStart", handleId: r }), (g = e.onDragStart) == null || g.call(e), n != null && n.value && (document.body.style.cursor = Ae(n == null ? void 0 : n.value) || "auto");
1475
+ var h;
1476
+ l == null || l({ type: "dragHandleStart", handleId: r }), (h = e.onDragStart) == null || h.call(e), n != null && n.value && (document.body.style.cursor = Ve(n == null ? void 0 : n.value) || "auto");
1436
1477
  },
1437
- onMove: (g) => {
1478
+ onMove: (h) => {
1438
1479
  var p;
1439
- l == null || l({ type: "dragHandle", handleId: r, value: g }), (p = e.onDrag) == null || p.call(e);
1480
+ l == null || l({ type: "dragHandle", handleId: r, value: h }), (p = e.onDrag) == null || p.call(e);
1440
1481
  },
1441
1482
  onMoveEnd: () => {
1442
- var g;
1443
- l == null || l({ type: "dragHandleEnd", handleId: r }), (g = e.onDragEnd) == null || g.call(e), document.body.style.cursor = "auto";
1483
+ var h;
1484
+ l == null || l({ type: "dragHandleEnd", handleId: r }), (h = e.onDragEnd) == null || h.call(e), document.body.style.cursor = "auto";
1444
1485
  }
1445
- }), s = (g) => {
1486
+ }), s = (h) => {
1446
1487
  if (n != null && n.value)
1447
1488
  try {
1448
- const p = mt(n == null ? void 0 : n.value, r);
1449
- g.key === "Enter" && p && (p.collapsed ? l == null || l({ type: "expandPanel", panelId: p.id }) : l == null || l({ type: "collapsePanel", panelId: p.id }));
1489
+ const p = ht(n == null ? void 0 : n.value, r);
1490
+ h.key === "Enter" && p && (p.collapsed ? l == null || l({ type: "expandPanel", panelId: p.id }) : l == null || l({ type: "collapsePanel", panelId: p.id }));
1450
1491
  } catch {
1451
1492
  }
1452
- }, f = N(() => {
1453
- var h, z, I, C, x, E, L, M, R;
1454
- const g = (h = n == null ? void 0 : n.value) == null ? void 0 : h.items.findIndex((w) => w.id === r);
1455
- if (!g) return { id: r };
1456
- const p = (z = n == null ? void 0 : n.value) == null ? void 0 : z.items[g], v = (I = n == null ? void 0 : n.value) == null ? void 0 : I.items[g - 1];
1457
- return !v || !P(v) ? { id: r } : {
1493
+ }, f = $(() => {
1494
+ var g, z, S, x, C, R, K, M, V;
1495
+ const h = (g = n == null ? void 0 : n.value) == null ? void 0 : g.items.findIndex((w) => w.id === r);
1496
+ if (!h) return { id: r };
1497
+ const p = (z = n == null ? void 0 : n.value) == null ? void 0 : z.items[h], v = (S = n == null ? void 0 : n.value) == null ? void 0 : S.items[h - 1];
1498
+ return !v || !y(v) ? { id: r } : {
1458
1499
  ...t,
1459
- ...At({
1460
- groupId: (C = n == null ? void 0 : n.value) == null ? void 0 : C.groupId,
1500
+ ...xt({
1501
+ groupId: (x = n == null ? void 0 : n.value) == null ? void 0 : x.groupId,
1461
1502
  id: r,
1462
- orientation: ((x = n == null ? void 0 : n.value) == null ? void 0 : x.orientation) || "horizontal",
1463
- isDragging: ((E = n == null ? void 0 : n.value) == null ? void 0 : E.activeDragHandleId) === r,
1464
- activeDragHandleId: (L = n == null ? void 0 : n.value) == null ? void 0 : L.activeDragHandleId,
1503
+ orientation: ((C = n == null ? void 0 : n.value) == null ? void 0 : C.orientation) || "horizontal",
1504
+ isDragging: ((R = n == null ? void 0 : n.value) == null ? void 0 : R.activeDragHandleId) === r,
1505
+ activeDragHandleId: (K = n == null ? void 0 : n.value) == null ? void 0 : K.activeDragHandleId,
1465
1506
  disabled: e.disabled,
1466
1507
  controlsId: v.id,
1467
1508
  min: v.min,
1468
1509
  max: v.max,
1469
1510
  currentValue: v.currentValue,
1470
- groupSize: V(n.value)
1511
+ groupSize: D(n.value)
1471
1512
  }),
1472
1513
  onpointerdown: e.disabled ? void 0 : m.onPointerDown,
1473
1514
  onkeydown: e.disabled ? void 0 : (w) => {
1474
1515
  m.onKeyDown(w), s(w);
1475
1516
  },
1476
1517
  style: {
1477
- cursor: n != null && n.value ? Ae(n.value) : void 0,
1518
+ cursor: n != null && n.value ? Ve(n.value) : void 0,
1478
1519
  width: ((M = n == null ? void 0 : n.value) == null ? void 0 : M.orientation) === "horizontal" ? `${p == null ? void 0 : p.size.value.toNumber()}px` : "100%",
1479
- height: ((R = n == null ? void 0 : n.value) == null ? void 0 : R.orientation) === "vertical" ? `${p == null ? void 0 : p.size.value.toNumber()}px` : "100%"
1520
+ height: ((V = n == null ? void 0 : n.value) == null ? void 0 : V.orientation) === "vertical" ? `${p == null ? void 0 : p.size.value.toNumber()}px` : "100%"
1480
1521
  }
1481
1522
  };
1482
1523
  });
1483
- return (g, p) => (Ie(), ye("div", Ee(f.value, {
1484
- tabindex: g.disabled ? -1 : 0
1524
+ return (h, p) => (Pe(), ye("div", Ke(f.value, {
1525
+ tabindex: h.disabled ? -1 : 0
1485
1526
  }), [
1486
- Pe(g.$slots, "default")
1487
- ], 16, Dt));
1527
+ Se(h.$slots, "default")
1528
+ ], 16, kt));
1488
1529
  }
1489
1530
  });
1490
1531
  export {
1491
1532
  Et as Panel,
1492
- Bt as PanelGroup,
1493
- Kt as PanelResizer
1533
+ Kt as PanelGroup,
1534
+ Nt as PanelResizer
1494
1535
  };
1495
1536
  //# sourceMappingURL=index.mjs.map