@sheetxl/utils-react 0.7.4 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,152 +1,152 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sheetxl-scrollbar_eblx4_6 ::-webkit-scrollbar-button{background:transparent}._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { jsx as L, jsxs as be, Fragment as De } from "react/jsx-runtime";
3
- import ce, { useLayoutEffect as Ie, useEffect as V, useState as G, useMemo as W, useCallback as H, useRef as A, memo as Le, forwardRef as Ce, useImperativeHandle as nn, version as on, createContext as rn, useContext as sn, createElement as ln, useReducer as an } from "react";
4
- import { CommonUtils as te, DelegatingNotifier as cn, Notifier as fe, InternalClipboard as Re, ClipboardUtils as We, MimeType as Fe } from "@sheetxl/utils";
5
- import { createRoot as hn } from "react-dom/client";
6
- import { unstable_batchedUpdates as un } from "react-dom";
1
+ (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode("._sheetxl-scrollbar_eblx4_6 ::-webkit-scrollbar-button{background:transparent}._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}:root{--icon-size-sm: .875rem;--icon-size-md: 1rem;--icon-size-lg: 1.25rem;--icon-size-xl: 1.5rem}._Icon_1ipwo_10{font-size:var(--icon-size, var(--icon-size-md));min-width:var(--icon-size, var(--icon-size-md));min-height:var(--icon-size, var(--icon-size-md));--icon-stroke-em: .085em;--icon-color: currentColor;--icon-secondary-color: color-mix(in oklab, currentColor 65%, transparent);--icon-tertiary-color: color-mix(in oklab, currentColor 40%, transparent);--icon-line-color: currentColor;--icon-main-opacity: 1;--icon-secondary-opacity: .45;--icon-tertiary-opacity: .25;--icon-line-opacity: 1;--icon-filter: none;filter:var(--icon-filter);display:inline-flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle;flex:0 0 auto}._Icon_1ipwo_10 .sm{--font-size: var(--icon-size-sm)}._Icon_1ipwo_10 .md{--font-size: var(--icon-size-md)}._Icon_1ipwo_10 .lg{--font-size: var(--icon-size-lg)}._Icon_1ipwo_10 .xl{--font-size: var(--icon-size-xl)}._Icon_1ipwo_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_1ipwo_10>img{aspect-ratio:1 / 1;display:block;line-height:1}._Icon_1ipwo_10 .fill,._Icon_1ipwo_10 .line{--layer-color: var(--icon-color);--layer-opacity: var(--icon-main-opacity)}._Icon_1ipwo_10 .secondary{--layer-color: var(--icon-secondary-color)}._Icon_1ipwo_10 .tertiary{--layer-color: var(--icon-tertiary-color)}._Icon_1ipwo_10 .primary{--layer-color: var(--sxl-app-color-primary, var(--icon-primary, #595b5e))}._Icon_1ipwo_10 .secondary{--layer-color: var(--sxl-app-color-secondary, #9c27b0)}._Icon_1ipwo_10 .secondary.light{--layer-color: var(--sxl-app-color-secondary-light, #a060ac)}._Icon_1ipwo_10 .success{--layer-color: var(--sxl-app-color-success, #22c55e)}._Icon_1ipwo_10 .success.light{--layer-color: var(--sxl-app-color-success-light, #22c55e)}._Icon_1ipwo_10 .info{--layer-color: var(--sxl-app-color-info, #3b82f6)}._Icon_1ipwo_10 .warn{--layer-color: var(--sxl-app-color-warn, #f59e0b)}._Icon_1ipwo_10 .error{--layer-color: var(--sxl-app-color-error, #ef4444)}._Icon_1ipwo_10 .error.light{--layer-color: var(--sxl-app-color-error-light, #f87171)}._Icon_1ipwo_10 .grey{--layer-color: var(--sxl-app-color-grey, #cccccc)}._Icon_1ipwo_10 .shadow{--layer-color: var(--sxl-app-color-shadow, #cccccc)}._Icon_1ipwo_10 .fill:not(.fixed){fill:var(--layer-color);opacity:var(--layer-opacity);stroke:none}._Icon_1ipwo_10 .line:not(.fixed){fill:none;stroke:var(--layer-color, var(--icon-line-color));stroke-width:var(--icon-stroke-em);opacity:var(--layer-opacity, var(--icon-line-opacity));vector-effect:non-scaling-stroke;pointer-events:none;stroke-linecap:var(--icon-linecap, round);stroke-linejoin:var(--icon-linejoin, round);stroke-miterlimit:var(--icon-miter, 4)}@media (prefers-color-scheme: dark){._Icon_1ipwo_10 .invert-dark{filter:invert(1) hue-rotate(180deg)}}._Icon_1ipwo_10 .muted{opacity:calc(var(--layer-opacity, 1) * .6)}@keyframes _sxl-walk_1ipwo_1{to{stroke-dashoffset:0}}.icon.walking .walkable.line{stroke-dasharray:var(--walk-dash-length, 5px) var(--walk-dash-gap, 2px);stroke-dashoffset:calc(var(--walk-dash-length, 5px) + var(--walk-dash-gap, 2px));animation:_sxl-walk_1ipwo_1 var(--walk-duration, .96s) linear infinite;will-change:stroke-dashoffset}")),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
+ import { jsx as L, jsxs as Se, Fragment as ke } from "react/jsx-runtime";
3
+ import ie, { useLayoutEffect as Ve, useEffect as V, useState as q, useMemo as N, useCallback as H, useRef as O, memo as ye, forwardRef as Ce, useImperativeHandle as cn, version as hn, createContext as un, useContext as dn, createElement as pn, useReducer as fn } from "react";
4
+ import { CommonUtils as Z, DefaultNotifier as _n, Notifier as me, InternalClipboard as Ie, ClipboardUtils as Fe, MimeType as je } from "@sheetxl/utils";
5
+ import { createRoot as mn } from "react-dom/client";
6
+ import { unstable_batchedUpdates as gn } from "react-dom";
7
7
  /**
8
- * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.4
8
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.6
9
9
  *
10
10
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
11
11
  * License: The license can be found at https://www.sheetxl.com/license.
12
12
  */
13
- const io = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, Z = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, ro = { 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 }, so = { Left: 1, Middle: 2, Right: 3 }, re = { Horizontal: "horizontal", Vertical: "vertical" };
14
- function Ct(i) {
13
+ const _o = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, G = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, mo = { 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 }, go = { Left: 1, Middle: 2, Right: 3 }, se = { Horizontal: "horizontal", Vertical: "vertical" };
14
+ function Pt(i) {
15
15
  var e, t, n = "";
16
16
  if (typeof i == "string" || typeof i == "number") n += i;
17
17
  else if (typeof i == "object") if (Array.isArray(i)) {
18
18
  var o = i.length;
19
- for (e = 0; e < o; e++) i[e] && (t = Ct(i[e])) && (n && (n += " "), n += t);
19
+ for (e = 0; e < o; e++) i[e] && (t = Pt(i[e])) && (n && (n += " "), n += t);
20
20
  } else for (t in i) i[t] && (n && (n += " "), n += t);
21
21
  return n;
22
22
  }
23
- function xe() {
24
- for (var i, e, t = 0, n = "", o = arguments.length; t < o; t++) (i = arguments[t]) && (e = Ct(i)) && (n && (n += " "), n += e);
23
+ function we() {
24
+ for (var i, e, t = 0, n = "", o = arguments.length; t < o; t++) (i = arguments[t]) && (e = Pt(i)) && (n && (n += " "), n += e);
25
25
  return n;
26
26
  }
27
- var dn = function() {
28
- }, Et = typeof window < "u", pn = Et ? Ie : V, pt = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
29
- const ge = Et && window.ResizeObserver !== void 0 ? function() {
30
- var i = G(null), e = i[0], t = i[1], n = G(pt), o = n[0], r = n[1], s = W(function() {
31
- return new window.ResizeObserver(function(l) {
32
- if (l[0]) {
33
- var a = l[0].contentRect, c = a.x, h = a.y, u = a.width, d = a.height, b = a.top, w = a.left, x = a.bottom, S = a.right;
34
- r({ x: c, y: h, width: u, height: d, top: b, left: w, bottom: x, right: S });
27
+ var yn = function() {
28
+ }, At = typeof window < "u", vn = At ? Ve : V, ft = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
29
+ const ge = At && window.ResizeObserver !== void 0 ? function() {
30
+ var i = q(null), e = i[0], t = i[1], n = q(ft), o = n[0], r = n[1], a = N(function() {
31
+ return new window.ResizeObserver(function(h) {
32
+ if (h[0]) {
33
+ var s = h[0].contentRect, l = s.x, c = s.y, u = s.width, d = s.height, f = s.top, v = s.left, m = s.bottom, b = s.right;
34
+ r({ x: l, y: c, width: u, height: d, top: f, left: v, bottom: m, right: b });
35
35
  }
36
36
  });
37
37
  }, []);
38
- return pn(function() {
39
- if (e) return s.observe(e), function() {
40
- s.disconnect();
38
+ return vn(function() {
39
+ if (e) return a.observe(e), function() {
40
+ a.disconnect();
41
41
  };
42
42
  }, [e]), [t, o];
43
43
  } : function() {
44
- return [dn, pt];
45
- }, T = (i, e) => {
46
- const t = H((...r) => i?.(...r), e), n = A(null);
44
+ return [yn, ft];
45
+ }, M = (i, e) => {
46
+ const t = H((...r) => i?.(...r), e), n = O(null);
47
47
  n.current = t;
48
48
  const o = H((...r) => n.current?.(...r), []);
49
49
  if (n.current) return o;
50
- }, _n = (i) => {
51
- const { style: e, orientation: t = re.Vertical, ...n } = i, o = t === re.Vertical;
50
+ }, xn = (i) => {
51
+ const { style: e, orientation: t = se.Vertical, ...n } = i, o = t === se.Vertical;
52
52
  return L("div", { style: { paddingBottom: "0px", paddingRight: "0px", paddingLeft: o ? "0px" : "3px", paddingTop: o ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...e }, ...n, children: L("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${o ? "vertical" : "horizontal"} single-button start`, children: L("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: L("path", { d: o ? "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" }) }) }) });
53
- }, mn = (i) => {
54
- const { style: e, orientation: t = re.Vertical, ...n } = i, o = t === re.Vertical;
53
+ }, wn = (i) => {
54
+ const { style: e, orientation: t = se.Vertical, ...n } = i, o = t === se.Vertical;
55
55
  return L("div", { style: { paddingLeft: "0px", paddingTop: "0px", paddingRight: o ? "0px" : "3px", paddingBottom: o ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...e }, ...n, children: L("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${o ? "vertical" : "horizontal"} single-button end`, children: L("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: L("path", { d: o ? "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" }) }) }) });
56
- }, lo = (i) => {
57
- const { style: e, orientation: t = re.Vertical, ...n } = i, o = t === re.Vertical;
56
+ }, yo = (i) => {
57
+ const { style: e, orientation: t = se.Vertical, ...n } = i, o = t === se.Vertical;
58
58
  return L("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...e }, className: `scrollbar-button ${o ? "vertical" : "horizontal"} edge`, ...n, children: L("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: o ? "rotate(90) " : "", children: L("path", { style: { transition: "opacity 240ms ease 0s", opacity: i.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" }) }) });
59
59
  }, Ze = (i, e, t, n, o = 0) => {
60
60
  for (let r = 0; r < t.length; r++) {
61
- const s = t[r].getBoundingClientRect();
62
- let l = s.left - e, a = l + s.width;
61
+ const a = t[r].getBoundingClientRect();
62
+ let h = a.left - e, s = h + a.width;
63
63
  if (n) {
64
- if (l < i && a >= i) return l;
65
- } else if (Math.ceil(a) > Math.ceil(i) + 2) return a;
64
+ if (h < i && s >= i) return h;
65
+ } else if (Math.ceil(s) > Math.ceil(i) + 2) return s;
66
66
  }
67
67
  return o;
68
- }, ao = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: Ze }, Symbol.toStringTag, { value: "Module" })), fn = "_sheetxl-scrollbar_eblx4_6", nt = Le(Ce((i, e) => {
69
- const { offset: t = 0, totalSize: n = 0, viewportSize: o = 0, style: r, className: s, orientation: l = re.Vertical, onScrollOffset: a, onScroll: c, showCustomScrollButtons: h = !1, scrollButtonIncrement: u = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: b = 120, createScrollStartButton: w = _n, createScrollEndButton: x = mn, ...S } = i, P = T(c, [c]), _ = A(null), [y, { width: f, height: k }] = ge(), [z, { width: $, height: I }] = ge(), g = l === re.Vertical, v = g ? "top" : "left", B = g ? "scrollTop" : "scrollLeft", p = g ? k : f, C = g ? I : $, [m, E] = G(null);
68
+ }, vo = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: Ze }, Symbol.toStringTag, { value: "Module" })), bn = "_sheetxl-scrollbar_eblx4_6", ot = ye(Ce((i, e) => {
69
+ const { offset: t = 0, totalSize: n = 0, viewportSize: o = 0, style: r, className: a, orientation: h = se.Vertical, onScrollOffset: s, onScroll: l, showCustomScrollButtons: c = !1, scrollButtonIncrement: u = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: f = 120, createScrollStartButton: v = xn, createScrollEndButton: m = wn, ...b } = i, T = M(l, [l]), _ = O(null), [w, { width: x, height: A }] = ge(), [P, { width: B, height: K }] = ge(), y = h === se.Vertical, S = y ? "top" : "left", z = y ? "scrollTop" : "scrollLeft", p = y ? A : x, C = y ? K : B, [g, E] = q(null);
70
70
  V(() => {
71
- m !== null && _.current && _.current.scrollTo({ behavior: "smooth", [v]: m });
72
- }, [m, g]);
73
- const D = H((K, se = !1) => {
71
+ g !== null && _.current && _.current.scrollTo({ behavior: "smooth", [S]: g });
72
+ }, [g, y]);
73
+ const k = H((R, le = !1) => {
74
74
  if (!_.current) return 0;
75
- const ie = _.current.querySelector(".scrollbar-viewport"), _e = ie.getBoundingClientRect(), le = ie.children, he = se ? 0 : Ze(K, _e[v], le, !0, Math.max(0, K - u));
75
+ const re = _.current.querySelector(".scrollbar-viewport"), fe = re.getBoundingClientRect(), ae = re.children, he = le ? 0 : Ze(R, fe[S], ae, !0, Math.max(0, R - u));
76
76
  return E(he), Math.max(0, he);
77
- }, []), q = H((K, se = !1) => {
77
+ }, []), J = H((R, le = !1) => {
78
78
  if (!_.current) return 0;
79
- const ie = _.current.querySelector(".scrollbar-viewport"), _e = ie.getBoundingClientRect(), le = ie.children, he = Math.ceil(C - p), Ee = se ? he : Ze(K, _e[v], le, !1, Math.max(0, K + u));
79
+ const re = _.current.querySelector(".scrollbar-viewport"), fe = re.getBoundingClientRect(), ae = re.children, he = Math.ceil(C - p), Ee = le ? he : Ze(R, fe[S], ae, !1, Math.max(0, R + u));
80
80
  return E(Ee), Math.min(he, Ee);
81
- }, [C, p]), F = A(null), Y = H((K) => {
81
+ }, [C, p]), F = O(null), j = H((R) => {
82
82
  F.current = t;
83
- const se = K.target[B];
84
- a(se, o, n), P?.(K);
85
- }, [a, o, n, t]);
83
+ const le = R.target[z];
84
+ s(le, o, n), T?.(R);
85
+ }, [s, o, n, t]);
86
86
  V(() => {
87
- const K = F.current;
88
- F.current = null, t !== K && (_.current[B] = t);
89
- }, [t, B]);
90
- const X = A(null), O = A(null), N = H(() => {
91
- X.current && (clearTimeout(X.current), X.current = null, O.current = null);
92
- }, []), j = H((K, se, ie, _e = d) => {
93
- O.current = K, X.current = setTimeout(() => {
94
- const le = ie ? D(O.current || K) : q(O.current || K);
95
- le !== O.current ? j(le, !1, ie, b) : N();
96
- }, se ? 0 : _e);
97
- }, [D, q, N]);
98
- V(() => () => N(), [N]);
99
- const ne = t, ye = W(() => {
100
- if (!h) return null;
101
- const K = { orientation: l, disabled: Math.floor(ne) <= 0 || Math.floor(C - p) === 0, onMouseUp: N, onMouseLeave: N, onMouseDown: () => j(ne, !0, !0) };
102
- return w?.(K);
103
- }, [h, l, ne, m, C, p]), ve = W(() => {
104
- if (!h) return null;
105
- const K = { orientation: l, disabled: Math.floor(C - p) <= Math.ceil(ne), onMouseUp: N, onMouseLeave: N, onMouseDown: () => j(ne, !0, !1) };
106
- return x?.(K);
107
- }, [h, l, ne, m, C, p]);
108
- return be("div", { ref: e, style: { display: "flex", flex: "1", flexDirection: g ? "column" : "row", padding: "0", ...r }, className: xe(fn, s), ...S, children: [ye, L("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: g ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: y, children: L("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: g ? "scroll" : "hidden", overflowX: g ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: Y, ref: _, children: L("div", { ref: z, style: { position: "absolute", height: g ? n - o + (k ?? 0) : 1, width: g ? 1 : n - o + (f ?? 0) }, className: "scrollbar-viewport" }) }) }), ve] });
87
+ const R = F.current;
88
+ F.current = null, t !== R && (_.current[z] = t);
89
+ }, [t, z]);
90
+ const Y = O(null), $ = O(null), W = H(() => {
91
+ Y.current && (clearTimeout(Y.current), Y.current = null, $.current = null);
92
+ }, []), X = H((R, le, re, fe = d) => {
93
+ $.current = R, Y.current = setTimeout(() => {
94
+ const ae = re ? k($.current || R) : J($.current || R);
95
+ ae !== $.current ? X(ae, !1, re, f) : W();
96
+ }, le ? 0 : fe);
97
+ }, [k, J, W]);
98
+ V(() => () => W(), [W]);
99
+ const ne = t, ve = N(() => {
100
+ if (!c) return null;
101
+ const R = { orientation: h, disabled: Math.floor(ne) <= 0 || Math.floor(C - p) === 0, onMouseUp: W, onMouseLeave: W, onMouseDown: () => X(ne, !0, !0) };
102
+ return v?.(R);
103
+ }, [c, h, ne, g, C, p]), xe = N(() => {
104
+ if (!c) return null;
105
+ const R = { orientation: h, disabled: Math.floor(C - p) <= Math.ceil(ne), onMouseUp: W, onMouseLeave: W, onMouseDown: () => X(ne, !0, !1) };
106
+ return m?.(R);
107
+ }, [c, h, ne, g, C, p]);
108
+ return Se("div", { ref: e, style: { display: "flex", flex: "1", flexDirection: y ? "column" : "row", padding: "0", ...r }, className: we(bn, a), ...b, children: [ve, L("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: y ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: w, children: L("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: y ? "scroll" : "hidden", overflowX: y ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: j, ref: _, children: L("div", { ref: P, style: { position: "absolute", height: y ? n - o + (A ?? 0) : 1, width: y ? 1 : n - o + (x ?? 0) }, className: "scrollbar-viewport" }) }) }), xe] });
109
109
  }));
