@sheetxl/utils-react 0.7.4 → 0.7.6

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,720 +1,997 @@
1
1
  /**
2
- * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.4
2
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.6
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 { jsx as e, jsxs as t, Fragment as n } from "react/jsx-runtime";
8
- import o, { useCallback as i, useRef as r, memo as s, forwardRef as l, useState as a, useEffect as c, useMemo as h, useImperativeHandle as u, useLayoutEffect as d, createContext as _, useContext as p, createElement as m, useReducer as f } from "react";
7
+ import { jsx as t, jsxs as e, Fragment as n } from "react/jsx-runtime";
8
+ import o, { useCallback as i, useRef as r, memo as s, forwardRef as l, useState as a, useEffect as c, useMemo as h, useImperativeHandle as u, useLayoutEffect as d, createContext as p, useContext as f, createElement as _, useReducer as m } from "react";
9
9
  import g from "clsx";
10
10
  import { useMeasure as y } from "react-use";
11
- import { CommonUtils as v, DelegatingNotifier as x, Notifier as w, InternalClipboard as b, ClipboardUtils as S, MimeType as L } from "@sheetxl/utils";
11
+ import { CommonUtils as v, DefaultNotifier as x, Notifier as w, InternalClipboard as b, ClipboardUtils as S, MimeType as L } from "@sheetxl/utils";
12
12
  import * as E from "detect-it";
13
13
  import { mergeRefs as C } from "react-merge-refs";
14
14
  import { createRoot as T } from "react-dom/client";
15
15
  import { unstable_batchedUpdates as M } from "react-dom";
16
- const D = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, P = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, z = { 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 }, k = { Left: 1, Middle: 2, Right: 3 }, A = { Horizontal: "horizontal", Vertical: "vertical" }, B = (e2, t2) => {
17
- const n2 = i((...t3) => e2?.(...t3), t2), o2 = r(null);
16
+ const k = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, D = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, P = { 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 }, A = { Left: 1, Middle: 2, Right: 3 }, z = { Horizontal: "horizontal", Vertical: "vertical" }, B = (t2, e2) => {
17
+ const n2 = i((...e3) => t2?.(...e3), e2), o2 = r(null);
18
18
  o2.current = n2;
19
- const s2 = i((...e3) => o2.current?.(...e3), []);
19
+ const s2 = i((...t3) => o2.current?.(...t3), []);
20
20
  if (o2.current) return s2;
21
- }, $ = (t2) => {
22
- const { style: n2, orientation: o2 = A.Vertical, ...i2 } = t2, r2 = o2 === A.Vertical;
23
- return e("div", { style: { paddingBottom: "0px", paddingRight: "0px", paddingLeft: r2 ? "0px" : "3px", paddingTop: r2 ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, ...i2, children: e("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} single-button start`, children: e("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: e("path", { d: r2 ? "m 3.7274761,0.68060577 1.11969,1.93863003 1.12075,1.93912 c 0.0895,0.155 0.12152,0.33658 0.0904,0.51283 -0.0311,0.17625 -0.12336,0.33591 -0.26054,0.45091 -0.13715,0.11495 -0.31044,0.17793 -0.4894,0.17781 H 0.83095614 c -0.20186,0 -0.39542,-0.0802 -0.53814,-0.2229 -0.14272,-0.14272 -0.22291,-0.33629 -0.22291,-0.53814 -3e-4,-0.13308 0.0347,-0.26385 0.10147,-0.379 l 1.11872996,-1.94066 1.11921,-1.93864003 c 0.13594,-0.23541 0.38717,-0.38047 0.65905,-0.38047 0.27188,0 0.52311,0.14506 0.65905,0.38047 z" : "m 0.75051,2.3424298 1.93863,-1.11969 1.93912,-1.12075 c 0.155,-0.0895 0.33658,-0.12152 0.51283,-0.0904 0.17625,0.0311 0.33591,0.12336 0.45091,0.26054 0.11495,0.13715 0.17793,0.31044 0.17781,0.4894 v 4.47742 c 0,0.20186 -0.0802,0.39542 -0.2229,0.53814 -0.14272,0.14272 -0.33629,0.22291 -0.53814,0.22291 -0.13308,3e-4 -0.26385,-0.0347 -0.379,-0.10147 L 2.68911,4.7797998 0.75047,3.6605898 C 0.51506,3.5246498 0.37,3.2734198 0.37,3.0015398 c 0,-0.27188 0.14506,-0.52311 0.38047,-0.65905 z" }) }) }) });
24
- }, O = (t2) => {
25
- const { style: n2, orientation: o2 = A.Vertical, ...i2 } = t2, r2 = o2 === A.Vertical;
26
- return e("div", { style: { paddingLeft: "0px", paddingTop: "0px", paddingRight: r2 ? "0px" : "3px", paddingBottom: r2 ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, ...i2, children: e("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} single-button end`, children: e("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: e("path", { d: r2 ? "M 2.412334,5.319396 1.292644,3.3807659 0.17189405,1.4416459 c -0.0895,-0.155 -0.12152,-0.33658 -0.0904,-0.51282998 0.0311,-0.17625 0.12336,-0.33591 0.26054,-0.45091 0.13715,-0.11495 0.31044,-0.17793 0.4894,-0.17781 H 5.308854 c 0.20186,0 0.39542,0.0802 0.53814,0.2229 0.14272,0.14272 0.22291,0.33629 0.22291,0.53813998 3e-4,0.13308 -0.0347,0.26385 -0.10147,0.379 l -1.11873,1.94066 -1.11921,1.9386401 c -0.13594,0.23541 -0.38717,0.38047 -0.65905,0.38047 -0.27188,0 -0.52311,-0.14506 -0.65905,-0.38047 z" : "m 5.3893002,3.6575719 -1.9386301,1.11969 -1.93912,1.12075 c -0.155,0.0895 -0.33658,0.12152 -0.51282997,0.0904 -0.17625,-0.0311 -0.33591,-0.12336 -0.45091,-0.26054 -0.11495,-0.13715 -0.17793,-0.31044 -0.17781,-0.4894 V 0.76105195 c 0,-0.20186 0.0802,-0.39542 0.2229,-0.53814 C 0.73562013,0.08019195 0.92919013,1.9467784e-6 1.1310401,1.9467784e-6 1.2641201,-2.9805322e-4 1.3948901,0.03470195 1.5100401,0.10147195 l 1.94066,1.11872995 1.9386401,1.11921 c 0.23541,0.13594 0.38047,0.38717 0.38047,0.65905 0,0.27188 -0.14506,0.52311 -0.38047,0.65905 z" }) }) }) });
27
- }, K = (t2) => {
28
- const { style: n2, orientation: o2 = A.Vertical, ...i2 } = t2, r2 = o2 === A.Vertical;
29
- return e("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...n2 }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} edge`, ...i2, children: e("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: r2 ? "rotate(90) " : "", children: e("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" }) }) });
30
- }, V = (e2, t2, n2, o2, i2 = 0) => {
21
+ }, $ = (e2) => {
22
+ const { style: n2, orientation: o2 = z.Vertical, ...i2 } = e2, r2 = o2 === z.Vertical;
23
+ return t("div", { style: { paddingBottom: "0px", paddingRight: "0px", paddingLeft: r2 ? "0px" : "3px", paddingTop: r2 ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, ...i2, children: t("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} single-button start`, children: t("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: t("path", { d: r2 ? "m 3.7274761,0.68060577 1.11969,1.93863003 1.12075,1.93912 c 0.0895,0.155 0.12152,0.33658 0.0904,0.51283 -0.0311,0.17625 -0.12336,0.33591 -0.26054,0.45091 -0.13715,0.11495 -0.31044,0.17793 -0.4894,0.17781 H 0.83095614 c -0.20186,0 -0.39542,-0.0802 -0.53814,-0.2229 -0.14272,-0.14272 -0.22291,-0.33629 -0.22291,-0.53814 -3e-4,-0.13308 0.0347,-0.26385 0.10147,-0.379 l 1.11872996,-1.94066 1.11921,-1.93864003 c 0.13594,-0.23541 0.38717,-0.38047 0.65905,-0.38047 0.27188,0 0.52311,0.14506 0.65905,0.38047 z" : "m 0.75051,2.3424298 1.93863,-1.11969 1.93912,-1.12075 c 0.155,-0.0895 0.33658,-0.12152 0.51283,-0.0904 0.17625,0.0311 0.33591,0.12336 0.45091,0.26054 0.11495,0.13715 0.17793,0.31044 0.17781,0.4894 v 4.47742 c 0,0.20186 -0.0802,0.39542 -0.2229,0.53814 -0.14272,0.14272 -0.33629,0.22291 -0.53814,0.22291 -0.13308,3e-4 -0.26385,-0.0347 -0.379,-0.10147 L 2.68911,4.7797998 0.75047,3.6605898 C 0.51506,3.5246498 0.37,3.2734198 0.37,3.0015398 c 0,-0.27188 0.14506,-0.52311 0.38047,-0.65905 z" }) }) }) });
24
+ }, O = (e2) => {
25
+ const { style: n2, orientation: o2 = z.Vertical, ...i2 } = e2, r2 = o2 === z.Vertical;
26
+ return t("div", { style: { paddingLeft: "0px", paddingTop: "0px", paddingRight: r2 ? "0px" : "3px", paddingBottom: r2 ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, ...i2, children: t("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} single-button end`, children: t("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: t("path", { d: r2 ? "M 2.412334,5.319396 1.292644,3.3807659 0.17189405,1.4416459 c -0.0895,-0.155 -0.12152,-0.33658 -0.0904,-0.51282998 0.0311,-0.17625 0.12336,-0.33591 0.26054,-0.45091 0.13715,-0.11495 0.31044,-0.17793 0.4894,-0.17781 H 5.308854 c 0.20186,0 0.39542,0.0802 0.53814,0.2229 0.14272,0.14272 0.22291,0.33629 0.22291,0.53813998 3e-4,0.13308 -0.0347,0.26385 -0.10147,0.379 l -1.11873,1.94066 -1.11921,1.9386401 c -0.13594,0.23541 -0.38717,0.38047 -0.65905,0.38047 -0.27188,0 -0.52311,-0.14506 -0.65905,-0.38047 z" : "m 5.3893002,3.6575719 -1.9386301,1.11969 -1.93912,1.12075 c -0.155,0.0895 -0.33658,0.12152 -0.51282997,0.0904 -0.17625,-0.0311 -0.33591,-0.12336 -0.45091,-0.26054 -0.11495,-0.13715 -0.17793,-0.31044 -0.17781,-0.4894 V 0.76105195 c 0,-0.20186 0.0802,-0.39542 0.2229,-0.53814 C 0.73562013,0.08019195 0.92919013,1.9467784e-6 1.1310401,1.9467784e-6 1.2641201,-2.9805322e-4 1.3948901,0.03470195 1.5100401,0.10147195 l 1.94066,1.11872995 1.9386401,1.11921 c 0.23541,0.13594 0.38047,0.38717 0.38047,0.65905 0,0.27188 -0.14506,0.52311 -0.38047,0.65905 z" }) }) }) });
27
+ }, K = (e2) => {
28
+ const { style: n2, orientation: o2 = z.Vertical, ...i2 } = e2, r2 = o2 === z.Vertical;
29
+ return t("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...n2 }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} edge`, ...i2, children: t("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: r2 ? "rotate(90) " : "", children: t("path", { style: { transition: "opacity 240ms ease 0s", opacity: e2.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" }) }) });
30
+ }, V = (t2, e2, n2, o2, i2 = 0) => {
31
31
  for (let i3 = 0; i3 < n2.length; i3++) {
32
32
  const r2 = n2[i3].getBoundingClientRect();
33
- let s2 = r2.left - t2, l2 = s2 + r2.width;
33
+ let s2 = r2.left - e2, l2 = s2 + r2.width;
34
34
  if (o2) {
35
- if (s2 < e2 && l2 >= e2) return s2;
36
- } else if (Math.ceil(l2) > Math.ceil(e2) + 2) return l2;
35
+ if (s2 < t2 && l2 >= t2) return s2;
36
+ } else if (Math.ceil(l2) > Math.ceil(t2) + 2) return l2;
37
37
  }
38
38
  return i2;
39
- }, H = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: V }, Symbol.toStringTag, { value: "Module" })), W = "_sheetxl-scrollbar_eblx4_6", I = s(l((n2, o2) => {
40
- const { offset: s2 = 0, totalSize: l2 = 0, viewportSize: u2 = 0, style: d2, className: _2, orientation: p2 = A.Vertical, onScrollOffset: m2, onScroll: f2, showCustomScrollButtons: v2 = false, scrollButtonIncrement: x2 = 200, scrollButtonInitialRepeatDelay: w2 = 260, scrollButtonAdditionalRepeatDelay: b2 = 120, createScrollStartButton: S2 = $, createScrollEndButton: L2 = O, ...E2 } = n2, C2 = B(f2, [f2]), T2 = r(null), [M2, { width: D2, height: P2 }] = y(), [z2, { width: k2, height: K2 }] = y(), H2 = p2 === A.Vertical, I2 = H2 ? "top" : "left", N2 = H2 ? "scrollTop" : "scrollLeft", F2 = H2 ? P2 : D2, R2 = H2 ? K2 : k2, [Y2, X2] = a(null);
39
+ }, N = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: V }, Symbol.toStringTag, { value: "Module" })), H = "_sheetxl-scrollbar_eblx4_6", W = s(l((n2, o2) => {
40
+ const { offset: s2 = 0, totalSize: l2 = 0, viewportSize: u2 = 0, style: d2, className: p2, orientation: f2 = z.Vertical, onScrollOffset: _2, onScroll: m2, showCustomScrollButtons: v2 = false, scrollButtonIncrement: x2 = 200, scrollButtonInitialRepeatDelay: w2 = 260, scrollButtonAdditionalRepeatDelay: b2 = 120, createScrollStartButton: S2 = $, createScrollEndButton: L2 = O, ...E2 } = n2, C2 = B(m2, [m2]), T2 = r(null), [M2, { width: k2, height: D2 }] = y(), [P2, { width: A2, height: K2 }] = y(), N2 = f2 === z.Vertical, W2 = N2 ? "top" : "left", I2 = N2 ? "scrollTop" : "scrollLeft", R2 = N2 ? D2 : k2, j2 = N2 ? K2 : A2, [F2, Y2] = a(null);
41
41
  c(() => {
42
- null !== Y2 && T2.current && T2.current.scrollTo({ behavior: "smooth", [I2]: Y2 });
43
- }, [Y2, H2]);
44
- const j2 = i((e2, t2 = false) => {
42
+ null !== F2 && T2.current && T2.current.scrollTo({ behavior: "smooth", [W2]: F2 });
43
+ }, [F2, N2]);
44
+ const X2 = i((t2, e2 = false) => {
45
45
  if (!T2.current) return 0;
46
- const n3 = T2.current.querySelector(".scrollbar-viewport"), o3 = n3.getBoundingClientRect(), i2 = n3.children, r2 = t2 ? 0 : V(e2, o3[I2], i2, true, Math.max(0, e2 - x2));
47
- return X2(r2), Math.max(0, r2);
48
- }, []), U2 = i((e2, t2 = false) => {
46
+ const n3 = T2.current.querySelector(".scrollbar-viewport"), o3 = n3.getBoundingClientRect(), i2 = n3.children, r2 = e2 ? 0 : V(t2, o3[W2], i2, true, Math.max(0, t2 - x2));
47
+ return Y2(r2), Math.max(0, r2);
48
+ }, []), U2 = i((t2, e2 = false) => {
49
49
  if (!T2.current) return 0;
50
- const n3 = T2.current.querySelector(".scrollbar-viewport"), o3 = n3.getBoundingClientRect(), i2 = n3.children, r2 = Math.ceil(R2 - F2), s3 = t2 ? r2 : V(e2, o3[I2], i2, false, Math.max(0, e2 + x2));
51
- return X2(s3), Math.min(r2, s3);
52
- }, [R2, F2]), Z2 = r(null), G2 = i((e2) => {
50
+ const n3 = T2.current.querySelector(".scrollbar-viewport"), o3 = n3.getBoundingClientRect(), i2 = n3.children, r2 = Math.ceil(j2 - R2), s3 = e2 ? r2 : V(t2, o3[W2], i2, false, Math.max(0, t2 + x2));
51
+ return Y2(s3), Math.min(r2, s3);
52
+ }, [j2, R2]), Z2 = r(null), q2 = i((t2) => {
53
53
  Z2.current = s2;
54
- const t2 = e2.target[N2];
55
- m2(t2, u2, l2), C2?.(e2);
56
- }, [m2, u2, l2, s2]);
54
+ const e2 = t2.target[I2];
55
+ _2(e2, u2, l2), C2?.(t2);
56
+ }, [_2, u2, l2, s2]);
57
57
  c(() => {
58
- const e2 = Z2.current;
59
- Z2.current = null, s2 !== e2 && (T2.current[N2] = s2);
60
- }, [s2, N2]);
61
- const q2 = r(null), J2 = r(null), Q2 = i(() => {
62
- q2.current && (clearTimeout(q2.current), q2.current = null, J2.current = null);
63
- }, []), ee2 = i((e2, t2, n3, o3 = w2) => {
64
- J2.current = e2, q2.current = setTimeout(() => {
65
- const t3 = n3 ? j2(J2.current || e2) : U2(J2.current || e2);
66
- t3 !== J2.current ? ee2(t3, false, n3, b2) : Q2();
67
- }, t2 ? 0 : o3);
68
- }, [j2, U2, Q2]);
58
+ const t2 = Z2.current;
59
+ Z2.current = null, s2 !== t2 && (T2.current[I2] = s2);
60
+ }, [s2, I2]);
61
+ const G2 = r(null), J2 = r(null), Q2 = i(() => {
62
+ G2.current && (clearTimeout(G2.current), G2.current = null, J2.current = null);
63
+ }, []), tt2 = i((t2, e2, n3, o3 = w2) => {
64
+ J2.current = t2, G2.current = setTimeout(() => {
65
+ const e3 = n3 ? X2(J2.current || t2) : U2(J2.current || t2);
66
+ e3 !== J2.current ? tt2(e3, false, n3, b2) : Q2();
67
+ }, e2 ? 0 : o3);
68
+ }, [X2, U2, Q2]);
69
69
  c(() => () => Q2(), [Q2]);
70
- const te2 = s2, ne2 = h(() => {
70
+ const et2 = s2, nt2 = h(() => {
71
71
  if (!v2) return null;
72
- const e2 = { orientation: p2, disabled: Math.floor(te2) <= 0 || 0 === Math.floor(R2 - F2), onMouseUp: Q2, onMouseLeave: Q2, onMouseDown: () => ee2(te2, true, true) };
73
- return S2?.(e2);
74
- }, [v2, p2, te2, Y2, R2, F2]), oe2 = h(() => {
72
+ const t2 = { orientation: f2, disabled: Math.floor(et2) <= 0 || 0 === Math.floor(j2 - R2), onMouseUp: Q2, onMouseLeave: Q2, onMouseDown: () => tt2(et2, true, true) };
73
+ return S2?.(t2);
74
+ }, [v2, f2, et2, F2, j2, R2]), ot2 = h(() => {
75
75
  if (!v2) return null;
76
- const e2 = { orientation: p2, disabled: Math.floor(R2 - F2) <= Math.ceil(te2), onMouseUp: Q2, onMouseLeave: Q2, onMouseDown: () => ee2(te2, true, false) };
77
- return L2?.(e2);
78
- }, [v2, p2, te2, Y2, R2, F2]);
79
- return t("div", { ref: o2, style: { display: "flex", flex: "1", flexDirection: H2 ? "column" : "row", padding: "0", ...d2 }, className: g(W, _2), ...E2, children: [ne2, e("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: H2 ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: M2, children: e("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: H2 ? "scroll" : "hidden", overflowX: H2 ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: G2, ref: T2, children: e("div", { ref: z2, style: { position: "absolute", height: H2 ? l2 - u2 + (P2 ?? 0) : 1, width: H2 ? 1 : l2 - u2 + (D2 ?? 0) }, className: "scrollbar-viewport" }) }) }), oe2] });
76
+ const t2 = { orientation: f2, disabled: Math.floor(j2 - R2) <= Math.ceil(et2), onMouseUp: Q2, onMouseLeave: Q2, onMouseDown: () => tt2(et2, true, false) };
77
+ return L2?.(t2);
78
+ }, [v2, f2, et2, F2, j2, R2]);
79
+ return e("div", { ref: o2, style: { display: "flex", flex: "1", flexDirection: N2 ? "column" : "row", padding: "0", ...d2 }, className: g(H, p2), ...E2, children: [nt2, t("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: N2 ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: M2, children: t("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: N2 ? "scroll" : "hidden", overflowX: N2 ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: q2, ref: T2, children: t("div", { ref: P2, style: { position: "absolute", height: N2 ? l2 - u2 + (D2 ?? 0) : 1, width: N2 ? 1 : l2 - u2 + (k2 ?? 0) }, className: "scrollbar-viewport" }) }) }), ot2] });
80
80
  }));
81
- I.displayName = "Scrollbar";
82
- let N = Date.now, F = 1e3, R = {}, Y = 1;
83
- const X = (e2) => {
84
- let t2 = null !== R[e2];
85
- return t2 && (R[e2] = null), t2;
86
- }, j = (e2, t2, n2, o2 = 0, i2) => {
87
- let r2 = N(), s2 = r2, l2 = 0, a2 = 0, c2 = 0, h2 = Y++;
81
+ W.displayName = "Scrollbar";
82
+ let I = Date.now, R = 1e3, j = {}, F = 1;
83
+ const Y = (t2) => {
84
+ let e2 = null !== j[t2];
85
+ return e2 && (j[t2] = null), e2;
86
+ }, X = (t2, e2, n2, o2 = 0, i2) => {
87
+ let r2 = I(), s2 = r2, l2 = 0, a2 = 0, c2 = 0, h2 = F++;
88
88
  if (h2 % 20 == 0) {
89
- const e3 = {};
90
- for (let t3 in R) e3[t3] = true;
91
- R = e3;
89
+ const t3 = {};
90
+ for (let e3 in j) t3[e3] = true;
91
+ j = t3;
92
92
  }
93
93
  const u2 = function(d2) {
94
- let _2 = true !== d2, p2 = N(), m2 = true;
94
+ let p2 = true !== d2, f2 = I(), _2 = true;
95
95
  try {
96
- m2 = (!t2 || t2(h2)) ?? true;
97
- } catch (e3) {
98
- m2 = false;
96
+ _2 = (!e2 || e2(h2)) ?? true;
97
+ } catch (t3) {
98
+ _2 = false;
99
99
  }
100
- if (!R[h2] || !m2) return R[h2] = null, void n2?.(60 - a2 / ((p2 - r2) / F), h2, false);
101
- if (_2) {
102
- c2 = Math.round((p2 - s2) / 16.666666666666668) - 1;
103
- for (let e3 = 0; e3 < Math.min(c2, 4); e3++) u2(true), a2++;
100
+ if (!j[h2] || !_2) return j[h2] = null, void n2?.(60 - a2 / ((f2 - r2) / R), h2, false);
101
+ if (p2) {
102
+ c2 = Math.round((f2 - s2) / 16.666666666666668) - 1;
103
+ for (let t3 = 0; t3 < Math.min(c2, 4); t3++) u2(true), a2++;
104
104
  }
105
- o2 && (l2 = (p2 - r2) / o2, l2 > 1 && (l2 = 1));
106
- let f2 = i2 ? i2(l2) : l2, g2 = false;
105
+ o2 && (l2 = (f2 - r2) / o2, l2 > 1 && (l2 = 1));
106
+ let m2 = i2 ? i2(l2) : l2, g2 = false;
107
107
  try {
108
- g2 = e2(f2, p2, _2);
109
- } catch (e3) {
108
+ g2 = t2(m2, f2, p2);
109
+ } catch (t3) {
110
110
  g2 = false;
111
111
  }
112
- false !== g2 && 1 !== l2 || !_2 ? _2 && (s2 = p2, requestAnimationFrame(u2)) : (R[h2] = null, n2?.(60 - a2 / ((p2 - r2) / F), h2, 1 === l2 || null == o2));
112
+ false !== g2 && 1 !== l2 || !p2 ? p2 && (s2 = f2, requestAnimationFrame(u2)) : (j[h2] = null, n2?.(60 - a2 / ((f2 - r2) / R), h2, 1 === l2 || null == o2));
113
113
  };
114
- return R[h2] = true, requestAnimationFrame(u2), h2;
115
- }, U = function(e2) {
116
- return Math.pow(e2 - 1, 3) + 1;
117
- }, Z = function(e2) {
118
- return (e2 /= 0.5) < 1 ? 0.5 * Math.pow(e2, 3) : 0.5 * (Math.pow(e2 - 2, 3) + 2);
114
+ return j[h2] = true, requestAnimationFrame(u2), h2;
115
+ }, U = function(t2) {
116
+ return Math.pow(t2 - 1, 3) + 1;
117
+ }, Z = function(t2) {
118
+ return (t2 /= 0.5) < 1 ? 0.5 * Math.pow(t2, 3) : 0.5 * (Math.pow(t2 - 2, 3) + 2);
119
119
  };
120
- class G {
121
- constructor(e2, t2) {
122
- this.__isSingleTouch = false, this.__isTracking = false, this.__didDecelerationComplete = false, this.__isGesturing = false, this.__isDragging = false, this.__isDecelerating = 0, this.__isAnimating = 0, this.__interruptedAnimation = false, this.__lastScale = 1, this.__enableScrollX = true, this.__enableScrollY = true, this.__clientLeft = 0, this.__clientTop = 0, this.__clientWidth = 0, this.__clientHeight = 0, this.__contentWidth = 0, this.__contentHeight = 0, this.__snapWidth = 100, this.__snapHeight = 100, this.__zoomLevel = 1, this.__scrollLeft = 0, this.__scrollTop = 0, this.__maxScrollLeft = 0, this.__maxScrollTop = 0, this.__scheduledLeft = 0, this.__scheduledTop = 0, this.__scheduledZoom = 0, this.__lastTouchLeft = 0, this.__lastTouchTop = 0, this.__lastTouchMove = 0, this.__positions = [], this.__initialTouchLeft = 0, this.__initialTouchTop = 0, this.__zoomLevelStart = 1, this.__minDecelerationScrollLeft = null, this.__minDecelerationScrollTop = null, this.__maxDecelerationScrollLeft = null, this.__maxDecelerationScrollTop = null, this.__decelerationVelocityX = null, this.__decelerationVelocityY = 0, this.__callback = e2, this.options = { scrollingX: true, scrollingY: true, animating: true, animationDuration: 250, bouncing: true, locking: true, paging: false, snapping: false, zooming: false, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: void 0, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08, ...t2 };
120
+ class q {
121
+ constructor(t2, e2) {
122
+ this.__isSingleTouch = false, this.__isTracking = false, this.__didDecelerationComplete = false, this.__isGesturing = false, this.__isDragging = false, this.__isDecelerating = 0, this.__isAnimating = 0, this.__interruptedAnimation = false, this.__lastScale = 1, this.__enableScrollX = true, this.__enableScrollY = true, this.__clientLeft = 0, this.__clientTop = 0, this.__clientWidth = 0, this.__clientHeight = 0, this.__contentWidth = 0, this.__contentHeight = 0, this.__snapWidth = 100, this.__snapHeight = 100, this.__zoomLevel = 1, this.__scrollLeft = 0, this.__scrollTop = 0, this.__maxScrollLeft = 0, this.__maxScrollTop = 0, this.__scheduledLeft = 0, this.__scheduledTop = 0, this.__scheduledZoom = 0, this.__lastTouchLeft = 0, this.__lastTouchTop = 0, this.__lastTouchMove = 0, this.__positions = [], this.__initialTouchLeft = 0, this.__initialTouchTop = 0, this.__zoomLevelStart = 1, this.__minDecelerationScrollLeft = null, this.__minDecelerationScrollTop = null, this.__maxDecelerationScrollLeft = null, this.__maxDecelerationScrollTop = null, this.__decelerationVelocityX = null, this.__decelerationVelocityY = 0, this.__callback = t2, this.options = { scrollingX: true, scrollingY: true, animating: true, animationDuration: 250, bouncing: true, locking: true, paging: false, snapping: false, zooming: false, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: void 0, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08, ...e2 };
123
123
  }
124
- setDimensions(e2, t2, n2, o2) {
125
- null !== e2 && (this.__clientWidth = e2), null !== t2 && (this.__clientHeight = t2), null !== n2 && (this.__contentWidth = n2), null !== o2 && (this.__contentHeight = o2), this.__computeScrollMax(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true);
124
+ setDimensions(t2, e2, n2, o2) {
125
+ null !== t2 && (this.__clientWidth = t2), null !== e2 && (this.__clientHeight = e2), null !== n2 && (this.__contentWidth = n2), null !== o2 && (this.__contentHeight = o2), this.__computeScrollMax(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true);
126
126
  }
127
- setPosition(e2, t2) {
128
- this.__clientLeft = e2 || 0, this.__clientTop = t2 || 0;
127
+ setPosition(t2, e2) {
128
+ this.__clientLeft = t2 || 0, this.__clientTop = e2 || 0;
129
129
  }
130
- setSnapSize(e2, t2) {
131
- this.__snapWidth = e2, this.__snapHeight = t2;
130
+ setSnapSize(t2, e2) {
131
+ this.__snapWidth = t2, this.__snapHeight = e2;
132
132
  }
133
133
  getValues() {
134
134
  return { left: this.__scrollLeft, top: this.__scrollTop, right: this.__scrollLeft + this.__clientWidth / this.__zoomLevel, bottom: this.__scrollTop + this.__clientHeight / this.__zoomLevel, zoom: this.__zoomLevel };
135
135
  }
136
- getPoint(e2, t2) {
136
+ getPoint(t2, e2) {
137
137
  const n2 = this.getValues();
138
- return { left: e2 / n2.zoom, top: t2 / n2.zoom };
138
+ return { left: t2 / n2.zoom, top: e2 / n2.zoom };
139
139
  }
140
140
  getScrollMax() {
141
141
  return { left: this.__maxScrollLeft, top: this.__maxScrollTop };
142
142
  }
143
- zoomTo(e2, t2 = false, n2, o2, i2) {
143
+ zoomTo(t2, e2 = false, n2, o2, i2) {
144
144
  if (!this.options.zooming) throw new Error("Zooming is not enabled!");
145
- i2 && (this.__zoomComplete = i2), this.__isDecelerating && (X(this.__isDecelerating), this.__isDecelerating = 0);
145
+ i2 && (this.__zoomComplete = i2), this.__isDecelerating && (Y(this.__isDecelerating), this.__isDecelerating = 0);
146
146
  const r2 = this.__zoomLevel;
147
- void 0 === n2 && (n2 = this.__clientWidth / 2), void 0 === o2 && (o2 = this.__clientHeight / 2), e2 = Math.max(Math.min(e2, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(e2);
148
- const s2 = e2 / r2;
147
+ void 0 === n2 && (n2 = this.__clientWidth / 2), void 0 === o2 && (o2 = this.__clientHeight / 2), t2 = Math.max(Math.min(t2, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(t2);
148
+ const s2 = t2 / r2;
149
149
  let l2 = s2 * (this.__scrollLeft + n2) - n2, a2 = s2 * (this.__scrollTop + o2) - o2;
150
- l2 > this.__maxScrollLeft ? l2 = this.__maxScrollLeft : l2 < 0 && (l2 = 0), a2 > this.__maxScrollTop ? a2 = this.__maxScrollTop : a2 < 0 && (a2 = 0), this.__publish(l2, a2, e2, t2);
150
+ l2 > this.__maxScrollLeft ? l2 = this.__maxScrollLeft : l2 < 0 && (l2 = 0), a2 > this.__maxScrollTop ? a2 = this.__maxScrollTop : a2 < 0 && (a2 = 0), this.__publish(l2, a2, t2, e2);
151
151
  }
152
- zoomBy(e2, t2 = false, n2 = 0, o2 = 0, i2) {
153
- this.zoomTo(this.__zoomLevel * e2, t2, n2, o2, i2);
152
+ zoomBy(t2, e2 = false, n2 = 0, o2 = 0, i2) {
153
+ this.zoomTo(this.__zoomLevel * t2, e2, n2, o2, i2);
154
154
  }
155
- scrollTo(e2, t2, n2 = false, o2 = 1) {
156
- if (this.__isDecelerating && (X(this.__isDecelerating), this.__isDecelerating = 0), void 0 !== o2 && o2 !== this.__zoomLevel) {
155
+ scrollTo(t2, e2, n2 = false, o2 = 1) {
156
+ if (this.__isDecelerating && (Y(this.__isDecelerating), this.__isDecelerating = 0), void 0 !== o2 && o2 !== this.__zoomLevel) {
157
157
  if (!this.options.zooming) throw new Error("Zooming is not enabled!");
158
- e2 *= o2, t2 *= o2, this.__computeScrollMax(o2);
158
+ t2 *= o2, e2 *= o2, this.__computeScrollMax(o2);
159
159
  } else o2 = this.__zoomLevel;
160
- this.options.scrollingX ? this.options.paging ? e2 = Math.round(e2 / this.__clientWidth) * this.__clientWidth : this.options.snapping && (e2 = Math.round(e2 / this.__snapWidth) * this.__snapWidth) : e2 = this.__scrollLeft, this.options.scrollingY ? this.options.paging ? t2 = Math.round(t2 / this.__clientHeight) * this.__clientHeight : this.options.snapping && (t2 = Math.round(t2 / this.__snapHeight) * this.__snapHeight) : t2 = this.__scrollTop, e2 = Math.max(Math.min(this.__maxScrollLeft, e2), 0), t2 = Math.max(Math.min(this.__maxScrollTop, t2), 0), e2 === this.__scrollLeft && t2 === this.__scrollTop && (n2 = false), this.__publish(e2, t2, o2, n2);
160
+ this.options.scrollingX ? this.options.paging ? t2 = Math.round(t2 / this.__clientWidth) * this.__clientWidth : this.options.snapping && (t2 = Math.round(t2 / this.__snapWidth) * this.__snapWidth) : t2 = this.__scrollLeft, this.options.scrollingY ? this.options.paging ? e2 = Math.round(e2 / this.__clientHeight) * this.__clientHeight : this.options.snapping && (e2 = Math.round(e2 / this.__snapHeight) * this.__snapHeight) : e2 = this.__scrollTop, t2 = Math.max(Math.min(this.__maxScrollLeft, t2), 0), e2 = Math.max(Math.min(this.__maxScrollTop, e2), 0), t2 === this.__scrollLeft && e2 === this.__scrollTop && (n2 = false), this.__publish(t2, e2, o2, n2);
161
161
  }
162
- scrollBy(e2 = 0, t2 = 0, n2 = false) {
162
+ scrollBy(t2 = 0, e2 = 0, n2 = false) {
163
163
  const o2 = this.__isAnimating ? this.__scheduledLeft : this.__scrollLeft, i2 = this.__isAnimating ? this.__scheduledTop : this.__scrollTop;
164
- this.scrollTo(o2 + (e2 || 0), i2 + (t2 || 0), n2);
164
+ this.scrollTo(o2 + (t2 || 0), i2 + (e2 || 0), n2);
165
165
  }
166
- doMouseZoom(e2, t2, n2, o2) {
167
- const i2 = e2 > 0 ? 0.97 : 1.03;
166
+ doMouseZoom(t2, e2, n2, o2) {
167
+ const i2 = t2 > 0 ? 0.97 : 1.03;
168
168
  return this.zoomTo(this.__zoomLevel * i2, false, n2 - this.__clientLeft, o2 - this.__clientTop);
169
169
  }
170
- doTouchStart(e2, t2) {
171
- if (void 0 === e2.length) throw new Error("Invalid touch list: " + e2);
172
- if (t2 instanceof Date && (t2 = t2.valueOf()), "number" != typeof t2) throw new Error("Invalid timestamp value: " + t2);
170
+ doTouchStart(t2, e2) {
171
+ if (void 0 === t2.length) throw new Error("Invalid touch list: " + t2);
172
+ if (e2 instanceof Date && (e2 = e2.valueOf()), "number" != typeof e2) throw new Error("Invalid timestamp value: " + e2);
173
173
  let n2, o2;
174
- this.__interruptedAnimation = true, this.__isDecelerating && (X(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = true), this.__isAnimating && (X(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = true);
175
- let i2 = 1 === e2.length;
176
- i2 ? (n2 = e2[0].pageX, o2 = e2[0].pageY) : (n2 = Math.abs(e2[0].pageX + e2[1].pageX) / 2, o2 = Math.abs(e2[0].pageY + e2[1].pageY) / 2), this.__initialTouchLeft = n2, this.__initialTouchTop = o2, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n2, this.__lastTouchTop = o2, this.__lastTouchMove = t2, this.__lastScale = 1, this.__enableScrollX = !i2 && this.options.scrollingX, this.__enableScrollY = !i2 && this.options.scrollingY, this.__isTracking = true, this.__didDecelerationComplete = false, this.__isDragging = !i2, this.__isSingleTouch = i2, this.__positions = [];
174
+ this.__interruptedAnimation = true, this.__isDecelerating && (Y(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = true), this.__isAnimating && (Y(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = true);
175
+ let i2 = 1 === t2.length;
176
+ i2 ? (n2 = t2[0].pageX, o2 = t2[0].pageY) : (n2 = Math.abs(t2[0].pageX + t2[1].pageX) / 2, o2 = Math.abs(t2[0].pageY + t2[1].pageY) / 2), this.__initialTouchLeft = n2, this.__initialTouchTop = o2, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n2, this.__lastTouchTop = o2, this.__lastTouchMove = e2, this.__lastScale = 1, this.__enableScrollX = !i2 && this.options.scrollingX, this.__enableScrollY = !i2 && this.options.scrollingY, this.__isTracking = true, this.__didDecelerationComplete = false, this.__isDragging = !i2, this.__isSingleTouch = i2, this.__positions = [];
177
177
  }
178
- doTouchMove(e2, t2, n2 = 1) {
179
- if (void 0 === e2.length) throw new Error("Invalid touch list: " + e2);
180
- if (t2 instanceof Date && (t2 = t2.valueOf()), "number" != typeof t2) throw new Error("Invalid timestamp value: " + t2);
178
+ doTouchMove(t2, e2, n2 = 1) {
179
+ if (void 0 === t2.length) throw new Error("Invalid touch list: " + t2);
180
+ if (e2 instanceof Date && (e2 = e2.valueOf()), "number" != typeof e2) throw new Error("Invalid timestamp value: " + e2);
181
181
  if (!this.__isTracking) return;
182
182
  let o2, i2;
183
- 2 === e2.length ? (o2 = Math.abs(e2[0].pageX + e2[1].pageX) / 2, i2 = Math.abs(e2[0].pageY + e2[1].pageY) / 2) : (o2 = e2[0].pageX, i2 = e2[0].pageY);
183
+ 2 === t2.length ? (o2 = Math.abs(t2[0].pageX + t2[1].pageX) / 2, i2 = Math.abs(t2[0].pageY + t2[1].pageY) / 2) : (o2 = t2[0].pageX, i2 = t2[0].pageY);
184
184
  let r2 = this.__positions;
185
185
  if (this.__isDragging) {
186
- let e3 = o2 - this.__lastTouchLeft, s2 = i2 - this.__lastTouchTop, l2 = this.__scrollLeft, a2 = this.__scrollTop, c2 = this.__zoomLevel;
186
+ let t3 = o2 - this.__lastTouchLeft, s2 = i2 - this.__lastTouchTop, l2 = this.__scrollLeft, a2 = this.__scrollTop, c2 = this.__zoomLevel;
187
187
  if (void 0 !== n2 && this.options.zooming) {
188
- let e4 = c2;
189
- if (c2 = c2 / this.__lastScale * n2, c2 = Math.max(Math.min(c2, this.options.maxZoom), this.options.minZoom), e4 !== c2) {
190
- let t3 = o2 - this.__clientLeft, n3 = i2 - this.__clientTop;
191
- l2 = (t3 + l2) * c2 / e4 - t3, a2 = (n3 + a2) * c2 / e4 - n3, this.__computeScrollMax(c2);
188
+ let t4 = c2;
189
+ if (c2 = c2 / this.__lastScale * n2, c2 = Math.max(Math.min(c2, this.options.maxZoom), this.options.minZoom), t4 !== c2) {
190
+ let e3 = o2 - this.__clientLeft, n3 = i2 - this.__clientTop;
191
+ l2 = (e3 + l2) * c2 / t4 - e3, a2 = (n3 + a2) * c2 / t4 - n3, this.__computeScrollMax(c2);
192
192
  }
193
193
  }
194
194
  if (this.__enableScrollX) {
195
- l2 -= e3 * this.options.speedMultiplier;
196
- let t3 = this.__maxScrollLeft;
197
- (l2 > t3 || l2 < 0) && (this.options.bouncing ? l2 += e3 / 2 * this.options.speedMultiplier : l2 = l2 > t3 ? t3 : 0);
195
+ l2 -= t3 * this.options.speedMultiplier;
196
+ let e3 = this.__maxScrollLeft;
197
+ (l2 > e3 || l2 < 0) && (this.options.bouncing ? l2 += t3 / 2 * this.options.speedMultiplier : l2 = l2 > e3 ? e3 : 0);
198
198
  }
199
199
  if (this.__enableScrollY) {
200
200
  a2 -= s2 * this.options.speedMultiplier;
201
- const e4 = this.__maxScrollTop;
202
- (a2 > e4 || a2 < 0) && (this.options.bouncing ? a2 += s2 / 2 * this.options.speedMultiplier : a2 = a2 > e4 ? e4 : 0);
201
+ const t4 = this.__maxScrollTop;
202
+ (a2 > t4 || a2 < 0) && (this.options.bouncing ? a2 += s2 / 2 * this.options.speedMultiplier : a2 = a2 > t4 ? t4 : 0);
203
203
  }
204
- r2.length > 60 && r2.splice(0, 30), r2.push(l2, a2, t2), this.__publish(l2, a2, c2);
204
+ r2.length > 60 && r2.splice(0, 30), r2.push(l2, a2, e2), this.__publish(l2, a2, c2);
205
205
  } else {
206
- let e3 = this.options.locking ? 3 : 0, n3 = 5, s2 = Math.abs(o2 - this.__initialTouchLeft), l2 = Math.abs(i2 - this.__initialTouchTop);
207
- this.__enableScrollX = this.options.scrollingX && s2 >= e3, this.__enableScrollY = this.options.scrollingY && l2 >= e3, r2.push(this.__scrollLeft, this.__scrollTop, t2), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (s2 >= n3 || l2 >= n3), this.__isDragging && (this.__interruptedAnimation = false);
206
+ let t3 = this.options.locking ? 3 : 0, n3 = 5, s2 = Math.abs(o2 - this.__initialTouchLeft), l2 = Math.abs(i2 - this.__initialTouchTop);
207
+ this.__enableScrollX = this.options.scrollingX && s2 >= t3, this.__enableScrollY = this.options.scrollingY && l2 >= t3, r2.push(this.__scrollLeft, this.__scrollTop, e2), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (s2 >= n3 || l2 >= n3), this.__isDragging && (this.__interruptedAnimation = false);
208
208
  }
209
- this.__lastTouchLeft = o2, this.__lastTouchTop = i2, this.__lastTouchMove = t2, this.__lastScale = n2;
209
+ this.__lastTouchLeft = o2, this.__lastTouchTop = i2, this.__lastTouchMove = e2, this.__lastScale = n2;
210
210
  }
211
- doTouchEnd(e2) {
212
- if (e2 instanceof Date && (e2 = e2.valueOf()), "number" != typeof e2) throw new Error("Invalid timestamp value: " + e2);
211
+ doTouchEnd(t2) {
212
+ if (t2 instanceof Date && (t2 = t2.valueOf()), "number" != typeof t2) throw new Error("Invalid timestamp value: " + t2);
213
213
  if (this.__isTracking) {
214
- if (this.__isTracking = false, this.__isDragging) if (this.__isDragging = false, this.__isSingleTouch && this.options.animating && e2 - this.__lastTouchMove <= 100) {
215
- let t2 = this.__positions, n2 = t2.length - 1, o2 = n2;
216
- for (let e3 = n2; e3 > 0 && t2[e3] > this.__lastTouchMove - 100; e3 -= 3) o2 = e3;
214
+ if (this.__isTracking = false, this.__isDragging) if (this.__isDragging = false, this.__isSingleTouch && this.options.animating && t2 - this.__lastTouchMove <= 100) {
215
+ let e2 = this.__positions, n2 = e2.length - 1, o2 = n2;
216
+ for (let t3 = n2; t3 > 0 && e2[t3] > this.__lastTouchMove - 100; t3 -= 3) o2 = t3;
217
217
  if (o2 !== n2) {
218
- const i2 = t2[n2] - t2[o2], r2 = this.__scrollLeft - t2[o2 - 2], s2 = this.__scrollTop - t2[o2 - 1];
218
+ const i2 = e2[n2] - e2[o2], r2 = this.__scrollLeft - e2[o2 - 2], s2 = this.__scrollTop - e2[o2 - 1];
219
219
  this.__decelerationVelocityX = r2 / i2 * (1e3 / 60), this.__decelerationVelocityY = s2 / i2 * (1e3 / 60);
220
220
  const l2 = this.options.paging || this.options.snapping ? 4 : 1;
221
- (Math.abs(this.__decelerationVelocityX) > l2 || Math.abs(this.__decelerationVelocityY) > l2) && this.__startDeceleration(e2);
221
+ (Math.abs(this.__decelerationVelocityX) > l2 || Math.abs(this.__decelerationVelocityY) > l2) && this.__startDeceleration(t2);
222
222
  } else this.options.scrollingComplete?.();
223
- } else e2 - this.__lastTouchMove > 100 && this.options.scrollingComplete?.();
223
+ } else t2 - this.__lastTouchMove > 100 && this.options.scrollingComplete?.();
224
224
  this.__isDecelerating || ((this.__interruptedAnimation || this.__isDragging) && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true, this.__zoomLevel)), this.__positions.length = 0;
225
225
  }
226
226
  }
227
- __publish(e2, t2, n2, o2 = false) {
227
+ __publish(t2, e2, n2, o2 = false) {
228
228
  const i2 = this.__isAnimating;
229
- if (i2 && (X(i2), this.__isAnimating = 0), o2 && this.options.animating) {
230
- this.__scheduledLeft = e2, this.__scheduledTop = t2, this.__scheduledZoom = n2;
231
- const o3 = this.__scrollLeft, r2 = this.__scrollTop, s2 = this.__zoomLevel, l2 = e2 - o3, a2 = t2 - r2, c2 = n2 - s2, h2 = function(e3, t3, n3) {
232
- n3 && (this.__scrollLeft = o3 + l2 * e3, this.__scrollTop = r2 + a2 * e3, this.__zoomLevel = s2 + c2 * e3, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
233
- }.bind(this), u2 = function(e3) {
234
- return this.__isAnimating === e3;
235
- }.bind(this), d2 = function(e3, t3, n3) {
236
- t3 === this.__isAnimating && (this.__isAnimating = false), (this.__didDecelerationComplete || n3) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
229
+ if (i2 && (Y(i2), this.__isAnimating = 0), o2 && this.options.animating) {
230
+ this.__scheduledLeft = t2, this.__scheduledTop = e2, this.__scheduledZoom = n2;
231
+ const o3 = this.__scrollLeft, r2 = this.__scrollTop, s2 = this.__zoomLevel, l2 = t2 - o3, a2 = e2 - r2, c2 = n2 - s2, h2 = function(t3, e3, n3) {
232
+ n3 && (this.__scrollLeft = o3 + l2 * t3, this.__scrollTop = r2 + a2 * t3, this.__zoomLevel = s2 + c2 * t3, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
233
+ }.bind(this), u2 = function(t3) {
234
+ return this.__isAnimating === t3;
235
+ }.bind(this), d2 = function(t3, e3, n3) {
236
+ e3 === this.__isAnimating && (this.__isAnimating = false), (this.__didDecelerationComplete || n3) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
237
237
  }.bind(this);
238
- this.__isAnimating = j(h2, u2, d2, this.options.animationDuration, i2 ? U : Z);
239
- } else this.__scheduledLeft = this.__scrollLeft = e2, this.__scheduledTop = this.__scrollTop = t2, this.__scheduledZoom = this.__zoomLevel = n2, this.__callback && this.__callback(e2, t2, n2), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
238
+ this.__isAnimating = X(h2, u2, d2, this.options.animationDuration, i2 ? U : Z);
239
+ } else this.__scheduledLeft = this.__scrollLeft = t2, this.__scheduledTop = this.__scrollTop = e2, this.__scheduledZoom = this.__zoomLevel = n2, this.__callback && this.__callback(t2, e2, n2), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
240
240
  }
241
- __computeScrollMax(e2 = this.__zoomLevel) {
242
- this.__maxScrollLeft = Math.max(this.__contentWidth * e2 - this.__clientWidth, 0), this.__maxScrollTop = Math.max(this.__contentHeight * e2 - this.__clientHeight, 0);
241
+ __computeScrollMax(t2 = this.__zoomLevel) {
242
+ this.__maxScrollLeft = Math.max(this.__contentWidth * t2 - this.__clientWidth, 0), this.__maxScrollTop = Math.max(this.__contentHeight * t2 - this.__clientHeight, 0);
243
243
  }
244
- __startDeceleration(e2) {
244
+ __startDeceleration(t2) {
245
245
  if (this.options.paging) {
246
- const e3 = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), t3 = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), n3 = this.__clientWidth, o3 = this.__clientHeight;
247
- this.__minDecelerationScrollLeft = Math.floor(e3 / n3) * n3, this.__minDecelerationScrollTop = Math.floor(t3 / o3) * o3, this.__maxDecelerationScrollLeft = Math.ceil(e3 / n3) * n3, this.__maxDecelerationScrollTop = Math.ceil(t3 / o3) * o3;
246
+ const t3 = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), e3 = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), n3 = this.__clientWidth, o3 = this.__clientHeight;
247
+ this.__minDecelerationScrollLeft = Math.floor(t3 / n3) * n3, this.__minDecelerationScrollTop = Math.floor(e3 / o3) * o3, this.__maxDecelerationScrollLeft = Math.ceil(t3 / n3) * n3, this.__maxDecelerationScrollTop = Math.ceil(e3 / o3) * o3;
248
248
  } else this.__minDecelerationScrollLeft = 0, this.__minDecelerationScrollTop = 0, this.__maxDecelerationScrollLeft = this.__maxScrollLeft, this.__maxDecelerationScrollTop = this.__maxScrollTop;
249
- const t2 = function(e3, t3, n3) {
249
+ const e2 = function(t3, e3, n3) {
250
250
  this.__stepThroughDeceleration(n3);
251
251
  }.bind(this), n2 = this.options.snapping ? 4 : 0.1, o2 = function() {
252
- const e3 = Math.abs(this.__decelerationVelocityX) >= n2 || Math.abs(this.__decelerationVelocityY) >= n2;
253
- return e3 || (this.__didDecelerationComplete = true), e3;
254
- }.bind(this), i2 = function(e3, t3, n3) {
252
+ const t3 = Math.abs(this.__decelerationVelocityX) >= n2 || Math.abs(this.__decelerationVelocityY) >= n2;
253
+ return t3 || (this.__didDecelerationComplete = true), t3;
254
+ }.bind(this), i2 = function(t3, e3, n3) {
255
255
  this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
256
256
  }.bind(this);
257
- this.__isDecelerating = j(t2, o2, i2);
257
+ this.__isDecelerating = X(e2, o2, i2);
258
258
  }
259
- __stepThroughDeceleration(e2) {
260
- let t2 = this.__scrollLeft + this.__decelerationVelocityX, n2 = this.__scrollTop + this.__decelerationVelocityY;
259
+ __stepThroughDeceleration(t2) {
260
+ let e2 = this.__scrollLeft + this.__decelerationVelocityX, n2 = this.__scrollTop + this.__decelerationVelocityY;
261
261
  if (!this.options.bouncing) {
262
- const e3 = Math.max(Math.min(this.__maxDecelerationScrollLeft, t2), this.__minDecelerationScrollLeft);
263
- e3 !== t2 && (t2 = e3, this.__decelerationVelocityX = 0);
262
+ const t3 = Math.max(Math.min(this.__maxDecelerationScrollLeft, e2), this.__minDecelerationScrollLeft);
263
+ t3 !== e2 && (e2 = t3, this.__decelerationVelocityX = 0);
264
264
  const o2 = Math.max(Math.min(this.__maxDecelerationScrollTop, n2), this.__minDecelerationScrollTop);
265
265
  o2 !== n2 && (n2 = o2, this.__decelerationVelocityY = 0);
266
266
  }
267
- if (e2 ? this.__publish(t2, n2, this.__zoomLevel) : (this.__scrollLeft = t2, this.__scrollTop = n2), !this.options.paging) {
268
- const e3 = 0.95;
269
- this.__decelerationVelocityX *= e3, this.__decelerationVelocityY *= e3;
267
+ if (t2 ? this.__publish(e2, n2, this.__zoomLevel) : (this.__scrollLeft = e2, this.__scrollTop = n2), !this.options.paging) {
268
+ const t3 = 0.95;
269
+ this.__decelerationVelocityX *= t3, this.__decelerationVelocityY *= t3;
270
270
  }
271
271
  if (this.options.bouncing) {
272
- let e3 = 0, o2 = 0, i2 = this.options.penetrationDeceleration, r2 = this.options.penetrationAcceleration;
273
- t2 < this.__minDecelerationScrollLeft ? e3 = this.__minDecelerationScrollLeft - t2 : t2 > this.__maxDecelerationScrollLeft && (e3 = this.__maxDecelerationScrollLeft - t2), n2 < this.__minDecelerationScrollTop ? o2 = this.__minDecelerationScrollTop - n2 : n2 > this.__maxDecelerationScrollTop && (o2 = this.__maxDecelerationScrollTop - n2), 0 !== e3 && (e3 * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += e3 * i2 : this.__decelerationVelocityX = e3 * r2), 0 !== o2 && (o2 * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += o2 * i2 : this.__decelerationVelocityY = o2 * r2);
272
+ let t3 = 0, o2 = 0, i2 = this.options.penetrationDeceleration, r2 = this.options.penetrationAcceleration;
273
+ e2 < this.__minDecelerationScrollLeft ? t3 = this.__minDecelerationScrollLeft - e2 : e2 > this.__maxDecelerationScrollLeft && (t3 = this.__maxDecelerationScrollLeft - e2), n2 < this.__minDecelerationScrollTop ? o2 = this.__minDecelerationScrollTop - n2 : n2 > this.__maxDecelerationScrollTop && (o2 = this.__maxDecelerationScrollTop - n2), 0 !== t3 && (t3 * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += t3 * i2 : this.__decelerationVelocityX = t3 * r2), 0 !== o2 && (o2 * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += o2 * i2 : this.__decelerationVelocityY = o2 * r2);
274
274
  }
275
275
  }
276
276
  }
277
- const q = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), J = {};
277
+ const G = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), J = {};
278
278
  function Q() {
279
279
  return E;
280
280
  }
281
- const ee = (e2) => "BracketLeft" === e2 ? "[" : "BracketRight" === e2 ? "]" : v.camelToPrettyCase(e2), te = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: J, boundPixel: function(e2, t2 = false, n2 = 0) {
282
- return e2;
283
- }, createSyntheticEvent: (e2) => {
284
- let t2 = false, n2 = false;
285
- return { nativeEvent: e2, currentTarget: e2.currentTarget, target: e2.target, bubbles: e2.bubbles, cancelable: e2.cancelable, defaultPrevented: e2.defaultPrevented, eventPhase: e2.eventPhase, isTrusted: e2.isTrusted, preventDefault: () => {
286
- t2 = true, e2.preventDefault();
287
- }, isDefaultPrevented: () => t2, stopPropagation: () => {
288
- n2 = true, e2.stopPropagation();
281
+ const tt = (t2) => "BracketLeft" === t2 ? "[" : "BracketRight" === t2 ? "]" : v.camelToPrettyCase(t2), et = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: J, boundPixel: function(t2, e2 = false, n2 = 0) {
282
+ return t2;
283
+ }, createSyntheticEvent: (t2) => {
284
+ let e2 = false, n2 = false;
285
+ return { nativeEvent: t2, currentTarget: t2.currentTarget, target: t2.target, bubbles: t2.bubbles, cancelable: t2.cancelable, defaultPrevented: t2.defaultPrevented, eventPhase: t2.eventPhase, isTrusted: t2.isTrusted, preventDefault: () => {
286
+ e2 = true, t2.preventDefault();
287
+ }, isDefaultPrevented: () => e2, stopPropagation: () => {
288
+ n2 = true, t2.stopPropagation();
289
289
  }, isPropagationStopped: () => n2, persist: () => {
290
- }, timeStamp: e2.timeStamp, type: e2.type };
291
- }, detectIt: Q, focusableNodeNames: q, toPrettyKeyCode: ee }, Symbol.toStringTag, { value: "Module" })), ne = [];
292
- function oe(e2, t2, n2 = ne) {
290
+ }, timeStamp: t2.timeStamp, type: t2.type };
291
+ }, detectIt: Q, focusableNodeNames: G, toPrettyKeyCode: tt }, Symbol.toStringTag, { value: "Module" })), nt = [];
292
+ function ot(t2, e2, n2 = nt) {
293
293
  const o2 = r(null);
294
- return u(e2, () => {
294
+ return u(t2, () => {
295
295
  if (!o2.current) return;
296
- const e3 = o2.current, n3 = t2?.();
296
+ const t3 = o2.current, n3 = e2?.();
297
297
  if (!n3 || "object" != typeof n3) throw new Error("attributes must return a plain object of values");
298
298
  const i2 = Object.keys(n3), r2 = i2.length;
299
- for (let t3 = 0; t3 < r2; t3++) {
300
- const o3 = i2[t3], r3 = n3[o3];
301
- Object.defineProperty(e3, o3, { value: r3, writable: true, configurable: true, enumerable: true });
299
+ for (let e3 = 0; e3 < r2; e3++) {
300
+ const o3 = i2[e3], r3 = n3[o3];
301
+ Object.defineProperty(t3, o3, { value: r3, writable: true, configurable: true, enumerable: true });
302
302
  }
303
- return e3;
303
+ return t3;
304
304
  }, n2), o2;
305
305
  }
306
- const ie = (t2) => e(I, { ...t2 }), re = ({ width: t2, height: n2 }) => e("div", { className: "corner", style: { minWidth: `${t2}px`, width: `${t2}px`, minHeight: `${n2}px`, height: `${n2}px` } }), se = s(l((o2, s2) => {
307
- const { children: l2, viewport: a2, onScrollViewport: u2, showHorizontalScrollbar: d2 = true, showVerticalScrollbar: _2 = true, createScrollCorner: p2 = re, createHorizontalScrollbar: m2 = ie, createVerticalScrollbar: f2 = ie, style: g2, touchElement: v2, disableTouch: x2, ...w2 } = o2, b2 = B(u2, [u2]), S2 = oe(s2, () => ({ isScrollPane: () => true }), []), L2 = r(null);
306
+ const it = (e2) => t(W, { ...e2 }), rt = ({ width: e2, height: n2 }) => t("div", { className: "corner", style: { minWidth: `${e2}px`, width: `${e2}px`, minHeight: `${n2}px`, height: `${n2}px` } }), st = s(l((o2, s2) => {
307
+ const { children: l2, viewport: a2, onScrollViewport: u2, showHorizontalScrollbar: d2 = true, showVerticalScrollbar: p2 = true, createScrollCorner: f2 = rt, createHorizontalScrollbar: _2 = it, createVerticalScrollbar: m2 = it, style: g2, touchElement: v2, disableTouch: x2, ...w2 } = o2, b2 = B(u2, [u2]), S2 = ot(s2, () => ({ isScrollPane: () => true }), []), L2 = r(null);
308
308
  c(() => {
309
309
  L2.current && (L2.current.__scrollTop === a2?.top && L2.current.__scrollLeft === a2?.left || L2.current.__isDecelerating || L2.current?.scrollTo(a2?.left, a2?.top, false));
310
310
  }, [a2?.left, a2?.top, v2]);
311
- const E2 = i((e2, t2) => {
312
- b2?.({ left: e2, top: t2 });
313
- }, []), C2 = i((e2) => {
314
- L2.current?.doTouchStart(e2.touches, e2.timeStamp);
315
- }, []), T2 = i((e2) => {
316
- e2.preventDefault(), L2.current?.doTouchMove(e2.touches, e2.timeStamp);
317
- }, []), M2 = i((e2) => {
318
- L2.current?.doTouchEnd(e2.timeStamp);
319
- }, []), D2 = i(({ containerWidth: e2, containerHeight: t2, totalWidth: n2, totalHeight: o3 }) => {
320
- L2.current.setDimensions(e2, t2, n2, o3);
311
+ const E2 = i((t2, e2) => {
312
+ b2?.({ left: t2, top: e2 });
313
+ }, []), C2 = i((t2) => {
314
+ L2.current?.doTouchStart(t2.touches, t2.timeStamp);
315
+ }, []), T2 = i((t2) => {
316
+ t2.preventDefault(), L2.current?.doTouchMove(t2.touches, t2.timeStamp);
317
+ }, []), M2 = i((t2) => {
318
+ L2.current?.doTouchEnd(t2.timeStamp);
319
+ }, []), k2 = i(({ containerWidth: t2, containerHeight: e2, totalWidth: n2, totalHeight: o3 }) => {
320
+ L2.current.setDimensions(t2, e2, n2, o3);
321
321
  }, []);
322
322
  c(() => {
323
- const e2 = v2 ?? S2.current;
324
- if (!x2 && Q().supportsTouchEvents && e2 && a2) {
323
+ const t2 = v2 ?? S2.current;
324
+ if (!x2 && Q().supportsTouchEvents && t2 && a2) {
325
325
  if (!L2.current) {
326
- const e3 = { scrollingX: true, scrollingY: true, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
327
- L2.current = new G(E2, e3);
326
+ const t3 = { scrollingX: true, scrollingY: true, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
327
+ L2.current = new q(E2, t3);
328
328
  }
329
- Q().supportsTouchEvents && (e2.addEventListener("touchstart", C2), e2.addEventListener("touchend", M2), e2.addEventListener("touchmove", T2)), D2({ containerWidth: a2?.width, containerHeight: a2?.height, totalWidth: a2?.totalWidth, totalHeight: a2?.totalHeight });
329
+ Q().supportsTouchEvents && (t2.addEventListener("touchstart", C2), t2.addEventListener("touchend", M2), t2.addEventListener("touchmove", T2)), k2({ containerWidth: a2?.width, containerHeight: a2?.height, totalWidth: a2?.totalWidth, totalHeight: a2?.totalHeight });
330
330
  }
331
331
  return () => {
332
- e2?.removeEventListener("touchstart", C2), e2?.removeEventListener("touchend", M2), e2?.removeEventListener("touchmove", T2);
332
+ t2?.removeEventListener("touchstart", C2), t2?.removeEventListener("touchend", M2), t2?.removeEventListener("touchmove", T2);
333
333
  };
334
334
  }, [a2?.width, a2?.height, a2?.totalWidth, a2?.totalHeight, x2, v2]);
335
- const [P2, { width: z2 }] = y(), [k2, { height: $2 }] = y(), O2 = h(() => {
336
- const t2 = f2({ orientation: A.Vertical, offset: a2?.top, viewportSize: a2?.height, totalSize: a2?.totalHeight, onScrollOffset: (e2) => {
337
- b2?.({ top: e2 });
335
+ const [D2, { width: P2 }] = y(), [A2, { height: $2 }] = y(), O2 = h(() => {
336
+ const e2 = m2({ orientation: z.Vertical, offset: a2?.top, viewportSize: a2?.height, totalSize: a2?.totalHeight, onScrollOffset: (t2) => {
337
+ b2?.({ top: t2 });
338
338
  } });
339
- return e("div", { style: { display: "flex", flex: "0" }, ref: P2, children: t2 });
340
- }, [f2, a2?.top, a2?.height, a2?.totalHeight]), K2 = h(() => {
341
- const o3 = m2({ orientation: A.Horizontal, offset: a2?.left, viewportSize: a2?.width, totalSize: a2?.totalWidth, onScrollOffset: (e2) => b2?.({ left: e2 }) });
342
- return t("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [e("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${z2}px)` }, children: e("div", { ref: k2, className: "sizer", children: o3 }) }), _2 ? p2({ width: z2, height: $2 }) : e(n, {})] });
343
- }, [m2, a2?.left, a2?.width, a2?.totalWidth, _2, p2, z2, $2]);
344
- return e("div", { style: { position: "relative", display: "flex", minWidth: _2 ? `${z2}px` : void 0, minHeight: d2 ? `${$2}px` : void 0, ...g2 }, ...w2, ref: S2, children: t("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [t("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [e("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: l2 }), _2 ? O2 : e(n, {})] }), d2 ? K2 : e(n, {})] }) });
339
+ return t("div", { style: { display: "flex", flex: "0" }, ref: D2, children: e2 });
340
+ }, [m2, a2?.top, a2?.height, a2?.totalHeight]), K2 = h(() => {
341
+ const o3 = _2({ orientation: z.Horizontal, offset: a2?.left, viewportSize: a2?.width, totalSize: a2?.totalWidth, onScrollOffset: (t2) => b2?.({ left: t2 }) });
342
+ return e("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [t("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${P2}px)` }, children: t("div", { ref: A2, className: "sizer", children: o3 }) }), p2 ? f2({ width: P2, height: $2 }) : t(n, {})] });
343
+ }, [_2, a2?.left, a2?.width, a2?.totalWidth, p2, f2, P2, $2]);
344
+ return t("div", { style: { position: "relative", display: "flex", minWidth: p2 ? `${P2}px` : void 0, minHeight: d2 ? `${$2}px` : void 0, ...g2 }, ...w2, ref: S2, children: e("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [e("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [t("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: l2 }), p2 ? O2 : t(n, {})] }), d2 ? K2 : t(n, {})] }) });
345
345
  }));
346
- se.displayName = "ScrollPane";
347
- let le = 0;
348
- function ae() {
349
- const [e2, t2] = a(!!document.fullscreenElement), n2 = i(() => {
350
- const e3 = document.fullscreenElement;
351
- return e3 ? e3.querySelector(".fullscreen-portal-root") || e3 : document.body;
346
+ st.displayName = "ScrollPane";
347
+ let lt = 0;
348
+ function at() {
349
+ const [t2, e2] = a(!!document.fullscreenElement), n2 = i(() => {
350
+ const t3 = document.fullscreenElement;
351
+ return t3 ? t3.querySelector(".fullscreen-portal-root") || t3 : document.body;
352
352
  }, []);
353
353
  return c(() => {
354
- function e3() {
355
- const e4 = document.fullscreenElement;
356
- if (t2(!!e4), !e4) return;
357
- let n3 = e4.querySelector(".fullscreen-portal-root");
358
- n3 || (n3 = document.createElement("div"), n3.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", e4.appendChild(n3));
354
+ function t3() {
355
+ const t4 = document.fullscreenElement;
356
+ if (e2(!!t4), !t4) return;
357
+ let n3 = t4.querySelector(".fullscreen-portal-root");
358
+ n3 || (n3 = document.createElement("div"), n3.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", t4.appendChild(n3));
359
359
  }
360
- return le++, e3(), document.addEventListener("fullscreenchange", e3), () => {
361
- document.removeEventListener("fullscreenchange", e3), le--, le <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((e4) => {
362
- e4.parentNode && e4.parentNode.removeChild(e4);
363
- }), le = 0);
360
+ return lt++, t3(), document.addEventListener("fullscreenchange", t3), () => {
361
+ document.removeEventListener("fullscreenchange", t3), lt--, lt <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((t4) => {
362
+ t4.parentNode && t4.parentNode.removeChild(t4);
363
+ }), lt = 0);
364
364
  };
365
- }, []), { getPortalContainer: n2, isFullscreen: e2 };
365
+ }, []), { getPortalContainer: n2, isFullscreen: t2 };
366
366
  }
367
- const ce = 100, he = 100, ue = 1e6, de = 100, _e = 50, pe = s(l((t2, n2) => {
368
- const { offset: o2 = 0, viewportSize: s2 = 0, totalSize: l2 = 0, minSize: c2 = 0, endGap: h2 = ce, endScrollIncrement: u2 = he, style: _2 = J, onMouseDown: p2, onScrollOffset: m2, onScroll: f2, scaleLimit: g2 = ue, scaleFactor: y2 = de, precisionFactor: v2 = _e, ...x2 } = t2;
369
- f2 && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
370
- const w2 = B(p2, [p2]), b2 = () => ({ offset: o2, totalSize: 0 === g2 ? l2 : Math.min(l2 ?? 0, Math.max(c2 ?? 0, (o2 ?? 0) + (s2 ?? 0)) + (h2 ?? 0)) }), [S2, L2] = a(b2), E2 = 0 !== g2 && S2.totalSize > g2 ? y2 : 1, C2 = E2 / v2, T2 = Math.ceil(S2.totalSize / E2), M2 = Math.ceil(S2.offset / E2), D2 = Math.ceil(s2 / E2), P2 = i((e2) => {
371
- }, []), [z2, k2] = a(false), A2 = r(null);
367
+ const ct = 100, ht = 100, ut = 1e6, dt = 100, pt = 50, ft = s(l((e2, n2) => {
368
+ const { offset: o2 = 0, viewportSize: s2 = 0, totalSize: l2 = 0, minSize: c2 = 0, endGap: h2 = ct, endScrollIncrement: u2 = ht, style: p2 = J, onMouseDown: f2, onScrollOffset: _2, onScroll: m2, scaleLimit: g2 = ut, scaleFactor: y2 = dt, precisionFactor: v2 = pt, ...x2 } = e2;
369
+ m2 && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
370
+ const w2 = B(f2, [f2]), b2 = () => ({ offset: o2, totalSize: 0 === g2 ? l2 : Math.min(l2 ?? 0, Math.max(c2 ?? 0, (o2 ?? 0) + (s2 ?? 0)) + (h2 ?? 0)) }), [S2, L2] = a(b2), E2 = 0 !== g2 && S2.totalSize > g2 ? y2 : 1, C2 = E2 / v2, T2 = Math.ceil(S2.totalSize / E2), M2 = Math.ceil(S2.offset / E2), k2 = Math.ceil(s2 / E2), D2 = i((t2) => {
371
+ }, []), [P2, A2] = a(false), z2 = r(null);
372
372
  d(() => {
373
- if (!z2) {
374
- A2.current = { propTotalSize: l2, propViewportSize: s2, propOffset: o2 };
375
- const e2 = b2();
376
- L2(e2);
373
+ if (!P2) {
374
+ z2.current = { propTotalSize: l2, propViewportSize: s2, propOffset: o2 };
375
+ const t2 = b2();
376
+ L2(t2);
377
377
  }
378
- }, [l2, s2, o2, z2, c2, h2, u2]);
379
- const $2 = B((e2, t3, n3) => {
380
- const i2 = A2.current;
381
- A2.current = null, i2 && i2.propTotalSize === l2 && i2.propViewportSize === s2 && i2.propOffset === o2 || (Math.abs(e2 - M2) < C2 && (e2 = M2), m2?.(e2 * E2, M2, D2));
382
- }, [m2, E2, C2, M2, D2]), O2 = i((e2) => {
383
- document.removeEventListener("mousemove", P2), document.removeEventListener("mouseup", O2), k2(false);
384
- }, []), K2 = i((e2) => {
385
- w2?.(e2), k2(true), document.addEventListener("mousemove", P2, { passive: true }), document.addEventListener("mouseup", O2, { passive: true });
386
- }, [P2, O2]);
387
- return e(I, { ref: n2, style: { ..._2 }, ...x2, offset: M2, totalSize: T2, viewportSize: D2, onMouseDown: K2, onScrollOffset: $2 });
378
+ }, [l2, s2, o2, P2, c2, h2, u2]);
379
+ const $2 = B((t2, e3, n3) => {
380
+ const i2 = z2.current;
381
+ z2.current = null, i2 && i2.propTotalSize === l2 && i2.propViewportSize === s2 && i2.propOffset === o2 || (Math.abs(t2 - M2) < C2 && (t2 = M2), _2?.(t2 * E2, M2, k2));
382
+ }, [_2, E2, C2, M2, k2]), O2 = i((t2) => {
383
+ document.removeEventListener("mousemove", D2), document.removeEventListener("mouseup", O2), A2(false);
384
+ }, []), K2 = i((t2) => {
385
+ w2?.(t2), A2(true), document.addEventListener("mousemove", D2, { passive: true }), document.addEventListener("mouseup", O2, { passive: true });
386
+ }, [D2, O2]);
387
+ return t(W, { ref: n2, style: { ...p2 }, ...x2, offset: M2, totalSize: T2, viewportSize: k2, onMouseDown: K2, onScrollOffset: $2 });
388
388
  }));
389
- pe.displayName = "VirtualScrollbar";
390
- const me = { 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" }, fe = s(l((t2, n2) => {
391
- const { refFocusStart: o2, ...s2 } = t2, l2 = r(null), a2 = i(() => {
389
+ ft.displayName = "VirtualScrollbar";
390
+ const _t = { 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" }, mt = s(l((e2, n2) => {
391
+ const { refFocusStart: o2, ...s2 } = e2, l2 = r(null), a2 = i(() => {
392
392
  if (o2) return void o2?.current?.focus();
393
- const e2 = l2.current.parentElement.children;
394
- let t3 = [];
395
- for (let n3 = 0; n3 < e2.length && e2[n3] !== l2.current; n3++) {
396
- const o3 = e2[n3].getAttribute("tabindex");
393
+ const t2 = l2.current.parentElement.children;
394
+ let e3 = [];
395
+ for (let n3 = 0; n3 < t2.length && t2[n3] !== l2.current; n3++) {
396
+ const o3 = t2[n3].getAttribute("tabindex");
397
397
  if (null == o3 || "-1" === o3) continue;
398
- if ("true" === e2[n3].getAttribute("disabled")) continue;
399
- const i2 = e2[n3];
400
- i2.focus && t3.push({ tabindex: parseInt(o3), child: i2 });
398
+ if ("true" === t2[n3].getAttribute("disabled")) continue;
399
+ const i2 = t2[n3];
400
+ i2.focus && e3.push({ tabindex: parseInt(o3), child: i2 });
401
401
  }
402
- 0 !== t3.length && (t3.sort(function(e3, t4) {
403
- return e3.tabindex - t4.tabindex;
404
- }), t3[0].child.focus());
402
+ 0 !== e3.length && (e3.sort(function(t3, e4) {
403
+ return t3.tabindex - e4.tabindex;
404
+ }), e3[0].child.focus());
405
405
  }, [o2]);
406
- return e("div", { tabIndex: 0, ref: C([l2, n2]), onFocus: a2, ...s2 });
406
+ return t("div", { tabIndex: 0, ref: C([l2, n2]), onFocus: a2, ...s2 });
407
407
  }));
408
- const ge = s(l((i2, s2) => {
409
- const { className: l2, style: a2, children: c2, radius: u2 = 4, strokeWidth: d2 = 1, strokeColor: _2 = "grey", ...p2 } = i2, [m2, { width: f2, height: g2 }] = y(), v2 = r(null), x2 = (e2, t2 = 0) => {
410
- const n2 = e2 / 2, o2 = g2 - n2 + t2;
411
- return (function(e3, t3, n3 = false) {
412
- if (0 === t3) return e3;
413
- function o3(e4, t4, n4) {
414
- let o4 = t4.x - e4.x, r3 = t4.y - e4.y, s4 = Math.sqrt(o4 * o4 + r3 * r3);
415
- return i3(e4, t4, Math.min(1, n4 / s4));
408
+ const gt = s(l((i2, s2) => {
409
+ const { className: l2, style: a2, children: c2, radius: u2 = 4, strokeWidth: d2 = 1, strokeColor: p2 = "grey", ...f2 } = i2, [_2, { width: m2, height: g2 }] = y(), v2 = r(null), x2 = (t2, e2 = 0) => {
410
+ const n2 = t2 / 2, o2 = g2 - n2 + e2;
411
+ return (function(t3, e3, n3 = false) {
412
+ if (0 === e3) return t3;
413
+ function o3(t4, e4, n4) {
414
+ let o4 = e4.x - t4.x, r3 = e4.y - t4.y, s4 = Math.sqrt(o4 * o4 + r3 * r3);
415
+ return i3(t4, e4, Math.min(1, n4 / s4));
416
416
  }
417
- function i3(e4, t4, n4) {
418
- return { x: e4.x + (t4.x - e4.x) * n4, y: e4.y + (t4.y - e4.y) * n4 };
417
+ function i3(t4, e4, n4) {
418
+ return { x: t4.x + (e4.x - t4.x) * n4, y: t4.y + (e4.y - t4.y) * n4 };
419
419
  }
420
- function r2(e4, t4) {
421
- e4.length > 2 && (e4[e4.length - 2] = t4.x, e4[e4.length - 1] = t4.y);
420
+ function r2(t4, e4) {
421
+ t4.length > 2 && (t4[t4.length - 2] = e4.x, t4[t4.length - 1] = e4.y);
422
422
  }
423
- function s3(e4) {
424
- return { x: parseFloat(e4[e4.length - 2]), y: parseFloat(e4[e4.length - 1]) };
423
+ function s3(t4) {
424
+ return { x: parseFloat(t4[t4.length - 2]), y: parseFloat(t4[t4.length - 1]) };
425
425
  }
426
- let l3 = e3.split(/[,\s]/).reduce(function(e4, t4) {
427
- let n4 = t4.match("([a-zA-Z])(.+)");
428
- return n4 ? (e4.push(n4[1]), e4.push(n4[2])) : e4.push(t4), e4;
429
- }, []).reduce(function(e4, t4) {
430
- return parseFloat(t4) == t4 && e4.length ? e4[e4.length - 1].push(t4) : e4.push([t4]), e4;
426
+ let l3 = t3.split(/[,\s]/).reduce(function(t4, e4) {
427
+ let n4 = e4.match("([a-zA-Z])(.+)");
428
+ return n4 ? (t4.push(n4[1]), t4.push(n4[2])) : t4.push(e4), t4;
429
+ }, []).reduce(function(t4, e4) {
430
+ return parseFloat(e4) == e4 && t4.length ? t4[t4.length - 1].push(e4) : t4.push([e4]), t4;
431
431
  }, []), a3 = [];
432
432
  if (l3.length > 1) {
433
- let e4 = s3(l3[0]), c3 = null;
434
- "Z" === l3[l3.length - 1][0] && l3[0].length > 2 && (c3 = ["L", e4.x, e4.y], l3[l3.length - 1] = c3), a3.push(l3[0]);
435
- for (let e5 = 1; e5 < l3.length; e5++) {
436
- let h2 = a3[a3.length - 1], u3 = l3[e5], d3 = u3 === c3 ? l3[1] : l3[e5 + 1];
433
+ let t4 = s3(l3[0]), c3 = null;
434
+ "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]);
435
+ for (let t5 = 1; t5 < l3.length; t5++) {
436
+ let h2 = a3[a3.length - 1], u3 = l3[t5], d3 = u3 === c3 ? l3[1] : l3[t5 + 1];
437
437
  if (d3 && h2 && h2.length > 2 && "L" === u3[0] && d3.length > 2 && "L" === d3[0]) {
438
- let e6, l4, c4 = s3(h2), _3 = s3(u3), p3 = s3(d3);
439
- n3 ? (e6 = i3(_3, h2.origPoint || c4, t3), l4 = i3(_3, d3.origPoint || p3, t3)) : (e6 = o3(_3, c4, t3), l4 = o3(_3, p3, t3)), r2(u3, e6), u3.origPoint = _3, a3.push(u3);
440
- let m3 = i3(e6, _3, 0.5), f3 = i3(_3, l4, 0.5), g3 = ["C", m3.x, m3.y, f3.x, f3.y, l4.x, l4.y];
441
- g3.origPoint = _3, a3.push(g3);
438
+ let t6, l4, c4 = s3(h2), p3 = s3(u3), f3 = s3(d3);
439
+ n3 ? (t6 = i3(p3, h2.origPoint || c4, e3), l4 = i3(p3, d3.origPoint || f3, e3)) : (t6 = o3(p3, c4, e3), l4 = o3(p3, f3, e3)), r2(u3, t6), u3.origPoint = p3, a3.push(u3);
440
+ let _3 = i3(t6, p3, 0.5), m3 = i3(p3, l4, 0.5), g3 = ["C", _3.x, _3.y, m3.x, m3.y, l4.x, l4.y];
441
+ g3.origPoint = p3, a3.push(g3);
442
442
  } else a3.push(u3);
443
443
  }
444
444
  if (c3) {
445
- let e5 = s3(a3[a3.length - 1]);
446
- a3.push(["Z"]), r2(a3[0], e5);
445
+ let t5 = s3(a3[a3.length - 1]);
446
+ a3.push(["Z"]), r2(a3[0], t5);
447
447
  }
448
448
  } else a3 = l3;
449
- return a3.reduce(function(e4, t4) {
450
- return e4 + t4.join(" ") + " ";
449
+ return a3.reduce(function(t4, e4) {
450
+ return t4 + e4.join(" ") + " ";
451
451
  }, "");
452
- })(`${`M 0 ${n2} L ${u2 - 0.5} ${n2} L ${u2 - 0.5} ${o2} L ${2 * u2} ${o2}`} ${`L ${f2 - 2 * u2} ${o2}`} ${`M ${f2 - 2 * u2} ${o2} L ${f2 - u2} ${o2} L ${f2 - u2} ${n2} L ${f2} ${n2}`}`, u2);
453
- }, w2 = h(() => x2(d2), [f2, g2, u2, d2]), b2 = h(() => {
452
+ })(`${`M 0 ${n2} L ${u2 - 0.5} ${n2} L ${u2 - 0.5} ${o2} L ${2 * u2} ${o2}`} ${`L ${m2 - 2 * u2} ${o2}`} ${`M ${m2 - 2 * u2} ${o2} L ${m2 - u2} ${o2} L ${m2 - u2} ${n2} L ${m2} ${n2}`}`, u2);
453
+ }, w2 = h(() => x2(d2), [m2, g2, u2, d2]), b2 = h(() => {
454
454
  if (0 === u2) return;
455
- const e2 = u2 / 2;
456
- return x2(u2) + `L ${f2} 0 L 0 0 L 0 ${e2}`;
455
+ const t2 = u2 / 2;
456
+ return x2(u2) + `L ${m2} 0 L 0 0 L 0 ${t2}`;
457
457
  }, [w2, u2, d2]), S2 = h(() => ({ style: { clipPath: `path('${b2}')` } }), [b2]);
458
- return t("div", { className: l2, style: { display: "flex", flexDirection: "row", ...a2 }, ...p2, ref: C([v2, m2, s2]), children: [o.isValidElement(c2) ? o.cloneElement(c2, S2) : e(n, {}), e("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: f2, height: g2, viewBox: `0 0 ${f2} ${g2}`, children: e("path", { d: w2, stroke: _2, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: d2 }) })] });
459
- })), ye = {}, ve = (t2) => {
460
- const { onPointerDown: n2, style: o2, splitDirection: i2, paddingBefore: r2 = 0, paddingAfter: s2 = 0, disabled: l2, key: a2, hitAreaProps: c2 = ye, ...h2 } = t2, u2 = "row" === i2, { style: d2, className: _2, ...p2 } = c2;
461
- return e("div", { style: { ...o2, position: "relative" }, ...h2, children: e("div", { className: g("hit-box", _2), style: { left: (u2 ? -r2 : 0) + "px", width: `calc(100% + ${u2 ? r2 + s2 : 0}px)`, top: (u2 ? 0 : -r2) + "px", height: `calc(100% + ${u2 ? 0 : r2 + s2}px)`, position: "absolute", ...d2 }, onPointerDown: l2 ? void 0 : n2, ...p2 }) }, a2);
462
- }, xe = {}, we = (e2, t2, n2 = true) => null === e2 ? null : null !== e2.pixels ? n2 ? e2.pixels : t2 - e2.pixels : (n2 ? e2.percent : 100 - e2.percent) / 100 * t2, be = (e2, t2 = true) => e2?.percent ? `${t2 ? e2.percent : 100 - e2.percent}%` : e2?.pixels ? `${e2.pixels}px` : void 0, Se = (e2, t2) => {
463
- if (null == e2) return null;
458
+ return e("div", { className: l2, style: { display: "flex", flexDirection: "row", ...a2 }, ...f2, ref: C([v2, _2, s2]), children: [o.isValidElement(c2) ? o.cloneElement(c2, S2) : t(n, {}), t("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: m2, height: g2, viewBox: `0 0 ${m2} ${g2}`, children: t("path", { d: w2, stroke: p2, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: d2 }) })] });
459
+ })), yt = {}, vt = (e2) => {
460
+ const { onPointerDown: n2, style: o2, splitDirection: i2, paddingBefore: r2 = 0, paddingAfter: s2 = 0, disabled: l2, key: a2, hitAreaProps: c2 = yt, ...h2 } = e2, u2 = "row" === i2, { style: d2, className: p2, ...f2 } = c2;
461
+ return t("div", { style: { ...o2, position: "relative" }, ...h2, children: t("div", { className: g("hit-box", p2), style: { left: (u2 ? -r2 : 0) + "px", width: `calc(100% + ${u2 ? r2 + s2 : 0}px)`, top: (u2 ? 0 : -r2) + "px", height: `calc(100% + ${u2 ? 0 : r2 + s2}px)`, position: "absolute", ...d2 }, onPointerDown: l2 ? void 0 : n2, ...f2 }) }, a2);
462
+ }, xt = {}, wt = (t2, e2, n2 = true) => null === t2 ? null : null !== t2.pixels ? n2 ? t2.pixels : e2 - t2.pixels : (n2 ? t2.percent : 100 - t2.percent) / 100 * e2, bt = (t2, e2 = true) => t2?.percent ? `${e2 ? t2.percent : 100 - t2.percent}%` : t2?.pixels ? `${t2.pixels}px` : void 0, St = (t2, e2) => {
463
+ if (null == t2) return null;
464
464
  const n2 = { percent: null, pixels: null };
465
- let o2 = t2;
466
- return "string" == typeof e2 && ((e2 = e2.trim().toLowerCase()).endsWith("px") ? (e2 = e2.substring(0, e2.length - 2), o2 = false) : e2.endsWith("%") && (e2 = e2.substring(0, e2.length - 1), o2 = true), e2 = parseFloat(e2)), o2 ? n2.percent = e2 : n2.pixels = e2, Object.freeze(n2);
467
- }, Le = s(l((n2, i2) => {
468
- const { elementBefore: s2, elementAfter: l2, splitDirection: u2 = "row", fixedPane: d2 = null, position: _2, onPositionChange: p2, minBefore: m2, maxBefore: f2, minAfter: v2, maxAfter: x2, children: w2, className: b2, style: S2, disabled: L2 = false, onDragStart: E2, onDragResize: T2, onDragFinish: M2, resizerProps: D2 = xe, paneProps: P2 = xe, paneBeforeProps: z2 = xe, paneAfterProps: k2 = xe, createResizer: A2 = ve } = n2;
465
+ let o2 = e2;
466
+ 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);
467
+ }, Lt = s(l((n2, i2) => {
468
+ const { elementBefore: s2, elementAfter: l2, splitDirection: u2 = "row", fixedPane: d2 = null, position: p2, onPositionChange: f2, minBefore: _2, maxBefore: m2, minAfter: v2, maxAfter: x2, children: w2, className: b2, style: S2, disabled: L2 = false, onDragStart: E2, onDragResize: T2, onDragFinish: M2, resizerProps: k2 = xt, paneProps: D2 = xt, paneBeforeProps: P2 = xt, paneAfterProps: A2 = xt, createResizer: z2 = vt } = n2;
469
469
  if (w2) throw new Error("Use elementBefore and elementAfter instead of children.");
470
470
  const $2 = h(() => o.isValidElement(l2) && o.isValidElement(s2), [l2, s2]), O2 = h(() => {
471
- let e2 = null;
472
- d2 && ("before" === d2 ? e2 = 0 : "after" === d2 && (e2 = 1));
473
- const t2 = null === e2;
474
- return { fixedPaneOffset: e2, isPercent: t2, minBefore: Se(m2, t2), maxBefore: Se(f2, t2), minAfter: Se(v2, t2), maxAfter: Se(x2, t2) };
475
- }, [m2, f2, v2, x2]), K2 = B(p2, [p2]), [V2, H2] = a(() => Se(_2, null === d2));
471
+ let t2 = null;
472
+ d2 && ("before" === d2 ? t2 = 0 : "after" === d2 && (t2 = 1));
473
+ const e2 = null === t2;
474
+ return { fixedPaneOffset: t2, isPercent: e2, minBefore: St(_2, e2), maxBefore: St(m2, e2), minAfter: St(v2, e2), maxAfter: St(x2, e2) };
475
+ }, [_2, m2, v2, x2]), K2 = B(f2, [f2]), [V2, N2] = a(() => St(p2, null === d2));
476
476
  c(() => {
477
- H2(Se(_2, null === d2));
478
- }, [_2, d2]);
479
- const [W2, { width: I2, height: N2 }] = y(), [F2, { width: R2, height: Y2 }] = y(), X2 = "row" === u2 ? R2 : Y2, j2 = "row" === u2 ? I2 : N2, U2 = h(() => ((e2, t2, n3, o2) => {
477
+ N2(St(p2, null === d2));
478
+ }, [p2, d2]);
479
+ const [H2, { width: W2, height: I2 }] = y(), [R2, { width: j2, height: F2 }] = y(), Y2 = "row" === u2 ? j2 : F2, X2 = "row" === u2 ? W2 : I2, U2 = h(() => ((t2, e2, n3, o2) => {
480
480
  const i3 = [null, null], r2 = [null, null];
481
- if (e2 || (e2 = { percent: null === o2.fixedPaneOffset ? 50 : null, pixels: null === o2.fixedPaneOffset ? null : 0 }), 0 === t2) return null != e2?.pixels ? 1 !== o2.fixedPaneOffset ? (i3[0] = e2?.pixels, r2[1] = 100) : (i3[1] = e2?.pixels - n3, r2[0] = 100) : null != e2?.percent && (1 !== o2.fixedPaneOffset ? (r2[0] = e2?.percent, r2[1] = 100 - e2?.percent) : (r2[1] = e2?.percent, r2[0] = 100 - e2?.percent)), { percents: r2, pixels: i3, minBefore: be(o2.minBefore, true), maxBefore: be(o2.maxBefore, true), minAfter: be(o2.minAfter), maxAfter: be(o2.maxAfter) };
482
- let s3 = we(e2, t2, 1 !== o2.fixedPaneOffset), l3 = t2 - n3, a2 = we(o2.minBefore, l3, true) ?? 0, c2 = we(o2.maxBefore, l3, true) ?? l3, h2 = 0, u3 = 0, d3 = 0, _3 = l3;
483
- h2 = (we(o2.maxAfter, t2, false) ?? n3) - n3, u3 = we(o2.minAfter, t2, false) ?? t2, d3 = Math.max(a2, h2), _3 = Math.min(c2, u3), s3 = Math.max(d3, Math.min(s3, _3)), u3 = Math.min(l3 - s3, we(o2.maxAfter, l3 - s3, true) ?? l3), h2 = Math.min(l3 - s3, we(o2.minAfter, l3 - s3, true) ?? l3), i3[0] = s3, i3[1] = l3 - i3[0];
484
- const p3 = Math.max(0, Math.min(100, s3 / l3 * 100));
485
- return r2[0] = p3, r2[1] = 100 - r2[0], { percents: r2, pixels: i3, minBefore: `${a2}px`, minAfter: `${h2}px`, maxBefore: `${i3[0]}px`, maxAfter: `${i3[1]}px` };
486
- })(V2, j2, X2, O2), [O2, V2, j2, X2, u2]), [Z2, G2] = a(false), q2 = B(E2, [E2]), J2 = B(T2, [T2]), Q2 = B(M2, [M2]), ee2 = r(null), te2 = r(null), ne2 = r(null), { style: ie2, className: re2, ...se2 } = P2, le2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", display: "flex", overflow: "hidden", ...ie2 }, { className: ae2, style: ce2, ...he2 } = z2, { className: ue2, style: de2, ..._e2 } = k2, pe2 = { flex: "1 1 100%", width: "100%", ...S2, flexDirection: u2, display: "flex" }, { className: me2, style: fe2, onPointerDown: ge2, ...ye2 } = D2, Le2 = B((e2) => {
487
- const t2 = Se(e2, null === d2);
488
- H2(t2);
489
- }, [d2]), Ee2 = B((e2) => {
481
+ if (t2 || (t2 = { percent: null === o2.fixedPaneOffset ? 50 : null, pixels: null === o2.fixedPaneOffset ? null : 0 }), 0 === e2) return null != t2?.pixels ? 1 !== o2.fixedPaneOffset ? (i3[0] = t2?.pixels, r2[1] = 100) : (i3[1] = t2?.pixels - n3, r2[0] = 100) : null != t2?.percent && (1 !== o2.fixedPaneOffset ? (r2[0] = t2?.percent, r2[1] = 100 - t2?.percent) : (r2[1] = t2?.percent, r2[0] = 100 - t2?.percent)), { percents: r2, pixels: i3, minBefore: bt(o2.minBefore, true), maxBefore: bt(o2.maxBefore, true), minAfter: bt(o2.minAfter), maxAfter: bt(o2.maxAfter) };
482
+ let s3 = wt(t2, e2, 1 !== o2.fixedPaneOffset), l3 = e2 - n3, a2 = wt(o2.minBefore, l3, true) ?? 0, c2 = wt(o2.maxBefore, l3, true) ?? l3, h2 = 0, u3 = 0, d3 = 0, p3 = l3;
483
+ h2 = (wt(o2.maxAfter, e2, false) ?? n3) - n3, u3 = wt(o2.minAfter, e2, false) ?? e2, d3 = Math.max(a2, h2), p3 = Math.min(c2, u3), s3 = Math.max(d3, Math.min(s3, p3)), u3 = Math.min(l3 - s3, wt(o2.maxAfter, l3 - s3, true) ?? l3), h2 = Math.min(l3 - s3, wt(o2.minAfter, l3 - s3, true) ?? l3), i3[0] = s3, i3[1] = l3 - i3[0];
484
+ const f3 = Math.max(0, Math.min(100, s3 / l3 * 100));
485
+ return r2[0] = f3, r2[1] = 100 - r2[0], { percents: r2, pixels: i3, minBefore: `${a2}px`, minAfter: `${h2}px`, maxBefore: `${i3[0]}px`, maxAfter: `${i3[1]}px` };
486
+ })(V2, X2, Y2, O2), [O2, V2, X2, Y2, u2]), [Z2, q2] = a(false), G2 = B(E2, [E2]), J2 = B(T2, [T2]), Q2 = B(M2, [M2]), tt2 = r(null), et2 = r(null), nt2 = r(null), { style: it2, className: rt2, ...st2 } = D2, lt2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", display: "flex", overflow: "hidden", ...it2 }, { className: at2, style: ct2, ...ht2 } = P2, { className: ut2, style: dt2, ...pt2 } = A2, ft2 = { flex: "1 1 100%", width: "100%", ...S2, flexDirection: u2, display: "flex" }, { className: _t2, style: mt2, onPointerDown: gt2, ...yt2 } = k2, Lt2 = B((t2) => {
487
+ const e2 = St(t2, null === d2);
488
+ N2(e2);
489
+ }, [d2]), Et2 = B((t2) => {
490
490
  if (L2 || !Z2) return;
491
- const t2 = Me2.current?.getBoundingClientRect();
491
+ const e2 = Mt2.current?.getBoundingClientRect();
492
492
  let n3 = 0;
493
- n3 = "row" === u2 ? (e2.clientX ?? e2.touches?.[0]?.clientX) - t2.x : (e2.clientY ?? e2.touches?.[0]?.clientY) - t2.y, n3 = Math.max(0, Math.min(j2, n3)), 1 === O2.fixedPaneOffset && (n3 = j2 - n3), _2 && V2.pixels === n3 || H2({ pixels: n3, percent: null }), J2?.(n3), e2.stopPropagation(), e2.preventDefault();
494
- }, [O2, u2, L2, Z2, V2, j2]), Ce2 = B((e2) => {
495
- if (document.removeEventListener("pointermove", Ee2), document.removeEventListener("touchmove", Ee2), document.removeEventListener("pointerup", Ce2), !Z2) return;
496
- if (G2(false), !V2) return;
493
+ n3 = "row" === u2 ? (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 === O2.fixedPaneOffset && (n3 = X2 - n3), p2 && V2.pixels === n3 || N2({ pixels: n3, percent: null }), J2?.(n3), t2.stopPropagation(), t2.preventDefault();
494
+ }, [O2, u2, L2, Z2, V2, X2]), Ct2 = B((t2) => {
495
+ if (document.removeEventListener("pointermove", Et2), document.removeEventListener("touchmove", Et2), document.removeEventListener("pointerup", Ct2), !Z2) return;
496
+ if (q2(false), !V2) return;
497
497
  Q2(V2.pixels);
498
- if (!Se(_2, null === d2) || V2.pixels !== _2) {
499
- const e3 = { ...V2 };
500
- null === e3.percent && (e3.percent = e3.pixels / j2 * 100), K2(e3);
498
+ if (!St(p2, null === d2) || V2.pixels !== p2) {
499
+ const t3 = { ...V2 };
500
+ null === t3.percent && (t3.percent = t3.pixels / X2 * 100), K2(t3);
501
+ }
502
+ t2.stopPropagation(), t2.preventDefault();
503
+ }, [V2, Z2, p2, d2, X2]), Tt2 = B((t2) => {
504
+ gt2?.(t2), t2.defaultPrevented || L2 || Z2 || (q2(true), G2(), document.addEventListener("pointermove", Et2, { passive: false }), document.addEventListener("touchmove", Et2, { passive: false }), document.addEventListener("pointerup", Ct2, { passive: false }));
505
+ }, [gt2]), Mt2 = ot(i2, () => ({ setPosition: Lt2, isSplitPane: () => true }), []), kt2 = h(() => $2 ? z2?.({ key: "resizer", ref: C([R2, et2]), className: g("resizer", _t2), onPointerDownCapture: Tt2, style: { cursor: L2 ? void 0 : "row" === u2 ? "ew-resize" : "ns-resize", minWidth: "row" === u2 ? "2px" : void 0, minHeight: "row" !== u2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...mt2 }, splitDirection: u2, disabled: L2, ...yt2 }) : null, [$2, _t2, yt2, u2, mt2, L2]), Dt2 = "row" === u2 ? "Width" : "Height", Pt2 = { ...lt2, ...ct2, flex: 0 === O2.fixedPaneOffset && null !== U2?.pixels[0] ? `0 0 ${Math.round(U2?.pixels[0])}px` : `1 1 ${Math.round(U2?.percents[0] ?? 100)}%`, [`min${Dt2}`]: U2?.minBefore, [`max${Dt2}`]: l2 ? U2?.maxBefore : "100%" }, At2 = { ...lt2, ...dt2, flex: 1 === O2.fixedPaneOffset && null !== U2?.pixels[1] ? `0 0 ${Math.round(U2?.pixels[1])}px` : `1 1 ${Math.round(U2?.percents[1] ?? 100)}%`, [`min${Dt2}`]: U2?.minAfter, [`max${Dt2}`]: s2 ? U2?.maxAfter : "100%" }, zt2 = h(() => s2 ? t("div", { ref: tt2, className: g("before", rt2, at2), style: Pt2, ...st2, ...ht2, children: s2 }, "before") : null, [s2, D2, P2, O2, U2]), Bt2 = h(() => l2 ? t("div", { ref: nt2, className: g("after", rt2, ut2), style: At2, ...st2, ...pt2, children: l2 }, "after") : null, [l2, D2, A2, O2, U2]);
506
+ return e("div", { ref: C([H2, Mt2]), className: g("splitPane", "row" === u2 ? "vertical" : "horizontal", { dragging: Z2 }, b2), style: ft2, children: [zt2, kt2, Bt2] });
507
+ }));
508
+ function Et(t2) {
509
+ if ("function" == typeof t2) return t2;
510
+ if ("string" == typeof t2) {
511
+ const e2 = t2.trim();
512
+ if (e2.startsWith("data:image/svg+xml")) {
513
+ const t3 = (function(t4) {
514
+ const e3 = /^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(t4.trim());
515
+ if (!e3) return null;
516
+ const n2 = e3[1] || "", o2 = e3[2] || "";
517
+ try {
518
+ if (/;base64/i.test(n2)) {
519
+ if ("undefined" != typeof atob) {
520
+ const t5 = atob(o2);
521
+ if ("undefined" != typeof TextDecoder) {
522
+ const e5 = new Uint8Array(t5.length);
523
+ for (let n3 = 0; n3 < t5.length; n3++) e5[n3] = t5.charCodeAt(n3);
524
+ return new TextDecoder("utf-8").decode(e5);
525
+ }
526
+ let e4 = "";
527
+ for (let n3 = 0; n3 < t5.length; n3++) {
528
+ e4 += `%${t5.charCodeAt(n3).toString(16).padStart(2, "0")}`;
529
+ }
530
+ return decodeURIComponent(e4);
531
+ }
532
+ return (globalThis.Buffer ? globalThis.Buffer.from(o2, "base64") : require("buffer").Buffer.from(o2, "base64")).toString("utf-8");
533
+ }
534
+ try {
535
+ return decodeURIComponent(o2);
536
+ } catch {
537
+ return o2;
538
+ }
539
+ } catch {
540
+ return null;
541
+ }
542
+ })(e2);
543
+ if (t3) return Mt(t3);
544
+ }
545
+ if (e2.startsWith("<")) {
546
+ if (/^<\s*svg\b/i.test(e2)) return Mt(e2);
547
+ if (/^<\s*path\b/i.test(e2)) {
548
+ const t3 = Ct(e2);
549
+ if (t3) return { paths: [{ d: t3 }] };
550
+ }
551
+ return { paths: [{ d: e2 }] };
552
+ }
553
+ return { paths: [{ d: e2 }] };
554
+ }
555
+ if (Array.isArray(t2)) {
556
+ const e2 = [];
557
+ for (const n2 of t2) if ("string" == typeof n2) {
558
+ const t3 = String(n2).trim();
559
+ if (t3.startsWith("<path")) {
560
+ const n3 = Ct(t3);
561
+ n3 && e2.push({ d: n3 });
562
+ } else e2.push({ d: t3 });
563
+ } else n2 && "object" == typeof n2 && "d" in n2 && "string" == typeof n2.d && e2.push({ ...n2 });
564
+ return { paths: e2 };
565
+ }
566
+ return t2;
567
+ }
568
+ function Ct(t2) {
569
+ const e2 = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(t2);
570
+ return e2 ? e2[1] ?? e2[2] ?? null : null;
571
+ }
572
+ function Tt(t2) {
573
+ if ("svg" in t2) return { ...t2, svg: Et(t2.svg) };
574
+ if ("url" in t2) {
575
+ const e2 = "string" == typeof t2.url ? { src: t2.url } : t2.url;
576
+ return { ...t2, url: e2 };
577
+ }
578
+ if ("emoji" in t2) {
579
+ const e2 = "string" == typeof t2.emoji ? t2.emoji : t2.emoji.text;
580
+ return { ...t2, emoji: e2 };
581
+ }
582
+ return t2;
583
+ }
584
+ function Mt(t2) {
585
+ try {
586
+ if ("undefined" != typeof DOMParser) {
587
+ const e3 = new DOMParser().parseFromString(t2, "image/svg+xml"), n3 = e3.querySelector("svg"), o3 = n3?.getAttribute("viewBox") ?? void 0, i3 = [];
588
+ return e3.querySelectorAll("path").forEach((t3) => {
589
+ const e4 = t3.getAttribute("d");
590
+ if (!e4) return;
591
+ const n4 = { d: e4 }, o4 = t3.getAttribute("class");
592
+ o4 && (n4.className = o4);
593
+ const r3 = t3.getAttribute("fill");
594
+ r3 && "none" !== r3 && (n4.fill = r3);
595
+ const s2 = t3.getAttribute("stroke");
596
+ s2 && (n4.stroke = s2);
597
+ const l2 = t3.getAttribute("opacity");
598
+ l2 && (n4.opacity = Number(l2));
599
+ const a2 = t3.getAttribute("fill-rule");
600
+ a2 && (n4.fillRule = a2);
601
+ const c2 = t3.getAttribute("clip-rule");
602
+ c2 && (n4.clipRule = c2), i3.push(n4);
603
+ }), { viewBox: o3, paths: i3 };
604
+ }
605
+ } catch {
606
+ }
607
+ const e2 = t2.match(/viewBox="([^"]+)"/i), n2 = e2 ? e2[1] : void 0, o2 = [], i2 = /<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;
608
+ let r2;
609
+ for (; r2 = i2.exec(t2); ) o2.push({ d: r2[1] });
610
+ return { viewBox: n2, paths: o2 };
611
+ }
612
+ function kt(t2) {
613
+ const e2 = {};
614
+ for (const [n3, o3] of Object.entries(t2.icons)) e2[n3] = Tt(o3);
615
+ const n2 = { label: t2.meta?.label ?? "Unnamed", version: t2.meta?.version ?? "1.0.0", license: t2.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: t2.meta?.extends ?? [] };
616
+ n2.extends.includes("base") || n2.extends.push("base");
617
+ const o2 = { meta: n2, icons: e2 }, i2 = t2.overrides;
618
+ if (i2) {
619
+ const t3 = {};
620
+ for (const [e3, n3] of Object.entries(i2)) {
621
+ const o3 = {};
622
+ for (const [t4, e4] of Object.entries(n3)) o3[t4] = Tt(e4);
623
+ t3[e3] = o3;
624
+ }
625
+ o2.__overrides = t3;
626
+ }
627
+ return o2;
628
+ }
629
+ function Dt() {
630
+ const t2 = /* @__PURE__ */ new Map(), e2 = /* @__PURE__ */ new Map();
631
+ let n2 = "base", o2 = /* @__PURE__ */ new Map();
632
+ async function i2(e3) {
633
+ const o3 = t2.get(e3 ?? n2);
634
+ if (!o3) throw new Error(`Icon pack not registered: ${e3}`);
635
+ if (!o3.pack) {
636
+ if (!o3.loading) {
637
+ if (!o3.loader) throw new Error(`No loader for icon pack: ${e3}`);
638
+ o3.loading = o3.loader().then((t3) => {
639
+ const e4 = t3 && "object" == typeof t3 && "default" in t3 ? t3.default : t3;
640
+ o3.pack = kt(e4);
641
+ }).catch((t3) => {
642
+ throw o3.loading = void 0, t3;
643
+ });
644
+ }
645
+ await o3.loading;
646
+ }
647
+ }
648
+ function r2(t3) {
649
+ const e3 = t3.indexOf(":");
650
+ return e3 > 0 ? { ns: t3.slice(0, e3), key: t3.slice(e3 + 1) } : { key: t3 };
651
+ }
652
+ function s2(n3, o3) {
653
+ const i3 = [n3, ...t2.get(n3)?.pack?.meta.extends ?? []];
654
+ for (const n4 of i3) {
655
+ const i4 = t2.get(n4);
656
+ if (!i4?.pack) continue;
657
+ const { icons: r3 } = i4.pack, s3 = r3[e2.get(n4)?.get(o3) ?? o3] ?? r3[o3];
658
+ if (s3) return { glyph: s3, pack: i4.pack, packKey: n4 };
659
+ }
660
+ return null;
661
+ }
662
+ function l2(e3, o3) {
663
+ const i3 = o3?.packKey ?? n2;
664
+ if (o3?.packKey) return s2(o3.packKey, e3);
665
+ if (!e3) return null;
666
+ const { ns: l3, key: a2 } = r2(e3);
667
+ if (l3) {
668
+ const e4 = t2.get(l3)?.pack;
669
+ if (e4) {
670
+ if (!!t2.get(n2)?.pack) {
671
+ const t3 = e4.__overrides, o5 = t3?.[n2]?.[a2];
672
+ if (o5) return { glyph: o5, pack: e4, packKey: l3 };
673
+ }
674
+ const o4 = s2(l3, a2);
675
+ if (o4) return o4;
676
+ }
677
+ return null;
678
+ }
679
+ return s2(i3, e3);
680
+ }
681
+ return { register: function(e3, o3) {
682
+ const i3 = t2.get(e3) ?? {};
683
+ "function" == typeof o3 ? i3.loader = o3 : i3.pack = kt(o3), t2.set(e3, i3), n2 || (n2 = e3);
684
+ }, prefetch: async function(t3 = n2) {
685
+ const e3 = Array.isArray(t3) ? t3 : [t3];
686
+ await Promise.all(e3.map(i2));
687
+ }, setActive: function(t3) {
688
+ n2 = t3;
689
+ for (const e3 of o2.keys()) try {
690
+ e3(t3);
691
+ } catch (t4) {
692
+ }
693
+ }, getActive: function() {
694
+ return n2;
695
+ }, resolve: async function(e3, o3) {
696
+ let s3 = l2(e3, o3);
697
+ if (s3) return s3;
698
+ const a2 = o3?.packKey ?? n2, { ns: c2 } = r2(e3);
699
+ if (o3?.packKey) {
700
+ if (await i2(a2), s3 = l2(e3, o3), s3) return s3;
701
+ const n3 = t2.get(a2)?.pack?.meta?.extends ?? [];
702
+ if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(e3, o3), s3)) return s3;
703
+ } else if (c2) {
704
+ if (await i2(c2), s3 = l2(e3, o3), s3) return s3;
705
+ const n3 = t2.get(c2)?.pack?.meta?.extends ?? [];
706
+ if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(e3, o3), s3)) return s3;
707
+ } else {
708
+ if (await i2(a2), s3 = l2(e3, o3), s3) return s3;
709
+ const n3 = t2.get(a2)?.pack?.meta?.extends ?? [];
710
+ if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(e3, o3), s3)) return s3;
711
+ }
712
+ return null;
713
+ }, registerAlias: function(t3, n3, o3) {
714
+ e2.has(t3) || e2.set(t3, /* @__PURE__ */ new Map()), e2.get(t3).set(n3, o3);
715
+ }, has: function(t3, e3) {
716
+ return !!l2(t3, e3);
717
+ }, getPack: function(e3) {
718
+ return t2.get(e3 ?? n2)?.pack;
719
+ }, hasPack: function(e3) {
720
+ return !!t2.get(e3)?.pack;
721
+ }, listPacks: function() {
722
+ return Array.from(t2.keys());
723
+ }, listIcons: function(e3) {
724
+ const n3 = t2.get(e3)?.pack;
725
+ return n3 ? Object.keys(n3.icons) : [];
726
+ }, addActiveListener: function(t3) {
727
+ const e3 = o2.get(t3);
728
+ if (e3) return e3;
729
+ const n3 = () => {
730
+ o2.delete(t3);
731
+ };
732
+ return o2.set(t3, n3), n3;
733
+ } };
734
+ }
735
+ const Pt = Dt();
736
+ Pt.register("base", () => import("./iqYVEUkNtlVZ_Hro.mjs"));
737
+ const At = (e2) => t("svg", { ...e2, children: t("path", {}) }), zt = { Icon: "_Icon_1ipwo_10" }, Bt = s((e2) => {
738
+ const { iconKey: n2, packKey: i2, className: r2, style: s2, role: l2, title: a2, size: c2, ariaHidden: u2, sourceProps: d2, children: p2, ...f2 } = e2, [_2, m2] = o.useState(null);
739
+ o.useEffect(() => {
740
+ let t2 = true, e3 = i2, o2 = n2;
741
+ if (!o2) {
742
+ const t3 = Pt.getPack(e3);
743
+ return void m2({ glyph: t3 ? { svg: v.EmptyArray } : void 0, pack: t3 ?? void 0, packKey: e3 ?? Pt.getActive() });
744
+ }
745
+ if (o2.includes(":")) {
746
+ const [t3, n3] = o2.split(":");
747
+ e3 = t3, o2 = n3;
501
748
  }
502
- e2.stopPropagation(), e2.preventDefault();
503
- }, [V2, Z2, _2, d2, j2]), Te2 = B((e2) => {
504
- ge2?.(e2), e2.defaultPrevented || L2 || Z2 || (G2(true), q2(), document.addEventListener("pointermove", Ee2, { passive: false }), document.addEventListener("touchmove", Ee2, { passive: false }), document.addEventListener("pointerup", Ce2, { passive: false }));
505
- }, [ge2]), Me2 = oe(i2, () => ({ setPosition: Le2, isSplitPane: () => true }), []), De2 = h(() => $2 ? A2?.({ key: "resizer", ref: C([F2, te2]), className: g("resizer", me2), onPointerDownCapture: Te2, style: { cursor: L2 ? void 0 : "row" === u2 ? "ew-resize" : "ns-resize", minWidth: "row" === u2 ? "2px" : void 0, minHeight: "row" !== u2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...fe2 }, splitDirection: u2, disabled: L2, ...ye2 }) : null, [$2, me2, ye2, u2, fe2, L2]), Pe2 = "row" === u2 ? "Width" : "Height", ze2 = { ...le2, ...ce2, flex: 0 === O2.fixedPaneOffset && null !== U2?.pixels[0] ? `0 0 ${Math.round(U2?.pixels[0])}px` : `1 1 ${Math.round(U2?.percents[0] ?? 100)}%`, [`min${Pe2}`]: U2?.minBefore, [`max${Pe2}`]: l2 ? U2?.maxBefore : "100%" }, ke2 = { ...le2, ...de2, flex: 1 === O2.fixedPaneOffset && null !== U2?.pixels[1] ? `0 0 ${Math.round(U2?.pixels[1])}px` : `1 1 ${Math.round(U2?.percents[1] ?? 100)}%`, [`min${Pe2}`]: U2?.minAfter, [`max${Pe2}`]: s2 ? U2?.maxAfter : "100%" }, Ae2 = h(() => s2 ? e("div", { ref: ee2, className: g("before", re2, ae2), style: ze2, ...se2, ...he2, children: s2 }, "before") : null, [s2, P2, z2, O2, U2]), Be2 = h(() => l2 ? e("div", { ref: ne2, className: g("after", re2, ue2), style: ke2, ...se2, ..._e2, children: l2 }, "after") : null, [l2, P2, k2, O2, U2]);
506
- return t("div", { ref: C([W2, Me2]), className: g("splitPane", "row" === u2 ? "vertical" : "horizontal", { dragging: Z2 }, b2), style: pe2, children: [Ae2, De2, Be2] });
507
- })), Ee = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
508
- class Ce extends x {
509
- setDelegate(e2) {
510
- super.setDelegate(e2);
749
+ return Pt.resolve(o2, { packKey: e3 }).then((e4) => {
750
+ t2 && m2(e4);
751
+ }), () => {
752
+ t2 = false;
753
+ };
754
+ }, [n2, i2]);
755
+ const g2 = _2?.pack, y2 = _2?.glyph, x2 = _2?.packKey;
756
+ let w2 = y2 ? y2.svg : void 0;
757
+ const b2 = y2 && !w2 ? y2.url : void 0, S2 = !y2 || w2 || b2 ? void 0 : y2.emoji, L2 = null != c2 ? "number" == typeof c2 ? `${c2}px` : c2 : void 0, E2 = h(() => [zt.Icon, "icon", r2].filter(Boolean).join(" "), [r2]), C2 = h(() => {
758
+ const t2 = { ...s2 };
759
+ return t2["--icon-size"] = L2, t2;
760
+ }, [s2, L2]), T2 = l2 ?? (a2 ? "img" : "presentation"), M2 = u2 ?? (!a2 || void 0), k2 = (e3) => t("span", { className: E2, style: C2, role: T2, "aria-hidden": M2, title: a2, "data-icon-glyph": n2, "data-icon-pack": x2, ...f2, children: e3 });
761
+ if (p2) return k2(p2);
762
+ if (S2) return k2(t("span", { children: "string" == typeof S2 ? S2 : S2.text }));
763
+ if (b2) return k2(t("img", { src: b2.src, alt: a2 ?? "" }));
764
+ if (y2 && "react" in y2) {
765
+ const e3 = y2.react, n3 = { className: E2, style: C2, role: T2, "aria-hidden": M2, title: a2, ...f2, ...d2 };
766
+ return k2(t(e3, { ...n3 }));
767
+ }
768
+ const D2 = { viewBox: w2?.viewBox ?? g2?.meta.defaultViewBox ?? "0 0 24 24" };
769
+ if ("function" == typeof w2) {
770
+ return k2(w2(D2) ?? t(At, { ...D2 }));
771
+ }
772
+ if (!w2) return k2(t(At, { ...D2 }));
773
+ const P2 = w2.paths;
774
+ return k2(t("svg", { ...D2, children: P2 ? P2.map((e3, n3) => t("path", { d: e3.d, className: e3.className, fill: e3.fill, stroke: e3.stroke, opacity: e3.opacity, fillRule: e3.fillRule, clipRule: e3.clipRule }, n3)) : null }));
775
+ });
776
+ function $t(e2) {
777
+ const { isWalking: n2 = false, themedType: o2 = "info", speed: i2 = 120, dashGap: r2 = 3, dashLength: s2 = 5, iconKey: l2, packKey: a2, style: c2, className: u2, ...d2 } = e2, p2 = h(() => {
778
+ if (!n2) return;
779
+ const t2 = { "--walk-duration": `${i2 * (r2 + s2)}ms`, "--walk-dash-length": `${s2}px`, "--walk-dash-gap": `${r2}px` };
780
+ return o2 && "accent" !== o2 && (t2["--icon-accent"] = `var(--icon-${o2})`), t2;
781
+ }, [n2, i2, r2, s2, o2]), f2 = h(() => n2 ? u2 + " walking" : u2, [n2, u2]);
782
+ return t(Bt, { iconKey: l2, packKey: a2, className: f2, style: { ...c2, ...p2 }, ...d2 });
783
+ }
784
+ const Ot = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
785
+ class Kt extends x {
786
+ setOverrides(t2) {
787
+ super.setOverrides(t2);
511
788
  }
512
789
  getDelegate() {
513
- return this._delegate;
790
+ return this._overrides;
514
791
  }
515
- showMessage(e2, t2) {
792
+ showMessage(t2, e2) {
516
793
  const n2 = this.getDelegate();
517
- if (n2?.showMessage) return n2.showMessage(e2, t2);
518
- t2?.type !== Ee.Warning ? t2?.type !== Ee.Error ? w.log(e2) : w.error(e2) : w.warn(e2);
794
+ if (n2?.showMessage) return n2.showMessage(t2, e2);
795
+ e2?.type !== Ot.Warning ? e2?.type !== Ot.Error ? w.log(t2) : w.error(t2) : w.warn(t2);
519
796
  }
520
- showBusy(e2, t2) {
797
+ showBusy(t2, e2) {
521
798
  const n2 = this.getDelegate();
522
- return n2?.showBusy ? n2.showBusy(e2, t2) : new Promise((e3) => {
523
- e3(() => {
799
+ return n2?.showBusy ? n2.showBusy(t2, e2) : new Promise((t3) => {
800
+ t3(() => {
524
801
  });
525
802
  });
526
803
  }
527
- showWindow(e2, t2, n2) {
804
+ showWindow(t2, e2, n2) {
528
805
  const o2 = this.getDelegate();
529
- if (o2?.showWindow) return o2.showWindow(e2, t2, n2);
806
+ if (o2?.showWindow) return o2.showWindow(t2, e2, n2);
530
807
  }
531
- showError(e2) {
532
- const t2 = this.getDelegate();
533
- t2?.showError ? t2.showError(e2) : w.error(e2);
808
+ showError(t2) {
809
+ const e2 = this.getDelegate();
810
+ e2?.showError ? e2.showError(t2) : w.error(t2);
534
811
  }
535
- showOptions(e2) {
536
- const t2 = this.getDelegate();
537
- return t2?.showOptions ? t2.showOptions(e2) : Promise.resolve("");
812
+ showOptions(t2) {
813
+ const e2 = this.getDelegate();
814
+ return e2?.showOptions ? e2.showOptions(t2) : Promise.resolve("");
538
815
  }
539
- showInputOptions(e2) {
540
- const t2 = this.getDelegate();
541
- return t2?.showInputOptions ? t2.showInputOptions(e2) : Promise.resolve({ input: "", option: "" });
816
+ showInputOptions(t2) {
817
+ const e2 = this.getDelegate();
818
+ return e2?.showInputOptions ? e2.showInputOptions(t2) : Promise.resolve({ input: "", option: "" });
542
819
  }
543
820
  }
544
- const Te = _(new Ce()), Me = ({ children: e2, notifier: t2 }) => (o.useEffect(() => {
545
- const e3 = w.getDelegate();
546
- return w.setDelegate(t2), () => {
547
- w.setDelegate(e3);
821
+ const Vt = p(new Kt()), Nt = ({ children: t2, notifier: e2 }) => (o.useEffect(() => {
822
+ const t3 = w.getOverrides();
823
+ return w.setOverrides(e2), () => {
824
+ w.setOverrides(t3);
548
825
  };
549
- }, [t2]), o.createElement(Te.Provider, { value: t2 }, e2)), De = () => p(Te);
550
- function Pe(e2) {
551
- const [t2, n2] = a("undefined" != typeof window ? window.devicePixelRatio : 1), o2 = r(null);
826
+ }, [e2]), o.createElement(Vt.Provider, { value: e2 }, t2)), Ht = () => f(Vt);
827
+ function Wt(t2) {
828
+ const [e2, n2] = a("undefined" != typeof window ? window.devicePixelRatio : 1), o2 = r(null);
552
829
  return c(() => {
553
830
  if (!("undefined" != typeof window && "matchMedia" in window)) return;
554
- const e3 = () => {
555
- const t3 = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
556
- t3.addEventListener("change", e3, { once: true, passive: true }), n2(window.devicePixelRatio), o2.current = { mediaMatcher: t3, listener: e3 };
831
+ const t3 = () => {
832
+ const e3 = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
833
+ e3.addEventListener("change", t3, { once: true, passive: true }), n2(window.devicePixelRatio), o2.current = { mediaMatcher: e3, listener: t3 };
557
834
  };
558
- return e3(), () => {
835
+ return t3(), () => {
559
836
  o2.current && o2.current.mediaMatcher.removeEventListener("change", o2.current.listener);
560
837
  };
561
- }, [e2]), t2;
838
+ }, [t2]), e2;
562
839
  }
563
- function ze(e2) {
840
+ function It(t2) {
564
841
  if ("undefined" == typeof window) return 1;
565
- const { defaultDpr: t2 = 1, maxDpr: n2 = 3, round: o2 = true } = e2 || {}, i2 = "undefined" != typeof window && "number" == typeof window.devicePixelRatio ? window.devicePixelRatio : t2;
842
+ const { defaultDpr: e2 = 1, maxDpr: n2 = 3, round: o2 = true } = t2 || {}, i2 = "undefined" != typeof window && "number" == typeof window.devicePixelRatio ? window.devicePixelRatio : e2;
566
843
  return Math.min(Math.max(1, o2 ? Math.floor(i2) : i2), n2);
567
844
  }
568
- function ke(e2, t2, n2) {
569
- const o2 = B(t2, [t2]);
845
+ function Rt(t2, e2, n2) {
846
+ const o2 = B(e2, [e2]);
570
847
  c(() => {
571
- const t3 = (t4) => {
572
- e2.current && !e2.current.contains(t4.target) && o2(t4);
848
+ const e3 = (e4) => {
849
+ t2.current && !t2.current.contains(e4.target) && o2(e4);
573
850
  };
574
- return n2 && false === n2.mouseEvents || (document.addEventListener("mousedown", t3), document.addEventListener("touchstart", t3)), n2 && false === n2.focusEvents || document.addEventListener("focus", t3), () => {
575
- document.removeEventListener("mousedown", t3), document.removeEventListener("touchstart", t3), document.removeEventListener("focus", t3);
851
+ return n2 && false === n2.mouseEvents || (document.addEventListener("mousedown", e3), document.addEventListener("touchstart", e3)), n2 && false === n2.focusEvents || document.addEventListener("focus", e3), () => {
852
+ document.removeEventListener("mousedown", e3), document.removeEventListener("touchstart", e3), document.removeEventListener("focus", e3);
576
853
  };
577
- }, [e2]);
854
+ }, [t2]);
578
855
  }
579
- function Ae(e2) {
580
- if (!e2) throw new Error("must have a PointerHandlerOptions");
581
- const { onPointerDown: t2, onPointerUp: n2, onPointerMoveOrWait: o2, processTouch: s2 = false, consumeTouch: l2 = true } = e2, a2 = B(t2, [t2]), h2 = B(n2, [n2]), u2 = B(o2, [o2]), d2 = r(false), _2 = e2?.timerInitial ?? 230, p2 = e2?.timerContinuous ?? _2 / 2, m2 = r(null), f2 = r(null), g2 = r(null), y2 = r(null), v2 = i(() => {
856
+ function jt(t2) {
857
+ if (!t2) throw new Error("must have a PointerHandlerOptions");
858
+ const { onPointerDown: e2, onPointerUp: n2, onPointerMoveOrWait: o2, processTouch: s2 = false, consumeTouch: l2 = true } = t2, a2 = B(e2, [e2]), h2 = B(n2, [n2]), u2 = B(o2, [o2]), d2 = r(false), p2 = t2?.timerInitial ?? 230, f2 = t2?.timerContinuous ?? p2 / 2, _2 = r(null), m2 = r(null), g2 = r(null), y2 = r(null), v2 = i(() => {
582
859
  y2.current && (clearTimeout(y2.current), y2.current = null);
583
- }, []), x2 = i((e3) => {
860
+ }, []), x2 = i((t3) => {
584
861
  y2.current = setTimeout(() => {
585
862
  window.requestAnimationFrame(() => {
586
- false !== d2.current && u2?.(f2.current, g2.current, m2.current);
587
- }), x2(p2);
588
- }, e3 ?? _2);
863
+ false !== d2.current && u2?.(m2.current, g2.current, _2.current);
864
+ }), x2(f2);
865
+ }, t3 ?? p2);
589
866
  }, []);
590
867
  c(() => () => v2(), []);
591
- const w2 = s2 ? "pointer" : "mouse", b2 = i((e3) => {
592
- e3.stopPropagation(), e3.stopImmediatePropagation(), e3.preventDefault();
593
- }, []), S2 = B((e3) => {
868
+ const w2 = s2 ? "pointer" : "mouse", b2 = i((t3) => {
869
+ t3.stopPropagation(), t3.stopImmediatePropagation(), t3.preventDefault();
870
+ }, []), S2 = B((t3) => {
594
871
  document.removeEventListener(`${w2}move`, C2), document.removeEventListener(`${w2}up`, S2), document.removeEventListener("keydown", T2), document.removeEventListener("keyup", M2), document.removeEventListener("touchstart", b2, { capture: true }), document.removeEventListener("touchmove", b2, { capture: true }), window.removeEventListener("blur", L2), v2(), window.requestAnimationFrame(() => {
595
- false !== d2.current && (d2.current = false, h2?.(e3, g2.current, m2.current), g2.current = null);
872
+ false !== d2.current && (d2.current = false, h2?.(t3, g2.current, _2.current), g2.current = null);
596
873
  });
597
874
  }, []), L2 = i(() => {
598
- false !== d2.current && (d2.current = false, S2(f2.current));
875
+ false !== d2.current && (d2.current = false, S2(m2.current));
599
876
  }, []), E2 = B(() => {
600
- v2(), x2(p2), window.requestAnimationFrame(() => {
601
- false !== d2.current && u2?.(f2.current, g2.current, m2.current);
877
+ v2(), x2(f2), window.requestAnimationFrame(() => {
878
+ false !== d2.current && u2?.(m2.current, g2.current, _2.current);
602
879
  });
603
- }, [p2]), C2 = B((e3) => {
604
- f2.current = e3, E2();
605
- }, []), T2 = B((e3) => {
606
- g2.current = { ctrlKey: e3.ctrlKey, shiftKey: e3.shiftKey, altKey: e3.altKey, metaKey: e3.metaKey }, E2();
607
- }, []), M2 = B((e3) => {
608
- g2.current = { ctrlKey: e3.ctrlKey, shiftKey: e3.shiftKey, altKey: e3.altKey, metaKey: e3.metaKey }, E2();
609
- }, [p2]);
610
- return B((e3) => {
611
- if (e3.isDefaultPrevented()) return;
612
- g2.current = { ctrlKey: e3.ctrlKey, shiftKey: e3.shiftKey, altKey: e3.altKey, metaKey: e3.metaKey };
613
- false !== a2(e3, g2.current) && (m2.current = e3, f2.current = e3.nativeEvent, document.addEventListener(`${w2}up`, S2, { passive: false }), document.addEventListener(`${w2}move`, C2, { passive: false }), document.addEventListener("keydown", T2, { passive: false }), document.addEventListener("keyup", M2, { passive: false }), window.addEventListener("blur", L2, { passive: true }), s2 && l2 && (document.addEventListener("touchstart", b2, { passive: false, capture: true }), document.addEventListener("touchmove", b2, { passive: false, capture: true })), d2.current = true, x2(_2));
614
- }, [_2, s2]);
880
+ }, [f2]), C2 = B((t3) => {
881
+ m2.current = t3, E2();
882
+ }, []), T2 = B((t3) => {
883
+ g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey }, E2();
884
+ }, []), M2 = B((t3) => {
885
+ g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey }, E2();
886
+ }, [f2]);
887
+ return B((t3) => {
888
+ if (t3.isDefaultPrevented()) return;
889
+ g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey };
890
+ false !== a2(t3, g2.current) && (_2.current = t3, m2.current = t3.nativeEvent, document.addEventListener(`${w2}up`, S2, { passive: false }), document.addEventListener(`${w2}move`, C2, { passive: false }), document.addEventListener("keydown", T2, { passive: false }), document.addEventListener("keyup", M2, { passive: false }), window.addEventListener("blur", L2, { passive: true }), s2 && l2 && (document.addEventListener("touchstart", b2, { passive: false, capture: true }), document.addEventListener("touchmove", b2, { passive: false, capture: true })), d2.current = true, x2(p2));
891
+ }, [p2, s2]);
615
892
  }
616
- function Be(e2, t2) {
617
- return Ae({ onPointerDown: e2, onPointerMoveOrWait: (t3, n2, o2) => {
618
- e2?.(o2);
619
- }, ...t2 });
893
+ function Ft(t2, e2) {
894
+ return jt({ onPointerDown: t2, onPointerMoveOrWait: (e3, n2, o2) => {
895
+ t2?.(o2);
896
+ }, ...e2 });
620
897
  }
621
- const $e = ({ initValue: e2, useHookBody: t2, applyStateChange: n2 }) => {
622
- const o2 = r(e2);
623
- if ("function" != typeof t2) throw new Error("function expected as hook body parameter. got " + typeof t2);
624
- const i2 = t2();
898
+ const Yt = ({ initValue: t2, useHookBody: e2, applyStateChange: n2 }) => {
899
+ const o2 = r(t2);
900
+ if ("function" != typeof e2) throw new Error("function expected as hook body parameter. got " + typeof e2);
901
+ const i2 = e2();
625
902
  return d(() => {
626
903
  o2.current !== i2 && (o2.current = i2, n2(i2));
627
904
  }, [n2, i2]), null;
628
- }, Oe = (e2) => {
629
- console && console.warn && console.warn(e2);
630
- }, Ke = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || void 0;
631
- let Ve = 1, He = false, We = false;
632
- const Ie = [], Ne = [], Fe = () => {
633
- Ne.forEach((e2) => e2());
634
- }, Re = ({ automaticContainerInternalUseOnly: t2 }) => {
905
+ }, Xt = (t2) => {
906
+ console && console.warn && console.warn(t2);
907
+ }, Ut = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || void 0;
908
+ let Zt = 1, qt = false, Gt = false;
909
+ const Jt = [], Qt = [], te = () => {
910
+ Qt.forEach((t2) => t2());
911
+ }, ee = ({ automaticContainerInternalUseOnly: e2 }) => {
635
912
  const [o2, i2] = a([]), s2 = r([]);
636
- return s2.current = o2, t2 || false !== He || (We = true), c(() => {
637
- let e2 = true;
913
+ return s2.current = o2, e2 || false !== qt || (Gt = true), c(() => {
914
+ let t2 = true;
638
915
  function n2() {
639
- if (e2) return Ne[0] !== n2 ? (t2 || true !== He || Oe("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void i2((e3) => [])) : void i2([...Ie]);
916
+ if (t2) return Qt[0] !== n2 ? (e2 || true !== qt || Xt("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void i2((t3) => [])) : void i2([...Jt]);
640
917
  }
641
- return Ne.push(n2), Fe(), () => {
642
- e2 = false, s2.current?.length > 0 && Oe("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Ne.splice(Ne.indexOf(n2), 1), Fe();
918
+ return Qt.push(n2), te(), () => {
919
+ t2 = false, s2.current?.length > 0 && Xt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Qt.splice(Qt.indexOf(n2), 1), te();
643
920
  };
644
- }, [t2]), e(n, { children: o2.map(({ hook: e2, key: t3 }) => m($e, { ...e2, key: t3 })) });
645
- }, Ye = (t2) => {
646
- const n2 = Ve++;
647
- return Ie.push({ hook: t2, key: n2 }), 0 === Ne.length && false === We && (He = true, ((t3) => {
648
- if (Ke.document && Ke.document.createElement) {
649
- const n3 = Ke.document.createElement("div");
650
- T(n3).render(e(t3, { automaticContainerInternalUseOnly: true }));
651
- } else Oe("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
652
- })(Re)), Fe(), () => {
653
- Ie.splice(Ie.findIndex((e2) => e2.key === n2), 1), Fe();
921
+ }, [e2]), t(n, { children: o2.map(({ hook: t2, key: e3 }) => _(Yt, { ...t2, key: e3 })) });
922
+ }, ne = (e2) => {
923
+ const n2 = Zt++;
924
+ return Jt.push({ hook: e2, key: n2 }), 0 === Qt.length && false === Gt && (qt = true, ((e3) => {
925
+ if (Ut.document && Ut.document.createElement) {
926
+ const n3 = Ut.document.createElement("div");
927
+ T(n3).render(t(e3, { automaticContainerInternalUseOnly: true }));
928
+ } else Xt("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
929
+ })(ee)), te(), () => {
930
+ Jt.splice(Jt.findIndex((t2) => t2.key === n2), 1), te();
654
931
  };
655
932
  };
656
- let Xe = null;
657
- Xe || (Xe = (e2, t2, n2 = {}) => {
933
+ let oe = null;
934
+ oe || (oe = (t2, e2, n2 = {}) => {
658
935
  let o2, i2, r2 = false, s2 = false, l2 = [], { unmountIfNoConsumers: h2 = false } = n2;
659
- const u2 = (e3) => {
660
- i2 = e3, M(() => l2.forEach((t3) => t3(e3)));
661
- }, d2 = () => (s2 || (i2 = "function" == typeof e2 ? e2() : e2, s2 = true), i2);
936
+ const u2 = (t3) => {
937
+ i2 = t3, M(() => l2.forEach((e3) => e3(t3)));
938
+ }, d2 = () => (s2 || (i2 = "function" == typeof t2 ? t2() : t2, s2 = true), i2);
662
939
  return () => {
663
940
  const [n3, s3] = a(d2);
664
- return c(() => (r2 || (r2 = true, o2 = Ye({ initValue: e2, useHookBody: t2, applyStateChange: u2 })), l2.push(s3), i2 !== n3 && s3(i2), () => {
941
+ return c(() => (r2 || (r2 = true, o2 = ne({ initValue: t2, useHookBody: e2, applyStateChange: u2 })), l2.push(s3), i2 !== n3 && s3(i2), () => {
665
942
  l2.splice(l2.indexOf(s3), 1), 0 === l2.length && h2 && (o2(), r2 = false);
666
943
  }), []), n3;
667
944
  };
668
945
  });
669
- const je = Xe;
670
- let Ue = () => {
946
+ const ie = oe;
947
+ let re = () => {
671
948
  console.warn("You must call useEditMode before setting its state.");
672
949
  };
673
- const Ze = je(null, () => {
674
- const [e2, t2] = a(null);
675
- return Ue = t2, e2;
676
- }), Ge = () => {
677
- const e2 = Ze();
678
- return h(() => ({ setMode: (e3) => {
679
- Ue((t2) => ("function" == typeof e3 && (e3 = e3(t2)), e3?.onModeChange?.(e3 ?? null), e3));
680
- }, getMode: () => e2 }), [e2]);
950
+ const se = ie(null, () => {
951
+ const [t2, e2] = a(null);
952
+ return re = e2, t2;
953
+ }), le = () => {
954
+ const t2 = se();
955
+ return h(() => ({ setMode: (t3) => {
956
+ re((e2) => ("function" == typeof t3 && (t3 = t3(e2)), t3?.onModeChange?.(t3 ?? null), t3));
957
+ }, getMode: () => t2 }), [t2]);
681
958
  };
682
- class qe {
683
- constructor(e2, t2, n2, o2) {
684
- this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = e2, this._target = t2, this._applyProps(n2 || {}), this._callback = o2, void 0 === o2 && (this._callback = () => {
959
+ class ae {
960
+ constructor(t2, e2, n2, o2) {
961
+ 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 = () => {
685
962
  console.log(`implement: ${this.label()} : ${this.description()}`);
686
963
  });
687
964
  }
688
965
  key() {
689
966
  return this._key;
690
967
  }
691
- _resolve(e2, t2) {
692
- if ("function" == typeof e2) {
693
- const n2 = t2 ?? this._context;
694
- return e2("function" == typeof n2 ? n2() : n2);
968
+ _resolve(t2, e2) {
969
+ if ("function" == typeof t2) {
970
+ const n2 = e2 ?? this._context;
971
+ return t2("function" == typeof n2 ? n2() : n2);
695
972
  }
696
- return e2;
973
+ return t2;
697
974
  }
698
975
  target() {
699
976
  return "function" == typeof this._target ? this._target() : this._target;
700
977
  }
701
- label(e2, t2) {
702
- const n2 = this._scopedLabels?.[e2] || this._label;
978
+ label(t2, e2) {
979
+ const n2 = this._scopedLabels?.[t2] || this._label;
703
980
  let o2 = null;
704
981
  if ("function" == typeof n2) {
705
- const e3 = t2 ?? this._context;
706
- o2 = n2("function" == typeof e3 ? e3() : e3);
982
+ const t3 = e2 ?? this._context;
983
+ o2 = n2("function" == typeof t3 ? t3() : t3);
707
984
  } else o2 = n2;
708
985
  return o2;
709
986
  }
710
- description(e2) {
711
- return this._resolve(this._description, e2);
987
+ description(t2) {
988
+ return this._resolve(this._description, t2);
712
989
  }
713
- tags(e2) {
714
- return this._resolve(this._tags, e2);
990
+ tags(t2) {
991
+ return this._resolve(this._tags, t2);
715
992
  }
716
- icon(e2) {
717
- return this._resolve(this._icon, e2);
993
+ icon(t2) {
994
+ return this._resolve(this._icon, t2);
718
995
  }
719
996
  shortcut() {
720
997
  return this._resolve(this._shortcut);
@@ -728,120 +1005,120 @@ class qe {
728
1005
  context() {
729
1006
  return "function" == typeof this._context ? this._context() : this._context;
730
1007
  }
731
- async execute(e2, t2) {
1008
+ async execute(t2, e2) {
732
1009
  if (!this.disabled() && this._callback) {
733
1010
  try {
734
1011
  let n2 = true;
735
- t2?.beforeExecute && (n2 = t2?.beforeExecute(this, e2));
1012
+ e2?.beforeExecute && (n2 = e2?.beforeExecute(this, t2));
736
1013
  if (false === await Promise.resolve(n2)) return false;
737
- const o2 = this._callback.bind(this)(e2, this);
1014
+ const o2 = this._callback.bind(this)(t2, this);
738
1015
  if (false === await Promise.resolve(o2)) return false;
739
- t2?.onExecute?.(this, e2), this._notifyExecute(e2);
1016
+ e2?.onExecute?.(this, t2), this._notifyExecute(t2);
740
1017
  } catch (n2) {
741
- return console.warn(n2), t2?.onError(this, n2, e2), this._notifyError(e2, n2), false;
1018
+ return console.warn(n2), e2?.onError(this, n2, t2), this._notifyError(t2, n2), false;
742
1019
  }
743
1020
  return true;
744
1021
  }
745
1022
  }
746
- addPropertyListener(e2, t2 = false) {
747
- if (!e2) throw new Error("listener must be specified");
1023
+ addPropertyListener(t2, e2 = false) {
1024
+ if (!t2) throw new Error("listener must be specified");
748
1025
  const n2 = this._listenersProperties;
749
- return n2.add(e2), t2 && e2({}, this), () => {
750
- n2.delete(e2);
1026
+ return n2.add(t2), e2 && t2({}, this), () => {
1027
+ n2.delete(t2);
751
1028
  };
752
1029
  }
753
- addExecuteListener(e2) {
754
- if (!e2) throw new Error("listener must be specified");
755
- const t2 = this._listenersExecute;
756
- return t2.add(e2), function() {
757
- t2.delete(e2);
1030
+ addExecuteListener(t2) {
1031
+ if (!t2) throw new Error("listener must be specified");
1032
+ const e2 = this._listenersExecute;
1033
+ return e2.add(t2), function() {
1034
+ e2.delete(t2);
758
1035
  };
759
1036
  }
760
- _notifyExecute(e2) {
761
- const t2 = this;
1037
+ _notifyExecute(t2) {
1038
+ const e2 = this;
762
1039
  this._listenersExecute.forEach((n2) => {
763
- n2.onExecute(t2, e2);
1040
+ n2.onExecute(e2, t2);
764
1041
  });
765
1042
  }
766
- _notifyError(e2, t2) {
1043
+ _notifyError(t2, e2) {
767
1044
  const n2 = this;
768
1045
  this._listenersExecute.forEach((o2) => {
769
- o2.onError?.(n2, e2, t2);
1046
+ o2.onError?.(n2, t2, e2);
770
1047
  });
771
1048
  }
772
- updateCallback(e2) {
773
- return this._callback = e2 || null, this;
1049
+ updateCallback(t2) {
1050
+ return this._callback = t2 || null, this;
774
1051
  }
775
- update(e2) {
776
- if (!e2) return;
777
- const t2 = this._applyProps(e2);
778
- return Object.keys(t2).length > 0 && this._notifyPropertyChange(t2), this;
1052
+ update(t2) {
1053
+ if (!t2) return;
1054
+ const e2 = this._applyProps(t2);
1055
+ return Object.keys(e2).length > 0 && this._notifyPropertyChange(e2), this;
779
1056
  }
780
- _notifyPropertyChange(e2) {
781
- const t2 = this;
1057
+ _notifyPropertyChange(t2) {
1058
+ const e2 = this;
782
1059
  this._listenersProperties.forEach((n2) => {
783
- n2(e2, t2);
1060
+ n2(t2, e2);
784
1061
  });
785
1062
  }
786
- _applyProps(e2) {
787
- let t2 = {}, n2 = this;
788
- return Object.keys(e2).forEach((o2) => {
789
- let i2 = e2[o2];
790
- n2["_" + o2] !== i2 && (n2["_" + o2] = t2[o2] = i2);
791
- }), t2;
1063
+ _applyProps(t2) {
1064
+ let e2 = {}, n2 = this;
1065
+ return Object.keys(t2).forEach((o2) => {
1066
+ let i2 = t2[o2];
1067
+ n2["_" + o2] !== i2 && (n2["_" + o2] = e2[o2] = i2);
1068
+ }), e2;
792
1069
  }
793
1070
  }
794
- class Je extends qe {
1071
+ class ce extends ae {
795
1072
  }
796
- class Qe {
797
- constructor(e2, t2) {
798
- this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = v.uuidV4(), this._target = e2, this._groupKey = t2 ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(t2, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
1073
+ class he {
1074
+ constructor(t2, e2) {
1075
+ this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = v.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();
799
1076
  const n2 = this;
800
- this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (e3, t3) => {
801
- const o2 = n2._root._listenersByKey, i2 = t3.key(), r2 = o2.get(i2);
802
- r2 && n2._notifyCommands(r2, "onCommandChange", t3);
1077
+ this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (t3, e3) => {
1078
+ const o2 = n2._root._listenersByKey, i2 = e3.key(), r2 = o2.get(i2);
1079
+ r2 && n2._notifyCommands(r2, "onCommandChange", e3);
803
1080
  };
804
1081
  }
805
- _getCommand(e2) {
806
- const t2 = this._commandsByKey.get(e2);
807
- return t2 || (this._parent?._getCommand(e2) ?? null);
1082
+ _getCommand(t2) {
1083
+ const e2 = this._commandsByKey.get(t2);
1084
+ return e2 || (this._parent?._getCommand(t2) ?? null);
808
1085
  }
809
- getCommand(e2, t2 = false) {
1086
+ getCommand(t2, e2 = false) {
810
1087
  const n2 = this._root._focused;
811
1088
  let o2 = n2, i2 = n2 === this;
812
1089
  for (; !i2 && o2; ) o2 === this && (i2 = true), o2 = o2._parent;
813
- return (i2 ? n2 : this)._getCommand(e2);
1090
+ return (i2 ? n2 : this)._getCommand(t2);
814
1091
  }
815
- createChildGroup(e2, t2, n2) {
1092
+ createChildGroup(t2, e2, n2) {
816
1093
  let o2;
817
1094
  if (!n2) {
818
- let e3 = this;
819
- for (; e3 && !o2; ) {
820
- let n3 = e3._nodes.get(t2);
821
- n3 && (o2 = n3), e3 = e3._parent;
1095
+ let t3 = this;
1096
+ for (; t3 && !o2; ) {
1097
+ let n3 = t3._nodes.get(e2);
1098
+ n3 && (o2 = n3), t3 = t3._parent;
822
1099
  }
823
1100
  }
824
- o2 || (o2 = new Qe(e2, t2), o2._parent = this, o2._root = this._root, o2._unListenersByCommand = null, o2._listenersByKey = null, o2._commandsPropertyListener = null);
825
- const i2 = (e3, o3) => {
826
- !e3.has(t2) || n2 ? e3.set(t2, o3) : void 0 === n2 && console.warn("commandGroup already registered", t2);
1101
+ o2 || (o2 = new he(t2, e2), o2._parent = this, o2._root = this._root, o2._unListenersByCommand = null, o2._listenersByKey = null, o2._commandsPropertyListener = null);
1102
+ const i2 = (t3, o3) => {
1103
+ !t3.has(e2) || n2 ? t3.set(e2, o3) : void 0 === n2 && console.warn("commandGroup already registered", e2);
827
1104
  };
828
1105
  i2(this._root._nodes, o2);
829
1106
  let r2 = this._parent;
830
1107
  for (; r2; ) i2(this._nodes, o2), r2 = r2._parent;
831
- return this._children.set(t2, o2), this._notify("onGroupChange"), o2;
1108
+ return this._children.set(e2, o2), this._notify("onGroupChange"), o2;
832
1109
  }
833
1110
  getKey() {
834
1111
  return this._groupKey;
835
1112
  }
836
- getGroup(e2) {
837
- return this._nodes.get(e2);
1113
+ getGroup(t2) {
1114
+ return this._nodes.get(t2);
838
1115
  }
839
- _addCommands(e2, t2 = void 0) {
1116
+ _addCommands(t2, e2 = void 0) {
840
1117
  const n2 = this._commandsByKey, o2 = this._commandsByShortcut, i2 = this._root._commandsPropertyListener, r2 = this._root._unListenersByCommand;
841
- for (let s2 = 0; s2 < e2.length; s2++) {
842
- const l2 = e2[s2], a2 = l2.key();
843
- if (n2.has(a2) && !t2) {
844
- void 0 === t2 && console.warn("command already registered", a2);
1118
+ for (let s2 = 0; s2 < t2.length; s2++) {
1119
+ const l2 = t2[s2], a2 = l2.key();
1120
+ if (n2.has(a2) && !e2) {
1121
+ void 0 === e2 && console.warn("command already registered", a2);
845
1122
  continue;
846
1123
  }
847
1124
  n2.set(a2, l2);
@@ -852,55 +1129,55 @@ class Qe {
852
1129
  const u2 = l2.shortcut();
853
1130
  if (!u2) continue;
854
1131
  const d2 = Array.isArray(u2) ? u2 : [u2];
855
- for (let e3 = 0; e3 < d2.length; e3++) {
856
- const n3 = nt(d2[e3]), i3 = o2.get(n3);
857
- i3 && !t2 && void 0 === t2 && console.warn(`Shortcut already registered: ${n3}, ${a2}, ${i3}.`), o2.set(n3, a2);
1132
+ for (let t3 = 0; t3 < d2.length; t3++) {
1133
+ const n3 = pe(d2[t3]), i3 = o2.get(n3);
1134
+ i3 && !e2 && void 0 === e2 && console.warn(`Shortcut already registered: ${n3}, ${a2}, ${i3}.`), o2.set(n3, a2);
858
1135
  }
859
1136
  }
860
1137
  }
861
1138
  removeFromParent() {
862
1139
  if (!this._parent) return;
863
- let e2 = this._parent, t2 = [];
1140
+ let t2 = this._parent, e2 = [];
864
1141
  const n2 = this._groupKey;
865
- for (; e2; ) t2.push(e2._nodes), e2._nodes.delete(n2), e2 = e2._parent;
866
- e2 = this._parent;
867
- const o2 = (e3) => {
868
- e3._children.forEach((e4) => {
869
- for (let n3 = 0; n3 < t2.length; n3++) e4._nodes.delete(t2[n3]);
870
- o2(e4);
1142
+ for (; t2; ) e2.push(t2._nodes), t2._nodes.delete(n2), t2 = t2._parent;
1143
+ t2 = this._parent;
1144
+ const o2 = (t3) => {
1145
+ t3._children.forEach((t4) => {
1146
+ for (let n3 = 0; n3 < e2.length; n3++) t4._nodes.delete(e2[n3]);
1147
+ o2(t4);
871
1148
  });
872
1149
  };
873
1150
  o2(this), this._parent = null, this._notify("onGroupChange");
874
1151
  }
875
- addCommands(e2, t2) {
876
- this._addCommands(e2, t2), this._notify("onGroupChange");
1152
+ addCommands(t2, e2) {
1153
+ this._addCommands(t2, e2), this._notify("onGroupChange");
877
1154
  }
878
1155
  getActive() {
879
1156
  return this._root._focused ?? this._root;
880
1157
  }
881
- activate(e2) {
882
- let t2 = this;
883
- if (e2 && (t2 = this._nodes.get(e2), !t2)) return void console.warn("group not found", e2);
1158
+ activate(t2) {
1159
+ let e2 = this;
1160
+ if (t2 && (e2 = this._nodes.get(t2), !e2)) return void console.warn("group not found", t2);
884
1161
  let n2 = this._root._focused ?? this._root;
885
1162
  for (; n2; ) n2 = n2._parent;
886
- this._root._focused !== t2 && (this._root._focused = t2, this._notify("onGroupChange"), this._notify("onActiveChange"));
1163
+ this._root._focused !== e2 && (this._root._focused = e2, this._notify("onGroupChange"), this._notify("onActiveChange"));
887
1164
  }
888
- findCommandByEvent(e2) {
889
- const t2 = [];
890
- e2.altKey && t2.push(P.Alt), e2.shiftKey && t2.push(P.Shift), e2.ctrlKey && t2.push(P.Ctrl), e2.metaKey && t2.push(P.Meta);
891
- let n2 = nt({ key: e2.code, modifiers: t2 });
1165
+ findCommandByEvent(t2) {
1166
+ const e2 = [];
1167
+ t2.altKey && e2.push(D.Alt), t2.shiftKey && e2.push(D.Shift), t2.ctrlKey && e2.push(D.Ctrl), t2.metaKey && e2.push(D.Meta);
1168
+ let n2 = pe({ key: t2.code, modifiers: e2 });
892
1169
  const o2 = this._commandsByShortcut;
893
1170
  let i2 = o2.get(n2);
894
- i2 || (n2 = nt({ key: e2.key, modifiers: t2 }), i2 = o2.get(n2)), !i2 && e2.code.startsWith("Digit") && (n2 = nt({ key: e2.code.substring(5, e2.code.length), modifiers: t2 }), i2 = this._commandsByShortcut.get(n2)), !i2 && e2.code.startsWith("Key") && (i2 = nt({ key: e2.code.substring(3, e2.code.length), modifiers: t2 }), i2 = o2.get(n2));
1171
+ i2 || (n2 = pe({ key: t2.key, modifiers: e2 }), i2 = o2.get(n2)), !i2 && t2.code.startsWith("Digit") && (n2 = pe({ key: t2.code.substring(5, t2.code.length), modifiers: e2 }), i2 = this._commandsByShortcut.get(n2)), !i2 && t2.code.startsWith("Key") && (i2 = pe({ key: t2.code.substring(3, t2.code.length), modifiers: e2 }), i2 = o2.get(n2));
895
1172
  let r2 = null;
896
- return i2 && (r2 = this._commandsByKey.get(i2), r2 && r2.disabled() && (r2 = null), !r2 || r2.target() && r2.target().contains(e2.target) || (r2 = null)), r2 || (this._parent?.findCommandByEvent(e2) ?? null);
1173
+ return i2 && (r2 = this._commandsByKey.get(i2), r2 && r2.disabled() && (r2 = null), !r2 || r2.target() && r2.target().contains(t2.target) || (r2 = null)), r2 || (this._parent?.findCommandByEvent(t2) ?? null);
897
1174
  }
898
- dispatchToFocusedCommand(e2) {
899
- const t2 = this.getActive();
900
- if (!t2) return false;
901
- if (e2.isDefaultPrevented()) return false;
902
- const n2 = t2.findCommandByEvent?.(e2);
903
- return !!n2 && (n2.execute(), e2.preventDefault(), true);
1175
+ dispatchToFocusedCommand(t2) {
1176
+ const e2 = this.getActive();
1177
+ if (!e2) return false;
1178
+ if (t2.isDefaultPrevented()) return false;
1179
+ const n2 = e2.findCommandByEvent?.(t2);
1180
+ return !!n2 && (n2.execute(), t2.preventDefault(), true);
904
1181
  }
905
1182
  getRoot() {
906
1183
  return this._parent ? this._parent.getRoot() : this;
@@ -908,300 +1185,305 @@ class Qe {
908
1185
  getParent() {
909
1186
  return this._parent;
910
1187
  }
911
- addListener(e2, t2) {
912
- const n2 = this._listeners, o2 = t2?.keys, i2 = this._root._listenersByKey;
913
- if (o2 && !e2.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
1188
+ addListener(t2, e2) {
1189
+ const n2 = this._listeners, o2 = e2?.keys, i2 = this._root._listenersByKey;
1190
+ if (o2 && !t2.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
914
1191
  let r2 = null;
915
- if (o2) for (let t3 = 0; t3 < o2.length; t3++) {
916
- const n3 = o2[t3];
1192
+ if (o2) for (let e3 = 0; e3 < o2.length; e3++) {
1193
+ const n3 = o2[e3];
917
1194
  if (!n3) continue;
918
1195
  let s2 = i2.get(n3);
919
- s2 || (s2 = /* @__PURE__ */ new Set(), i2.set(n3, s2)), r2 || (r2 = []), r2.push(s2), s2.add(e2);
1196
+ s2 || (s2 = /* @__PURE__ */ new Set(), i2.set(n3, s2)), r2 || (r2 = []), r2.push(s2), s2.add(t2);
920
1197
  }
921
- return n2.add(e2), () => {
922
- if (r2) for (let t3 = 0; t3 < r2.length; t3++) {
923
- r2[t3].delete(e2);
1198
+ return n2.add(t2), () => {
1199
+ if (r2) for (let e3 = 0; e3 < r2.length; e3++) {
1200
+ r2[e3].delete(t2);
924
1201
  }
925
- n2.delete(e2);
1202
+ n2.delete(t2);
926
1203
  };
927
1204
  }
928
- _notifyCommands(e2, t2, n2) {
1205
+ _notifyCommands(t2, e2, n2) {
929
1206
  const o2 = this;
930
1207
  setTimeout(() => {
931
- e2.forEach((e3) => {
932
- e3[t2]?.(o2, n2);
1208
+ t2.forEach((t3) => {
1209
+ t3[e2]?.(o2, n2);
933
1210
  });
934
1211
  }, 0);
935
1212
  }
936
- _notify(e2, t2) {
1213
+ _notify(t2, e2) {
937
1214
  const n2 = this;
938
1215
  setTimeout(() => {
939
1216
  n2._listeners.forEach((o2) => {
940
- o2[e2]?.(n2, t2);
941
- }), n2._parent && n2._parent._notify(e2, t2);
1217
+ o2[t2]?.(n2, e2);
1218
+ }), n2._parent && n2._parent._notify(t2, e2);
942
1219
  }, 0);
943
1220
  }
944
1221
  getAllCommands() {
945
- const e2 = [], t2 = this._groupKey;
1222
+ const t2 = [], e2 = this._groupKey;
946
1223
  return this._commandsByKey.forEach((n2) => {
947
- e2.push({ command: n2, groupKey: t2 });
948
- }), this._children.forEach((t3) => {
949
- e2.push(...t3.getAllCommands());
950
- }), e2;
1224
+ t2.push({ command: n2, groupKey: e2 });
1225
+ }), this._children.forEach((e3) => {
1226
+ t2.push(...e3.getAllCommands());
1227
+ }), t2;
951
1228
  }
952
1229
  }
953
- const et = v.getOS() === v.OSType.MacOS || v.getOS() === v.OSType.IOS ? "Cmd" : "Ctrl", tt = v.getOS() === v.OSType.MacOS || v.getOS() === v.OSType.IOS ? "⌘" : "^", nt = (e2, t2 = false) => {
1230
+ const ue = v.getOS() === v.OSType.MacOS || v.getOS() === v.OSType.IOS ? "Cmd" : "Ctrl", de = v.getOS() === v.OSType.MacOS || v.getOS() === v.OSType.IOS ? "⌘" : "^", pe = (t2, e2 = false) => {
954
1231
  const n2 = {};
955
- for (let t3 = 0; e2.modifiers && t3 < e2.modifiers.length; t3++) n2[e2.modifiers[t3]] = true;
1232
+ for (let e3 = 0; t2.modifiers && e3 < t2.modifiers.length; e3++) n2[t2.modifiers[e3]] = true;
956
1233
  let o2 = "";
957
- return (n2?.[P.Ctrl] || n2?.[P.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (t2 ? tt : et)), n2?.[P.Alt] && (o2 += t2 ? "⌥" : "Alt"), n2?.[P.Shift] && (o2 += (o2.length > 0 ? "+" : "") + (t2 ? "⇧" : "Shift")), o2 += (o2.length > 0 ? "+" : "") + ee(e2.key), o2;
1234
+ return (n2?.[D.Ctrl] || n2?.[D.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? de : ue)), n2?.[D.Alt] && (o2 += e2 ? "⌥" : "Alt"), n2?.[D.Shift] && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? "⇧" : "Shift")), o2 += (o2.length > 0 ? "+" : "") + tt(t2.key), o2;
958
1235
  };
959
- function ot(e2, t2 = null) {
960
- const n2 = r(t2);
961
- n2.current = t2;
962
- const [o2, i2] = f((e3) => e3 + 1, 0), s2 = h(() => Array.isArray(e2) ? e2 : [e2], [e2]);
1236
+ function fe(t2, e2 = null) {
1237
+ const n2 = r(e2);
1238
+ n2.current = e2;
1239
+ const [o2, i2] = m((t3) => t3 + 1, 0), s2 = h(() => Array.isArray(t2) ? t2 : [t2], [t2]);
963
1240
  return c(() => {
964
1241
  if (!s2 || 0 === s2.length) return;
965
- const e3 = (e4, t3) => {
966
- n2.current?.onChange?.(t3), i2();
1242
+ const t3 = (t4, e3) => {
1243
+ n2.current?.onChange?.(e3), i2();
967
1244
  };
968
1245
  let o3 = null;
969
- t2 && (o3 = { onExecute(e4, t3) {
970
- n2.current?.onExecute?.(e4, t3);
971
- }, onError(e4, t3, o4) {
972
- n2.current?.onError?.(e4, t3, o4);
1246
+ e2 && (o3 = { onExecute(t4, e3) {
1247
+ n2.current?.onExecute?.(t4, e3);
1248
+ }, onError(t4, e3, o4) {
1249
+ n2.current?.onError?.(t4, e3, o4);
973
1250
  } });
974
1251
  const r2 = /* @__PURE__ */ new Set();
975
- for (let n3 = 0; n3 < s2.length; n3++) r2.add(s2[n3]?.addPropertyListener(v.debounce(e3, 0), true)), t2 && r2.add(s2[n3]?.addExecuteListener(o3));
1252
+ for (let n3 = 0; n3 < s2.length; n3++) r2.add(s2[n3]?.addPropertyListener(v.debounce(t3, 0), true)), e2 && r2.add(s2[n3]?.addExecuteListener(o3));
976
1253
  return () => {
977
- r2.forEach((e4) => {
978
- e4?.();
1254
+ r2.forEach((t4) => {
1255
+ t4?.();
979
1256
  });
980
1257
  };
981
- }, [e2]), o2;
1258
+ }, [t2]), o2;
982
1259
  }
983
- const it = (e2, t2) => {
984
- const n2 = [];
985
- if (t2) for (let o2 = 0; o2 < t2.length; o2++) {
986
- const i2 = t2[o2], r2 = i2 ? e2?.getCommand(i2) : null;
987
- n2.push(r2);
988
- }
989
- return n2;
1260
+ const _e = (t2, e2) => {
1261
+ if (!e2 || !t2 || 0 === e2.length) return v.EmptyArray;
1262
+ const n2 = e2.length, o2 = new Array(n2);
1263
+ for (let i2 = 0; i2 < n2; i2++) {
1264
+ const n3 = e2[i2], r2 = n3 ? t2.getCommand(n3) : null;
1265
+ o2[i2] = r2;
1266
+ }
1267
+ return o2;
990
1268
  };
991
- function rt(e2, t2 = null, n2 = null, o2) {
1269
+ function me(t2, e2 = null, n2 = null, o2) {
992
1270
  const i2 = r(n2);
993
- i2.current = n2, t2 && !Array.isArray(t2) && (t2 = [t2]);
994
- const [s2, l2] = a(it(e2, t2)), h2 = o2 ? [...o2, e2] : [e2];
1271
+ i2.current = n2, e2 && !Array.isArray(e2) && (e2 = [e2]);
1272
+ const [s2, l2] = a(_e(t2, e2)), h2 = o2 ? [...o2, t2] : [t2];
995
1273
  return c(() => {
996
1274
  const n3 = { onGroupChange: () => {
997
- const n4 = it(e2, t2);
1275
+ const n4 = _e(t2, e2);
998
1276
  l2(n4), i2.current?.onChange?.(this);
999
1277
  } };
1000
1278
  let o3;
1001
- t2 && t2.length > 0 && (o3 = { keys: t2 }, n3.onCommandChange = (n4, o4) => {
1002
- i2.current?.onChange?.(e2), l2(it(e2, t2));
1279
+ e2 && e2.length > 0 && (o3 = { keys: e2 }, n3.onCommandChange = (n4, o4) => {
1280
+ i2.current?.onChange?.(t2), l2(_e(t2, e2));
1003
1281
  });
1004
- const r2 = e2?.addListener(n3, o3), s3 = it(e2, t2);
1005
- return l2(s3), i2.current?.onChange && i2.current?.onChange(e2), () => {
1282
+ const r2 = t2?.addListener(n3, o3), s3 = _e(t2, e2);
1283
+ return l2(s3), i2.current?.onChange && i2.current?.onChange(t2), () => {
1006
1284
  r2?.();
1007
1285
  };
1008
1286
  }, h2), s2;
1009
1287
  }
1010
- const st = { Toolbar: "toolbar", Menuitem: "menuitem" }, lt = je({ setClipboard: (e2) => {
1288
+ const ge = { Toolbar: "toolbar", Menuitem: "menuitem" }, ye = ie({ setClipboard: (t2) => {
1011
1289
  throw new Error("This is only available via the useClipboard.");
1012
1290
  }, getClipboard: () => b.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
1013
- const [e2, t2] = a(b.Global);
1014
- return { setClipboard: (e3) => t2(e3), getClipboard: () => e2, refNativeCopy: r(null), refNativeLastKey: r(null) };
1015
- }), at = (e2) => {
1016
- const { source: t2, target: n2, onPaste: o2, onClipboardUpdate: r2, commands: s2 } = e2, l2 = De(), a2 = B(r2, [r2]), u2 = B(o2, [o2]), { getClipboard: d2, refNativeCopy: _2 } = lt(), p2 = d2();
1291
+ const [t2, e2] = a(b.Global);
1292
+ return { setClipboard: (t3) => e2(t3), getClipboard: () => t2, refNativeCopy: r(null), refNativeLastKey: r(null) };
1293
+ }), ve = (t2) => {
1294
+ const { source: e2, target: n2, onPaste: o2, onClipboardUpdate: r2, commands: s2 } = t2, l2 = Ht(), a2 = B(r2, [r2]), u2 = B(o2, [o2]), { getClipboard: d2, refNativeCopy: p2 } = ye(), f2 = d2();
1017
1295
  h(() => {
1018
- const e3 = t2?.element, o3 = n2?.element ?? t2?.element;
1296
+ const t3 = e2?.element, o3 = n2?.element ?? e2?.element;
1019
1297
  if (!s2) return;
1020
- const i2 = [new Je("cut", e3, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", shortcut: { key: "X", modifiers: [P.Ctrl] } }), new Je("copy", e3, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", shortcut: { key: "C", modifiers: [P.Ctrl] } }), new Je("paste", o3, { label: "Paste", description: "Add content on the clipboard to your document.", shortcut: [{ key: "V", modifiers: [P.Ctrl] }, { key: "F8", modifiers: [P.Ctrl] }] })];
1298
+ const i2 = [new ce("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: [D.Ctrl] } }), new ce("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: [D.Ctrl] } }), new ce("paste", o3, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste", shortcut: [{ key: "V", modifiers: [D.Ctrl] }, { key: "F8", modifiers: [D.Ctrl] }] })];
1021
1299
  s2?.addCommands(i2, true);
1022
1300
  }, [s2]);
1023
- const m2 = B(async (e3) => {
1024
- if (!t2?.element) return;
1301
+ const _2 = B(async (t3) => {
1302
+ if (!e2?.element) return;
1025
1303
  let n3 = null;
1026
1304
  try {
1027
- n3 = t2.doCopy?.(e3), "string" == typeof n3 ? await p2.writeText(n3) : await p2.writeReference(n3);
1028
- } catch (e4) {
1029
- throw e4;
1305
+ n3 = e2.doCopy?.(t3), "string" == typeof n3 ? await f2.writeText(n3) : await f2.writeReference(n3);
1306
+ } catch (t4) {
1307
+ throw t4;
1030
1308
  }
1031
- }, [t2, l2]), f2 = B(async (e3) => {
1032
- const n3 = t2?.element?.();
1309
+ }, [e2, l2]), m2 = B(async (t3) => {
1310
+ const n3 = e2?.element?.();
1033
1311
  if (n3) {
1034
- _2.current = { sourceElement: n3, args: e3 };
1312
+ p2.current = { sourceElement: n3, args: t3 };
1035
1313
  try {
1036
- await m2(e3);
1037
- } catch (e4) {
1038
- l2.showError?.(e4);
1314
+ await _2(t3);
1315
+ } catch (t4) {
1316
+ l2.showError?.(t4);
1039
1317
  }
1040
1318
  }
1041
- }, [t2?.element, l2]), g2 = i(() => {
1042
- f2({ isCut: true });
1043
- }, []), y2 = B(async (e3, t3, n3) => {
1319
+ }, [e2?.element, l2]), g2 = i(() => {
1320
+ m2({ isCut: true });
1321
+ }, []), y2 = B(async (t3, e3, n3) => {
1044
1322
  try {
1045
- if (false === await e3.doPaste(t3, n3)) return;
1046
- u2?.(t3, n3);
1047
- } catch (e4) {
1048
- l2.showError?.(e4);
1323
+ if (false === await t3.doPaste(e3, n3)) return;
1324
+ u2?.(e3, n3);
1325
+ } catch (t4) {
1326
+ l2.showError?.(t4);
1049
1327
  }
1050
- }, [u2]), x2 = B(async (e3, t3, o3) => {
1328
+ }, [u2]), x2 = B(async (t3, e3, o3) => {
1051
1329
  const i2 = n2?.element?.();
1052
- if (i2 && await v.whenFocus(i2), !e3 && !t3) return;
1330
+ if (i2 && await v.whenFocus(i2), !t3 && !e3) return;
1053
1331
  const r3 = await l2.showBusy?.("Pasting...");
1054
- if (t3) try {
1055
- return await y2(n2, t3, o3), void r3?.();
1056
- } catch (e4) {
1057
- r3?.(), l2.showError?.(e4);
1332
+ if (e3) try {
1333
+ return await y2(n2, e3, o3), void r3?.();
1334
+ } catch (t4) {
1335
+ r3?.(), l2.showError?.(t4);
1058
1336
  }
1059
1337
  let s3, a3 = n2.importFromExternal;
1060
- a3 || (a3 = (t4, n3) => ({ getItemType: () => "text", toText: () => e3.text, isClipboardItem: true }));
1338
+ a3 || (a3 = (e4, n3) => ({ getItemType: () => "text", toText: () => t3.text, isClipboardItem: true }));
1061
1339
  try {
1062
- s3 = await a3(e3, { isCut: false });
1063
- } catch (e4) {
1064
- r3?.(), l2.showError?.(e4);
1340
+ s3 = await a3(t3, { isCut: false });
1341
+ } catch (t4) {
1342
+ r3?.(), l2.showError?.(t4);
1065
1343
  }
1066
1344
  if (s3) try {
1067
- const e4 = await Promise.resolve(s3);
1068
- await y2(n2, e4, o3), r3?.();
1069
- } catch (e4) {
1070
- r3?.(), l2.showError?.(e4);
1345
+ const t4 = await Promise.resolve(s3);
1346
+ await y2(n2, t4, o3), r3?.();
1347
+ } catch (t4) {
1348
+ r3?.(), l2.showError?.(t4);
1071
1349
  }
1072
1350
  else r3?.();
1073
- }, [y2, n2, l2]), w2 = B(async (e3) => {
1351
+ }, [y2, n2, l2]), w2 = B(async (t3) => {
1074
1352
  if (n2?.element) try {
1075
- const t3 = await p2.readReference();
1076
- if (t3) return void await x2(null, t3, e3);
1353
+ const e3 = await f2.readReference();
1354
+ if (e3) return void await x2(null, e3, t3);
1077
1355
  const n3 = [];
1078
- n3[0] = await S.readStringFromClipboard(p2, L.plain), n3[1] = await S.readHTMLFromClipboard(p2, L.html), n3[2] = await S.readBlobFromClipboard(p2, L.png);
1356
+ n3[0] = await S.readStringFromClipboard(f2, L.plain), n3[1] = await S.readHTMLFromClipboard(f2, L.html), n3[2] = await S.readBlobFromClipboard(f2, L.png);
1079
1357
  const o3 = { text: n3[0] ?? null, html: n3[1] ?? null, image: n3[2] ?? null };
1080
- await x2(o3, null, e3);
1081
- } catch (e4) {
1082
- if ("Document is not focused." === e4?.message) return;
1083
- l2.showError?.(e4);
1358
+ await x2(o3, null, t3);
1359
+ } catch (t4) {
1360
+ if ("Document is not focused." === t4?.message) return;
1361
+ l2.showError?.(t4);
1084
1362
  }
1085
1363
  }, [x2, n2?.element, l2]);
1086
- return B(async (e3) => {
1087
- }, [t2?.element]), B(async (e3) => {
1364
+ return B(async (t3) => {
1365
+ }, [e2?.element]), B(async (t3) => {
1088
1366
  }, [n2?.element, x2, l2]), c(() => {
1089
- if (!p2) return;
1090
- const e3 = async (e4) => {
1091
- const t4 = await p2.readReference();
1092
- a2?.(t4);
1093
- }, t3 = (e4) => {
1367
+ if (!f2) return;
1368
+ const t3 = async (t4) => {
1369
+ const e4 = await f2.readReference();
1370
+ a2?.(e4);
1371
+ }, e3 = (t4) => {
1094
1372
  l2.showMessage?.(b.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
1095
- }, n3 = (e4) => {
1373
+ }, n3 = (t4) => {
1096
1374
  l2.showMessage?.(b.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
1097
1375
  };
1098
- return p2.addEventListener("clipboardchange", e3), p2.addEventListener("clipboarderrorread", t3), p2.addEventListener("clipboarderrorwrite", n3), () => {
1099
- p2.removeEventListener("clipboardchange", e3), p2.removeEventListener("clipboarderrorread", t3), p2.removeEventListener("clipboarderrorwrite", n3);
1376
+ return f2.addEventListener("clipboardchange", t3), f2.addEventListener("clipboarderrorread", e3), f2.addEventListener("clipboarderrorwrite", n3), () => {
1377
+ f2.removeEventListener("clipboardchange", t3), f2.removeEventListener("clipboarderrorread", e3), f2.removeEventListener("clipboarderrorwrite", n3);
1100
1378
  };
1101
- }, [p2, l2]), c(() => {
1102
- }, [m2, x2, t2, n2]), c(() => {
1103
- s2?.getCommand("cut")?.updateCallback(g2).update({ disabled: !t2 || !n2 }), s2?.getCommand("copy")?.updateCallback(f2).update({ disabled: !t2 }), s2?.getCommand("paste")?.updateCallback(w2).update({ disabled: !n2 });
1104
- }, [t2, n2, s2]), { paste: w2, copy: f2, clipboard: p2 };
1379
+ }, [f2, l2]), c(() => {
1380
+ }, [_2, x2, e2, n2]), c(() => {
1381
+ s2?.getCommand("cut")?.updateCallback(g2).update({ disabled: !e2 || !n2 }), s2?.getCommand("copy")?.updateCallback(m2).update({ disabled: !e2 }), s2?.getCommand("paste")?.updateCallback(w2).update({ disabled: !n2 });
1382
+ }, [e2, n2, s2]), { paste: w2, copy: m2, clipboard: f2 };
1105
1383
  };
1106
- function ct(e2, t2 = true) {
1107
- const n2 = r(e2);
1384
+ function xe(t2, e2 = true) {
1385
+ const n2 = r(t2);
1108
1386
  c(() => {
1109
- if (t2) {
1110
- const t3 = Object.entries(e2).reduce((e3, [t4, o2]) => (n2.current[t4] !== o2 && (e3[t4] = [n2.current[t4], o2]), e3), {});
1111
- Object.keys(t3).length > 0 && console.log("Changed props:", t3);
1387
+ if (e2) {
1388
+ const e3 = Object.entries(t2).reduce((t3, [e4, o2]) => (n2.current[e4] !== o2 && (t3[e4] = [n2.current[e4], o2]), t3), {});
1389
+ Object.keys(e3).length > 0 && console.log("Changed props:", e3);
1112
1390
  }
1113
- n2.current = e2;
1391
+ n2.current = t2;
1114
1392
  });
1115
1393
  }
1116
- let ht = false, ut = 0;
1117
- var dt = "undefined" != typeof document ? d : c;
1118
- const _t = () => "sheetxl-ui-" + ut++;
1119
- const pt = o["useId".toString()], mt = null != pt ? pt : function() {
1120
- const [e2, t2] = o.useState(() => ht ? _t() : void 0);
1121
- return dt(() => {
1122
- null == e2 && t2(_t());
1394
+ let we = false, be = 0;
1395
+ var Se = "undefined" != typeof document ? d : c;
1396
+ const Le = () => "sheetxl-ui-" + be++;
1397
+ const Ee = o["useId".toString()], Ce = null != Ee ? Ee : function() {
1398
+ const [t2, e2] = o.useState(() => we ? Le() : void 0);
1399
+ return Se(() => {
1400
+ null == t2 && e2(Le());
1123
1401
  }, []), o.useEffect(() => {
1124
- ht || (ht = true);
1125
- }, []), e2;
1126
- }, ft = "Undo the last action.", gt = "Repeat the last action or undo the redo.", yt = (e2) => `Redo ${e2}`, vt = ({ manager: e2, commands: t2, disabled: n2 }) => {
1127
- const o2 = De(), i2 = B((t3) => {
1402
+ we || (we = true);
1403
+ }, []), t2;
1404
+ }, Te = "Undo the last action.", Me = "Repeat the last action or undo the redo.", ke = (t2) => `Redo ${t2}`, De = ({ manager: t2, commands: e2, disabled: n2 }) => {
1405
+ const o2 = Ht(), i2 = B((e3) => {
1128
1406
  try {
1129
- e2?.undo(t3);
1130
- } catch (e3) {
1131
- o2.error(e3);
1407
+ t2?.undo(e3);
1408
+ } catch (t3) {
1409
+ o2.error(t3);
1132
1410
  }
1133
- }, [e2]), r2 = B((t3) => {
1411
+ }, [t2]), r2 = B((e3) => {
1134
1412
  try {
1135
- e2?.redo(t3);
1136
- } catch (e3) {
1137
- o2.error(e3);
1413
+ t2?.redo(e3);
1414
+ } catch (t3) {
1415
+ o2.error(t3);
1138
1416
  }
1139
- }, [e2]);
1417
+ }, [t2]);
1140
1418
  return h(() => {
1141
- if (!t2) return;
1142
- const e3 = { contains: (e4) => true, focus() {
1143
- } }, n3 = [new qe("undo", e3, { label: "Undo", description: ft, shortcut: { key: "z", modifiers: [P.Ctrl] }, disabled: true }, i2), new qe("redo", e3, { label: "Redo", description: gt, shortcut: [{ key: "y", modifiers: [P.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [P.Alt] }], disabled: true }, r2)];
1144
- t2?.addCommands(n3, true);
1145
- }, [t2]), c(() => {
1146
- if (!t2) return;
1419
+ if (!e2) return;
1420
+ const t3 = { contains: (t4) => true, focus() {
1421
+ } }, n3 = [new ae("undo", t3, { label: "Undo", description: Te, shortcut: { key: "z", modifiers: [D.Ctrl] }, disabled: true }, i2), new ae("redo", t3, { label: "Redo", description: Me, shortcut: [{ key: "y", modifiers: [D.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [D.Alt] }], disabled: true }, r2)];
1422
+ e2?.addCommands(n3, true);
1423
+ }, [e2]), c(() => {
1424
+ if (!e2) return;
1147
1425
  const o3 = () => {
1148
- const o4 = e2?.getTopUndoDescription(), i4 = {};
1426
+ const o4 = t2?.getTopUndoDescription(), i4 = {};
1149
1427
  var r3;
1150
- t2.getCommand("undo").update({ disabled: n2 || !e2 || !e2.hasUndo(), description: o4 ? (r3 = o4, `Undo ${r3}`) : ft, state: i4, context: { undoManager: e2 } });
1151
- const s2 = e2?.getTopRedoDescription();
1152
- t2.getCommand("redo").update({ disabled: n2 || !e2 || !e2.hasRedo(), description: s2 ? yt(s2) : gt, state: i4, context: { undoManager: e2 } });
1428
+ e2.getCommand("undo").update({ disabled: n2 || !t2 || !t2.hasUndo(), description: o4 ? (r3 = o4, `Undo ${r3}`) : Te, state: i4, context: { undoManager: t2 } });
1429
+ const s2 = t2?.getTopRedoDescription();
1430
+ e2.getCommand("redo").update({ disabled: n2 || !t2 || !t2.hasRedo(), description: s2 ? ke(s2) : Me, state: i4, context: { undoManager: t2 } });
1153
1431
  };
1154
- if (o3(), !e2) return;
1155
- const i3 = e2.addListener({ onStackChange() {
1432
+ if (o3(), !t2) return;
1433
+ const i3 = t2.addListener({ onStackChange() {
1156
1434
  o3();
1157
1435
  } });
1158
1436
  return () => i3?.();
1159
- }, [e2, t2, n2]), { undo: i2, redo: r2 };
1437
+ }, [t2, e2, n2]), { undo: i2, redo: r2 };
1160
1438
  };
1161
1439
  export {
1162
- qe as Command,
1163
- st as CommandButtonType,
1164
- Qe as CommandGroup,
1165
- Ce as DelegatingReactNotifier,
1166
- fe as FocusKeyNavigation,
1167
- D as HorizontalAlignment,
1168
- z as KeyCodes,
1169
- P as KeyModifiers,
1170
- k as MouseButtonCodes,
1171
- Me as NotifierProvider,
1172
- Ee as NotifierType,
1173
- te as ReactUtils,
1174
- ge as RoundedTab,
1175
- se as ScrollPane,
1176
- H as ScrollUtils,
1177
- I as Scrollbar,
1178
- A as ScrollbarOrientation,
1179
- Je as SimpleCommand,
1180
- Le as SplitPane,
1181
- ve as SplitPaneResizer,
1182
- me as ToolTipPlacement,
1183
- pe as VirtualScrollbar,
1184
- re as defaultCreateScrollCorner,
1440
+ ae as Command,
1441
+ ge as CommandButtonType,
1442
+ he as CommandGroup,
1443
+ Pt as DefaultDynamicIconService,
1444
+ Kt as DefaultReactNotifier,
1445
+ Bt as DynamicIcon,
1446
+ mt as FocusKeyNavigation,
1447
+ k as HorizontalAlignment,
1448
+ P as KeyCodes,
1449
+ D as KeyModifiers,
1450
+ A as MouseButtonCodes,
1451
+ Nt as NotifierProvider,
1452
+ Ot as NotifierType,
1453
+ et as ReactUtils,
1454
+ gt as RoundedTab,
1455
+ st as ScrollPane,
1456
+ N as ScrollUtils,
1457
+ W as Scrollbar,
1458
+ z as ScrollbarOrientation,
1459
+ ce as SimpleCommand,
1460
+ Lt as SplitPane,
1461
+ vt as SplitPaneResizer,
1462
+ _t as ToolTipPlacement,
1463
+ ft as VirtualScrollbar,
1464
+ $t as WalkingIcon,
1465
+ Dt as createDynamicIconService,
1466
+ rt as defaultCreateScrollCorner,
1185
1467
  K as defaultCreateScrollEdgeButton,
1186
1468
  O as defaultCreateScrollEndButton,
1187
1469
  $ as defaultCreateScrollStartButton,
1188
- ie as defaultCreateScrollbar,
1189
- ze as getDevicePixelRatio,
1190
- nt as toShortcutString,
1470
+ it as defaultCreateScrollbar,
1471
+ It as getDevicePixelRatio,
1472
+ pe as toShortcutString,
1191
1473
  B as useCallbackRef,
1192
- ot as useCommand,
1193
- rt as useCommands,
1194
- at as useCopyPaste,
1195
- Pe as useDevicePixelRatio,
1196
- Ge as useEditMode,
1197
- ae as useFullscreenPortal,
1198
- lt as useGlobalClipboard,
1199
- mt as useId,
1200
- oe as useImperativeElement,
1201
- Be as useMouseDownAndHoldListener,
1202
- De as useNotifier,
1203
- ke as useOnClickOrFocusAway,
1204
- Ae as useSynchronizedPointerHandler,
1205
- ct as useTraceUpdate,
1206
- vt as useUndoManager
1474
+ fe as useCommand,
1475
+ me as useCommands,
1476
+ ve as useCopyPaste,
1477
+ Wt as useDevicePixelRatio,
1478
+ le as useEditMode,
1479
+ at as useFullscreenPortal,
1480
+ ye as useGlobalClipboard,
1481
+ Ce as useId,
1482
+ ot as useImperativeElement,
1483
+ Ft as useMouseDownAndHoldListener,
1484
+ Ht as useNotifier,
1485
+ Rt as useOnClickOrFocusAway,
1486
+ jt as useSynchronizedPointerHandler,
1487
+ xe as useTraceUpdate,
1488
+ De as useUndoManager
1207
1489
  };