@sheetxl/utils-react 0.7.5 → 0.7.7

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,33 +1,33 @@
1
1
  /**
2
- * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.5
2
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.7
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
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";
9
- import g from "clsx";
10
- import { useMeasure as y } from "react-use";
11
- import { CommonUtils as v, DefaultNotifier as x, Notifier as w, InternalClipboard as b, ClipboardUtils as S, MimeType as L } from "@sheetxl/utils";
12
- import * as E from "detect-it";
13
- import { mergeRefs as C } from "react-merge-refs";
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, createContext as d, useContext as p, useLayoutEffect as f, createElement as _, useReducer as m, Component as g } from "react";
9
+ import y from "clsx";
10
+ import { useMeasure as v } from "react-use";
11
+ import { CommonUtils as x, DefaultNotifier as w, Notifier as b, InternalClipboard as S, ClipboardUtils as L, MimeType as E } from "@sheetxl/utils";
12
+ import * as C from "detect-it";
13
+ import { mergeRefs as M } from "react-merge-refs";
14
14
  import { createRoot as T } from "react-dom/client";
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) => {
15
+ import { unstable_batchedUpdates as k } 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" }, A = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219 }, z = { Left: 1, Middle: 2, Right: 3 }, B = { Horizontal: "horizontal", Vertical: "vertical" }, $ = (e2, t2) => {
17
17
  const n2 = i((...t3) => e2?.(...t3), t2), o2 = r(null);
18
18
  o2.current = n2;
19
19
  const s2 = i((...e3) => o2.current?.(...e3), []);
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
21
  }, 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" }) }) }) });
22
+ const { style: n2, orientation: o2 = B.Vertical, ...i2 } = t2, r2 = o2 === B.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" }) }) }) });
27
24
  }, K = (t2) => {
28
- const { style: n2, orientation: o2 = A.Vertical, ...i2 } = t2, r2 = o2 === A.Vertical;
25
+ const { style: n2, orientation: o2 = B.Vertical, ...i2 } = t2, r2 = o2 === B.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
+ }, H = (t2) => {
28
+ const { style: n2, orientation: o2 = B.Vertical, ...i2 } = t2, r2 = o2 === B.Vertical;
29
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) => {
30
+ }, R = (e2, t2, n2, o2, i2 = 0) => {
31
31
  for (let i3 = 0; i3 < n2.length; i3++) {
32
32
  const r2 = n2[i3].getBoundingClientRect();
33
33
  let s2 = r2.left - t2, l2 = s2 + r2.width;
@@ -36,88 +36,89 @@ const D = { General: "general", Left: "left", Right: "right", Center: "center",
36
36
  } else if (Math.ceil(l2) > Math.ceil(e2) + 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
+ }, V = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: R }, Symbol.toStringTag, { value: "Module" })), N = "_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 = B.Vertical, onScrollOffset: _2, onScroll: m2, showCustomScrollButtons: g2 = false, scrollButtonIncrement: x2 = 200, scrollButtonInitialRepeatDelay: w2 = 260, scrollButtonAdditionalRepeatDelay: b2 = 120, createScrollStartButton: S2 = O, createScrollEndButton: L2 = K, ...E2 } = n2, C2 = $(m2, [m2]), M2 = r(null), [T2, { width: k2, height: D2 }] = v(), [P2, { width: A2, height: z2 }] = v(), H2 = f2 === B.Vertical, V2 = H2 ? "top" : "left", W2 = H2 ? "scrollTop" : "scrollLeft", I2 = H2 ? D2 : k2, j2 = H2 ? z2 : 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) => {
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);
42
+ null !== F2 && M2.current && M2.current.scrollTo({ behavior: "smooth", [V2]: F2 });
43
+ }, [F2, H2]);
44
+ const X2 = i((e2, t2 = false) => {
45
+ if (!M2.current) return 0;
46
+ const n3 = M2.current.querySelector(".scrollbar-viewport"), o3 = n3.getBoundingClientRect(), i2 = n3.children, r2 = t2 ? 0 : R(e2, o3[V2], i2, true, Math.max(0, e2 - x2));
47
+ return Y2(r2), Math.max(0, r2);
48
48
  }, []), U2 = i((e2, t2 = false) => {
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) => {
53
- Z2.current = s2;
54
- const t2 = e2.target[N2];
55
- m2(t2, u2, l2), C2?.(e2);
56
- }, [m2, u2, l2, s2]);
49
+ if (!M2.current) return 0;
50
+ const n3 = M2.current.querySelector(".scrollbar-viewport"), o3 = n3.getBoundingClientRect(), i2 = n3.children, r2 = Math.ceil(j2 - I2), s3 = t2 ? r2 : R(e2, o3[V2], i2, false, Math.max(0, e2 + x2));
51
+ return Y2(s3), Math.min(r2, s3);
52
+ }, [j2, I2]), G2 = r(null), Z2 = i((e2) => {
53
+ if (null !== G2.current) return void (G2.current = null);
54
+ const t2 = e2.target[W2];
55
+ _2(t2, u2, l2), C2?.(e2);
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]);
58
+ const e2 = G2.current;
59
+ if (s2 === e2) return;
60
+ M2.current[W2] !== s2 && (G2.current = s2, M2.current[W2] = s2);
61
+ }, [s2, W2]);
61
62
  const q2 = r(null), J2 = r(null), Q2 = i(() => {
62
63
  q2.current && (clearTimeout(q2.current), q2.current = null, J2.current = null);
63
64
  }, []), ee2 = i((e2, t2, n3, o3 = w2) => {
64
65
  J2.current = e2, q2.current = setTimeout(() => {
65
- const t3 = n3 ? j2(J2.current || e2) : U2(J2.current || e2);
66
+ const t3 = n3 ? X2(J2.current || e2) : U2(J2.current || e2);
66
67
  t3 !== J2.current ? ee2(t3, false, n3, b2) : Q2();
67
68
  }, t2 ? 0 : o3);
68
- }, [j2, U2, Q2]);
69
+ }, [X2, U2, Q2]);
69
70
  c(() => () => Q2(), [Q2]);
70
- const te2 = s2, ne2 = h(() => {
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) };
71
+ const te2 = h(() => {
72
+ if (!g2) return null;
73
+ const e2 = { orientation: f2, disabled: Math.floor(s2) <= 0 || 0 === Math.floor(j2 - I2), onMouseUp: Q2, onMouseLeave: Q2, onMouseDown: () => ee2(s2, true, true) };
73
74
  return S2?.(e2);
74
- }, [v2, p2, te2, Y2, R2, F2]), oe2 = h(() => {
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) };
75
+ }, [g2, f2, s2, F2, j2, I2]), ne2 = h(() => {
76
+ if (!g2) return null;
77
+ const e2 = { orientation: f2, disabled: Math.floor(j2 - I2) <= Math.ceil(s2), onMouseUp: Q2, onMouseLeave: Q2, onMouseDown: () => ee2(s2, true, false) };
77
78
  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] });
79
+ }, [g2, f2, s2, F2, j2, I2]);
80
+ return t("div", { ref: o2, style: { display: "flex", flex: "1", flexDirection: H2 ? "column" : "row", padding: "0", ...d2 }, className: y(N, p2), ...E2, children: [te2, e("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: H2 ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: T2, children: e("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: H2 ? "scroll" : "hidden", overflowX: H2 ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: Z2, ref: M2, children: e("div", { ref: P2, style: { position: "absolute", height: H2 ? l2 - u2 + (D2 ?? 0) : 1, width: H2 ? 1 : l2 - u2 + (k2 ?? 0) }, className: "scrollbar-viewport" }) }) }), ne2] });
80
81
  }));
81
- I.displayName = "Scrollbar";
82
- let N = Date.now, F = 1e3, R = {}, Y = 1;
82
+ W.displayName = "Scrollbar";
83
+ let I = Date.now, j = 1e3, F = {}, Y = 1;
83
84
  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++;
85
+ let t2 = null !== F[e2];
86
+ return t2 && (F[e2] = null), t2;
87
+ }, U = (e2, t2, n2, o2 = 0, i2) => {
88
+ let r2 = I(), s2 = r2, l2 = 0, a2 = 0, c2 = 0, h2 = Y++;
88
89
  if (h2 % 20 == 0) {
89
90
  const e3 = {};
90
- for (let t3 in R) e3[t3] = true;
91
- R = e3;
91
+ for (let t3 in F) e3[t3] = true;
92
+ F = e3;
92
93
  }
93
94
  const u2 = function(d2) {
94
- let _2 = true !== d2, p2 = N(), m2 = true;
95
+ let p2 = true !== d2, f2 = I(), _2 = true;
95
96
  try {
96
- m2 = (!t2 || t2(h2)) ?? true;
97
+ _2 = (!t2 || t2(h2)) ?? true;
97
98
  } catch (e3) {
98
- m2 = false;
99
+ _2 = false;
99
100
  }
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;
101
+ if (!F[h2] || !_2) return F[h2] = null, void n2?.(60 - a2 / ((f2 - r2) / j), h2, false);
102
+ if (p2) {
103
+ c2 = Math.round((f2 - s2) / 16.666666666666668) - 1;
103
104
  for (let e3 = 0; e3 < Math.min(c2, 4); e3++) u2(true), a2++;
104
105
  }
105
- o2 && (l2 = (p2 - r2) / o2, l2 > 1 && (l2 = 1));
106
- let f2 = i2 ? i2(l2) : l2, g2 = false;
106
+ o2 && (l2 = (f2 - r2) / o2, l2 > 1 && (l2 = 1));
107
+ let m2 = i2 ? i2(l2) : l2, g2 = false;
107
108
  try {
108
- g2 = e2(f2, p2, _2);
109
+ g2 = e2(m2, f2, p2);
109
110
  } catch (e3) {
110
111
  g2 = false;
111
112
  }
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));
113
+ false !== g2 && 1 !== l2 || !p2 ? p2 && (s2 = f2, requestAnimationFrame(u2)) : (F[h2] = null, n2?.(60 - a2 / ((f2 - r2) / j), h2, 1 === l2 || null == o2));
113
114
  };
114
- return R[h2] = true, requestAnimationFrame(u2), h2;
115
- }, U = function(e2) {
115
+ return F[h2] = true, requestAnimationFrame(u2), h2;
116
+ }, G = function(e2) {
116
117
  return Math.pow(e2 - 1, 3) + 1;
117
118
  }, Z = function(e2) {
118
119
  return (e2 /= 0.5) < 1 ? 0.5 * Math.pow(e2, 3) : 0.5 * (Math.pow(e2 - 2, 3) + 2);
119
120
  };
120
- class G {
121
+ class q {
121
122
  constructor(e2, t2) {
122
123
  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 };
123
124
  }
@@ -235,7 +236,7 @@ class G {
235
236
  }.bind(this), d2 = function(e3, t3, n3) {
236
237
  t3 === this.__isAnimating && (this.__isAnimating = false), (this.__didDecelerationComplete || n3) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
237
238
  }.bind(this);
238
- this.__isAnimating = j(h2, u2, d2, this.options.animationDuration, i2 ? U : Z);
239
+ this.__isAnimating = U(h2, u2, d2, this.options.animationDuration, i2 ? G : Z);
239
240
  } 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));
240
241
  }
241
242
  __computeScrollMax(e2 = this.__zoomLevel) {
@@ -254,7 +255,7 @@ class G {
254
255
  }.bind(this), i2 = function(e3, t3, n3) {
255
256
  this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
256
257
  }.bind(this);
257
- this.__isDecelerating = j(t2, o2, i2);
258
+ this.__isDecelerating = U(t2, o2, i2);
258
259
  }
259
260
  __stepThroughDeceleration(e2) {
260
261
  let t2 = this.__scrollLeft + this.__decelerationVelocityX, n2 = this.__scrollTop + this.__decelerationVelocityY;
@@ -274,11 +275,11 @@ class G {
274
275
  }
275
276
  }
276
277
  }
277
- const q = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), J = {};
278
- function Q() {
279
- return E;
278
+ const J = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), Q = {};
279
+ function ee() {
280
+ return C;
280
281
  }
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
+ const te = (e2) => "BracketLeft" === e2 ? "[" : "BracketRight" === e2 ? "]" : x.camelToPrettyCase(e2), ne = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: Q, boundPixel: function(e2, t2 = false, n2 = 0) {
282
283
  return e2;
283
284
  }, createSyntheticEvent: (e2) => {
284
285
  let t2 = false, n2 = false;
@@ -288,8 +289,8 @@ const ee = (e2) => "BracketLeft" === e2 ? "[" : "BracketRight" === e2 ? "]" : v.
288
289
  n2 = true, e2.stopPropagation();
289
290
  }, isPropagationStopped: () => n2, persist: () => {
290
291
  }, 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) {
292
+ }, detectIt: ee, focusableNodeNames: J, toPrettyKeyCode: te }, Symbol.toStringTag, { value: "Module" })), oe = [];
293
+ function ie(e2, t2, n2 = oe) {
293
294
  const o2 = r(null);
294
295
  return u(e2, () => {
295
296
  if (!o2.current) return;
@@ -303,49 +304,51 @@ function oe(e2, t2, n2 = ne) {
303
304
  return e3;
304
305
  }, n2), o2;
305
306
  }
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);
307
+ const re = (t2) => e(W, { ...t2 }), se = ({ width: t2, height: n2 }) => e("div", { className: "corner", style: { minWidth: `${t2}px`, width: `${t2}px`, minHeight: `${n2}px`, height: `${n2}px` } }), le = s(l((o2, s2) => {
308
+ const { children: l2, viewport: a2, onScrollViewport: u2, showHorizontalScrollbar: d2 = true, showVerticalScrollbar: p2 = true, createScrollCorner: f2 = se, createHorizontalScrollbar: _2 = re, createVerticalScrollbar: m2 = re, style: g2, touchElement: y2, disableTouch: x2, ...w2 } = o2, b2 = $(u2, [u2]), S2 = ie(s2, () => ({ isScrollPane: () => true }), []), L2 = r(null);
308
309
  c(() => {
309
310
  L2.current && (L2.current.__scrollTop === a2?.top && L2.current.__scrollLeft === a2?.left || L2.current.__isDecelerating || L2.current?.scrollTo(a2?.left, a2?.top, false));
310
- }, [a2?.left, a2?.top, v2]);
311
+ }, [a2?.left, a2?.top, y2]);
311
312
  const E2 = i((e2, t2) => {
312
313
  b2?.({ left: e2, top: t2 });
313
314
  }, []), C2 = i((e2) => {
314
315
  L2.current?.doTouchStart(e2.touches, e2.timeStamp);
315
- }, []), T2 = i((e2) => {
316
- e2.preventDefault(), L2.current?.doTouchMove(e2.touches, e2.timeStamp);
317
316
  }, []), M2 = i((e2) => {
317
+ e2.preventDefault(), L2.current?.doTouchMove(e2.touches, e2.timeStamp);
318
+ }, []), T2 = i((e2) => {
318
319
  L2.current?.doTouchEnd(e2.timeStamp);
319
- }, []), D2 = i(({ containerWidth: e2, containerHeight: t2, totalWidth: n2, totalHeight: o3 }) => {
320
+ }, []), k2 = i(({ containerWidth: e2, containerHeight: t2, totalWidth: n2, totalHeight: o3 }) => {
320
321
  L2.current.setDimensions(e2, t2, n2, o3);
321
322
  }, []);
322
323
  c(() => {
323
- const e2 = v2 ?? S2.current;
324
- if (!x2 && Q().supportsTouchEvents && e2 && a2) {
324
+ const e2 = y2 ?? S2.current;
325
+ if (!x2 && ee().supportsTouchEvents && e2 && a2) {
325
326
  if (!L2.current) {
326
327
  const e3 = { scrollingX: true, scrollingY: true, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
327
- L2.current = new G(E2, e3);
328
+ L2.current = new q(E2, e3);
328
329
  }
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 });
330
+ ee().supportsTouchEvents && (e2.addEventListener("touchstart", C2), e2.addEventListener("touchend", T2), e2.addEventListener("touchmove", M2)), k2({ containerWidth: a2?.width, containerHeight: a2?.height, totalWidth: a2?.totalWidth, totalHeight: a2?.totalHeight });
330
331
  }
331
332
  return () => {
332
- e2?.removeEventListener("touchstart", C2), e2?.removeEventListener("touchend", M2), e2?.removeEventListener("touchmove", T2);
333
+ e2?.removeEventListener("touchstart", C2), e2?.removeEventListener("touchend", T2), e2?.removeEventListener("touchmove", M2);
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) => {
335
+ }, [a2?.width, a2?.height, a2?.totalWidth, a2?.totalHeight, x2, y2]);
336
+ const [D2, { width: P2 }] = v(), [A2, { height: z2 }] = v(), O2 = h(() => {
337
+ const t2 = m2({ orientation: B.Vertical, offset: a2?.top, viewportSize: a2?.height, totalSize: a2?.totalHeight, onScrollOffset: (e2) => {
337
338
  b2?.({ top: e2 });
338
339
  } });
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, {})] }) });
340
+ return e("div", { style: { display: "flex", flex: "0" }, ref: D2, children: t2 });
341
+ }, [m2, a2?.top, a2?.height, a2?.totalHeight]), K2 = h(() => {
342
+ const o3 = _2({ orientation: B.Horizontal, offset: a2?.left, viewportSize: a2?.width, totalSize: a2?.totalWidth, onScrollOffset: (e2) => {
343
+ b2?.({ left: e2 });
344
+ } });
345
+ 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% - ${P2}px)` }, children: e("div", { ref: A2, className: "sizer", children: o3 }) }), p2 ? f2({ width: P2, height: z2 }) : e(n, {})] });
346
+ }, [_2, a2?.left, a2?.width, a2?.totalWidth, p2, f2, P2, z2]);
347
+ return e("div", { style: { position: "relative", display: "flex", minWidth: p2 ? `${P2}px` : void 0, minHeight: d2 ? `${z2}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 }), p2 ? O2 : e(n, {})] }), d2 ? K2 : e(n, {})] }) });
345
348
  }));
346
- se.displayName = "ScrollPane";
347
- let le = 0;
348
- function ae() {
349
+ le.displayName = "ScrollPane";
350
+ let ae = 0;
351
+ function ce() {
349
352
  const [e2, t2] = a(!!document.fullscreenElement), n2 = i(() => {
350
353
  const e3 = document.fullscreenElement;
351
354
  return e3 ? e3.querySelector(".fullscreen-portal-root") || e3 : document.body;
@@ -357,56 +360,52 @@ function ae() {
357
360
  let n3 = e4.querySelector(".fullscreen-portal-root");
358
361
  n3 || (n3 = document.createElement("div"), n3.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", e4.appendChild(n3));
359
362
  }
360
- return le++, e3(), document.addEventListener("fullscreenchange", e3), () => {
361
- document.removeEventListener("fullscreenchange", e3), le--, le <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((e4) => {
363
+ return ae++, e3(), document.addEventListener("fullscreenchange", e3), () => {
364
+ document.removeEventListener("fullscreenchange", e3), ae--, ae <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((e4) => {
362
365
  e4.parentNode && e4.parentNode.removeChild(e4);
363
- }), le = 0);
366
+ }), ae = 0);
364
367
  };
365
368
  }, []), { getPortalContainer: n2, isFullscreen: e2 };
366
369
  }
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);
372
- d(() => {
373
- if (!z2) {
374
- A2.current = { propTotalSize: l2, propViewportSize: s2, propOffset: o2 };
375
- const e2 = b2();
376
- L2(e2);
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 });
370
+ const he = 100, ue = 100, de = 1e6, pe = 100, fe = 50, _e = s(l((t2, n2) => {
371
+ const { offset: o2 = 0, viewportSize: s2 = 0, totalSize: l2 = 0, minSize: c2 = 0, endGap: u2 = he, endScrollIncrement: d2 = ue, style: p2 = Q, onMouseDown: f2, onScrollOffset: _2, onScroll: m2, scaleLimit: g2 = de, scaleFactor: y2 = pe, precisionFactor: v2 = fe, ...x2 } = t2;
372
+ m2 && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
373
+ const w2 = $(f2, [f2]), [b2, S2] = a(false), L2 = r(null), E2 = h(() => {
374
+ const e2 = 0 === g2 ? l2 : Math.min(l2 ?? 0, Math.max(c2 ?? 0, (o2 ?? 0) + (s2 ?? 0)) + (u2 ?? 0)), t3 = 0 !== g2 && e2 > g2 ? y2 : 1, n3 = Math.ceil(e2 / t3), i2 = { offset: Math.ceil(o2 / t3), totalSize: n3, viewportSize: Math.ceil(s2 / t3), scaledOffset: o2, scaledTotalSize: l2, scaledViewportSize: s2 };
375
+ return L2.current = b2 ? null : i2, i2;
376
+ }, [o2, l2, s2, b2, c2, u2, d2]), C2 = 0 !== g2 && E2.totalSize > g2 ? y2 : 1, M2 = C2 / v2, T2 = $((e2, t3, n3) => {
377
+ const i2 = L2.current;
378
+ if (L2.current = null, i2 && i2.scaledTotalSize === l2 && i2.scaledViewportSize === s2 && i2.scaledOffset === o2) return;
379
+ const r2 = E2.offset;
380
+ Math.abs(e2 - r2) < M2 && (e2 = r2), _2?.(e2 * C2, r2, E2.viewportSize);
381
+ }, [_2, C2, M2, E2]), k2 = i((e2) => {
382
+ }, []), D2 = i((e2) => {
383
+ document.removeEventListener("mousemove", k2), document.removeEventListener("mouseup", D2), S2(false);
384
+ }, []), P2 = i((e2) => {
385
+ S2(true), w2?.(e2), document.addEventListener("mousemove", k2, { passive: true }), document.addEventListener("mouseup", D2, { passive: true });
386
+ }, [k2, D2]);
387
+ return e(W, { ref: n2, style: p2, ...x2, offset: E2.offset, totalSize: E2.totalSize, viewportSize: E2.viewportSize, onMouseDown: P2, onScrollOffset: T2 });
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) => {
389
+ _e.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" }, ge = s(l((t2, n2) => {
391
391
  const { refFocusStart: o2, ...s2 } = t2, l2 = r(null), a2 = i(() => {
392
392
  if (o2) return void o2?.current?.focus();
393
393
  const e2 = l2.current.parentElement.children;
394
394
  let t3 = [];
395
- for (let n3 = 0; n3 < e2.length && e2[n3] !== l2.current; n3++) {
396
- const o3 = e2[n3].getAttribute("tabindex");
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 });
395
+ const n3 = e2.length;
396
+ for (let o3 = 0; o3 < n3 && e2[o3] !== l2.current; o3++) {
397
+ const n4 = e2[o3], i2 = n4.getAttribute("tabindex");
398
+ if (null == i2 || "-1" === i2) continue;
399
+ "true" !== n4.getAttribute("disabled") && (n4.focus && t3.push({ tabindex: parseInt(i2), child: n4 }));
401
400
  }
402
401
  0 !== t3.length && (t3.sort(function(e3, t4) {
403
402
  return e3.tabindex - t4.tabindex;
404
403
  }), t3[0].child.focus());
405
404
  }, [o2]);
406
- return e("div", { tabIndex: 0, ref: C([l2, n2]), onFocus: a2, ...s2 });
405
+ return e("div", { tabIndex: 0, ref: M([l2, n2]), onFocus: a2, ...s2 });
407
406
  }));
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) => {
407
+ const ye = s(l((i2, s2) => {
408
+ const { className: l2, style: a2, children: c2, radius: u2 = 4, strokeWidth: d2 = 1, strokeColor: p2 = "grey", ...f2 } = i2, [_2, { width: m2, height: g2 }] = v(), y2 = r(null), x2 = (e2, t2 = 0) => {
410
409
  const n2 = e2 / 2, o2 = g2 - n2 + t2;
411
410
  return (function(e3, t3, n3 = false) {
412
411
  if (0 === t3) return e3;
@@ -435,10 +434,10 @@ const ge = s(l((i2, s2) => {
435
434
  for (let e5 = 1; e5 < l3.length; e5++) {
436
435
  let h2 = a3[a3.length - 1], u3 = l3[e5], d3 = u3 === c3 ? l3[1] : l3[e5 + 1];
437
436
  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);
437
+ let e6, l4, c4 = s3(h2), p3 = s3(u3), f3 = s3(d3);
438
+ n3 ? (e6 = i3(p3, h2.origPoint || c4, t3), l4 = i3(p3, d3.origPoint || f3, t3)) : (e6 = o3(p3, c4, t3), l4 = o3(p3, f3, t3)), r2(u3, e6), u3.origPoint = p3, a3.push(u3);
439
+ let _3 = i3(e6, p3, 0.5), m3 = i3(p3, l4, 0.5), g3 = ["C", _3.x, _3.y, m3.x, m3.y, l4.x, l4.y];
440
+ g3.origPoint = p3, a3.push(g3);
442
441
  } else a3.push(u3);
443
442
  }
444
443
  if (c3) {
@@ -449,63 +448,15 @@ const ge = s(l((i2, s2) => {
449
448
  return a3.reduce(function(e4, t4) {
450
449
  return e4 + t4.join(" ") + " ";
451
450
  }, "");
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(() => {
451
+ })(`${`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);
452
+ }, w2 = h(() => x2(d2), [m2, g2, u2, d2]), b2 = h(() => {
454
453
  if (0 === u2) return;
455
454
  const e2 = u2 / 2;
456
- return x2(u2) + `L ${f2} 0 L 0 0 L 0 ${e2}`;
455
+ return x2(u2) + `L ${m2} 0 L 0 0 L 0 ${e2}`;
457
456
  }, [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;
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;
469
- if (w2) throw new Error("Use elementBefore and elementAfter instead of children.");
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));
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) => {
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) => {
490
- if (L2 || !Z2) return;
491
- const t2 = Me2.current?.getBoundingClientRect();
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;
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);
501
- }
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 {
457
+ return t("div", { className: l2, style: { display: "flex", flexDirection: "row", ...a2 }, ...f2, ref: M([y2, _2, s2]), children: [o.isValidElement(c2) ? o.cloneElement(c2, S2) : e(n, {}), e("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: m2, height: g2, viewBox: `0 0 ${m2} ${g2}`, children: e("path", { d: w2, stroke: p2, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: d2 }) })] });
458
+ })), ve = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
459
+ class xe extends w {
509
460
  setOverrides(e2) {
510
461
  super.setOverrides(e2);
511
462
  }
@@ -515,7 +466,7 @@ class Ce extends x {
515
466
  showMessage(e2, t2) {
516
467
  const n2 = this.getDelegate();
517
468
  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);
469
+ t2?.type !== ve.Warning ? t2?.type !== ve.Error ? b.log(e2) : b.error(e2) : b.warn(e2);
519
470
  }
520
471
  showBusy(e2, t2) {
521
472
  const n2 = this.getDelegate();
@@ -530,7 +481,7 @@ class Ce extends x {
530
481
  }
531
482
  showError(e2) {
532
483
  const t2 = this.getDelegate();
533
- t2?.showError ? t2.showError(e2) : w.error(e2);
484
+ t2?.showError ? t2.showError(e2) : b.error(e2);
534
485
  }
535
486
  showOptions(e2) {
536
487
  const t2 = this.getDelegate();
@@ -541,13 +492,13 @@ class Ce extends x {
541
492
  return t2?.showInputOptions ? t2.showInputOptions(e2) : Promise.resolve({ input: "", option: "" });
542
493
  }
543
494
  }
544
- const Te = _(new Ce()), Me = ({ children: e2, notifier: t2 }) => (o.useEffect(() => {
545
- const e3 = w.getOverrides();
546
- return w.setOverrides(t2), () => {
547
- w.setOverrides(e3);
495
+ const we = d(new xe()), be = ({ children: e2, notifier: t2 }) => (o.useEffect(() => {
496
+ const e3 = b.getOverrides();
497
+ return b.setOverrides(t2), () => {
498
+ b.setOverrides(e3);
548
499
  };
549
- }, [t2]), o.createElement(Te.Provider, { value: t2 }, e2)), De = () => p(Te);
550
- function Pe(e2) {
500
+ }, [t2]), o.createElement(we.Provider, { value: t2 }, e2)), Se = () => p(we);
501
+ function Le(e2) {
551
502
  const [t2, n2] = a("undefined" != typeof window ? window.devicePixelRatio : 1), o2 = r(null);
552
503
  return c(() => {
553
504
  if (!("undefined" != typeof window && "matchMedia" in window)) return;
@@ -560,13 +511,13 @@ function Pe(e2) {
560
511
  };
561
512
  }, [e2]), t2;
562
513
  }
563
- function ze(e2) {
514
+ function Ee(e2) {
564
515
  if ("undefined" == typeof window) return 1;
565
516
  const { defaultDpr: t2 = 1, maxDpr: n2 = 3, round: o2 = true } = e2 || {}, i2 = "undefined" != typeof window && "number" == typeof window.devicePixelRatio ? window.devicePixelRatio : t2;
566
517
  return Math.min(Math.max(1, o2 ? Math.floor(i2) : i2), n2);
567
518
  }
568
- function ke(e2, t2, n2) {
569
- const o2 = B(t2, [t2]);
519
+ function Ce(e2, t2, n2) {
520
+ const o2 = $(t2, [t2]);
570
521
  c(() => {
571
522
  const t3 = (t4) => {
572
523
  e2.current && !e2.current.contains(t4.target) && o2(t4);
@@ -576,110 +527,110 @@ function ke(e2, t2, n2) {
576
527
  };
577
528
  }, [e2]);
578
529
  }
579
- function Ae(e2) {
530
+ function Me(e2) {
580
531
  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(() => {
532
+ const { onPointerDown: t2, onPointerUp: n2, onPointerMoveOrWait: o2, processTouch: s2 = false, consumeTouch: l2 = true } = e2, a2 = $(t2, [t2]), h2 = $(n2, [n2]), u2 = $(o2, [o2]), d2 = r(false), p2 = e2?.timerInitial ?? 230, f2 = e2?.timerContinuous ?? p2 / 2, _2 = r(null), m2 = r(null), g2 = r(null), y2 = r(null), v2 = i(() => {
582
533
  y2.current && (clearTimeout(y2.current), y2.current = null);
583
534
  }, []), x2 = i((e3) => {
584
535
  y2.current = setTimeout(() => {
585
536
  window.requestAnimationFrame(() => {
586
- false !== d2.current && u2?.(f2.current, g2.current, m2.current);
587
- }), x2(p2);
588
- }, e3 ?? _2);
537
+ false !== d2.current && u2?.(m2.current, g2.current, _2.current);
538
+ }), x2(f2);
539
+ }, e3 ?? p2);
589
540
  }, []);
590
541
  c(() => () => v2(), []);
591
542
  const w2 = s2 ? "pointer" : "mouse", b2 = i((e3) => {
592
543
  e3.stopPropagation(), e3.stopImmediatePropagation(), e3.preventDefault();
593
- }, []), S2 = B((e3) => {
594
- 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);
544
+ }, []), S2 = $((e3) => {
545
+ document.removeEventListener(`${w2}move`, C2), document.removeEventListener(`${w2}up`, S2), document.removeEventListener("keydown", M2), document.removeEventListener("keyup", T2), document.removeEventListener("touchstart", b2, { capture: true }), document.removeEventListener("touchmove", b2, { capture: true }), window.removeEventListener("blur", L2), v2(), window.requestAnimationFrame(() => {
546
+ false !== d2.current && (d2.current = false, h2?.(e3, g2.current, _2.current), g2.current = null);
596
547
  });
597
548
  }, []), L2 = i(() => {
598
- false !== d2.current && (d2.current = false, S2(f2.current));
599
- }, []), E2 = B(() => {
600
- v2(), x2(p2), window.requestAnimationFrame(() => {
601
- false !== d2.current && u2?.(f2.current, g2.current, m2.current);
549
+ false !== d2.current && (d2.current = false, S2(m2.current));
550
+ }, []), E2 = $(() => {
551
+ v2(), x2(f2), window.requestAnimationFrame(() => {
552
+ false !== d2.current && u2?.(m2.current, g2.current, _2.current);
602
553
  });
603
- }, [p2]), C2 = B((e3) => {
604
- f2.current = e3, E2();
605
- }, []), T2 = B((e3) => {
554
+ }, [f2]), C2 = $((e3) => {
555
+ m2.current = e3, E2();
556
+ }, []), M2 = $((e3) => {
606
557
  g2.current = { ctrlKey: e3.ctrlKey, shiftKey: e3.shiftKey, altKey: e3.altKey, metaKey: e3.metaKey }, E2();
607
- }, []), M2 = B((e3) => {
558
+ }, []), T2 = $((e3) => {
608
559
  g2.current = { ctrlKey: e3.ctrlKey, shiftKey: e3.shiftKey, altKey: e3.altKey, metaKey: e3.metaKey }, E2();
609
- }, [p2]);
610
- return B((e3) => {
560
+ }, [f2]);
561
+ return $((e3) => {
611
562
  if (e3.isDefaultPrevented()) return;
612
563
  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]);
564
+ false !== a2(e3, g2.current) && (_2.current = e3, m2.current = e3.nativeEvent, document.addEventListener(`${w2}up`, S2, { passive: false }), document.addEventListener(`${w2}move`, C2, { passive: false }), document.addEventListener("keydown", M2, { passive: false }), document.addEventListener("keyup", T2, { 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));
565
+ }, [p2, s2]);
615
566
  }
616
- function Be(e2, t2) {
617
- return Ae({ onPointerDown: e2, onPointerMoveOrWait: (t3, n2, o2) => {
567
+ function Te(e2, t2) {
568
+ return Me({ onPointerDown: e2, onPointerMoveOrWait: (t3, n2, o2) => {
618
569
  e2?.(o2);
619
570
  }, ...t2 });
620
571
  }
621
- const $e = ({ initValue: e2, useHookBody: t2, applyStateChange: n2 }) => {
572
+ const ke = ({ initValue: e2, useHookBody: t2, applyStateChange: n2 }) => {
622
573
  const o2 = r(e2);
623
574
  if ("function" != typeof t2) throw new Error("function expected as hook body parameter. got " + typeof t2);
624
575
  const i2 = t2();
625
- return d(() => {
576
+ return f(() => {
626
577
  o2.current !== i2 && (o2.current = i2, n2(i2));
627
578
  }, [n2, i2]), null;
628
- }, Oe = (e2) => {
579
+ }, De = (e2) => {
629
580
  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 }) => {
581
+ }, Pe = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || void 0;
582
+ let Ae = 1, ze = false, Be = false;
583
+ const $e = [], Oe = [], Ke = () => {
584
+ Oe.forEach((e2) => e2());
585
+ }, He = ({ automaticContainerInternalUseOnly: t2 }) => {
635
586
  const [o2, i2] = a([]), s2 = r([]);
636
- return s2.current = o2, t2 || false !== He || (We = true), c(() => {
587
+ return s2.current = o2, t2 || false !== ze || (Be = true), c(() => {
637
588
  let e2 = true;
638
589
  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]);
590
+ if (e2) return Oe[0] !== n2 ? (t2 || true !== ze || De("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([...$e]);
640
591
  }
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();
592
+ return Oe.push(n2), Ke(), () => {
593
+ e2 = false, s2.current?.length > 0 && De("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Oe.splice(Oe.indexOf(n2), 1), Ke();
643
594
  };
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");
595
+ }, [t2]), e(n, { children: o2.map(({ hook: e2, key: t3 }) => _(ke, { ...e2, key: t3 })) });
596
+ }, Re = (t2) => {
597
+ const n2 = Ae++;
598
+ return $e.push({ hook: t2, key: n2 }), 0 === Oe.length && false === Be && (ze = true, ((t3) => {
599
+ if (Pe.document && Pe.document.createElement) {
600
+ const n3 = Pe.document.createElement("div");
650
601
  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();
602
+ } else De("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
603
+ })(He)), Ke(), () => {
604
+ $e.splice($e.findIndex((e2) => e2.key === n2), 1), Ke();
654
605
  };
655
606
  };
656
- let Xe = null;
657
- Xe || (Xe = (e2, t2, n2 = {}) => {
607
+ let Ve = null;
608
+ Ve || (Ve = (e2, t2, n2 = {}) => {
658
609
  let o2, i2, r2 = false, s2 = false, l2 = [], { unmountIfNoConsumers: h2 = false } = n2;
659
610
  const u2 = (e3) => {
660
- i2 = e3, M(() => l2.forEach((t3) => t3(e3)));
611
+ i2 = e3, k(() => l2.forEach((t3) => t3(e3)));
661
612
  }, d2 = () => (s2 || (i2 = "function" == typeof e2 ? e2() : e2, s2 = true), i2);
662
613
  return () => {
663
614
  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), () => {
615
+ return c(() => (r2 || (r2 = true, o2 = Re({ initValue: e2, useHookBody: t2, applyStateChange: u2 })), l2.push(s3), i2 !== n3 && s3(i2), () => {
665
616
  l2.splice(l2.indexOf(s3), 1), 0 === l2.length && h2 && (o2(), r2 = false);
666
617
  }), []), n3;
667
618
  };
668
619
  });
669
- const je = Xe;
670
- let Ue = () => {
620
+ const Ne = Ve;
621
+ let We = () => {
671
622
  console.warn("You must call useEditMode before setting its state.");
672
623
  };
673
- const Ze = je(null, () => {
624
+ const Ie = Ne(null, () => {
674
625
  const [e2, t2] = a(null);
675
- return Ue = t2, e2;
676
- }), Ge = () => {
677
- const e2 = Ze();
626
+ return We = t2, e2;
627
+ }), je = () => {
628
+ const e2 = Ie();
678
629
  return h(() => ({ setMode: (e3) => {
679
- Ue((t2) => ("function" == typeof e3 && (e3 = e3(t2)), e3?.onModeChange?.(e3 ?? null), e3));
630
+ We((t2) => ("function" == typeof e3 && (e3 = e3(t2)), e3?.onModeChange?.(e3 ?? null), e3));
680
631
  }, getMode: () => e2 }), [e2]);
681
632
  };
682
- class qe {
633
+ class Fe {
683
634
  constructor(e2, t2, n2, o2) {
684
635
  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 = () => {
685
636
  console.log(`implement: ${this.label()} : ${this.description()}`);
@@ -791,11 +742,11 @@ class qe {
791
742
  }), t2;
792
743
  }
793
744
  }
794
- class Je extends qe {
745
+ class Ye extends Fe {
795
746
  }
796
- class Qe {
747
+ class Xe {
797
748
  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();
749
+ this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = x.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();
799
750
  const n2 = this;
800
751
  this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (e3, t3) => {
801
752
  const o2 = n2._root._listenersByKey, i2 = t3.key(), r2 = o2.get(i2);
@@ -821,7 +772,7 @@ class Qe {
821
772
  n3 && (o2 = n3), e3 = e3._parent;
822
773
  }
823
774
  }
824
- o2 || (o2 = new Qe(e2, t2), o2._parent = this, o2._root = this._root, o2._unListenersByCommand = null, o2._listenersByKey = null, o2._commandsPropertyListener = null);
775
+ o2 || (o2 = new Xe(e2, t2), o2._parent = this, o2._root = this._root, o2._unListenersByCommand = null, o2._listenersByKey = null, o2._commandsPropertyListener = null);
825
776
  const i2 = (e3, o3) => {
826
777
  !e3.has(t2) || n2 ? e3.set(t2, o3) : void 0 === n2 && console.warn("commandGroup already registered", t2);
827
778
  };
@@ -853,7 +804,7 @@ class Qe {
853
804
  if (!u2) continue;
854
805
  const d2 = Array.isArray(u2) ? u2 : [u2];
855
806
  for (let e3 = 0; e3 < d2.length; e3++) {
856
- const n3 = nt(d2[e3]), i3 = o2.get(n3);
807
+ const n3 = Ze(d2[e3]), i3 = o2.get(n3);
857
808
  i3 && !t2 && void 0 === t2 && console.warn(`Shortcut already registered: ${n3}, ${a2}, ${i3}.`), o2.set(n3, a2);
858
809
  }
859
810
  }
@@ -888,10 +839,10 @@ class Qe {
888
839
  findCommandByEvent(e2) {
889
840
  const t2 = [];
890
841
  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 });
842
+ let n2 = Ze({ key: e2.code, modifiers: t2 });
892
843
  const o2 = this._commandsByShortcut;
893
844
  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));
845
+ i2 || (n2 = Ze({ key: e2.key, modifiers: t2 }), i2 = o2.get(n2)), !i2 && e2.code.startsWith("Digit") && (n2 = Ze({ key: e2.code.substring(5, e2.code.length), modifiers: t2 }), i2 = this._commandsByShortcut.get(n2)), !i2 && e2.code.startsWith("Key") && (i2 = Ze({ key: e2.code.substring(3, e2.code.length), modifiers: t2 }), i2 = o2.get(n2));
895
846
  let r2 = null;
896
847
  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);
897
848
  }
@@ -950,16 +901,16 @@ class Qe {
950
901
  }), e2;
951
902
  }
952
903
  }
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) => {
904
+ const Ue = x.getOS() === x.OSType.MacOS || x.getOS() === x.OSType.IOS ? "Cmd" : "Ctrl", Ge = x.getOS() === x.OSType.MacOS || x.getOS() === x.OSType.IOS ? "⌘" : "^", Ze = (e2, t2 = false) => {
954
905
  const n2 = {};
955
906
  for (let t3 = 0; e2.modifiers && t3 < e2.modifiers.length; t3++) n2[e2.modifiers[t3]] = true;
956
907
  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;
908
+ return (n2?.[P.Ctrl] || n2?.[P.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (t2 ? Ge : Ue)), n2?.[P.Alt] && (o2 += t2 ? "⌥" : "Alt"), n2?.[P.Shift] && (o2 += (o2.length > 0 ? "+" : "") + (t2 ? "⇧" : "Shift")), o2 += (o2.length > 0 ? "+" : "") + te(e2.key), o2;
958
909
  };
959
- function ot(e2, t2 = null) {
910
+ function qe(e2, t2 = null) {
960
911
  const n2 = r(t2);
961
912
  n2.current = t2;
962
- const [o2, i2] = f((e3) => e3 + 1, 0), s2 = h(() => Array.isArray(e2) ? e2 : [e2], [e2]);
913
+ const [o2, i2] = m((e3) => e3 + 1, 0), s2 = h(() => Array.isArray(e2) ? e2 : [e2], [e2]);
963
914
  return c(() => {
964
915
  if (!s2 || 0 === s2.length) return;
965
916
  const e3 = (e4, t3) => {
@@ -972,7 +923,7 @@ function ot(e2, t2 = null) {
972
923
  n2.current?.onError?.(e4, t3, o4);
973
924
  } });
974
925
  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));
926
+ for (let n3 = 0; n3 < s2.length; n3++) r2.add(s2[n3]?.addPropertyListener(x.debounce(e3, 0), true)), t2 && r2.add(s2[n3]?.addExecuteListener(o3));
976
927
  return () => {
977
928
  r2.forEach((e4) => {
978
929
  e4?.();
@@ -980,76 +931,77 @@ function ot(e2, t2 = null) {
980
931
  };
981
932
  }, [e2]), o2;
982
933
  }
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;
934
+ const Je = (e2, t2) => {
935
+ if (!t2 || !e2 || 0 === t2.length) return x.EmptyArray;
936
+ const n2 = t2.length, o2 = new Array(n2);
937
+ for (let i2 = 0; i2 < n2; i2++) {
938
+ const n3 = t2[i2], r2 = n3 ? e2.getCommand(n3) : null;
939
+ o2[i2] = r2;
940
+ }
941
+ return o2;
990
942
  };
991
- function rt(e2, t2 = null, n2 = null, o2) {
943
+ function Qe(e2, t2 = null, n2 = null, o2) {
992
944
  const i2 = r(n2);
993
945
  i2.current = n2, t2 && !Array.isArray(t2) && (t2 = [t2]);
994
- const [s2, l2] = a(it(e2, t2)), h2 = o2 ? [...o2, e2] : [e2];
946
+ const [s2, l2] = a(Je(e2, t2)), h2 = o2 ? [...o2, e2] : [e2];
995
947
  return c(() => {
996
948
  const n3 = { onGroupChange: () => {
997
- const n4 = it(e2, t2);
949
+ const n4 = Je(e2, t2);
998
950
  l2(n4), i2.current?.onChange?.(this);
999
951
  } };
1000
952
  let o3;
1001
953
  t2 && t2.length > 0 && (o3 = { keys: t2 }, n3.onCommandChange = (n4, o4) => {
1002
- i2.current?.onChange?.(e2), l2(it(e2, t2));
954
+ i2.current?.onChange?.(e2), l2(Je(e2, t2));
1003
955
  });
1004
- const r2 = e2?.addListener(n3, o3), s3 = it(e2, t2);
956
+ const r2 = e2?.addListener(n3, o3), s3 = Je(e2, t2);
1005
957
  return l2(s3), i2.current?.onChange && i2.current?.onChange(e2), () => {
1006
958
  r2?.();
1007
959
  };
1008
960
  }, h2), s2;
1009
961
  }
1010
- const st = { Toolbar: "toolbar", Menuitem: "menuitem" }, lt = je({ setClipboard: (e2) => {
962
+ const et = { Toolbar: "toolbar", Menuitem: "menuitem" }, tt = Ne({ setClipboard: (e2) => {
1011
963
  throw new Error("This is only available via the useClipboard.");
1012
- }, getClipboard: () => b.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
1013
- const [e2, t2] = a(b.Global);
964
+ }, getClipboard: () => S.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
965
+ const [e2, t2] = a(S.Global);
1014
966
  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();
967
+ }), nt = (e2) => {
968
+ const { source: t2, target: n2, onPaste: o2, onClipboardUpdate: r2, commands: s2 } = e2, l2 = Se(), a2 = $(r2, [r2]), u2 = $(o2, [o2]), { getClipboard: d2, refNativeCopy: p2 } = tt(), f2 = d2();
1017
969
  h(() => {
1018
970
  const e3 = t2?.element, o3 = n2?.element ?? t2?.element;
1019
971
  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] }] })];
972
+ const i2 = [new Ye("cut", e3, { 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: [P.Ctrl] } }), new Ye("copy", e3, { 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: [P.Ctrl] } }), new Ye("paste", o3, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste", shortcut: [{ key: "V", modifiers: [P.Ctrl] }, { key: "F8", modifiers: [P.Ctrl] }] })];
1021
973
  s2?.addCommands(i2, true);
1022
974
  }, [s2]);
1023
- const m2 = B(async (e3) => {
975
+ const _2 = $(async (e3) => {
1024
976
  if (!t2?.element) return;
1025
977
  let n3 = null;
1026
978
  try {
1027
- n3 = t2.doCopy?.(e3), "string" == typeof n3 ? await p2.writeText(n3) : await p2.writeReference(n3);
979
+ n3 = t2.doCopy?.(e3), "string" == typeof n3 ? await f2.writeText(n3) : await f2.writeReference(n3);
1028
980
  } catch (e4) {
1029
981
  throw e4;
1030
982
  }
1031
- }, [t2, l2]), f2 = B(async (e3) => {
983
+ }, [t2, l2]), m2 = $(async (e3) => {
1032
984
  const n3 = t2?.element?.();
1033
985
  if (n3) {
1034
- _2.current = { sourceElement: n3, args: e3 };
986
+ p2.current = { sourceElement: n3, args: e3 };
1035
987
  try {
1036
- await m2(e3);
988
+ await _2(e3);
1037
989
  } catch (e4) {
1038
990
  l2.showError?.(e4);
1039
991
  }
1040
992
  }
1041
993
  }, [t2?.element, l2]), g2 = i(() => {
1042
- f2({ isCut: true });
1043
- }, []), y2 = B(async (e3, t3, n3) => {
994
+ m2({ isCut: true });
995
+ }, []), y2 = $(async (e3, t3, n3) => {
1044
996
  try {
1045
997
  if (false === await e3.doPaste(t3, n3)) return;
1046
998
  u2?.(t3, n3);
1047
999
  } catch (e4) {
1048
1000
  l2.showError?.(e4);
1049
1001
  }
1050
- }, [u2]), x2 = B(async (e3, t3, o3) => {
1002
+ }, [u2]), v2 = $(async (e3, t3, o3) => {
1051
1003
  const i2 = n2?.element?.();
1052
- if (i2 && await v.whenFocus(i2), !e3 && !t3) return;
1004
+ if (i2 && await x.whenFocus(i2), !e3 && !t3) return;
1053
1005
  const r3 = await l2.showBusy?.("Pasting...");
1054
1006
  if (t3) try {
1055
1007
  return await y2(n2, t3, o3), void r3?.();
@@ -1070,40 +1022,40 @@ const st = { Toolbar: "toolbar", Menuitem: "menuitem" }, lt = je({ setClipboard:
1070
1022
  r3?.(), l2.showError?.(e4);
1071
1023
  }
1072
1024
  else r3?.();
1073
- }, [y2, n2, l2]), w2 = B(async (e3) => {
1025
+ }, [y2, n2, l2]), w2 = $(async (e3) => {
1074
1026
  if (n2?.element) try {
1075
- const t3 = await p2.readReference();
1076
- if (t3) return void await x2(null, t3, e3);
1027
+ const t3 = await f2.readReference();
1028
+ if (t3) return void await v2(null, t3, e3);
1077
1029
  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);
1030
+ n3[0] = await L.readStringFromClipboard(f2, E.plain), n3[1] = await L.readHTMLFromClipboard(f2, E.html), n3[2] = await L.readBlobFromClipboard(f2, E.png);
1079
1031
  const o3 = { text: n3[0] ?? null, html: n3[1] ?? null, image: n3[2] ?? null };
1080
- await x2(o3, null, e3);
1032
+ await v2(o3, null, e3);
1081
1033
  } catch (e4) {
1082
1034
  if ("Document is not focused." === e4?.message) return;
1083
1035
  l2.showError?.(e4);
1084
1036
  }
1085
- }, [x2, n2?.element, l2]);
1086
- return B(async (e3) => {
1087
- }, [t2?.element]), B(async (e3) => {
1088
- }, [n2?.element, x2, l2]), c(() => {
1089
- if (!p2) return;
1037
+ }, [v2, n2?.element, l2]);
1038
+ return $(async (e3) => {
1039
+ }, [t2?.element]), $(async (e3) => {
1040
+ }, [n2?.element, v2, l2]), c(() => {
1041
+ if (!f2) return;
1090
1042
  const e3 = async (e4) => {
1091
- const t4 = await p2.readReference();
1043
+ const t4 = await f2.readReference();
1092
1044
  a2?.(t4);
1093
1045
  }, t3 = (e4) => {
1094
- l2.showMessage?.(b.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
1046
+ l2.showMessage?.(S.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
1095
1047
  }, n3 = (e4) => {
1096
- l2.showMessage?.(b.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
1048
+ l2.showMessage?.(S.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
1097
1049
  };
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);
1050
+ return f2.addEventListener("clipboardchange", e3), f2.addEventListener("clipboarderrorread", t3), f2.addEventListener("clipboarderrorwrite", n3), () => {
1051
+ f2.removeEventListener("clipboardchange", e3), f2.removeEventListener("clipboarderrorread", t3), f2.removeEventListener("clipboarderrorwrite", n3);
1100
1052
  };
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 };
1053
+ }, [f2, l2]), c(() => {
1054
+ }, [_2, v2, t2, n2]), c(() => {
1055
+ s2?.getCommand("cut")?.updateCallback(g2).update({ disabled: !t2 || !n2 }), s2?.getCommand("copy")?.updateCallback(m2).update({ disabled: !t2 }), s2?.getCommand("paste")?.updateCallback(w2).update({ disabled: !n2 });
1056
+ }, [t2, n2, s2]), { paste: w2, copy: m2, clipboard: f2 };
1105
1057
  };
1106
- function ct(e2, t2 = true) {
1058
+ function ot(e2, t2 = true) {
1107
1059
  const n2 = r(e2);
1108
1060
  c(() => {
1109
1061
  if (t2) {
@@ -1113,24 +1065,24 @@ function ct(e2, t2 = true) {
1113
1065
  n2.current = e2;
1114
1066
  });
1115
1067
  }
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());
1068
+ let it = false, rt = 0;
1069
+ var st = "undefined" != typeof document ? f : c;
1070
+ const lt = () => "sheetxl-ui-" + rt++;
1071
+ const at = o["useId".toString()], ct = null != at ? at : function() {
1072
+ const [e2, t2] = o.useState(() => it ? lt() : void 0);
1073
+ return st(() => {
1074
+ null == e2 && t2(lt());
1123
1075
  }, []), o.useEffect(() => {
1124
- ht || (ht = true);
1076
+ it || (it = true);
1125
1077
  }, []), 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) => {
1078
+ }, ht = "Undo the last action.", ut = "Repeat the last action or undo the redo.", dt = (e2) => `Redo ${e2}`, pt = ({ manager: e2, commands: t2, disabled: n2 }) => {
1079
+ const o2 = Se(), i2 = $((t3) => {
1128
1080
  try {
1129
1081
  e2?.undo(t3);
1130
1082
  } catch (e3) {
1131
1083
  o2.error(e3);
1132
1084
  }
1133
- }, [e2]), r2 = B((t3) => {
1085
+ }, [e2]), r2 = $((t3) => {
1134
1086
  try {
1135
1087
  e2?.redo(t3);
1136
1088
  } catch (e3) {
@@ -1140,16 +1092,16 @@ const pt = o["useId".toString()], mt = null != pt ? pt : function() {
1140
1092
  return h(() => {
1141
1093
  if (!t2) return;
1142
1094
  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)];
1095
+ } }, n3 = [new Fe("undo", e3, { label: "Undo", description: ht, shortcut: { key: "z", modifiers: [P.Ctrl] }, disabled: true }, i2), new Fe("redo", e3, { label: "Redo", description: ut, shortcut: [{ key: "y", modifiers: [P.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [P.Alt] }], disabled: true }, r2)];
1144
1096
  t2?.addCommands(n3, true);
1145
1097
  }, [t2]), c(() => {
1146
1098
  if (!t2) return;
1147
1099
  const o3 = () => {
1148
1100
  const o4 = e2?.getTopUndoDescription(), i4 = {};
1149
1101
  var r3;
1150
- t2.getCommand("undo").update({ disabled: n2 || !e2 || !e2.hasUndo(), description: o4 ? (r3 = o4, `Undo ${r3}`) : ft, state: i4, context: { undoManager: e2 } });
1102
+ t2.getCommand("undo").update({ disabled: n2 || !e2 || !e2.hasUndo(), description: o4 ? (r3 = o4, `Undo ${r3}`) : ht, state: i4, context: { undoManager: e2 } });
1151
1103
  const s2 = e2?.getTopRedoDescription();
1152
- t2.getCommand("redo").update({ disabled: n2 || !e2 || !e2.hasRedo(), description: s2 ? yt(s2) : gt, state: i4, context: { undoManager: e2 } });
1104
+ t2.getCommand("redo").update({ disabled: n2 || !e2 || !e2.hasRedo(), description: s2 ? dt(s2) : ut, state: i4, context: { undoManager: e2 } });
1153
1105
  };
1154
1106
  if (o3(), !e2) return;
1155
1107
  const i3 = e2.addListener({ onStackChange() {
@@ -1158,50 +1110,431 @@ const pt = o["useId".toString()], mt = null != pt ? pt : function() {
1158
1110
  return () => i3?.();
1159
1111
  }, [e2, t2, n2]), { undo: i2, redo: r2 };
1160
1112
  };
1113
+ class ft extends g {
1114
+ static getDerivedStateFromError() {
1115
+ return { hasError: true };
1116
+ }
1117
+ componentDidCatch(e2) {
1118
+ this.props.onError?.(e2);
1119
+ }
1120
+ render() {
1121
+ return this.props.children;
1122
+ }
1123
+ }
1124
+ const _t = ({ children: t2 }) => {
1125
+ const n2 = Se(), o2 = i((e2) => {
1126
+ n2.showError(e2);
1127
+ }, [n2]);
1128
+ return e(ft, { onError: o2, children: t2 });
1129
+ };
1130
+ class mt {
1131
+ constructor(e2) {
1132
+ this.notifier = e2, this.handleUnhandledRejection = (e3) => {
1133
+ const t2 = e3.reason;
1134
+ t2 instanceof DOMException && "AbortError" === t2.name || this.notifier.showError(t2);
1135
+ }, this.handleGlobalError = (e3) => {
1136
+ this.notifier.showError(e3.error);
1137
+ }, this.setupGlobalHandlers();
1138
+ }
1139
+ setupGlobalHandlers() {
1140
+ window.addEventListener("unhandledrejection", this.handleUnhandledRejection), window.addEventListener("error", this.handleGlobalError);
1141
+ }
1142
+ cleanup() {
1143
+ window.removeEventListener("unhandledrejection", this.handleUnhandledRejection), window.removeEventListener("error", this.handleGlobalError);
1144
+ }
1145
+ }
1146
+ const gt = ({ children: t2 }) => {
1147
+ const o2 = Se();
1148
+ return c(() => {
1149
+ const e2 = new mt(o2);
1150
+ return () => {
1151
+ e2.cleanup();
1152
+ };
1153
+ }, [o2]), e(n, { children: t2 });
1154
+ }, yt = () => null, vt = {}, xt = (t2) => {
1155
+ const { onPointerDown: n2, style: o2, splitDirection: i2, paddingBefore: r2 = 0, paddingAfter: s2 = 0, disabled: l2, key: a2, hitAreaProps: c2 = vt, ...h2 } = t2, u2 = "row" === i2, { style: d2, className: p2, ...f2 } = c2;
1156
+ return e("div", { style: { ...o2, position: "relative" }, ...h2, children: e("div", { className: y("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);
1157
+ }, wt = {}, bt = (e2, t2, n2 = true) => null === e2 ? null : null !== e2.pixels ? n2 ? e2.pixels : t2 - e2.pixels : (n2 ? e2.percent : 100 - e2.percent) / 100 * t2, St = (e2, t2 = true) => e2?.percent ? `${t2 ? e2.percent : 100 - e2.percent}%` : e2?.pixels ? `${e2.pixels}px` : void 0, Lt = (e2, t2) => {
1158
+ if (null == e2) return null;
1159
+ const n2 = { percent: null, pixels: null };
1160
+ let o2 = t2;
1161
+ 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);
1162
+ }, Et = s(l((n2, i2) => {
1163
+ const { elementBefore: s2, elementAfter: l2, splitDirection: u2 = "row", fixedPane: d2 = null, position: p2, onPositionChange: f2, minBefore: _2, maxBefore: m2, minAfter: g2, maxAfter: x2, children: w2, className: b2, style: S2, disabled: L2 = false, onDragStart: E2, onDragResize: C2, onDragFinish: T2, resizerProps: k2 = wt, paneProps: D2 = wt, paneBeforeProps: P2 = wt, paneAfterProps: A2 = wt, createResizer: z2 = xt } = n2;
1164
+ if (w2) throw new Error("Use elementBefore and elementAfter instead of children.");
1165
+ const B2 = h(() => o.isValidElement(l2) && o.isValidElement(s2), [l2, s2]), O2 = h(() => {
1166
+ let e2 = null;
1167
+ d2 && ("before" === d2 ? e2 = 0 : "after" === d2 && (e2 = 1));
1168
+ const t2 = null === e2;
1169
+ return { fixedPaneOffset: e2, isPercent: t2, minBefore: Lt(_2, t2), maxBefore: Lt(m2, t2), minAfter: Lt(g2, t2), maxAfter: Lt(x2, t2) };
1170
+ }, [_2, m2, g2, x2]), K2 = $(f2, [f2]), [H2, R2] = a(() => Lt(p2, null === d2));
1171
+ c(() => {
1172
+ R2(Lt(p2, null === d2));
1173
+ }, [p2, d2]);
1174
+ const [V2, { width: N2, height: W2 }] = v(), [I2, { width: j2, height: F2 }] = v(), Y2 = "row" === u2 ? j2 : F2, X2 = "row" === u2 ? N2 : W2, U2 = h(() => ((e2, t2, n3, o2) => {
1175
+ const i3 = [null, null], r2 = [null, null];
1176
+ 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: St(o2.minBefore, true), maxBefore: St(o2.maxBefore, true), minAfter: St(o2.minAfter), maxAfter: St(o2.maxAfter) };
1177
+ let s3 = bt(e2, t2, 1 !== o2.fixedPaneOffset), l3 = t2 - n3, a2 = bt(o2.minBefore, l3, true) ?? 0, c2 = bt(o2.maxBefore, l3, true) ?? l3, h2 = 0, u3 = 0, d3 = 0, p3 = l3;
1178
+ h2 = (bt(o2.maxAfter, t2, false) ?? n3) - n3, u3 = bt(o2.minAfter, t2, false) ?? t2, d3 = Math.max(a2, h2), p3 = Math.min(c2, u3), s3 = Math.max(d3, Math.min(s3, p3)), u3 = Math.min(l3 - s3, bt(o2.maxAfter, l3 - s3, true) ?? l3), h2 = Math.min(l3 - s3, bt(o2.minAfter, l3 - s3, true) ?? l3), i3[0] = s3, i3[1] = l3 - i3[0];
1179
+ const f3 = Math.max(0, Math.min(100, s3 / l3 * 100));
1180
+ 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` };
1181
+ })(H2, X2, Y2, O2), [O2, H2, X2, Y2, u2]), [G2, Z2] = a(false), q2 = $(E2, [E2]), J2 = $(C2, [C2]), Q2 = $(T2, [T2]), ee2 = r(null), te2 = r(null), ne2 = r(null), { style: oe2, className: re2, ...se2 } = D2, le2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...oe2 }, { className: ae2, style: ce2, ...he2 } = P2, { className: ue2, style: de2, ...pe2 } = A2, fe2 = { flex: "1 1 100%", width: "100%", ...S2, flexDirection: u2, display: "flex" }, { className: _e2, style: me2, onPointerDown: ge2, ...ye2 } = k2, ve2 = $((e2) => {
1182
+ const t2 = Lt(e2, null === d2);
1183
+ R2(t2);
1184
+ }, [d2]), xe2 = $((e2) => {
1185
+ if (L2 || !G2) return;
1186
+ const t2 = Se2.current?.getBoundingClientRect();
1187
+ let n3 = 0;
1188
+ 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(X2, n3)), 1 === O2.fixedPaneOffset && (n3 = X2 - n3), p2 && H2.pixels === n3 || R2({ pixels: n3, percent: null }), J2?.(n3), e2.stopPropagation(), e2.preventDefault();
1189
+ }, [O2, u2, L2, G2, H2, X2]), we2 = $((e2) => {
1190
+ if (document.removeEventListener("pointermove", xe2), document.removeEventListener("touchmove", xe2), document.removeEventListener("pointerup", we2), !G2) return;
1191
+ if (Z2(false), !H2) return;
1192
+ Q2(H2.pixels);
1193
+ if (!Lt(p2, null === d2) || H2.pixels !== p2) {
1194
+ const e3 = { ...H2 };
1195
+ null === e3.percent && (e3.percent = e3.pixels / X2 * 100), K2(e3);
1196
+ }
1197
+ e2.stopPropagation(), e2.preventDefault();
1198
+ }, [H2, G2, p2, d2, X2]), be2 = $((e2) => {
1199
+ ge2?.(e2), e2.defaultPrevented || L2 || G2 || (Z2(true), q2(), document.addEventListener("pointermove", xe2, { passive: false }), document.addEventListener("touchmove", xe2, { passive: false }), document.addEventListener("pointerup", we2, { passive: false }));
1200
+ }, [ge2]), Se2 = ie(i2, () => ({ setPosition: ve2, isSplitPane: () => true }), []), Le2 = h(() => B2 ? z2?.({ key: "resizer", ref: M([I2, te2]), className: y("resizer", _e2), onPointerDownCapture: be2, 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, ...me2 }, splitDirection: u2, disabled: L2, ...ye2 }) : null, [B2, _e2, ye2, u2, me2, L2]), Ee2 = "row" === u2 ? "Width" : "Height", Ce2 = h(() => {
1201
+ if (!s2) return null;
1202
+ const t2 = { ...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${Ee2}`]: U2?.minBefore, [`max${Ee2}`]: l2 ? U2?.maxBefore : "100%" };
1203
+ return e("div", { ref: ee2, className: y("before", re2, ae2), style: t2, ...se2, ...he2, children: s2 }, "before");
1204
+ }, [s2, D2, P2, O2, U2]), Me2 = h(() => {
1205
+ if (!l2) return null;
1206
+ const t2 = { ...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${Ee2}`]: U2?.minAfter, [`max${Ee2}`]: s2 ? U2?.maxAfter : "100%" };
1207
+ return e("div", { ref: ne2, className: y("after", re2, ue2), style: t2, ...se2, ...pe2, children: l2 }, "after");
1208
+ }, [l2, D2, A2, O2, U2]);
1209
+ return t("div", { ref: M([V2, Se2]), className: y("splitPane", "row" === u2 ? "vertical" : "horizontal", { dragging: G2 }, b2), style: fe2, children: [Ce2, Le2, Me2] });
1210
+ }));
1211
+ function Ct(e2) {
1212
+ if ("function" == typeof e2) return e2;
1213
+ if ("string" == typeof e2) {
1214
+ const t2 = e2.trim();
1215
+ if (t2.startsWith("data:image/svg+xml")) {
1216
+ const e3 = (function(e4) {
1217
+ const t3 = /^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(e4.trim());
1218
+ if (!t3) return null;
1219
+ const n2 = t3[1] || "", o2 = t3[2] || "";
1220
+ try {
1221
+ if (/;base64/i.test(n2)) {
1222
+ if ("undefined" != typeof atob) {
1223
+ const e5 = atob(o2);
1224
+ if ("undefined" != typeof TextDecoder) {
1225
+ const t5 = new Uint8Array(e5.length);
1226
+ for (let n3 = 0; n3 < e5.length; n3++) t5[n3] = e5.charCodeAt(n3);
1227
+ return new TextDecoder("utf-8").decode(t5);
1228
+ }
1229
+ let t4 = "";
1230
+ for (let n3 = 0; n3 < e5.length; n3++) {
1231
+ t4 += `%${e5.charCodeAt(n3).toString(16).padStart(2, "0")}`;
1232
+ }
1233
+ return decodeURIComponent(t4);
1234
+ }
1235
+ return (globalThis.Buffer ? globalThis.Buffer.from(o2, "base64") : require("buffer").Buffer.from(o2, "base64")).toString("utf-8");
1236
+ }
1237
+ try {
1238
+ return decodeURIComponent(o2);
1239
+ } catch {
1240
+ return o2;
1241
+ }
1242
+ } catch {
1243
+ return null;
1244
+ }
1245
+ })(t2);
1246
+ if (e3) return kt(e3);
1247
+ }
1248
+ if (t2.startsWith("<")) {
1249
+ if (/^<\s*svg\b/i.test(t2)) return kt(t2);
1250
+ if (/^<\s*path\b/i.test(t2)) {
1251
+ const e3 = Mt(t2);
1252
+ if (e3) return { paths: [{ d: e3 }] };
1253
+ }
1254
+ return { paths: [{ d: t2 }] };
1255
+ }
1256
+ return { paths: [{ d: t2 }] };
1257
+ }
1258
+ if (Array.isArray(e2)) {
1259
+ const t2 = [];
1260
+ for (const n2 of e2) if ("string" == typeof n2) {
1261
+ const e3 = String(n2).trim();
1262
+ if (e3.startsWith("<path")) {
1263
+ const n3 = Mt(e3);
1264
+ n3 && t2.push({ d: n3 });
1265
+ } else t2.push({ d: e3 });
1266
+ } else n2 && "object" == typeof n2 && "d" in n2 && "string" == typeof n2.d && t2.push({ ...n2 });
1267
+ return { paths: t2 };
1268
+ }
1269
+ return e2;
1270
+ }
1271
+ function Mt(e2) {
1272
+ const t2 = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(e2);
1273
+ return t2 ? t2[1] ?? t2[2] ?? null : null;
1274
+ }
1275
+ function Tt(e2) {
1276
+ if ("svg" in e2) return { ...e2, svg: Ct(e2.svg) };
1277
+ if ("url" in e2) {
1278
+ const t2 = "string" == typeof e2.url ? { src: e2.url } : e2.url;
1279
+ return { ...e2, url: t2 };
1280
+ }
1281
+ if ("emoji" in e2) {
1282
+ const t2 = "string" == typeof e2.emoji ? e2.emoji : e2.emoji.text;
1283
+ return { ...e2, emoji: t2 };
1284
+ }
1285
+ return e2;
1286
+ }
1287
+ function kt(e2) {
1288
+ try {
1289
+ if ("undefined" != typeof DOMParser) {
1290
+ const t3 = new DOMParser().parseFromString(e2, "image/svg+xml"), n3 = t3.querySelector("svg"), o3 = n3?.getAttribute("viewBox") ?? void 0, i3 = [];
1291
+ return t3.querySelectorAll("path").forEach((e3) => {
1292
+ const t4 = e3.getAttribute("d");
1293
+ if (!t4) return;
1294
+ const n4 = { d: t4 }, o4 = e3.getAttribute("class");
1295
+ o4 && (n4.className = o4);
1296
+ const r3 = e3.getAttribute("fill");
1297
+ r3 && "none" !== r3 && (n4.fill = r3);
1298
+ const s2 = e3.getAttribute("stroke");
1299
+ s2 && (n4.stroke = s2);
1300
+ const l2 = e3.getAttribute("opacity");
1301
+ l2 && (n4.opacity = Number(l2));
1302
+ const a2 = e3.getAttribute("fill-rule");
1303
+ a2 && (n4.fillRule = a2);
1304
+ const c2 = e3.getAttribute("clip-rule");
1305
+ c2 && (n4.clipRule = c2), i3.push(n4);
1306
+ }), { viewBox: o3, paths: i3 };
1307
+ }
1308
+ } catch {
1309
+ }
1310
+ const t2 = e2.match(/viewBox="([^"]+)"/i), n2 = t2 ? t2[1] : void 0, o2 = [], i2 = /<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;
1311
+ let r2;
1312
+ for (; r2 = i2.exec(e2); ) o2.push({ d: r2[1] });
1313
+ return { viewBox: n2, paths: o2 };
1314
+ }
1315
+ function Dt(e2) {
1316
+ const t2 = {};
1317
+ for (const [n3, o3] of Object.entries(e2.icons)) t2[n3] = Tt(o3);
1318
+ const n2 = { label: e2.meta?.label ?? "Unnamed", version: e2.meta?.version ?? "1.0.0", license: e2.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: e2.meta?.extends ?? [] };
1319
+ n2.extends.includes("base") || n2.extends.push("base");
1320
+ const o2 = { meta: n2, icons: t2 }, i2 = e2.overrides;
1321
+ if (i2) {
1322
+ const e3 = {};
1323
+ for (const [t3, n3] of Object.entries(i2)) {
1324
+ const o3 = {};
1325
+ for (const [e4, t4] of Object.entries(n3)) o3[e4] = Tt(t4);
1326
+ e3[t3] = o3;
1327
+ }
1328
+ o2.__overrides = e3;
1329
+ }
1330
+ return o2;
1331
+ }
1332
+ function Pt() {
1333
+ const e2 = /* @__PURE__ */ new Map(), t2 = /* @__PURE__ */ new Map();
1334
+ let n2 = "base", o2 = /* @__PURE__ */ new Map();
1335
+ async function i2(t3) {
1336
+ const o3 = e2.get(t3 ?? n2);
1337
+ if (!o3) throw new Error(`Icon pack not registered: ${t3}`);
1338
+ if (!o3.pack) {
1339
+ if (!o3.loading) {
1340
+ if (!o3.loader) throw new Error(`No loader for icon pack: ${t3}`);
1341
+ o3.loading = o3.loader().then((e3) => {
1342
+ const t4 = e3 && "object" == typeof e3 && "default" in e3 ? e3.default : e3;
1343
+ o3.pack = Dt(t4);
1344
+ }).catch((e3) => {
1345
+ throw o3.loading = void 0, e3;
1346
+ });
1347
+ }
1348
+ await o3.loading;
1349
+ }
1350
+ }
1351
+ function r2(e3) {
1352
+ const t3 = e3.indexOf(":");
1353
+ return t3 > 0 ? { ns: e3.slice(0, t3), key: e3.slice(t3 + 1) } : { key: e3 };
1354
+ }
1355
+ function s2(n3, o3) {
1356
+ const i3 = [n3, ...e2.get(n3)?.pack?.meta.extends ?? []];
1357
+ for (const n4 of i3) {
1358
+ const i4 = e2.get(n4);
1359
+ if (!i4?.pack) continue;
1360
+ const { icons: r3 } = i4.pack, s3 = r3[t2.get(n4)?.get(o3) ?? o3] ?? r3[o3];
1361
+ if (s3) return { glyph: s3, pack: i4.pack, packKey: n4 };
1362
+ }
1363
+ return null;
1364
+ }
1365
+ function l2(t3, o3) {
1366
+ const i3 = o3?.packKey ?? n2;
1367
+ if (o3?.packKey) return s2(o3.packKey, t3);
1368
+ if (!t3) return null;
1369
+ const { ns: l3, key: a2 } = r2(t3);
1370
+ if (l3) {
1371
+ const t4 = e2.get(l3)?.pack;
1372
+ if (t4) {
1373
+ if (!!e2.get(n2)?.pack) {
1374
+ const e3 = t4.__overrides, o5 = e3?.[n2]?.[a2];
1375
+ if (o5) return { glyph: o5, pack: t4, packKey: l3 };
1376
+ }
1377
+ const o4 = s2(l3, a2);
1378
+ if (o4) return o4;
1379
+ }
1380
+ return null;
1381
+ }
1382
+ return s2(i3, t3);
1383
+ }
1384
+ return { register: function(t3, o3) {
1385
+ const i3 = e2.get(t3) ?? {};
1386
+ "function" == typeof o3 ? i3.loader = o3 : i3.pack = Dt(o3), e2.set(t3, i3), n2 || (n2 = t3);
1387
+ }, prefetch: async function(e3 = n2) {
1388
+ const t3 = Array.isArray(e3) ? e3 : [e3];
1389
+ await Promise.all(t3.map(i2));
1390
+ }, setActive: function(e3) {
1391
+ n2 = e3;
1392
+ for (const t3 of o2.keys()) try {
1393
+ t3(e3);
1394
+ } catch (e4) {
1395
+ }
1396
+ }, getActive: function() {
1397
+ return n2;
1398
+ }, resolve: async function(t3, o3) {
1399
+ let s3 = l2(t3, o3);
1400
+ if (s3) return s3;
1401
+ const a2 = o3?.packKey ?? n2, { ns: c2 } = r2(t3);
1402
+ if (o3?.packKey) {
1403
+ if (await i2(a2), s3 = l2(t3, o3), s3) return s3;
1404
+ const n3 = e2.get(a2)?.pack?.meta?.extends ?? [];
1405
+ if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(t3, o3), s3)) return s3;
1406
+ } else if (c2) {
1407
+ if (await i2(c2), s3 = l2(t3, o3), s3) return s3;
1408
+ const n3 = e2.get(c2)?.pack?.meta?.extends ?? [];
1409
+ if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(t3, o3), s3)) return s3;
1410
+ } else {
1411
+ if (await i2(a2), s3 = l2(t3, o3), s3) return s3;
1412
+ const n3 = e2.get(a2)?.pack?.meta?.extends ?? [];
1413
+ if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(t3, o3), s3)) return s3;
1414
+ }
1415
+ return null;
1416
+ }, registerAlias: function(e3, n3, o3) {
1417
+ t2.has(e3) || t2.set(e3, /* @__PURE__ */ new Map()), t2.get(e3).set(n3, o3);
1418
+ }, has: function(e3, t3) {
1419
+ return !!l2(e3, t3);
1420
+ }, getPack: function(t3) {
1421
+ return e2.get(t3 ?? n2)?.pack;
1422
+ }, hasPack: function(t3) {
1423
+ return !!e2.get(t3)?.pack;
1424
+ }, listPacks: function() {
1425
+ return Array.from(e2.keys());
1426
+ }, listIcons: function(t3) {
1427
+ const n3 = e2.get(t3)?.pack;
1428
+ return n3 ? Object.keys(n3.icons) : [];
1429
+ }, addActiveListener: function(e3) {
1430
+ const t3 = o2.get(e3);
1431
+ if (t3) return t3;
1432
+ const n3 = () => {
1433
+ o2.delete(e3);
1434
+ };
1435
+ return o2.set(e3, n3), n3;
1436
+ } };
1437
+ }
1438
+ const At = Pt();
1439
+ At.register("base", () => import("./Cq6QyR2iVPDVSg3n.mjs"));
1440
+ const zt = (t2) => e("svg", { ...t2, children: e("path", {}) }), Bt = { Icon: "_Icon_1ipwo_10" }, $t = s((t2) => {
1441
+ const { iconKey: n2, packKey: i2, className: r2, style: s2, role: l2, title: a2, size: c2, ariaHidden: u2, sourceProps: d2, children: p2, ...f2 } = t2, [_2, m2] = o.useState(null);
1442
+ o.useEffect(() => {
1443
+ let e2 = true, t3 = i2, o2 = n2;
1444
+ if (!o2) {
1445
+ const e3 = At.getPack(t3);
1446
+ return void m2({ glyph: e3 ? { svg: x.EmptyArray } : void 0, pack: e3 ?? void 0, packKey: t3 ?? At.getActive() });
1447
+ }
1448
+ if (o2.includes(":")) {
1449
+ const [e3, n3] = o2.split(":");
1450
+ t3 = e3, o2 = n3;
1451
+ }
1452
+ return At.resolve(o2, { packKey: t3 }).then((t4) => {
1453
+ e2 && m2(t4);
1454
+ }), () => {
1455
+ e2 = false;
1456
+ };
1457
+ }, [n2, i2]);
1458
+ const g2 = _2?.pack, y2 = _2?.glyph, v2 = _2?.packKey;
1459
+ let w2 = y2 ? y2.svg : void 0;
1460
+ 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(() => [Bt.Icon, "icon", r2].filter(Boolean).join(" "), [r2]), C2 = h(() => {
1461
+ const e2 = { ...s2 };
1462
+ return e2["--icon-size"] = L2, e2;
1463
+ }, [s2, L2]), M2 = l2 ?? (a2 ? "img" : "presentation"), T2 = u2 ?? (!a2 || void 0), k2 = (t3) => e("span", { className: E2, style: C2, role: M2, "aria-hidden": T2, title: a2, "data-icon-glyph": n2, "data-icon-pack": v2, ...f2, children: t3 });
1464
+ if (p2) return k2(p2);
1465
+ if (S2) return k2(e("span", { children: "string" == typeof S2 ? S2 : S2.text }));
1466
+ if (b2) return k2(e("img", { src: b2.src, alt: a2 ?? "" }));
1467
+ if (y2 && "react" in y2) {
1468
+ const t3 = y2.react, n3 = { className: E2, style: C2, role: M2, "aria-hidden": T2, title: a2, ...f2, ...d2 };
1469
+ return k2(e(t3, { ...n3 }));
1470
+ }
1471
+ const D2 = { viewBox: w2?.viewBox ?? g2?.meta.defaultViewBox ?? "0 0 24 24" };
1472
+ if ("function" == typeof w2) {
1473
+ return k2(w2(D2) ?? e(zt, { ...D2 }));
1474
+ }
1475
+ if (!w2) return k2(e(zt, { ...D2 }));
1476
+ const P2 = w2.paths;
1477
+ return k2(e("svg", { ...D2, children: P2 ? P2.map((t3, n3) => e("path", { d: t3.d, className: t3.className, fill: t3.fill, stroke: t3.stroke, opacity: t3.opacity, fillRule: t3.fillRule, clipRule: t3.clipRule }, n3)) : null }));
1478
+ });
1479
+ function Ot(t2) {
1480
+ 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 } = t2, p2 = h(() => {
1481
+ if (!n2) return;
1482
+ const e2 = { "--walk-duration": `${i2 * (r2 + s2)}ms`, "--walk-dash-length": `${s2}px`, "--walk-dash-gap": `${r2}px` };
1483
+ return o2 && "accent" !== o2 && (e2["--icon-accent"] = `var(--icon-${o2})`), e2;
1484
+ }, [n2, i2, r2, s2, o2]), f2 = h(() => n2 ? u2 + " walking" : u2, [n2, u2]);
1485
+ return e($t, { iconKey: l2, packKey: a2, className: f2, style: { ...c2, ...p2 }, ...d2 });
1486
+ }
1161
1487
  export {
1162
- qe as Command,
1163
- st as CommandButtonType,
1164
- Qe as CommandGroup,
1165
- Ce as DefaultReactNotifier,
1166
- fe as FocusKeyNavigation,
1488
+ Fe as Command,
1489
+ et as CommandButtonType,
1490
+ Xe as CommandGroup,
1491
+ At as DefaultDynamicIconService,
1492
+ xe as DefaultReactNotifier,
1493
+ $t as DynamicIcon,
1494
+ yt as ErrorTestPanel,
1495
+ ge as FocusKeyNavigation,
1167
1496
  D as HorizontalAlignment,
1168
- z as KeyCodes,
1497
+ A as KeyCodes,
1169
1498
  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,
1499
+ z as MouseButtonCodes,
1500
+ be as NotifierProvider,
1501
+ ve as NotifierType,
1502
+ _t as ReactErrorBoundary,
1503
+ ne as ReactUtils,
1504
+ ye as RoundedTab,
1505
+ le as ScrollPane,
1506
+ V as ScrollUtils,
1507
+ W as Scrollbar,
1508
+ B as ScrollbarOrientation,
1509
+ Ye as SimpleCommand,
1510
+ Et as SplitPane,
1511
+ xt as SplitPaneResizer,
1182
1512
  me as ToolTipPlacement,
1183
- pe as VirtualScrollbar,
1184
- re as defaultCreateScrollCorner,
1185
- K as defaultCreateScrollEdgeButton,
1186
- O as defaultCreateScrollEndButton,
1187
- $ as defaultCreateScrollStartButton,
1188
- ie as defaultCreateScrollbar,
1189
- ze as getDevicePixelRatio,
1190
- nt as toShortcutString,
1191
- 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
1513
+ gt as UncaughtErrorBoundary,
1514
+ _e as VirtualScrollbar,
1515
+ Ot as WalkingIcon,
1516
+ Pt as createDynamicIconService,
1517
+ se as defaultCreateScrollCorner,
1518
+ H as defaultCreateScrollEdgeButton,
1519
+ K as defaultCreateScrollEndButton,
1520
+ O as defaultCreateScrollStartButton,
1521
+ re as defaultCreateScrollbar,
1522
+ Ee as getDevicePixelRatio,
1523
+ Ze as toShortcutString,
1524
+ $ as useCallbackRef,
1525
+ qe as useCommand,
1526
+ Qe as useCommands,
1527
+ nt as useCopyPaste,
1528
+ Le as useDevicePixelRatio,
1529
+ je as useEditMode,
1530
+ ce as useFullscreenPortal,
1531
+ tt as useGlobalClipboard,
1532
+ ct as useId,
1533
+ ie as useImperativeElement,
1534
+ Te as useMouseDownAndHoldListener,
1535
+ Se as useNotifier,
1536
+ Ce as useOnClickOrFocusAway,
1537
+ Me as useSynchronizedPointerHandler,
1538
+ ot as useTraceUpdate,
1539
+ pt as useUndoManager
1207
1540
  };