@sheetxl/utils-react 0.7.20 → 0.7.22

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,26 +1,26 @@
1
1
  /**
2
- * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.20
2
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.22
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import { CommonUtils as t, DefaultNotifier as e, Notifier as n, InternalClipboard as o, ClipboardUtils as r, MimeType as i } from "@sheetxl/utils";
8
- import * as s from "detect-it";
9
- import l, { useRef as a, useReducer as c, useMemo as h, useEffect as u, useState as d, memo as p, forwardRef as m, useCallback as f, createContext as _, useContext as g, useLayoutEffect as y, createElement as v, useImperativeHandle as w, Component as b } from "react";
7
+ import t, { useRef as e, useReducer as n, useMemo as o, useEffect as r, useState as i, memo as s, forwardRef as l, useCallback as a, createContext as c, useContext as h, useLayoutEffect as u, createElement as d, useImperativeHandle as p, Component as m } from "react";
8
+ import { CommonUtils as f, DefaultNotifier as _, Notifier as g, InternalClipboard as y, ClipboardUtils as v, MimeType as w } from "@sheetxl/utils";
9
+ import * as b from "detect-it";
10
10
  import { jsx as x, jsxs as S, Fragment as E } from "react/jsx-runtime";
11
11
  import { mergeRefs as L } from "react-merge-refs";
12
12
  import { useMeasure as M } from "react-use";
13
13
  import T from "clsx";
14
14
  import { createRoot as C } from "react-dom/client";
15
- import { unstable_batchedUpdates as k, createPortal as P } from "react-dom";
16
- const D = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, z = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, A = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219 }, B = { Left: 1, Middle: 2, Right: 3 };
15
+ import { unstable_batchedUpdates as k, createPortal as D } from "react-dom";
16
+ const P = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, z = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, A = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219, Composition: 229 }, B = { Left: 1, Middle: 2, Right: 3 };
17
17
  class $ {
18
18
  constructor(t2, e2, n2, o2) {
19
19
  this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = t2, this._target = e2, this._applyProps(n2 || {}), this._callback = o2, void 0 === o2 && (this._callback = () => {
20
- console.log(`implement: ${this.label()} : ${this.description()}`);
20
+ console.log(`implement: ${this.getLabel()} : ${this.getDescription()}`);
21
21
  });
22
22
  }
23
- key() {
23
+ getKey() {
24
24
  return this._key;
25
25
  }
26
26
  _resolve(t2, e2) {
@@ -30,10 +30,10 @@ class $ {
30
30
  }
31
31
  return t2;
32
32
  }
33
- target() {
33
+ getTarget() {
34
34
  return "function" == typeof this._target ? this._target() : this._target;
35
35
  }
36
- label(t2, e2) {
36
+ getLabel(t2, e2) {
37
37
  const n2 = this._scopedLabels?.[t2] || this._label;
38
38
  let o2 = null;
39
39
  if ("function" == typeof n2) {
@@ -42,25 +42,25 @@ class $ {
42
42
  } else o2 = n2;
43
43
  return o2;
44
44
  }
45
- description(t2) {
45
+ getDescription(t2) {
46
46
  return this._resolve(this._description, t2);
47
47
  }
48
- tags(t2) {
48
+ getTags(t2) {
49
49
  return this._resolve(this._tags, t2);
50
50
  }
51
- icon(t2) {
51
+ getIcon(t2) {
52
52
  return this._resolve(this._icon, t2);
53
53
  }
54
- shortcut() {
54
+ getShortcut() {
55
55
  return this._resolve(this._shortcut);
56
56
  }
57
57
  disabled() {
58
58
  return this._resolve(this._disabled) || !this._callback;
59
59
  }
60
- state() {
60
+ getState() {
61
61
  return this._resolve(this._state);
62
62
  }
63
- context() {
63
+ getContext() {
64
64
  return "function" == typeof this._context ? this._context() : this._context;
65
65
  }
66
66
  async execute(t2, e2) {
@@ -128,11 +128,39 @@ class $ {
128
128
  }
129
129
  class K extends $ {
130
130
  }
131
- const O = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), I = {};
132
- function N() {
133
- return s;
131
+ function I(t2, i2 = null) {
132
+ const s2 = e(i2);
133
+ s2.current = i2;
134
+ const [l2, a2] = n((t3) => t3 + 1, 0), c2 = o(() => Array.isArray(t2) ? t2 : [t2], [t2]);
135
+ return r(() => {
136
+ const t3 = c2 ? c2.length : 0;
137
+ if (0 === t3) return;
138
+ const e2 = (t4, e3) => {
139
+ s2.current?.onChange?.(e3), a2();
140
+ };
141
+ let n2 = null;
142
+ i2 && (n2 = { onExecute(t4, e3) {
143
+ s2.current?.onExecute?.(t4, e3);
144
+ }, onError(t4, e3, n3) {
145
+ s2.current?.onError?.(t4, e3, n3);
146
+ } });
147
+ const o2 = /* @__PURE__ */ new Set();
148
+ for (let r2 = 0; r2 < t3; r2++) {
149
+ const t4 = c2[r2];
150
+ t4 && (o2.add(t4.addPropertyListener(f.debounce(e2, 0), true)), i2 && o2.add(t4.addExecuteListener(n2)));
151
+ }
152
+ return () => {
153
+ o2.forEach((t4) => {
154
+ t4?.();
155
+ });
156
+ };
157
+ }, [t2]), l2;
158
+ }
159
+ const O = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), N = {};
160
+ function H() {
161
+ return b;
134
162
  }