110
- nt.displayName = "Scrollbar";
111
- let _t = Date.now, mt = 1e3, pe = {}, gn = 1;
110
+ ot.displayName = "Scrollbar";
111
+ let _t = Date.now, mt = 1e3, pe = {}, Sn = 1;
112
112
  const Te = (i) => {
113
113
  let e = pe[i] !== null;
114
114
  return e && (pe[i] = null), e;
115
- }, ft = (i, e, t, n = 0, o) => {
116
- let r = _t(), s = r, l = 0, a = 0, c = 0, h = gn++;
117
- if (h % 20 == 0) {
115
+ }, gt = (i, e, t, n = 0, o) => {
116
+ let r = _t(), a = r, h = 0, s = 0, l = 0, c = Sn++;
117
+ if (c % 20 == 0) {
118
118
  const d = {};
119
- for (let b in pe) d[b] = !0;
119
+ for (let f in pe) d[f] = !0;
120
120
  pe = d;
121
121
  }
122
122
  const u = function(d) {
123
- let b = d !== !0, w = _t(), x = !0;
123
+ let f = d !== !0, v = _t(), m = !0;
124
124
  try {
125
- x = (!e || e(h)) ?? !0;
125
+ m = (!e || e(c)) ?? !0;
126
126
  } catch {
127
- x = !1;
127
+ m = !1;
128
128
  }
129
- if (!pe[h] || !x) return pe[h] = null, void t?.(60 - a / ((w - r) / mt), h, !1);
130
- if (b) {
131
- c = Math.round((w - s) / 16.666666666666668) - 1;
132
- for (let _ = 0; _ < Math.min(c, 4); _++) u(!0), a++;
129
+ if (!pe[c] || !m) return pe[c] = null, void t?.(60 - s / ((v - r) / mt), c, !1);
130
+ if (f) {
131
+ l = Math.round((v - a) / 16.666666666666668) - 1;
132
+ for (let _ = 0; _ < Math.min(l, 4); _++) u(!0), s++;
133
133
  }
134
- n && (l = (w - r) / n, l > 1 && (l = 1));
135
- let S = o ? o(l) : l, P = !1;
134
+ n && (h = (v - r) / n, h > 1 && (h = 1));
135
+ let b = o ? o(h) : h, T = !1;
136
136
  try {
137
- P = i(S, w, b);
137
+ T = i(b, v, f);
138
138
  } catch {
139
- P = !1;
139
+ T = !1;
140
140
  }
141
- P !== !1 && l !== 1 || !b ? b && (s = w, requestAnimationFrame(u)) : (pe[h] = null, t?.(60 - a / ((w - r) / mt), h, l === 1 || n == null));
141
+ T !== !1 && h !== 1 || !f ? f && (a = v, requestAnimationFrame(u)) : (pe[c] = null, t?.(60 - s / ((v - r) / mt), c, h === 1 || n == null));
142
142
  };
143
- return pe[h] = !0, requestAnimationFrame(u), h;
144
- }, yn = function(i) {
143
+ return pe[c] = !0, requestAnimationFrame(u), c;
144
+ }, Ln = function(i) {
145
145
  return Math.pow(i - 1, 3) + 1;
146
- }, vn = function(i) {
146
+ }, Cn = function(i) {
147
147
  return (i /= 0.5) < 1 ? 0.5 * Math.pow(i, 3) : 0.5 * (Math.pow(i - 2, 3) + 2);
148
148
  };
149
- class xn {
149
+ class En {
150
150
  constructor(e, t) {
151
151
  this.__isSingleTouch = !1, this.__isTracking = !1, this.__didDecelerationComplete = !1, this.__isGesturing = !1, this.__isDragging = !1, this.__isDecelerating = 0, this.__isAnimating = 0, this.__interruptedAnimation = !1, this.__lastScale = 1, this.__enableScrollX = !0, this.__enableScrollY = !0, 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 = e, this.options = { scrollingX: !0, scrollingY: !0, animating: !0, animationDuration: 250, bouncing: !0, locking: !0, paging: !1, snapping: !1, zooming: !1, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: void 0, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08, ...t };
152
152
  }
@@ -172,11 +172,11 @@ class xn {
172
172
  zoomTo(e, t = !1, n, o, r) {
173
173
  if (!this.options.zooming) throw new Error("Zooming is not enabled!");
174
174
  r && (this.__zoomComplete = r), this.__isDecelerating && (Te(this.__isDecelerating), this.__isDecelerating = 0);
175
- const s = this.__zoomLevel;
175
+ const a = this.__zoomLevel;
176
176
  n === void 0 && (n = this.__clientWidth / 2), o === void 0 && (o = this.__clientHeight / 2), e = Math.max(Math.min(e, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(e);
177
- const l = e / s;
178
- let a = l * (this.__scrollLeft + n) - n, c = l * (this.__scrollTop + o) - o;
179
- a > this.__maxScrollLeft ? a = this.__maxScrollLeft : a < 0 && (a = 0), c > this.__maxScrollTop ? c = this.__maxScrollTop : c < 0 && (c = 0), this.__publish(a, c, e, t);
177
+ const h = e / a;
178
+ let s = h * (this.__scrollLeft + n) - n, l = h * (this.__scrollTop + o) - o;
179
+ s > this.__maxScrollLeft ? s = this.__maxScrollLeft : s < 0 && (s = 0), l > this.__maxScrollTop ? l = this.__maxScrollTop : l < 0 && (l = 0), this.__publish(s, l, e, t);
180
180
  }
181
181
  zoomBy(e, t = !1, n = 0, o = 0, r) {
182
182
  this.zoomTo(this.__zoomLevel * e, t, n, o, r);
@@ -210,30 +210,30 @@ class xn {
210
210
  if (!this.__isTracking) return;
211
211
  let o, r;
212
212
  e.length === 2 ? (o = Math.abs(e[0].pageX + e[1].pageX) / 2, r = Math.abs(e[0].pageY + e[1].pageY) / 2) : (o = e[0].pageX, r = e[0].pageY);
213
- let s = this.__positions;
213
+ let a = this.__positions;
214
214
  if (this.__isDragging) {
215
- let l = o - this.__lastTouchLeft, a = r - this.__lastTouchTop, c = this.__scrollLeft, h = this.__scrollTop, u = this.__zoomLevel;
215
+ let h = o - this.__lastTouchLeft, s = r - this.__lastTouchTop, l = this.__scrollLeft, c = this.__scrollTop, u = this.__zoomLevel;
216
216
  if (n !== void 0 && this.options.zooming) {
217
217
  let d = u;
218
218
  if (u = u / this.__lastScale * n, u = Math.max(Math.min(u, this.options.maxZoom), this.options.minZoom), d !== u) {
219
- let b = o - this.__clientLeft, w = r - this.__clientTop;
220
- c = (b + c) * u / d - b, h = (w + h) * u / d - w, this.__computeScrollMax(u);
219
+ let f = o - this.__clientLeft, v = r - this.__clientTop;
220
+ l = (f + l) * u / d - f, c = (v + c) * u / d - v, this.__computeScrollMax(u);
221
221
  }
222
222
  }
223
223
  if (this.__enableScrollX) {
224
- c -= l * this.options.speedMultiplier;
224
+ l -= h * this.options.speedMultiplier;
225
225
  let d = this.__maxScrollLeft;
226
- (c > d || c < 0) && (this.options.bouncing ? c += l / 2 * this.options.speedMultiplier : c = c > d ? d : 0);
226
+ (l > d || l < 0) && (this.options.bouncing ? l += h / 2 * this.options.speedMultiplier : l = l > d ? d : 0);
227
227
  }
228
228
  if (this.__enableScrollY) {
229
- h -= a * this.options.speedMultiplier;
229
+ c -= s * this.options.speedMultiplier;
230
230
  const d = this.__maxScrollTop;
231
- (h > d || h < 0) && (this.options.bouncing ? h += a / 2 * this.options.speedMultiplier : h = h > d ? d : 0);
231
+ (c > d || c < 0) && (this.options.bouncing ? c += s / 2 * this.options.speedMultiplier : c = c > d ? d : 0);
232
232
  }
233
- s.length > 60 && s.splice(0, 30), s.push(c, h, t), this.__publish(c, h, u);
233
+ a.length > 60 && a.splice(0, 30), a.push(l, c, t), this.__publish(l, c, u);
234
234
  } else {
235
- let l = this.options.locking ? 3 : 0, a = 5, c = Math.abs(o - this.__initialTouchLeft), h = Math.abs(r - this.__initialTouchTop);
236
- this.__enableScrollX = this.options.scrollingX && c >= l, this.__enableScrollY = this.options.scrollingY && h >= l, s.push(this.__scrollLeft, this.__scrollTop, t), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (c >= a || h >= a), this.__isDragging && (this.__interruptedAnimation = !1);
235
+ let h = this.options.locking ? 3 : 0, s = 5, l = Math.abs(o - this.__initialTouchLeft), c = Math.abs(r - this.__initialTouchTop);
236
+ this.__enableScrollX = this.options.scrollingX && l >= h, this.__enableScrollY = this.options.scrollingY && c >= h, a.push(this.__scrollLeft, this.__scrollTop, t), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (l >= s || c >= s), this.__isDragging && (this.__interruptedAnimation = !1);
237
237
  }
238
238
  this.__lastTouchLeft = o, this.__lastTouchTop = r, this.__lastTouchMove = t, this.__lastScale = n;
239
239
  }
@@ -244,10 +244,10 @@ class xn {
244
244
  let t = this.__positions, n = t.length - 1, o = n;
245
245
  for (let r = n; r > 0 && t[r] > this.__lastTouchMove - 100; r -= 3) o = r;
246
246
  if (o !== n) {
247
- const r = t[n] - t[o], s = this.__scrollLeft - t[o - 2], l = this.__scrollTop - t[o - 1];
248
- this.__decelerationVelocityX = s / r * (1e3 / 60), this.__decelerationVelocityY = l / r * (1e3 / 60);
249
- const a = this.options.paging || this.options.snapping ? 4 : 1;
250
- (Math.abs(this.__decelerationVelocityX) > a || Math.abs(this.__decelerationVelocityY) > a) && this.__startDeceleration(e);
247
+ const r = t[n] - t[o], a = this.__scrollLeft - t[o - 2], h = this.__scrollTop - t[o - 1];
248
+ this.__decelerationVelocityX = a / r * (1e3 / 60), this.__decelerationVelocityY = h / r * (1e3 / 60);
249
+ const s = this.options.paging || this.options.snapping ? 4 : 1;
250
+ (Math.abs(this.__decelerationVelocityX) > s || Math.abs(this.__decelerationVelocityY) > s) && this.__startDeceleration(e);
251
251
  } else this.options.scrollingComplete?.();
252
252
  } else e - this.__lastTouchMove > 100 && this.options.scrollingComplete?.();
253
253
  this.__isDecelerating || ((this.__interruptedAnimation || this.__isDragging) && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, !0, this.__zoomLevel)), this.__positions.length = 0;
@@ -257,14 +257,14 @@ class xn {
257
257
  const r = this.__isAnimating;
258
258
  if (r && (Te(r), this.__isAnimating = 0), o && this.options.animating) {
259
259
  this.__scheduledLeft = e, this.__scheduledTop = t, this.__scheduledZoom = n;
260
- const s = this.__scrollLeft, l = this.__scrollTop, a = this.__zoomLevel, c = e - s, h = t - l, u = n - a, d = function(x, S, P) {
261
- P && (this.__scrollLeft = s + c * x, this.__scrollTop = l + h * x, this.__zoomLevel = a + u * x, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
262
- }.bind(this), b = function(x) {
263
- return this.__isAnimating === x;
264
- }.bind(this), w = function(x, S, P) {
265
- S === this.__isAnimating && (this.__isAnimating = !1), (this.__didDecelerationComplete || P) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
260
+ const a = this.__scrollLeft, h = this.__scrollTop, s = this.__zoomLevel, l = e - a, c = t - h, u = n - s, d = function(m, b, T) {
261
+ T && (this.__scrollLeft = a + l * m, this.__scrollTop = h + c * m, this.__zoomLevel = s + u * m, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
262
+ }.bind(this), f = function(m) {
263
+ return this.__isAnimating === m;
264
+ }.bind(this), v = function(m, b, T) {
265
+ b === this.__isAnimating && (this.__isAnimating = !1), (this.__didDecelerationComplete || T) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
266
266
  }.bind(this);
267
- this.__isAnimating = ft(d, b, w, this.options.animationDuration, r ? yn : vn);
267
+ this.__isAnimating = gt(d, f, v, this.options.animationDuration, r ? Ln : Cn);
268
268
  } else this.__scheduledLeft = this.__scrollLeft = e, this.__scheduledTop = this.__scrollTop = t, this.__scheduledZoom = this.__zoomLevel = n, this.__callback && this.__callback(e, t, n), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
269
269
  }
270
270
  __computeScrollMax(e = this.__zoomLevel) {
@@ -272,18 +272,18 @@ class xn {
272
272
  }
273
273
  __startDeceleration(e) {
274
274
  if (this.options.paging) {
275
- const s = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), l = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), a = this.__clientWidth, c = this.__clientHeight;
276
- this.__minDecelerationScrollLeft = Math.floor(s / a) * a, this.__minDecelerationScrollTop = Math.floor(l / c) * c, this.__maxDecelerationScrollLeft = Math.ceil(s / a) * a, this.__maxDecelerationScrollTop = Math.ceil(l / c) * c;
275
+ const a = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), h = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), s = this.__clientWidth, l = this.__clientHeight;
276
+ this.__minDecelerationScrollLeft = Math.floor(a / s) * s, this.__minDecelerationScrollTop = Math.floor(h / l) * l, this.__maxDecelerationScrollLeft = Math.ceil(a / s) * s, this.__maxDecelerationScrollTop = Math.ceil(h / l) * l;
277
277
  } else this.__minDecelerationScrollLeft = 0, this.__minDecelerationScrollTop = 0, this.__maxDecelerationScrollLeft = this.__maxScrollLeft, this.__maxDecelerationScrollTop = this.__maxScrollTop;
278
- const t = function(s, l, a) {
279
- this.__stepThroughDeceleration(a);
278
+ const t = function(a, h, s) {
279
+ this.__stepThroughDeceleration(s);
280
280
  }.bind(this), n = this.options.snapping ? 4 : 0.1, o = function() {
281
- const s = Math.abs(this.__decelerationVelocityX) >= n || Math.abs(this.__decelerationVelocityY) >= n;
282
- return s || (this.__didDecelerationComplete = !0), s;
283
- }.bind(this), r = function(s, l, a) {
281
+ const a = Math.abs(this.__decelerationVelocityX) >= n || Math.abs(this.__decelerationVelocityY) >= n;
282
+ return a || (this.__didDecelerationComplete = !0), a;
283
+ }.bind(this), r = function(a, h, s) {
284
284
  this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
285
285
  }.bind(this);
286
- this.__isDecelerating = ft(t, o, r);
286
+ this.__isDecelerating = gt(t, o, r);
287
287
  }
288
288
  __stepThroughDeceleration(e) {
289
289
  let t = this.__scrollLeft + this.__decelerationVelocityX, n = this.__scrollTop + this.__decelerationVelocityY;
@@ -294,24 +294,24 @@ class xn {
294
294
  r !== n && (n = r, this.__decelerationVelocityY = 0);
295
295
  }
296
296
  if (e ? this.__publish(t, n, this.__zoomLevel) : (this.__scrollLeft = t, this.__scrollTop = n), !this.options.paging && (this.__decelerationVelocityX *= 0.95, this.__decelerationVelocityY *= 0.95), this.options.bouncing) {
297
- let o = 0, r = 0, s = this.options.penetrationDeceleration, l = this.options.penetrationAcceleration;
298
- t < this.__minDecelerationScrollLeft ? o = this.__minDecelerationScrollLeft - t : t > this.__maxDecelerationScrollLeft && (o = this.__maxDecelerationScrollLeft - t), n < this.__minDecelerationScrollTop ? r = this.__minDecelerationScrollTop - n : n > this.__maxDecelerationScrollTop && (r = this.__maxDecelerationScrollTop - n), o !== 0 && (o * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += o * s : this.__decelerationVelocityX = o * l), r !== 0 && (r * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += r * s : this.__decelerationVelocityY = r * l);
297
+ let o = 0, r = 0, a = this.options.penetrationDeceleration, h = this.options.penetrationAcceleration;
298
+ t < this.__minDecelerationScrollLeft ? o = this.__minDecelerationScrollLeft - t : t > this.__maxDecelerationScrollLeft && (o = this.__maxDecelerationScrollLeft - t), n < this.__minDecelerationScrollTop ? r = this.__minDecelerationScrollTop - n : n > this.__maxDecelerationScrollTop && (r = this.__maxDecelerationScrollTop - n), o !== 0 && (o * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += o * a : this.__decelerationVelocityX = o * h), r !== 0 && (r * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += r * a : this.__decelerationVelocityY = r * h);
299
299
  }
300
300
  }
301
301
  }
302
- var Q = typeof window < "u" ? window : { screen: {}, navigator: {} }, Se = (Q.matchMedia || function() {
302
+ var ee = typeof window < "u" ? window : { screen: {}, navigator: {} }, Le = (ee.matchMedia || function() {
303
303
  return { matches: !1 };
304
- }).bind(Q), Tt = !1, wn = { get passive() {
305
- return Tt = !0;
306
- } }, gt = function() {
304
+ }).bind(ee), zt = !1, Tn = { get passive() {
305
+ return zt = !0;
306
+ } }, yt = function() {
307
307
  };
308
- Q.addEventListener && Q.addEventListener("p", gt, wn), Q.removeEventListener && Q.removeEventListener("p", gt, !1);
309
- var bn = Tt, Sn = "PointerEvent" in Q, ot = "ontouchstart" in Q, Mt = ot || "TouchEvent" in Q && Se("(any-pointer: coarse)").matches, yt = (Q.navigator.maxTouchPoints || 0) > 0 || Mt, Dt = Q.navigator.userAgent || "", Ln = Se("(pointer: coarse)").matches && /iPad|Macintosh/.test(Dt) && Math.min(Q.screen.width || 0, Q.screen.height || 0) >= 768, Pt = (Se("(pointer: coarse)").matches || !Se("(pointer: fine)").matches && ot) && !/Windows.*Firefox/.test(Dt), Cn = Se("(any-pointer: fine)").matches || Se("(any-hover: hover)").matches || Ln || !ot, Ge = !yt || !Cn && Pt ? yt ? "touchOnly" : "mouseOnly" : "hybrid", En = Ge === "mouseOnly" ? "mouse" : Ge === "touchOnly" || Pt ? "touch" : "mouse";
310
- const Tn = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: Ge, primaryInput: En, supportsPassiveEvents: bn, supportsPointerEvents: Sn, supportsTouchEvents: Mt }, Symbol.toStringTag, { value: "Module" })), Mn = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), zt = {};
311
- function qe() {
312
- return Tn;
308
+ ee.addEventListener && ee.addEventListener("p", yt, Tn), ee.removeEventListener && ee.removeEventListener("p", yt, !1);
309
+ var Mn = zt, kn = "PointerEvent" in ee, it = "ontouchstart" in ee, Bt = it || "TouchEvent" in ee && Le("(any-pointer: coarse)").matches, vt = (ee.navigator.maxTouchPoints || 0) > 0 || Bt, Ot = ee.navigator.userAgent || "", Dn = Le("(pointer: coarse)").matches && /iPad|Macintosh/.test(Ot) && Math.min(ee.screen.width || 0, ee.screen.height || 0) >= 768, $t = (Le("(pointer: coarse)").matches || !Le("(pointer: fine)").matches && it) && !/Windows.*Firefox/.test(Ot), Pn = Le("(any-pointer: fine)").matches || Le("(any-hover: hover)").matches || Dn || !it, qe = !vt || !Pn && $t ? vt ? "touchOnly" : "mouseOnly" : "hybrid", An = qe === "mouseOnly" ? "mouse" : qe === "touchOnly" || $t ? "touch" : "mouse";
310
+ const zn = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: qe, primaryInput: An, supportsPassiveEvents: Mn, supportsPointerEvents: kn, supportsTouchEvents: Bt }, Symbol.toStringTag, { value: "Module" })), Bn = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), Kt = {};
311
+ function Je() {
312
+ return zn;
313
313
  }
314
- const kt = (i) => i === "BracketLeft" ? "[" : i === "BracketRight" ? "]" : te.camelToPrettyCase(i), co = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: zt, boundPixel: function(i, e = !1, t = 0) {
314
+ const Rt = (i) => i === "BracketLeft" ? "[" : i === "BracketRight" ? "]" : Z.camelToPrettyCase(i), xo = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: Kt, boundPixel: function(i, e = !1, t = 0) {
315
315
  return i;
316
316
  }, createSyntheticEvent: (i) => {
317
317
  let e = !1, t = !1;
@@ -321,65 +321,65 @@ const kt = (i) => i === "BracketLeft" ? "[" : i === "BracketRight" ? "]" : te.ca
321
321
  t = !0, i.stopPropagation();
322
322
  }, isPropagationStopped: () => t, persist: () => {
323
323
  }, timeStamp: i.timeStamp, type: i.type };
324
- }, detectIt: qe, focusableNodeNames: Mn, toPrettyKeyCode: kt }, Symbol.toStringTag, { value: "Module" })), Dn = [];
325
- function At(i, e, t = Dn) {
326
- const n = A(null);
327
- return nn(i, () => {
324
+ }, detectIt: Je, focusableNodeNames: Bn, toPrettyKeyCode: Rt }, Symbol.toStringTag, { value: "Module" })), On = [];
325
+ function It(i, e, t = On) {
326
+ const n = O(null);
327
+ return cn(i, () => {
328
328
  if (!n.current) return;
329
329
  const o = n.current, r = e?.();
330
330
  if (!r || typeof r != "object") throw new Error("attributes must return a plain object of values");
331
- const s = Object.keys(r), l = s.length;
332
- for (let a = 0; a < l; a++) {
333
- const c = s[a], h = r[c];
334
- Object.defineProperty(o, c, { value: h, writable: !0, configurable: !0, enumerable: !0 });
331
+ const a = Object.keys(r), h = a.length;
332
+ for (let s = 0; s < h; s++) {
333
+ const l = a[s], c = r[l];
334
+ Object.defineProperty(o, l, { value: c, writable: !0, configurable: !0, enumerable: !0 });
335
335
  }
336
336
  return o;
337
337
  }, t), n;
338
338
  }
339
- const vt = (i) => L(nt, { ...i }), Pn = ({ width: i, height: e }) => L("div", { className: "corner", style: { minWidth: `${i}px`, width: `${i}px`, minHeight: `${e}px`, height: `${e}px` } }), zn = Le(Ce((i, e) => {
340
- const { children: t, viewport: n, onScrollViewport: o, showHorizontalScrollbar: r = !0, showVerticalScrollbar: s = !0, createScrollCorner: l = Pn, createHorizontalScrollbar: a = vt, createVerticalScrollbar: c = vt, style: h, touchElement: u, disableTouch: d, ...b } = i, w = T(o, [o]), x = At(e, () => ({ isScrollPane: () => !0 }), []), S = A(null);
339
+ const xt = (i) => L(ot, { ...i }), $n = ({ width: i, height: e }) => L("div", { className: "corner", style: { minWidth: `${i}px`, width: `${i}px`, minHeight: `${e}px`, height: `${e}px` } }), Kn = ye(Ce((i, e) => {
340
+ const { children: t, viewport: n, onScrollViewport: o, showHorizontalScrollbar: r = !0, showVerticalScrollbar: a = !0, createScrollCorner: h = $n, createHorizontalScrollbar: s = xt, createVerticalScrollbar: l = xt, style: c, touchElement: u, disableTouch: d, ...f } = i, v = M(o, [o]), m = It(e, () => ({ isScrollPane: () => !0 }), []), b = O(null);
341
341
  V(() => {
342
- S.current && (S.current.__scrollTop === n?.top && S.current.__scrollLeft === n?.left || S.current.__isDecelerating || S.current?.scrollTo(n?.left, n?.top, !1));
342
+ b.current && (b.current.__scrollTop === n?.top && b.current.__scrollLeft === n?.left || b.current.__isDecelerating || b.current?.scrollTo(n?.left, n?.top, !1));
343
343
  }, [n?.left, n?.top, u]);
344
- const P = H((p, C) => {
345
- w?.({ left: p, top: C });
344
+ const T = H((p, C) => {
345
+ v?.({ left: p, top: C });
346
346
  }, []), _ = H((p) => {
347
- S.current?.doTouchStart(p.touches, p.timeStamp);
348
- }, []), y = H((p) => {
349
- p.preventDefault(), S.current?.doTouchMove(p.touches, p.timeStamp);
350
- }, []), f = H((p) => {
351
- S.current?.doTouchEnd(p.timeStamp);
352
- }, []), k = H(({ containerWidth: p, containerHeight: C, totalWidth: m, totalHeight: E }) => {
353
- S.current.setDimensions(p, C, m, E);
347
+ b.current?.doTouchStart(p.touches, p.timeStamp);
348
+ }, []), w = H((p) => {
349
+ p.preventDefault(), b.current?.doTouchMove(p.touches, p.timeStamp);
350
+ }, []), x = H((p) => {
351
+ b.current?.doTouchEnd(p.timeStamp);
352
+ }, []), A = H(({ containerWidth: p, containerHeight: C, totalWidth: g, totalHeight: E }) => {
353
+ b.current.setDimensions(p, C, g, E);
354
354
  }, []);
355
355
  V(() => {
356
- const p = u ?? x.current;
357
- if (!d && qe().supportsTouchEvents && p && n) {
358
- if (!S.current) {
356
+ const p = u ?? m.current;
357
+ if (!d && Je().supportsTouchEvents && p && n) {
358
+ if (!b.current) {
359
359
  const C = { scrollingX: !0, scrollingY: !0, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
360
- S.current = new xn(P, C);
360
+ b.current = new En(T, C);
361
361
  }
362
- qe().supportsTouchEvents && (p.addEventListener("touchstart", _), p.addEventListener("touchend", f), p.addEventListener("touchmove", y)), k({ containerWidth: n?.width, containerHeight: n?.height, totalWidth: n?.totalWidth, totalHeight: n?.totalHeight });
362
+ Je().supportsTouchEvents && (p.addEventListener("touchstart", _), p.addEventListener("touchend", x), p.addEventListener("touchmove", w)), A({ containerWidth: n?.width, containerHeight: n?.height, totalWidth: n?.totalWidth, totalHeight: n?.totalHeight });
363
363
  }
364
364
  return () => {
365
- p?.removeEventListener("touchstart", _), p?.removeEventListener("touchend", f), p?.removeEventListener("touchmove", y);
365
+ p?.removeEventListener("touchstart", _), p?.removeEventListener("touchend", x), p?.removeEventListener("touchmove", w);
366
366
  };
367
367
  }, [n?.width, n?.height, n?.totalWidth, n?.totalHeight, d, u]);
368
- const [z, { width: $ }] = ge(), [I, { height: g }] = ge(), v = W(() => {
369
- const p = c({ orientation: re.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (C) => {
370
- w?.({ top: C });
368
+ const [P, { width: B }] = ge(), [K, { height: y }] = ge(), S = N(() => {
369
+ const p = l({ orientation: se.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (C) => {
370
+ v?.({ top: C });
371
371
  } });
372
- return L("div", { style: { display: "flex", flex: "0" }, ref: z, children: p });
373
- }, [c, n?.top, n?.height, n?.totalHeight]), B = W(() => {
374
- const p = a({ orientation: re.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (C) => w?.({ left: C }) });
375
- return be("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [L("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${$}px)` }, children: L("div", { ref: I, className: "sizer", children: p }) }), s ? l({ width: $, height: g }) : L(De, {})] });
376
- }, [a, n?.left, n?.width, n?.totalWidth, s, l, $, g]);
377
- return L("div", { style: { position: "relative", display: "flex", minWidth: s ? `${$}px` : void 0, minHeight: r ? `${g}px` : void 0, ...h }, ...b, ref: x, children: be("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [be("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [L("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: t }), s ? v : L(De, {})] }), r ? B : L(De, {})] }) });
372
+ return L("div", { style: { display: "flex", flex: "0" }, ref: P, children: p });
373
+ }, [l, n?.top, n?.height, n?.totalHeight]), z = N(() => {
374
+ const p = s({ orientation: se.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (C) => v?.({ left: C }) });
375
+ return Se("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [L("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${B}px)` }, children: L("div", { ref: K, className: "sizer", children: p }) }), a ? h({ width: B, height: y }) : L(ke, {})] });
376
+ }, [s, n?.left, n?.width, n?.totalWidth, a, h, B, y]);
377
+ return L("div", { style: { position: "relative", display: "flex", minWidth: a ? `${B}px` : void 0, minHeight: r ? `${y}px` : void 0, ...c }, ...f, ref: m, children: Se("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [Se("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [L("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: t }), a ? S : L(ke, {})] }), r ? z : L(ke, {})] }) });
378
378
  }));
379
- zn.displayName = "ScrollPane";
380
- let Ae = 0;
381
- function ho() {
382
- const [i, e] = G(!!document.fullscreenElement), t = H(() => {
379
+ Kn.displayName = "ScrollPane";
380
+ let ze = 0;
381
+ function wo() {
382
+ const [i, e] = q(!!document.fullscreenElement), t = H(() => {
383
383
  const n = document.fullscreenElement;
384
384
  return n ? n.querySelector(".fullscreen-portal-root") || n : document.body;
385
385
  }, []);
@@ -390,42 +390,42 @@ function ho() {
390
390
  let r = o.querySelector(".fullscreen-portal-root");
391
391
  r || (r = document.createElement("div"), r.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", o.appendChild(r));
392
392
  }
393
- return Ae++, n(), document.addEventListener("fullscreenchange", n), () => {
394
- document.removeEventListener("fullscreenchange", n), Ae--, Ae <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((o) => {
393
+ return ze++, n(), document.addEventListener("fullscreenchange", n), () => {
394
+ document.removeEventListener("fullscreenchange", n), ze--, ze <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((o) => {
395
395
  o.parentNode && o.parentNode.removeChild(o);
396
- }), Ae = 0);
396
+ }), ze = 0);
397
397
  };
398
398
  }, []), { getPortalContainer: t, isFullscreen: i };
399
399
  }
400
- const kn = 100, An = 100, Bn = 1e6, On = 100, $n = 50, Kn = Le(Ce((i, e) => {
401
- const { offset: t = 0, viewportSize: n = 0, totalSize: o = 0, minSize: r = 0, endGap: s = kn, endScrollIncrement: l = An, style: a = zt, onMouseDown: c, onScrollOffset: h, onScroll: u, scaleLimit: d = Bn, scaleFactor: b = On, precisionFactor: w = $n, ...x } = i;
400
+ const Rn = 100, In = 100, Nn = 1e6, Hn = 100, Vn = 50, Wn = ye(Ce((i, e) => {
401
+ const { offset: t = 0, viewportSize: n = 0, totalSize: o = 0, minSize: r = 0, endGap: a = Rn, endScrollIncrement: h = In, style: s = Kt, onMouseDown: l, onScrollOffset: c, onScroll: u, scaleLimit: d = Nn, scaleFactor: f = Hn, precisionFactor: v = Vn, ...m } = i;
402
402
  u && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
403
- const S = T(c, [c]), P = () => ({ offset: t, totalSize: d === 0 ? o : Math.min(o ?? 0, Math.max(r ?? 0, (t ?? 0) + (n ?? 0)) + (s ?? 0)) }), [_, y] = G(P), f = d !== 0 && _.totalSize > d ? b : 1, k = f / w, z = Math.ceil(_.totalSize / f), $ = Math.ceil(_.offset / f), I = Math.ceil(n / f), g = H((D) => {
404
- }, []), [v, B] = G(!1), p = A(null);
405
- Ie(() => {
406
- if (!v) {
403
+ const b = M(l, [l]), T = () => ({ offset: t, totalSize: d === 0 ? o : Math.min(o ?? 0, Math.max(r ?? 0, (t ?? 0) + (n ?? 0)) + (a ?? 0)) }), [_, w] = q(T), x = d !== 0 && _.totalSize > d ? f : 1, A = x / v, P = Math.ceil(_.totalSize / x), B = Math.ceil(_.offset / x), K = Math.ceil(n / x), y = H((k) => {
404
+ }, []), [S, z] = q(!1), p = O(null);
405
+ Ve(() => {
406
+ if (!S) {
407
407
  p.current = { propTotalSize: o, propViewportSize: n, propOffset: t };
408
- const D = P();
409
- y(D);
408
+ const k = T();
409
+ w(k);
410
410
  }
411
- }, [o, n, t, v, r, s, l]);
412
- const C = T((D, q, F) => {
413
- const Y = p.current;
414
- p.current = null, Y && Y.propTotalSize === o && Y.propViewportSize === n && Y.propOffset === t || (Math.abs(D - $) < k && (D = $), h?.(D * f, $, I));
415
- }, [h, f, k, $, I]), m = H((D) => {
416
- document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", m), B(!1);
417
- }, []), E = H((D) => {
418
- S?.(D), B(!0), document.addEventListener("mousemove", g, { passive: !0 }), document.addEventListener("mouseup", m, { passive: !0 });
419
- }, [g, m]);
420
- return L(nt, { ref: e, style: { ...a }, ...x, offset: $, totalSize: z, viewportSize: I, onMouseDown: E, onScrollOffset: C });
411
+ }, [o, n, t, S, r, a, h]);
412
+ const C = M((k, J, F) => {
413
+ const j = p.current;
414
+ p.current = null, j && j.propTotalSize === o && j.propViewportSize === n && j.propOffset === t || (Math.abs(k - B) < A && (k = B), c?.(k * x, B, K));
415
+ }, [c, x, A, B, K]), g = H((k) => {
416
+ document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", g), z(!1);
417
+ }, []), E = H((k) => {
418
+ b?.(k), z(!0), document.addEventListener("mousemove", y, { passive: !0 }), document.addEventListener("mouseup", g, { passive: !0 });
419
+ }, [y, g]);
420
+ return L(ot, { ref: e, style: { ...s }, ...m, offset: B, totalSize: P, viewportSize: K, onMouseDown: E, onScrollOffset: C });
421
421
  }));
422
- Kn.displayName = "VirtualScrollbar";
423
- const uo = { 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" };
422
+ Wn.displayName = "VirtualScrollbar";
423
+ const bo = { 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" };
424
424
  function Ye(i, e) {
425
425
  if (typeof i == "function") return i(e);
426
426
  i && (i.current = e);
427
427
  }
428
- var He = parseInt(on.split(".")[0], 10) >= 19 ? function(i) {
428
+ var Ne = parseInt(hn.split(".")[0], 10) >= 19 ? function(i) {
429
429
  return (e) => {
430
430
  const t = [];
431
431
  for (const n of i) {
@@ -441,132 +441,407 @@ var He = parseInt(on.split(".")[0], 10) >= 19 ? function(i) {
441
441
  for (const t of i) Ye(t, e);
442
442
  };
443
443
  };
444
- const po = Le(Ce((i, e) => {
445
- const { refFocusStart: t, ...n } = i, o = A(null), r = H(() => {
444
+ const So = ye(Ce((i, e) => {
445
+ const { refFocusStart: t, ...n } = i, o = O(null), r = H(() => {
446
446
  if (t) return void t?.current?.focus();
447
- const s = o.current.parentElement.children;
448
- let l = [];
449
- for (let a = 0; a < s.length && s[a] !== o.current; a++) {
450
- const c = s[a].getAttribute("tabindex");
451
- if (c == null || c === "-1" || s[a].getAttribute("disabled") === "true") continue;
452
- const h = s[a];
453
- h.focus && l.push({ tabindex: parseInt(c), child: h });
447
+ const a = o.current.parentElement.children;
448
+ let h = [];
449
+ for (let s = 0; s < a.length && a[s] !== o.current; s++) {
450
+ const l = a[s].getAttribute("tabindex");
451
+ if (l == null || l === "-1" || a[s].getAttribute("disabled") === "true") continue;
452
+ const c = a[s];
453
+ c.focus && h.push({ tabindex: parseInt(l), child: c });
454
454
  }
455
- l.length !== 0 && (l.sort(function(a, c) {
456
- return a.tabindex - c.tabindex;
457
- }), l[0].child.focus());
455
+ h.length !== 0 && (h.sort(function(s, l) {
456
+ return s.tabindex - l.tabindex;
457
+ }), h[0].child.focus());
458
458
  }, [t]);
459
- return L("div", { tabIndex: 0, ref: He([o, e]), onFocus: r, ...n });
460
- })), _o = Le(Ce((i, e) => {
461
- const { className: t, style: n, children: o, radius: r = 4, strokeWidth: s = 1, strokeColor: l = "grey", ...a } = i, [c, { width: h, height: u }] = ge(), d = A(null), b = (P, _ = 0) => {
462
- const y = P / 2, f = u - y + _;
463
- return (function(k, z, $ = !1) {
464
- if (z === 0) return k;
465
- function I(m, E, D) {
466
- let q = E.x - m.x, F = E.y - m.y, Y = Math.sqrt(q * q + F * F);
467
- return g(m, E, Math.min(1, D / Y));
459
+ return L("div", { tabIndex: 0, ref: Ne([o, e]), onFocus: r, ...n });
460
+ })), Lo = ye(Ce((i, e) => {
461
+ const { className: t, style: n, children: o, radius: r = 4, strokeWidth: a = 1, strokeColor: h = "grey", ...s } = i, [l, { width: c, height: u }] = ge(), d = O(null), f = (T, _ = 0) => {
462
+ const w = T / 2, x = u - w + _;
463
+ return (function(A, P, B = !1) {
464
+ if (P === 0) return A;
465
+ function K(g, E, k) {
466
+ let J = E.x - g.x, F = E.y - g.y, j = Math.sqrt(J * J + F * F);
467
+ return y(g, E, Math.min(1, k / j));
468
468
  }
469
- function g(m, E, D) {
470
- return { x: m.x + (E.x - m.x) * D, y: m.y + (E.y - m.y) * D };
469
+ function y(g, E, k) {
470
+ return { x: g.x + (E.x - g.x) * k, y: g.y + (E.y - g.y) * k };
471
471
  }
472
- function v(m, E) {
473
- m.length > 2 && (m[m.length - 2] = E.x, m[m.length - 1] = E.y);
472
+ function S(g, E) {
473
+ g.length > 2 && (g[g.length - 2] = E.x, g[g.length - 1] = E.y);
474
474
  }
475
- function B(m) {
476
- return { x: parseFloat(m[m.length - 2]), y: parseFloat(m[m.length - 1]) };
475
+ function z(g) {
476
+ return { x: parseFloat(g[g.length - 2]), y: parseFloat(g[g.length - 1]) };
477
477
  }
478
- let p = k.split(/[,\s]/).reduce(function(m, E) {
479
- let D = E.match("([a-zA-Z])(.+)");
480
- return D ? (m.push(D[1]), m.push(D[2])) : m.push(E), m;
481
- }, []).reduce(function(m, E) {
482
- return parseFloat(E) == E && m.length ? m[m.length - 1].push(E) : m.push([E]), m;
478
+ let p = A.split(/[,\s]/).reduce(function(g, E) {
479
+ let k = E.match("([a-zA-Z])(.+)");
480
+ return k ? (g.push(k[1]), g.push(k[2])) : g.push(E), g;
481
+ }, []).reduce(function(g, E) {
482
+ return parseFloat(E) == E && g.length ? g[g.length - 1].push(E) : g.push([E]), g;
483
483
  }, []), C = [];
484
484
  if (p.length > 1) {
485
- let m = B(p[0]), E = null;
486
- p[p.length - 1][0] === "Z" && p[0].length > 2 && (E = ["L", m.x, m.y], p[p.length - 1] = E), C.push(p[0]);
487
- for (let D = 1; D < p.length; D++) {
488
- let q = C[C.length - 1], F = p[D], Y = F === E ? p[1] : p[D + 1];
489
- if (Y && q && q.length > 2 && F[0] === "L" && Y.length > 2 && Y[0] === "L") {
490
- let X, O, N = B(q), j = B(F), ne = B(Y);
491
- $ ? (X = g(j, q.origPoint || N, z), O = g(j, Y.origPoint || ne, z)) : (X = I(j, N, z), O = I(j, ne, z)), v(F, X), F.origPoint = j, C.push(F);
492
- let ye = g(X, j, 0.5), ve = g(j, O, 0.5), K = ["C", ye.x, ye.y, ve.x, ve.y, O.x, O.y];
493
- K.origPoint = j, C.push(K);
485
+ let g = z(p[0]), E = null;
486
+ p[p.length - 1][0] === "Z" && p[0].length > 2 && (E = ["L", g.x, g.y], p[p.length - 1] = E), C.push(p[0]);
487
+ for (let k = 1; k < p.length; k++) {
488
+ let J = C[C.length - 1], F = p[k], j = F === E ? p[1] : p[k + 1];
489
+ if (j && J && J.length > 2 && F[0] === "L" && j.length > 2 && j[0] === "L") {
490
+ let Y, $, W = z(J), X = z(F), ne = z(j);
491
+ B ? (Y = y(X, J.origPoint || W, P), $ = y(X, j.origPoint || ne, P)) : (Y = K(X, W, P), $ = K(X, ne, P)), S(F, Y), F.origPoint = X, C.push(F);
492
+ let ve = y(Y, X, 0.5), xe = y(X, $, 0.5), R = ["C", ve.x, ve.y, xe.x, xe.y, $.x, $.y];
493
+ R.origPoint = X, C.push(R);
494
494
  } else C.push(F);
495
495
  }
496
496
  if (E) {
497
- let D = B(C[C.length - 1]);
498
- C.push(["Z"]), v(C[0], D);
497
+ let k = z(C[C.length - 1]);
498
+ C.push(["Z"]), S(C[0], k);
499
499
  }
500
500
  } else C = p;
501
- return C.reduce(function(m, E) {
502
- return m + E.join(" ") + " ";
501
+ return C.reduce(function(g, E) {
502
+ return g + E.join(" ") + " ";
503
503
  }, "");
504
- })(`${`M 0 ${y} L ${r - 0.5} ${y} L ${r - 0.5} ${f} L ${2 * r} ${f}`} ${`L ${h - 2 * r} ${f}`} ${`M ${h - 2 * r} ${f} L ${h - r} ${f} L ${h - r} ${y} L ${h} ${y}`}`, r);
505
- }, w = W(() => b(s), [h, u, r, s]), x = W(() => {
504
+ })(`${`M 0 ${w} L ${r - 0.5} ${w} L ${r - 0.5} ${x} L ${2 * r} ${x}`} ${`L ${c - 2 * r} ${x}`} ${`M ${c - 2 * r} ${x} L ${c - r} ${x} L ${c - r} ${w} L ${c} ${w}`}`, r);
505
+ }, v = N(() => f(a), [c, u, r, a]), m = N(() => {
506
506
  if (r === 0) return;
507
- const P = r / 2;
508
- return b(r) + `L ${h} 0 L 0 0 L 0 ${P}`;
509
- }, [w, r, s]), S = W(() => ({ style: { clipPath: `path('${x}')` } }), [x]);
510
- return be("div", { className: t, style: { display: "flex", flexDirection: "row", ...n }, ...a, ref: He([d, c, e]), children: [ce.isValidElement(o) ? ce.cloneElement(o, S) : L(De, {}), L("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: h, height: u, viewBox: `0 0 ${h} ${u}`, children: L("path", { d: w, stroke: l, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: s }) })] });
511
- })), Rn = {}, Hn = (i) => {
512
- const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: o = 0, paddingAfter: r = 0, disabled: s, key: l, hitAreaProps: a = Rn, ...c } = i, h = n === "row", { style: u, className: d, ...b } = a;
513
- return L("div", { style: { ...t, position: "relative" }, ...c, children: L("div", { className: xe("hit-box", d), style: { left: (h ? -o : 0) + "px", width: `calc(100% + ${h ? o + r : 0}px)`, top: (h ? 0 : -o) + "px", height: `calc(100% + ${h ? 0 : o + r}px)`, position: "absolute", ...u }, onPointerDown: s ? void 0 : e, ...b }) }, l);
514
- }, Be = {}, me = (i, e, t = !0) => i === null ? null : i.pixels !== null ? t ? i.pixels : e - i.pixels : (t ? i.percent : 100 - i.percent) / 100 * e, Oe = (i, e = !0) => i?.percent ? `${e ? i.percent : 100 - i.percent}%` : i?.pixels ? `${i.pixels}px` : void 0, de = (i, e) => {
507
+ const T = r / 2;
508
+ return f(r) + `L ${c} 0 L 0 0 L 0 ${T}`;
509
+ }, [v, r, a]), b = N(() => ({ style: { clipPath: `path('${m}')` } }), [m]);
510
+ return Se("div", { className: t, style: { display: "flex", flexDirection: "row", ...n }, ...s, ref: Ne([d, l, e]), children: [ie.isValidElement(o) ? ie.cloneElement(o, b) : L(ke, {}), L("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: c, height: u, viewBox: `0 0 ${c} ${u}`, children: L("path", { d: v, stroke: h, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: a }) })] });
511
+ })), Fn = {}, jn = (i) => {
512
+ const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: o = 0, paddingAfter: r = 0, disabled: a, key: h, hitAreaProps: s = Fn, ...l } = i, c = n === "row", { style: u, className: d, ...f } = s;
513
+ return L("div", { style: { ...t, position: "relative" }, ...l, children: L("div", { className: we("hit-box", d), style: { left: (c ? -o : 0) + "px", width: `calc(100% + ${c ? o + r : 0}px)`, top: (c ? 0 : -o) + "px", height: `calc(100% + ${c ? 0 : o + r}px)`, position: "absolute", ...u }, onPointerDown: a ? void 0 : e, ...f }) }, h);
514
+ }, Be = {}, _e = (i, e, t = !0) => i === null ? null : i.pixels !== null ? t ? i.pixels : e - i.pixels : (t ? i.percent : 100 - i.percent) / 100 * e, Oe = (i, e = !0) => i?.percent ? `${e ? i.percent : 100 - i.percent}%` : i?.pixels ? `${i.pixels}px` : void 0, de = (i, e) => {
515
515
  if (i == null) return null;
516
516
  const t = { percent: null, pixels: null };
517
517
  let n = e;
518
518
  return typeof i == "string" && ((i = i.trim().toLowerCase()).endsWith("px") ? (i = i.substring(0, i.length - 2), n = !1) : i.endsWith("%") && (i = i.substring(0, i.length - 1), n = !0), i = parseFloat(i)), n ? t.percent = i : t.pixels = i, Object.freeze(t);
519
- }, mo = Le(Ce((i, e) => {
520
- const { elementBefore: t, elementAfter: n, splitDirection: o = "row", fixedPane: r = null, position: s, onPositionChange: l, minBefore: a, maxBefore: c, minAfter: h, maxAfter: u, children: d, className: b, style: w, disabled: x = !1, onDragStart: S, onDragResize: P, onDragFinish: _, resizerProps: y = Be, paneProps: f = Be, paneBeforeProps: k = Be, paneAfterProps: z = Be, createResizer: $ = Hn } = i;
519
+ }, Co = ye(Ce((i, e) => {
520
+ const { elementBefore: t, elementAfter: n, splitDirection: o = "row", fixedPane: r = null, position: a, onPositionChange: h, minBefore: s, maxBefore: l, minAfter: c, maxAfter: u, children: d, className: f, style: v, disabled: m = !1, onDragStart: b, onDragResize: T, onDragFinish: _, resizerProps: w = Be, paneProps: x = Be, paneBeforeProps: A = Be, paneAfterProps: P = Be, createResizer: B = jn } = i;
521
521
  if (d) throw new Error("Use elementBefore and elementAfter instead of children.");
522
- const I = W(() => ce.isValidElement(n) && ce.isValidElement(t), [n, t]), g = W(() => {
523
- let M = null;
524
- r && (r === "before" ? M = 0 : r === "after" && (M = 1));
525
- const R = M === null;
526
- return { fixedPaneOffset: M, isPercent: R, minBefore: de(a, R), maxBefore: de(c, R), minAfter: de(h, R), maxAfter: de(u, R) };
527
- }, [a, c, h, u]), v = T(l, [l]), [B, p] = G(() => de(s, r === null));
522
+ const K = N(() => ie.isValidElement(n) && ie.isValidElement(t), [n, t]), y = N(() => {
523
+ let D = null;
524
+ r && (r === "before" ? D = 0 : r === "after" && (D = 1));
525
+ const I = D === null;
526
+ return { fixedPaneOffset: D, isPercent: I, minBefore: de(s, I), maxBefore: de(l, I), minAfter: de(c, I), maxAfter: de(u, I) };
527
+ }, [s, l, c, u]), S = M(h, [h]), [z, p] = q(() => de(a, r === null));
528
528
  V(() => {
529
- p(de(s, r === null));
530
- }, [s, r]);
531
- const [C, { width: m, height: E }] = ge(), [D, { width: q, height: F }] = ge(), Y = o === "row" ? q : F, X = o === "row" ? m : E, O = W(() => ((M, R, J, U) => {
532
- const ae = [null, null], oe = [null, null];
533
- if (M || (M = { percent: U.fixedPaneOffset === null ? 50 : null, pixels: U.fixedPaneOffset === null ? null : 0 }), R === 0) return M?.pixels != null ? U.fixedPaneOffset !== 1 ? (ae[0] = M?.pixels, oe[1] = 100) : (ae[1] = M?.pixels - J, oe[0] = 100) : M?.percent != null && (U.fixedPaneOffset !== 1 ? (oe[0] = M?.percent, oe[1] = 100 - M?.percent) : (oe[1] = M?.percent, oe[0] = 100 - M?.percent)), { percents: oe, pixels: ae, minBefore: Oe(U.minBefore, !0), maxBefore: Oe(U.maxBefore, !0), minAfter: Oe(U.minAfter), maxAfter: Oe(U.maxAfter) };
534
- let ue = me(M, R, U.fixedPaneOffset !== 1), ee = R - J, ht = me(U.minBefore, ee, !0) ?? 0, en = me(U.maxBefore, ee, !0) ?? ee, ke = 0, Ne = 0, ut = 0, dt = ee;
535
- ke = (me(U.maxAfter, R, !1) ?? J) - J, Ne = me(U.minAfter, R, !1) ?? R, ut = Math.max(ht, ke), dt = Math.min(en, Ne), ue = Math.max(ut, Math.min(ue, dt)), Ne = Math.min(ee - ue, me(U.maxAfter, ee - ue, !0) ?? ee), ke = Math.min(ee - ue, me(U.minAfter, ee - ue, !0) ?? ee), ae[0] = ue, ae[1] = ee - ae[0];
536
- const tn = Math.max(0, Math.min(100, ue / ee * 100));
537
- return oe[0] = tn, oe[1] = 100 - oe[0], { percents: oe, pixels: ae, minBefore: `${ht}px`, minAfter: `${ke}px`, maxBefore: `${ae[0]}px`, maxAfter: `${ae[1]}px` };
538
- })(B, X, Y, g), [g, B, X, Y, o]), [N, j] = G(!1), ne = T(S, [S]), ye = T(P, [P]), ve = T(_, [_]), K = A(null), se = A(null), ie = A(null), { style: _e, className: le, ...he } = f, Ee = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", display: "flex", overflow: "hidden", ..._e }, { className: Vt, style: It, ...Nt } = k, { className: Wt, style: Ft, ...Yt } = z, Xt = { flex: "1 1 100%", width: "100%", ...w, flexDirection: o, display: "flex" }, { className: it, style: rt, onPointerDown: st, ...lt } = y, jt = T((M) => {
539
- const R = de(M, r === null);
540
- p(R);
541
- }, [r]), Pe = T((M) => {
542
- if (x || !N) return;
543
- const R = ct.current?.getBoundingClientRect();
544
- let J = 0;
545
- J = o === "row" ? (M.clientX ?? M.touches?.[0]?.clientX) - R.x : (M.clientY ?? M.touches?.[0]?.clientY) - R.y, J = Math.max(0, Math.min(X, J)), g.fixedPaneOffset === 1 && (J = X - J), s && B.pixels === J || p({ pixels: J, percent: null }), ye?.(J), M.stopPropagation(), M.preventDefault();
546
- }, [g, o, x, N, B, X]), at = T((M) => {
547
- if (document.removeEventListener("pointermove", Pe), document.removeEventListener("touchmove", Pe), document.removeEventListener("pointerup", at), !!N && (j(!1), !!B)) {
548
- if (ve(B.pixels), !de(s, r === null) || B.pixels !== s) {
549
- const R = { ...B };
550
- R.percent === null && (R.percent = R.pixels / X * 100), v(R);
529
+ p(de(a, r === null));
530
+ }, [a, r]);
531
+ const [C, { width: g, height: E }] = ge(), [k, { width: J, height: F }] = ge(), j = o === "row" ? J : F, Y = o === "row" ? g : E, $ = N(() => ((D, I, Q, U) => {
532
+ const ce = [null, null], oe = [null, null];
533
+ if (D || (D = { percent: U.fixedPaneOffset === null ? 50 : null, pixels: U.fixedPaneOffset === null ? null : 0 }), I === 0) return D?.pixels != null ? U.fixedPaneOffset !== 1 ? (ce[0] = D?.pixels, oe[1] = 100) : (ce[1] = D?.pixels - Q, oe[0] = 100) : D?.percent != null && (U.fixedPaneOffset !== 1 ? (oe[0] = D?.percent, oe[1] = 100 - D?.percent) : (oe[1] = D?.percent, oe[0] = 100 - D?.percent)), { percents: oe, pixels: ce, minBefore: Oe(U.minBefore, !0), maxBefore: Oe(U.maxBefore, !0), minAfter: Oe(U.minAfter), maxAfter: Oe(U.maxAfter) };
534
+ let ue = _e(D, I, U.fixedPaneOffset !== 1), te = I - Q, ut = _e(U.minBefore, te, !0) ?? 0, ln = _e(U.maxBefore, te, !0) ?? te, Ae = 0, We = 0, dt = 0, pt = te;
535
+ Ae = (_e(U.maxAfter, I, !1) ?? Q) - Q, We = _e(U.minAfter, I, !1) ?? I, dt = Math.max(ut, Ae), pt = Math.min(ln, We), ue = Math.max(dt, Math.min(ue, pt)), We = Math.min(te - ue, _e(U.maxAfter, te - ue, !0) ?? te), Ae = Math.min(te - ue, _e(U.minAfter, te - ue, !0) ?? te), ce[0] = ue, ce[1] = te - ce[0];
536
+ const an = Math.max(0, Math.min(100, ue / te * 100));
537
+ return oe[0] = an, oe[1] = 100 - oe[0], { percents: oe, pixels: ce, minBefore: `${ut}px`, minAfter: `${Ae}px`, maxBefore: `${ce[0]}px`, maxAfter: `${ce[1]}px` };
538
+ })(z, Y, j, y), [y, z, Y, j, o]), [W, X] = q(!1), ne = M(b, [b]), ve = M(T, [T]), xe = M(_, [_]), R = O(null), le = O(null), re = O(null), { style: fe, className: ae, ...he } = x, Ee = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", display: "flex", overflow: "hidden", ...fe }, { className: Yt, style: Xt, ...Ut } = A, { className: Gt, style: Zt, ...qt } = P, Jt = { flex: "1 1 100%", width: "100%", ...v, flexDirection: o, display: "flex" }, { className: rt, style: st, onPointerDown: lt, ...at } = w, Qt = M((D) => {
539
+ const I = de(D, r === null);
540
+ p(I);
541
+ }, [r]), De = M((D) => {
542
+ if (m || !W) return;
543
+ const I = ht.current?.getBoundingClientRect();
544
+ let Q = 0;
545
+ Q = o === "row" ? (D.clientX ?? D.touches?.[0]?.clientX) - I.x : (D.clientY ?? D.touches?.[0]?.clientY) - I.y, Q = Math.max(0, Math.min(Y, Q)), y.fixedPaneOffset === 1 && (Q = Y - Q), a && z.pixels === Q || p({ pixels: Q, percent: null }), ve?.(Q), D.stopPropagation(), D.preventDefault();
546
+ }, [y, o, m, W, z, Y]), ct = M((D) => {
547
+ if (document.removeEventListener("pointermove", De), document.removeEventListener("touchmove", De), document.removeEventListener("pointerup", ct), !!W && (X(!1), !!z)) {
548
+ if (xe(z.pixels), !de(a, r === null) || z.pixels !== a) {
549
+ const I = { ...z };
550
+ I.percent === null && (I.percent = I.pixels / Y * 100), S(I);
551
551
  }
552
- M.stopPropagation(), M.preventDefault();
552
+ D.stopPropagation(), D.preventDefault();
553
+ }
554
+ }, [z, W, a, r, Y]), en = M((D) => {
555
+ lt?.(D), D.defaultPrevented || m || W || (X(!0), ne(), document.addEventListener("pointermove", De, { passive: !1 }), document.addEventListener("touchmove", De, { passive: !1 }), document.addEventListener("pointerup", ct, { passive: !1 }));
556
+ }, [lt]), ht = It(e, () => ({ setPosition: Qt, isSplitPane: () => !0 }), []), tn = N(() => K ? B?.({ key: "resizer", ref: Ne([k, le]), className: we("resizer", rt), onPointerDownCapture: en, style: { cursor: m ? void 0 : o === "row" ? "ew-resize" : "ns-resize", minWidth: o === "row" ? "2px" : void 0, minHeight: o !== "row" ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...st }, splitDirection: o, disabled: m, ...at }) : null, [K, rt, at, o, st, m]), Pe = o === "row" ? "Width" : "Height", nn = { ...Ee, ...Xt, flex: y.fixedPaneOffset === 0 && $?.pixels[0] !== null ? `0 0 ${Math.round($?.pixels[0])}px` : `1 1 ${Math.round($?.percents[0] ?? 100)}%`, [`min${Pe}`]: $?.minBefore, [`max${Pe}`]: n ? $?.maxBefore : "100%" }, on = { ...Ee, ...Zt, flex: y.fixedPaneOffset === 1 && $?.pixels[1] !== null ? `0 0 ${Math.round($?.pixels[1])}px` : `1 1 ${Math.round($?.percents[1] ?? 100)}%`, [`min${Pe}`]: $?.minAfter, [`max${Pe}`]: t ? $?.maxAfter : "100%" }, rn = N(() => t ? L("div", { ref: R, className: we("before", ae, Yt), style: nn, ...he, ...Ut, children: t }, "before") : null, [t, x, A, y, $]), sn = N(() => n ? L("div", { ref: re, className: we("after", ae, Gt), style: on, ...he, ...qt, children: n }, "after") : null, [n, x, P, y, $]);
557
+ return Se("div", { ref: Ne([C, ht]), className: we("splitPane", o === "row" ? "vertical" : "horizontal", { dragging: W }, f), style: Jt, children: [rn, tn, sn] });
558
+ }));
559
+ function Yn(i) {
560
+ if (typeof i == "function") return i;
561
+ if (typeof i == "string") {
562
+ const e = i.trim();
563
+ if (e.startsWith("data:image/svg+xml")) {
564
+ const t = (function(n) {
565
+ const o = /^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());
566
+ if (!o) return null;
567
+ const r = o[1] || "", a = o[2] || "";
568
+ try {
569
+ if (/;base64/i.test(r)) {
570
+ if (typeof atob < "u") {
571
+ const h = atob(a);
572
+ if (typeof TextDecoder < "u") {
573
+ const l = new Uint8Array(h.length);
574
+ for (let c = 0; c < h.length; c++) l[c] = h.charCodeAt(c);
575
+ return new TextDecoder("utf-8").decode(l);
576
+ }
577
+ let s = "";
578
+ for (let l = 0; l < h.length; l++)
579
+ s += `%${h.charCodeAt(l).toString(16).padStart(2, "0")}`;
580
+ return decodeURIComponent(s);
581
+ }
582
+ return (globalThis.Buffer ? globalThis.Buffer.from(a, "base64") : require("buffer").Buffer.from(a, "base64")).toString("utf-8");
583
+ }
584
+ try {
585
+ return decodeURIComponent(a);
586
+ } catch {
587
+ return a;
588
+ }
589
+ } catch {
590
+ return null;
591
+ }
592
+ })(e);
593
+ if (t) return St(t);
594
+ }
595
+ if (e.startsWith("<")) {
596
+ if (/^<\s*svg\b/i.test(e)) return St(e);
597
+ if (/^<\s*path\b/i.test(e)) {
598
+ const t = wt(e);
599
+ if (t) return { paths: [{ d: t }] };
600
+ }
601
+ return { paths: [{ d: e }] };
602
+ }
603
+ return { paths: [{ d: e }] };
604
+ }
605
+ if (Array.isArray(i)) {
606
+ const e = [];
607
+ for (const t of i) if (typeof t == "string") {
608
+ const n = String(t).trim();
609
+ if (n.startsWith("<path")) {
610
+ const o = wt(n);
611
+ o && e.push({ d: o });
612
+ } else e.push({ d: n });
613
+ } else t && typeof t == "object" && "d" in t && typeof t.d == "string" && e.push({ ...t });
614
+ return { paths: e };
615
+ }
616
+ return i;
617
+ }
618
+ function wt(i) {
619
+ const e = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(i);
620
+ return e ? e[1] ?? e[2] ?? null : null;
621
+ }
622
+ function bt(i) {
623
+ if ("svg" in i) return { ...i, svg: Yn(i.svg) };
624
+ if ("url" in i) {
625
+ const e = typeof i.url == "string" ? { src: i.url } : i.url;
626
+ return { ...i, url: e };
627
+ }
628
+ if ("emoji" in i) {
629
+ const e = typeof i.emoji == "string" ? i.emoji : i.emoji.text;
630
+ return { ...i, emoji: e };
631
+ }
632
+ return i;
633
+ }
634
+ function St(i) {
635
+ try {
636
+ if (typeof DOMParser < "u") {
637
+ const a = new DOMParser().parseFromString(i, "image/svg+xml"), h = a.querySelector("svg"), s = h?.getAttribute("viewBox") ?? void 0, l = [];
638
+ return a.querySelectorAll("path").forEach((c) => {
639
+ const u = c.getAttribute("d");
640
+ if (!u) return;
641
+ const d = { d: u }, f = c.getAttribute("class");
642
+ f && (d.className = f);
643
+ const v = c.getAttribute("fill");
644
+ v && v !== "none" && (d.fill = v);
645
+ const m = c.getAttribute("stroke");
646
+ m && (d.stroke = m);
647
+ const b = c.getAttribute("opacity");
648
+ b && (d.opacity = Number(b));
649
+ const T = c.getAttribute("fill-rule");
650
+ T && (d.fillRule = T);
651
+ const _ = c.getAttribute("clip-rule");
652
+ _ && (d.clipRule = _), l.push(d);
653
+ }), { viewBox: s, paths: l };
654
+ }
655
+ } catch {
656
+ }
657
+ const e = i.match(/viewBox="([^"]+)"/i), t = e ? e[1] : void 0, n = [], o = /<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;
658
+ let r;
659
+ for (; r = o.exec(i); ) n.push({ d: r[1] });
660
+ return { viewBox: t, paths: n };
661
+ }
662
+ function Lt(i) {
663
+ const e = {};
664
+ for (const [r, a] of Object.entries(i.icons)) e[r] = bt(a);
665
+ const t = { label: i.meta?.label ?? "Unnamed", version: i.meta?.version ?? "1.0.0", license: i.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: i.meta?.extends ?? [] };
666
+ t.extends.includes("base") || t.extends.push("base");
667
+ const n = { meta: t, icons: e }, o = i.overrides;
668
+ if (o) {
669
+ const r = {};
670
+ for (const [a, h] of Object.entries(o)) {
671
+ const s = {};
672
+ for (const [l, c] of Object.entries(h)) s[l] = bt(c);
673
+ r[a] = s;
674
+ }
675
+ n.__overrides = r;
676
+ }
677
+ return n;
678
+ }
679
+ function Xn() {
680
+ const i = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
681
+ let t = "base", n = /* @__PURE__ */ new Map();
682
+ async function o(s) {
683
+ const l = i.get(s ?? t);
684
+ if (!l) throw new Error(`Icon pack not registered: ${s}`);
685
+ if (!l.pack) {
686
+ if (!l.loading) {
687
+ if (!l.loader) throw new Error(`No loader for icon pack: ${s}`);
688
+ l.loading = l.loader().then((c) => {
689
+ const u = c && typeof c == "object" && "default" in c ? c.default : c;
690
+ l.pack = Lt(u);
691
+ }).catch((c) => {
692
+ throw l.loading = void 0, c;
693
+ });
694
+ }
695
+ await l.loading;
553
696
  }
554
- }, [B, N, s, r, X]), Ut = T((M) => {
555
- st?.(M), M.defaultPrevented || x || N || (j(!0), ne(), document.addEventListener("pointermove", Pe, { passive: !1 }), document.addEventListener("touchmove", Pe, { passive: !1 }), document.addEventListener("pointerup", at, { passive: !1 }));
556
- }, [st]), ct = At(e, () => ({ setPosition: jt, isSplitPane: () => !0 }), []), Zt = W(() => I ? $?.({ key: "resizer", ref: He([D, se]), className: xe("resizer", it), onPointerDownCapture: Ut, style: { cursor: x ? void 0 : o === "row" ? "ew-resize" : "ns-resize", minWidth: o === "row" ? "2px" : void 0, minHeight: o !== "row" ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...rt }, splitDirection: o, disabled: x, ...lt }) : null, [I, it, lt, o, rt, x]), ze = o === "row" ? "Width" : "Height", Gt = { ...Ee, ...It, flex: g.fixedPaneOffset === 0 && O?.pixels[0] !== null ? `0 0 ${Math.round(O?.pixels[0])}px` : `1 1 ${Math.round(O?.percents[0] ?? 100)}%`, [`min${ze}`]: O?.minBefore, [`max${ze}`]: n ? O?.maxBefore : "100%" }, qt = { ...Ee, ...Ft, flex: g.fixedPaneOffset === 1 && O?.pixels[1] !== null ? `0 0 ${Math.round(O?.pixels[1])}px` : `1 1 ${Math.round(O?.percents[1] ?? 100)}%`, [`min${ze}`]: O?.minAfter, [`max${ze}`]: t ? O?.maxAfter : "100%" }, Jt = W(() => t ? L("div", { ref: K, className: xe("before", le, Vt), style: Gt, ...he, ...Nt, children: t }, "before") : null, [t, f, k, g, O]), Qt = W(() => n ? L("div", { ref: ie, className: xe("after", le, Wt), style: qt, ...he, ...Yt, children: n }, "after") : null, [n, f, z, g, O]);
557
- return be("div", { ref: He([C, ct]), className: xe("splitPane", o === "row" ? "vertical" : "horizontal", { dragging: N }, b), style: Xt, children: [Jt, Zt, Qt] });
558
- })), xt = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
559
- class Vn extends cn {
560
- setDelegate(e) {
561
- super.setDelegate(e);
697
+ }
698
+ function r(s) {
699
+ const l = s.indexOf(":");
700
+ return l > 0 ? { ns: s.slice(0, l), key: s.slice(l + 1) } : { key: s };
701
+ }
702
+ function a(s, l) {
703
+ const c = [s, ...i.get(s)?.pack?.meta.extends ?? []];
704
+ for (const u of c) {
705
+ const d = i.get(u);
706
+ if (!d?.pack) continue;
707
+ const { icons: f } = d.pack, v = f[e.get(u)?.get(l) ?? l] ?? f[l];
708
+ if (v) return { glyph: v, pack: d.pack, packKey: u };
709
+ }
710
+ return null;
711
+ }
712
+ function h(s, l) {
713
+ const c = l?.packKey ?? t;
714
+ if (l?.packKey) return a(l.packKey, s);
715
+ if (!s) return null;
716
+ const { ns: u, key: d } = r(s);
717
+ if (u) {
718
+ const f = i.get(u)?.pack;
719
+ if (f) {
720
+ if (i.get(t)?.pack) {
721
+ const m = f.__overrides, b = m?.[t]?.[d];
722
+ if (b) return { glyph: b, pack: f, packKey: u };
723
+ }
724
+ const v = a(u, d);
725
+ if (v) return v;
726
+ }
727
+ return null;
728
+ }
729
+ return a(c, s);
730
+ }
731
+ return { register: function(s, l) {
732
+ const c = i.get(s) ?? {};
733
+ typeof l == "function" ? c.loader = l : c.pack = Lt(l), i.set(s, c), t || (t = s);
734
+ }, prefetch: async function(s = t) {
735
+ const l = Array.isArray(s) ? s : [s];
736
+ await Promise.all(l.map(o));
737
+ }, setActive: function(s) {
738
+ t = s;
739
+ for (const l of n.keys()) try {
740
+ l(s);
741
+ } catch {
742
+ }
743
+ }, getActive: function() {
744
+ return t;
745
+ }, resolve: async function(s, l) {
746
+ let c = h(s, l);
747
+ if (c) return c;
748
+ const u = l?.packKey ?? t, { ns: d } = r(s);
749
+ if (l?.packKey) {
750
+ if (await o(u), c = h(s, l), c) return c;
751
+ const f = i.get(u)?.pack?.meta?.extends ?? [];
752
+ if (f.length && (await Promise.all(f.map(o)), c = h(s, l), c)) return c;
753
+ } else if (d) {
754
+ if (await o(d), c = h(s, l), c) return c;
755
+ const f = i.get(d)?.pack?.meta?.extends ?? [];
756
+ if (f.length && (await Promise.all(f.map(o)), c = h(s, l), c)) return c;
757
+ } else {
758
+ if (await o(u), c = h(s, l), c) return c;
759
+ const f = i.get(u)?.pack?.meta?.extends ?? [];
760
+ if (f.length && (await Promise.all(f.map(o)), c = h(s, l), c)) return c;
761
+ }
762
+ return null;
763
+ }, registerAlias: function(s, l, c) {
764
+ e.has(s) || e.set(s, /* @__PURE__ */ new Map()), e.get(s).set(l, c);
765
+ }, has: function(s, l) {
766
+ return !!h(s, l);
767
+ }, getPack: function(s) {
768
+ return i.get(s ?? t)?.pack;
769
+ }, hasPack: function(s) {
770
+ return !!i.get(s)?.pack;
771
+ }, listPacks: function() {
772
+ return Array.from(i.keys());
773
+ }, listIcons: function(s) {
774
+ const l = i.get(s)?.pack;
775
+ return l ? Object.keys(l.icons) : [];
776
+ }, addActiveListener: function(s) {
777
+ const l = n.get(s);
778
+ if (l) return l;
779
+ const c = () => {
780
+ n.delete(s);
781
+ };
782
+ return n.set(s, c), c;
783
+ } };
784
+ }
785
+ const Ke = Xn();
786
+ Ke.register("base", () => import("./CxY-6HIFmPob67ga.mjs"));
787
+ const Ct = (i) => L("svg", { ...i, children: L("path", {}) }), Un = { Icon: "_Icon_1ipwo_10" }, Gn = ye((i) => {
788
+ const { iconKey: e, packKey: t, className: n, style: o, role: r, title: a, size: h, ariaHidden: s, sourceProps: l, children: c, ...u } = i, [d, f] = ie.useState(null);
789
+ ie.useEffect(() => {
790
+ let p = !0, C = t, g = e;
791
+ if (!g) {
792
+ const E = Ke.getPack(C);
793
+ return void f({ glyph: E ? { svg: Z.EmptyArray } : void 0, pack: E ?? void 0, packKey: C ?? Ke.getActive() });
794
+ }
795
+ if (g.includes(":")) {
796
+ const [E, k] = g.split(":");
797
+ C = E, g = k;
798
+ }
799
+ return Ke.resolve(g, { packKey: C }).then((E) => {
800
+ p && f(E);
801
+ }), () => {
802
+ p = !1;
803
+ };
804
+ }, [e, t]);
805
+ const v = d?.pack, m = d?.glyph, b = d?.packKey;
806
+ let T = m ? m.svg : void 0;
807
+ const _ = m && !T ? m.url : void 0, w = !m || T || _ ? void 0 : m.emoji, x = h != null ? typeof h == "number" ? `${h}px` : h : void 0, A = N(() => [Un.Icon, "icon", n].filter(Boolean).join(" "), [n]), P = N(() => {
808
+ const p = { ...o };
809
+ return p["--icon-size"] = x, p;
810
+ }, [o, x]), B = r ?? (a ? "img" : "presentation"), K = s ?? (!a || void 0), y = (p) => L("span", { className: A, style: P, role: B, "aria-hidden": K, title: a, "data-icon-glyph": e, "data-icon-pack": b, ...u, children: p });
811
+ if (c) return y(c);
812
+ if (w) return y(L("span", { children: typeof w == "string" ? w : w.text }));
813
+ if (_) return y(L("img", { src: _.src, alt: a ?? "" }));
814
+ if (m && "react" in m) {
815
+ const p = m.react, C = { className: A, style: P, role: B, "aria-hidden": K, title: a, ...u, ...l };
816
+ return y(L(p, { ...C }));
817
+ }
818
+ const S = { viewBox: T?.viewBox ?? v?.meta.defaultViewBox ?? "0 0 24 24" };
819
+ if (typeof T == "function")
820
+ return y(T(S) ?? L(Ct, { ...S }));
821
+ if (!T) return y(L(Ct, { ...S }));
822
+ const z = T.paths;
823
+ return y(L("svg", { ...S, children: z ? z.map((p, C) => L("path", { d: p.d, className: p.className, fill: p.fill, stroke: p.stroke, opacity: p.opacity, fillRule: p.fillRule, clipRule: p.clipRule }, C)) : null }));
824
+ });
825
+ function Eo(i) {
826
+ const { isWalking: e = !1, themedType: t = "info", speed: n = 120, dashGap: o = 3, dashLength: r = 5, iconKey: a, packKey: h, style: s, className: l, ...c } = i, u = N(() => {
827
+ if (!e) return;
828
+ const f = { "--walk-duration": `${n * (o + r)}ms`, "--walk-dash-length": `${r}px`, "--walk-dash-gap": `${o}px` };
829
+ return t && t !== "accent" && (f["--icon-accent"] = `var(--icon-${t})`), f;
830
+ }, [e, n, o, r, t]), d = N(() => e ? l + " walking" : l, [e, l]);
831
+ return L(Gn, { iconKey: a, packKey: h, className: d, style: { ...s, ...u }, ...c });
832
+ }
833
+ const Et = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
834
+ class Zn extends _n {
835
+ setOverrides(e) {
836
+ super.setOverrides(e);
562
837
  }
563
838
  getDelegate() {
564
- return this._delegate;
839
+ return this._overrides;
565
840
  }
566
841
  showMessage(e, t) {
567
842
  const n = this.getDelegate();
568
843
  if (n?.showMessage) return n.showMessage(e, t);
569
- t?.type !== xt.Warning ? t?.type !== xt.Error ? fe.log(e) : fe.error(e) : fe.warn(e);
844
+ t?.type !== Et.Warning ? t?.type !== Et.Error ? me.log(e) : me.error(e) : me.warn(e);
570
845
  }
571
846
  showBusy(e, t) {
572
847
  const n = this.getDelegate();
@@ -581,7 +856,7 @@ class Vn extends cn {
581
856
  }
582
857
  showError(e) {
583
858
  const t = this.getDelegate();
584
- t?.showError ? t.showError(e) : fe.error(e);
859
+ t?.showError ? t.showError(e) : me.error(e);
585
860
  }
586
861
  showOptions(e) {
587
862
  const t = this.getDelegate();
@@ -592,14 +867,14 @@ class Vn extends cn {
592
867
  return t?.showInputOptions ? t.showInputOptions(e) : Promise.resolve({ input: "", option: "" });
593
868
  }
594
869
  }
595
- const Bt = rn(new Vn()), fo = ({ children: i, notifier: e }) => (ce.useEffect(() => {
596
- const t = fe.getDelegate();
597
- return fe.setDelegate(e), () => {
598
- fe.setDelegate(t);
870
+ const Nt = un(new Zn()), To = ({ children: i, notifier: e }) => (ie.useEffect(() => {
871
+ const t = me.getOverrides();
872
+ return me.setOverrides(e), () => {
873
+ me.setOverrides(t);
599
874
  };
600
- }, [e]), ce.createElement(Bt.Provider, { value: e }, i)), Ot = () => sn(Bt);
601
- function go(i) {
602
- const [e, t] = G(typeof window < "u" ? window.devicePixelRatio : 1), n = A(null);
875
+ }, [e]), ie.createElement(Nt.Provider, { value: e }, i)), Ht = () => dn(Nt);
876
+ function Mo(i) {
877
+ const [e, t] = q(typeof window < "u" ? window.devicePixelRatio : 1), n = O(null);
603
878
  return V(() => {
604
879
  if (!(typeof window < "u" && "matchMedia" in window)) return;
605
880
  const o = () => {
@@ -611,13 +886,13 @@ function go(i) {
611
886
  };
612
887
  }, [i]), e;
613
888
  }
614
- function yo(i) {
889
+ function ko(i) {
615
890
  if (typeof window > "u") return 1;
616
891
  const { defaultDpr: e = 1, maxDpr: t = 3, round: n = !0 } = i || {}, o = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : e;
617
892
  return Math.min(Math.max(1, n ? Math.floor(o) : o), t);
618
893
  }
619
- function vo(i, e, t) {
620
- const n = T(e, [e]);
894
+ function Do(i, e, t) {
895
+ const n = M(e, [e]);
621
896
  V(() => {
622
897
  const o = (r) => {
623
898
  i.current && !i.current.contains(r.target) && n(r);
@@ -627,108 +902,108 @@ function vo(i, e, t) {
627
902
  };
628
903
  }, [i]);
629
904
  }
630
- function In(i) {
905
+ function qn(i) {
631
906
  if (!i) throw new Error("must have a PointerHandlerOptions");
632
- const { onPointerDown: e, onPointerUp: t, onPointerMoveOrWait: n, processTouch: o = !1, consumeTouch: r = !0 } = i, s = T(e, [e]), l = T(t, [t]), a = T(n, [n]), c = A(!1), h = i?.timerInitial ?? 230, u = i?.timerContinuous ?? h / 2, d = A(null), b = A(null), w = A(null), x = A(null), S = H(() => {
633
- x.current && (clearTimeout(x.current), x.current = null);
634
- }, []), P = H((v) => {
635
- x.current = setTimeout(() => {
907
+ const { onPointerDown: e, onPointerUp: t, onPointerMoveOrWait: n, processTouch: o = !1, consumeTouch: r = !0 } = i, a = M(e, [e]), h = M(t, [t]), s = M(n, [n]), l = O(!1), c = i?.timerInitial ?? 230, u = i?.timerContinuous ?? c / 2, d = O(null), f = O(null), v = O(null), m = O(null), b = H(() => {
908
+ m.current && (clearTimeout(m.current), m.current = null);
909
+ }, []), T = H((S) => {
910
+ m.current = setTimeout(() => {
636
911
  window.requestAnimationFrame(() => {
637
- c.current !== !1 && a?.(b.current, w.current, d.current);
638
- }), P(u);
639
- }, v ?? h);
912
+ l.current !== !1 && s?.(f.current, v.current, d.current);
913
+ }), T(u);
914
+ }, S ?? c);
640
915
  }, []);
641
- V(() => () => S(), []);
642
- const _ = o ? "pointer" : "mouse", y = H((v) => {
643
- v.stopPropagation(), v.stopImmediatePropagation(), v.preventDefault();
644
- }, []), f = T((v) => {
645
- document.removeEventListener(`${_}move`, $), document.removeEventListener(`${_}up`, f), document.removeEventListener("keydown", I), document.removeEventListener("keyup", g), document.removeEventListener("touchstart", y, { capture: !0 }), document.removeEventListener("touchmove", y, { capture: !0 }), window.removeEventListener("blur", k), S(), window.requestAnimationFrame(() => {
646
- c.current !== !1 && (c.current = !1, l?.(v, w.current, d.current), w.current = null);
916
+ V(() => () => b(), []);
917
+ const _ = o ? "pointer" : "mouse", w = H((S) => {
918
+ S.stopPropagation(), S.stopImmediatePropagation(), S.preventDefault();
919
+ }, []), x = M((S) => {
920
+ document.removeEventListener(`${_}move`, B), document.removeEventListener(`${_}up`, x), document.removeEventListener("keydown", K), document.removeEventListener("keyup", y), document.removeEventListener("touchstart", w, { capture: !0 }), document.removeEventListener("touchmove", w, { capture: !0 }), window.removeEventListener("blur", A), b(), window.requestAnimationFrame(() => {
921
+ l.current !== !1 && (l.current = !1, h?.(S, v.current, d.current), v.current = null);
647
922
  });
648
- }, []), k = H(() => {
649
- c.current !== !1 && (c.current = !1, f(b.current));
650
- }, []), z = T(() => {
651
- S(), P(u), window.requestAnimationFrame(() => {
652
- c.current !== !1 && a?.(b.current, w.current, d.current);
923
+ }, []), A = H(() => {
924
+ l.current !== !1 && (l.current = !1, x(f.current));
925
+ }, []), P = M(() => {
926
+ b(), T(u), window.requestAnimationFrame(() => {
927
+ l.current !== !1 && s?.(f.current, v.current, d.current);
653
928
  });
654
- }, [u]), $ = T((v) => {
655
- b.current = v, z();
656
- }, []), I = T((v) => {
657
- w.current = { ctrlKey: v.ctrlKey, shiftKey: v.shiftKey, altKey: v.altKey, metaKey: v.metaKey }, z();
658
- }, []), g = T((v) => {
659
- w.current = { ctrlKey: v.ctrlKey, shiftKey: v.shiftKey, altKey: v.altKey, metaKey: v.metaKey }, z();
929
+ }, [u]), B = M((S) => {
930
+ f.current = S, P();
931
+ }, []), K = M((S) => {
932
+ v.current = { ctrlKey: S.ctrlKey, shiftKey: S.shiftKey, altKey: S.altKey, metaKey: S.metaKey }, P();
933
+ }, []), y = M((S) => {
934
+ v.current = { ctrlKey: S.ctrlKey, shiftKey: S.shiftKey, altKey: S.altKey, metaKey: S.metaKey }, P();
660
935
  }, [u]);
661
- return T((v) => {
662
- v.isDefaultPrevented() || (w.current = { ctrlKey: v.ctrlKey, shiftKey: v.shiftKey, altKey: v.altKey, metaKey: v.metaKey }, s(v, w.current) !== !1 && (d.current = v, b.current = v.nativeEvent, document.addEventListener(`${_}up`, f, { passive: !1 }), document.addEventListener(`${_}move`, $, { passive: !1 }), document.addEventListener("keydown", I, { passive: !1 }), document.addEventListener("keyup", g, { passive: !1 }), window.addEventListener("blur", k, { passive: !0 }), o && r && (document.addEventListener("touchstart", y, { passive: !1, capture: !0 }), document.addEventListener("touchmove", y, { passive: !1, capture: !0 })), c.current = !0, P(h)));
663
- }, [h, o]);
936
+ return M((S) => {
937
+ S.isDefaultPrevented() || (v.current = { ctrlKey: S.ctrlKey, shiftKey: S.shiftKey, altKey: S.altKey, metaKey: S.metaKey }, a(S, v.current) !== !1 && (d.current = S, f.current = S.nativeEvent, document.addEventListener(`${_}up`, x, { passive: !1 }), document.addEventListener(`${_}move`, B, { passive: !1 }), document.addEventListener("keydown", K, { passive: !1 }), document.addEventListener("keyup", y, { passive: !1 }), window.addEventListener("blur", A, { passive: !0 }), o && r && (document.addEventListener("touchstart", w, { passive: !1, capture: !0 }), document.addEventListener("touchmove", w, { passive: !1, capture: !0 })), l.current = !0, T(c)));
938
+ }, [c, o]);
664
939
  }
665
- function xo(i, e) {
666
- return In({ onPointerDown: i, onPointerMoveOrWait: (t, n, o) => {
940
+ function Po(i, e) {
941
+ return qn({ onPointerDown: i, onPointerMoveOrWait: (t, n, o) => {
667
942
  i?.(o);
668
943
  }, ...e });
669
944
  }
670
- const Nn = ({ initValue: i, useHookBody: e, applyStateChange: t }) => {
671
- const n = A(i);
945
+ const Jn = ({ initValue: i, useHookBody: e, applyStateChange: t }) => {
946
+ const n = O(i);
672
947
  if (typeof e != "function") throw new Error("function expected as hook body parameter. got " + typeof e);
673
948
  const o = e();
674
- return Ie(() => {
949
+ return Ve(() => {
675
950
  n.current !== o && (n.current = o, t(o));
676
951
  }, [t, o]), null;
677
- }, Je = (i) => {
952
+ }, Qe = (i) => {
678
953
  console && console.warn && console.warn(i);
679
954
  }, Xe = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
680
- let Wn = 1, Qe = !1, $t = !1;
681
- const Ke = [], we = [], Ve = () => {
682
- we.forEach((i) => i());
683
- }, Fn = ({ automaticContainerInternalUseOnly: i }) => {
684
- const [e, t] = G([]), n = A([]);
685
- return n.current = e, i || Qe !== !1 || ($t = !0), V(() => {
955
+ let Qn = 1, et = !1, Vt = !1;
956
+ const Re = [], be = [], He = () => {
957
+ be.forEach((i) => i());
958
+ }, eo = ({ automaticContainerInternalUseOnly: i }) => {
959
+ const [e, t] = q([]), n = O([]);
960
+ return n.current = e, i || et !== !1 || (Vt = !0), V(() => {
686
961
  let o = !0;
687
962
  function r() {
688
- if (o) return we[0] !== r ? (i || Qe !== !0 || Je("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void t((s) => [])) : void t([...Ke]);
963
+ if (o) return be[0] !== r ? (i || et !== !0 || Qe("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void t((a) => [])) : void t([...Re]);
689
964
  }
690
- return we.push(r), Ve(), () => {
691
- o = !1, n.current?.length > 0 && Je("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), we.splice(we.indexOf(r), 1), Ve();
965
+ return be.push(r), He(), () => {
966
+ o = !1, n.current?.length > 0 && Qe("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), be.splice(be.indexOf(r), 1), He();
692
967
  };
693
- }, [i]), L(De, { children: e.map(({ hook: o, key: r }) => ln(Nn, { ...o, key: r })) });
694
- }, Yn = (i) => {
695
- const e = Wn++;
696
- return Ke.push({ hook: i, key: e }), we.length === 0 && $t === !1 && (Qe = !0, ((t) => {
968
+ }, [i]), L(ke, { children: e.map(({ hook: o, key: r }) => pn(Jn, { ...o, key: r })) });
969
+ }, to = (i) => {
970
+ const e = Qn++;
971
+ return Re.push({ hook: i, key: e }), be.length === 0 && Vt === !1 && (et = !0, ((t) => {
697
972
  if (Xe.document && Xe.document.createElement) {
698
973
  const n = Xe.document.createElement("div");
699
- hn(n).render(L(t, { automaticContainerInternalUseOnly: !0 }));
700
- } else Je("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
701
- })(Fn)), Ve(), () => {
702
- Ke.splice(Ke.findIndex((t) => t.key === e), 1), Ve();
974
+ mn(n).render(L(t, { automaticContainerInternalUseOnly: !0 }));
975
+ } else Qe("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
976
+ })(eo)), He(), () => {
977
+ Re.splice(Re.findIndex((t) => t.key === e), 1), He();
703
978
  };
704
979
  };
705
- let et = null;
706
- et || (et = (i, e, t = {}) => {
707
- let n, o, r = !1, s = !1, l = [], { unmountIfNoConsumers: a = !1 } = t;
708
- const c = (u) => {
709
- o = u, un(() => l.forEach((d) => d(u)));
710
- }, h = () => (s || (o = typeof i == "function" ? i() : i, s = !0), o);
980
+ let tt = null;
981
+ tt || (tt = (i, e, t = {}) => {
982
+ let n, o, r = !1, a = !1, h = [], { unmountIfNoConsumers: s = !1 } = t;
983
+ const l = (u) => {
984
+ o = u, gn(() => h.forEach((d) => d(u)));
985
+ }, c = () => (a || (o = typeof i == "function" ? i() : i, a = !0), o);
711
986
  return () => {
712
- const [u, d] = G(h);
713
- return V(() => (r || (r = !0, n = Yn({ initValue: i, useHookBody: e, applyStateChange: c })), l.push(d), o !== u && d(o), () => {
714
- l.splice(l.indexOf(d), 1), l.length === 0 && a && (n(), r = !1);
987
+ const [u, d] = q(c);
988
+ return V(() => (r || (r = !0, n = to({ initValue: i, useHookBody: e, applyStateChange: l })), h.push(d), o !== u && d(o), () => {
989
+ h.splice(h.indexOf(d), 1), h.length === 0 && s && (n(), r = !1);
715
990
  }), []), u;
716
991
  };
717
992
  });
718
- const Kt = et;
719
- let Rt = () => {
993
+ const Wt = tt;
994
+ let Ft = () => {
720
995
  console.warn("You must call useEditMode before setting its state.");
721
996
  };
722
- const Xn = Kt(null, () => {
723
- const [i, e] = G(null);
724
- return Rt = e, i;
725
- }), wo = () => {
726
- const i = Xn();
727
- return W(() => ({ setMode: (e) => {
728
- Rt((t) => (typeof e == "function" && (e = e(t)), e?.onModeChange?.(e ?? null), e));
997
+ const no = Wt(null, () => {
998
+ const [i, e] = q(null);
999
+ return Ft = e, i;
1000
+ }), Ao = () => {
1001
+ const i = no();
1002
+ return N(() => ({ setMode: (e) => {
1003
+ Ft((t) => (typeof e == "function" && (e = e(t)), e?.onModeChange?.(e ?? null), e));
729
1004
  }, getMode: () => i }), [i]);
730
1005
  };
731
- class tt {
1006
+ class nt {
732
1007
  constructor(e, t, n, o) {
733
1008
  this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = e, this._target = t, this._applyProps(n || {}), this._callback = o, o === void 0 && (this._callback = () => {
734
1009
  console.log(`implement: ${this.label()} : ${this.description()}`);
@@ -839,15 +1114,15 @@ class tt {
839
1114
  }), t;
840
1115
  }
841
1116
  }
842
- class je extends tt {
1117
+ class Ue extends nt {
843
1118
  }
844
- class Ht {
1119
+ class jt {
845
1120
  constructor(e, t) {
846
- this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = te.uuidV4(), this._target = e, this._groupKey = t ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(t, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
1121
+ this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = Z.uuidV4(), this._target = e, this._groupKey = t ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(t, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
847
1122
  const n = this;
848
1123
  this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (o, r) => {
849
- const s = n._root._listenersByKey, l = r.key(), a = s.get(l);
850
- a && n._notifyCommands(a, "onCommandChange", r);
1124
+ const a = n._root._listenersByKey, h = r.key(), s = a.get(h);
1125
+ s && n._notifyCommands(s, "onCommandChange", r);
851
1126
  };
852
1127
  }
853
1128
  _getCommand(e) {
@@ -862,19 +1137,19 @@ class Ht {
862
1137
  createChildGroup(e, t, n) {
863
1138
  let o;
864
1139
  if (!n) {
865
- let l = this;
866
- for (; l && !o; ) {
867
- let a = l._nodes.get(t);
868
- a && (o = a), l = l._parent;
1140
+ let h = this;
1141
+ for (; h && !o; ) {
1142
+ let s = h._nodes.get(t);
1143
+ s && (o = s), h = h._parent;
869
1144
  }
870
1145
  }
871
- o || (o = new Ht(e, t), o._parent = this, o._root = this._root, o._unListenersByCommand = null, o._listenersByKey = null, o._commandsPropertyListener = null);
872
- const r = (l, a) => {
873
- !l.has(t) || n ? l.set(t, a) : n === void 0 && console.warn("commandGroup already registered", t);
1146
+ o || (o = new jt(e, t), o._parent = this, o._root = this._root, o._unListenersByCommand = null, o._listenersByKey = null, o._commandsPropertyListener = null);
1147
+ const r = (h, s) => {
1148
+ !h.has(t) || n ? h.set(t, s) : n === void 0 && console.warn("commandGroup already registered", t);
874
1149
  };
875
1150
  r(this._root._nodes, o);
876
- let s = this._parent;
877
- for (; s; ) r(this._nodes, o), s = s._parent;
1151
+ let a = this._parent;
1152
+ for (; a; ) r(this._nodes, o), a = a._parent;
878
1153
  return this._children.set(t, o), this._notify("onGroupChange"), o;
879
1154
  }
880
1155
  getKey() {
@@ -884,24 +1159,24 @@ class Ht {
884
1159
  return this._nodes.get(e);
885
1160
  }
886
1161
  _addCommands(e, t = void 0) {
887
- const n = this._commandsByKey, o = this._commandsByShortcut, r = this._root._commandsPropertyListener, s = this._root._unListenersByCommand;
888
- for (let l = 0; l < e.length; l++) {
889
- const a = e[l], c = a.key();
890
- if (n.has(c) && !t) {
891
- t === void 0 && console.warn("command already registered", c);
1162
+ const n = this._commandsByKey, o = this._commandsByShortcut, r = this._root._commandsPropertyListener, a = this._root._unListenersByCommand;
1163
+ for (let h = 0; h < e.length; h++) {
1164
+ const s = e[h], l = s.key();
1165
+ if (n.has(l) && !t) {
1166
+ t === void 0 && console.warn("command already registered", l);
892
1167
  continue;
893
1168
  }
894
- n.set(c, a);
895
- let h = s.get(a);
896
- h && (h(), s.delete(a));
897
- const u = a.addPropertyListener(r);
898
- s.set(a, u);
899
- const d = a.shortcut();
1169
+ n.set(l, s);
1170
+ let c = a.get(s);
1171
+ c && (c(), a.delete(s));
1172
+ const u = s.addPropertyListener(r);
1173
+ a.set(s, u);
1174
+ const d = s.shortcut();
900
1175
  if (!d) continue;
901
- const b = Array.isArray(d) ? d : [d];
902
- for (let w = 0; w < b.length; w++) {
903
- const x = Me(b[w]), S = o.get(x);
904
- S && !t && t === void 0 && console.warn(`Shortcut already registered: ${x}, ${c}, ${S}.`), o.set(x, c);
1176
+ const f = Array.isArray(d) ? d : [d];
1177
+ for (let v = 0; v < f.length; v++) {
1178
+ const m = Me(f[v]), b = o.get(m);
1179
+ b && !t && t === void 0 && console.warn(`Shortcut already registered: ${m}, ${l}, ${b}.`), o.set(m, l);
905
1180
  }
906
1181
  }
907
1182
  }
@@ -912,9 +1187,9 @@ class Ht {
912
1187
  for (; e; ) t.push(e._nodes), e._nodes.delete(n), e = e._parent;
913
1188
  e = this._parent;
914
1189
  const o = (r) => {
915
- r._children.forEach((s) => {
916
- for (let l = 0; l < t.length; l++) s._nodes.delete(t[l]);
917
- o(s);
1190
+ r._children.forEach((a) => {
1191
+ for (let h = 0; h < t.length; h++) a._nodes.delete(t[h]);
1192
+ o(a);
918
1193
  });
919
1194
  };
920
1195
  o(this), this._parent = null, this._notify("onGroupChange");
@@ -934,13 +1209,13 @@ class Ht {
934
1209
  }
935
1210
  findCommandByEvent(e) {
936
1211
  const t = [];
937
- e.altKey && t.push(Z.Alt), e.shiftKey && t.push(Z.Shift), e.ctrlKey && t.push(Z.Ctrl), e.metaKey && t.push(Z.Meta);
1212
+ e.altKey && t.push(G.Alt), e.shiftKey && t.push(G.Shift), e.ctrlKey && t.push(G.Ctrl), e.metaKey && t.push(G.Meta);
938
1213
  let n = Me({ key: e.code, modifiers: t });
939
1214
  const o = this._commandsByShortcut;
940
1215
  let r = o.get(n);
941
1216
  r || (n = Me({ key: e.key, modifiers: t }), r = o.get(n)), !r && e.code.startsWith("Digit") && (n = Me({ key: e.code.substring(5, e.code.length), modifiers: t }), r = this._commandsByShortcut.get(n)), !r && e.code.startsWith("Key") && (r = Me({ key: e.code.substring(3, e.code.length), modifiers: t }), r = o.get(n));
942
- let s = null;
943
- return r && (s = this._commandsByKey.get(r), s && s.disabled() && (s = null), !s || s.target() && s.target().contains(e.target) || (s = null)), s || (this._parent?.findCommandByEvent(e) ?? null);
1217
+ let a = null;
1218
+ return r && (a = this._commandsByKey.get(r), a && a.disabled() && (a = null), !a || a.target() && a.target().contains(e.target) || (a = null)), a || (this._parent?.findCommandByEvent(e) ?? null);
944
1219
  }
945
1220
  dispatchToFocusedCommand(e) {
946
1221
  const t = this.getActive();
@@ -957,16 +1232,16 @@ class Ht {
957
1232
  addListener(e, t) {
958
1233
  const n = this._listeners, o = t?.keys, r = this._root._listenersByKey;
959
1234
  if (o && !e.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
960
- let s = null;
961
- if (o) for (let l = 0; l < o.length; l++) {
962
- const a = o[l];
963
- if (!a) continue;
964
- let c = r.get(a);
965
- c || (c = /* @__PURE__ */ new Set(), r.set(a, c)), s || (s = []), s.push(c), c.add(e);
1235
+ let a = null;
1236
+ if (o) for (let h = 0; h < o.length; h++) {
1237
+ const s = o[h];
1238
+ if (!s) continue;
1239
+ let l = r.get(s);
1240
+ l || (l = /* @__PURE__ */ new Set(), r.set(s, l)), a || (a = []), a.push(l), l.add(e);
966
1241
  }
967
1242
  return n.add(e), () => {
968
- if (s) for (let l = 0; l < s.length; l++)
969
- s[l].delete(e);
1243
+ if (a) for (let h = 0; h < a.length; h++)
1244
+ a[h].delete(e);
970
1245
  n.delete(e);
971
1246
  };
972
1247
  }
@@ -995,257 +1270,262 @@ class Ht {
995
1270
  }), e;
996
1271
  }
997
1272
  }
998
- const jn = te.getOS() === te.OSType.MacOS || te.getOS() === te.OSType.IOS ? "Cmd" : "Ctrl", Un = te.getOS() === te.OSType.MacOS || te.getOS() === te.OSType.IOS ? "⌘" : "^", Me = (i, e = !1) => {
1273
+ const oo = Z.getOS() === Z.OSType.MacOS || Z.getOS() === Z.OSType.IOS ? "Cmd" : "Ctrl", io = Z.getOS() === Z.OSType.MacOS || Z.getOS() === Z.OSType.IOS ? "⌘" : "^", Me = (i, e = !1) => {
999
1274
  const t = {};
1000
1275
  for (let o = 0; i.modifiers && o < i.modifiers.length; o++) t[i.modifiers[o]] = !0;
1001
1276
  let n = "";
1002
- return (t?.[Z.Ctrl] || t?.[Z.Meta]) && (n += (n.length > 0 ? "+" : "") + (e ? Un : jn)), t?.[Z.Alt] && (n += e ? "⌥" : "Alt"), t?.[Z.Shift] && (n += (n.length > 0 ? "+" : "") + (e ? "⇧" : "Shift")), n += (n.length > 0 ? "+" : "") + kt(i.key), n;
1277
+ return (t?.[G.Ctrl] || t?.[G.Meta]) && (n += (n.length > 0 ? "+" : "") + (e ? io : oo)), t?.[G.Alt] && (n += e ? "⌥" : "Alt"), t?.[G.Shift] && (n += (n.length > 0 ? "+" : "") + (e ? "⇧" : "Shift")), n += (n.length > 0 ? "+" : "") + Rt(i.key), n;
1003
1278
  };
1004
- function bo(i, e = null) {
1005
- const t = A(e);
1279
+ function zo(i, e = null) {
1280
+ const t = O(e);
1006
1281
  t.current = e;
1007
- const [n, o] = an((s) => s + 1, 0), r = W(() => Array.isArray(i) ? i : [i], [i]);
1282
+ const [n, o] = fn((a) => a + 1, 0), r = N(() => Array.isArray(i) ? i : [i], [i]);
1008
1283
  return V(() => {
1009
1284
  if (!r || r.length === 0) return;
1010
- const s = (c, h) => {
1011
- t.current?.onChange?.(h), o();
1285
+ const a = (l, c) => {
1286
+ t.current?.onChange?.(c), o();
1012
1287
  };
1013
- let l = null;
1014
- e && (l = { onExecute(c, h) {
1015
- t.current?.onExecute?.(c, h);
1016
- }, onError(c, h, u) {
1017
- t.current?.onError?.(c, h, u);
1288
+ let h = null;
1289
+ e && (h = { onExecute(l, c) {
1290
+ t.current?.onExecute?.(l, c);
1291
+ }, onError(l, c, u) {
1292
+ t.current?.onError?.(l, c, u);
1018
1293
  } });
1019
- const a = /* @__PURE__ */ new Set();
1020
- for (let c = 0; c < r.length; c++) a.add(r[c]?.addPropertyListener(te.debounce(s, 0), !0)), e && a.add(r[c]?.addExecuteListener(l));
1294
+ const s = /* @__PURE__ */ new Set();
1295
+ for (let l = 0; l < r.length; l++) s.add(r[l]?.addPropertyListener(Z.debounce(a, 0), !0)), e && s.add(r[l]?.addExecuteListener(h));
1021
1296
  return () => {
1022
- a.forEach((c) => {
1023
- c?.();
1297
+ s.forEach((l) => {
1298
+ l?.();
1024
1299
  });
1025
1300
  };
1026
1301
  }, [i]), n;
1027
1302
  }
1028
1303
  const $e = (i, e) => {
1029
- const t = [];
1030
- if (e) for (let n = 0; n < e.length; n++) {
1031
- const o = e[n], r = o ? i?.getCommand(o) : null;
1032
- t.push(r);
1304
+ if (!e || !i || e.length === 0) return Z.EmptyArray;
1305
+ const t = e.length, n = new Array(t);
1306
+ for (let o = 0; o < t; o++) {
1307
+ const r = e[o], a = r ? i.getCommand(r) : null;
1308
+ n[o] = a;
1033
1309
  }
1034
- return t;
1310
+ return n;
1035
1311
  };
1036
- function So(i, e = null, t = null, n) {
1037
- const o = A(t);
1312
+ function Bo(i, e = null, t = null, n) {
1313
+ const o = O(t);
1038
1314
  o.current = t, e && !Array.isArray(e) && (e = [e]);
1039
- const [r, s] = G($e(i, e)), l = n ? [...n, i] : [i];
1315
+ const [r, a] = q($e(i, e)), h = n ? [...n, i] : [i];
1040
1316
  return V(() => {
1041
- const a = { onGroupChange: () => {
1317
+ const s = { onGroupChange: () => {
1042
1318
  const d = $e(i, e);
1043
- s(d), o.current?.onChange?.(this);
1319
+ a(d), o.current?.onChange?.(this);
1044
1320
  } };
1045
- let c;
1046
- e && e.length > 0 && (c = { keys: e }, a.onCommandChange = (d, b) => {
1047
- o.current?.onChange?.(i), s($e(i, e));
1321
+ let l;
1322
+ e && e.length > 0 && (l = { keys: e }, s.onCommandChange = (d, f) => {
1323
+ o.current?.onChange?.(i), a($e(i, e));
1048
1324
  });
1049
- const h = i?.addListener(a, c), u = $e(i, e);
1050
- return s(u), o.current?.onChange && o.current?.onChange(i), () => {
1051
- h?.();
1325
+ const c = i?.addListener(s, l), u = $e(i, e);
1326
+ return a(u), o.current?.onChange && o.current?.onChange(i), () => {
1327
+ c?.();
1052
1328
  };
1053
- }, l), r;
1329
+ }, h), r;
1054
1330
  }
1055
- const Lo = { Toolbar: "toolbar", Menuitem: "menuitem" }, Zn = Kt({ setClipboard: (i) => {
1331
+ const Oo = { Toolbar: "toolbar", Menuitem: "menuitem" }, ro = Wt({ setClipboard: (i) => {
1056
1332
  throw new Error("This is only available via the useClipboard.");
1057
- }, getClipboard: () => Re.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
1058
- const [i, e] = G(Re.Global);
1059
- return { setClipboard: (t) => e(t), getClipboard: () => i, refNativeCopy: A(null), refNativeLastKey: A(null) };
1060
- }), Co = (i) => {
1061
- const { source: e, target: t, onPaste: n, onClipboardUpdate: o, commands: r } = i, s = Ot(), l = T(o, [o]), a = T(n, [n]), { getClipboard: c, refNativeCopy: h } = Zn(), u = c();
1062
- W(() => {
1063
- const _ = e?.element, y = t?.element ?? e?.element;
1333
+ }, getClipboard: () => Ie.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
1334
+ const [i, e] = q(Ie.Global);
1335
+ return { setClipboard: (t) => e(t), getClipboard: () => i, refNativeCopy: O(null), refNativeLastKey: O(null) };
1336
+ }), $o = (i) => {
1337
+ const { source: e, target: t, onPaste: n, onClipboardUpdate: o, commands: r } = i, a = Ht(), h = M(o, [o]), s = M(n, [n]), { getClipboard: l, refNativeCopy: c } = ro(), u = l();
1338
+ N(() => {
1339
+ const _ = e?.element, w = t?.element ?? e?.element;
1064
1340
  if (!r) return;
1065
- const f = [new je("cut", _, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", shortcut: { key: "X", modifiers: [Z.Ctrl] } }), new je("copy", _, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", shortcut: { key: "C", modifiers: [Z.Ctrl] } }), new je("paste", y, { label: "Paste", description: "Add content on the clipboard to your document.", shortcut: [{ key: "V", modifiers: [Z.Ctrl] }, { key: "F8", modifiers: [Z.Ctrl] }] })];
1066
- r?.addCommands(f, !0);
1341
+ const x = [new Ue("cut", _, { 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: [G.Ctrl] } }), new Ue("copy", _, { 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: [G.Ctrl] } }), new Ue("paste", w, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste", shortcut: [{ key: "V", modifiers: [G.Ctrl] }, { key: "F8", modifiers: [G.Ctrl] }] })];
1342
+ r?.addCommands(x, !0);
1067
1343
  }, [r]);
1068
- const d = T(async (_) => {
1344
+ const d = M(async (_) => {
1069
1345
  if (!e?.element) return;
1070
- let y = null;
1346
+ let w = null;
1071
1347
  try {
1072
- y = e.doCopy?.(_), typeof y == "string" ? await u.writeText(y) : await u.writeReference(y);
1073
- } catch (f) {
1074
- throw f;
1348
+ w = e.doCopy?.(_), typeof w == "string" ? await u.writeText(w) : await u.writeReference(w);
1349
+ } catch (x) {
1350
+ throw x;
1075
1351
  }
1076
- }, [e, s]), b = T(async (_) => {
1077
- const y = e?.element?.();
1078
- if (y) {
1079
- h.current = { sourceElement: y, args: _ };
1352
+ }, [e, a]), f = M(async (_) => {
1353
+ const w = e?.element?.();
1354
+ if (w) {
1355
+ c.current = { sourceElement: w, args: _ };
1080
1356
  try {
1081
1357
  await d(_);
1082
- } catch (f) {
1083
- s.showError?.(f);
1358
+ } catch (x) {
1359
+ a.showError?.(x);
1084
1360
  }
1085
1361
  }
1086
- }, [e?.element, s]), w = H(() => {
1087
- b({ isCut: !0 });
1088
- }, []), x = T(async (_, y, f) => {
1362
+ }, [e?.element, a]), v = H(() => {
1363
+ f({ isCut: !0 });
1364
+ }, []), m = M(async (_, w, x) => {
1089
1365
  try {
1090
- if (await _.doPaste(y, f) === !1) return;
1091
- a?.(y, f);
1092
- } catch (k) {
1093
- s.showError?.(k);
1366
+ if (await _.doPaste(w, x) === !1) return;
1367
+ s?.(w, x);
1368
+ } catch (A) {
1369
+ a.showError?.(A);
1094
1370
  }
1095
- }, [a]), S = T(async (_, y, f) => {
1096
- const k = t?.element?.();
1097
- if (k && await te.whenFocus(k), !_ && !y) return;
1098
- const z = await s.showBusy?.("Pasting...");
1099
- if (y) try {
1100
- return await x(t, y, f), void z?.();
1101
- } catch (g) {
1102
- z?.(), s.showError?.(g);
1371
+ }, [s]), b = M(async (_, w, x) => {
1372
+ const A = t?.element?.();
1373
+ if (A && await Z.whenFocus(A), !_ && !w) return;
1374
+ const P = await a.showBusy?.("Pasting...");
1375
+ if (w) try {
1376
+ return await m(t, w, x), void P?.();
1377
+ } catch (y) {
1378
+ P?.(), a.showError?.(y);
1103
1379
  }
1104
- let $, I = t.importFromExternal;
1105
- I || (I = (g, v) => ({ getItemType: () => "text", toText: () => _.text, isClipboardItem: !0 }));
1380
+ let B, K = t.importFromExternal;
1381
+ K || (K = (y, S) => ({ getItemType: () => "text", toText: () => _.text, isClipboardItem: !0 }));
1106
1382
  try {
1107
- $ = await I(_, { isCut: !1 });
1108
- } catch (g) {
1109
- z?.(), s.showError?.(g);
1383
+ B = await K(_, { isCut: !1 });
1384
+ } catch (y) {
1385
+ P?.(), a.showError?.(y);
1110
1386
  }
1111
- if ($) try {
1112
- const g = await Promise.resolve($);
1113
- await x(t, g, f), z?.();
1114
- } catch (g) {
1115
- z?.(), s.showError?.(g);
1387
+ if (B) try {
1388
+ const y = await Promise.resolve(B);
1389
+ await m(t, y, x), P?.();
1390
+ } catch (y) {
1391
+ P?.(), a.showError?.(y);
1116
1392
  }
1117
- else z?.();
1118
- }, [x, t, s]), P = T(async (_) => {
1393
+ else P?.();
1394
+ }, [m, t, a]), T = M(async (_) => {
1119
1395
  if (t?.element) try {
1120
- const y = await u.readReference();
1121
- if (y) return void await S(null, y, _);
1122
- const f = [];
1123
- f[0] = await We.readStringFromClipboard(u, Fe.plain), f[1] = await We.readHTMLFromClipboard(u, Fe.html), f[2] = await We.readBlobFromClipboard(u, Fe.png);
1124
- const k = { text: f[0] ?? null, html: f[1] ?? null, image: f[2] ?? null };
1125
- await S(k, null, _);
1126
- } catch (y) {
1127
- if (y?.message === "Document is not focused.") return;
1128
- s.showError?.(y);
1396
+ const w = await u.readReference();
1397
+ if (w) return void await b(null, w, _);
1398
+ const x = [];
1399
+ x[0] = await Fe.readStringFromClipboard(u, je.plain), x[1] = await Fe.readHTMLFromClipboard(u, je.html), x[2] = await Fe.readBlobFromClipboard(u, je.png);
1400
+ const A = { text: x[0] ?? null, html: x[1] ?? null, image: x[2] ?? null };
1401
+ await b(A, null, _);
1402
+ } catch (w) {
1403
+ if (w?.message === "Document is not focused.") return;
1404
+ a.showError?.(w);
1129
1405
  }
1130
- }, [S, t?.element, s]);
1131
- return T(async (_) => {
1132
- }, [e?.element]), T(async (_) => {
1133
- }, [t?.element, S, s]), V(() => {
1406
+ }, [b, t?.element, a]);
1407
+ return M(async (_) => {
1408
+ }, [e?.element]), M(async (_) => {
1409
+ }, [t?.element, b, a]), V(() => {
1134
1410
  if (!u) return;
1135
- const _ = async (k) => {
1136
- const z = await u.readReference();
1137
- l?.(z);
1138
- }, y = (k) => {
1139
- s.showMessage?.(Re.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
1140
- }, f = (k) => {
1141
- s.showMessage?.(Re.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
1411
+ const _ = async (A) => {
1412
+ const P = await u.readReference();
1413
+ h?.(P);
1414
+ }, w = (A) => {
1415
+ a.showMessage?.(Ie.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
1416
+ }, x = (A) => {
1417
+ a.showMessage?.(Ie.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
1142
1418
  };
1143
- return u.addEventListener("clipboardchange", _), u.addEventListener("clipboarderrorread", y), u.addEventListener("clipboarderrorwrite", f), () => {
1144
- u.removeEventListener("clipboardchange", _), u.removeEventListener("clipboarderrorread", y), u.removeEventListener("clipboarderrorwrite", f);
1419
+ return u.addEventListener("clipboardchange", _), u.addEventListener("clipboarderrorread", w), u.addEventListener("clipboarderrorwrite", x), () => {
1420
+ u.removeEventListener("clipboardchange", _), u.removeEventListener("clipboarderrorread", w), u.removeEventListener("clipboarderrorwrite", x);
1145
1421
  };
1146
- }, [u, s]), V(() => {
1147
- }, [d, S, e, t]), V(() => {
1148
- r?.getCommand("cut")?.updateCallback(w).update({ disabled: !e || !t }), r?.getCommand("copy")?.updateCallback(b).update({ disabled: !e }), r?.getCommand("paste")?.updateCallback(P).update({ disabled: !t });
1149
- }, [e, t, r]), { paste: P, copy: b, clipboard: u };
1422
+ }, [u, a]), V(() => {
1423
+ }, [d, b, e, t]), V(() => {
1424
+ r?.getCommand("cut")?.updateCallback(v).update({ disabled: !e || !t }), r?.getCommand("copy")?.updateCallback(f).update({ disabled: !e }), r?.getCommand("paste")?.updateCallback(T).update({ disabled: !t });
1425
+ }, [e, t, r]), { paste: T, copy: f, clipboard: u };
1150
1426
  };
1151
- function Eo(i, e = !0) {
1152
- const t = A(i);
1427
+ function Ko(i, e = !0) {
1428
+ const t = O(i);
1153
1429
  V(() => {
1154
1430
  if (e) {
1155
- const n = Object.entries(i).reduce((o, [r, s]) => (t.current[r] !== s && (o[r] = [t.current[r], s]), o), {});
1431
+ const n = Object.entries(i).reduce((o, [r, a]) => (t.current[r] !== a && (o[r] = [t.current[r], a]), o), {});
1156
1432
  Object.keys(n).length > 0 && console.log("Changed props:", n);
1157
1433
  }
1158
1434
  t.current = i;
1159
1435
  });
1160
1436
  }
1161
- let Ue = !1, Gn = 0;
1162
- var qn = typeof document < "u" ? Ie : V;
1163
- const wt = () => "sheetxl-ui-" + Gn++, bt = ce.useId, To = bt ?? function() {
1164
- const [i, e] = ce.useState(() => Ue ? wt() : void 0);
1165
- return qn(() => {
1166
- i == null && e(wt());
1167
- }, []), ce.useEffect(() => {
1168
- Ue || (Ue = !0);
1437
+ let Ge = !1, so = 0;
1438
+ var lo = typeof document < "u" ? Ve : V;
1439
+ const Tt = () => "sheetxl-ui-" + so++, Mt = ie.useId, Ro = Mt ?? function() {
1440
+ const [i, e] = ie.useState(() => Ge ? Tt() : void 0);
1441
+ return lo(() => {
1442
+ i == null && e(Tt());
1443
+ }, []), ie.useEffect(() => {
1444
+ Ge || (Ge = !0);
1169
1445
  }, []), i;
1170
- }, St = "Undo the last action.", Lt = "Repeat the last action or undo the redo.", Jn = (i) => `Redo ${i}`, Mo = ({ manager: i, commands: e, disabled: t }) => {
1171
- const n = Ot(), o = T((s) => {
1446
+ }, kt = "Undo the last action.", Dt = "Repeat the last action or undo the redo.", ao = (i) => `Redo ${i}`, Io = ({ manager: i, commands: e, disabled: t }) => {
1447
+ const n = Ht(), o = M((a) => {
1172
1448
  try {
1173
- i?.undo(s);
1174
- } catch (l) {
1175
- n.error(l);
1449
+ i?.undo(a);
1450
+ } catch (h) {
1451
+ n.error(h);
1176
1452
  }
1177
- }, [i]), r = T((s) => {
1453
+ }, [i]), r = M((a) => {
1178
1454
  try {
1179
- i?.redo(s);
1180
- } catch (l) {
1181
- n.error(l);
1455
+ i?.redo(a);
1456
+ } catch (h) {
1457
+ n.error(h);
1182
1458
  }
1183
1459
  }, [i]);
1184
- return W(() => {
1460
+ return N(() => {
1185
1461
  if (!e) return;
1186
- const s = { contains: (a) => !0, focus() {
1187
- } }, l = [new tt("undo", s, { label: "Undo", description: St, shortcut: { key: "z", modifiers: [Z.Ctrl] }, disabled: !0 }, o), new tt("redo", s, { label: "Redo", description: Lt, shortcut: [{ key: "y", modifiers: [Z.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [Z.Alt] }], disabled: !0 }, r)];
1188
- e?.addCommands(l, !0);
1462
+ const a = { contains: (s) => !0, focus() {
1463
+ } }, h = [new nt("undo", a, { label: "Undo", description: kt, shortcut: { key: "z", modifiers: [G.Ctrl] }, disabled: !0 }, o), new nt("redo", a, { label: "Redo", description: Dt, shortcut: [{ key: "y", modifiers: [G.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [G.Alt] }], disabled: !0 }, r)];
1464
+ e?.addCommands(h, !0);
1189
1465
  }, [e]), V(() => {
1190
1466
  if (!e) return;
1191
- const s = () => {
1192
- const a = i?.getTopUndoDescription(), c = {};
1193
- var h;
1194
- e.getCommand("undo").update({ disabled: t || !i || !i.hasUndo(), description: a ? (h = a, `Undo ${h}`) : St, state: c, context: { undoManager: i } });
1467
+ const a = () => {
1468
+ const s = i?.getTopUndoDescription(), l = {};
1469
+ var c;
1470
+ e.getCommand("undo").update({ disabled: t || !i || !i.hasUndo(), description: s ? (c = s, `Undo ${c}`) : kt, state: l, context: { undoManager: i } });
1195
1471
  const u = i?.getTopRedoDescription();
1196
- e.getCommand("redo").update({ disabled: t || !i || !i.hasRedo(), description: u ? Jn(u) : Lt, state: c, context: { undoManager: i } });
1472
+ e.getCommand("redo").update({ disabled: t || !i || !i.hasRedo(), description: u ? ao(u) : Dt, state: l, context: { undoManager: i } });
1197
1473
  };
1198
- if (s(), !i) return;
1199
- const l = i.addListener({ onStackChange() {
1200
- s();
1474
+ if (a(), !i) return;
1475
+ const h = i.addListener({ onStackChange() {
1476
+ a();
1201
1477
  } });
1202
- return () => l?.();
1478
+ return () => h?.();
1203
1479
  }, [i, e, t]), { undo: o, redo: r };
1204
1480
  };
1205
1481
  export {
1206
- tt as Command,
1207
- Lo as CommandButtonType,
1208
- Ht as CommandGroup,
1209
- Vn as DelegatingReactNotifier,
1210
- po as FocusKeyNavigation,
1211
- io as HorizontalAlignment,
1212
- ro as KeyCodes,
1213
- Z as KeyModifiers,
1214
- so as MouseButtonCodes,
1215
- fo as NotifierProvider,
1216
- xt as NotifierType,
1217
- co as ReactUtils,
1218
- _o as RoundedTab,
1219
- zn as ScrollPane,
1220
- ao as ScrollUtils,
1221
- nt as Scrollbar,
1222
- re as ScrollbarOrientation,
1223
- je as SimpleCommand,
1224
- mo as SplitPane,
1225
- Hn as SplitPaneResizer,
1226
- uo as ToolTipPlacement,
1227
- Kn as VirtualScrollbar,
1228
- Pn as defaultCreateScrollCorner,
1229
- lo as defaultCreateScrollEdgeButton,
1230
- mn as defaultCreateScrollEndButton,
1231
- _n as defaultCreateScrollStartButton,
1232
- vt as defaultCreateScrollbar,
1233
- yo as getDevicePixelRatio,
1482
+ nt as Command,
1483
+ Oo as CommandButtonType,
1484
+ jt as CommandGroup,
1485
+ Ke as DefaultDynamicIconService,
1486
+ Zn as DefaultReactNotifier,
1487
+ Gn as DynamicIcon,
1488
+ So as FocusKeyNavigation,
1489
+ _o as HorizontalAlignment,
1490
+ mo as KeyCodes,
1491
+ G as KeyModifiers,
1492
+ go as MouseButtonCodes,
1493
+ To as NotifierProvider,
1494
+ Et as NotifierType,
1495
+ xo as ReactUtils,
1496
+ Lo as RoundedTab,
1497
+ Kn as ScrollPane,
1498
+ vo as ScrollUtils,
1499
+ ot as Scrollbar,
1500
+ se as ScrollbarOrientation,
1501
+ Ue as SimpleCommand,
1502
+ Co as SplitPane,
1503
+ jn as SplitPaneResizer,
1504
+ bo as ToolTipPlacement,
1505
+ Wn as VirtualScrollbar,
1506
+ Eo as WalkingIcon,
1507
+ Xn as createDynamicIconService,
1508
+ $n as defaultCreateScrollCorner,
1509
+ yo as defaultCreateScrollEdgeButton,
1510
+ wn as defaultCreateScrollEndButton,
1511
+ xn as defaultCreateScrollStartButton,
1512
+ xt as defaultCreateScrollbar,
1513
+ ko as getDevicePixelRatio,
1234
1514
  Me as toShortcutString,
1235
- T as useCallbackRef,
1236
- bo as useCommand,
1237
- So as useCommands,
1238
- Co as useCopyPaste,
1239
- go as useDevicePixelRatio,
1240
- wo as useEditMode,
1241
- ho as useFullscreenPortal,
1242
- Zn as useGlobalClipboard,
1243
- To as useId,
1244
- At as useImperativeElement,
1245
- xo as useMouseDownAndHoldListener,
1246
- Ot as useNotifier,
1247
- vo as useOnClickOrFocusAway,
1248
- In as useSynchronizedPointerHandler,
1249
- Eo as useTraceUpdate,
1250
- Mo as useUndoManager
1515
+ M as useCallbackRef,
1516
+ zo as useCommand,
1517
+ Bo as useCommands,
1518
+ $o as useCopyPaste,
1519
+ Mo as useDevicePixelRatio,
1520
+ Ao as useEditMode,
1521
+ wo as useFullscreenPortal,
1522
+ ro as useGlobalClipboard,
1523
+ Ro as useId,
1524
+ It as useImperativeElement,
1525
+ Po as useMouseDownAndHoldListener,
1526
+ Ht as useNotifier,
1527
+ Do as useOnClickOrFocusAway,
1528
+ qn as useSynchronizedPointerHandler,
1529
+ Ko as useTraceUpdate,
1530
+ Io as useUndoManager
1251
1531
  };