react-semaphor 0.1.535 → 0.1.537

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,17 +1,17 @@
1
- import { jsxs as De, jsx as _, Fragment as dt } from "react/jsx-runtime";
1
+ import { jsxs as De, jsx as _, Fragment as ft } from "react/jsx-runtime";
2
2
  import * as k from "react";
3
- import Sn, { forwardRef as $e, createElement as be, useContext as xt, createContext as xn, useRef as B, useLayoutEffect as bn, useImperativeHandle as bt, useEffect as Z, useState as ue, useCallback as O, useMemo as U, memo as zn, Suspense as Pn } from "react";
4
- import { aF as wn, aG as zt, aH as nt, aI as Pt, aJ as Cn, aK as En, aL as In, aM as Rn, aN as Dn, aO as An, aP as Mn, aQ as Ln, aR as Nn, aS as _n, aT as kn, aU as Tn } from "./semaphor-ready-indicator-B017OW6t.js";
5
- import { a1 as te, a2 as wt, C as Ct, ax as Hn, c as rt, ay as $n, u as Oe, az as Et, aA as ze, aB as pe, aC as Vn, aD as Fn, aE as Kn, aF as Pe, aG as Bn, aH as It, aI as qn, aJ as Gn } from "./switch-ojmMsFMO.js";
6
- import { f as On, r as Rt } from "./use-create-flow-overlay-state-BbwQ0gpQ.js";
7
- import { f as Un, r as Dt, g as At, a as Qe, b as _e, n as Wn, c as Xn } from "./index-P5aUuGF1.js";
3
+ import bn, { forwardRef as Ve, createElement as be, useContext as nt, createContext as bt, useRef as B, useLayoutEffect as zn, useImperativeHandle as zt, useEffect as Z, useState as ue, useCallback as O, useMemo as U, memo as Pn, Suspense as wn, useSyncExternalStore as Cn } from "react";
4
+ import { aF as En, aG as Pt, aH as rt, aI as wt, aJ as In, aK as Rn, aL as Dn, aM as An, aN as Mn, aO as Nn, aP as Ln, aQ as _n, aR as kn, aS as Tn, aT as Hn, aU as Vn, aV as $n } from "./semaphor-ready-indicator-CHu1L-lo.js";
5
+ import { a1 as te, a2 as Ct, C as Et, ax as Fn, c as ot, ay as Kn, u as Ge, az as It, aA as ze, aB as pe, aC as Bn, aD as qn, aE as On, aF as Pe, aG as Gn, aH as Rt, aI as Un, aJ as Wn } from "./switch-DO8a0EfJ.js";
6
+ import { f as Xn, r as Dt } from "./use-create-flow-overlay-state-Bj63WwHc.js";
7
+ import { f as Yn, r as At, g as Mt, a as Qe, b as _e, n as jn, c as Qn } from "./index-DTcTAGGM.js";
8
8
  import "./x-CXDkqdur.js";
9
9
  import "./validators-DMSH81OM.js";
10
10
  import "./matrix-operation-contract-BKupLHXL.js";
11
11
  import "zod";
12
12
  import "../value-format-preferences/index.js";