135
- const H = (e2) => "BracketLeft" === e2 ? "[" : "BracketRight" === e2 ? "]" : t.camelToPrettyCase(e2), R = (t2, e2) => {
163
+ const R = (t2) => "BracketLeft" === t2 ? "[" : "BracketRight" === t2 ? "]" : f.camelToPrettyCase(t2), W = (t2, e2) => {
136
164
  let n2 = false, o2 = false;
137
165
  const r2 = { nativeEvent: t2, currentTarget: e2 || t2.currentTarget, target: t2.target, bubbles: t2.bubbles, cancelable: t2.cancelable, defaultPrevented: t2.defaultPrevented, eventPhase: t2.eventPhase, isTrusted: t2.isTrusted, preventDefault: () => {
138
166
  n2 = true, t2.preventDefault();
@@ -142,16 +170,16 @@ const H = (e2) => "BracketLeft" === e2 ? "[" : "BracketRight" === e2 ? "]" : t.c
142
170
  }, timeStamp: t2.timeStamp, type: t2.type };
143
171
  for (const e3 in t2) e3 in r2 || "function" == typeof t2[e3] || (r2[e3] = t2[e3]);
144
172
  return r2;
145
- }, W = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: I, boundPixel: function(t2, e2 = false, n2 = 0) {
173
+ }, V = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: N, boundPixel: function(t2, e2 = false, n2 = 0) {
146
174
  return t2;
147
- }, createSyntheticEvent: R, detectIt: N, focusableNodeNames: O, toPrettyKeyCode: H }, Symbol.toStringTag, { value: "Module" }));
148
- class V {
149
- constructor(e2, n2) {
150
- this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = t.uuidV4(), this._target = e2, this._groupKey = n2 ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(n2, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
151
- const o2 = this;
152
- this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (t2, e3) => {
153
- const n3 = o2._root._listenersByKey, r2 = e3.key(), i2 = n3.get(r2);
154
- i2 && o2._notifyCommands(i2, "onCommandChange", e3);
175
+ }, createSyntheticEvent: W, detectIt: H, focusableNodeNames: O, toPrettyKeyCode: R }, Symbol.toStringTag, { value: "Module" }));
176
+ class F {
177
+ constructor(t2, e2) {
178
+ this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = f.uuidV4(), this._target = t2, this._groupKey = e2 ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(e2, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
179
+ const n2 = this;
180
+ this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (t3, e3) => {
181
+ const o2 = n2._root._listenersByKey, r2 = e3.getKey(), i2 = o2.get(r2);
182
+ i2 && n2._notifyCommands(i2, "onCommandChange", e3);
155
183
  };
156
184
  }
157
185
  _getCommand(t2) {
@@ -173,7 +201,7 @@ class V {
173
201
  n3 && (o2 = n3), t3 = t3._parent;
174
202
  }
175
203
  }
176
- o2 || (o2 = new V(t2, e2), o2._parent = this, o2._root = this._root, o2._unListenersByCommand = null, o2._listenersByKey = null, o2._commandsPropertyListener = null);
204
+ o2 || (o2 = new F(t2, e2), o2._parent = this, o2._root = this._root, o2._unListenersByCommand = null, o2._listenersByKey = null, o2._commandsPropertyListener = null);
177
205
  const r2 = (t3, o3) => {
178
206
  !t3.has(e2) || n2 ? t3.set(e2, o3) : void 0 === n2 && console.warn("commandGroup already registered", e2);
179
207
  };
@@ -189,23 +217,23 @@ class V {
189
217
  return this._nodes.get(t2);
190
218
  }
191
219
  _addCommands(t2, e2 = void 0) {
192
- const n2 = this._commandsByKey, o2 = this._commandsByShortcut, r2 = this._root._commandsPropertyListener, i2 = this._root._unListenersByCommand;
193
- for (let s2 = 0; s2 < t2.length; s2++) {
194
- const l2 = t2[s2], a2 = l2.key();
220
+ const n2 = this._commandsByKey, o2 = this._commandsByShortcut, r2 = this._root._commandsPropertyListener, i2 = this._root._unListenersByCommand, s2 = t2.length;
221
+ for (let l2 = 0; l2 < s2; l2++) {
222
+ const s3 = t2[l2], a2 = s3.getKey();
195
223
  if (n2.has(a2) && !e2) {
196
224
  void 0 === e2 && console.warn("command already registered", a2);
197
225
  continue;
198
226
  }
199
- n2.set(a2, l2);
200
- let c2 = i2.get(l2);
201
- c2 && (c2(), i2.delete(l2));
202
- const h2 = l2.addPropertyListener(r2);
203
- i2.set(l2, h2);
204
- const u2 = l2.shortcut();
227
+ n2.set(a2, s3);
228
+ let c2 = i2.get(s3);
229
+ c2 && (c2(), i2.delete(s3));
230
+ const h2 = s3.addPropertyListener(r2);
231
+ i2.set(s3, h2);
232
+ const u2 = s3.getShortcut();
205
233
  if (!u2) continue;
206
- const d2 = Array.isArray(u2) ? u2 : [u2];
207
- for (let t3 = 0; t3 < d2.length; t3++) {
208
- const n3 = X(d2[t3]), r3 = o2.get(n3);
234
+ const d2 = Array.isArray(u2) ? u2 : [u2], p2 = d2.length;
235
+ for (let t3 = 0; t3 < p2; t3++) {
236
+ const n3 = Y(d2[t3]), r3 = o2.get(n3);
209
237
  r3 && !e2 && void 0 === e2 && console.warn(`Shortcut already registered: ${n3}, ${a2}, ${r3}.`), o2.set(n3, a2);
210
238
  }
211
239
  }
@@ -218,7 +246,8 @@ class V {
218
246
  t2 = this._parent;
219
247
  const o2 = (t3) => {
220
248
  t3._children.forEach((t4) => {
221
- for (let n3 = 0; n3 < e2.length; n3++) t4._nodes.delete(e2[n3]);
249
+ const n3 = e2.length, r2 = t4._nodes;
250
+ for (let t5 = 0; t5 < n3; t5++) r2.delete(e2[t5]);
222
251
  o2(t4);
223
252
  });
224
253
  };
@@ -240,12 +269,12 @@ class V {
240
269
  findCommandByEvent(t2) {
241
270
  const e2 = [];
242
271
  t2.altKey && e2.push(z.Alt), t2.shiftKey && e2.push(z.Shift), t2.ctrlKey && e2.push(z.Ctrl), t2.metaKey && e2.push(z.Meta);
243
- let n2 = X({ key: t2.code, modifiers: e2 });
272
+ let n2 = Y({ key: t2.code, modifiers: e2 });
244
273
  const o2 = this._commandsByShortcut;
245
274
  let r2 = o2.get(n2);
246
- r2 || (n2 = X({ key: t2.key, modifiers: e2 }), r2 = o2.get(n2)), !r2 && t2.code.startsWith("Digit") && (n2 = X({ key: t2.code.substring(5, t2.code.length), modifiers: e2 }), r2 = this._commandsByShortcut.get(n2)), !r2 && t2.code.startsWith("Key") && (r2 = X({ key: t2.code.substring(3, t2.code.length), modifiers: e2 }), r2 = o2.get(n2));
275
+ r2 || (n2 = Y({ key: t2.key, modifiers: e2 }), r2 = o2.get(n2)), !r2 && t2.code.startsWith("Digit") && (n2 = Y({ key: t2.code.substring(5, t2.code.length), modifiers: e2 }), r2 = this._commandsByShortcut.get(n2)), !r2 && t2.code.startsWith("Key") && (r2 = Y({ key: t2.code.substring(3, t2.code.length), modifiers: e2 }), r2 = o2.get(n2));
247
276
  let i2 = null;
248
- return r2 && (i2 = this._commandsByKey.get(r2), i2 && i2.disabled() && (i2 = null), !i2 || i2.target() && i2.target().contains(t2.target) || (i2 = null)), i2 || (this._parent?.findCommandByEvent(t2) ?? null);
277
+ return r2 && (i2 = this._commandsByKey.get(r2), i2 && i2.disabled() && (i2 = null), !i2 || i2.getTarget() && i2.getTarget().contains(t2.target) || (i2 = null)), i2 || (this._parent?.findCommandByEvent(t2) ?? null);
249
278
  }
250
279
  dispatchToFocusedCommand(t2) {
251
280
  const e2 = this.getActive();
@@ -264,15 +293,21 @@ class V {
264
293
  const n2 = this._listeners, o2 = e2?.keys, r2 = this._root._listenersByKey;
265
294
  if (o2 && !t2.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
266
295
  let i2 = null;
267
- if (o2) for (let e3 = 0; e3 < o2.length; e3++) {
268
- const n3 = o2[e3];
269
- if (!n3) continue;
270
- let s2 = r2.get(n3);
271
- s2 || (s2 = /* @__PURE__ */ new Set(), r2.set(n3, s2)), i2 || (i2 = []), i2.push(s2), s2.add(t2);
296
+ if (o2) {
297
+ const e3 = o2.length;
298
+ for (let n3 = 0; n3 < e3; n3++) {
299
+ const e4 = o2[n3];
300
+ if (!e4) continue;
301
+ let s2 = r2.get(e4);
302
+ s2 || (s2 = /* @__PURE__ */ new Set(), r2.set(e4, s2)), i2 || (i2 = []), i2.push(s2), s2.add(t2);
303
+ }
272
304
  }
273
305
  return n2.add(t2), () => {
274
- if (i2) for (let e3 = 0; e3 < i2.length; e3++) {
275
- i2[e3].delete(t2);
306
+ if (i2) {
307
+ const e3 = i2.length;
308
+ for (let n3 = 0; n3 < e3; n3++) {
309
+ i2[n3].delete(t2);
310
+ }
276
311
  }
277
312
  n2.delete(t2);
278
313
  };
@@ -302,134 +337,109 @@ class V {
302
337
  }), t2;
303
338
  }
304
339
  }
305
- const F = t.getOS() === t.OSType.MacOS || t.getOS() === t.OSType.IOS ? "Cmd" : "Ctrl", j = t.getOS() === t.OSType.MacOS || t.getOS() === t.OSType.IOS ? "⌘" : "^", X = (t2, e2 = false) => {
340
+ const j = f.getOS() === f.OSType.MacOS || f.getOS() === f.OSType.IOS ? "Cmd" : "Ctrl", X = f.getOS() === f.OSType.MacOS || f.getOS() === f.OSType.IOS ? "⌘" : "^", Y = (t2, e2 = false) => {
306
341
  const n2 = {};
307
342
  for (let e3 = 0; t2.modifiers && e3 < t2.modifiers.length; e3++) n2[t2.modifiers[e3]] = true;
308
343
  let o2 = "";
309
- return (n2?.[z.Ctrl] || n2?.[z.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? j : F)), n2?.[z.Alt] && (o2 += e2 ? "⌥" : "Alt"), n2?.[z.Shift] && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? "⇧" : "Shift")), o2 += (o2.length > 0 ? "+" : "") + H(t2.key), o2;
310
- };
311
- function Y(e2, n2 = null) {
312
- const o2 = a(n2);
313
- o2.current = n2;
314
- const [r2, i2] = c((t2) => t2 + 1, 0), s2 = h(() => Array.isArray(e2) ? e2 : [e2], [e2]);
315
- return u(() => {
316
- if (!s2 || 0 === s2.length) return;
317
- const e3 = (t2, e4) => {
318
- o2.current?.onChange?.(e4), i2();
319
- };
320
- let r3 = null;
321
- n2 && (r3 = { onExecute(t2, e4) {
322
- o2.current?.onExecute?.(t2, e4);
323
- }, onError(t2, e4, n3) {
324
- o2.current?.onError?.(t2, e4, n3);
325
- } });
326
- const l2 = /* @__PURE__ */ new Set();
327
- for (let o3 = 0; o3 < s2.length; o3++) l2.add(s2[o3]?.addPropertyListener(t.debounce(e3, 0), true)), n2 && l2.add(s2[o3]?.addExecuteListener(r3));
328
- return () => {
329
- l2.forEach((t2) => {
330
- t2?.();
331
- });
332
- };
333
- }, [e2]), r2;
334
- }
335
- const U = (e2, n2) => {
336
- if (!n2 || !e2 || 0 === n2.length) return t.EmptyArray;
337
- const o2 = n2.length, r2 = new Array(o2);
338
- for (let t2 = 0; t2 < o2; t2++) {
339
- const o3 = n2[t2], i2 = o3 ? e2.getCommand(o3) : null;
340
- r2[t2] = i2;
344
+ return (n2?.[z.Ctrl] || n2?.[z.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? X : j)), n2?.[z.Alt] && (o2 += e2 ? "⌥" : "Alt"), n2?.[z.Shift] && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? "⇧" : "Shift")), o2 += (o2.length > 0 ? "+" : "") + R(t2.key), o2;
345
+ }, U = (t2, e2) => {
346
+ if (!e2 || !t2 || 0 === e2.length) return f.EmptyArray;
347
+ const n2 = e2.length, o2 = new Array(n2);
348
+ for (let r2 = 0; r2 < n2; r2++) {
349
+ const n3 = e2[r2], i2 = n3 ? t2.getCommand(n3) : null;
350
+ o2[r2] = i2;
341
351
  }
342
- return r2;
352
+ return o2;
343
353
  };
344
- function G(t2, e2 = null, n2 = null, o2) {
345
- const r2 = a(n2);
346
- r2.current = n2, e2 && !Array.isArray(e2) && (e2 = [e2]);
347
- const [i2, s2] = d(U(t2, e2)), l2 = o2 ? [...o2, t2] : [t2];
348
- return u(() => {
349
- const n3 = { onGroupChange: () => {
350
- const n4 = U(t2, e2);
351
- s2(n4), r2.current?.onChange?.(this);
354
+ function G(t2, n2 = null, o2 = null, s2) {
355
+ const l2 = e(o2);
356
+ l2.current = o2, n2 && !Array.isArray(n2) && (n2 = [n2]);
357
+ const [a2, c2] = i(U(t2, n2)), h2 = s2 ? [...s2, t2] : [t2];
358
+ return r(() => {
359
+ const e2 = { onGroupChange: () => {
360
+ const e3 = U(t2, n2);
361
+ c2(e3), l2.current?.onChange?.(this);
352
362
  } };
353
363
  let o3;
354
- e2 && e2.length > 0 && (o3 = { keys: e2 }, n3.onCommandChange = (n4, o4) => {
355
- r2.current?.onChange?.(t2), s2(U(t2, e2));
364
+ n2 && n2.length > 0 && (o3 = { keys: n2 }, e2.onCommandChange = (e3, o4) => {
365
+ l2.current?.onChange?.(t2), c2(U(t2, n2));
356
366
  });
357
- const i3 = t2?.addListener(n3, o3), l3 = U(t2, e2);
358
- return s2(l3), r2.current?.onChange && r2.current?.onChange(t2), () => {
359
- i3?.();
367
+ const r2 = t2?.addListener(e2, o3), i2 = U(t2, n2);
368
+ return c2(i2), l2.current?.onChange && l2.current?.onChange(t2), () => {
369
+ r2?.();
360
370
  };
361
- }, l2), i2;
371
+ }, h2), a2;
362
372
  }
363
- const q = { Toolbar: "toolbar", Menuitem: "menuitem" }, Z = { BottomEnd: "bottom-end", BottomStart: "bottom-start", Bottom: "bottom", LeftEnd: "left-end", LeftStart: "left-start", Left: "left", RightEnd: "right-end", RightStart: "right-start", Right: "right", TopEnd: "top-end", TopStart: "top-start", Top: "top" }, J = p(m((t2, e2) => {
364
- const { refFocusStart: n2, ...o2 } = t2, r2 = a(null), i2 = f(() => {
365
- if (n2) return void n2?.current?.focus();
366
- const t3 = r2.current.parentElement.children;
367
- let e3 = [];
368
- const o3 = t3.length;
369
- for (let n3 = 0; n3 < o3 && t3[n3] !== r2.current; n3++) {
370
- const o4 = t3[n3], r3 = o4.getAttribute("tabindex");
373
+ const q = { Toolbar: "toolbar", Menuitem: "menuitem" }, Z = { BottomEnd: "bottom-end", BottomStart: "bottom-start", Bottom: "bottom", LeftEnd: "left-end", LeftStart: "left-start", Left: "left", RightEnd: "right-end", RightStart: "right-start", Right: "right", TopEnd: "top-end", TopStart: "top-start", Top: "top" }, J = s(l((t2, n2) => {
374
+ const { refFocusStart: o2, ...r2 } = t2, i2 = e(null), s2 = a(() => {
375
+ if (o2) return void o2?.current?.focus();
376
+ const t3 = i2.current.parentElement.children;
377
+ let e2 = [];
378
+ const n3 = t3.length;
379
+ for (let o3 = 0; o3 < n3 && t3[o3] !== i2.current; o3++) {
380
+ const n4 = t3[o3], r3 = n4.getAttribute("tabindex");
371
381
  if (null == r3 || "-1" === r3) continue;
372
- "true" !== o4.getAttribute("disabled") && (o4.focus && e3.push({ tabindex: parseInt(r3), child: o4 }));
382
+ "true" !== n4.getAttribute("disabled") && (n4.focus && e2.push({ tabindex: parseInt(r3), child: n4 }));
373
383
  }
374
- 0 !== e3.length && (e3.sort(function(t4, e4) {
375
- return t4.tabindex - e4.tabindex;
376
- }), e3[0].child.focus());
377
- }, [n2]);
378
- return x("div", { tabIndex: 0, ref: L([r2, e2]), onFocus: i2, ...o2 });
384
+ 0 !== e2.length && (e2.sort(function(t4, e3) {
385
+ return t4.tabindex - e3.tabindex;
386
+ }), e2[0].child.focus());
387
+ }, [o2]);
388
+ return x("div", { tabIndex: 0, ref: L([i2, n2]), onFocus: s2, ...r2 });
379
389
  }));
380
- const Q = p(m((t2, e2) => {
381
- const { className: n2, style: o2, children: r2, radius: i2 = 4, strokeWidth: s2 = 1, strokeColor: c2 = "grey", ...u2 } = t2, [d2, { width: p2, height: m2 }] = M(), f2 = a(null), _2 = (t3, e3 = 0) => {
382
- const n3 = t3 / 2, o3 = m2 - n3 + e3;
383
- return (function(t4, e4, n4 = false) {
384
- if (0 === e4) return t4;
385
- function o4(t5, e5, n5) {
386
- let o5 = e5.x - t5.x, i4 = e5.y - t5.y, s4 = Math.sqrt(o5 * o5 + i4 * i4);
387
- return r3(t5, e5, Math.min(1, n5 / s4));
390
+ const Q = s(l((n2, r2) => {
391
+ const { className: i2, style: s2, children: l2, radius: a2 = 4, strokeWidth: c2 = 1, strokeColor: h2 = "grey", ...u2 } = n2, [d2, { width: p2, height: m2 }] = M(), f2 = e(null), _2 = (t2, e2 = 0) => {
392
+ const n3 = t2 / 2, o2 = m2 - n3 + e2;
393
+ return (function(t3, e3, n4 = false) {
394
+ if (0 === e3) return t3;
395
+ function o3(t4, e4, n5) {
396
+ let o4 = e4.x - t4.x, i4 = e4.y - t4.y, s4 = Math.sqrt(o4 * o4 + i4 * i4);
397
+ return r3(t4, e4, Math.min(1, n5 / s4));
388
398
  }
389
- function r3(t5, e5, n5) {
390
- return { x: t5.x + (e5.x - t5.x) * n5, y: t5.y + (e5.y - t5.y) * n5 };
399
+ function r3(t4, e4, n5) {
400
+ return { x: t4.x + (e4.x - t4.x) * n5, y: t4.y + (e4.y - t4.y) * n5 };
391
401
  }
392
- function i3(t5, e5) {
393
- t5.length > 2 && (t5[t5.length - 2] = e5.x, t5[t5.length - 1] = e5.y);
402
+ function i3(t4, e4) {
403
+ t4.length > 2 && (t4[t4.length - 2] = e4.x, t4[t4.length - 1] = e4.y);
394
404
  }
395
- function s3(t5) {
396
- return { x: parseFloat(t5[t5.length - 2]), y: parseFloat(t5[t5.length - 1]) };
405
+ function s3(t4) {
406
+ return { x: parseFloat(t4[t4.length - 2]), y: parseFloat(t4[t4.length - 1]) };
397
407
  }
398
- let l2 = t4.split(/[,\s]/).reduce(function(t5, e5) {
399
- let n5 = e5.match("([a-zA-Z])(.+)");
400
- return n5 ? (t5.push(n5[1]), t5.push(n5[2])) : t5.push(e5), t5;
401
- }, []).reduce(function(t5, e5) {
402
- return parseFloat(e5) == e5 && t5.length ? t5[t5.length - 1].push(e5) : t5.push([e5]), t5;
403
- }, []), a2 = [];
404
- if (l2.length > 1) {
405
- let t5 = s3(l2[0]), c3 = null;
406
- "Z" === l2[l2.length - 1][0] && l2[0].length > 2 && (c3 = ["L", t5.x, t5.y], l2[l2.length - 1] = c3), a2.push(l2[0]);
407
- for (let t6 = 1; t6 < l2.length; t6++) {
408
- let h2 = a2[a2.length - 1], u3 = l2[t6], d3 = u3 === c3 ? l2[1] : l2[t6 + 1];
409
- if (d3 && h2 && h2.length > 2 && "L" === u3[0] && d3.length > 2 && "L" === d3[0]) {
410
- let t7, l3, c4 = s3(h2), p3 = s3(u3), m3 = s3(d3);
411
- n4 ? (t7 = r3(p3, h2.origPoint || c4, e4), l3 = r3(p3, d3.origPoint || m3, e4)) : (t7 = o4(p3, c4, e4), l3 = o4(p3, m3, e4)), i3(u3, t7), u3.origPoint = p3, a2.push(u3);
412
- let f3 = r3(t7, p3, 0.5), _3 = r3(p3, l3, 0.5), g3 = ["C", f3.x, f3.y, _3.x, _3.y, l3.x, l3.y];
413
- g3.origPoint = p3, a2.push(g3);
414
- } else a2.push(u3);
408
+ let l3 = t3.split(/[,\s]/).reduce(function(t4, e4) {
409
+ let n5 = e4.match("([a-zA-Z])(.+)");
410
+ return n5 ? (t4.push(n5[1]), t4.push(n5[2])) : t4.push(e4), t4;
411
+ }, []).reduce(function(t4, e4) {
412
+ return parseFloat(e4) == e4 && t4.length ? t4[t4.length - 1].push(e4) : t4.push([e4]), t4;
413
+ }, []), a3 = [];
414
+ if (l3.length > 1) {
415
+ let t4 = s3(l3[0]), c3 = null;
416
+ "Z" === l3[l3.length - 1][0] && l3[0].length > 2 && (c3 = ["L", t4.x, t4.y], l3[l3.length - 1] = c3), a3.push(l3[0]);
417
+ for (let t5 = 1; t5 < l3.length; t5++) {
418
+ let h3 = a3[a3.length - 1], u3 = l3[t5], d3 = u3 === c3 ? l3[1] : l3[t5 + 1];
419
+ if (d3 && h3 && h3.length > 2 && "L" === u3[0] && d3.length > 2 && "L" === d3[0]) {
420
+ let t6, l4, c4 = s3(h3), p3 = s3(u3), m3 = s3(d3);
421
+ n4 ? (t6 = r3(p3, h3.origPoint || c4, e3), l4 = r3(p3, d3.origPoint || m3, e3)) : (t6 = o3(p3, c4, e3), l4 = o3(p3, m3, e3)), i3(u3, t6), u3.origPoint = p3, a3.push(u3);
422
+ let f3 = r3(t6, p3, 0.5), _3 = r3(p3, l4, 0.5), g3 = ["C", f3.x, f3.y, _3.x, _3.y, l4.x, l4.y];
423
+ g3.origPoint = p3, a3.push(g3);
424
+ } else a3.push(u3);
415
425
  }
416
426
  if (c3) {
417
- let t6 = s3(a2[a2.length - 1]);
418
- a2.push(["Z"]), i3(a2[0], t6);
427
+ let t5 = s3(a3[a3.length - 1]);
428
+ a3.push(["Z"]), i3(a3[0], t5);
419
429
  }
420
- } else a2 = l2;
421
- return a2.reduce(function(t5, e5) {
422
- return t5 + e5.join(" ") + " ";
430
+ } else a3 = l3;
431
+ return a3.reduce(function(t4, e4) {
432
+ return t4 + e4.join(" ") + " ";
423
433
  }, "");
424
- })(`${`M 0 ${n3} L ${i2 - 0.5} ${n3} L ${i2 - 0.5} ${o3} L ${2 * i2} ${o3}`} ${`L ${p2 - 2 * i2} ${o3}`} ${`M ${p2 - 2 * i2} ${o3} L ${p2 - i2} ${o3} L ${p2 - i2} ${n3} L ${p2} ${n3}`}`, i2);
425
- }, g2 = h(() => _2(s2), [p2, m2, i2, s2]), y2 = h(() => {
426
- if (0 === i2) return;
427
- const t3 = i2 / 2;
428
- return _2(i2) + `L ${p2} 0 L 0 0 L 0 ${t3}`;
429
- }, [g2, i2, s2]), v2 = h(() => ({ style: { clipPath: `path('${y2}')` } }), [y2]);
430
- return S("div", { className: n2, style: { display: "flex", flexDirection: "row", ...o2 }, ...u2, ref: L([f2, d2, e2]), children: [l.isValidElement(r2) ? l.cloneElement(r2, v2) : x(E, {}), x("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: p2, height: m2, viewBox: `0 0 ${p2} ${m2}`, children: x("path", { d: g2, stroke: c2, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: s2 }) })] });
434
+ })(`${`M 0 ${n3} L ${a2 - 0.5} ${n3} L ${a2 - 0.5} ${o2} L ${2 * a2} ${o2}`} ${`L ${p2 - 2 * a2} ${o2}`} ${`M ${p2 - 2 * a2} ${o2} L ${p2 - a2} ${o2} L ${p2 - a2} ${n3} L ${p2} ${n3}`}`, a2);
435
+ }, g2 = o(() => _2(c2), [p2, m2, a2, c2]), y2 = o(() => {
436
+ if (0 === a2) return;
437
+ const t2 = a2 / 2;
438
+ return _2(a2) + `L ${p2} 0 L 0 0 L 0 ${t2}`;
439
+ }, [g2, a2, c2]), v2 = o(() => ({ style: { clipPath: `path('${y2}')` } }), [y2]);
440
+ return S("div", { className: i2, style: { display: "flex", flexDirection: "row", ...s2 }, ...u2, ref: L([f2, d2, r2]), children: [t.isValidElement(l2) ? t.cloneElement(l2, v2) : x(E, {}), x("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: p2, height: m2, viewBox: `0 0 ${p2} ${m2}`, children: x("path", { d: g2, stroke: h2, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: c2 }) })] });
431
441
  })), tt = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
432
- class et extends e {
442
+ class et extends _ {
433
443
  setOverrides(t2) {
434
444
  super.setOverrides(t2);
435
445
  }
@@ -437,9 +447,9 @@ class et extends e {
437
447
  return this._overrides;
438
448
  }
439
449
  showMessage(t2, e2) {
440
- const o2 = this.getDelegate();
441
- if (o2?.showMessage) return o2.showMessage(t2, e2);
442
- e2?.type !== tt.Warning ? e2?.type !== tt.Error ? n.log(t2) : n.error(t2) : n.warn(t2);
450
+ const n2 = this.getDelegate();
451
+ if (n2?.showMessage) return n2.showMessage(t2, e2);
452
+ e2?.type !== tt.Warning ? e2?.type !== tt.Error ? g.log(t2) : g.error(t2) : g.warn(t2);
443
453
  }
444
454
  showBusy(t2, e2) {
445
455
  const n2 = this.getDelegate();
@@ -454,7 +464,7 @@ class et extends e {
454
464
  }
455
465
  showError(t2) {
456
466
  const e2 = this.getDelegate();
457
- e2?.showError ? e2.showError(t2) : n.error(t2);
467
+ e2?.showError ? e2.showError(t2) : g.error(t2);
458
468
  }
459
469
  showOptions(t2) {
460
470
  const e2 = this.getDelegate();
@@ -465,61 +475,61 @@ class et extends e {
465
475
  return e2?.showInput ? e2.showInput(t2) : Promise.resolve({ input: "", option: "" });
466
476
  }
467
477
  }
468
- const nt = _(new et()), ot = ({ children: t2, notifier: e2 }) => (l.useEffect(() => {
469
- const t3 = n.getOverrides();
470
- return n.setOverrides(e2), () => {
471
- n.setOverrides(t3);
478
+ const nt = c(new et()), ot = ({ children: e2, notifier: n2 }) => (t.useEffect(() => {
479
+ const t2 = g.getOverrides();
480
+ return g.setOverrides(n2), () => {
481
+ g.setOverrides(t2);
472
482
  };
473
- }, [e2]), l.createElement(nt.Provider, { value: e2 }, t2)), rt = () => g(nt), it = 3, st = 0.5, lt = 50, at = (t2) => ({ x: t2.x, y: t2.y, width: t2.width, height: t2.height, top: t2.top, left: t2.left, right: t2.right, bottom: t2.bottom });
483
+ }, [n2]), t.createElement(nt.Provider, { value: n2 }, e2)), rt = () => h(nt), it = 3, st = 0.5, lt = 50, at = (t2) => ({ x: t2.x, y: t2.y, width: t2.width, height: t2.height, top: t2.top, left: t2.left, right: t2.right, bottom: t2.bottom });
474
484
  function ct(t2 = {}) {
475
- const { threshold: e2 = st, stillnessThreshold: n2 = it, maxHierarchyDepth: o2 = lt } = t2, [r2, i2] = M(), s2 = a(null), [l2, h2] = c((t3) => t3 + 1, 0), p2 = a(void 0), m2 = a({ x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0 }), _2 = f((t3) => {
476
- s2.current = t3, "function" == typeof r2 && r2(t3);
477
- }, [r2]), [g2, y2] = d(i2);
478
- return u(() => {
479
- i2 && !g2 && y2(i2);
480
- }, [i2, g2]), u(() => {
481
- const t3 = s2.current;
485
+ const { threshold: o2 = st, stillnessThreshold: s2 = it, maxHierarchyDepth: l2 = lt } = t2, [c2, h2] = M(), u2 = e(null), [d2, p2] = n((t3) => t3 + 1, 0), m2 = e(void 0), f2 = e({ x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0 }), _2 = a((t3) => {
486
+ u2.current = t3, "function" == typeof c2 && c2(t3);
487
+ }, [c2]), [g2, y2] = i(h2);
488
+ return r(() => {
489
+ h2 && !g2 && y2(h2);
490
+ }, [h2, g2]), r(() => {
491
+ const t3 = u2.current;
482
492
  if (!t3) return;
483
- let r3 = false, i3 = 0;
484
- const l3 = () => {
493
+ let e2 = false, n2 = 0;
494
+ const r2 = () => {
485
495
  if (!t3) return;
486
- const o3 = t3.getBoundingClientRect(), s3 = m2.current;
487
- Math.abs(o3.x - s3.x) > e2 || Math.abs(o3.y - s3.y) > e2 || Math.abs(o3.width - s3.width) > e2 || Math.abs(o3.height - s3.height) > e2 ? (r3 || (r3 = true, y2(at(o3)), h2()), i3 = 0) : i3++, r3 && i3 >= n2 && (r3 = false, y2(at(o3)), h2()), m2.current = at(o3), p2.current = requestAnimationFrame(l3);
496
+ const i3 = t3.getBoundingClientRect(), l3 = f2.current;
497
+ Math.abs(i3.x - l3.x) > o2 || Math.abs(i3.y - l3.y) > o2 || Math.abs(i3.width - l3.width) > o2 || Math.abs(i3.height - l3.height) > o2 ? (e2 || (e2 = true, y2(at(i3)), p2()), n2 = 0) : n2++, e2 && n2 >= s2 && (e2 = false, y2(at(i3)), p2()), f2.current = at(i3), m2.current = requestAnimationFrame(r2);
488
498
  };
489
- p2.current = requestAnimationFrame(l3);
490
- const a2 = (t4) => {
491
- r3 = true, h2();
492
- }, c2 = (t4) => {
493
- r3 = false, i3 = n2, h2();
499
+ m2.current = requestAnimationFrame(r2);
500
+ const i2 = (t4) => {
501
+ e2 = true, p2();
502
+ }, a2 = (t4) => {
503
+ e2 = false, n2 = s2, p2();
494
504
  };
495
- let u2 = t3;
496
- const d2 = [];
497
- for (; u2 && u2 !== document.documentElement && (u2.addEventListener("animationstart", a2, true), u2.addEventListener("animationend", c2, true), u2.addEventListener("transitionstart", a2, true), u2.addEventListener("transitionend", c2, true), d2.push(u2), u2 = u2.parentElement, !(d2.length > o2)); ) ;
505
+ let c3 = t3;
506
+ const h3 = [];
507
+ for (; c3 && c3 !== document.documentElement && (c3.addEventListener("animationstart", i2, true), c3.addEventListener("animationend", a2, true), c3.addEventListener("transitionstart", i2, true), c3.addEventListener("transitionend", a2, true), h3.push(c3), c3 = c3.parentElement, !(h3.length > l2)); ) ;
498
508
  return () => {
499
- p2.current && cancelAnimationFrame(p2.current), d2.forEach((t4) => {
500
- t4.removeEventListener("animationstart", a2, true), t4.removeEventListener("animationend", c2, true), t4.removeEventListener("transitionstart", a2, true), t4.removeEventListener("transitionend", c2, true);
509
+ m2.current && cancelAnimationFrame(m2.current), h3.forEach((t4) => {
510
+ t4.removeEventListener("animationstart", i2, true), t4.removeEventListener("animationend", a2, true), t4.removeEventListener("transitionstart", i2, true), t4.removeEventListener("transitionend", a2, true);
501
511
  });
502
512
  };
503
- }, [l2, i2, e2, n2, o2]), [_2, g2];
513
+ }, [d2, h2, o2, s2, l2]), [_2, g2];
504
514
  }
505
- const ht = (t2, e2) => {
506
- const n2 = f((...e3) => t2?.(...e3), e2), o2 = a(null);
507
- o2.current = n2;
508
- const r2 = f((...t3) => o2.current?.(...t3), []);
509
- if (o2.current) return r2;
515
+ const ht = (t2, n2) => {
516
+ const o2 = a((...e2) => t2?.(...e2), n2), r2 = e(null);
517
+ r2.current = o2;
518
+ const i2 = a((...t3) => r2.current?.(...t3), []);
519
+ if (r2.current) return i2;
510
520
  };
511
521
  function ut(t2) {
512
- const [e2, n2] = d("undefined" != typeof window ? window.devicePixelRatio : 1), o2 = a(null);
513
- return u(() => {
522
+ const [n2, o2] = i("undefined" != typeof window ? window.devicePixelRatio : 1), s2 = e(null);
523
+ return r(() => {
514
524
  if (!("undefined" != typeof window && "matchMedia" in window)) return;
515
525
  const t3 = () => {
516
- const e3 = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
517
- e3.addEventListener("change", t3, { once: true, passive: true }), n2(window.devicePixelRatio), o2.current = { mediaMatcher: e3, listener: t3 };
526
+ const e2 = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
527
+ e2.addEventListener("change", t3, { once: true, passive: true }), o2(window.devicePixelRatio), s2.current = { mediaMatcher: e2, listener: t3 };
518
528
  };
519
529
  return t3(), () => {
520
- o2.current && o2.current.mediaMatcher.removeEventListener("change", o2.current.listener);
530
+ s2.current && s2.current.mediaMatcher.removeEventListener("change", s2.current.listener);
521
531
  };
522
- }, [t2]), e2;
532
+ }, [t2]), n2;
523
533
  }
524
534
  function dt(t2) {
525
535
  if ("undefined" == typeof window) return 1;
@@ -528,7 +538,7 @@ function dt(t2) {
528
538
  }
529
539
  function pt(t2, e2, n2) {
530
540
  const o2 = ht(e2, [e2]);
531
- u(() => {
541
+ r(() => {
532
542
  const e3 = (e4) => {
533
543
  t2.current && !t2.current.contains(e4.target) && o2(e4);
534
544
  };
@@ -539,11 +549,11 @@ function pt(t2, e2, n2) {
539
549
  }
540
550
  let mt = 0;
541
551
  function ft() {
542
- const [t2, e2] = d(!!document.fullscreenElement), n2 = f(() => {
552
+ const [t2, e2] = i(!!document.fullscreenElement), n2 = a(() => {
543
553
  const t3 = document.fullscreenElement;
544
554
  return t3 ? t3.querySelector(".fullscreen-portal-root") || t3 : document.body;
545
555
  }, []);
546
- return u(() => {
556
+ return r(() => {
547
557
  function t3() {
548
558
  const t4 = document.fullscreenElement;
549
559
  if (e2(!!t4), !t4) return;
@@ -559,60 +569,60 @@ function ft() {
559
569
  }
560
570
  function _t(t2) {
561
571
  if (!t2) throw new Error("must have a PointerHandlerOptions");
562
- const { onPointerDown: e2, onPointerUp: n2, onPointerMoveOrWait: o2, processTouch: r2 = false, consumeTouch: i2 = true } = t2, s2 = ht(e2, [e2]), l2 = ht(n2, [n2]), c2 = ht(o2, [o2]), h2 = a(false), d2 = t2?.timerInitial ?? 230, p2 = t2?.timerContinuous ?? d2 / 2, m2 = a(null), _2 = a(null), g2 = a(null), y2 = a(null), v2 = f(() => {
572
+ const { onPointerDown: n2, onPointerUp: o2, onPointerMoveOrWait: i2, processTouch: s2 = false, consumeTouch: l2 = true } = t2, c2 = ht(n2, [n2]), h2 = ht(o2, [o2]), u2 = ht(i2, [i2]), d2 = e(false), p2 = t2?.timerInitial ?? 230, m2 = t2?.timerContinuous ?? p2 / 2, f2 = e(null), _2 = e(null), g2 = e(null), y2 = e(null), v2 = a(() => {
563
573
  y2.current && (clearTimeout(y2.current), y2.current = null);
564
- }, []), w2 = f((t3) => {
574
+ }, []), w2 = a((t3) => {
565
575
  y2.current = setTimeout(() => {
566
576
  window.requestAnimationFrame(() => {
567
- if (false === h2.current) return;
568
- const t4 = _2.current, e3 = m2.current, n3 = R(t4, e3.currentTarget);
569
- c2?.(n3, g2.current, e3);
570
- }), w2(p2);
571
- }, t3 ?? d2);
577
+ if (false === d2.current) return;
578
+ const t4 = _2.current, e2 = f2.current, n3 = W(t4, e2.currentTarget);
579
+ u2?.(n3, g2.current, e2);
580
+ }), w2(m2);
581
+ }, t3 ?? p2);
572
582
  }, []);
573
- u(() => () => v2(), []);
574
- const b2 = r2 ? "pointer" : "mouse", x2 = f((t3) => {
583
+ r(() => () => v2(), []);
584
+ const b2 = s2 ? "pointer" : "mouse", x2 = a((t3) => {
575
585
  t3.stopPropagation(), t3.stopImmediatePropagation(), t3.preventDefault();
576
586
  }, []), S2 = ht((t3) => {
577
587
  document.removeEventListener(`${b2}move`, M2), document.removeEventListener(`${b2}up`, S2), document.removeEventListener("keydown", T2), document.removeEventListener("keyup", C2), document.removeEventListener("touchstart", x2, { capture: true }), document.removeEventListener("touchmove", x2, { capture: true }), window.removeEventListener("blur", E2), v2(), window.requestAnimationFrame(() => {
578
- if (false === h2.current) return;
579
- h2.current = false;
580
- const e3 = t3, n3 = m2.current, o3 = R(e3, n3.currentTarget);
581
- l2?.(o3, g2.current, n3), g2.current = null;
588
+ if (false === d2.current) return;
589
+ d2.current = false;
590
+ const e2 = t3, n3 = f2.current, o3 = W(e2, n3.currentTarget);
591
+ h2?.(o3, g2.current, n3), g2.current = null;
582
592
  });
583
- }, []), E2 = f(() => {
584
- false !== h2.current && (h2.current = false, S2(_2.current));
593
+ }, []), E2 = a(() => {
594
+ false !== d2.current && (d2.current = false, S2(_2.current));
585
595
  }, []), L2 = ht(() => {
586
- v2(), w2(p2), window.requestAnimationFrame(() => {
587
- if (false === h2.current) return;
588
- const t3 = _2.current, e3 = m2.current, n3 = R(t3, e3.currentTarget);
589
- c2?.(n3, g2.current, e3);
596
+ v2(), w2(m2), window.requestAnimationFrame(() => {
597
+ if (false === d2.current) return;
598
+ const t3 = _2.current, e2 = f2.current, n3 = W(t3, e2.currentTarget);
599
+ u2?.(n3, g2.current, e2);
590
600
  });
591
- }, [p2]), M2 = ht((t3) => {
601
+ }, [m2]), M2 = ht((t3) => {
592
602
  _2.current = t3, L2();
593
603
  }, []), T2 = ht((t3) => {
594
604
  g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey }, L2();
595
605
  }, []), C2 = ht((t3) => {
596
606
  g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey }, L2();
597
- }, [p2]);
607
+ }, [m2]);
598
608
  return ht((t3) => {
599
609
  if (t3.isDefaultPrevented()) return;
600
610
  g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey };
601
- false !== s2(t3, g2.current) && (m2.current = t3, _2.current = t3.nativeEvent, document.addEventListener(`${b2}up`, S2, { passive: false }), document.addEventListener(`${b2}move`, M2, { passive: false }), document.addEventListener("keydown", T2, { passive: false }), document.addEventListener("keyup", C2, { passive: false }), window.addEventListener("blur", E2, { passive: true }), r2 && i2 && (document.addEventListener("touchstart", x2, { passive: false, capture: true }), document.addEventListener("touchmove", x2, { passive: false, capture: true })), h2.current = true, w2(d2));
602
- }, [d2, r2]);
611
+ false !== c2(t3, g2.current) && (f2.current = t3, _2.current = t3.nativeEvent, document.addEventListener(`${b2}up`, S2, { passive: false }), document.addEventListener(`${b2}move`, M2, { passive: false }), document.addEventListener("keydown", T2, { passive: false }), document.addEventListener("keyup", C2, { passive: false }), window.addEventListener("blur", E2, { passive: true }), s2 && l2 && (document.addEventListener("touchstart", x2, { passive: false, capture: true }), document.addEventListener("touchmove", x2, { passive: false, capture: true })), d2.current = true, w2(p2));
612
+ }, [p2, s2]);
603
613
  }
604
614
  function gt(t2, e2) {
605
615
  return _t({ onPointerDown: t2, onPointerMoveOrWait: (e3, n2, o2) => {
606
616
  t2?.(o2);
607
617
  }, ...e2 });
608
618
  }
609
- const yt = ({ initValue: t2, useHookBody: e2, applyStateChange: n2 }) => {
610
- const o2 = a(t2);
611
- if ("function" != typeof e2) throw new Error("function expected as hook body parameter. got " + typeof e2);
612
- const r2 = e2();
613
- return y(() => {
614
- o2.current !== r2 && (o2.current = r2, n2(r2));
615
- }, [n2, r2]), null;
619
+ const yt = ({ initValue: t2, useHookBody: n2, applyStateChange: o2 }) => {
620
+ const r2 = e(t2);
621
+ if ("function" != typeof n2) throw new Error("function expected as hook body parameter. got " + typeof n2);
622
+ const i2 = n2();
623
+ return u(() => {
624
+ r2.current !== i2 && (r2.current = i2, o2(i2));
625
+ }, [o2, i2]), null;
616
626
  }, vt = (t2) => {
617
627
  console && console.warn && console.warn(t2);
618
628
  }, wt = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || void 0;
@@ -620,16 +630,16 @@ let bt = 1, xt = false, St = false;
620
630
  const Et = [], Lt = [], Mt = () => {
621
631
  Lt.forEach((t2) => t2());
622
632
  }, Tt = ({ automaticContainerInternalUseOnly: t2 }) => {
623
- const [e2, n2] = d([]), o2 = a([]);
624
- return o2.current = e2, t2 || false !== xt || (St = true), u(() => {
625
- let e3 = true;
626
- function r2() {
627
- if (e3) return Lt[0] !== r2 ? (t2 || true !== xt || vt("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void n2((t3) => [])) : void n2([...Et]);
633
+ const [n2, o2] = i([]), s2 = e([]);
634
+ return s2.current = n2, t2 || false !== xt || (St = true), r(() => {
635
+ let e2 = true;
636
+ function n3() {
637
+ if (e2) return Lt[0] !== n3 ? (t2 || true !== xt || vt("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void o2((t3) => [])) : void o2([...Et]);
628
638
  }
629
- return Lt.push(r2), Mt(), () => {
630
- e3 = false, o2.current?.length > 0 && vt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Lt.splice(Lt.indexOf(r2), 1), Mt();
639
+ return Lt.push(n3), Mt(), () => {
640
+ e2 = false, s2.current?.length > 0 && vt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Lt.splice(Lt.indexOf(n3), 1), Mt();
631
641
  };
632
- }, [t2]), x(E, { children: e2.map(({ hook: t3, key: e3 }) => v(yt, { ...t3, key: e3 })) });
642
+ }, [t2]), x(E, { children: n2.map(({ hook: t3, key: e2 }) => d(yt, { ...t3, key: e2 })) });
633
643
  }, Ct = (t2) => {
634
644
  const e2 = bt++;
635
645
  return Et.push({ hook: t2, key: e2 }), 0 === Lt.length && false === St && (xt = true, ((t3) => {
@@ -643,196 +653,196 @@ const Et = [], Lt = [], Mt = () => {
643
653
  };
644
654
  let kt = null;
645
655
  kt || (kt = (t2, e2, n2 = {}) => {
646
- let o2, r2, i2 = false, s2 = false, l2 = [], { unmountIfNoConsumers: a2 = false } = n2;
647
- const c2 = (t3) => {
648
- r2 = t3, k(() => l2.forEach((e3) => e3(t3)));
649
- }, h2 = () => (s2 || (r2 = "function" == typeof t2 ? t2() : t2, s2 = true), r2);
656
+ let o2, s2, l2 = false, a2 = false, c2 = [], { unmountIfNoConsumers: h2 = false } = n2;
657
+ const u2 = (t3) => {
658
+ s2 = t3, k(() => c2.forEach((e3) => e3(t3)));
659
+ }, d2 = () => (a2 || (s2 = "function" == typeof t2 ? t2() : t2, a2 = true), s2);
650
660
  return () => {
651
- const [n3, s3] = d(h2);
652
- return u(() => (i2 || (i2 = true, o2 = Ct({ initValue: t2, useHookBody: e2, applyStateChange: c2 })), l2.push(s3), r2 !== n3 && s3(r2), () => {
653
- l2.splice(l2.indexOf(s3), 1), 0 === l2.length && a2 && (o2(), i2 = false);
661
+ const [n3, a3] = i(d2);
662
+ return r(() => (l2 || (l2 = true, o2 = Ct({ initValue: t2, useHookBody: e2, applyStateChange: u2 })), c2.push(a3), s2 !== n3 && a3(s2), () => {
663
+ c2.splice(c2.indexOf(a3), 1), 0 === c2.length && h2 && (o2(), l2 = false);
654
664
  }), []), n3;
655
665
  };
656
666
  });
657
- const Pt = kt;
658
- let Dt = () => {
667
+ const Dt = kt;
668
+ let Pt = () => {
659
669
  console.warn("You must call useEditMode before setting its state.");
660
670
  };
661
- const zt = Pt(null, () => {
662
- const [t2, e2] = d(null);
663
- return Dt = e2, t2;
671
+ const zt = Dt(null, () => {
672
+ const [t2, e2] = i(null);
673
+ return Pt = e2, t2;
664
674
  }), At = () => {
665
675
  const t2 = zt();
666
- return h(() => ({ setMode: (t3) => {
667
- Dt((e2) => ("function" == typeof t3 && (t3 = t3(e2)), t3?.onModeChange?.(t3 ?? null), t3));
676
+ return o(() => ({ setMode: (t3) => {
677
+ Pt((e2) => ("function" == typeof t3 && (t3 = t3(e2)), t3?.onModeChange?.(t3 ?? null), t3));
668
678
  }, getMode: () => t2 }), [t2]);
669
- }, Bt = Pt({ setClipboard: (t2) => {
679
+ }, Bt = Dt({ setClipboard: (t2) => {
670
680
  throw new Error("This is only available via the useClipboard.");
671
- }, getClipboard: () => o.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
672
- const [t2, e2] = d(o.Global);
673
- return { setClipboard: (t3) => e2(t3), getClipboard: () => t2, refNativeCopy: a(null), refNativeLastKey: a(null) };
674
- }), $t = (e2) => {
675
- const { source: n2, target: s2, onPaste: l2, onClipboardUpdate: a2, commands: c2 } = e2, d2 = rt(), p2 = ht(a2, [a2]), m2 = ht(l2, [l2]), { getClipboard: _2, refNativeCopy: g2 } = Bt(), y2 = _2();
676
- h(() => {
677
- const t2 = n2?.element, e3 = s2?.element ?? n2?.element;
678
- if (!c2) return;
679
- const o2 = [new K("cut", t2, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", icon: "cut", shortcut: { key: "X", modifiers: [z.Ctrl] } }), new K("copy", t2, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", icon: "copy", shortcut: { key: "C", modifiers: [z.Ctrl] } }), new K("paste", e3, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste.yellow", shortcut: [{ key: "V", modifiers: [z.Ctrl] }, { key: "F8", modifiers: [z.Ctrl] }] })];
680
- c2?.addCommands(o2, true);
681
- }, [c2]);
682
- const v2 = ht(async (t2) => {
683
- if (!n2?.element) return;
684
- let e3 = null;
681
+ }, getClipboard: () => y.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
682
+ const [t2, n2] = i(y.Global);
683
+ return { setClipboard: (t3) => n2(t3), getClipboard: () => t2, refNativeCopy: e(null), refNativeLastKey: e(null) };
684
+ }), $t = (t2) => {
685
+ const { source: e2, target: n2, onPaste: i2, onClipboardUpdate: s2, commands: l2 } = t2, c2 = rt(), h2 = ht(s2, [s2]), u2 = ht(i2, [i2]), { getClipboard: d2, refNativeCopy: p2 } = Bt(), m2 = d2();
686
+ o(() => {
687
+ const t3 = e2?.element, o2 = n2?.element ?? e2?.element;
688
+ if (!l2) return;
689
+ const r2 = [new K("cut", t3, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", icon: "cut", shortcut: { key: "X", modifiers: [z.Ctrl] } }), new K("copy", t3, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", icon: "copy", shortcut: { key: "C", modifiers: [z.Ctrl] } }), new K("paste", o2, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste.yellow", shortcut: [{ key: "V", modifiers: [z.Ctrl] }, { key: "F8", modifiers: [z.Ctrl] }] })];
690
+ l2?.addCommands(r2, true);
691
+ }, [l2]);
692
+ const _2 = ht(async (t3) => {
693
+ if (!e2?.element) return;
694
+ let n3 = null;
685
695
  try {
686
- e3 = n2.doCopy?.(t2), "string" == typeof e3 ? await y2.writeText(e3) : await y2.writeReference(e3);
687
- } catch (t3) {
688
- throw t3;
696
+ n3 = e2.doCopy?.(t3), "string" == typeof n3 ? await m2.writeText(n3) : await m2.writeReference(n3);
697
+ } catch (t4) {
698
+ throw t4;
689
699
  }
690
- }, [n2, d2]), w2 = ht(async (t2) => {
691
- const e3 = n2?.element?.();
692
- if (e3) {
693
- g2.current = { sourceElement: e3, args: t2 };
700
+ }, [e2, c2]), g2 = ht(async (t3) => {
701
+ const n3 = e2?.element?.();
702
+ if (n3) {
703
+ p2.current = { sourceElement: n3, args: t3 };
694
704
  try {
695
- await v2(t2);
696
- } catch (t3) {
697
- d2.showError?.(t3);
705
+ await _2(t3);
706
+ } catch (t4) {
707
+ c2.showError?.(t4);
698
708
  }
699
709
  }
700
- }, [n2?.element, d2]), b2 = f(() => {
701
- w2({ isCut: true });
702
- }, []), x2 = ht(async (t2, e3, n3) => {
710
+ }, [e2?.element, c2]), b2 = a(() => {
711
+ g2({ isCut: true });
712
+ }, []), x2 = ht(async (t3, e3, n3) => {
703
713
  try {
704
- if (false === await t2.doPaste(e3, n3)) return;
705
- m2?.(e3, n3);
706
- } catch (t3) {
707
- d2.showError?.(t3);
714
+ if (false === await t3.doPaste(e3, n3)) return;
715
+ u2?.(e3, n3);
716
+ } catch (t4) {
717
+ c2.showError?.(t4);
708
718
  }
709
- }, [m2]), S2 = ht(async (e3, n3, o2) => {
710
- const r2 = s2?.element?.();
711
- if (r2 && await t.whenFocus(r2), !e3 && !n3) return;
712
- const i2 = await d2.showBusy?.("Pasting...");
713
- if (n3) try {
714
- return await x2(s2, n3, o2), void i2?.();
715
- } catch (t2) {
716
- i2?.(), d2.showError?.(t2);
719
+ }, [u2]), S2 = ht(async (t3, e3, o2) => {
720
+ const r2 = n2?.element?.();
721
+ if (r2 && await f.whenFocus(r2), !t3 && !e3) return;
722
+ const i3 = await c2.showBusy?.("Pasting...");
723
+ if (e3) try {
724
+ return await x2(n2, e3, o2), void i3?.();
725
+ } catch (t4) {
726
+ i3?.(), c2.showError?.(t4);
717
727
  }
718
- let l3, a3 = s2.importFromExternal;
719
- a3 || (a3 = (t2, n4) => ({ getItemType: () => "text", toText: () => e3.text, isClipboardItem: true }));
728
+ let s3, l3 = n2.importFromExternal;
729
+ l3 || (l3 = (e4, n3) => ({ getItemType: () => "text", toText: () => t3.text, isClipboardItem: true }));
720
730
  try {
721
- l3 = await a3(e3, { isCut: false });
722
- } catch (t2) {
723
- i2?.(), d2.showError?.(t2);
731
+ s3 = await l3(t3, { isCut: false });
732
+ } catch (t4) {
733
+ i3?.(), c2.showError?.(t4);
724
734
  }
725
- if (l3) try {
726
- const t2 = await Promise.resolve(l3);
727
- await x2(s2, t2, o2), i2?.();
728
- } catch (t2) {
729
- i2?.(), d2.showError?.(t2);
735
+ if (s3) try {
736
+ const t4 = await Promise.resolve(s3);
737
+ await x2(n2, t4, o2), i3?.();
738
+ } catch (t4) {
739
+ i3?.(), c2.showError?.(t4);
730
740
  }
731
- else i2?.();
732
- }, [x2, s2, d2]), E2 = ht(async (t2) => {
733
- if (s2?.element) try {
734
- const e3 = await y2.readReference();
735
- if (e3) return void await S2(null, e3, t2);
741
+ else i3?.();
742
+ }, [x2, n2, c2]), E2 = ht(async (t3) => {
743
+ if (n2?.element) try {
744
+ const e3 = await m2.readReference();
745
+ if (e3) return void await S2(null, e3, t3);
736
746
  const n3 = [];
737
- n3[0] = await r.readStringFromClipboard(y2, i.plain), n3[1] = await r.readHTMLFromClipboard(y2, i.html), n3[2] = await r.readBlobFromClipboard(y2, i.png);
747
+ n3[0] = await v.readStringFromClipboard(m2, w.plain), n3[1] = await v.readHTMLFromClipboard(m2, w.html), n3[2] = await v.readBlobFromClipboard(m2, w.png);
738
748
  const o2 = { text: n3[0] ?? null, html: n3[1] ?? null, image: n3[2] ?? null };
739
- await S2(o2, null, t2);
740
- } catch (t3) {
741
- if ("Document is not focused." === t3?.message) return;
742
- d2.showError?.(t3);
749
+ await S2(o2, null, t3);
750
+ } catch (t4) {
751
+ if ("Document is not focused." === t4?.message) return;
752
+ c2.showError?.(t4);
743
753
  }
744
- }, [S2, s2?.element, d2]);
745
- return ht(async (t2) => {
746
- }, [n2?.element]), ht(async (t2) => {
747
- }, [s2?.element, S2, d2]), u(() => {
748
- if (!y2) return;
749
- const t2 = async (t3) => {
750
- const e4 = await y2.readReference();
751
- p2?.(e4);
752
- }, e3 = (t3) => {
753
- d2.showMessage?.(o.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
754
- }, n3 = (t3) => {
755
- d2.showMessage?.(o.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
754
+ }, [S2, n2?.element, c2]);
755
+ return ht(async (t3) => {
756
+ }, [e2?.element]), ht(async (t3) => {
757
+ }, [n2?.element, S2, c2]), r(() => {
758
+ if (!m2) return;
759
+ const t3 = async (t4) => {
760
+ const e4 = await m2.readReference();
761
+ h2?.(e4);
762
+ }, e3 = (t4) => {
763
+ c2.showMessage?.(y.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
764
+ }, n3 = (t4) => {
765
+ c2.showMessage?.(y.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
756
766
  };
757
- return y2.addEventListener("clipboardchange", t2), y2.addEventListener("clipboarderrorread", e3), y2.addEventListener("clipboarderrorwrite", n3), () => {
758
- y2.removeEventListener("clipboardchange", t2), y2.removeEventListener("clipboarderrorread", e3), y2.removeEventListener("clipboarderrorwrite", n3);
767
+ return m2.addEventListener("clipboardchange", t3), m2.addEventListener("clipboarderrorread", e3), m2.addEventListener("clipboarderrorwrite", n3), () => {
768
+ m2.removeEventListener("clipboardchange", t3), m2.removeEventListener("clipboarderrorread", e3), m2.removeEventListener("clipboarderrorwrite", n3);
759
769
  };
760
- }, [y2, d2]), u(() => {
761
- }, [v2, S2, n2, s2]), u(() => {
762
- c2?.getCommand("cut")?.updateCallback(b2).update({ disabled: !n2 || !s2 }), c2?.getCommand("copy")?.updateCallback(w2).update({ disabled: !n2 }), c2?.getCommand("paste")?.updateCallback(E2).update({ disabled: !s2 });
763
- }, [n2, s2, c2]), { paste: E2, copy: w2, clipboard: y2 };
770
+ }, [m2, c2]), r(() => {
771
+ }, [_2, S2, e2, n2]), r(() => {
772
+ l2?.getCommand("cut")?.updateCallback(b2).update({ disabled: !e2 || !n2 }), l2?.getCommand("copy")?.updateCallback(g2).update({ disabled: !e2 }), l2?.getCommand("paste")?.updateCallback(E2).update({ disabled: !n2 });
773
+ }, [e2, n2, l2]), { paste: E2, copy: g2, clipboard: m2 };
764
774
  };
765
- function Kt(t2, e2 = true) {
766
- const n2 = a(t2);
767
- u(() => {
768
- if (e2) {
769
- const e3 = Object.entries(t2).reduce((t3, [e4, o2]) => (n2.current[e4] !== o2 && (t3[e4] = [n2.current[e4], o2]), t3), {});
770
- Object.keys(e3).length > 0 && console.log("Changed props:", e3);
775
+ function Kt(t2, n2 = true) {
776
+ const o2 = e(t2);
777
+ r(() => {
778
+ if (n2) {
779
+ const e2 = Object.entries(t2).reduce((t3, [e3, n3]) => (o2.current[e3] !== n3 && (t3[e3] = [o2.current[e3], n3]), t3), {});
780
+ Object.keys(e2).length > 0 && console.log("Changed props:", e2);
771
781
  }
772
- n2.current = t2;
782
+ o2.current = t2;
773
783
  });
774
784
  }
775
- let Ot = false, It = 0;
776
- var Nt = "undefined" != typeof document ? y : u;
777
- const Ht = () => "sheetxl-ui-" + It++;
778
- const Rt = l["useId".toString()], Wt = null != Rt ? Rt : function() {
779
- const [t2, e2] = l.useState(() => Ot ? Ht() : void 0);
785
+ let It = false, Ot = 0;
786
+ var Nt = "undefined" != typeof document ? u : r;
787
+ const Ht = () => "sheetxl-ui-" + Ot++;
788
+ const Rt = t["useId".toString()], Wt = null != Rt ? Rt : function() {
789
+ const [e2, n2] = t.useState(() => It ? Ht() : void 0);
780
790
  return Nt(() => {
781
- null == t2 && e2(Ht());
782
- }, []), l.useEffect(() => {
783
- Ot || (Ot = true);
784
- }, []), t2;
791
+ null == e2 && n2(Ht());
792
+ }, []), t.useEffect(() => {
793
+ It || (It = true);
794
+ }, []), e2;
785
795
  }, Vt = [];
786
- function Ft(t2, e2, n2 = Vt) {
787
- const o2 = a(null);
788
- return w(t2, () => {
789
- if (!o2.current) return;
790
- const t3 = o2.current, n3 = e2?.();
791
- if (!n3 || "object" != typeof n3) throw new Error("attributes must return a plain object of values");
792
- const r2 = Object.keys(n3), i2 = r2.length;
793
- for (let e3 = 0; e3 < i2; e3++) {
794
- const o3 = r2[e3], i3 = n3[o3];
795
- Object.defineProperty(t3, o3, { value: i3, writable: true, configurable: true, enumerable: true });
796
+ function Ft(t2, n2, o2 = Vt) {
797
+ const r2 = e(null);
798
+ return p(t2, () => {
799
+ if (!r2.current) return;
800
+ const t3 = r2.current, e2 = n2?.();
801
+ if (!e2 || "object" != typeof e2) throw new Error("attributes must return a plain object of values");
802
+ const o3 = Object.keys(e2), i2 = o3.length;
803
+ for (let n3 = 0; n3 < i2; n3++) {
804
+ const r3 = o3[n3], i3 = e2[r3];
805
+ Object.defineProperty(t3, r3, { value: i3, writable: true, configurable: true, enumerable: true });
796
806
  }
797
807
  return t3;
798
- }, n2), o2;
808
+ }, o2), r2;
799
809
  }
800
810
  const jt = "Undo the last action.", Xt = "Repeat the last action or undo the redo.", Yt = (t2) => `Redo ${t2}`, Ut = ({ manager: t2, commands: e2, disabled: n2 }) => {
801
- const o2 = rt(), r2 = ht((e3) => {
811
+ const i2 = rt(), s2 = ht((e3) => {
802
812
  try {
803
813
  t2?.undo(e3);
804
814
  } catch (t3) {
805
- o2.error(t3);
815
+ i2.error(t3);
806
816
  }
807
- }, [t2]), i2 = ht((e3) => {
817
+ }, [t2]), l2 = ht((e3) => {
808
818
  try {
809
819
  t2?.redo(e3);
810
820
  } catch (t3) {
811
- o2.error(t3);
821
+ i2.error(t3);
812
822
  }
813
823
  }, [t2]);
814
- return h(() => {
824
+ return o(() => {
815
825
  if (!e2) return;
816
826
  const t3 = { contains: (t4) => true, focus() {
817
- } }, n3 = [new $("undo", t3, { label: "Undo", description: jt, shortcut: { key: "z", modifiers: [z.Ctrl] }, disabled: true }, r2), new $("redo", t3, { label: "Redo", description: Xt, shortcut: [{ key: "y", modifiers: [z.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [z.Alt] }], disabled: true }, i2)];
827
+ } }, n3 = [new $("undo", t3, { label: "Undo", description: jt, shortcut: { key: "z", modifiers: [z.Ctrl] }, disabled: true }, s2), new $("redo", t3, { label: "Redo", description: Xt, shortcut: [{ key: "y", modifiers: [z.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [z.Alt] }], disabled: true }, l2)];
818
828
  e2?.addCommands(n3, true);
819
- }, [e2]), u(() => {
829
+ }, [e2]), r(() => {
820
830
  if (!e2) return;
821
- const o3 = () => {
822
- const o4 = t2?.getTopUndoDescription(), r4 = {};
831
+ const o2 = () => {
832
+ const o3 = t2?.getTopUndoDescription(), r3 = {};
823
833
  var i3;
824
- e2.getCommand("undo").update({ disabled: n2 || !t2 || !t2.hasUndo(), description: o4 ? (i3 = o4, `Undo ${i3}`) : jt, state: r4, context: { undoManager: t2 } });
825
- const s2 = t2?.getTopRedoDescription();
826
- e2.getCommand("redo").update({ disabled: n2 || !t2 || !t2.hasRedo(), description: s2 ? Yt(s2) : Xt, state: r4, context: { undoManager: t2 } });
834
+ e2.getCommand("undo").update({ disabled: n2 || !t2 || !t2.hasUndo(), description: o3 ? (i3 = o3, `Undo ${i3}`) : jt, state: r3, context: { undoManager: t2 } });
835
+ const s3 = t2?.getTopRedoDescription();
836
+ e2.getCommand("redo").update({ disabled: n2 || !t2 || !t2.hasRedo(), description: s3 ? Yt(s3) : Xt, state: r3, context: { undoManager: t2 } });
827
837
  };
828
- if (o3(), !t2) return;
829
- const r3 = t2.addListener({ onStackChange() {
830
- o3();
838
+ if (o2(), !t2) return;
839
+ const r2 = t2.addListener({ onStackChange() {
840
+ o2();
831
841
  } });
832
- return () => r3?.();
833
- }, [t2, e2, n2]), { undo: r2, redo: i2 };
842
+ return () => r2?.();
843
+ }, [t2, e2, n2]), { undo: s2, redo: l2 };
834
844
  };
835
- class Gt extends b {
845
+ class Gt extends m {
836
846
  static getDerivedStateFromError() {
837
847
  return { hasError: true };
838
848
  }
@@ -844,7 +854,7 @@ class Gt extends b {
844
854
  }
845
855
  }
846
856
  const qt = ({ children: t2 }) => {
847
- const e2 = rt(), n2 = f((t3) => {
857
+ const e2 = rt(), n2 = a((t3) => {
848
858
  e2.showError(t3);
849
859
  }, [e2]);
850
860
  return x(Gt, { onError: n2, children: t2 });
@@ -867,68 +877,68 @@ class Zt {
867
877
  }
868
878
  const Jt = ({ children: t2 }) => {
869
879
  const e2 = rt();
870
- return u(() => {
880
+ return r(() => {
871
881
  const t3 = new Zt(e2);
872
882
  return () => {
873
883
  t3.cleanup();
874
884
  };
875
885
  }, [e2]), x(E, { children: t2 });
876
886
  }, Qt = () => null, te = {}, ee = (t2) => {
877
- const { onPointerDown: e2, style: n2, splitDirection: o2, paddingBefore: r2 = 0, paddingAfter: i2 = 0, disabled: s2, key: l2, hitAreaProps: a2 = te, ...c2 } = t2, h2 = "row" === o2, { style: u2, className: d2, ...p2 } = a2;
887
+ const { onPointerDown: e2, style: n2, splitDirection: o2, paddingBefore: r2 = 0, paddingAfter: i2 = 0, disabled: s2, key: l2, propsHitArea: a2 = te, ...c2 } = t2, h2 = "row" === o2, { style: u2, className: d2, ...p2 } = a2;
878
888
  return x("div", { style: { ...n2, position: "relative" }, ...c2, children: x("div", { className: T("hit-box", d2), style: { left: (h2 ? -r2 : 0) + "px", width: `calc(100% + ${h2 ? r2 + i2 : 0}px)`, top: (h2 ? 0 : -r2) + "px", height: `calc(100% + ${h2 ? 0 : r2 + i2}px)`, position: "absolute", ...u2 }, onPointerDown: s2 ? void 0 : e2, ...p2 }) }, l2);
879
889
  }, ne = {}, oe = (t2, e2, n2 = true) => null === t2 ? null : null !== t2.pixels ? n2 ? t2.pixels : e2 - t2.pixels : (n2 ? t2.percent : 100 - t2.percent) / 100 * e2, re = (t2, e2 = true) => t2?.percent ? `${e2 ? t2.percent : 100 - t2.percent}%` : t2?.pixels ? `${t2.pixels}px` : void 0, ie = (t2, e2) => {
880
890
  if (null == t2) return null;
881
891
  const n2 = { percent: null, pixels: null };
882
892
  let o2 = e2;
883
893
  return "string" == typeof t2 && ((t2 = t2.trim().toLowerCase()).endsWith("px") ? (t2 = t2.substring(0, t2.length - 2), o2 = false) : t2.endsWith("%") && (t2 = t2.substring(0, t2.length - 1), o2 = true), t2 = parseFloat(t2)), o2 ? n2.percent = t2 : n2.pixels = t2, Object.freeze(n2);
884
- }, se = p(m((t2, e2) => {
885
- const { elementBefore: n2, elementAfter: o2, splitDirection: r2 = "row", fixedPane: i2 = null, position: s2, onPositionChange: c2, minBefore: p2, maxBefore: m2, minAfter: f2, maxAfter: _2, children: g2, className: y2, style: v2, disabled: w2 = false, onDragStart: b2, onDragResize: E2, onDragFinish: C2, resizerProps: k2 = ne, paneProps: P2 = ne, paneBeforeProps: D2 = ne, paneAfterProps: z2 = ne, createResizer: A2 = ee } = t2;
894
+ }, se = s(l((n2, s2) => {
895
+ const { elementBefore: l2, elementAfter: a2, splitDirection: c2 = "row", fixedPane: h2 = null, position: u2, onPositionChange: d2, minBefore: p2, maxBefore: m2, minAfter: f2, maxAfter: _2, children: g2, className: y2, style: v2, disabled: w2 = false, onDragStart: b2, onDragResize: E2, onDragFinish: C2, propsResizer: k2 = ne, propsPane: D2 = ne, propsPaneBefore: P2 = ne, propsPaneAfter: z2 = ne, renderResizer: A2 = ee } = n2;
886
896
  if (g2) throw new Error("Use elementBefore and elementAfter instead of children.");
887
- const B2 = h(() => l.isValidElement(o2) && l.isValidElement(n2), [o2, n2]), $2 = h(() => {
888
- let t3 = null;
889
- i2 && ("before" === i2 ? t3 = 0 : "after" === i2 && (t3 = 1));
890
- const e3 = null === t3;
891
- return { fixedPaneOffset: t3, isPercent: e3, minBefore: ie(p2, e3), maxBefore: ie(m2, e3), minAfter: ie(f2, e3), maxAfter: ie(_2, e3) };
892
- }, [p2, m2, f2, _2]), K2 = ht(c2, [c2]), [O2, I2] = d(() => ie(s2, null === i2));
893
- u(() => {
894
- I2(ie(s2, null === i2));
895
- }, [s2, i2]);
896
- const [N2, { width: H2, height: R2 }] = M(), [W2, { width: V2, height: F2 }] = M(), j2 = "row" === r2 ? V2 : F2, X2 = "row" === r2 ? H2 : R2, Y2 = h(() => ((t3, e3, n3, o3) => {
897
- const r3 = [null, null], i3 = [null, null];
898
- if (t3 || (t3 = { percent: null === o3.fixedPaneOffset ? 50 : null, pixels: null === o3.fixedPaneOffset ? null : 0 }), 0 === e3) return null != t3?.pixels ? 1 !== o3.fixedPaneOffset ? (r3[0] = t3?.pixels, i3[1] = 100) : (r3[1] = t3?.pixels - n3, i3[0] = 100) : null != t3?.percent && (1 !== o3.fixedPaneOffset ? (i3[0] = t3?.percent, i3[1] = 100 - t3?.percent) : (i3[1] = t3?.percent, i3[0] = 100 - t3?.percent)), { percents: i3, pixels: r3, minBefore: re(o3.minBefore, true), maxBefore: re(o3.maxBefore, true), minAfter: re(o3.minAfter), maxAfter: re(o3.maxAfter) };
899
- let s3 = oe(t3, e3, 1 !== o3.fixedPaneOffset), l2 = e3 - n3, a2 = oe(o3.minBefore, l2, true) ?? 0, c3 = oe(o3.maxBefore, l2, true) ?? l2, h2 = 0, u2 = 0, d2 = 0, p3 = l2;
900
- h2 = (oe(o3.maxAfter, e3, false) ?? n3) - n3, u2 = oe(o3.minAfter, e3, false) ?? e3, d2 = Math.max(a2, h2), p3 = Math.min(c3, u2), s3 = Math.max(d2, Math.min(s3, p3)), u2 = Math.min(l2 - s3, oe(o3.maxAfter, l2 - s3, true) ?? l2), h2 = Math.min(l2 - s3, oe(o3.minAfter, l2 - s3, true) ?? l2), r3[0] = s3, r3[1] = l2 - r3[0];
901
- const m3 = Math.max(0, Math.min(100, s3 / l2 * 100));
902
- return i3[0] = m3, i3[1] = 100 - i3[0], { percents: i3, pixels: r3, minBefore: `${a2}px`, minAfter: `${h2}px`, maxBefore: `${r3[0]}px`, maxAfter: `${r3[1]}px` };
903
- })(O2, X2, j2, $2), [$2, O2, X2, j2, r2]), [U2, G2] = d(false), q2 = ht(b2, [b2]), Z2 = ht(E2, [E2]), J2 = ht(C2, [C2]), Q2 = a(null), tt2 = a(null), et2 = a(null), { style: nt2, className: ot2, ...rt2 } = P2, it2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...nt2 }, { className: st2, style: lt2, ...at2 } = D2, { className: ct2, style: ut2, ...dt2 } = z2, pt2 = { flex: "1 1 100%", width: "100%", ...v2, flexDirection: r2, display: "flex" }, { className: mt2, style: ft2, onPointerDown: _t2, ...gt2 } = k2, yt2 = ht((t3) => {
904
- const e3 = ie(t3, null === i2);
905
- I2(e3);
906
- }, [i2]), vt2 = ht((t3) => {
897
+ const B2 = o(() => t.isValidElement(a2) && t.isValidElement(l2), [a2, l2]), $2 = o(() => {
898
+ let t2 = null;
899
+ h2 && ("before" === h2 ? t2 = 0 : "after" === h2 && (t2 = 1));
900
+ const e2 = null === t2;
901
+ return { fixedPaneOffset: t2, isPercent: e2, minBefore: ie(p2, e2), maxBefore: ie(m2, e2), minAfter: ie(f2, e2), maxAfter: ie(_2, e2) };
902
+ }, [p2, m2, f2, _2]), K2 = ht(d2, [d2]), [I2, O2] = i(() => ie(u2, null === h2));
903
+ r(() => {
904
+ O2(ie(u2, null === h2));
905
+ }, [u2, h2]);
906
+ const [N2, { width: H2, height: R2 }] = M(), [W2, { width: V2, height: F2 }] = M(), j2 = "row" === c2 ? V2 : F2, X2 = "row" === c2 ? H2 : R2, Y2 = o(() => ((t2, e2, n3, o2) => {
907
+ const r2 = [null, null], i2 = [null, null];
908
+ if (t2 || (t2 = { percent: null === o2.fixedPaneOffset ? 50 : null, pixels: null === o2.fixedPaneOffset ? null : 0 }), 0 === e2) return null != t2?.pixels ? 1 !== o2.fixedPaneOffset ? (r2[0] = t2?.pixels, i2[1] = 100) : (r2[1] = t2?.pixels - n3, i2[0] = 100) : null != t2?.percent && (1 !== o2.fixedPaneOffset ? (i2[0] = t2?.percent, i2[1] = 100 - t2?.percent) : (i2[1] = t2?.percent, i2[0] = 100 - t2?.percent)), { percents: i2, pixels: r2, minBefore: re(o2.minBefore, true), maxBefore: re(o2.maxBefore, true), minAfter: re(o2.minAfter), maxAfter: re(o2.maxAfter) };
909
+ let s3 = oe(t2, e2, 1 !== o2.fixedPaneOffset), l3 = e2 - n3, a3 = oe(o2.minBefore, l3, true) ?? 0, c3 = oe(o2.maxBefore, l3, true) ?? l3, h3 = 0, u3 = 0, d3 = 0, p3 = l3;
910
+ h3 = (oe(o2.maxAfter, e2, false) ?? n3) - n3, u3 = oe(o2.minAfter, e2, false) ?? e2, d3 = Math.max(a3, h3), p3 = Math.min(c3, u3), s3 = Math.max(d3, Math.min(s3, p3)), u3 = Math.min(l3 - s3, oe(o2.maxAfter, l3 - s3, true) ?? l3), h3 = Math.min(l3 - s3, oe(o2.minAfter, l3 - s3, true) ?? l3), r2[0] = s3, r2[1] = l3 - r2[0];
911
+ const m3 = Math.max(0, Math.min(100, s3 / l3 * 100));
912
+ return i2[0] = m3, i2[1] = 100 - i2[0], { percents: i2, pixels: r2, minBefore: `${a3}px`, minAfter: `${h3}px`, maxBefore: `${r2[0]}px`, maxAfter: `${r2[1]}px` };
913
+ })(I2, X2, j2, $2), [$2, I2, X2, j2, c2]), [U2, G2] = i(false), q2 = ht(b2, [b2]), Z2 = ht(E2, [E2]), J2 = ht(C2, [C2]), Q2 = e(null), tt2 = e(null), et2 = e(null), { style: nt2, className: ot2, ...rt2 } = D2, it2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...nt2 }, { className: st2, style: lt2, ...at2 } = P2, { className: ct2, style: ut2, ...dt2 } = z2, pt2 = { flex: "1 1 100%", width: "100%", ...v2, flexDirection: c2, display: "flex" }, { className: mt2, style: ft2, onPointerDown: _t2, ...gt2 } = k2, yt2 = ht((t2) => {
914
+ const e2 = ie(t2, null === h2);
915
+ O2(e2);
916
+ }, [h2]), vt2 = ht((t2) => {
907
917
  if (w2 || !U2) return;
908
- const e3 = xt2.current?.getBoundingClientRect();
918
+ const e2 = xt2.current?.getBoundingClientRect();
909
919
  let n3 = 0;
910
- n3 = "row" === r2 ? (t3.clientX ?? t3.touches?.[0]?.clientX) - e3.x : (t3.clientY ?? t3.touches?.[0]?.clientY) - e3.y, n3 = Math.max(0, Math.min(X2, n3)), 1 === $2.fixedPaneOffset && (n3 = X2 - n3), s2 && O2.pixels === n3 || I2({ pixels: n3, percent: null }), Z2?.(n3), t3.stopPropagation(), t3.preventDefault();
911
- }, [$2, r2, w2, U2, O2, X2]), wt2 = ht((t3) => {
920
+ n3 = "row" === c2 ? (t2.clientX ?? t2.touches?.[0]?.clientX) - e2.x : (t2.clientY ?? t2.touches?.[0]?.clientY) - e2.y, n3 = Math.max(0, Math.min(X2, n3)), 1 === $2.fixedPaneOffset && (n3 = X2 - n3), u2 && I2.pixels === n3 || O2({ pixels: n3, percent: null }), Z2?.(n3), t2.stopPropagation(), t2.preventDefault();
921
+ }, [$2, c2, w2, U2, I2, X2]), wt2 = ht((t2) => {
912
922
  if (document.removeEventListener("pointermove", vt2), document.removeEventListener("touchmove", vt2), document.removeEventListener("pointerup", wt2), !U2) return;
913
- if (G2(false), !O2) return;
914
- J2(O2.pixels);
915
- if (!ie(s2, null === i2) || O2.pixels !== s2) {
916
- const t4 = { ...O2 };
917
- null === t4.percent && (t4.percent = t4.pixels / X2 * 100), K2(t4);
923
+ if (G2(false), !I2) return;
924
+ J2(I2.pixels);
925
+ if (!ie(u2, null === h2) || I2.pixels !== u2) {
926
+ const t3 = { ...I2 };
927
+ null === t3.percent && (t3.percent = t3.pixels / X2 * 100), K2(t3);
918
928
  }
919
- t3.stopPropagation(), t3.preventDefault();
920
- }, [O2, U2, s2, i2, X2]), bt2 = ht((t3) => {
921
- _t2?.(t3), t3.defaultPrevented || w2 || U2 || (G2(true), q2(), document.addEventListener("pointermove", vt2, { passive: false }), document.addEventListener("touchmove", vt2, { passive: false }), document.addEventListener("pointerup", wt2, { passive: false }));
922
- }, [_t2]), xt2 = Ft(e2, () => ({ setPosition: yt2, isSplitPane: () => true }), []), St2 = h(() => B2 ? A2?.({ key: "resizer", ref: L([W2, tt2]), className: T("resizer", mt2), onPointerDownCapture: bt2, style: { cursor: w2 ? void 0 : "row" === r2 ? "ew-resize" : "ns-resize", minWidth: "row" === r2 ? "2px" : void 0, minHeight: "row" !== r2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...ft2 }, splitDirection: r2, disabled: w2, ...gt2 }) : null, [B2, mt2, gt2, r2, ft2, w2]), Et2 = "row" === r2 ? "Width" : "Height", Lt2 = h(() => {
923
- if (!n2) return null;
924
- const t3 = { ...it2, ...lt2, flex: 0 === $2.fixedPaneOffset && null !== Y2?.pixels[0] ? `0 0 ${Math.round(Y2?.pixels[0])}px` : `1 1 ${Math.round(Y2?.percents[0] ?? 100)}%`, [`min${Et2}`]: Y2?.minBefore, [`max${Et2}`]: o2 ? Y2?.maxBefore : "100%" };
925
- return x("div", { ref: Q2, className: T("before", ot2, st2), style: t3, ...rt2, ...at2, children: n2 }, "before");
926
- }, [n2, P2, D2, $2, Y2]), Mt2 = h(() => {
927
- if (!o2) return null;
928
- const t3 = { ...it2, ...ut2, flex: 1 === $2.fixedPaneOffset && null !== Y2?.pixels[1] ? `0 0 ${Math.round(Y2?.pixels[1])}px` : `1 1 ${Math.round(Y2?.percents[1] ?? 100)}%`, [`min${Et2}`]: Y2?.minAfter, [`max${Et2}`]: n2 ? Y2?.maxAfter : "100%" };
929
- return x("div", { ref: et2, className: T("after", ot2, ct2), style: t3, ...rt2, ...dt2, children: o2 }, "after");
930
- }, [o2, P2, z2, $2, Y2]);
931
- return S("div", { ref: L([N2, xt2]), className: T("splitPane", "row" === r2 ? "vertical" : "horizontal", { dragging: U2 }, y2), style: pt2, children: [Lt2, St2, Mt2] });
929
+ t2.stopPropagation(), t2.preventDefault();
930
+ }, [I2, U2, u2, h2, X2]), bt2 = ht((t2) => {
931
+ _t2?.(t2), t2.defaultPrevented || w2 || U2 || (G2(true), q2(), document.addEventListener("pointermove", vt2, { passive: false }), document.addEventListener("touchmove", vt2, { passive: false }), document.addEventListener("pointerup", wt2, { passive: false }));
932
+ }, [_t2]), xt2 = Ft(s2, () => ({ setPosition: yt2, isSplitPane: () => true }), []), St2 = o(() => B2 ? A2?.({ key: "resizer", ref: L([W2, tt2]), className: T("resizer", mt2), onPointerDownCapture: bt2, style: { cursor: w2 ? void 0 : "row" === c2 ? "ew-resize" : "ns-resize", minWidth: "row" === c2 ? "2px" : void 0, minHeight: "row" !== c2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...ft2 }, splitDirection: c2, disabled: w2, ...gt2 }) : null, [B2, mt2, gt2, c2, ft2, w2]), Et2 = "row" === c2 ? "Width" : "Height", Lt2 = o(() => {
933
+ if (!l2) return null;
934
+ const t2 = { ...it2, ...lt2, flex: 0 === $2.fixedPaneOffset && null !== Y2?.pixels[0] ? `0 0 ${Math.round(Y2?.pixels[0])}px` : `1 1 ${Math.round(Y2?.percents[0] ?? 100)}%`, [`min${Et2}`]: Y2?.minBefore, [`max${Et2}`]: a2 ? Y2?.maxBefore : "100%" };
935
+ return x("div", { ref: Q2, className: T("before", ot2, st2), style: t2, ...rt2, ...at2, children: l2 }, "before");
936
+ }, [l2, D2, P2, $2, Y2]), Mt2 = o(() => {
937
+ if (!a2) return null;
938
+ const t2 = { ...it2, ...ut2, flex: 1 === $2.fixedPaneOffset && null !== Y2?.pixels[1] ? `0 0 ${Math.round(Y2?.pixels[1])}px` : `1 1 ${Math.round(Y2?.percents[1] ?? 100)}%`, [`min${Et2}`]: Y2?.minAfter, [`max${Et2}`]: l2 ? Y2?.maxAfter : "100%" };
939
+ return x("div", { ref: et2, className: T("after", ot2, ct2), style: t2, ...rt2, ...dt2, children: a2 }, "after");
940
+ }, [a2, D2, z2, $2, Y2]);
941
+ return S("div", { ref: L([N2, xt2]), className: T("splitPane", "row" === c2 ? "vertical" : "horizontal", { dragging: U2 }, y2), style: pt2, children: [Lt2, St2, Mt2] });
932
942
  }));
933
943
  function le(t2) {
934
944
  if ("function" == typeof t2) return t2;
@@ -1159,53 +1169,53 @@ function de() {
1159
1169
  }
1160
1170
  se.displayName = "SplitPane";
1161
1171
  const pe = de();
1162
- pe.register("base", () => import("./DIUtMpFEGWd4fFvO.mjs"));
1163
- const me = (t2) => x("svg", { ...t2, children: x("path", {}) }), fe = { Icon: "_Icon_17dpm_10" }, _e = p((e2) => {
1164
- const { iconKey: n2, packKey: o2, className: r2, style: i2, role: s2, title: a2, size: c2, ariaHidden: u2, sourceProps: d2, children: p2, ...m2 } = e2, [f2, _2] = l.useState(null);
1165
- l.useEffect(() => {
1166
- let e3 = true, r3 = o2, i3 = n2;
1167
- if (!i3) {
1168
- const e4 = pe.getPack(r3);
1169
- return void _2({ glyph: e4 ? { svg: t.EmptyArray } : void 0, pack: e4 ?? void 0, packKey: r3 ?? pe.getActive() });
1172
+ pe.register("base", () => import("./CJ8rg6a2gULy0991.mjs"));
1173
+ const me = (t2) => x("svg", { ...t2, children: x("path", {}) }), fe = { Icon: "_Icon_17dpm_10" }, _e = s((e2) => {
1174
+ const { iconKey: n2, packKey: r2, className: i2, style: s2, role: l2, title: a2, size: c2, ariaHidden: h2, propsSource: u2, children: d2, ...p2 } = e2, [m2, _2] = t.useState(null);
1175
+ t.useEffect(() => {
1176
+ let t2 = true, e3 = r2, o2 = n2;
1177
+ if (!o2) {
1178
+ const t3 = pe.getPack(e3);
1179
+ return void _2({ glyph: t3 ? { svg: f.EmptyArray } : void 0, pack: t3 ?? void 0, packKey: e3 ?? pe.getActive() });
1170
1180
  }
1171
- if (i3.includes(":")) {
1172
- const [t2, e4] = i3.split(":");
1173
- r3 = t2, i3 = e4;
1181
+ if (o2.includes(":")) {
1182
+ const [t3, n3] = o2.split(":");
1183
+ e3 = t3, o2 = n3;
1174
1184
  }
1175
- return pe.resolve(i3, { packKey: r3 }).then((t2) => {
1176
- e3 && _2(t2);
1185
+ return pe.resolve(o2, { packKey: e3 }).then((e4) => {
1186
+ t2 && _2(e4);
1177
1187
  }), () => {
1178
- e3 = false;
1188
+ t2 = false;
1179
1189
  };
1180
- }, [n2, o2]);
1181
- const g2 = f2?.pack, y2 = f2?.glyph, v2 = f2?.packKey;
1190
+ }, [n2, r2]);
1191
+ const g2 = m2?.pack, y2 = m2?.glyph, v2 = m2?.packKey;
1182
1192
  let w2 = y2 ? y2.svg : void 0;
1183
- const b2 = y2 && !w2 ? y2.url : void 0, S2 = !y2 || w2 || b2 ? void 0 : y2.emoji, E2 = null != c2 ? "number" == typeof c2 ? `${c2}px` : c2 : void 0, L2 = h(() => [fe.Icon, "icon", r2].filter(Boolean).join(" "), [r2]), M2 = h(() => {
1184
- const t2 = { ...i2 };
1193
+ const b2 = y2 && !w2 ? y2.url : void 0, S2 = !y2 || w2 || b2 ? void 0 : y2.emoji, E2 = null != c2 ? "number" == typeof c2 ? `${c2}px` : c2 : void 0, L2 = o(() => [fe.Icon, "icon", i2].filter(Boolean).join(" "), [i2]), M2 = o(() => {
1194
+ const t2 = { ...s2 };
1185
1195
  return t2["--icon-size"] = E2, t2;
1186
- }, [i2, E2]), T2 = s2 ?? (a2 ? "img" : "presentation"), C2 = u2 ?? (!a2 || void 0), k2 = (t2) => x("span", { className: L2, style: M2, role: T2, "aria-hidden": C2, title: a2, "data-icon-glyph": n2, "data-icon-pack": v2, ...m2, children: t2 });
1187
- if (p2) return k2(p2);
1196
+ }, [s2, E2]), T2 = l2 ?? (a2 ? "img" : "presentation"), C2 = h2 ?? (!a2 || void 0), k2 = (t2) => x("span", { className: L2, style: M2, role: T2, "aria-hidden": C2, title: a2, "data-icon-glyph": n2, "data-icon-pack": v2, ...p2, children: t2 });
1197
+ if (d2) return k2(d2);
1188
1198
  if (S2) return k2(x("span", { children: "string" == typeof S2 ? S2 : S2.text }));
1189
1199
  if (b2) return k2(x("img", { src: b2.src, alt: a2 ?? "" }));
1190
1200
  if (y2 && "react" in y2) {
1191
- const t2 = y2.react, e3 = { className: L2, style: M2, role: T2, "aria-hidden": C2, title: a2, ...m2, ...d2 };
1201
+ const t2 = y2.react, e3 = { className: L2, style: M2, role: T2, "aria-hidden": C2, title: a2, ...p2, ...u2 };
1192
1202
  return k2(x(t2, { ...e3 }));
1193
1203
  }
1194
- const P2 = { viewBox: w2?.viewBox ?? g2?.meta.defaultViewBox ?? "0 0 24 24" };
1204
+ const D2 = { viewBox: w2?.viewBox ?? g2?.meta.defaultViewBox ?? "0 0 24 24" };
1195
1205
  if ("function" == typeof w2) {
1196
- return k2(w2(P2) ?? x(me, { ...P2 }));
1206
+ return k2(w2(D2) ?? x(me, { ...D2 }));
1197
1207
  }
1198
- if (!w2) return k2(x(me, { ...P2 }));
1199
- const D2 = w2.paths;
1200
- return k2(x("svg", { ...P2, children: D2 ? D2.map((t2, e3) => x("path", { d: t2.d, className: t2.className, fill: t2.fill, stroke: t2.stroke, opacity: t2.opacity, fillRule: t2.fillRule, clipRule: t2.clipRule }, e3)) : null }));
1208
+ if (!w2) return k2(x(me, { ...D2 }));
1209
+ const P2 = w2.paths;
1210
+ return k2(x("svg", { ...D2, children: P2 ? P2.map((t2, e3) => x("path", { d: t2.d, className: t2.className, fill: t2.fill, stroke: t2.stroke, opacity: t2.opacity, fillRule: t2.fillRule, clipRule: t2.clipRule }, e3)) : null }));
1201
1211
  });
1202
1212
  function ge(t2) {
1203
- const { isWalking: e2 = false, themedType: n2 = "info", speed: o2 = 120, dashGap: r2 = 3, dashLength: i2 = 5, iconKey: s2, packKey: l2, style: a2, className: c2, ...u2 } = t2, d2 = h(() => {
1213
+ const { isWalking: e2 = false, themedType: n2 = "info", speed: r2 = 120, dashGap: i2 = 3, dashLength: s2 = 5, iconKey: l2, packKey: a2, style: c2, className: h2, ...u2 } = t2, d2 = o(() => {
1204
1214
  if (!e2) return;
1205
- const t3 = { "--walk-duration": `${o2 * (r2 + i2)}ms`, "--walk-dash-length": `${i2}px`, "--walk-dash-gap": `${r2}px` };
1215
+ const t3 = { "--walk-duration": `${r2 * (i2 + s2)}ms`, "--walk-dash-length": `${s2}px`, "--walk-dash-gap": `${i2}px` };
1206
1216
  return n2 && "accent" !== n2 && (t3["--icon-accent"] = `var(--icon-${n2})`), t3;
1207
- }, [e2, o2, r2, i2, n2]), p2 = h(() => e2 ? c2 + " walking" : c2, [e2, c2]);
1208
- return x(_e, { iconKey: s2, packKey: l2, className: p2, style: { ...a2, ...d2 }, ...u2 });
1217
+ }, [e2, r2, i2, s2, n2]), p2 = o(() => e2 ? h2 + " walking" : h2, [e2, h2]);
1218
+ return x(_e, { iconKey: l2, packKey: a2, className: p2, style: { ...c2, ...d2 }, ...u2 });
1209
1219
  }
1210
1220
  class ye {
1211
1221
  constructor() {
@@ -1221,89 +1231,89 @@ class ye {
1221
1231
  this.store.delete(t2);
1222
1232
  }
1223
1233
  }
1224
- const ve = _(null), we = { parse: (t2) => t2 ? JSON.parse(t2) : null, stringify: JSON.stringify }, be = { store: new ye(), namespace: "", serializer: we, debounceMs: 0, crossTabSync: false, notify: () => {
1234
+ const ve = c(null), we = { parse: (t2) => t2 ? JSON.parse(t2) : null, stringify: JSON.stringify }, be = { store: new ye(), namespace: "", serializer: we, debounceMs: 0, crossTabSync: false, notify: () => {
1225
1235
  }, subscribeKey: () => () => {
1226
1236
  } };
1227
- function xe(t2, e2, n2 = Se) {
1228
- const { store: o2, namespace: r2, serializer: i2, debounceMs: s2, subscribeKey: l2 } = g(ve) || be, c2 = n2.serializer ?? i2 ?? we, p2 = h(() => `${r2}:${t2}`, [r2, t2]), m2 = a(null), f2 = `${p2}::v`, [_2, y2] = d(() => {
1237
+ function xe(t2, n2, s2 = Se) {
1238
+ const { store: l2, namespace: a2, serializer: c2, debounceMs: u2, subscribeKey: d2 } = h(ve) || be, p2 = s2.serializer ?? c2 ?? we, m2 = o(() => `${a2}:${t2}`, [a2, t2]), f2 = e(null), _2 = `${m2}::v`, [g2, y2] = i(() => {
1229
1239
  let t3;
1230
1240
  try {
1231
- if ("undefined" != typeof window && "localStorage" in window && p2.startsWith(r2)) {
1232
- const e3 = window.localStorage?.getItem(p2) ?? null;
1233
- null != e3 && (t3 = c2.parse(e3));
1241
+ if ("undefined" != typeof window && "localStorage" in window && m2.startsWith(a2)) {
1242
+ const e2 = window.localStorage?.getItem(m2) ?? null;
1243
+ null != e2 && (t3 = p2.parse(e2));
1234
1244
  }
1235
1245
  } catch {
1236
1246
  }
1237
1247
  if (void 0 === t3) {
1238
- const t4 = e2;
1248
+ const t4 = n2;
1239
1249
  return "function" == typeof t4 ? t4() : t4;
1240
1250
  }
1241
1251
  return t3;
1242
1252
  });
1243
- u(() => {
1253
+ r(() => {
1244
1254
  let t3 = true;
1245
1255
  return (async () => {
1246
- const [r3, i3] = await Promise.all([o2.getItem(p2), o2.getItem(f2)]);
1247
- let s3;
1256
+ const [e2, o2] = await Promise.all([l2.getItem(m2), l2.getItem(_2)]);
1257
+ let r2;
1248
1258
  try {
1249
- s3 = null == r3 ? void 0 : c2.parse(r3);
1259
+ r2 = null == e2 ? void 0 : p2.parse(e2);
1250
1260
  } catch {
1251
1261
  }
1252
- const l3 = null == i3 ? void 0 : Number.parseInt(i3, 10);
1253
- if (void 0 === s3) {
1254
- if (!n2.lazy && void 0 !== e2) {
1255
- s3 = "function" == typeof e2 ? e2() : e2, await o2.setItem(p2, c2.stringify(s3)), null != n2.version && await o2.setItem(f2, String(n2.version));
1262
+ const i2 = null == o2 ? void 0 : Number.parseInt(o2, 10);
1263
+ if (void 0 === r2) {
1264
+ if (!s2.lazy && void 0 !== n2) {
1265
+ r2 = "function" == typeof n2 ? n2() : n2, await l2.setItem(m2, p2.stringify(r2)), null != s2.version && await l2.setItem(_2, String(s2.version));
1256
1266
  }
1257
- } else if (null != n2.version && void 0 !== l3 && l3 !== n2.version && n2.migrate) {
1258
- s3 = n2.migrate(s3, l3), await o2.setItem(p2, c2.stringify(s3)), await o2.setItem(f2, String(n2.version));
1267
+ } else if (null != s2.version && void 0 !== i2 && i2 !== s2.version && s2.migrate) {
1268
+ r2 = s2.migrate(r2, i2), await l2.setItem(m2, p2.stringify(r2)), await l2.setItem(_2, String(s2.version));
1259
1269
  }
1260
- t3 && void 0 !== s3 && y2(s3);
1270
+ t3 && void 0 !== r2 && y2(r2);
1261
1271
  })(), () => {
1262
1272
  t3 = false;
1263
1273
  };
1264
- }, [o2, p2, f2, n2.version, n2.migrate, n2.lazy]), u(() => l2(t2, async () => {
1265
- const t3 = await o2.getItem(p2);
1274
+ }, [l2, m2, _2, s2.version, s2.migrate, s2.lazy]), r(() => d2(t2, async () => {
1275
+ const t3 = await l2.getItem(m2);
1266
1276
  if (null != t3) try {
1267
- y2(c2.parse(t3));
1277
+ y2(p2.parse(t3));
1268
1278
  } catch {
1269
1279
  }
1270
- }), [o2, p2, l2, t2]);
1280
+ }), [l2, m2, d2, t2]);
1271
1281
  const v2 = async (t3) => {
1272
- await o2.setItem(p2, c2.stringify(t3)), null != n2.version && await o2.setItem(f2, String(n2.version));
1282
+ await l2.setItem(m2, p2.stringify(t3)), null != s2.version && await l2.setItem(_2, String(s2.version));
1273
1283
  };
1274
- return [_2, (t3) => {
1275
- y2((e3) => {
1276
- const n3 = "function" == typeof t3 ? t3(e3) : t3;
1277
- return m2.current && clearTimeout(m2.current), s2 > 0 ? m2.current = setTimeout(() => {
1284
+ return [g2, (t3) => {
1285
+ y2((e2) => {
1286
+ const n3 = "function" == typeof t3 ? t3(e2) : t3;
1287
+ return f2.current && clearTimeout(f2.current), u2 > 0 ? f2.current = setTimeout(() => {
1278
1288
  v2(n3);
1279
- }, s2) : v2(n3), n3;
1289
+ }, u2) : v2(n3), n3;
1280
1290
  });
1281
1291
  }, () => {
1282
- if (m2.current && clearTimeout(m2.current), o2.removeItem(p2), o2.removeItem(f2), void 0 !== e2) {
1283
- const t3 = "function" == typeof e2 ? e2() : e2;
1292
+ if (f2.current && clearTimeout(f2.current), l2.removeItem(m2), l2.removeItem(_2), void 0 !== n2) {
1293
+ const t3 = "function" == typeof n2 ? n2() : n2;
1284
1294
  y2(t3);
1285
1295
  } else y2(void 0);
1286
1296
  }];
1287
1297
  }
1288
1298
  const Se = {};
1289
1299
  function Ee(t2) {
1290
- const { store: e2, namespace: n2 = "", serializer: o2 = Le, debounceMs: r2 = 0, crossTabSync: i2 = true, children: s2 } = t2, l2 = h(() => "undefined" == typeof window ? new ye() : e2 ?? new ye(), [e2]), c2 = a(/* @__PURE__ */ new Map()), d2 = h(() => ({ store: l2, namespace: n2, serializer: o2, debounceMs: r2, crossTabSync: i2, notify(t3) {
1291
- const e3 = c2.current.get(t3);
1292
- e3 && e3.forEach((t4) => t4());
1293
- }, subscribeKey(t3, e3) {
1294
- const n3 = c2.current, o3 = n3.get(t3) ?? /* @__PURE__ */ new Set();
1295
- return o3.add(e3), n3.set(t3, o3), () => {
1296
- const o4 = n3.get(t3);
1297
- o4 && (o4.delete(e3), 0 === o4.size && n3.delete(t3));
1300
+ const { store: n2, namespace: i2 = "", serializer: s2 = Le, debounceMs: l2 = 0, crossTabSync: a2 = true, children: c2 } = t2, h2 = o(() => "undefined" == typeof window ? new ye() : n2 ?? new ye(), [n2]), u2 = e(/* @__PURE__ */ new Map()), d2 = o(() => ({ store: h2, namespace: i2, serializer: s2, debounceMs: l2, crossTabSync: a2, notify(t3) {
1301
+ const e2 = u2.current.get(t3);
1302
+ e2 && e2.forEach((t4) => t4());
1303
+ }, subscribeKey(t3, e2) {
1304
+ const n3 = u2.current, o2 = n3.get(t3) ?? /* @__PURE__ */ new Set();
1305
+ return o2.add(e2), n3.set(t3, o2), () => {
1306
+ const o3 = n3.get(t3);
1307
+ o3 && (o3.delete(e2), 0 === o3.size && n3.delete(t3));
1298
1308
  };
1299
- } }), [l2, n2, o2, r2, i2]);
1300
- return u(() => {
1309
+ } }), [h2, i2, s2, l2, a2]);
1310
+ return r(() => {
1301
1311
  if (d2.crossTabSync && d2.store.subscribe) return d2.store.subscribe((t3) => {
1302
1312
  if (!t3.startsWith(d2.namespace + ":")) return;
1303
- const e3 = t3.slice(d2.namespace.length + 1);
1304
- d2.notify(e3);
1313
+ const e2 = t3.slice(d2.namespace.length + 1);
1314
+ d2.notify(e2);
1305
1315
  });
1306
- }, [d2]), x(ve.Provider, { value: d2, children: s2 });
1316
+ }, [d2]), x(ve.Provider, { value: d2, children: c2 });
1307
1317
  }
1308
1318
  const Le = { parse: (t2) => null == t2 ? null : JSON.parse(t2), stringify: JSON.stringify };
1309
1319
  class Me {
@@ -1336,68 +1346,68 @@ class Me {
1336
1346
  return window.addEventListener("storage", e2), () => window.removeEventListener("storage", e2);
1337
1347
  }
1338
1348
  }
1339
- const Te = { Horizontal: "horizontal", Vertical: "vertical" }, Ce = { scrollbar: "_scrollbar_gqxsx_24", track: "_track_gqxsx_35", thumb: "_thumb_gqxsx_47", "scrollbar-button": "_scrollbar-button_gqxsx_89", "touch-thumb": "_touch-thumb_gqxsx_124" }, ke = "M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z", Pe = "M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z", De = { transform: "rotate(180deg)" }, ze = (t2) => {
1340
- const { style: e2, orientation: n2 = Te.Vertical, disabled: o2, ...r2 } = t2, i2 = n2 === Te.Vertical ? ke : Pe;
1349
+ const Te = { Horizontal: "horizontal", Vertical: "vertical" }, Ce = { scrollbar: "_scrollbar_gqxsx_24", track: "_track_gqxsx_35", thumb: "_thumb_gqxsx_47", "scrollbar-button": "_scrollbar-button_gqxsx_89", "touch-thumb": "_touch-thumb_gqxsx_124" }, ke = "M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z", De = "M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z", Pe = { transform: "rotate(180deg)" }, ze = (t2) => {
1350
+ const { style: e2, orientation: n2 = Te.Vertical, disabled: o2, ...r2 } = t2, i2 = n2 === Te.Vertical ? ke : De;
1341
1351
  return x("button", { style: e2, className: T(Ce["scrollbar-button"], n2, "scroll-button"), disabled: o2, ...r2, children: x("svg", { width: "9", height: "9", viewBox: "0 0 9 9", children: x("path", { d: i2 }) }) });
1342
1352
  }, Ae = (t2) => {
1343
- const { style: e2, orientation: n2 = Te.Vertical, disabled: o2, ...r2 } = t2, i2 = n2 === Te.Vertical ? ke : Pe;
1344
- return x("button", { style: e2, className: T(Ce["scrollbar-button"], n2, "scroll-button"), disabled: o2, ...r2, children: x("svg", { width: "9", height: "9", viewBox: "0 0 9 9", style: De, children: x("path", { d: i2 }) }) });
1353
+ const { style: e2, orientation: n2 = Te.Vertical, disabled: o2, ...r2 } = t2, i2 = n2 === Te.Vertical ? ke : De;
1354
+ return x("button", { style: e2, className: T(Ce["scrollbar-button"], n2, "scroll-button"), disabled: o2, ...r2, children: x("svg", { width: "9", height: "9", viewBox: "0 0 9 9", style: Pe, children: x("path", { d: i2 }) }) });
1345
1355
  }, Be = (t2) => {
1346
1356
  const { style: e2, orientation: n2 = Te.Vertical, ...o2 } = t2, r2 = n2 === Te.Vertical;
1347
1357
  return x("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...e2 }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} edge`, ...o2, children: x("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: r2 ? "rotate(90) " : "", children: x("path", { style: { transition: "opacity 240ms ease 0s", opacity: t2.disabled ? 0 : 1 }, d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }) }) });
1348
- }, $e = N().supportsTouchEvents, Ke = p(m((t2, e2) => {
1349
- const { borderColor: n2 = "var(--sxl-app-color-primary, rgb(33, 115, 70))", backgroundColor: o2 = "var(--sxl-app-color-background, white)", fillColor: r2 = "var(--sxl-app-color-grey, grey)", borderWidth: i2 = 3, size: s2 = 22, style: l2, className: c2, onPointerDown: p2, onPointerMove: m2, onPointerUp: f2, orientation: _2 = Te.Vertical, offset: g2 = 0, currentTouchAnchor: y2, elementParent: v2, elementRoot: w2, key: b2, ...M2 } = t2;
1358
+ }, $e = H().supportsTouchEvents, Ke = s(l((t2, n2) => {
1359
+ const { borderColor: s2 = "var(--sxl-app-color-primary, rgb(33, 115, 70))", backgroundColor: l2 = "var(--sxl-app-color-background, white)", fillColor: a2 = "var(--sxl-app-color-grey, grey)", borderWidth: c2 = 3, size: h2 = 22, style: u2, className: d2, onPointerDown: p2, onPointerMove: m2, onPointerUp: f2, orientation: _2 = Te.Vertical, offset: g2 = 0, currentTouchAnchor: y2, elementParent: v2, elementRoot: w2, key: b2, ...M2 } = t2;
1350
1360
  if (!$e) return null;
1351
- const C2 = ht(p2, [p2]), k2 = ht(m2, [m2]), D2 = ht(f2, [f2]), z2 = _2 === Te.Vertical, [A2, B2] = d(false), $2 = _t(h(() => ({ processTouch: true, consumeTouch: true, onPointerDown: (t3, e3) => {
1361
+ const C2 = ht(p2, [p2]), k2 = ht(m2, [m2]), P2 = ht(f2, [f2]), z2 = _2 === Te.Vertical, [A2, B2] = i(false), $2 = _t(o(() => ({ processTouch: true, consumeTouch: true, onPointerDown: (t3, e2) => {
1352
1362
  B2(true), C2?.(t3), t3.preventDefault(), t3.stopPropagation();
1353
- }, onPointerMoveOrWait: (t3, e3, n3) => {
1363
+ }, onPointerMoveOrWait: (t3, e2, n3) => {
1354
1364
  k2?.(t3);
1355
- }, onPointerUp: (t3, e3, n3) => {
1356
- B2(false), D2?.(n3), t3.preventDefault(), t3.stopPropagation();
1357
- } }), [])), K2 = h(() => {
1358
- const t3 = s2 / 2 + i2 / 2 + 6;
1359
- return { x: z2 ? -t3 : g2 + s2, y: z2 ? g2 + s2 : -t3, width: 0, height: 0 };
1360
- }, [z2, g2, s2]), [O2, { y: I2, x: N2 }] = ct(), H2 = a(null), { getPortalContainer: R2, isFullscreen: W2 } = ft(), [V2, F2] = d(null);
1361
- return u(() => {
1365
+ }, onPointerUp: (t3, e2, n3) => {
1366
+ B2(false), P2?.(n3), t3.preventDefault(), t3.stopPropagation();
1367
+ } }), [])), K2 = o(() => {
1368
+ const t3 = h2 / 2 + c2 / 2 + 6;
1369
+ return { x: z2 ? -t3 : g2 + h2, y: z2 ? g2 + h2 : -t3, width: 0, height: 0 };
1370
+ }, [z2, g2, h2]), [I2, { y: O2, x: N2 }] = ct(), H2 = e(null), { getPortalContainer: R2, isFullscreen: W2 } = ft(), [V2, F2] = i(null);
1371
+ return r(() => {
1362
1372
  const t3 = H2.current?.getBoundingClientRect();
1363
1373
  if (!t3) return void F2(null);
1364
- let a2 = 0, h2 = 0, u2 = v2;
1365
- for (; u2; ) a2 += u2.scrollLeft, h2 += u2.scrollTop, u2 = w2 && u2 === w2.parentElement ? null : u2.parentElement;
1366
- F2(P(x("div", { className: T("touch-thumb", Ce["touch-thumb"], c2, Ce, { dragging: A2 }), ref: e2, style: { left: a2 + (t3?.x ?? 0) - (s2 + i2) / 2, top: h2 + (t3?.y ?? 0) - (s2 + i2) / 2, width: z2 ? s2 : 1.8 * s2, height: z2 ? 1.8 * s2 : s2, borderWidth: `${i2}px`, boxShadow: A2 ? `${o2} 0px 0px 0px 1.5px` : void 0, borderStyle: "solid", borderColor: n2, backgroundColor: o2, opacity: y2 ? 0 : void 0, transitionDuration: "160ms", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${r2}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center center", ...l2 }, tabIndex: -1, onPointerDown: $2, ...M2 }), w2 ?? R2(), b2));
1367
- }, [I2, A2, n2, o2, r2, N2, K2?.x, K2?.y, K2?.width, K2?.height, c2, y2, o2, s2, i2, n2, v2, W2, b2]), K2 ? S(E, { children: [x("div", { ref: L([O2, H2]), style: { position: "absolute", left: K2.x, top: K2.y, opacity: 0 } }), V2] }) : null;
1374
+ let e2 = 0, o2 = 0, r2 = v2;
1375
+ for (; r2; ) e2 += r2.scrollLeft, o2 += r2.scrollTop, r2 = w2 && r2 === w2.parentElement ? null : r2.parentElement;
1376
+ F2(D(x("div", { className: T("touch-thumb", Ce["touch-thumb"], d2, Ce, { dragging: A2 }), ref: n2, style: { left: e2 + (t3?.x ?? 0) - (h2 + c2) / 2, top: o2 + (t3?.y ?? 0) - (h2 + c2) / 2, width: z2 ? h2 : 1.8 * h2, height: z2 ? 1.8 * h2 : h2, borderWidth: `${c2}px`, boxShadow: A2 ? `${l2} 0px 0px 0px 1.5px` : void 0, borderStyle: "solid", borderColor: s2, backgroundColor: l2, opacity: y2 ? 0 : void 0, transitionDuration: "160ms", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${a2}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center center", ...u2 }, tabIndex: -1, onPointerDown: $2, ...M2 }), w2 ?? R2(), b2));
1377
+ }, [O2, A2, s2, l2, a2, N2, K2?.x, K2?.y, K2?.width, K2?.height, d2, y2, l2, h2, c2, s2, v2, W2, b2]), K2 ? S(E, { children: [x("div", { ref: L([I2, H2]), style: { position: "absolute", left: K2.x, top: K2.y, opacity: 0 } }), V2] }) : null;
1368
1378
  }));
1369
1379
  Ke.displayName = "TouchThumbHandle";
1370
- const Oe = 24, Ie = p(m((t2, e2) => {
1371
- const { offset: n2 = 0, totalSize: o2 = 0, viewportSize: r2 = 0, style: i2, className: s2, orientation: l2 = Te.Vertical, onScrollOffset: c2, onScroll: p2, showCustomScrollButtons: m2, scrollButtonIncrement: _2 = 200, scrollButtonInitialRepeatDelay: g2 = 260, scrollButtonAdditionalRepeatDelay: y2 = 120, minThumbSize: v2 = Oe, maxThumbSize: w2, createScrollStartButton: b2 = ze, createScrollEndButton: C2 = Ae, touchThumbProps: k2, thumbProps: P2, onMouseDown: D2, ...z2 } = t2, A2 = "touch" === N().primaryInput, B2 = m2 ?? !A2;
1372
- ht(p2, [p2]);
1373
- const [$2, K2] = d({ offset: 0, length: 0, disabled: false }), O2 = a(-1), I2 = l2 === Te.Vertical, [H2, { width: R2, height: W2 }] = M(), V2 = I2 ? W2 : R2, F2 = ht((t3, e3, n3) => {
1374
- if (0 === e3 || 0 === n3) {
1380
+ const Ie = 24, Oe = s(l((t2, n2) => {
1381
+ const { offset: s2 = 0, totalSize: l2 = 0, viewportSize: c2 = 0, style: h2, className: u2, orientation: d2 = Te.Vertical, onScrollOffset: p2, onScroll: m2, showCustomScrollButtons: f2, scrollButtonIncrement: _2 = 200, scrollButtonInitialRepeatDelay: g2 = 260, scrollButtonAdditionalRepeatDelay: y2 = 120, minThumbSize: v2 = Ie, maxThumbSize: w2, renderScrollButtonStart: b2 = ze, renderScrollButtonEnd: C2 = Ae, propsTouchThumb: k2, propsThumb: D2, onMouseDown: P2, ...z2 } = t2, A2 = "touch" === H().primaryInput, B2 = f2 ?? !A2;
1382
+ ht(m2, [m2]);
1383
+ const [$2, K2] = i({ offset: 0, length: 0, disabled: false }), I2 = e(-1), O2 = d2 === Te.Vertical, [N2, { width: R2, height: W2 }] = M(), V2 = O2 ? W2 : R2, F2 = ht((t3, e2, n3) => {
1384
+ if (0 === e2 || 0 === n3) {
1375
1385
  const t4 = { offset: 0, length: v2, disabled: true };
1376
1386
  return K2(t4), t4;
1377
1387
  }
1378
- if (e3 >= n3) return { offset: 0, length: V2, disabled: true };
1379
- const o3 = n3 / V2, r3 = e3 / o3, i3 = Math.min(Math.max(v2, r3), Math.min(V2, w2 ?? Number.MAX_SAFE_INTEGER)), s3 = t3 / o3;
1380
- return { offset: Math.min(Math.max(0, s3), V2 - i3), length: i3, disabled: false };
1388
+ if (e2 >= n3) return { offset: 0, length: V2, disabled: true };
1389
+ const o2 = n3 / V2, r2 = e2 / o2, i2 = Math.min(Math.max(v2, r2), Math.min(V2, w2 ?? Number.MAX_SAFE_INTEGER)), s3 = t3 / o2;
1390
+ return { offset: Math.min(Math.max(0, s3), V2 - i2), length: i2, disabled: false };
1381
1391
  }, [V2, v2, w2]), j2 = ht((t3) => {
1382
- const e3 = o2 / V2, n3 = Math.round(t3 * e3);
1383
- K2(F2(n3, r2, o2)), c2?.(n3, r2, o2), O2.current = t3;
1384
- }, [c2, r2, o2, V2, $2]), X2 = ht((t3) => {
1385
- K2(F2(t3, r2, o2)), c2?.(t3, r2, o2), O2.current = t3;
1386
- }, [c2, r2, o2]);
1387
- u(() => {
1388
- O2.current !== n2 && 0 !== V2 && (O2.current = -1, K2(F2(n2, r2, o2)));
1389
- }, [n2]), u(() => {
1390
- 0 !== V2 && K2(F2(n2, r2, o2));
1391
- }, [r2, o2, I2, V2]);
1392
- const Y2 = Math.max(0, o2 - r2), [U2, G2] = d(false), q2 = a(0), Z2 = a(0), J2 = Ft(e2, () => ({ isScrollbar: () => true }), []), Q2 = ht((t3) => {
1393
- G2(true), q2.current = I2 ? t3.clientY : t3.clientX, Z2.current = $2.offset;
1394
- }, [I2, $2]), tt2 = ht((t3) => {
1392
+ const e2 = l2 / V2, n3 = Math.round(t3 * e2);
1393
+ K2(F2(n3, c2, l2)), p2?.(n3, c2, l2), I2.current = t3;
1394
+ }, [p2, c2, l2, V2, $2]), X2 = ht((t3) => {
1395
+ K2(F2(t3, c2, l2)), p2?.(t3, c2, l2), I2.current = t3;
1396
+ }, [p2, c2, l2]);
1397
+ r(() => {
1398
+ I2.current !== s2 && 0 !== V2 && (I2.current = -1, K2(F2(s2, c2, l2)));
1399
+ }, [s2]), r(() => {
1400
+ 0 !== V2 && K2(F2(s2, c2, l2));
1401
+ }, [c2, l2, O2, V2]);
1402
+ const Y2 = Math.max(0, l2 - c2), [U2, G2] = i(false), q2 = e(0), Z2 = e(0), J2 = Ft(n2, () => ({ isScrollbar: () => true }), []), Q2 = ht((t3) => {
1403
+ G2(true), q2.current = O2 ? t3.clientY : t3.clientX, Z2.current = $2.offset;
1404
+ }, [O2, $2]), tt2 = ht((t3) => {
1395
1405
  t3.currentTarget.setPointerCapture(t3.pointerId), Q2(t3), t3.stopPropagation();
1396
- }, [D2]), et2 = ht((t3) => {
1406
+ }, [P2]), et2 = ht((t3) => {
1397
1407
  if (!U2) return;
1398
- const e3 = (I2 ? t3.clientY : t3.clientX) - q2.current, n3 = Z2.current + e3;
1408
+ const e2 = (O2 ? t3.clientY : t3.clientX) - q2.current, n3 = Z2.current + e2;
1399
1409
  j2(n3);
1400
- }, [U2, I2]), nt2 = ht((t3) => {
1410
+ }, [U2, O2]), nt2 = ht((t3) => {
1401
1411
  et2(t3);
1402
1412
  }, []), ot2 = ht((t3) => {
1403
1413
  G2(false);
@@ -1409,45 +1419,45 @@ const Oe = 24, Ie = p(m((t2, e2) => {
1409
1419
  ot2(t3);
1410
1420
  }, []), it2 = ht((t3) => {
1411
1421
  if (!t3.currentTarget) return;
1412
- const e3 = t3.currentTarget.getBoundingClientRect(), n3 = I2 ? t3.clientY - e3.top : t3.clientX - e3.left;
1422
+ const e2 = t3.currentTarget.getBoundingClientRect(), n3 = O2 ? t3.clientY - e2.top : t3.clientX - e2.left;
1413
1423
  j2(n3);
1414
- }, [I2, $2, r2, o2]), st2 = ht((t3) => {
1415
- const e3 = Math.max(1, Math.floor(0.9 * r2));
1416
- I2 ? ("ArrowDown" === t3.key && j2(Math.min(Y2, n2 + 1)), "ArrowUp" === t3.key && j2(Math.max(0, n2 - 1)), "PageDown" === t3.key && j2(Math.min(Y2, n2 + e3)), "PageUp" === t3.key && j2(Math.max(0, n2 - e3)), "Home" === t3.key && j2(0), "End" === t3.key && j2(Y2)) : ("ArrowRight" === t3.key && j2(Math.min(Y2, n2 + 1)), "ArrowLeft" === t3.key && j2(Math.max(0, n2 - 1)), "PageDown" === t3.key && j2(Math.min(Y2, n2 + e3)), "PageUp" === t3.key && j2(Math.max(0, n2 - e3)), "Home" === t3.key && j2(0), "End" === t3.key && j2(Y2));
1417
- }, [I2, r2, o2, n2, Y2]), lt2 = a(null), at2 = h(() => {
1424
+ }, [O2, $2, c2, l2]), st2 = ht((t3) => {
1425
+ const e2 = Math.max(1, Math.floor(0.9 * c2));
1426
+ O2 ? ("ArrowDown" === t3.key && j2(Math.min(Y2, s2 + 1)), "ArrowUp" === t3.key && j2(Math.max(0, s2 - 1)), "PageDown" === t3.key && j2(Math.min(Y2, s2 + e2)), "PageUp" === t3.key && j2(Math.max(0, s2 - e2)), "Home" === t3.key && j2(0), "End" === t3.key && j2(Y2)) : ("ArrowRight" === t3.key && j2(Math.min(Y2, s2 + 1)), "ArrowLeft" === t3.key && j2(Math.max(0, s2 - 1)), "PageDown" === t3.key && j2(Math.min(Y2, s2 + e2)), "PageUp" === t3.key && j2(Math.max(0, s2 - e2)), "Home" === t3.key && j2(0), "End" === t3.key && j2(Y2));
1427
+ }, [O2, c2, l2, s2, Y2]), lt2 = e(null), at2 = o(() => {
1418
1428
  const t3 = $2.disabled;
1419
1429
  if (t3) return null;
1420
- const e3 = x("div", { ...P2, className: T(Ce.thumb, { disabled: t3 }), ref: lt2, role: "slider", "aria-label": I2 ? "Rows" : "Columns", "aria-orientation": I2 ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": Y2, "aria-valuenow": n2, tabIndex: 0, style: { ...P2?.style, position: "relative", [I2 ? "height" : "width"]: `${$2.length}px`, [I2 ? "width" : "height"]: "100%", transform: I2 ? `translateY(${$2.offset}px)` : `translateX(${$2.offset}px)`, [I2 ? "minHeight" : "minWidth"]: `${v2}px` }, onMouseDown: D2, onPointerDown: tt2, onPointerMove: nt2, onPointerUp: rt2 });
1421
- return !A2 || t3 ? e3 : S(E, { children: [e3, x(Ke, { ...k2, offset: $2.offset, orientation: I2 ? Te.Vertical : Te.Horizontal, onPointerDown: Q2, onPointerMove: et2, onPointerUp: ot2 })] });
1422
- }, [$2, v2, Y2, n2, I2, A2, D2, k2, P2]), [ct2, ut2] = d(null), dt2 = ht(() => {
1430
+ const e2 = x("div", { ...D2, className: T(Ce.thumb, { disabled: t3 }), ref: lt2, role: "slider", "aria-label": O2 ? "Rows" : "Columns", "aria-orientation": O2 ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": Y2, "aria-valuenow": s2, tabIndex: 0, style: { ...D2?.style, position: "relative", [O2 ? "height" : "width"]: `${$2.length}px`, [O2 ? "width" : "height"]: "100%", transform: O2 ? `translateY(${$2.offset}px)` : `translateX(${$2.offset}px)`, [O2 ? "minHeight" : "minWidth"]: `${v2}px` }, onMouseDown: P2, onPointerDown: tt2, onPointerMove: nt2, onPointerUp: rt2 });
1431
+ return !A2 || t3 ? e2 : S(E, { children: [e2, x(Ke, { ...k2, offset: $2.offset, orientation: O2 ? Te.Vertical : Te.Horizontal, onPointerDown: Q2, onPointerMove: et2, onPointerUp: ot2 })] });
1432
+ }, [$2, v2, Y2, s2, O2, A2, P2, k2, D2]), [ct2, ut2] = i(null), dt2 = ht(() => {
1423
1433
  let t3;
1424
- t3 = "function" == typeof _2 ? _2(n2, r2, o2) : n2 - _2;
1425
- const e3 = Math.max(0, t3);
1426
- return X2(e3), ut2(e3), e3;
1427
- }, [_2, n2, r2, o2]), pt2 = ht(() => {
1434
+ t3 = "function" == typeof _2 ? _2(s2, c2, l2) : s2 - _2;
1435
+ const e2 = Math.max(0, t3);
1436
+ return X2(e2), ut2(e2), e2;
1437
+ }, [_2, s2, c2, l2]), pt2 = ht(() => {
1428
1438
  let t3;
1429
- t3 = "function" == typeof _2 ? _2(n2, r2, o2) : n2 + _2;
1430
- const e3 = Math.min(Y2, t3);
1431
- return X2(e3), ut2(e3), e3;
1432
- }, [_2, n2, Y2, r2, o2]), mt2 = a(null), ft2 = a(null), _t2 = f(() => {
1439
+ t3 = "function" == typeof _2 ? _2(s2, c2, l2) : s2 + _2;
1440
+ const e2 = Math.min(Y2, t3);
1441
+ return X2(e2), ut2(e2), e2;
1442
+ }, [_2, s2, Y2, c2, l2]), mt2 = e(null), ft2 = e(null), _t2 = a(() => {
1433
1443
  mt2.current && (clearTimeout(mt2.current), mt2.current = null, ft2.current = null);
1434
- }, []), gt2 = f((t3, e3, n3, o3 = g2) => {
1444
+ }, []), gt2 = a((t3, e2, n3, o2 = g2) => {
1435
1445
  ft2.current = t3, mt2.current = setTimeout(() => {
1436
1446
  const t4 = n3 ? dt2() : pt2();
1437
1447
  t4 !== ft2.current ? gt2(t4, false, n3, y2) : _t2();
1438
- }, e3 ? 0 : o3);
1448
+ }, e2 ? 0 : o2);
1439
1449
  }, [dt2, pt2, _t2]);
1440
- u(() => () => _t2(), [_t2]);
1441
- const yt2 = h(() => {
1450
+ r(() => () => _t2(), [_t2]);
1451
+ const yt2 = o(() => {
1442
1452
  if (!B2) return null;
1443
- const t3 = { orientation: l2, disabled: n2 <= 0, onMouseUp: _t2, onMouseLeave: _t2, onMouseDown: () => gt2(n2, true, true) };
1453
+ const t3 = { orientation: d2, disabled: s2 <= 0, onMouseUp: _t2, onMouseLeave: _t2, onMouseDown: () => gt2(s2, true, true) };
1444
1454
  return b2?.(t3);
1445
- }, [B2, l2, n2, ct2]), vt2 = h(() => {
1455
+ }, [B2, d2, s2, ct2]), vt2 = o(() => {
1446
1456
  if (!B2) return null;
1447
- const t3 = { orientation: l2, disabled: n2 >= Y2, onMouseUp: _t2, onMouseLeave: _t2, onMouseDown: () => gt2(n2, true, false) };
1457
+ const t3 = { orientation: d2, disabled: s2 >= Y2, onMouseUp: _t2, onMouseLeave: _t2, onMouseDown: () => gt2(s2, true, false) };
1448
1458
  return C2?.(t3);
1449
- }, [B2, l2, n2, Y2, ct2]), wt2 = I2 ? "vertical" : "horizontal";
1450
- return S("div", { ref: L([J2, e2]), className: T(s2, Ce.scrollbar, wt2, { dragging: U2, "has-touch-thumb": A2 }), style: i2, ...z2, children: [yt2, x("div", { ref: H2, role: "scrollbar", "aria-orientation": wt2, "aria-valuemin": 0, "aria-valuemax": Y2, "aria-valuenow": n2, tabIndex: 0, className: T(Ce.track, "track", wt2), onMouseDown: D2, onPointerDown: it2, onKeyDown: st2, children: at2 }), vt2] });
1459
+ }, [B2, d2, s2, Y2, ct2]), wt2 = O2 ? "vertical" : "horizontal";
1460
+ return S("div", { ref: L([J2, n2]), className: T(u2, Ce.scrollbar, wt2, { dragging: U2, "has-touch-thumb": A2 }), style: h2, ...z2, children: [yt2, x("div", { ref: N2, role: "scrollbar", "aria-orientation": wt2, "aria-valuemin": 0, "aria-valuemax": Y2, "aria-valuenow": s2, tabIndex: 0, className: T(Ce.track, "track", wt2), onMouseDown: P2, onPointerDown: it2, onKeyDown: st2, children: at2 }), vt2] });
1451
1461
  }));
1452
1462
  let Ne = Date.now, He = 1e3, Re = {}, We = 1;
1453
1463
  const Ve = (t2) => {
@@ -1644,7 +1654,7 @@ class Ye {
1644
1654
  }
1645
1655
  }
1646
1656
  }
1647
- const Ue = (t2, e2) => x(Ie, { ...t2, ref: e2 }), Ge = Object.freeze(Object.defineProperty({ __proto__: null, defaultCreateScrollbar: Ue, getScrollTo: (t2, e2, n2, o2, r2 = 0) => {
1657
+ const Ue = (t2) => x(Oe, { ...t2 }), Ge = Object.freeze(Object.defineProperty({ __proto__: null, defaultRenderScrollbar: Ue, getScrollTo: (t2, e2, n2, o2, r2 = 0) => {
1648
1658
  for (let r3 = 0; r3 < n2.length; r3++) {
1649
1659
  const i2 = n2[r3].getBoundingClientRect();
1650
1660
  let s2 = i2.left - e2, l2 = s2 + i2.width;
@@ -1653,79 +1663,82 @@ const Ue = (t2, e2) => x(Ie, { ...t2, ref: e2 }), Ge = Object.freeze(Object.defi
1653
1663
  } else if (Math.ceil(l2) > Math.ceil(t2) + 2) return l2;
1654
1664
  }
1655
1665
  return r2;
1656
- } }, Symbol.toStringTag, { value: "Module" })), qe = { scrollpane: "_scrollpane_1fbi8_2", "vertical-container": "_vertical-container_1fbi8_7", "horizontal-corner-container": "_horizontal-corner-container_1fbi8_12", "scrollbar-sizer": "_scrollbar-sizer_1fbi8_26", "scrollpane-content": "_scrollpane-content_1fbi8_34", "scrollpane-content-element": "_scrollpane-content-element_1fbi8_43" }, Ze = ({ width: t2, height: e2 }) => x("div", { className: "corner", style: { minWidth: `${t2}px`, width: `${t2}px`, minHeight: `${e2}px`, height: `${e2}px` } }), Je = p(m((t2, e2) => {
1657
- const { children: n2, viewport: o2, onScrollViewport: r2, showHorizontalScrollbar: i2 = true, showVerticalScrollbar: s2 = true, createScrollCorner: l2 = Ze, createHorizontalScrollbar: c2 = Ue, createVerticalScrollbar: d2 = Ue, style: p2, className: m2, touchElement: _2, disableTouch: g2, ...y2 } = t2, v2 = i2 && c2, w2 = s2 && d2, b2 = ht(r2, [r2]), L2 = Ft(e2, () => ({ isScrollPane: () => true }), []), C2 = a(null);
1658
- u(() => {
1659
- C2.current && (C2.current.__scrollTop === o2?.top && C2.current.__scrollLeft === o2?.left || C2.current.__isDecelerating || C2.current?.scrollTo(o2?.left, o2?.top, false));
1660
- }, [o2?.left, o2?.top, _2]);
1661
- const k2 = f((t3, e3) => {
1662
- b2?.({ left: t3, top: e3 });
1663
- }, []), P2 = f((t3) => {
1666
+ } }, Symbol.toStringTag, { value: "Module" })), qe = { scrollpane: "_scrollpane_1fbi8_2", "vertical-container": "_vertical-container_1fbi8_7", "horizontal-corner-container": "_horizontal-corner-container_1fbi8_12", "scrollbar-sizer": "_scrollbar-sizer_1fbi8_26", "scrollpane-content": "_scrollpane-content_1fbi8_34", "scrollpane-content-element": "_scrollpane-content-element_1fbi8_43" }, Ze = (t2) => {
1667
+ const e2 = t2?.width, n2 = t2?.height;
1668
+ return x("div", { className: "corner", style: { minWidth: `${e2}px`, width: `${e2}px`, minHeight: `${n2}px`, height: `${n2}px` } });
1669
+ }, Je = s(l((t2, n2) => {
1670
+ const { children: i2, viewport: s2, onScrollViewport: l2, showHorizontalScrollbar: c2 = true, showVerticalScrollbar: h2 = true, createScrollCorner: u2 = Ze, renderScrollbarHorizontal: d2 = Ue, renderScrollbarVertical: p2 = Ue, style: m2, className: f2, touchElement: _2, disableTouch: g2, ...y2 } = t2, v2 = c2 && d2, w2 = h2 && p2, b2 = ht(l2, [l2]), L2 = Ft(n2, () => ({ isScrollPane: () => true }), []), C2 = e(null);
1671
+ r(() => {
1672
+ C2.current && (C2.current.__scrollTop === s2?.top && C2.current.__scrollLeft === s2?.left || C2.current.__isDecelerating || C2.current?.scrollTo(s2?.left, s2?.top, false));
1673
+ }, [s2?.left, s2?.top, _2]);
1674
+ const k2 = a((t3, e2) => {
1675
+ b2?.({ left: t3, top: e2 });
1676
+ }, []), D2 = a((t3) => {
1664
1677
  C2.current?.doTouchStart(t3.touches, t3.timeStamp);
1665
- }, []), D2 = f((t3) => {
1678
+ }, []), P2 = a((t3) => {
1666
1679
  t3.preventDefault(), C2.current?.doTouchMove(t3.touches, t3.timeStamp);
1667
- }, []), z2 = f((t3) => {
1680
+ }, []), z2 = a((t3) => {
1668
1681
  C2.current?.doTouchEnd(t3.timeStamp);
1669
- }, []), A2 = f(({ containerWidth: t3, containerHeight: e3, totalWidth: n3, totalHeight: o3 }) => {
1670
- C2.current.setDimensions(t3, e3, n3, o3);
1682
+ }, []), A2 = a(({ containerWidth: t3, containerHeight: e2, totalWidth: n3, totalHeight: o2 }) => {
1683
+ C2.current.setDimensions(t3, e2, n3, o2);
1671
1684
  }, []);
1672
- u(() => {
1685
+ r(() => {
1673
1686
  const t3 = _2 ?? L2.current;
1674
- if (!g2 && N().supportsTouchEvents && t3 && o2) {
1687
+ if (!g2 && H().supportsTouchEvents && t3 && s2) {
1675
1688
  if (!C2.current) {
1676
1689
  const t4 = { scrollingX: true, scrollingY: true, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
1677
1690
  C2.current = new Ye(k2, t4);
1678
1691
  }
1679
- N().supportsTouchEvents && (t3.addEventListener("touchstart", P2), t3.addEventListener("touchend", z2), t3.addEventListener("touchmove", D2)), A2({ containerWidth: o2?.width, containerHeight: o2?.height, totalWidth: o2?.totalWidth, totalHeight: o2?.totalHeight });
1692
+ H().supportsTouchEvents && (t3.addEventListener("touchstart", D2), t3.addEventListener("touchend", z2), t3.addEventListener("touchmove", P2)), A2({ containerWidth: s2?.width, containerHeight: s2?.height, totalWidth: s2?.totalWidth, totalHeight: s2?.totalHeight });
1680
1693
  }
1681
1694
  return () => {
1682
- t3?.removeEventListener("touchstart", P2), t3?.removeEventListener("touchend", z2), t3?.removeEventListener("touchmove", D2);
1695
+ t3?.removeEventListener("touchstart", D2), t3?.removeEventListener("touchend", z2), t3?.removeEventListener("touchmove", P2);
1683
1696
  };
1684
- }, [o2?.width, o2?.height, o2?.totalWidth, o2?.totalHeight, g2, _2]);
1685
- const [B2, { width: $2 }] = M(), [K2, { height: O2 }] = M(), I2 = h(() => {
1697
+ }, [s2?.width, s2?.height, s2?.totalWidth, s2?.totalHeight, g2, _2]);
1698
+ const [B2, { width: $2 }] = M(), [K2, { height: I2 }] = M(), O2 = o(() => {
1686
1699
  if (!w2) return null;
1687
- const t3 = d2({ orientation: Te.Vertical, offset: o2?.top, viewportSize: o2?.height, totalSize: o2?.totalHeight, onScrollOffset: (t4) => {
1700
+ const t3 = p2({ orientation: Te.Vertical, offset: s2?.top, viewportSize: s2?.height, totalSize: s2?.totalHeight, onScrollOffset: (t4) => {
1688
1701
  b2?.({ top: t4 });
1689
1702
  } });
1690
1703
  return x("div", { className: T("vertical-container", qe["vertical-container"]), ref: B2, children: t3 });
1691
- }, [d2, o2?.top, o2?.height, o2?.totalHeight]), H2 = h(() => {
1704
+ }, [p2, s2?.top, s2?.height, s2?.totalHeight]), N2 = o(() => {
1692
1705
  if (!v2) return null;
1693
- const t3 = c2({ orientation: Te.Horizontal, offset: o2?.left, viewportSize: o2?.width, totalSize: o2?.totalWidth, onScrollOffset: (t4) => {
1706
+ const t3 = d2({ orientation: Te.Horizontal, offset: s2?.left, viewportSize: s2?.width, totalSize: s2?.totalWidth, onScrollOffset: (t4) => {
1694
1707
  b2?.({ left: t4 });
1695
1708
  } });
1696
- return S("div", { className: T("horizontal-corner-container", qe["horizontal-corner-container"]), children: [x("div", { className: T("horizontal-sizer", qe["horizontal-sizer"]), style: { width: `calc(100% - ${$2}px)` }, children: x("div", { ref: K2, className: T("scrollbar-sizer", qe["scrollbar-sizer"]), children: t3 }) }), w2 ? l2({ width: $2, height: O2 }) : x(E, {})] });
1697
- }, [c2, o2?.left, o2?.width, o2?.totalWidth, w2, l2, $2, O2]);
1698
- return x("div", { className: T(m2, "scrollpane", qe.scrollpane), style: { minWidth: w2 ? `${$2}px` : void 0, minHeight: v2 ? `${O2}px` : void 0, ...p2 }, ...y2, ref: L2, children: S("div", { className: T("scrollpane-content", qe["scrollpane-content"]), children: [S("div", { className: T("scrollpane-content-element", qe["scrollpane-content-element"]), children: [x("div", { className: T("scrollpane-content-element", qe["scrollpane-content-element"]), children: n2 }), w2 ? I2 : x(E, {})] }), v2 ? H2 : x(E, {})] }) });
1709
+ return S("div", { className: T("horizontal-corner-container", qe["horizontal-corner-container"]), children: [x("div", { className: T("horizontal-sizer", qe["horizontal-sizer"]), style: { width: `calc(100% - ${$2}px)` }, children: x("div", { ref: K2, className: T("scrollbar-sizer", qe["scrollbar-sizer"]), children: t3 }) }), w2 ? u2({ width: $2, height: I2 }) : x(E, {})] });
1710
+ }, [d2, s2?.left, s2?.width, s2?.totalWidth, w2, u2, $2, I2]);
1711
+ return x("div", { className: T(f2, "scrollpane", qe.scrollpane), style: { minWidth: w2 ? `${$2}px` : void 0, minHeight: v2 ? `${I2}px` : void 0, ...m2 }, ...y2, ref: L2, children: S("div", { className: T("scrollpane-content", qe["scrollpane-content"]), children: [S("div", { className: T("scrollpane-content-element", qe["scrollpane-content-element"]), children: [x("div", { className: T("scrollpane-content-element", qe["scrollpane-content-element"]), children: i2 }), w2 ? O2 : x(E, {})] }), v2 ? N2 : x(E, {})] }) });
1699
1712
  }));
1700
1713
  Je.displayName = "ScrollPane";
1701
- const Qe = 300, tn = 100, en = 1e6, nn = 100, on = 50, rn = p(m((t2, e2) => {
1702
- const { offset: n2 = 0, viewportSize: o2 = 0, totalSize: r2 = 0, minSize: i2 = 0, endGap: s2 = Qe, endScrollIncrement: l2 = tn, style: a2 = I, onMouseDown: c2, onScrollOffset: u2, onScroll: p2, scaleLimit: m2 = en, scaleFactor: _2 = nn, precisionFactor: g2 = on, createScrollbar: y2 = Ue, ...v2 } = t2;
1703
- p2 && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
1704
- const w2 = ht(c2, [c2]), [b2, x2] = d(false), S2 = h(() => {
1705
- const t3 = 0 === m2 ? r2 : Math.min(r2 ?? 0, Math.max(i2 ?? 0, (n2 ?? 0) + (o2 ?? 0)) + (s2 ?? 0)), e3 = 0 !== m2 && t3 > m2 ? _2 : 1, l3 = e3 / g2, a3 = Math.ceil(t3 / e3);
1706
- return { offset: Math.ceil(n2 / e3), totalSize: a3, viewportSize: Math.ceil(o2 / e3), scaledOffset: n2, scaledTotalSize: r2, scaledViewportSize: o2, factor: e3, precision: l3 };
1707
- }, [n2, r2, o2, b2, i2, s2, l2]), E2 = ht((t3, e3, n3) => {
1708
- const o3 = S2.offset;
1709
- Math.abs(t3 - o3) < S2.precision && (t3 = o3), u2?.(t3 * S2.factor, o3, S2.viewportSize);
1710
- }, [u2, S2]), L2 = f((t3) => {
1711
- }, []), M2 = f((t3) => {
1714
+ const Qe = 300, tn = 100, en = 1e6, nn = 100, on = 50, rn = s(l((t2, e2) => {
1715
+ const { offset: n2 = 0, viewportSize: r2 = 0, totalSize: s2 = 0, minSize: l2 = 0, endGap: c2 = Qe, endScrollIncrement: h2 = tn, style: u2 = N, onMouseDown: d2, onScrollOffset: p2, onScroll: m2, scaleLimit: f2 = en, scaleFactor: _2 = nn, precisionFactor: g2 = on, renderScrollbar: y2 = Ue, ...v2 } = t2;
1716
+ m2 && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
1717
+ const w2 = ht(d2, [d2]), [b2, x2] = i(false), S2 = o(() => {
1718
+ const t3 = 0 === f2 ? s2 : Math.min(s2 ?? 0, Math.max(l2 ?? 0, (n2 ?? 0) + (r2 ?? 0)) + (c2 ?? 0)), e3 = 0 !== f2 && t3 > f2 ? _2 : 1, o2 = e3 / g2, i2 = Math.ceil(t3 / e3);
1719
+ return { offset: Math.ceil(n2 / e3), totalSize: i2, viewportSize: Math.ceil(r2 / e3), scaledOffset: n2, scaledTotalSize: s2, scaledViewportSize: r2, factor: e3, precision: o2 };
1720
+ }, [n2, s2, r2, b2, l2, c2, h2]), E2 = ht((t3, e3, n3) => {
1721
+ const o2 = S2.offset;
1722
+ Math.abs(t3 - o2) < S2.precision && (t3 = o2), p2?.(t3 * S2.factor, o2, S2.viewportSize);
1723
+ }, [p2, S2]), L2 = a((t3) => {
1724
+ }, []), M2 = a((t3) => {
1712
1725
  document.removeEventListener("mousemove", L2), document.removeEventListener("mouseup", M2), x2(false);
1713
- }, []), T2 = f((t3) => {
1726
+ }, []), T2 = a((t3) => {
1714
1727
  x2(true), w2?.(t3), document.addEventListener("mousemove", L2, { passive: true }), document.addEventListener("mouseup", M2, { passive: true });
1715
1728
  }, [L2, M2]);
1716
- return Ue({ style: a2, ...v2, offset: S2.offset, totalSize: S2.totalSize, viewportSize: S2.viewportSize, onMouseDown: T2, onScrollOffset: E2 }, e2);
1729
+ return y2({ style: u2, ...v2, offset: S2.offset, totalSize: S2.totalSize, viewportSize: S2.viewportSize, onMouseDown: T2, onScrollOffset: E2, ref: e2 });
1717
1730
  }));
1718
1731
  rn.displayName = "VirtualScrollbar";
1719
1732
  export {
1720
1733
  $ as Command,
1721
1734
  q as CommandButtonType,
1722
- V as CommandGroup,
1735
+ F as CommandGroup,
1723
1736
  pe as DefaultDynamicIconService,
1724
1737
  et as DefaultReactNotifier,
1725
1738
  _e as DynamicIcon,
1726
1739
  Qt as ErrorTestPanel,
1727
1740
  J as FocusKeyNavigation,
1728
- D as HorizontalAlignment,
1741
+ P as HorizontalAlignment,
1729
1742
  ye as InMemoryStore,
1730
1743
  A as KeyCodes,
1731
1744
  z as KeyModifiers,
@@ -1735,11 +1748,11 @@ export {
1735
1748
  tt as NotifierType,
1736
1749
  Ee as PersistenceStateProvider,
1737
1750
  qt as ReactErrorBoundary,
1738
- W as ReactUtils,
1751
+ V as ReactUtils,
1739
1752
  Q as RoundedTab,
1740
1753
  Je as ScrollPane,
1741
1754
  Ge as ScrollUtils,
1742
- Ie as Scrollbar,
1755
+ Oe as Scrollbar,
1743
1756
  Te as ScrollbarOrientation,
1744
1757
  K as SimpleCommand,
1745
1758
  se as SplitPane,
@@ -1754,10 +1767,10 @@ export {
1754
1767
  Ae as defaultCreateScrollEndButton,
1755
1768
  ze as defaultCreateScrollStartButton,
1756
1769
  dt as getDevicePixelRatio,
1757
- X as toShortcutString,
1770
+ Y as toShortcutString,
1758
1771
  ct as useAnimatedMeasure,
1759
1772
  ht as useCallbackRef,
1760
- Y as useCommand,
1773
+ I as useCommand,
1761
1774
  G as useCommands,
1762
1775
  $t as useCopyPaste,
1763
1776
  ut as useDevicePixelRatio,