13
- import { u as Yn } from "./appearance-context-DEYtWinQ.js";
14
- const fo = Sn.memo(function({
13
+ import { u as Jn } from "./appearance-context-DEYtWinQ.js";
14
+ const yo = bn.memo(function({
15
15
  context: t = "editor"
16
16
  } = {}) {
17
17
  return /* @__PURE__ */ De(
@@ -21,13 +21,13 @@ const fo = Sn.memo(function({
21
21
  className: "flex h-full grow flex-col items-center overflow-hidden",
22
22
  children: [
23
23
  " ",
24
- /* @__PURE__ */ _(wn, { context: t }),
24
+ /* @__PURE__ */ _(En, { context: t }),
25
25
  " "
26
26
  ]
27
27
  }
28
28
  );
29
- }), Ve = xn(null);
30
- Ve.displayName = "PanelGroupContext";
29
+ }), $e = bt(null);
30
+ $e.displayName = "PanelGroupContext";
31
31
  const K = {
32
32
  group: "data-panel-group",
33
33
  groupDirection: "data-panel-group-direction",
@@ -41,13 +41,13 @@ const K = {
41
41
  resizeHandleEnabled: "data-panel-resize-handle-enabled",
42
42
  resizeHandleId: "data-panel-resize-handle-id",
43
43
  resizeHandleState: "data-resize-handle-state"
44
- }, ot = 10, me = bn, ft = k.useId, jn = typeof ft == "function" ? ft : () => null;
45
- let Qn = 0;
46
- function it(e = null) {
47
- const t = jn(), n = B(e || t || null);
48
- return n.current === null && (n.current = "" + Qn++), e ?? n.current;
44
+ }, it = 10, me = zn, pt = k.useId, Zn = typeof pt == "function" ? pt : () => null;
45
+ let er = 0;
46
+ function st(e = null) {
47
+ const t = Zn(), n = B(e || t || null);
48
+ return n.current === null && (n.current = "" + er++), e ?? n.current;
49
49
  }
50
- function Mt({
50
+ function Nt({
51
51
  children: e,
52
52
  className: t = "",
53
53
  collapsedSize: n,
@@ -55,8 +55,8 @@ function Mt({
55
55
  defaultSize: i,
56
56
  forwardedRef: o,
57
57
  id: s,
58
- maxSize: a,
59
- minSize: l,
58
+ maxSize: l,
59
+ minSize: a,
60
60
  onCollapse: f,
61
61
  onExpand: p,
62
62
  onResize: u,
@@ -65,7 +65,7 @@ function Mt({
65
65
  tagName: m = "div",
66
66
  ...y
67
67
  }) {
68
- const S = xt(Ve);
68
+ const S = nt($e);
69
69
  if (S === null)
70
70
  throw Error("Panel components must be rendered within a PanelGroup container");
71
71
  const {
@@ -78,8 +78,8 @@ function Mt({
78
78
  reevaluatePanelConstraints: w,
79
79
  registerPanel: X,
80
80
  resizePanel: j,
81
- unregisterPanel: $
82
- } = S, A = it(s), L = B({
81
+ unregisterPanel: V
82
+ } = S, A = st(s), N = B({
83
83
  callbacks: {
84
84
  onCollapse: f,
85
85
  onExpand: p,
@@ -89,8 +89,8 @@ function Mt({
89
89
  collapsedSize: n,
90
90
  collapsible: r,
91
91
  defaultSize: i,
92
- maxSize: a,
93
- minSize: l
92
+ maxSize: l,
93
+ minSize: a
94
94
  },
95
95
  id: A,
96
96
  idIsFromProps: s !== void 0,
@@ -100,41 +100,41 @@ function Mt({
100
100
  didLogMissingDefaultSizeWarning: !1
101
101
  }), me(() => {
102
102
  const {
103
- callbacks: V,
103
+ callbacks: $,
104
104
  constraints: T
105
- } = L.current, H = {
105
+ } = N.current, H = {
106
106
  ...T
107
107
  };
108
- L.current.id = A, L.current.idIsFromProps = s !== void 0, L.current.order = c, V.onCollapse = f, V.onExpand = p, V.onResize = u, T.collapsedSize = n, T.collapsible = r, T.defaultSize = i, T.maxSize = a, T.minSize = l, (H.collapsedSize !== T.collapsedSize || H.collapsible !== T.collapsible || H.maxSize !== T.maxSize || H.minSize !== T.minSize) && w(L.current, H);
108
+ N.current.id = A, N.current.idIsFromProps = s !== void 0, N.current.order = c, $.onCollapse = f, $.onExpand = p, $.onResize = u, T.collapsedSize = n, T.collapsible = r, T.defaultSize = i, T.maxSize = l, T.minSize = a, (H.collapsedSize !== T.collapsedSize || H.collapsible !== T.collapsible || H.maxSize !== T.maxSize || H.minSize !== T.minSize) && w(N.current, H);
109
109
  }), me(() => {
110
- const V = L.current;
111
- return X(V), () => {
112
- $(V);
110
+ const $ = N.current;
111
+ return X($), () => {
112
+ V($);
113
113
  };
114
- }, [c, A, X, $]), bt(o, () => ({
114
+ }, [c, A, X, V]), zt(o, () => ({
115
115
  collapse: () => {
116
- v(L.current);
116
+ v(N.current);
117
117
  },
118
- expand: (V) => {
119
- D(L.current, V);
118
+ expand: ($) => {
119
+ D(N.current, $);
120
120
  },
121
121
  getId() {
122
122
  return A;
123
123
  },
124
124
  getSize() {
125
- return b(L.current);
125
+ return b(N.current);
126
126
  },
127
127
  isCollapsed() {
128
- return M(L.current);
128
+ return M(N.current);
129
129
  },
130
130
  isExpanded() {
131
- return !M(L.current);
131
+ return !M(N.current);
132
132
  },
133
- resize: (V) => {
134
- j(L.current, V);
133
+ resize: ($) => {
134
+ j(N.current, $);
135
135
  }
136
136
  }), [v, D, b, M, A, j]);
137
- const W = I(L.current, i);
137
+ const W = I(N.current, i);
138
138
  return be(m, {
139
139
  ...y,
140
140
  children: e,
@@ -152,16 +152,16 @@ function Mt({
152
152
  [K.panelSize]: parseFloat("" + W.flexGrow).toFixed(1)
153
153
  });
154
154
  }
155
- const Jn = $e((e, t) => be(Mt, {
155
+ const tr = Ve((e, t) => be(Nt, {
156
156
  ...e,
157
157
  forwardedRef: t
158
158
  }));
159
- Mt.displayName = "Panel";
160
- Jn.displayName = "forwardRef(Panel)";
159
+ Nt.displayName = "Panel";
160
+ tr.displayName = "forwardRef(Panel)";
161
161
  let Je = null, ke = -1, ce = null;
162
- function Zn(e, t) {
162
+ function nr(e, t) {
163
163
  if (t) {
164
- const n = (t & Tt) !== 0, r = (t & Ht) !== 0, i = (t & $t) !== 0, o = (t & Vt) !== 0;
164
+ const n = (t & Ht) !== 0, r = (t & Vt) !== 0, i = (t & $t) !== 0, o = (t & Ft) !== 0;
165
165
  if (n)
166
166
  return i ? "se-resize" : o ? "ne-resize" : "e-resize";
167
167
  if (r)
@@ -180,12 +180,12 @@ function Zn(e, t) {
180
180
  return "ns-resize";
181
181
  }
182
182
  }
183
- function er() {
183
+ function rr() {
184
184
  ce !== null && (document.head.removeChild(ce), Je = null, ce = null, ke = -1);
185
185
  }
186
186
  function Ue(e, t) {
187
187
  var n, r;
188
- const i = Zn(e, t);
188
+ const i = nr(e, t);
189
189
  if (Je !== i) {
190
190
  if (Je = i, ce === null && (ce = document.createElement("style"), document.head.appendChild(ce)), ke >= 0) {
191
191
  var o;
@@ -197,20 +197,20 @@ function Ue(e, t) {
197
197
  function Lt(e) {
198
198
  return e.type === "keydown";
199
199
  }
200
- function Nt(e) {
200
+ function _t(e) {
201
201
  return e.type.startsWith("pointer");
202
202
  }
203
- function _t(e) {
203
+ function kt(e) {
204
204
  return e.type.startsWith("mouse");
205
205
  }
206
206
  function Fe(e) {
207
- if (Nt(e)) {
207
+ if (_t(e)) {
208
208
  if (e.isPrimary)
209
209
  return {
210
210
  x: e.clientX,
211
211
  y: e.clientY
212
212
  };
213
- } else if (_t(e))
213
+ } else if (kt(e))
214
214
  return {
215
215
  x: e.clientX,
216
216
  y: e.clientY
@@ -220,109 +220,109 @@ function Fe(e) {
220
220
  y: 1 / 0
221
221
  };
222
222
  }
223
- function tr() {
223
+ function or() {
224
224
  if (typeof matchMedia == "function")
225
225
  return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
226
226
  }
227
- function nr(e, t, n) {
227
+ function ir(e, t, n) {
228
228
  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;
229
229
  }
230
- function rr(e, t) {
230
+ function sr(e, t) {
231
231
  if (e === t) throw new Error("Cannot compare node with itself");
232
232
  const n = {
233
- a: gt(e),
234
- b: gt(t)
233
+ a: ht(e),
234
+ b: ht(t)
235
235
  };
236
236
  let r;
237
237
  for (; n.a.at(-1) === n.b.at(-1); )
238
238
  e = n.a.pop(), t = n.b.pop(), r = e;
239
239
  E(r, "Stacking order can only be calculated for elements with a common ancestor");
240
240
  const i = {
241
- a: mt(pt(n.a)),
242
- b: mt(pt(n.b))
241
+ a: gt(mt(n.a)),
242
+ b: gt(mt(n.b))
243
243
  };
244
244
  if (i.a === i.b) {
245
245
  const o = r.childNodes, s = {
246
246
  a: n.a.at(-1),
247
247
  b: n.b.at(-1)
248
248
  };
249
- let a = o.length;
250
- for (; a--; ) {
251
- const l = o[a];
252
- if (l === s.a) return 1;
253
- if (l === s.b) return -1;
249
+ let l = o.length;
250
+ for (; l--; ) {
251
+ const a = o[l];
252
+ if (a === s.a) return 1;
253
+ if (a === s.b) return -1;
254
254
  }
255
255
  }
256
256
  return Math.sign(i.a - i.b);
257
257
  }
258
- const or = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
259
- function ir(e) {
258
+ const lr = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
259
+ function ar(e) {
260
260
  var t;
261
- const n = getComputedStyle((t = kt(e)) !== null && t !== void 0 ? t : e).display;
261
+ const n = getComputedStyle((t = Tt(e)) !== null && t !== void 0 ? t : e).display;
262
262
  return n === "flex" || n === "inline-flex";
263
263
  }
264
- function sr(e) {
264
+ function cr(e) {
265
265
  const t = getComputedStyle(e);
266
- return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || ir(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" || or.test(t.willChange) || t.webkitOverflowScrolling === "touch");
266
+ return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || ar(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" || lr.test(t.willChange) || t.webkitOverflowScrolling === "touch");
267
267
  }
268
- function pt(e) {
268
+ function mt(e) {
269
269
  let t = e.length;
270
270
  for (; t--; ) {
271
271
  const n = e[t];
272
- if (E(n, "Missing node"), sr(n)) return n;
272
+ if (E(n, "Missing node"), cr(n)) return n;
273
273
  }
274
274
  return null;
275
275
  }
276
- function mt(e) {
276
+ function gt(e) {
277
277
  return e && Number(getComputedStyle(e).zIndex) || 0;
278
278
  }
279
- function gt(e) {
279
+ function ht(e) {
280
280
  const t = [];
281
281
  for (; e; )
282
- t.push(e), e = kt(e);
282
+ t.push(e), e = Tt(e);
283
283
  return t;
284
284
  }
285
- function kt(e) {
285
+ function Tt(e) {
286
286
  const {
287
287
  parentNode: t
288
288
  } = e;
289
289
  return t && t instanceof ShadowRoot ? t.host : t;
290
290
  }
291
- const Tt = 1, Ht = 2, $t = 4, Vt = 8, ar = tr() === "coarse";
291
+ const Ht = 1, Vt = 2, $t = 4, Ft = 8, ur = or() === "coarse";
292
292
  let ne = [], xe = !1, fe = /* @__PURE__ */ new Map(), Ke = /* @__PURE__ */ new Map();
293
293
  const Ae = /* @__PURE__ */ new Set();
294
- function lr(e, t, n, r, i) {
294
+ function dr(e, t, n, r, i) {
295
295
  var o;
296
296
  const {
297
297
  ownerDocument: s
298
- } = t, a = {
298
+ } = t, l = {
299
299
  direction: n,
300
300
  element: t,
301
301
  hitAreaMargins: r,
302
302
  setResizeHandlerState: i
303
- }, l = (o = fe.get(s)) !== null && o !== void 0 ? o : 0;
304
- return fe.set(s, l + 1), Ae.add(a), Te(), function() {
303
+ }, a = (o = fe.get(s)) !== null && o !== void 0 ? o : 0;
304
+ return fe.set(s, a + 1), Ae.add(l), Te(), function() {
305
305
  var p;
306
- Ke.delete(e), Ae.delete(a);
306
+ Ke.delete(e), Ae.delete(l);
307
307
  const u = (p = fe.get(s)) !== null && p !== void 0 ? p : 1;
308
- if (fe.set(s, u - 1), Te(), u === 1 && fe.delete(s), ne.includes(a)) {
309
- const c = ne.indexOf(a);
308
+ if (fe.set(s, u - 1), Te(), u === 1 && fe.delete(s), ne.includes(l)) {
309
+ const c = ne.indexOf(l);
310
310
  c >= 0 && ne.splice(c, 1), at(), i("up", !0, null);
311
311
  }
312
312
  };
313
313
  }
314
- function cr(e) {
314
+ function fr(e) {
315
315
  const {
316
316
  target: t
317
317
  } = e, {
318
318
  x: n,
319
319
  y: r
320
320
  } = Fe(e);
321
- xe = !0, st({
321
+ xe = !0, lt({
322
322
  target: t,
323
323
  x: n,
324
324
  y: r
325
- }), Te(), ne.length > 0 && (He("down", e), e.preventDefault(), Ft(t) || e.stopImmediatePropagation());
325
+ }), Te(), ne.length > 0 && (He("down", e), e.preventDefault(), Kt(t) || e.stopImmediatePropagation());
326
326
  }
327
327
  function We(e) {
328
328
  const {
@@ -333,7 +333,7 @@ function We(e) {
333
333
  const {
334
334
  target: r
335
335
  } = e;
336
- st({
336
+ lt({
337
337
  target: r,
338
338
  x: t,
339
339
  y: n
@@ -348,13 +348,13 @@ function Xe(e) {
348
348
  x: n,
349
349
  y: r
350
350
  } = Fe(e);
351
- Ke.clear(), xe = !1, ne.length > 0 && (e.preventDefault(), Ft(t) || e.stopImmediatePropagation()), He("up", e), st({
351
+ Ke.clear(), xe = !1, ne.length > 0 && (e.preventDefault(), Kt(t) || e.stopImmediatePropagation()), He("up", e), lt({
352
352
  target: t,
353
353
  x: n,
354
354
  y: r
355
355
  }), at(), Te();
356
356
  }
357
- function Ft(e) {
357
+ function Kt(e) {
358
358
  let t = e;
359
359
  for (; t; ) {
360
360
  if (t.hasAttribute(K.resizeHandle))
@@ -363,7 +363,7 @@ function Ft(e) {
363
363
  }
364
364
  return !1;
365
365
  }
366
- function st({
366
+ function lt({
367
367
  target: e,
368
368
  x: t,
369
369
  y: n
@@ -374,20 +374,20 @@ function st({
374
374
  const {
375
375
  element: o,
376
376
  hitAreaMargins: s
377
- } = i, a = o.getBoundingClientRect(), {
378
- bottom: l,
377
+ } = i, l = o.getBoundingClientRect(), {
378
+ bottom: a,
379
379
  left: f,
380
380
  right: p,
381
381
  top: u
382
- } = a, c = ar ? s.coarse : s.fine;
383
- if (t >= f - c && t <= p + c && n >= u - c && n <= l + c) {
382
+ } = l, c = ur ? s.coarse : s.fine;
383
+ if (t >= f - c && t <= p + c && n >= u - c && n <= a + c) {
384
384
  if (r !== null && document.contains(r) && o !== r && !o.contains(r) && !r.contains(o) && // Calculating stacking order has a cost, so we should avoid it if possible
385
385
  // That is why we only check potentially intersecting handles,
386
386
  // and why we skip if the event target is within the handle's DOM
387
- rr(r, o) > 0) {
387
+ sr(r, o) > 0) {
388
388
  let m = r, y = !1;
389
389
  for (; m && !m.contains(o); ) {
390
- if (nr(m.getBoundingClientRect(), a)) {
390
+ if (ir(m.getBoundingClientRect(), l)) {
391
391
  y = !0;
392
392
  break;
393
393
  }
@@ -414,7 +414,7 @@ function at() {
414
414
  let n = 0;
415
415
  Ke.forEach((r) => {
416
416
  n |= r;
417
- }), e && t ? Ue("intersection", n) : e ? Ue("horizontal", n) : t ? Ue("vertical", n) : er();
417
+ }), e && t ? Ue("intersection", n) : e ? Ue("horizontal", n) : t ? Ue("vertical", n) : rr();
418
418
  }
419
419
  let je = new AbortController();
420
420
  function Te() {
@@ -432,7 +432,7 @@ function Te() {
432
432
  const {
433
433
  body: r
434
434
  } = n;
435
- t > 0 && (r.addEventListener("pointerdown", cr, e), r.addEventListener("pointermove", We, e));
435
+ t > 0 && (r.addEventListener("pointerdown", fr, e), r.addEventListener("pointermove", We, e));
436
436
  }));
437
437
  }
438
438
  function He(e, t) {
@@ -443,7 +443,7 @@ function He(e, t) {
443
443
  r(e, i, t);
444
444
  });
445
445
  }
446
- function ur() {
446
+ function pr() {
447
447
  const [e, t] = ue(0);
448
448
  return O(() => t((n) => n + 1), []);
449
449
  }
@@ -451,16 +451,16 @@ function E(e, t) {
451
451
  if (!e)
452
452
  throw console.error(t), Error(t);
453
453
  }
454
- function ge(e, t, n = ot) {
454
+ function ge(e, t, n = it) {
455
455
  return e.toFixed(n) === t.toFixed(n) ? 0 : e > t ? 1 : -1;
456
456
  }
457
- function ae(e, t, n = ot) {
457
+ function le(e, t, n = it) {
458
458
  return ge(e, t, n) === 0;
459
459
  }
460
460
  function J(e, t, n) {
461
461
  return ge(e, t, n) === 0;
462
462
  }
463
- function dr(e, t, n) {
463
+ function mr(e, t, n) {
464
464
  if (e.length !== t.length)
465
465
  return !1;
466
466
  for (let r = 0; r < e.length; r++) {
@@ -481,15 +481,15 @@ function Se({
481
481
  collapsedSize: i = 0,
482
482
  collapsible: o,
483
483
  maxSize: s = 100,
484
- minSize: a = 0
484
+ minSize: l = 0
485
485
  } = r;
486
- if (ge(n, a) < 0)
486
+ if (ge(n, l) < 0)
487
487
  if (o) {
488
- const l = (i + a) / 2;
489
- ge(n, l) < 0 ? n = i : n = a;
488
+ const a = (i + l) / 2;
489
+ ge(n, a) < 0 ? n = i : n = l;
490
490
  } else
491
- n = a;
492
- return n = Math.min(s, n), n = parseFloat(n.toFixed(ot)), n;
491
+ n = l;
492
+ return n = Math.min(s, n), n = parseFloat(n.toFixed(it)), n;
493
493
  }
494
494
  function Ie({
495
495
  delta: e,
@@ -501,12 +501,12 @@ function Ie({
501
501
  }) {
502
502
  if (J(e, 0))
503
503
  return t;
504
- const s = [...t], [a, l] = r;
505
- E(a != null, "Invalid first pivot index"), E(l != null, "Invalid second pivot index");
504
+ const s = [...t], [l, a] = r;
505
+ E(l != null, "Invalid first pivot index"), E(a != null, "Invalid second pivot index");
506
506
  let f = 0;
507
507
  if (o === "keyboard") {
508
508
  {
509
- const u = e < 0 ? l : a, c = n[u];
509
+ const u = e < 0 ? a : l, c = n[u];
510
510
  E(c, `Panel constraints not found for index ${u}`);
511
511
  const {
512
512
  collapsedSize: h = 0,
@@ -522,7 +522,7 @@ function Ie({
522
522
  }
523
523
  }
524
524
  {
525
- const u = e < 0 ? a : l, c = n[u];
525
+ const u = e < 0 ? l : a, c = n[u];
526
526
  E(c, `No panel constraints found for index ${u}`);
527
527
  const {
528
528
  collapsedSize: h = 0,
@@ -540,7 +540,7 @@ function Ie({
540
540
  }
541
541
  {
542
542
  const u = e < 0 ? 1 : -1;
543
- let c = e < 0 ? l : a, h = 0;
543
+ let c = e < 0 ? a : l, h = 0;
544
544
  for (; ; ) {
545
545
  const y = t[c];
546
546
  E(y != null, `Previous layout not found for panel index ${c}`);
@@ -556,7 +556,7 @@ function Ie({
556
556
  e = e < 0 ? 0 - m : m;
557
557
  }
558
558
  {
559
- let c = e < 0 ? a : l;
559
+ let c = e < 0 ? l : a;
560
560
  for (; c >= 0 && c < n.length; ) {
561
561
  const h = Math.abs(e) - Math.abs(f), m = t[c];
562
562
  E(m != null, `Previous layout not found for panel index ${c}`);
@@ -572,10 +572,10 @@ function Ie({
572
572
  e < 0 ? c-- : c++;
573
573
  }
574
574
  }
575
- if (dr(i, s))
575
+ if (mr(i, s))
576
576
  return i;
577
577
  {
578
- const u = e < 0 ? l : a, c = t[u];
578
+ const u = e < 0 ? a : l, c = t[u];
579
579
  E(c != null, `Previous layout not found for panel index ${u}`);
580
580
  const h = c + f, m = Se({
581
581
  panelConstraints: n,
@@ -583,7 +583,7 @@ function Ie({
583
583
  size: h
584
584
  });
585
585
  if (s[u] = m, !J(m, h)) {
586
- let y = h - m, v = e < 0 ? l : a;
586
+ let y = h - m, v = e < 0 ? a : l;
587
587
  for (; v >= 0 && v < n.length; ) {
588
588
  const D = s[v];
589
589
  E(D != null, `Previous layout not found for panel index ${v}`);
@@ -601,25 +601,25 @@ function Ie({
601
601
  const p = s.reduce((u, c) => c + u, 0);
602
602
  return J(p, 100) ? s : i;
603
603
  }
604
- function fr({
604
+ function gr({
605
605
  layout: e,
606
606
  panelsArray: t,
607
607
  pivotIndices: n
608
608
  }) {
609
609
  let r = 0, i = 100, o = 0, s = 0;
610
- const a = n[0];
611
- E(a != null, "No pivot index found"), t.forEach((u, c) => {
610
+ const l = n[0];
611
+ E(l != null, "No pivot index found"), t.forEach((u, c) => {
612
612
  const {
613
613
  constraints: h
614
614
  } = u, {
615
615
  maxSize: m = 100,
616
616
  minSize: y = 0
617
617
  } = h;
618
- c === a ? (r = y, i = m) : (o += y, s += m);
618
+ c === l ? (r = y, i = m) : (o += y, s += m);
619
619
  });
620
- const l = Math.min(i, 100 - o), f = Math.max(r, 100 - s), p = e[a];
620
+ const a = Math.min(i, 100 - o), f = Math.max(r, 100 - s), p = e[l];
621
621
  return {
622
- valueMax: l,
622
+ valueMax: a,
623
623
  valueMin: f,
624
624
  valueNow: p
625
625
  };
@@ -627,15 +627,15 @@ function fr({
627
627
  function Me(e, t = document) {
628
628
  return Array.from(t.querySelectorAll(`[${K.resizeHandleId}][data-panel-group-id="${e}"]`));
629
629
  }
630
- function Kt(e, t, n = document) {
630
+ function Bt(e, t, n = document) {
631
631
  const i = Me(e, n).findIndex((o) => o.getAttribute(K.resizeHandleId) === t);
632
632
  return i ?? null;
633
633
  }
634
- function Bt(e, t, n) {
635
- const r = Kt(e, t, n);
634
+ function qt(e, t, n) {
635
+ const r = Bt(e, t, n);
636
636
  return r != null ? [r, r + 1] : [-1, -1];
637
637
  }
638
- function qt(e, t = document) {
638
+ function Ot(e, t = document) {
639
639
  var n;
640
640
  if (t instanceof HTMLElement && (t == null || (n = t.dataset) === null || n === void 0 ? void 0 : n.panelGroupId) == e)
641
641
  return t;
@@ -646,12 +646,12 @@ function Be(e, t = document) {
646
646
  const n = t.querySelector(`[${K.resizeHandleId}="${e}"]`);
647
647
  return n || null;
648
648
  }
649
- function pr(e, t, n, r = document) {
650
- var i, o, s, a;
651
- const l = Be(t, r), f = Me(e, r), p = l ? f.indexOf(l) : -1, u = (i = (o = n[p]) === null || o === void 0 ? void 0 : o.id) !== null && i !== void 0 ? i : null, c = (s = (a = n[p + 1]) === null || a === void 0 ? void 0 : a.id) !== null && s !== void 0 ? s : null;
649
+ function hr(e, t, n, r = document) {
650
+ var i, o, s, l;
651
+ const a = Be(t, r), f = Me(e, r), p = a ? f.indexOf(a) : -1, u = (i = (o = n[p]) === null || o === void 0 ? void 0 : o.id) !== null && i !== void 0 ? i : null, c = (s = (l = n[p + 1]) === null || l === void 0 ? void 0 : l.id) !== null && s !== void 0 ? s : null;
652
652
  return [u, c];
653
653
  }
654
- function mr({
654
+ function yr({
655
655
  committedValuesRef: e,
656
656
  eagerValuesRef: t,
657
657
  groupId: n,
@@ -665,42 +665,42 @@ function mr({
665
665
  }), me(() => {
666
666
  if (!o)
667
667
  return;
668
- const a = Me(n, o);
669
- for (let l = 0; l < i.length - 1; l++) {
668
+ const l = Me(n, o);
669
+ for (let a = 0; a < i.length - 1; a++) {
670
670
  const {
671
671
  valueMax: f,
672
672
  valueMin: p,
673
673
  valueNow: u
674
- } = fr({
674
+ } = gr({
675
675
  layout: r,
676
676
  panelsArray: i,
677
- pivotIndices: [l, l + 1]
678
- }), c = a[l];
677
+ pivotIndices: [a, a + 1]
678
+ }), c = l[a];
679
679
  if (c != null) {
680
- const h = i[l];
681
- E(h, `No panel data found for index "${l}"`), c.setAttribute("aria-controls", h.id), c.setAttribute("aria-valuemax", "" + Math.round(f)), c.setAttribute("aria-valuemin", "" + Math.round(p)), c.setAttribute("aria-valuenow", u != null ? "" + Math.round(u) : "");
680
+ const h = i[a];
681
+ E(h, `No panel data found for index "${a}"`), c.setAttribute("aria-controls", h.id), c.setAttribute("aria-valuemax", "" + Math.round(f)), c.setAttribute("aria-valuemin", "" + Math.round(p)), c.setAttribute("aria-valuenow", u != null ? "" + Math.round(u) : "");
682
682
  }
683
683
  }
684
684
  return () => {
685
- a.forEach((l, f) => {
686
- l.removeAttribute("aria-controls"), l.removeAttribute("aria-valuemax"), l.removeAttribute("aria-valuemin"), l.removeAttribute("aria-valuenow");
685
+ l.forEach((a, f) => {
686
+ a.removeAttribute("aria-controls"), a.removeAttribute("aria-valuemax"), a.removeAttribute("aria-valuemin"), a.removeAttribute("aria-valuenow");
687
687
  });
688
688
  };
689
689
  }, [n, r, i, o]), Z(() => {
690
690
  if (!o)
691
691
  return;
692
- const a = t.current;
693
- E(a, "Eager values not found");
692
+ const l = t.current;
693
+ E(l, "Eager values not found");
694
694
  const {
695
- panelDataArray: l
696
- } = a, f = qt(n, o);
695
+ panelDataArray: a
696
+ } = l, f = Ot(n, o);
697
697
  E(f != null, `No group found for id "${n}"`);
698
698
  const p = Me(n, o);
699
699
  E(p, `No resize handles found for group id "${n}"`);
700
700
  const u = p.map((c) => {
701
701
  const h = c.getAttribute(K.resizeHandleId);
702
702
  E(h, "Resize handle element has no handle id attribute");
703
- const [m, y] = pr(n, h, l, o);
703
+ const [m, y] = hr(n, h, a, o);
704
704
  if (m == null || y == null)
705
705
  return () => {
706
706
  };
@@ -709,9 +709,9 @@ function mr({
709
709
  switch (v.key) {
710
710
  case "Enter": {
711
711
  v.preventDefault();
712
- const D = l.findIndex((b) => b.id === m);
712
+ const D = a.findIndex((b) => b.id === m);
713
713
  if (D >= 0) {
714
- const b = l[D];
714
+ const b = a[D];
715
715
  E(b, `No panel data found for index ${D}`);
716
716
  const I = r[D], {
717
717
  collapsedSize: R = 0,
@@ -722,8 +722,8 @@ function mr({
722
722
  const X = Ie({
723
723
  delta: J(I, R) ? w - R : R - I,
724
724
  initialLayout: r,
725
- panelConstraints: l.map((j) => j.constraints),
726
- pivotIndices: Bt(n, h, o),
725
+ panelConstraints: a.map((j) => j.constraints),
726
+ pivotIndices: qt(n, h, o),
727
727
  prevLayout: r,
728
728
  trigger: "keyboard"
729
729
  });
@@ -743,7 +743,7 @@ function mr({
743
743
  };
744
744
  }, [o, e, t, n, r, i, s]);
745
745
  }
746
- function ht(e, t) {
746
+ function yt(e, t) {
747
747
  if (e.length !== t.length)
748
748
  return !1;
749
749
  for (let n = 0; n < e.length; n++)
@@ -758,50 +758,50 @@ function Gt(e, t) {
758
758
  } = Fe(t);
759
759
  return n ? r : i;
760
760
  }
761
- function gr(e, t, n, r, i) {
761
+ function vr(e, t, n, r, i) {
762
762
  const o = n === "horizontal", s = Be(t, i);
763
763
  E(s, `No resize handle element found for id "${t}"`);
764
- const a = s.getAttribute(K.groupId);
765
- E(a, "Resize handle element has no group id attribute");
764
+ const l = s.getAttribute(K.groupId);
765
+ E(l, "Resize handle element has no group id attribute");
766
766
  let {
767
- initialCursorPosition: l
767
+ initialCursorPosition: a
768
768
  } = r;
769
- const f = Gt(n, e), p = qt(a, i);
770
- E(p, `No group element found for id "${a}"`);
769
+ const f = Gt(n, e), p = Ot(l, i);
770
+ E(p, `No group element found for id "${l}"`);
771
771
  const u = p.getBoundingClientRect(), c = o ? u.width : u.height;
772
- return (f - l) / c * 100;
772
+ return (f - a) / c * 100;
773
773
  }
774
- function hr(e, t, n, r, i, o) {
774
+ function Sr(e, t, n, r, i, o) {
775
775
  if (Lt(e)) {
776
776
  const s = n === "horizontal";
777
- let a = 0;
778
- e.shiftKey ? a = 100 : i != null ? a = i : a = 10;
779
777
  let l = 0;
778
+ e.shiftKey ? l = 100 : i != null ? l = i : l = 10;
779
+ let a = 0;
780
780
  switch (e.key) {
781
781
  case "ArrowDown":
782
- l = s ? 0 : a;
782
+ a = s ? 0 : l;
783
783
  break;
784
784
  case "ArrowLeft":
785
- l = s ? -a : 0;
785
+ a = s ? -l : 0;
786
786
  break;
787
787
  case "ArrowRight":
788
- l = s ? a : 0;
788
+ a = s ? l : 0;
789
789
  break;
790
790
  case "ArrowUp":
791
- l = s ? 0 : -a;
791
+ a = s ? 0 : -l;
792
792
  break;
793
793
  case "End":
794
- l = 100;
794
+ a = 100;
795
795
  break;
796
796
  case "Home":
797
- l = -100;
797
+ a = -100;
798
798
  break;
799
799
  }
800
- return l;
800
+ return a;
801
801
  } else
802
- return r == null ? 0 : gr(e, t, n, r, o);
802
+ return r == null ? 0 : vr(e, t, n, r, o);
803
803
  }
804
- function yr({
804
+ function xr({
805
805
  panelDataArray: e
806
806
  }) {
807
807
  const t = Array(e.length), n = e.map((o) => o.constraints);
@@ -810,19 +810,19 @@ function yr({
810
810
  const s = n[o];
811
811
  E(s, `Panel constraints not found for index ${o}`);
812
812
  const {
813
- defaultSize: a
813
+ defaultSize: l
814
814
  } = s;
815
- a != null && (r++, t[o] = a, i -= a);
815
+ l != null && (r++, t[o] = l, i -= l);
816
816
  }
817
817
  for (let o = 0; o < e.length; o++) {
818
818
  const s = n[o];
819
819
  E(s, `Panel constraints not found for index ${o}`);
820
820
  const {
821
- defaultSize: a
821
+ defaultSize: l
822
822
  } = s;
823
- if (a != null)
823
+ if (l != null)
824
824
  continue;
825
- const l = e.length - r, f = i / l;
825
+ const a = e.length - r, f = i / a;
826
826
  r++, t[o] = f, i -= f;
827
827
  }
828
828
  return t;
@@ -833,24 +833,24 @@ function ye(e, t, n) {
833
833
  E(o, `Panel data not found for index ${i}`);
834
834
  const {
835
835
  callbacks: s,
836
- constraints: a,
837
- id: l
836
+ constraints: l,
837
+ id: a
838
838
  } = o, {
839
839
  collapsedSize: f = 0,
840
840
  collapsible: p
841
- } = a, u = n[l];
841
+ } = l, u = n[a];
842
842
  if (u == null || r !== u) {
843
- n[l] = r;
843
+ n[a] = r;
844
844
  const {
845
845
  onCollapse: c,
846
846
  onExpand: h,
847
847
  onResize: m
848
848
  } = s;
849
- m && m(r, u), p && (c || h) && (h && (u == null || ae(u, f)) && !ae(r, f) && h(), c && (u == null || !ae(u, f)) && ae(r, f) && c());
849
+ m && m(r, u), p && (c || h) && (h && (u == null || le(u, f)) && !le(r, f) && h(), c && (u == null || !le(u, f)) && le(r, f) && c());
850
850
  }
851
851
  });
852
852
  }
853
- function Ne(e, t) {
853
+ function Le(e, t) {
854
854
  if (e.length !== t.length)
855
855
  return !1;
856
856
  for (let n = 0; n < e.length; n++)
@@ -858,7 +858,7 @@ function Ne(e, t) {
858
858
  return !1;
859
859
  return !0;
860
860
  }
861
- function vr({
861
+ function br({
862
862
  defaultSize: e,
863
863
  dragState: t,
864
864
  layout: n,
@@ -867,10 +867,10 @@ function vr({
867
867
  precision: o = 3
868
868
  }) {
869
869
  const s = n[i];
870
- let a;
871
- return s == null ? a = e != null ? e.toPrecision(o) : "1" : r.length === 1 ? a = "1" : a = s.toPrecision(o), {
870
+ let l;
871
+ return s == null ? l = e != null ? e.toPrecision(o) : "1" : r.length === 1 ? l = "1" : l = s.toPrecision(o), {
872
872
  flexBasis: 0,
873
- flexGrow: a,
873
+ flexGrow: l,
874
874
  flexShrink: 1,
875
875
  // Without this, Panel sizes may be unintentionally overridden by their content
876
876
  overflow: "hidden",
@@ -879,7 +879,7 @@ function vr({
879
879
  pointerEvents: t !== null ? "none" : void 0
880
880
  };
881
881
  }
882
- function Sr(e, t = 10) {
882
+ function zr(e, t = 10) {
883
883
  let n = null;
884
884
  return (...i) => {
885
885
  n !== null && clearTimeout(n), n = setTimeout(() => {
@@ -887,7 +887,7 @@ function Sr(e, t = 10) {
887
887
  }, t);
888
888
  };
889
889
  }
890
- function yt(e) {
890
+ function vt(e) {
891
891
  try {
892
892
  if (typeof localStorage < "u")
893
893
  e.getItem = (t) => localStorage.getItem(t), e.setItem = (t, n) => {
@@ -900,10 +900,10 @@ function yt(e) {
900
900
  };
901
901
  }
902
902
  }
903
- function Ot(e) {
903
+ function Ut(e) {
904
904
  return `react-resizable-panels:${e}`;
905
905
  }
906
- function Ut(e) {
906
+ function Wt(e) {
907
907
  return e.map((t) => {
908
908
  const {
909
909
  constraints: n,
@@ -914,9 +914,9 @@ function Ut(e) {
914
914
  return i ? r : o ? `${o}:${JSON.stringify(n)}` : JSON.stringify(n);
915
915
  }).sort((t, n) => t.localeCompare(n)).join(",");
916
916
  }
917
- function Wt(e, t) {
917
+ function Xt(e, t) {
918
918
  try {
919
- const n = Ot(e), r = t.getItem(n);
919
+ const n = Ut(e), r = t.getItem(n);
920
920
  if (r) {
921
921
  const i = JSON.parse(r);
922
922
  if (typeof i == "object" && i != null)
@@ -926,25 +926,25 @@ function Wt(e, t) {
926
926
  }
927
927
  return null;
928
928
  }
929
- function xr(e, t, n) {
929
+ function Pr(e, t, n) {
930
930
  var r, i;
931
- const o = (r = Wt(e, n)) !== null && r !== void 0 ? r : {}, s = Ut(t);
931
+ const o = (r = Xt(e, n)) !== null && r !== void 0 ? r : {}, s = Wt(t);
932
932
  return (i = o[s]) !== null && i !== void 0 ? i : null;
933
933
  }
934
- function br(e, t, n, r, i) {
934
+ function wr(e, t, n, r, i) {
935
935
  var o;
936
- const s = Ot(e), a = Ut(t), l = (o = Wt(e, i)) !== null && o !== void 0 ? o : {};
937
- l[a] = {
936
+ const s = Ut(e), l = Wt(t), a = (o = Xt(e, i)) !== null && o !== void 0 ? o : {};
937
+ a[l] = {
938
938
  expandToSizes: Object.fromEntries(n.entries()),
939
939
  layout: r
940
940
  };
941
941
  try {
942
- i.setItem(s, JSON.stringify(l));
942
+ i.setItem(s, JSON.stringify(a));
943
943
  } catch (f) {
944
944
  console.error(f);
945
945
  }
946
946
  }
947
- function vt({
947
+ function St({
948
948
  layout: e,
949
949
  panelConstraints: t
950
950
  }) {
@@ -955,41 +955,41 @@ function vt({
955
955
  for (let o = 0; o < t.length; o++) {
956
956
  const s = n[o];
957
957
  E(s != null, `No layout data found for index ${o}`);
958
- const a = 100 / r * s;
959
- n[o] = a;
958
+ const l = 100 / r * s;
959
+ n[o] = l;
960
960
  }
961
961
  let i = 0;
962
962
  for (let o = 0; o < t.length; o++) {
963
963
  const s = n[o];
964
964
  E(s != null, `No layout data found for index ${o}`);
965
- const a = Se({
965
+ const l = Se({
966
966
  panelConstraints: t,
967
967
  panelIndex: o,
968
968
  size: s
969
969
  });
970
- s != a && (i += s - a, n[o] = a);
970
+ s != l && (i += s - l, n[o] = l);
971
971
  }
972
972
  if (!J(i, 0))
973
973
  for (let o = 0; o < t.length; o++) {
974
974
  const s = n[o];
975
975
  E(s != null, `No layout data found for index ${o}`);
976
- const a = s + i, l = Se({
976
+ const l = s + i, a = Se({
977
977
  panelConstraints: t,
978
978
  panelIndex: o,
979
- size: a
979
+ size: l
980
980
  });
981
- if (s !== l && (i -= l - s, n[o] = l, J(i, 0)))
981
+ if (s !== a && (i -= a - s, n[o] = a, J(i, 0)))
982
982
  break;
983
983
  }
984
984
  return n;
985
985
  }
986
- const zr = 100, Re = {
987
- getItem: (e) => (yt(Re), Re.getItem(e)),
986
+ const Cr = 100, Re = {
987
+ getItem: (e) => (vt(Re), Re.getItem(e)),
988
988
  setItem: (e, t) => {
989
- yt(Re), Re.setItem(e, t);
989
+ vt(Re), Re.setItem(e, t);
990
990
  }
991
- }, St = {};
992
- function Xt({
991
+ }, xt = {};
992
+ function Yt({
993
993
  autoSaveId: e = null,
994
994
  children: t,
995
995
  className: n = "",
@@ -997,20 +997,20 @@ function Xt({
997
997
  forwardedRef: i,
998
998
  id: o = null,
999
999
  onLayout: s = null,
1000
- keyboardResizeBy: a = null,
1001
- storage: l = Re,
1000
+ keyboardResizeBy: l = null,
1001
+ storage: a = Re,
1002
1002
  style: f,
1003
1003
  tagName: p = "div",
1004
1004
  ...u
1005
1005
  }) {
1006
- const c = it(o), h = B(null), [m, y] = ue(null), [S, v] = ue([]), D = ur(), b = B({}), I = B(/* @__PURE__ */ new Map()), R = B(0), M = B({
1006
+ const c = st(o), h = B(null), [m, y] = ue(null), [S, v] = ue([]), D = pr(), b = B({}), I = B(/* @__PURE__ */ new Map()), R = B(0), M = B({
1007
1007
  autoSaveId: e,
1008
1008
  direction: r,
1009
1009
  dragState: m,
1010
1010
  id: c,
1011
- keyboardResizeBy: a,
1011
+ keyboardResizeBy: l,
1012
1012
  onLayout: s,
1013
- storage: l
1013
+ storage: a
1014
1014
  }), w = B({
1015
1015
  layout: S,
1016
1016
  panelDataArray: [],
@@ -1020,7 +1020,7 @@ function Xt({
1020
1020
  didLogIdAndOrderWarning: !1,
1021
1021
  didLogPanelConstraintsWarning: !1,
1022
1022
  prevPanelIds: []
1023
- }), bt(i, () => ({
1023
+ }), zt(i, () => ({
1024
1024
  getId: () => M.current.id,
1025
1025
  getLayout: () => {
1026
1026
  const {
@@ -1034,15 +1034,15 @@ function Xt({
1034
1034
  } = M.current, {
1035
1035
  layout: C,
1036
1036
  panelDataArray: d
1037
- } = w.current, g = vt({
1037
+ } = w.current, g = St({
1038
1038
  layout: x,
1039
1039
  panelConstraints: d.map((P) => P.constraints)
1040
1040
  });
1041
- ht(C, g) || (v(g), w.current.layout = g, z && z(g), ye(d, g, b.current));
1041
+ yt(C, g) || (v(g), w.current.layout = g, z && z(g), ye(d, g, b.current));
1042
1042
  }
1043
1043
  }), []), me(() => {
1044
- M.current.autoSaveId = e, M.current.direction = r, M.current.dragState = m, M.current.id = c, M.current.onLayout = s, M.current.storage = l;
1045
- }), mr({
1044
+ M.current.autoSaveId = e, M.current.direction = r, M.current.dragState = m, M.current.id = c, M.current.onLayout = s, M.current.storage = a;
1045
+ }), yr({
1046
1046
  committedValuesRef: M,
1047
1047
  eagerValuesRef: w,
1048
1048
  groupId: c,
@@ -1057,12 +1057,12 @@ function Xt({
1057
1057
  if (e) {
1058
1058
  if (S.length === 0 || S.length !== x.length)
1059
1059
  return;
1060
- let z = St[e];
1061
- z == null && (z = Sr(br, zr), St[e] = z);
1060
+ let z = xt[e];
1061
+ z == null && (z = zr(wr, Cr), xt[e] = z);
1062
1062
  const C = [...x], d = new Map(I.current);
1063
- z(e, C, d, S, l);
1063
+ z(e, C, d, S, a);
1064
1064
  }
1065
- }, [e, S, l]), Z(() => {
1065
+ }, [e, S, a]), Z(() => {
1066
1066
  });
1067
1067
  const X = O((x) => {
1068
1068
  const {
@@ -1074,12 +1074,12 @@ function Xt({
1074
1074
  if (x.constraints.collapsible) {
1075
1075
  const g = d.map((oe) => oe.constraints), {
1076
1076
  collapsedSize: P = 0,
1077
- panelSize: N,
1077
+ panelSize: L,
1078
1078
  pivotIndices: q
1079
1079
  } = de(d, x, C);
1080
- if (E(N != null, `Panel size not found for panel "${x.id}"`), !ae(N, P)) {
1081
- I.current.set(x.id, N);
1082
- const ie = ve(d, x) === d.length - 1 ? N - P : P - N, F = Ie({
1080
+ if (E(L != null, `Panel size not found for panel "${x.id}"`), !le(L, P)) {
1081
+ I.current.set(x.id, L);
1082
+ const ie = ve(d, x) === d.length - 1 ? L - P : P - L, F = Ie({
1083
1083
  delta: ie,
1084
1084
  initialLayout: C,
1085
1085
  panelConstraints: g,
@@ -1087,7 +1087,7 @@ function Xt({
1087
1087
  prevLayout: C,
1088
1088
  trigger: "imperative-api"
1089
1089
  });
1090
- Ne(C, F) || (v(F), w.current.layout = F, z && z(F), ye(d, F, b.current));
1090
+ Le(C, F) || (v(F), w.current.layout = F, z && z(F), ye(d, F, b.current));
1091
1091
  }
1092
1092
  }
1093
1093
  }, []), j = O((x, z) => {
@@ -1099,24 +1099,24 @@ function Xt({
1099
1099
  } = w.current;
1100
1100
  if (x.constraints.collapsible) {
1101
1101
  const P = g.map((ee) => ee.constraints), {
1102
- collapsedSize: N = 0,
1102
+ collapsedSize: L = 0,
1103
1103
  panelSize: q = 0,
1104
1104
  minSize: oe = 0,
1105
1105
  pivotIndices: ie
1106
1106
  } = de(g, x, d), F = z ?? oe;
1107
- if (ae(q, N)) {
1108
- const ee = I.current.get(x.id), Ce = ee != null && ee >= F ? ee : F, Ge = ve(g, x) === g.length - 1 ? q - Ce : Ce - q, Q = Ie({
1109
- delta: Ge,
1107
+ if (le(q, L)) {
1108
+ const ee = I.current.get(x.id), Ce = ee != null && ee >= F ? ee : F, Oe = ve(g, x) === g.length - 1 ? q - Ce : Ce - q, Q = Ie({
1109
+ delta: Oe,
1110
1110
  initialLayout: d,
1111
1111
  panelConstraints: P,
1112
1112
  pivotIndices: ie,
1113
1113
  prevLayout: d,
1114
1114
  trigger: "imperative-api"
1115
1115
  });
1116
- Ne(d, Q) || (v(Q), w.current.layout = Q, C && C(Q), ye(g, Q, b.current));
1116
+ Le(d, Q) || (v(Q), w.current.layout = Q, C && C(Q), ye(g, Q, b.current));
1117
1117
  }
1118
1118
  }
1119
- }, []), $ = O((x) => {
1119
+ }, []), V = O((x) => {
1120
1120
  const {
1121
1121
  layout: z,
1122
1122
  panelDataArray: C
@@ -1128,14 +1128,14 @@ function Xt({
1128
1128
  const {
1129
1129
  panelDataArray: C
1130
1130
  } = w.current, d = ve(C, x);
1131
- return vr({
1131
+ return br({
1132
1132
  defaultSize: z,
1133
1133
  dragState: m,
1134
1134
  layout: S,
1135
1135
  panelData: C,
1136
1136
  panelIndex: d
1137
1137
  });
1138
- }, [m, S]), L = O((x) => {
1138
+ }, [m, S]), N = O((x) => {
1139
1139
  const {
1140
1140
  layout: z,
1141
1141
  panelDataArray: C
@@ -1144,7 +1144,7 @@ function Xt({
1144
1144
  collapsible: g,
1145
1145
  panelSize: P
1146
1146
  } = de(C, x, z);
1147
- return E(P != null, `Panel size not found for panel "${x.id}"`), g === !0 && ae(P, d);
1147
+ return E(P != null, `Panel size not found for panel "${x.id}"`), g === !0 && le(P, d);
1148
1148
  }, []), W = O((x) => {
1149
1149
  const {
1150
1150
  layout: z,
@@ -1155,7 +1155,7 @@ function Xt({
1155
1155
  panelSize: P
1156
1156
  } = de(C, x, z);
1157
1157
  return E(P != null, `Panel size not found for panel "${x.id}"`), !g || ge(P, d) > 0;
1158
- }, []), V = O((x) => {
1158
+ }, []), $ = O((x) => {
1159
1159
  const {
1160
1160
  panelDataArray: z
1161
1161
  } = w.current;
@@ -1177,17 +1177,17 @@ function Xt({
1177
1177
  } = w.current;
1178
1178
  let P = null;
1179
1179
  if (x) {
1180
- const q = xr(x, g, C);
1180
+ const q = Pr(x, g, C);
1181
1181
  q && (I.current = new Map(Object.entries(q.expandToSizes)), P = q.layout);
1182
1182
  }
1183
- P == null && (P = yr({
1183
+ P == null && (P = xr({
1184
1184
  panelDataArray: g
1185
1185
  }));
1186
- const N = vt({
1186
+ const L = St({
1187
1187
  layout: P,
1188
1188
  panelConstraints: g.map((q) => q.constraints)
1189
1189
  });
1190
- ht(d, N) || (v(N), w.current.layout = N, z && z(N), ye(g, N, b.current));
1190
+ yt(d, L) || (v(L), w.current.layout = L, z && z(L), ye(g, L, b.current));
1191
1191
  }
1192
1192
  }), me(() => {
1193
1193
  const x = w.current;
@@ -1204,7 +1204,7 @@ function Xt({
1204
1204
  if (!P)
1205
1205
  return () => null;
1206
1206
  const {
1207
- direction: N,
1207
+ direction: L,
1208
1208
  dragState: q,
1209
1209
  id: oe,
1210
1210
  keyboardResizeBy: ie,
@@ -1213,20 +1213,20 @@ function Xt({
1213
1213
  layout: ee,
1214
1214
  panelDataArray: Ce
1215
1215
  } = w.current, {
1216
- initialLayout: Le
1217
- } = q ?? {}, Ge = Bt(oe, x, P);
1218
- let Q = hr(g, x, N, q, ie, P);
1219
- const ct = N === "horizontal";
1220
- ct && z && (Q = -Q);
1221
- const yn = Ce.map((vn) => vn.constraints), Ee = Ie({
1216
+ initialLayout: Ne
1217
+ } = q ?? {}, Oe = qt(oe, x, P);
1218
+ let Q = Sr(g, x, L, q, ie, P);
1219
+ const ut = L === "horizontal";
1220
+ ut && z && (Q = -Q);
1221
+ const Sn = Ce.map((xn) => xn.constraints), Ee = Ie({
1222
1222
  delta: Q,
1223
- initialLayout: Le ?? ee,
1224
- panelConstraints: yn,
1225
- pivotIndices: Ge,
1223
+ initialLayout: Ne ?? ee,
1224
+ panelConstraints: Sn,
1225
+ pivotIndices: Oe,
1226
1226
  prevLayout: ee,
1227
1227
  trigger: Lt(g) ? "keyboard" : "mouse-or-touch"
1228
- }), ut = !Ne(ee, Ee);
1229
- (Nt(g) || _t(g)) && R.current != Q && (R.current = Q, !ut && Q !== 0 ? ct ? Ye(x, Q < 0 ? Tt : Ht) : Ye(x, Q < 0 ? $t : Vt) : Ye(x, 0)), ut && (v(Ee), w.current.layout = Ee, F && F(Ee), ye(Ce, Ee, b.current));
1228
+ }), dt = !Le(ee, Ee);
1229
+ (_t(g) || kt(g)) && R.current != Q && (R.current = Q, !dt && Q !== 0 ? ut ? Ye(x, Q < 0 ? Ht : Vt) : Ye(x, Q < 0 ? $t : Ft) : Ye(x, 0)), dt && (v(Ee), w.current.layout = Ee, F && F(Ee), ye(Ce, Ee, b.current));
1230
1230
  };
1231
1231
  }, []), H = O((x, z) => {
1232
1232
  const {
@@ -1235,11 +1235,11 @@ function Xt({
1235
1235
  layout: d,
1236
1236
  panelDataArray: g
1237
1237
  } = w.current, P = g.map((ee) => ee.constraints), {
1238
- panelSize: N,
1238
+ panelSize: L,
1239
1239
  pivotIndices: q
1240
1240
  } = de(g, x, d);
1241
- E(N != null, `Panel size not found for panel "${x.id}"`);
1242
- const ie = ve(g, x) === g.length - 1 ? N - z : z - N, F = Ie({
1241
+ E(L != null, `Panel size not found for panel "${x.id}"`);
1242
+ const ie = ve(g, x) === g.length - 1 ? L - z : z - L, F = Ie({
1243
1243
  delta: ie,
1244
1244
  initialLayout: d,
1245
1245
  panelConstraints: P,
@@ -1247,7 +1247,7 @@ function Xt({
1247
1247
  prevLayout: d,
1248
1248
  trigger: "imperative-api"
1249
1249
  });
1250
- Ne(d, F) || (v(F), w.current.layout = F, C && C(F), ye(g, F, b.current));
1250
+ Le(d, F) || (v(F), w.current.layout = F, C && C(F), ye(g, F, b.current));
1251
1251
  }, []), Y = O((x, z) => {
1252
1252
  const {
1253
1253
  layout: C,
@@ -1256,14 +1256,14 @@ function Xt({
1256
1256
  collapsedSize: g = 0,
1257
1257
  collapsible: P
1258
1258
  } = z, {
1259
- collapsedSize: N = 0,
1259
+ collapsedSize: L = 0,
1260
1260
  collapsible: q,
1261
1261
  maxSize: oe = 100,
1262
1262
  minSize: ie = 0
1263
1263
  } = x.constraints, {
1264
1264
  panelSize: F
1265
1265
  } = de(d, x, C);
1266
- F != null && (P && q && ae(F, g) ? ae(g, N) || H(x, N) : F < ie ? H(x, ie) : F > oe && H(x, oe));
1266
+ F != null && (P && q && le(F, g) ? le(g, L) || H(x, L) : F < ie ? H(x, ie) : F > oe && H(x, oe));
1267
1267
  }, [H]), G = O((x, z) => {
1268
1268
  const {
1269
1269
  direction: C
@@ -1293,27 +1293,27 @@ function Xt({
1293
1293
  direction: r,
1294
1294
  dragState: m,
1295
1295
  expandPanel: j,
1296
- getPanelSize: $,
1296
+ getPanelSize: V,
1297
1297
  getPanelStyle: A,
1298
1298
  groupId: c,
1299
- isPanelCollapsed: L,
1299
+ isPanelCollapsed: N,
1300
1300
  isPanelExpanded: W,
1301
1301
  reevaluatePanelConstraints: Y,
1302
- registerPanel: V,
1302
+ registerPanel: $,
1303
1303
  registerResizeHandle: T,
1304
1304
  resizePanel: H,
1305
1305
  startDragging: G,
1306
1306
  stopDragging: re,
1307
1307
  unregisterPanel: he,
1308
1308
  panelGroupElement: h.current
1309
- }), [X, m, r, j, $, A, c, L, W, Y, V, T, H, G, re, he]), le = {
1309
+ }), [X, m, r, j, V, A, c, N, W, Y, $, T, H, G, re, he]), ae = {
1310
1310
  display: "flex",
1311
1311
  flexDirection: r === "horizontal" ? "row" : "column",
1312
1312
  height: "100%",
1313
1313
  overflow: "hidden",
1314
1314
  width: "100%"
1315
1315
  };
1316
- return be(Ve.Provider, {
1316
+ return be($e.Provider, {
1317
1317
  value: se
1318
1318
  }, be(p, {
1319
1319
  ...u,
@@ -1322,7 +1322,7 @@ function Xt({
1322
1322
  id: o,
1323
1323
  ref: h,
1324
1324
  style: {
1325
- ...le,
1325
+ ...ae,
1326
1326
  ...f
1327
1327
  },
1328
1328
  // CSS selectors
@@ -1331,12 +1331,12 @@ function Xt({
1331
1331
  [K.groupId]: c
1332
1332
  }));
1333
1333
  }
1334
- const Pr = $e((e, t) => be(Xt, {
1334
+ const Er = Ve((e, t) => be(Yt, {
1335
1335
  ...e,
1336
1336
  forwardedRef: t
1337
1337
  }));
1338
- Xt.displayName = "PanelGroup";
1339
- Pr.displayName = "forwardRef(PanelGroup)";
1338
+ Yt.displayName = "PanelGroup";
1339
+ Er.displayName = "forwardRef(PanelGroup)";
1340
1340
  function ve(e, t) {
1341
1341
  return e.findIndex((n) => n === t || n.id === t.id);
1342
1342
  }
@@ -1348,7 +1348,7 @@ function de(e, t, n) {
1348
1348
  pivotIndices: o
1349
1349
  };
1350
1350
  }
1351
- function wr({
1351
+ function Ir({
1352
1352
  disabled: e,
1353
1353
  handleId: t,
1354
1354
  resizeHandler: n,
@@ -1374,12 +1374,12 @@ function wr({
1374
1374
  }
1375
1375
  case "F6": {
1376
1376
  s.preventDefault();
1377
- const a = i.getAttribute(K.groupId);
1378
- E(a, `No group element found for id "${a}"`);
1379
- const l = Me(a, r), f = Kt(a, t, r);
1377
+ const l = i.getAttribute(K.groupId);
1378
+ E(l, `No group element found for id "${l}"`);
1379
+ const a = Me(l, r), f = Bt(l, t, r);
1380
1380
  E(f !== null, `No resize element found for id "${t}"`);
1381
- const p = s.shiftKey ? f > 0 ? f - 1 : l.length - 1 : f + 1 < l.length ? f + 1 : 0;
1382
- l[p].focus();
1381
+ const p = s.shiftKey ? f > 0 ? f - 1 : a.length - 1 : f + 1 < a.length ? f + 1 : 0;
1382
+ a[p].focus();
1383
1383
  break;
1384
1384
  }
1385
1385
  }
@@ -1389,7 +1389,7 @@ function wr({
1389
1389
  };
1390
1390
  }, [r, e, t, n]);
1391
1391
  }
1392
- function Cr({
1392
+ function Rr({
1393
1393
  children: e = null,
1394
1394
  className: t = "",
1395
1395
  disabled: n = !1,
@@ -1397,8 +1397,8 @@ function Cr({
1397
1397
  id: i,
1398
1398
  onBlur: o,
1399
1399
  onClick: s,
1400
- onDragging: a,
1401
- onFocus: l,
1400
+ onDragging: l,
1401
+ onFocus: a,
1402
1402
  onPointerDown: f,
1403
1403
  onPointerUp: p,
1404
1404
  style: u = {},
@@ -1409,14 +1409,14 @@ function Cr({
1409
1409
  var y, S;
1410
1410
  const v = B(null), D = B({
1411
1411
  onClick: s,
1412
- onDragging: a,
1412
+ onDragging: l,
1413
1413
  onPointerDown: f,
1414
1414
  onPointerUp: p
1415
1415
  });
1416
1416
  Z(() => {
1417
- D.current.onClick = s, D.current.onDragging = a, D.current.onPointerDown = f, D.current.onPointerUp = p;
1417
+ D.current.onClick = s, D.current.onDragging = l, D.current.onPointerDown = f, D.current.onPointerUp = p;
1418
1418
  });
1419
- const b = xt(Ve);
1419
+ const b = nt($e);
1420
1420
  if (b === null)
1421
1421
  throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");
1422
1422
  const {
@@ -1426,7 +1426,7 @@ function Cr({
1426
1426
  startDragging: w,
1427
1427
  stopDragging: X,
1428
1428
  panelGroupElement: j
1429
- } = b, $ = it(i), [A, L] = ue("inactive"), [W, V] = ue(!1), [T, H] = ue(null), Y = B({
1429
+ } = b, V = st(i), [A, N] = ue("inactive"), [W, $] = ue(!1), [T, H] = ue(null), Y = B({
1430
1430
  state: A
1431
1431
  });
1432
1432
  me(() => {
@@ -1435,28 +1435,28 @@ function Cr({
1435
1435
  if (n)
1436
1436
  H(null);
1437
1437
  else {
1438
- const se = M($);
1438
+ const se = M(V);
1439
1439
  H(() => se);
1440
1440
  }
1441
- }, [n, $, M]);
1441
+ }, [n, V, M]);
1442
1442
  const G = (y = r == null ? void 0 : r.coarse) !== null && y !== void 0 ? y : 15, re = (S = r == null ? void 0 : r.fine) !== null && S !== void 0 ? S : 5;
1443
1443
  return Z(() => {
1444
1444
  if (n || T == null)
1445
1445
  return;
1446
1446
  const se = v.current;
1447
1447
  E(se, "Element ref not attached");
1448
- let le = !1;
1449
- return lr($, se, I, {
1448
+ let ae = !1;
1449
+ return dr(V, se, I, {
1450
1450
  coarse: G,
1451
1451
  fine: re
1452
1452
  }, (z, C, d) => {
1453
1453
  if (!C) {
1454
- L("inactive");
1454
+ N("inactive");
1455
1455
  return;
1456
1456
  }
1457
1457
  switch (z) {
1458
1458
  case "down": {
1459
- L("drag"), le = !1, E(d, 'Expected event to be defined for "down" action'), w($, d);
1459
+ N("drag"), ae = !1, E(d, 'Expected event to be defined for "down" action'), w(V, d);
1460
1460
  const {
1461
1461
  onDragging: g,
1462
1462
  onPointerDown: P
@@ -1468,24 +1468,24 @@ function Cr({
1468
1468
  const {
1469
1469
  state: g
1470
1470
  } = Y.current;
1471
- le = !0, g !== "drag" && L("hover"), E(d, 'Expected event to be defined for "move" action'), T(d);
1471
+ ae = !0, g !== "drag" && N("hover"), E(d, 'Expected event to be defined for "move" action'), T(d);
1472
1472
  break;
1473
1473
  }
1474
1474
  case "up": {
1475
- L("hover"), X();
1475
+ N("hover"), X();
1476
1476
  const {
1477
1477
  onClick: g,
1478
1478
  onDragging: P,
1479
- onPointerUp: N
1479
+ onPointerUp: L
1480
1480
  } = D.current;
1481
- P == null || P(!1), N == null || N(), le || g == null || g();
1481
+ P == null || P(!1), L == null || L(), ae || g == null || g();
1482
1482
  break;
1483
1483
  }
1484
1484
  }
1485
1485
  });
1486
- }, [G, I, n, re, M, $, T, w, X]), wr({
1486
+ }, [G, I, n, re, M, V, T, w, X]), Ir({
1487
1487
  disabled: n,
1488
- handleId: $,
1488
+ handleId: V,
1489
1489
  resizeHandler: T,
1490
1490
  panelGroupElement: j
1491
1491
  }), be(h, {
@@ -1494,10 +1494,10 @@ function Cr({
1494
1494
  className: t,
1495
1495
  id: i,
1496
1496
  onBlur: () => {
1497
- V(!1), o == null || o();
1497
+ $(!1), o == null || o();
1498
1498
  },
1499
1499
  onFocus: () => {
1500
- V(!0), l == null || l();
1500
+ $(!0), a == null || a();
1501
1501
  },
1502
1502
  ref: v,
1503
1503
  role: "separator",
@@ -1515,18 +1515,18 @@ function Cr({
1515
1515
  [K.resizeHandle]: "",
1516
1516
  [K.resizeHandleActive]: A === "drag" ? "pointer" : W ? "keyboard" : void 0,
1517
1517
  [K.resizeHandleEnabled]: !n,
1518
- [K.resizeHandleId]: $,
1518
+ [K.resizeHandleId]: V,
1519
1519
  [K.resizeHandleState]: A
1520
1520
  });
1521
1521
  }
1522
- Cr.displayName = "PanelResizeHandle";
1523
- function Yt() {
1524
- var l, f;
1522
+ Rr.displayName = "PanelResizeHandle";
1523
+ function jt() {
1524
+ var a, f;
1525
1525
  const e = te((p) => p.card), t = te((p) => p.frame), n = U(
1526
- () => Un(t, e),
1526
+ () => Yn(t, e),
1527
1527
  [t, e]
1528
- ), { manifest: r } = zt(
1529
- ((l = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : l.url) || ""
1528
+ ), { manifest: r } = Pt(
1529
+ ((a = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : a.url) || ""
1530
1530
  ), i = U(
1531
1531
  () => {
1532
1532
  var p;
@@ -1538,39 +1538,39 @@ function Yt() {
1538
1538
  );
1539
1539
  },
1540
1540
  [r, (f = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : f.componentName]
1541
- ), o = Dt(n, i), s = U(
1542
- () => At({
1541
+ ), o = At(n, i), s = U(
1542
+ () => Mt({
1543
1543
  frame: t,
1544
1544
  configCard: n,
1545
1545
  isMultiInputVisual: o === "multiple"
1546
1546
  }),
1547
1547
  [t, n, o]
1548
- ), a = U(() => {
1548
+ ), l = U(() => {
1549
1549
  const p = s.findIndex(
1550
1550
  (u) => (u == null ? void 0 : u.id) === e.id
1551
1551
  );
1552
1552
  return p < 0 ? -1 : Qe(e, p);
1553
1553
  }, [s, e]);
1554
- return U(() => !n || o !== "multiple" || a < 0 ? e.type : _e(
1554
+ return U(() => !n || o !== "multiple" || l < 0 ? e.type : _e(
1555
1555
  e,
1556
- a,
1556
+ l,
1557
1557
  i == null ? void 0 : i.slots
1558
- ) ?? e.type, [n, o, a, e, i == null ? void 0 : i.slots]);
1558
+ ) ?? e.type, [n, o, l, e, i == null ? void 0 : i.slots]);
1559
1559
  }
1560
- function jt({
1560
+ function Qt({
1561
1561
  storeValue: e,
1562
1562
  defaultValue: t = "",
1563
1563
  onStoreUpdate: n,
1564
1564
  delay: r = 300
1565
1565
  }) {
1566
- const [i, o] = ue(e ?? t), s = B(null), a = B(i), l = B(e), f = B(!1), p = O(() => {
1567
- s.current && (clearTimeout(s.current), s.current = null), f.current && a.current !== (l.current ?? t) && (n(a.current), l.current = a.current);
1566
+ const [i, o] = ue(e ?? t), s = B(null), l = B(i), a = B(e), f = B(!1), p = O(() => {
1567
+ s.current && (clearTimeout(s.current), s.current = null), f.current && l.current !== (a.current ?? t) && (n(l.current), a.current = l.current);
1568
1568
  }, [t, n]);
1569
1569
  Z(() => {
1570
- if (e !== l.current) {
1570
+ if (e !== a.current) {
1571
1571
  s.current && (clearTimeout(s.current), s.current = null);
1572
1572
  const c = e ?? t;
1573
- o(c), a.current = c, l.current = e, f.current = !1;
1573
+ o(c), l.current = c, a.current = e, f.current = !1;
1574
1574
  }
1575
1575
  }, [e, t]), Z(() => {
1576
1576
  if (f.current)
@@ -1585,24 +1585,24 @@ function jt({
1585
1585
  const u = O(
1586
1586
  (c) => {
1587
1587
  const h = c ?? t;
1588
- f.current = !0, a.current = h, o(h);
1588
+ f.current = !0, l.current = h, o(h);
1589
1589
  },
1590
1590
  [t]
1591
1591
  );
1592
1592
  return { value: i, onChange: u, flush: p };
1593
1593
  }
1594
- function Qt({
1594
+ function Jt({
1595
1595
  queryClient: e,
1596
1596
  readQueryKey: t,
1597
1597
  setRunSql: n
1598
1598
  }) {
1599
- On(), setTimeout(() => {
1599
+ Xn(), setTimeout(() => {
1600
1600
  e.resetQueries({ queryKey: t(), exact: !0 }), n(!0);
1601
1601
  }, 0);
1602
1602
  }
1603
- const Er = 300;
1604
- function Ir({ className: e }, t) {
1605
- const n = te((b) => b.card.sql), r = te((b) => b.sqlGen), i = te((b) => b.card), o = Yt(), { setCardSql: s, setSqlGen: a, setRunSql: l } = wt(), f = U(() => o !== i.type ? { ...i, type: o } : i, [i, o]), { queryKey: p } = nt(f), u = Pt(), c = B(p);
1603
+ const Dr = 300;
1604
+ function Ar({ className: e }, t) {
1605
+ const n = te((b) => b.card.sql), r = te((b) => b.sqlGen), i = te((b) => b.card), o = jt(), { setCardSql: s, setSqlGen: l, setRunSql: a } = Ct(), f = U(() => o !== i.type ? { ...i, type: o } : i, [i, o]), { queryKey: p } = rt(f), u = wt(), c = B(p);
1606
1606
  c.current = p;
1607
1607
  const h = B(r);
1608
1608
  h.current = r;
@@ -1615,18 +1615,18 @@ function Ir({ className: e }, t) {
1615
1615
  value: y,
1616
1616
  onChange: S,
1617
1617
  flush: v
1618
- } = jt({
1618
+ } = Qt({
1619
1619
  storeValue: n,
1620
1620
  defaultValue: "",
1621
1621
  onStoreUpdate: m,
1622
- delay: Er
1622
+ delay: Dr
1623
1623
  });
1624
- Z(() => Rt(v), [v]);
1624
+ Z(() => Dt(v), [v]);
1625
1625
  function D(b) {
1626
- S(b), Hn(h.current) || a({});
1626
+ S(b), Fn(h.current) || l({});
1627
1627
  }
1628
1628
  return /* @__PURE__ */ _("div", { className: "relative h-full w-full", children: /* @__PURE__ */ _(
1629
- Ct,
1629
+ Et,
1630
1630
  {
1631
1631
  ref: t,
1632
1632
  value: y ?? "",
@@ -1638,45 +1638,45 @@ function Ir({ className: e }, t) {
1638
1638
  placeholder: "Write your SQL here",
1639
1639
  className: e,
1640
1640
  onKeyDown: (b) => {
1641
- b.key === "Enter" && b.shiftKey && (b.preventDefault(), Qt({
1641
+ b.key === "Enter" && b.shiftKey && (b.preventDefault(), Jt({
1642
1642
  queryClient: u,
1643
1643
  readQueryKey: () => c.current,
1644
- setRunSql: l
1644
+ setRunSql: a
1645
1645
  }));
1646
1646
  }
1647
1647
  }
1648
1648
  ) });
1649
1649
  }
1650
- const po = $e(Ir), Rr = 300, Dr = `# 'data' holds the SQL result.
1650
+ const vo = Ve(Ar), Mr = 300, Nr = `# 'data' holds the SQL result.
1651
1651
  # Set 'result' to a list of dicts to replace it, for example:
1652
1652
  # import pandas as pd
1653
1653
  # result = pd.DataFrame(data).to_dict('records')`;
1654
- function Ar({ className: e }, t) {
1655
- const n = te((m) => m.card.python), r = te((m) => m.card), i = Yt(), { setCardPython: o, setRunSql: s } = wt(), a = U(() => i !== r.type ? { ...r, type: i } : r, [r, i]), { queryKey: l } = nt(a), f = Pt(), p = B(l);
1656
- p.current = l;
1657
- const { value: u, onChange: c, flush: h } = jt({
1654
+ function Lr({ className: e }, t) {
1655
+ const n = te((m) => m.card.python), r = te((m) => m.card), i = jt(), { setCardPython: o, setRunSql: s } = Ct(), l = U(() => i !== r.type ? { ...r, type: i } : r, [r, i]), { queryKey: a } = rt(l), f = wt(), p = B(a);
1656
+ p.current = a;
1657
+ const { value: u, onChange: c, flush: h } = Qt({
1658
1658
  storeValue: n,
1659
1659
  onStoreUpdate: o,
1660
- delay: Rr
1660
+ delay: Mr
1661
1661
  });
1662
- return Z(() => Rt(h), [h]), /* @__PURE__ */ _(
1663
- Ct,
1662
+ return Z(() => Dt(h), [h]), /* @__PURE__ */ _(
1663
+ Et,
1664
1664
  {
1665
1665
  ref: t,
1666
1666
  value: u ?? "",
1667
1667
  onValueChange: c,
1668
1668
  language: "python",
1669
- placeholder: Dr,
1669
+ placeholder: Nr,
1670
1670
  ariaLabel: "Python code",
1671
1671
  embedded: !0,
1672
1672
  hideLineNumbers: !0,
1673
1673
  wrapLines: !0,
1674
- className: rt(
1674
+ className: ot(
1675
1675
  "[&_.code-editor-pre]:!pt-2 [&_.code-editor-textarea]:!pt-2",
1676
1676
  e
1677
1677
  ),
1678
1678
  onKeyDown: (m) => {
1679
- m.key === "Enter" && m.shiftKey && (m.preventDefault(), Qt({
1679
+ m.key === "Enter" && m.shiftKey && (m.preventDefault(), Jt({
1680
1680
  queryClient: f,
1681
1681
  readQueryKey: () => p.current,
1682
1682
  setRunSql: s
@@ -1685,32 +1685,32 @@ function Ar({ className: e }, t) {
1685
1685
  }
1686
1686
  );
1687
1687
  }
1688
- const mo = $e(Ar);
1689
- function Mr({ card: e }) {
1690
- var se, le, x, z, C;
1691
- const t = Cn(), [n, r] = ue({}), { authToken: i } = En(), o = $n(i == null ? void 0 : i.accessToken), { compiledAppearance: s } = Yn(), a = U(
1692
- () => In(s),
1688
+ const So = Ve(Lr);
1689
+ function _r({ card: e }) {
1690
+ var se, ae, x, z, C;
1691
+ const t = In(), [n, r] = ue({}), { authToken: i } = Rn(), o = Kn(i == null ? void 0 : i.accessToken), { compiledAppearance: s } = Jn(), l = U(
1692
+ () => Dn(s),
1693
1693
  [s]
1694
- ), l = te((d) => d.frame), f = te(
1694
+ ), a = te((d) => d.frame), f = te(
1695
1695
  (d) => d.inlineFilterValuesMap[e.id]
1696
1696
  ), p = te(
1697
1697
  (d) => d.actions.setCardInlineFilterValue
1698
1698
  ), u = te(
1699
1699
  (d) => d.actions.removeCardInlineFilterValue
1700
- ), c = e, { getCard: h, manifest: m } = zt(
1700
+ ), c = e, { getCard: h, manifest: m } = Pt(
1701
1701
  ((se = c.customCardPreferences) == null ? void 0 : se.url) || ""
1702
- ), y = (le = m == null ? void 0 : m.visuals) == null ? void 0 : le.find(
1702
+ ), y = (ae = m == null ? void 0 : m.visuals) == null ? void 0 : ae.find(
1703
1703
  (d) => {
1704
1704
  var g;
1705
1705
  return d.name === ((g = c.customCardPreferences) == null ? void 0 : g.componentName);
1706
1706
  }
1707
- ), S = Dt(c, y) ?? "single", v = U(
1708
- () => At({
1709
- frame: l,
1707
+ ), S = At(c, y) ?? "single", v = U(
1708
+ () => Mt({
1709
+ frame: a,
1710
1710
  configCard: c,
1711
1711
  isMultiInputVisual: S === "multiple"
1712
1712
  }),
1713
- [l, c, S]
1713
+ [a, c, S]
1714
1714
  ), D = U(() => {
1715
1715
  const d = v.findIndex(
1716
1716
  (g) => (g == null ? void 0 : g.id) === e.id
@@ -1728,50 +1728,50 @@ function Mr({ card: e }) {
1728
1728
  python: "",
1729
1729
  config: void 0,
1730
1730
  queryConfig: void 0
1731
- } : b !== e.type ? { ...e, type: b } : e, [e, b, S]), { data: R, effectiveCardConfig: M } = nt(I), w = Rn(), X = Oe((d) => d.dashboard.filters), j = Oe((d) => d.filterValues), $ = Oe((d) => d.selectedSheetId), A = U(
1732
- () => Dn({
1731
+ } : b !== e.type ? { ...e, type: b } : e, [e, b, S]), { data: R, effectiveCardConfig: M } = rt(I), w = An(), X = Ge((d) => d.dashboard.filters), j = Ge((d) => d.filterValues), V = Ge((d) => d.selectedSheetId), A = U(
1732
+ () => Mn({
1733
1733
  card: e,
1734
- sheetId: $ || "",
1734
+ sheetId: V || "",
1735
1735
  inlineFilterValues: f,
1736
1736
  setInlineFilterValue: (d) => p(e.id, d),
1737
1737
  removeInlineFilterValue: (d) => u(e.id, d)
1738
1738
  }),
1739
1739
  [
1740
1740
  e,
1741
- $,
1741
+ V,
1742
1742
  f,
1743
1743
  p,
1744
1744
  u
1745
1745
  ]
1746
- ), { cardFilters: L, cardFilterValues: W } = U(
1747
- () => An({
1746
+ ), { cardFilters: N, cardFilterValues: W } = U(
1747
+ () => Nn({
1748
1748
  card: e,
1749
1749
  transientContexts: w,
1750
1750
  filters: X,
1751
1751
  filterValues: j,
1752
- selectedSheetId: $
1752
+ selectedSheetId: V
1753
1753
  }),
1754
1754
  [
1755
1755
  e,
1756
1756
  w,
1757
1757
  X,
1758
1758
  j,
1759
- $
1759
+ V
1760
1760
  ]
1761
- ), V = O(
1761
+ ), $ = O(
1762
1762
  (d, g) => {
1763
- const P = Wn(g);
1764
- r((N) => ({
1765
- ...N,
1763
+ const P = jn(g);
1764
+ r((L) => ({
1765
+ ...L,
1766
1766
  [d]: P
1767
1767
  }));
1768
1768
  },
1769
1769
  []
1770
- ), T = (x = c.customCardPreferences) == null ? void 0 : x.componentName, H = T ? h(T) : null, Y = Mn(
1770
+ ), T = (x = c.customCardPreferences) == null ? void 0 : x.componentName, H = T ? h(T) : null, Y = Ln(
1771
1771
  (z = c.customCardPreferences) == null ? void 0 : z.settings,
1772
1772
  c
1773
1773
  ), G = U(
1774
- () => Xn(v),
1774
+ () => Qn(v),
1775
1775
  [v]
1776
1776
  ), re = U(
1777
1777
  () => G.map(
@@ -1783,8 +1783,8 @@ function Mr({ card: e }) {
1783
1783
  ),
1784
1784
  [G, y == null ? void 0 : y.slots]
1785
1785
  ), he = U(
1786
- () => Ln(
1787
- S === "multiple" ? Nn({
1786
+ () => _n(
1787
+ S === "multiple" ? kn({
1788
1788
  slotOrderedCards: G,
1789
1789
  multiInputData: n,
1790
1790
  valueFormatPreferences: t
@@ -1810,26 +1810,26 @@ function Mr({ card: e }) {
1810
1810
  ]
1811
1811
  );
1812
1812
  return T ? /* @__PURE__ */ _("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ De(
1813
- Pn,
1813
+ wn,
1814
1814
  {
1815
- fallback: /* @__PURE__ */ _(dt, {}),
1815
+ fallback: /* @__PURE__ */ _(ft, {}),
1816
1816
  children: [
1817
1817
  H && S === "single" && /* @__PURE__ */ _(
1818
1818
  H,
1819
1819
  {
1820
1820
  editing: !0,
1821
1821
  params: o,
1822
- theme: a,
1822
+ theme: l,
1823
1823
  settings: Y,
1824
- cardMetadata: _n({
1824
+ cardMetadata: Tn({
1825
1825
  card: e,
1826
1826
  dataMetadata: R == null ? void 0 : R.metadata
1827
1827
  }),
1828
- onDataChange: V,
1828
+ onDataChange: $,
1829
1829
  data: (R == null ? void 0 : R.records) || [],
1830
1830
  columns: (R == null ? void 0 : R.columns) || [],
1831
1831
  formatTemporalBucketValue: he,
1832
- filters: L,
1832
+ filters: N,
1833
1833
  filterValues: [
1834
1834
  ...W || [],
1835
1835
  ...f || []
@@ -1837,20 +1837,20 @@ function Mr({ card: e }) {
1837
1837
  inlineFilters: A
1838
1838
  }
1839
1839
  ),
1840
- H && S === "multiple" && /* @__PURE__ */ De(dt, { children: [
1840
+ H && S === "multiple" && /* @__PURE__ */ De(ft, { children: [
1841
1841
  v.map((d, g) => {
1842
1842
  if (!d) return null;
1843
- const P = Qe(d, g), N = _e(
1843
+ const P = Qe(d, g), L = _e(
1844
1844
  d,
1845
1845
  P,
1846
1846
  y == null ? void 0 : y.slots
1847
1847
  );
1848
1848
  return /* @__PURE__ */ _(
1849
- kn,
1849
+ Hn,
1850
1850
  {
1851
- onDataChange: V,
1851
+ onDataChange: $,
1852
1852
  card: d,
1853
- effectiveCardType: N
1853
+ effectiveCardType: L
1854
1854
  },
1855
1855
  `${d.id}-${P}`
1856
1856
  );
@@ -1859,16 +1859,16 @@ function Mr({ card: e }) {
1859
1859
  H,
1860
1860
  {
1861
1861
  editing: !0,
1862
- onDataChange: V,
1863
- ...Tn({
1862
+ onDataChange: $,
1863
+ ...Vn({
1864
1864
  configCard: c,
1865
1865
  slotOrderedCards: G,
1866
1866
  slotTypes: re,
1867
1867
  multiInputData: n,
1868
1868
  params: o,
1869
- theme: a,
1869
+ theme: l,
1870
1870
  chartSettings: Y,
1871
- filters: L,
1871
+ filters: N,
1872
1872
  filterValues: [
1873
1873
  ...W || [],
1874
1874
  ...f || []
@@ -1884,13 +1884,13 @@ function Mr({ card: e }) {
1884
1884
  (C = c.customCardPreferences) == null ? void 0 : C.componentName
1885
1885
  ) }) : null;
1886
1886
  }
1887
- const go = zn(Mr);
1888
- var Jt = "Toggle", Zt = k.forwardRef((e, t) => {
1889
- const { pressed: n, defaultPressed: r, onPressedChange: i, ...o } = e, [s, a] = Et({
1887
+ const xo = Pn(_r);
1888
+ var Zt = "Toggle", en = k.forwardRef((e, t) => {
1889
+ const { pressed: n, defaultPressed: r, onPressedChange: i, ...o } = e, [s, l] = It({
1890
1890
  prop: n,
1891
1891
  onChange: i,
1892
1892
  defaultProp: r ?? !1,
1893
- caller: Jt
1893
+ caller: Zt
1894
1894
  });
1895
1895
  return /* @__PURE__ */ _(
1896
1896
  ze.button,
@@ -1902,14 +1902,14 @@ var Jt = "Toggle", Zt = k.forwardRef((e, t) => {
1902
1902
  ...o,
1903
1903
  ref: t,
1904
1904
  onClick: pe(e.onClick, () => {
1905
- e.disabled || a(!s);
1905
+ e.disabled || l(!s);
1906
1906
  })
1907
1907
  }
1908
1908
  );
1909
1909
  });
1910
- Zt.displayName = Jt;
1911
- var en = Zt;
1912
- const Lr = Vn(
1910
+ en.displayName = Zt;
1911
+ var tn = en;
1912
+ const kr = Bn(
1913
1913
  "inline-flex items-center justify-center rounded-control text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
1914
1914
  {
1915
1915
  variants: {
@@ -1928,23 +1928,23 @@ const Lr = Vn(
1928
1928
  size: "default"
1929
1929
  }
1930
1930
  }
1931
- ), Nr = k.forwardRef(({ className: e, variant: t, size: n, ...r }, i) => /* @__PURE__ */ _(
1932
- en,
1931
+ ), Tr = k.forwardRef(({ className: e, variant: t, size: n, ...r }, i) => /* @__PURE__ */ _(
1932
+ tn,
1933
1933
  {
1934
1934
  ref: i,
1935
- className: rt(Lr({ variant: t, size: n, className: e })),
1935
+ className: ot(kr({ variant: t, size: n, className: e })),
1936
1936
  ...r
1937
1937
  }
1938
1938
  ));
1939
- Nr.displayName = en.displayName;
1940
- var tn = ["PageUp", "PageDown"], nn = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], rn = {
1939
+ Tr.displayName = tn.displayName;
1940
+ var nn = ["PageUp", "PageDown"], rn = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], on = {
1941
1941
  "from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
1942
1942
  "from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
1943
1943
  "from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
1944
1944
  "from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
1945
- }, we = "Slider", [Ze, _r, kr] = Kn(we), [on] = Fn(we, [
1946
- kr
1947
- ]), [Tr, qe] = on(we), sn = k.forwardRef(
1945
+ }, we = "Slider", [Ze, Hr, Vr] = On(we), [sn] = qn(we, [
1946
+ Vr
1947
+ ]), [$r, qe] = sn(we), ln = k.forwardRef(
1948
1948
  (e, t) => {
1949
1949
  const {
1950
1950
  name: n,
@@ -1952,8 +1952,8 @@ var tn = ["PageUp", "PageDown"], nn = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
1952
1952
  max: i = 100,
1953
1953
  step: o = 1,
1954
1954
  orientation: s = "horizontal",
1955
- disabled: a = !1,
1956
- minStepsBetweenThumbs: l = 0,
1955
+ disabled: l = !1,
1956
+ minStepsBetweenThumbs: a = 0,
1957
1957
  defaultValue: f = [r],
1958
1958
  value: p,
1959
1959
  onValueChange: u = () => {
@@ -1963,7 +1963,7 @@ var tn = ["PageUp", "PageDown"], nn = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
1963
1963
  inverted: h = !1,
1964
1964
  form: m,
1965
1965
  ...y
1966
- } = e, S = k.useRef(/* @__PURE__ */ new Set()), v = k.useRef(0), b = s === "horizontal" ? Hr : $r, [I = [], R] = Et({
1966
+ } = e, S = k.useRef(/* @__PURE__ */ new Set()), v = k.useRef(0), b = s === "horizontal" ? Fr : Kr, [I = [], R] = It({
1967
1967
  prop: p,
1968
1968
  defaultProp: f,
1969
1969
  onChange: (A) => {
@@ -1972,21 +1972,21 @@ var tn = ["PageUp", "PageDown"], nn = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
1972
1972
  }
1973
1973
  }), M = k.useRef(I);
1974
1974
  function w(A) {
1975
- const L = qr(I, A);
1976
- $(A, L);
1975
+ const N = Ur(I, A);
1976
+ V(A, N);
1977
1977
  }
1978
1978
  function X(A) {
1979
- $(A, v.current);
1979
+ V(A, v.current);
1980
1980
  }
1981
1981
  function j() {
1982
1982
  const A = M.current[v.current];
1983
1983
  I[v.current] !== A && c(I);
1984
1984
  }
1985
- function $(A, L, { commit: W } = { commit: !1 }) {
1986
- const V = Wr(o), T = Xr(Math.round((A - r) / o) * o + r, V), H = It(T, [r, i]);
1985
+ function V(A, N, { commit: W } = { commit: !1 }) {
1986
+ const $ = jr(o), T = Qr(Math.round((A - r) / o) * o + r, $), H = Rt(T, [r, i]);
1987
1987
  R((Y = []) => {
1988
- const G = Kr(Y, H, L);
1989
- if (Ur(G, l * o)) {
1988
+ const G = Or(Y, H, N);
1989
+ if (Yr(G, a * o)) {
1990
1990
  v.current = G.indexOf(H);
1991
1991
  const re = String(G) !== String(Y);
1992
1992
  return re && W && c(G), re ? G : Y;
@@ -1995,11 +1995,11 @@ var tn = ["PageUp", "PageDown"], nn = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
1995
1995
  });
1996
1996
  }
1997
1997
  return /* @__PURE__ */ _(
1998
- Tr,
1998
+ $r,
1999
1999
  {
2000
2000
  scope: e.__scopeSlider,
2001
2001
  name: n,
2002
- disabled: a,
2002
+ disabled: l,
2003
2003
  min: r,
2004
2004
  max: i,
2005
2005
  valueIndexToChangeRef: v,
@@ -2010,25 +2010,25 @@ var tn = ["PageUp", "PageDown"], nn = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
2010
2010
  children: /* @__PURE__ */ _(Ze.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ _(Ze.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ _(
2011
2011
  b,
2012
2012
  {
2013
- "aria-disabled": a,
2014
- "data-disabled": a ? "" : void 0,
2013
+ "aria-disabled": l,
2014
+ "data-disabled": l ? "" : void 0,
2015
2015
  ...y,
2016
2016
  ref: t,
2017
2017
  onPointerDown: pe(y.onPointerDown, () => {
2018
- a || (M.current = I);
2018
+ l || (M.current = I);
2019
2019
  }),
2020
2020
  min: r,
2021
2021
  max: i,
2022
2022
  inverted: h,
2023
- onSlideStart: a ? void 0 : w,
2024
- onSlideMove: a ? void 0 : X,
2025
- onSlideEnd: a ? void 0 : j,
2026
- onHomeKeyDown: () => !a && $(r, 0, { commit: !0 }),
2027
- onEndKeyDown: () => !a && $(i, I.length - 1, { commit: !0 }),
2028
- onStepKeyDown: ({ event: A, direction: L }) => {
2029
- if (!a) {
2030
- const T = tn.includes(A.key) || A.shiftKey && nn.includes(A.key) ? 10 : 1, H = v.current, Y = I[H], G = o * T * L;
2031
- $(Y + G, H, { commit: !0 });
2023
+ onSlideStart: l ? void 0 : w,
2024
+ onSlideMove: l ? void 0 : X,
2025
+ onSlideEnd: l ? void 0 : j,
2026
+ onHomeKeyDown: () => !l && V(r, 0, { commit: !0 }),
2027
+ onEndKeyDown: () => !l && V(i, I.length - 1, { commit: !0 }),
2028
+ onStepKeyDown: ({ event: A, direction: N }) => {
2029
+ if (!l) {
2030
+ const T = nn.includes(A.key) || A.shiftKey && rn.includes(A.key) ? 10 : 1, H = v.current, Y = I[H], G = o * T * N;
2031
+ V(Y + G, H, { commit: !0 });
2032
2032
  }
2033
2033
  }
2034
2034
  }
@@ -2037,13 +2037,13 @@ var tn = ["PageUp", "PageDown"], nn = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
2037
2037
  );
2038
2038
  }
2039
2039
  );
2040
- sn.displayName = we;
2041
- var [an, ln] = on(we, {
2040
+ ln.displayName = we;
2041
+ var [an, cn] = sn(we, {
2042
2042
  startEdge: "left",
2043
2043
  endEdge: "right",
2044
2044
  size: "width",
2045
2045
  direction: 1
2046
- }), Hr = k.forwardRef(
2046
+ }), Fr = k.forwardRef(
2047
2047
  (e, t) => {
2048
2048
  const {
2049
2049
  min: n,
@@ -2051,13 +2051,13 @@ var [an, ln] = on(we, {
2051
2051
  dir: i,
2052
2052
  inverted: o,
2053
2053
  onSlideStart: s,
2054
- onSlideMove: a,
2055
- onSlideEnd: l,
2054
+ onSlideMove: l,
2055
+ onSlideEnd: a,
2056
2056
  onStepKeyDown: f,
2057
2057
  ...p
2058
- } = e, [u, c] = k.useState(null), h = Pe(t, (b) => c(b)), m = k.useRef(void 0), y = Bn(i), S = y === "ltr", v = S && !o || !S && o;
2058
+ } = e, [u, c] = k.useState(null), h = Pe(t, (b) => c(b)), m = k.useRef(void 0), y = Gn(i), S = y === "ltr", v = S && !o || !S && o;
2059
2059
  function D(b) {
2060
- const I = m.current || u.getBoundingClientRect(), R = [0, I.width], w = lt(R, v ? [n, r] : [r, n]);
2060
+ const I = m.current || u.getBoundingClientRect(), R = [0, I.width], w = ct(R, v ? [n, r] : [r, n]);
2061
2061
  return m.current = I, w(b - I.left);
2062
2062
  }
2063
2063
  return /* @__PURE__ */ _(
@@ -2069,7 +2069,7 @@ var [an, ln] = on(we, {
2069
2069
  direction: v ? 1 : -1,
2070
2070
  size: "width",
2071
2071
  children: /* @__PURE__ */ _(
2072
- cn,
2072
+ un,
2073
2073
  {
2074
2074
  dir: y,
2075
2075
  "data-orientation": "horizontal",
@@ -2085,13 +2085,13 @@ var [an, ln] = on(we, {
2085
2085
  },
2086
2086
  onSlideMove: (b) => {
2087
2087
  const I = D(b.clientX);
2088
- a == null || a(I);
2088
+ l == null || l(I);
2089
2089
  },
2090
2090
  onSlideEnd: () => {
2091
- m.current = void 0, l == null || l();
2091
+ m.current = void 0, a == null || a();
2092
2092
  },
2093
2093
  onStepKeyDown: (b) => {
2094
- const R = rn[v ? "from-left" : "from-right"].includes(b.key);
2094
+ const R = on[v ? "from-left" : "from-right"].includes(b.key);
2095
2095
  f == null || f({ event: b, direction: R ? -1 : 1 });
2096
2096
  }
2097
2097
  }
@@ -2099,7 +2099,7 @@ var [an, ln] = on(we, {
2099
2099
  }
2100
2100
  );
2101
2101
  }
2102
- ), $r = k.forwardRef(
2102
+ ), Kr = k.forwardRef(
2103
2103
  (e, t) => {
2104
2104
  const {
2105
2105
  min: n,
@@ -2107,12 +2107,12 @@ var [an, ln] = on(we, {
2107
2107
  inverted: i,
2108
2108
  onSlideStart: o,
2109
2109
  onSlideMove: s,
2110
- onSlideEnd: a,
2111
- onStepKeyDown: l,
2110
+ onSlideEnd: l,
2111
+ onStepKeyDown: a,
2112
2112
  ...f
2113
2113
  } = e, p = k.useRef(null), u = Pe(t, p), c = k.useRef(void 0), h = !i;
2114
2114
  function m(y) {
2115
- const S = c.current || p.current.getBoundingClientRect(), v = [0, S.height], b = lt(v, h ? [r, n] : [n, r]);
2115
+ const S = c.current || p.current.getBoundingClientRect(), v = [0, S.height], b = ct(v, h ? [r, n] : [n, r]);
2116
2116
  return c.current = S, b(y - S.top);
2117
2117
  }
2118
2118
  return /* @__PURE__ */ _(
@@ -2124,7 +2124,7 @@ var [an, ln] = on(we, {
2124
2124
  size: "height",
2125
2125
  direction: h ? 1 : -1,
2126
2126
  children: /* @__PURE__ */ _(
2127
- cn,
2127
+ un,
2128
2128
  {
2129
2129
  "data-orientation": "vertical",
2130
2130
  ...f,
@@ -2142,18 +2142,18 @@ var [an, ln] = on(we, {
2142
2142
  s == null || s(S);
2143
2143
  },
2144
2144
  onSlideEnd: () => {
2145
- c.current = void 0, a == null || a();
2145
+ c.current = void 0, l == null || l();
2146
2146
  },
2147
2147
  onStepKeyDown: (y) => {
2148
- const v = rn[h ? "from-bottom" : "from-top"].includes(y.key);
2149
- l == null || l({ event: y, direction: v ? -1 : 1 });
2148
+ const v = on[h ? "from-bottom" : "from-top"].includes(y.key);
2149
+ a == null || a({ event: y, direction: v ? -1 : 1 });
2150
2150
  }
2151
2151
  }
2152
2152
  )
2153
2153
  }
2154
2154
  );
2155
2155
  }
2156
- ), cn = k.forwardRef(
2156
+ ), un = k.forwardRef(
2157
2157
  (e, t) => {
2158
2158
  const {
2159
2159
  __scopeSlider: n,
@@ -2161,8 +2161,8 @@ var [an, ln] = on(we, {
2161
2161
  onSlideMove: i,
2162
2162
  onSlideEnd: o,
2163
2163
  onHomeKeyDown: s,
2164
- onEndKeyDown: a,
2165
- onStepKeyDown: l,
2164
+ onEndKeyDown: l,
2165
+ onStepKeyDown: a,
2166
2166
  ...f
2167
2167
  } = e, p = qe(we, n);
2168
2168
  return /* @__PURE__ */ _(
@@ -2171,7 +2171,7 @@ var [an, ln] = on(we, {
2171
2171
  ...f,
2172
2172
  ref: t,
2173
2173
  onKeyDown: pe(e.onKeyDown, (u) => {
2174
- u.key === "Home" ? (s(u), u.preventDefault()) : u.key === "End" ? (a(u), u.preventDefault()) : tn.concat(nn).includes(u.key) && (l(u), u.preventDefault());
2174
+ u.key === "Home" ? (s(u), u.preventDefault()) : u.key === "End" ? (l(u), u.preventDefault()) : nn.concat(rn).includes(u.key) && (a(u), u.preventDefault());
2175
2175
  }),
2176
2176
  onPointerDown: pe(e.onPointerDown, (u) => {
2177
2177
  const c = u.target;
@@ -2187,9 +2187,9 @@ var [an, ln] = on(we, {
2187
2187
  }
2188
2188
  );
2189
2189
  }
2190
- ), un = "SliderTrack", dn = k.forwardRef(
2190
+ ), dn = "SliderTrack", fn = k.forwardRef(
2191
2191
  (e, t) => {
2192
- const { __scopeSlider: n, ...r } = e, i = qe(un, n);
2192
+ const { __scopeSlider: n, ...r } = e, i = qe(dn, n);
2193
2193
  return /* @__PURE__ */ _(
2194
2194
  ze.span,
2195
2195
  {
@@ -2201,19 +2201,19 @@ var [an, ln] = on(we, {
2201
2201
  );
2202
2202
  }
2203
2203
  );
2204
- dn.displayName = un;
2205
- var et = "SliderRange", fn = k.forwardRef(
2204
+ fn.displayName = dn;
2205
+ var et = "SliderRange", pn = k.forwardRef(
2206
2206
  (e, t) => {
2207
- const { __scopeSlider: n, ...r } = e, i = qe(et, n), o = ln(et, n), s = k.useRef(null), a = Pe(t, s), l = i.values.length, f = i.values.map(
2208
- (c) => gn(c, i.min, i.max)
2209
- ), p = l > 1 ? Math.min(...f) : 0, u = 100 - Math.max(...f);
2207
+ const { __scopeSlider: n, ...r } = e, i = qe(et, n), o = cn(et, n), s = k.useRef(null), l = Pe(t, s), a = i.values.length, f = i.values.map(
2208
+ (c) => hn(c, i.min, i.max)
2209
+ ), p = a > 1 ? Math.min(...f) : 0, u = 100 - Math.max(...f);
2210
2210
  return /* @__PURE__ */ _(
2211
2211
  ze.span,
2212
2212
  {
2213
2213
  "data-orientation": i.orientation,
2214
2214
  "data-disabled": i.disabled ? "" : void 0,
2215
2215
  ...r,
2216
- ref: a,
2216
+ ref: l,
2217
2217
  style: {
2218
2218
  ...e.style,
2219
2219
  [o.startEdge]: p + "%",
@@ -2223,30 +2223,30 @@ var et = "SliderRange", fn = k.forwardRef(
2223
2223
  );
2224
2224
  }
2225
2225
  );
2226
- fn.displayName = et;
2227
- var tt = "SliderThumb", pn = k.forwardRef(
2226
+ pn.displayName = et;
2227
+ var tt = "SliderThumb", mn = k.forwardRef(
2228
2228
  (e, t) => {
2229
- const n = _r(e.__scopeSlider), [r, i] = k.useState(null), o = Pe(t, (a) => i(a)), s = k.useMemo(
2230
- () => r ? n().findIndex((a) => a.ref.current === r) : -1,
2229
+ const n = Hr(e.__scopeSlider), [r, i] = k.useState(null), o = Pe(t, (l) => i(l)), s = k.useMemo(
2230
+ () => r ? n().findIndex((l) => l.ref.current === r) : -1,
2231
2231
  [n, r]
2232
2232
  );
2233
- return /* @__PURE__ */ _(Vr, { ...e, ref: o, index: s });
2233
+ return /* @__PURE__ */ _(Br, { ...e, ref: o, index: s });
2234
2234
  }
2235
- ), Vr = k.forwardRef(
2235
+ ), Br = k.forwardRef(
2236
2236
  (e, t) => {
2237
- const { __scopeSlider: n, index: r, name: i, ...o } = e, s = qe(tt, n), a = ln(tt, n), [l, f] = k.useState(null), p = Pe(t, (D) => f(D)), u = l ? s.form || !!l.closest("form") : !0, c = qn(l), h = s.values[r], m = h === void 0 ? 0 : gn(h, s.min, s.max), y = Br(r, s.values.length), S = c == null ? void 0 : c[a.size], v = S ? Gr(S, m, a.direction) : 0;
2237
+ const { __scopeSlider: n, index: r, name: i, ...o } = e, s = qe(tt, n), l = cn(tt, n), [a, f] = k.useState(null), p = Pe(t, (D) => f(D)), u = a ? s.form || !!a.closest("form") : !0, c = Un(a), h = s.values[r], m = h === void 0 ? 0 : hn(h, s.min, s.max), y = Gr(r, s.values.length), S = c == null ? void 0 : c[l.size], v = S ? Wr(S, m, l.direction) : 0;
2238
2238
  return k.useEffect(() => {
2239
- if (l)
2240
- return s.thumbs.add(l), () => {
2241
- s.thumbs.delete(l);
2239
+ if (a)
2240
+ return s.thumbs.add(a), () => {
2241
+ s.thumbs.delete(a);
2242
2242
  };
2243
- }, [l, s.thumbs]), /* @__PURE__ */ De(
2243
+ }, [a, s.thumbs]), /* @__PURE__ */ De(
2244
2244
  "span",
2245
2245
  {
2246
2246
  style: {
2247
2247
  transform: "var(--radix-slider-thumb-transform)",
2248
2248
  position: "absolute",
2249
- [a.startEdge]: `calc(${m}% + ${v}px)`
2249
+ [l.startEdge]: `calc(${m}% + ${v}px)`
2250
2250
  },
2251
2251
  children: [
2252
2252
  /* @__PURE__ */ _(Ze.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ _(
@@ -2270,7 +2270,7 @@ var tt = "SliderThumb", pn = k.forwardRef(
2270
2270
  }
2271
2271
  ) }),
2272
2272
  u && /* @__PURE__ */ _(
2273
- mn,
2273
+ gn,
2274
2274
  {
2275
2275
  name: i ?? (s.name ? s.name + (s.values.length > 1 ? "[]" : "") : void 0),
2276
2276
  form: s.form,
@@ -2283,17 +2283,17 @@ var tt = "SliderThumb", pn = k.forwardRef(
2283
2283
  );
2284
2284
  }
2285
2285
  );
2286
- pn.displayName = tt;
2287
- var Fr = "RadioBubbleInput", mn = k.forwardRef(
2286
+ mn.displayName = tt;
2287
+ var qr = "RadioBubbleInput", gn = k.forwardRef(
2288
2288
  ({ __scopeSlider: e, value: t, ...n }, r) => {
2289
- const i = k.useRef(null), o = Pe(i, r), s = Gn(t);
2289
+ const i = k.useRef(null), o = Pe(i, r), s = Wn(t);
2290
2290
  return k.useEffect(() => {
2291
- const a = i.current;
2292
- if (!a) return;
2293
- const l = window.HTMLInputElement.prototype, p = Object.getOwnPropertyDescriptor(l, "value").set;
2291
+ const l = i.current;
2292
+ if (!l) return;
2293
+ const a = window.HTMLInputElement.prototype, p = Object.getOwnPropertyDescriptor(a, "value").set;
2294
2294
  if (s !== t && p) {
2295
2295
  const u = new Event("input", { bubbles: !0 });
2296
- p.call(a, t), a.dispatchEvent(u);
2296
+ p.call(l, t), l.dispatchEvent(u);
2297
2297
  }
2298
2298
  }, [s, t]), /* @__PURE__ */ _(
2299
2299
  ze.input,
@@ -2306,78 +2306,99 @@ var Fr = "RadioBubbleInput", mn = k.forwardRef(
2306
2306
  );
2307
2307
  }
2308
2308
  );
2309
- mn.displayName = Fr;
2310
- function Kr(e = [], t, n) {
2309
+ gn.displayName = qr;
2310
+ function Or(e = [], t, n) {
2311
2311
  const r = [...e];
2312
2312
  return r[n] = t, r.sort((i, o) => i - o);
2313
2313
  }
2314
- function gn(e, t, n) {
2314
+ function hn(e, t, n) {
2315
2315
  const o = 100 / (n - t) * (e - t);
2316
- return It(o, [0, 100]);
2316
+ return Rt(o, [0, 100]);
2317
2317
  }
2318
- function Br(e, t) {
2318
+ function Gr(e, t) {
2319
2319
  return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
2320
2320
  }
2321
- function qr(e, t) {
2321
+ function Ur(e, t) {
2322
2322
  if (e.length === 1) return 0;
2323
2323
  const n = e.map((i) => Math.abs(i - t)), r = Math.min(...n);
2324
2324
  return n.indexOf(r);
2325
2325
  }
2326
- function Gr(e, t, n) {
2327
- const r = e / 2, o = lt([0, 50], [0, r]);
2326
+ function Wr(e, t, n) {
2327
+ const r = e / 2, o = ct([0, 50], [0, r]);
2328
2328
  return (r - o(t) * n) * n;
2329
2329
  }
2330
- function Or(e) {
2330
+ function Xr(e) {
2331
2331
  return e.slice(0, -1).map((t, n) => e[n + 1] - t);
2332
2332
  }
2333
- function Ur(e, t) {
2333
+ function Yr(e, t) {
2334
2334
  if (t > 0) {
2335
- const n = Or(e);
2335
+ const n = Xr(e);
2336
2336
  return Math.min(...n) >= t;
2337
2337
  }
2338
2338
  return !0;
2339
2339
  }
2340
- function lt(e, t) {
2340
+ function ct(e, t) {
2341
2341
  return (n) => {
2342
2342
  if (e[0] === e[1] || t[0] === t[1]) return t[0];
2343
2343
  const r = (t[1] - t[0]) / (e[1] - e[0]);
2344
2344
  return t[0] + r * (n - e[0]);
2345
2345
  };
2346
2346
  }
2347
- function Wr(e) {
2347
+ function jr(e) {
2348
2348
  return (String(e).split(".")[1] || "").length;
2349
2349
  }
2350
- function Xr(e, t) {
2350
+ function Qr(e, t) {
2351
2351
  const n = Math.pow(10, t);
2352
2352
  return Math.round(e * n) / n;
2353
2353
  }
2354
- var hn = sn, Yr = dn, jr = fn, Qr = pn;
2355
- const Jr = k.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ De(
2356
- hn,
2354
+ var yn = ln, Jr = fn, Zr = pn, eo = mn;
2355
+ const to = k.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ De(
2356
+ yn,
2357
2357
  {
2358
2358
  ref: n,
2359
- className: rt(
2359
+ className: ot(
2360
2360
  "relative flex w-full touch-none select-none items-center",
2361
2361
  e
2362
2362
  ),
2363
2363
  ...t,
2364
2364
  children: [
2365
- /* @__PURE__ */ _(Yr, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ _(jr, { className: "absolute h-full bg-primary" }) }),
2366
- /* @__PURE__ */ _(Qr, { className: "block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" })
2365
+ /* @__PURE__ */ _(Jr, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ _(Zr, { className: "absolute h-full bg-primary" }) }),
2366
+ /* @__PURE__ */ _(eo, { className: "block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" })
2367
2367
  ]
2368
2368
  }
2369
2369
  ));
2370
- Jr.displayName = hn.displayName;
2370
+ to.displayName = yn.displayName;
2371
+ const no = bt(null), ro = $n();
2372
+ function vn(e) {
2373
+ const t = nt(no) ?? ro;
2374
+ return Cn(t.subscribe, () => e(t.get()), () => e(null));
2375
+ }
2376
+ function bo(e) {
2377
+ return vn(
2378
+ O((t) => (t == null ? void 0 : t.slot.zone) === e ? t.outcome : null, [e])
2379
+ );
2380
+ }
2381
+ function zo(e, t, n) {
2382
+ return vn(
2383
+ O(
2384
+ (r) => (r == null ? void 0 : r.slot.zone) !== e || r.outcome.kind === "refused" ? null : r.slot.beforeId === t ? "top" : !r.slot.beforeId && n ? "bottom" : null,
2385
+ [e, t, n]
2386
+ )
2387
+ );
2388
+ }
2371
2389
  export {
2372
- go as E,
2373
- fo as F,
2374
- Jn as P,
2375
- po as S,
2376
- Nr as T,
2377
- Pr as a,
2378
- Cr as b,
2379
- mo as c,
2380
- Jr as d,
2381
- Qt as r,
2382
- Yt as u
2390
+ xo as E,
2391
+ yo as F,
2392
+ tr as P,
2393
+ vo as S,
2394
+ Tr as T,
2395
+ Er as a,
2396
+ Rr as b,
2397
+ So as c,
2398
+ to as d,
2399
+ bo as e,
2400
+ zo as f,
2401
+ no as g,
2402
+ Jt as r,
2403
+ jt as u
2383
2404
  };