@sheetxl/utils-react 0.7.12 → 0.7.13
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.
- package/browser/cjs/{BGFqkFxbLS0vmmh5.cjs → C2UpOWov5hxZw0Mu.cjs} +1 -1
- package/browser/cjs/index.cjs +3 -3
- package/browser/esm/{CNTtjTL9eZe9TQw2.mjs → BGxm64YWS34jS1Mw.mjs} +1 -1
- package/browser/esm/index.mjs +1490 -1361
- package/licenses/dependencies.txt +33 -33
- package/node/assets/style.css +1 -1
- package/node/esm/{i36M1qE9kUNw0xW3.mjs → BUbqNRja31CtMjD9.mjs} +1 -1
- package/node/esm/index.mjs +1395 -1262
- package/package.json +8 -4
- package/types/index.d.ts +222 -82
package/browser/esm/index.mjs
CHANGED
|
@@ -1,312 +1,52 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(":root{--
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(":root{--icon-size-sm: .875rem;--icon-size-md: 1rem;--icon-size-lg: 1.25rem;--icon-size-xl: 1.5rem}._Icon_1ld90_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_1ld90_10 .sm{--font-size: var(--icon-size-sm)}._Icon_1ld90_10 .md{--font-size: var(--icon-size-md)}._Icon_1ld90_10 .lg{--font-size: var(--icon-size-lg)}._Icon_1ld90_10 .xl{--font-size: var(--icon-size-xl)}._Icon_1ld90_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_1ld90_10>img{aspect-ratio:1 / 1;display:block;line-height:1}._Icon_1ld90_10 .fill,._Icon_1ld90_10 .line{--layer-color: var(--icon-color);--layer-opacity: var(--icon-main-opacity)}._Icon_1ld90_10 .secondary{--layer-color: var(--icon-secondary-color)}._Icon_1ld90_10 .tertiary{--layer-color: var(--icon-tertiary-color)}._Icon_1ld90_10 .primary{--layer-color: var(--sxl-app-color-primary, var(--icon-primary, #595b5e))}._Icon_1ld90_10 .secondary{--layer-color: var(--sxl-app-color-secondary, #9c27b0)}._Icon_1ld90_10 .secondary.light{--layer-color: var(--sxl-app-color-secondary-light, #a060ac)}._Icon_1ld90_10 .success{--layer-color: var(--sxl-app-color-success, #22c55e)}._Icon_1ld90_10 .success.light{--layer-color: var(--sxl-app-color-success-light, #22c55e)}._Icon_1ld90_10 .info{--layer-color: var(--sxl-app-color-info, #3b82f6)}._Icon_1ld90_10 .warn{--layer-color: var(--sxl-app-color-warn, #f59e0b)}._Icon_1ld90_10 .error{--layer-color: var(--sxl-app-color-error, #ef4444)}._Icon_1ld90_10 .error.light{--layer-color: var(--sxl-app-color-error-light, #f87171)}._Icon_1ld90_10 .grey{--layer-color: var(--sxl-app-color-grey, #cccccc)}._Icon_1ld90_10 .shadow{--layer-color: var(--sxl-app-color-shadow, #cccccc)}._Icon_1ld90_10 .fill:not(.fixed):not([fill]){fill:var(--layer-color);opacity:var(--layer-opacity);stroke:none}._Icon_1ld90_10 .line:not(.fixed):not([stroke]){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_1ld90_10 .invert-dark{filter:invert(1) hue-rotate(180deg)}}._Icon_1ld90_10 .muted{opacity:calc(var(--layer-opacity, 1) * .6)}@keyframes _sxl-walk_1ld90_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_1ld90_1 var(--walk-duration, .96s) linear infinite;will-change:stroke-dashoffset}:root{--scrollbar-track-color: rgba(0,0,0,.06);--scrollbar-thumb-color: rgba(0,0,0,.35);--scrollbar-button-color: var(--scrollbar-thumb-color);--scrollbar-active-color: rgba(0,0,0,.55);--scrollbar-corner-color: transparent;--scrollbar-border-color: transparent;--scrollbar-size: 13px;--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size);--scrollbar-border-radius: 9999px;--scrollbar-border-width: 2px;--scrollbar-min-thumb-size: 24px}._scrollbar_1v478_17 ::-webkit-scrollbar-button{background:transparent}._scrollbar_1v478_17{display:flex;overflow:hidden;border-radius:var(--scrollbar-border-radius);align-items:center;border:var(--scrollbar-border-width) solid transparent}._scrollbar_1v478_17 ._vsb-track_1v478_27{background:var(--scrollbar-track-color);border-radius:var(--scrollbar-border-radius);position:relative;flex:1 1 100%;border:var(--scrollbar-border-width) solid transparent;touch-action:none;box-sizing:border-box;overflow:hidden}._scrollbar_1v478_17 ._vsb-thumb_1v478_39{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-border-radius);transition:background .12s;touch-action:none}._scrollbar_1v478_17 ._vsb-thumb_1v478_39:hover{background:var(--scrollbar-active-color)}._scrollbar_1v478_17.vertical{flex-direction:column;min-width:var(--scrollbar-width, 0px)}._scrollbar_1v478_17.vertical ._vsb-thumb_1v478_39{min-height:var(--scrollbar-min-thumb-size)}._scrollbar_1v478_17.vertical ._vsb-track_1v478_27{width:100%}._scrollbar_1v478_17.horizontal{flex-direction:row;min-height:var(--scrollbar-height, 0px)}._scrollbar_1v478_17.horizontal ._vsb-thumb_1v478_39{min-width:var(--scrollbar-min-thumb-size)}._scrollbar_1v478_17.horizontal ._vsb-track_1v478_27{height:100%}._scrollbar_1v478_17.dragging ._vsb-thumb_1v478_39{background:var(--scrollbar-active-color)}._scrollbar-button_1v478_80{display:flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0}._scrollbar-button_1v478_80>*{fill:var(--scrollbar-button-color);transition:fill .12s ease}._scrollbar-button_1v478_80:hover:not([disabled])>*{fill:var(--scrollbar-active-color)}._scrollbar-button_1v478_80[disabled]>*{fill:var(--scrollbar-button-color);opacity:.5}._scrollbar-button_1v478_80.vertical{width:var(--scrollbar-width)}._scrollbar-button_1v478_80.horizontal{height:var(--scrollbar-height)}._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(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
import { CommonUtils as q, DefaultNotifier as mn, Notifier as yt, InternalClipboard as Zt, ClipboardUtils as oe, MimeType as ie } from "@sheetxl/utils";
|
|
3
|
+
import rt, { useRef as O, useReducer as He, useMemo as I, useEffect as $, useState as V, version as _n, memo as wt, forwardRef as kt, useCallback as W, useLayoutEffect as ge, createContext as We, useContext as Fe, createElement as gn, useImperativeHandle as yn, Component as vn } from "react";
|
|
4
|
+
import { jsx as T, jsxs as Mt, Fragment as Ct } from "react/jsx-runtime";
|
|
5
|
+
import { createRoot as wn } from "react-dom/client";
|
|
6
|
+
import { unstable_batchedUpdates as bn, createPortal as xn } from "react-dom";
|
|
7
7
|
/**
|
|
8
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
8
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.13
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
18
|
-
var o = i.length;
|
|
19
|
-
for (e = 0; e < o; e++) i[e] && (t = It(i[e])) && (n && (n += " "), n += t);
|
|
20
|
-
} else for (t in i) i[t] && (n && (n += " "), n += t);
|
|
21
|
-
return n;
|
|
22
|
-
}
|
|
23
|
-
function le() {
|
|
24
|
-
for (var i, e, t = 0, n = "", o = arguments.length; t < o; t++) (i = arguments[t]) && (e = It(i)) && (n && (n += " "), n += e);
|
|
25
|
-
return n;
|
|
26
|
-
}
|
|
27
|
-
function rt(i, e) {
|
|
28
|
-
if (typeof i == "function") return i(e);
|
|
29
|
-
i && (i.current = e);
|
|
30
|
-
}
|
|
31
|
-
var $e = parseInt(hn.split(".")[0], 10) >= 19 ? function(i) {
|
|
32
|
-
return (e) => {
|
|
33
|
-
const t = [];
|
|
34
|
-
for (const n of i) {
|
|
35
|
-
const o = rt(n, e), r = typeof o == "function";
|
|
36
|
-
t.push(r ? o : () => rt(n, null));
|
|
37
|
-
}
|
|
38
|
-
return () => {
|
|
39
|
-
for (const n of t) n();
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
} : function(i) {
|
|
43
|
-
return (e) => {
|
|
44
|
-
for (const t of i) rt(t, e);
|
|
45
|
-
};
|
|
46
|
-
}, wn = function() {
|
|
47
|
-
}, Vt = typeof window < "u", bn = Vt ? _t : N, Et = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
48
|
-
const ve = Vt && window.ResizeObserver !== void 0 ? function() {
|
|
49
|
-
var i = F(null), e = i[0], t = i[1], n = F(Et), o = n[0], r = n[1], a = R(function() {
|
|
50
|
-
return new window.ResizeObserver(function(h) {
|
|
51
|
-
if (h[0]) {
|
|
52
|
-
var s = h[0].contentRect, l = s.x, c = s.y, u = s.width, d = s.height, f = s.top, _ = s.left, g = s.bottom, M = s.right;
|
|
53
|
-
r({ x: l, y: c, width: u, height: d, top: f, left: _, bottom: g, right: M });
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}, []);
|
|
57
|
-
return bn(function() {
|
|
58
|
-
if (e) return a.observe(e), function() {
|
|
59
|
-
a.disconnect();
|
|
60
|
-
};
|
|
61
|
-
}, [e]), [t, o];
|
|
62
|
-
} : function() {
|
|
63
|
-
return [wn, Et];
|
|
64
|
-
}, Lt = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
|
|
65
|
-
class xn extends yn {
|
|
66
|
-
setOverrides(e) {
|
|
67
|
-
super.setOverrides(e);
|
|
68
|
-
}
|
|
69
|
-
getDelegate() {
|
|
70
|
-
return this._overrides;
|
|
71
|
-
}
|
|
72
|
-
showMessage(e, t) {
|
|
73
|
-
const n = this.getDelegate();
|
|
74
|
-
if (n?.showMessage) return n.showMessage(e, t);
|
|
75
|
-
t?.type !== Lt.Warning ? t?.type !== Lt.Error ? ye.log(e) : ye.error(e) : ye.warn(e);
|
|
76
|
-
}
|
|
77
|
-
showBusy(e, t) {
|
|
78
|
-
const n = this.getDelegate();
|
|
79
|
-
return n?.showBusy ? n.showBusy(e, t) : new Promise((o) => {
|
|
80
|
-
o(() => {
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
showWindow(e, t, n) {
|
|
85
|
-
const o = this.getDelegate();
|
|
86
|
-
if (o?.showWindow) return o.showWindow(e, t, n);
|
|
87
|
-
}
|
|
88
|
-
showError(e) {
|
|
89
|
-
const t = this.getDelegate();
|
|
90
|
-
t?.showError ? t.showError(e) : ye.error(e);
|
|
91
|
-
}
|
|
92
|
-
showOptions(e) {
|
|
93
|
-
const t = this.getDelegate();
|
|
94
|
-
return t?.showOptions ? t.showOptions(e) : Promise.resolve("");
|
|
95
|
-
}
|
|
96
|
-
showInputOptions(e) {
|
|
97
|
-
const t = this.getDelegate();
|
|
98
|
-
return t?.showInputOptions ? t.showInputOptions(e) : Promise.resolve({ input: "", option: "" });
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
const Wt = un(new xn()), Do = ({ children: i, notifier: e }) => (re.useEffect(() => {
|
|
102
|
-
const t = ye.getOverrides();
|
|
103
|
-
return ye.setOverrides(e), () => {
|
|
104
|
-
ye.setOverrides(t);
|
|
105
|
-
};
|
|
106
|
-
}, [e]), re.createElement(Wt.Provider, { value: e }, i)), Qe = () => dn(Wt), Sn = 3, En = 0.5, Ln = 50, st = (i) => ({ x: i.x, y: i.y, width: i.width, height: i.height, top: i.top, left: i.left, right: i.right, bottom: i.bottom });
|
|
107
|
-
function Ao(i = {}) {
|
|
108
|
-
const { threshold: e = En, stillnessThreshold: t = Sn, maxHierarchyDepth: n = Ln } = i, [o, r] = ve(), a = O(null), [h, s] = Ht((_) => _ + 1, 0), l = O(void 0), c = O({ x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0 }), u = V((_) => {
|
|
109
|
-
a.current = _, typeof o == "function" && o(_);
|
|
110
|
-
}, [o]), [d, f] = F(r);
|
|
111
|
-
return N(() => {
|
|
112
|
-
r && !d && f(r);
|
|
113
|
-
}, [r, d]), N(() => {
|
|
114
|
-
const _ = a.current;
|
|
115
|
-
if (!_) return;
|
|
116
|
-
let g = !1, M = 0;
|
|
117
|
-
const P = () => {
|
|
118
|
-
if (!_) return;
|
|
119
|
-
const S = _.getBoundingClientRect(), T = c.current;
|
|
120
|
-
Math.abs(S.x - T.x) > e || Math.abs(S.y - T.y) > e || Math.abs(S.width - T.width) > e || Math.abs(S.height - T.height) > e ? (g || (g = !0, f(st(S)), s()), M = 0) : M++, g && M >= t && (g = !1, f(st(S)), s()), c.current = st(S), l.current = requestAnimationFrame(P);
|
|
121
|
-
};
|
|
122
|
-
l.current = requestAnimationFrame(P);
|
|
123
|
-
const y = (S) => {
|
|
124
|
-
g = !0, s();
|
|
125
|
-
}, w = (S) => {
|
|
126
|
-
g = !1, M = t, s();
|
|
127
|
-
};
|
|
128
|
-
let m = _;
|
|
129
|
-
const A = [];
|
|
130
|
-
for (; m && m !== document.documentElement && (m.addEventListener("animationstart", y, !0), m.addEventListener("animationend", w, !0), m.addEventListener("transitionstart", y, !0), m.addEventListener("transitionend", w, !0), A.push(m), m = m.parentElement, !(A.length > n)); ) ;
|
|
131
|
-
return () => {
|
|
132
|
-
l.current && cancelAnimationFrame(l.current), A.forEach((S) => {
|
|
133
|
-
S.removeEventListener("animationstart", y, !0), S.removeEventListener("animationend", w, !0), S.removeEventListener("transitionstart", y, !0), S.removeEventListener("transitionend", w, !0);
|
|
134
|
-
});
|
|
135
|
-
};
|
|
136
|
-
}, [h, r, e, t, n]), [u, d];
|
|
137
|
-
}
|
|
138
|
-
const k = (i, e) => {
|
|
139
|
-
const t = V((...r) => i?.(...r), e), n = O(null);
|
|
140
|
-
n.current = t;
|
|
141
|
-
const o = V((...r) => n.current?.(...r), []);
|
|
142
|
-
if (n.current) return o;
|
|
143
|
-
};
|
|
144
|
-
function zo(i) {
|
|
145
|
-
const [e, t] = F(typeof window < "u" ? window.devicePixelRatio : 1), n = O(null);
|
|
146
|
-
return N(() => {
|
|
147
|
-
if (!(typeof window < "u" && "matchMedia" in window)) return;
|
|
148
|
-
const o = () => {
|
|
149
|
-
const r = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
|
|
150
|
-
r.addEventListener("change", o, { once: !0, passive: !0 }), t(window.devicePixelRatio), n.current = { mediaMatcher: r, listener: o };
|
|
151
|
-
};
|
|
152
|
-
return o(), () => {
|
|
153
|
-
n.current && n.current.mediaMatcher.removeEventListener("change", n.current.listener);
|
|
154
|
-
};
|
|
155
|
-
}, [i]), e;
|
|
156
|
-
}
|
|
157
|
-
function Bo(i) {
|
|
158
|
-
if (typeof window > "u") return 1;
|
|
159
|
-
const { defaultDpr: e = 1, maxDpr: t = 3, round: n = !0 } = i || {}, o = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : e;
|
|
160
|
-
return Math.min(Math.max(1, n ? Math.floor(o) : o), t);
|
|
161
|
-
}
|
|
162
|
-
function Oo(i, e, t) {
|
|
163
|
-
const n = k(e, [e]);
|
|
164
|
-
N(() => {
|
|
165
|
-
const o = (r) => {
|
|
166
|
-
i.current && !i.current.contains(r.target) && n(r);
|
|
167
|
-
};
|
|
168
|
-
return t && t.mouseEvents === !1 || (document.addEventListener("mousedown", o), document.addEventListener("touchstart", o)), t && t.focusEvents === !1 || document.addEventListener("focus", o), () => {
|
|
169
|
-
document.removeEventListener("mousedown", o), document.removeEventListener("touchstart", o), document.removeEventListener("focus", o);
|
|
170
|
-
};
|
|
171
|
-
}, [i]);
|
|
172
|
-
}
|
|
173
|
-
function Mn(i) {
|
|
174
|
-
if (!i) throw new Error("must have a PointerHandlerOptions");
|
|
175
|
-
const { onPointerDown: e, onPointerUp: t, onPointerMoveOrWait: n, processTouch: o = !1, consumeTouch: r = !0 } = i, a = k(e, [e]), h = k(t, [t]), s = k(n, [n]), l = O(!1), c = i?.timerInitial ?? 230, u = i?.timerContinuous ?? c / 2, d = O(null), f = O(null), _ = O(null), g = O(null), M = V(() => {
|
|
176
|
-
g.current && (clearTimeout(g.current), g.current = null);
|
|
177
|
-
}, []), P = V((E) => {
|
|
178
|
-
g.current = setTimeout(() => {
|
|
179
|
-
window.requestAnimationFrame(() => {
|
|
180
|
-
l.current !== !1 && s?.(f.current, _.current, d.current);
|
|
181
|
-
}), P(u);
|
|
182
|
-
}, E ?? c);
|
|
183
|
-
}, []);
|
|
184
|
-
N(() => () => M(), []);
|
|
185
|
-
const y = o ? "pointer" : "mouse", w = V((E) => {
|
|
186
|
-
E.stopPropagation(), E.stopImmediatePropagation(), E.preventDefault();
|
|
187
|
-
}, []), m = k((E) => {
|
|
188
|
-
document.removeEventListener(`${y}move`, T), document.removeEventListener(`${y}up`, m), document.removeEventListener("keydown", I), document.removeEventListener("keyup", x), document.removeEventListener("touchstart", w, { capture: !0 }), document.removeEventListener("touchmove", w, { capture: !0 }), window.removeEventListener("blur", A), M(), window.requestAnimationFrame(() => {
|
|
189
|
-
l.current !== !1 && (l.current = !1, h?.(E, _.current, d.current), _.current = null);
|
|
190
|
-
});
|
|
191
|
-
}, []), A = V(() => {
|
|
192
|
-
l.current !== !1 && (l.current = !1, m(f.current));
|
|
193
|
-
}, []), S = k(() => {
|
|
194
|
-
M(), P(u), window.requestAnimationFrame(() => {
|
|
195
|
-
l.current !== !1 && s?.(f.current, _.current, d.current);
|
|
196
|
-
});
|
|
197
|
-
}, [u]), T = k((E) => {
|
|
198
|
-
f.current = E, S();
|
|
199
|
-
}, []), I = k((E) => {
|
|
200
|
-
_.current = { ctrlKey: E.ctrlKey, shiftKey: E.shiftKey, altKey: E.altKey, metaKey: E.metaKey }, S();
|
|
201
|
-
}, []), x = k((E) => {
|
|
202
|
-
_.current = { ctrlKey: E.ctrlKey, shiftKey: E.shiftKey, altKey: E.altKey, metaKey: E.metaKey }, S();
|
|
203
|
-
}, [u]);
|
|
204
|
-
return k((E) => {
|
|
205
|
-
E.isDefaultPrevented() || (_.current = { ctrlKey: E.ctrlKey, shiftKey: E.shiftKey, altKey: E.altKey, metaKey: E.metaKey }, a(E, _.current) !== !1 && (d.current = E, f.current = E.nativeEvent, document.addEventListener(`${y}up`, m, { passive: !1 }), document.addEventListener(`${y}move`, T, { passive: !1 }), document.addEventListener("keydown", I, { passive: !1 }), document.addEventListener("keyup", x, { 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, P(c)));
|
|
206
|
-
}, [c, o]);
|
|
207
|
-
}
|
|
208
|
-
function $o(i, e) {
|
|
209
|
-
return Mn({ onPointerDown: i, onPointerMoveOrWait: (t, n, o) => {
|
|
210
|
-
i?.(o);
|
|
211
|
-
}, ...e });
|
|
212
|
-
}
|
|
213
|
-
const Cn = ({ initValue: i, useHookBody: e, applyStateChange: t }) => {
|
|
214
|
-
const n = O(i);
|
|
215
|
-
if (typeof e != "function") throw new Error("function expected as hook body parameter. got " + typeof e);
|
|
216
|
-
const o = e();
|
|
217
|
-
return _t(() => {
|
|
218
|
-
n.current !== o && (n.current = o, t(o));
|
|
219
|
-
}, [t, o]), null;
|
|
220
|
-
}, ht = (i) => {
|
|
221
|
-
console && console.warn && console.warn(i);
|
|
222
|
-
}, lt = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
|
|
223
|
-
let Tn = 1, ut = !1, Ft = !1;
|
|
224
|
-
const Ye = [], Le = [], qe = () => {
|
|
225
|
-
Le.forEach((i) => i());
|
|
226
|
-
}, kn = ({ automaticContainerInternalUseOnly: i }) => {
|
|
227
|
-
const [e, t] = F([]), n = O([]);
|
|
228
|
-
return n.current = e, i || ut !== !1 || (Ft = !0), N(() => {
|
|
229
|
-
let o = !0;
|
|
230
|
-
function r() {
|
|
231
|
-
if (o) return Le[0] !== r ? (i || ut !== !0 || ht("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([...Ye]);
|
|
232
|
-
}
|
|
233
|
-
return Le.push(r), qe(), () => {
|
|
234
|
-
o = !1, n.current?.length > 0 && ht("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Le.splice(Le.indexOf(r), 1), qe();
|
|
235
|
-
};
|
|
236
|
-
}, [i]), C(Me, { children: e.map(({ hook: o, key: r }) => pn(Cn, { ...o, key: r })) });
|
|
237
|
-
}, Pn = (i) => {
|
|
238
|
-
const e = Tn++;
|
|
239
|
-
return Ye.push({ hook: i, key: e }), Le.length === 0 && Ft === !1 && (ut = !0, ((t) => {
|
|
240
|
-
if (lt.document && lt.document.createElement) {
|
|
241
|
-
const n = lt.document.createElement("div");
|
|
242
|
-
vn(n).render(C(t, { automaticContainerInternalUseOnly: !0 }));
|
|
243
|
-
} else ht("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
|
|
244
|
-
})(kn)), qe(), () => {
|
|
245
|
-
Ye.splice(Ye.findIndex((t) => t.key === e), 1), qe();
|
|
246
|
-
};
|
|
247
|
-
};
|
|
248
|
-
let dt = null;
|
|
249
|
-
dt || (dt = (i, e, t = {}) => {
|
|
250
|
-
let n, o, r = !1, a = !1, h = [], { unmountIfNoConsumers: s = !1 } = t;
|
|
251
|
-
const l = (u) => {
|
|
252
|
-
o = u, _n(() => h.forEach((d) => d(u)));
|
|
253
|
-
}, c = () => (a || (o = typeof i == "function" ? i() : i, a = !0), o);
|
|
254
|
-
return () => {
|
|
255
|
-
const [u, d] = F(c);
|
|
256
|
-
return N(() => (r || (r = !0, n = Pn({ initValue: i, useHookBody: e, applyStateChange: l })), h.push(d), o !== u && d(o), () => {
|
|
257
|
-
h.splice(h.indexOf(d), 1), h.length === 0 && s && (n(), r = !1);
|
|
258
|
-
}), []), u;
|
|
259
|
-
};
|
|
260
|
-
});
|
|
261
|
-
const jt = dt;
|
|
262
|
-
let Ut = () => {
|
|
263
|
-
console.warn("You must call useEditMode before setting its state.");
|
|
264
|
-
};
|
|
265
|
-
const Dn = jt(null, () => {
|
|
266
|
-
const [i, e] = F(null);
|
|
267
|
-
return Ut = e, i;
|
|
268
|
-
}), Ko = () => {
|
|
269
|
-
const i = Dn();
|
|
270
|
-
return R(() => ({ setMode: (e) => {
|
|
271
|
-
Ut((t) => (typeof e == "function" && (e = e(t)), e?.onModeChange?.(e ?? null), e));
|
|
272
|
-
}, getMode: () => i }), [i]);
|
|
273
|
-
};
|
|
274
|
-
class pt {
|
|
275
|
-
constructor(e, t, n, o) {
|
|
276
|
-
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 = () => {
|
|
13
|
+
const Bo = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, Y = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, Oo = { 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 }, Io = { Left: 1, Middle: 2, Right: 3 };
|
|
14
|
+
class ue {
|
|
15
|
+
constructor(t, e, n, i) {
|
|
16
|
+
this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = t, this._target = e, this._applyProps(n || {}), this._callback = i, i === void 0 && (this._callback = () => {
|
|
277
17
|
console.log(`implement: ${this.label()} : ${this.description()}`);
|
|
278
18
|
});
|
|
279
19
|
}
|
|
280
20
|
key() {
|
|
281
21
|
return this._key;
|
|
282
22
|
}
|
|
283
|
-
_resolve(
|
|
284
|
-
if (typeof
|
|
285
|
-
const n =
|
|
286
|
-
return
|
|
23
|
+
_resolve(t, e) {
|
|
24
|
+
if (typeof t == "function") {
|
|
25
|
+
const n = e ?? this._context;
|
|
26
|
+
return t(typeof n == "function" ? n() : n);
|
|
287
27
|
}
|
|
288
|
-
return
|
|
28
|
+
return t;
|
|
289
29
|
}
|
|
290
30
|
target() {
|
|
291
31
|
return typeof this._target == "function" ? this._target() : this._target;
|
|
292
32
|
}
|
|
293
|
-
label(
|
|
294
|
-
const n = this._scopedLabels?.[
|
|
295
|
-
let
|
|
33
|
+
label(t, e) {
|
|
34
|
+
const n = this._scopedLabels?.[t] || this._label;
|
|
35
|
+
let i = null;
|
|
296
36
|
if (typeof n == "function") {
|
|
297
|
-
const r =
|
|
298
|
-
|
|
299
|
-
} else
|
|
300
|
-
return
|
|
37
|
+
const r = e ?? this._context;
|
|
38
|
+
i = n(typeof r == "function" ? r() : r);
|
|
39
|
+
} else i = n;
|
|
40
|
+
return i;
|
|
301
41
|
}
|
|
302
|
-
description(
|
|
303
|
-
return this._resolve(this._description,
|
|
42
|
+
description(t) {
|
|
43
|
+
return this._resolve(this._description, t);
|
|
304
44
|
}
|
|
305
|
-
tags(
|
|
306
|
-
return this._resolve(this._tags,
|
|
45
|
+
tags(t) {
|
|
46
|
+
return this._resolve(this._tags, t);
|
|
307
47
|
}
|
|
308
|
-
icon(
|
|
309
|
-
return this._resolve(this._icon,
|
|
48
|
+
icon(t) {
|
|
49
|
+
return this._resolve(this._icon, t);
|
|
310
50
|
}
|
|
311
51
|
shortcut() {
|
|
312
52
|
return this._resolve(this._shortcut);
|
|
@@ -320,199 +60,199 @@ class pt {
|
|
|
320
60
|
context() {
|
|
321
61
|
return typeof this._context == "function" ? this._context() : this._context;
|
|
322
62
|
}
|
|
323
|
-
async execute(
|
|
63
|
+
async execute(t, e) {
|
|
324
64
|
if (!this.disabled() && this._callback) {
|
|
325
65
|
try {
|
|
326
66
|
let n = !0;
|
|
327
|
-
if (
|
|
328
|
-
const
|
|
329
|
-
if (await Promise.resolve(
|
|
330
|
-
|
|
67
|
+
if (e?.beforeExecute && (n = e?.beforeExecute(this, t)), await Promise.resolve(n) === !1) return !1;
|
|
68
|
+
const i = this._callback.bind(this)(t, this);
|
|
69
|
+
if (await Promise.resolve(i) === !1) return !1;
|
|
70
|
+
e?.onExecute?.(this, t), this._notifyExecute(t);
|
|
331
71
|
} catch (n) {
|
|
332
|
-
return console.warn(n),
|
|
72
|
+
return console.warn(n), e?.onError(this, n, t), this._notifyError(t, n), !1;
|
|
333
73
|
}
|
|
334
74
|
return !0;
|
|
335
75
|
}
|
|
336
76
|
}
|
|
337
|
-
addPropertyListener(
|
|
338
|
-
if (!
|
|
77
|
+
addPropertyListener(t, e = !1) {
|
|
78
|
+
if (!t) throw new Error("listener must be specified");
|
|
339
79
|
const n = this._listenersProperties;
|
|
340
|
-
return n.add(
|
|
341
|
-
n.delete(
|
|
80
|
+
return n.add(t), e && t({}, this), () => {
|
|
81
|
+
n.delete(t);
|
|
342
82
|
};
|
|
343
83
|
}
|
|
344
|
-
addExecuteListener(
|
|
345
|
-
if (!
|
|
346
|
-
const
|
|
347
|
-
return
|
|
348
|
-
|
|
84
|
+
addExecuteListener(t) {
|
|
85
|
+
if (!t) throw new Error("listener must be specified");
|
|
86
|
+
const e = this._listenersExecute;
|
|
87
|
+
return e.add(t), function() {
|
|
88
|
+
e.delete(t);
|
|
349
89
|
};
|
|
350
90
|
}
|
|
351
|
-
_notifyExecute(
|
|
352
|
-
const
|
|
91
|
+
_notifyExecute(t) {
|
|
92
|
+
const e = this;
|
|
353
93
|
this._listenersExecute.forEach((n) => {
|
|
354
|
-
n.onExecute(
|
|
94
|
+
n.onExecute(e, t);
|
|
355
95
|
});
|
|
356
96
|
}
|
|
357
|
-
_notifyError(
|
|
97
|
+
_notifyError(t, e) {
|
|
358
98
|
const n = this;
|
|
359
|
-
this._listenersExecute.forEach((
|
|
360
|
-
|
|
99
|
+
this._listenersExecute.forEach((i) => {
|
|
100
|
+
i.onError?.(n, t, e);
|
|
361
101
|
});
|
|
362
102
|
}
|
|
363
|
-
updateCallback(
|
|
364
|
-
return this._callback =
|
|
103
|
+
updateCallback(t) {
|
|
104
|
+
return this._callback = t || null, this;
|
|
365
105
|
}
|
|
366
|
-
update(
|
|
367
|
-
if (!
|
|
368
|
-
const
|
|
369
|
-
return Object.keys(
|
|
106
|
+
update(t) {
|
|
107
|
+
if (!t) return;
|
|
108
|
+
const e = this._applyProps(t);
|
|
109
|
+
return Object.keys(e).length > 0 && this._notifyPropertyChange(e), this;
|
|
370
110
|
}
|
|
371
|
-
_notifyPropertyChange(
|
|
372
|
-
const
|
|
111
|
+
_notifyPropertyChange(t) {
|
|
112
|
+
const e = this;
|
|
373
113
|
this._listenersProperties.forEach((n) => {
|
|
374
|
-
n(
|
|
114
|
+
n(t, e);
|
|
375
115
|
});
|
|
376
116
|
}
|
|
377
|
-
_applyProps(
|
|
378
|
-
let
|
|
379
|
-
return Object.keys(
|
|
380
|
-
let r =
|
|
381
|
-
n["_" +
|
|
382
|
-
}),
|
|
117
|
+
_applyProps(t) {
|
|
118
|
+
let e = {}, n = this;
|
|
119
|
+
return Object.keys(t).forEach((i) => {
|
|
120
|
+
let r = t[i];
|
|
121
|
+
n["_" + i] !== r && (n["_" + i] = e[i] = r);
|
|
122
|
+
}), e;
|
|
383
123
|
}
|
|
384
124
|
}
|
|
385
|
-
class
|
|
125
|
+
class re extends ue {
|
|
386
126
|
}
|
|
387
|
-
var
|
|
127
|
+
var et = typeof window < "u" ? window : { screen: {}, navigator: {} }, Tt = (et.matchMedia || function() {
|
|
388
128
|
return { matches: !1 };
|
|
389
|
-
}).bind(
|
|
390
|
-
return
|
|
391
|
-
} },
|
|
129
|
+
}).bind(et), Ve = !1, Sn = { get passive() {
|
|
130
|
+
return Ve = !0;
|
|
131
|
+
} }, Le = function() {
|
|
392
132
|
};
|
|
393
|
-
|
|
394
|
-
var
|
|
395
|
-
const
|
|
396
|
-
function
|
|
397
|
-
return
|
|
133
|
+
et.addEventListener && et.addEventListener("p", Le, Sn), et.removeEventListener && et.removeEventListener("p", Le, !1);
|
|
134
|
+
var En = Ve, Ln = "PointerEvent" in et, ye = "ontouchstart" in et, je = ye || "TouchEvent" in et && Tt("(any-pointer: coarse)").matches, Me = (et.navigator.maxTouchPoints || 0) > 0 || je, Ue = et.navigator.userAgent || "", Mn = Tt("(pointer: coarse)").matches && /iPad|Macintosh/.test(Ue) && Math.min(et.screen.width || 0, et.screen.height || 0) >= 768, Xe = (Tt("(pointer: coarse)").matches || !Tt("(pointer: fine)").matches && ye) && !/Windows.*Firefox/.test(Ue), Cn = Tt("(any-pointer: fine)").matches || Tt("(any-hover: hover)").matches || Mn || !ye, he = !Me || !Cn && Xe ? Me ? "touchOnly" : "mouseOnly" : "hybrid", Tn = he === "mouseOnly" ? "mouse" : he === "touchOnly" || Xe ? "touch" : "mouse";
|
|
135
|
+
const kn = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: he, primaryInput: Tn, supportsPassiveEvents: En, supportsPointerEvents: Ln, supportsTouchEvents: je }, Symbol.toStringTag, { value: "Module" })), Pn = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), Ye = {};
|
|
136
|
+
function de() {
|
|
137
|
+
return kn;
|
|
398
138
|
}
|
|
399
|
-
const
|
|
400
|
-
return
|
|
401
|
-
}, createSyntheticEvent: (
|
|
402
|
-
let
|
|
403
|
-
return { nativeEvent:
|
|
404
|
-
|
|
405
|
-
}, isDefaultPrevented: () =>
|
|
406
|
-
|
|
407
|
-
}, isPropagationStopped: () =>
|
|
408
|
-
}, timeStamp:
|
|
409
|
-
}, detectIt:
|
|
410
|
-
class
|
|
411
|
-
constructor(
|
|
412
|
-
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = q.uuidV4(), this._target =
|
|
139
|
+
const Ge = (o) => o === "BracketLeft" ? "[" : o === "BracketRight" ? "]" : q.camelToPrettyCase(o), $o = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: Ye, boundPixel: function(o, t = !1, e = 0) {
|
|
140
|
+
return o;
|
|
141
|
+
}, createSyntheticEvent: (o) => {
|
|
142
|
+
let t = !1, e = !1;
|
|
143
|
+
return { nativeEvent: o, currentTarget: o.currentTarget, target: o.target, bubbles: o.bubbles, cancelable: o.cancelable, defaultPrevented: o.defaultPrevented, eventPhase: o.eventPhase, isTrusted: o.isTrusted, preventDefault: () => {
|
|
144
|
+
t = !0, o.preventDefault();
|
|
145
|
+
}, isDefaultPrevented: () => t, stopPropagation: () => {
|
|
146
|
+
e = !0, o.stopPropagation();
|
|
147
|
+
}, isPropagationStopped: () => e, persist: () => {
|
|
148
|
+
}, timeStamp: o.timeStamp, type: o.type };
|
|
149
|
+
}, detectIt: de, focusableNodeNames: Pn, toPrettyKeyCode: Ge }, Symbol.toStringTag, { value: "Module" }));
|
|
150
|
+
class Ze {
|
|
151
|
+
constructor(t, e) {
|
|
152
|
+
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = q.uuidV4(), this._target = t, this._groupKey = e ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(e, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
|
|
413
153
|
const n = this;
|
|
414
|
-
this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (
|
|
415
|
-
const
|
|
416
|
-
|
|
154
|
+
this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (i, r) => {
|
|
155
|
+
const c = n._root._listenersByKey, u = r.key(), l = c.get(u);
|
|
156
|
+
l && n._notifyCommands(l, "onCommandChange", r);
|
|
417
157
|
};
|
|
418
158
|
}
|
|
419
|
-
_getCommand(
|
|
420
|
-
return this._commandsByKey.get(
|
|
159
|
+
_getCommand(t) {
|
|
160
|
+
return this._commandsByKey.get(t) || (this._parent?._getCommand(t) ?? null);
|
|
421
161
|
}
|
|
422
|
-
getCommand(
|
|
162
|
+
getCommand(t, e = !1) {
|
|
423
163
|
const n = this._root._focused;
|
|
424
|
-
let
|
|
425
|
-
for (; !r &&
|
|
426
|
-
return (r ? n : this)._getCommand(
|
|
164
|
+
let i = n, r = n === this;
|
|
165
|
+
for (; !r && i; ) i === this && (r = !0), i = i._parent;
|
|
166
|
+
return (r ? n : this)._getCommand(t);
|
|
427
167
|
}
|
|
428
|
-
createChildGroup(
|
|
429
|
-
let
|
|
168
|
+
createChildGroup(t, e, n) {
|
|
169
|
+
let i;
|
|
430
170
|
if (!n) {
|
|
431
|
-
let
|
|
432
|
-
for (;
|
|
433
|
-
let
|
|
434
|
-
|
|
171
|
+
let u = this;
|
|
172
|
+
for (; u && !i; ) {
|
|
173
|
+
let l = u._nodes.get(e);
|
|
174
|
+
l && (i = l), u = u._parent;
|
|
435
175
|
}
|
|
436
176
|
}
|
|
437
|
-
|
|
438
|
-
const r = (
|
|
439
|
-
!
|
|
177
|
+
i || (i = new Ze(t, e), i._parent = this, i._root = this._root, i._unListenersByCommand = null, i._listenersByKey = null, i._commandsPropertyListener = null);
|
|
178
|
+
const r = (u, l) => {
|
|
179
|
+
!u.has(e) || n ? u.set(e, l) : n === void 0 && console.warn("commandGroup already registered", e);
|
|
440
180
|
};
|
|
441
|
-
r(this._root._nodes,
|
|
442
|
-
let
|
|
443
|
-
for (;
|
|
444
|
-
return this._children.set(
|
|
181
|
+
r(this._root._nodes, i);
|
|
182
|
+
let c = this._parent;
|
|
183
|
+
for (; c; ) r(this._nodes, i), c = c._parent;
|
|
184
|
+
return this._children.set(e, i), this._notify("onGroupChange"), i;
|
|
445
185
|
}
|
|
446
186
|
getKey() {
|
|
447
187
|
return this._groupKey;
|
|
448
188
|
}
|
|
449
|
-
getGroup(
|
|
450
|
-
return this._nodes.get(
|
|
189
|
+
getGroup(t) {
|
|
190
|
+
return this._nodes.get(t);
|
|
451
191
|
}
|
|
452
|
-
_addCommands(
|
|
453
|
-
const n = this._commandsByKey,
|
|
454
|
-
for (let
|
|
455
|
-
const
|
|
456
|
-
if (n.has(
|
|
457
|
-
|
|
192
|
+
_addCommands(t, e = void 0) {
|
|
193
|
+
const n = this._commandsByKey, i = this._commandsByShortcut, r = this._root._commandsPropertyListener, c = this._root._unListenersByCommand;
|
|
194
|
+
for (let u = 0; u < t.length; u++) {
|
|
195
|
+
const l = t[u], s = l.key();
|
|
196
|
+
if (n.has(s) && !e) {
|
|
197
|
+
e === void 0 && console.warn("command already registered", s);
|
|
458
198
|
continue;
|
|
459
199
|
}
|
|
460
|
-
n.set(
|
|
461
|
-
let
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
const d =
|
|
200
|
+
n.set(s, l);
|
|
201
|
+
let a = c.get(l);
|
|
202
|
+
a && (a(), c.delete(l));
|
|
203
|
+
const h = l.addPropertyListener(r);
|
|
204
|
+
c.set(l, h);
|
|
205
|
+
const d = l.shortcut();
|
|
466
206
|
if (!d) continue;
|
|
467
207
|
const f = Array.isArray(d) ? d : [d];
|
|
468
208
|
for (let _ = 0; _ < f.length; _++) {
|
|
469
|
-
const
|
|
470
|
-
|
|
209
|
+
const p = Bt(f[_]), b = i.get(p);
|
|
210
|
+
b && !e && e === void 0 && console.warn(`Shortcut already registered: ${p}, ${s}, ${b}.`), i.set(p, s);
|
|
471
211
|
}
|
|
472
212
|
}
|
|
473
213
|
}
|
|
474
214
|
removeFromParent() {
|
|
475
215
|
if (!this._parent) return;
|
|
476
|
-
let
|
|
216
|
+
let t = this._parent, e = [];
|
|
477
217
|
const n = this._groupKey;
|
|
478
|
-
for (;
|
|
479
|
-
|
|
480
|
-
const
|
|
481
|
-
r._children.forEach((
|
|
482
|
-
for (let
|
|
483
|
-
|
|
218
|
+
for (; t; ) e.push(t._nodes), t._nodes.delete(n), t = t._parent;
|
|
219
|
+
t = this._parent;
|
|
220
|
+
const i = (r) => {
|
|
221
|
+
r._children.forEach((c) => {
|
|
222
|
+
for (let u = 0; u < e.length; u++) c._nodes.delete(e[u]);
|
|
223
|
+
i(c);
|
|
484
224
|
});
|
|
485
225
|
};
|
|
486
|
-
|
|
226
|
+
i(this), this._parent = null, this._notify("onGroupChange");
|
|
487
227
|
}
|
|
488
|
-
addCommands(
|
|
489
|
-
this._addCommands(
|
|
228
|
+
addCommands(t, e) {
|
|
229
|
+
this._addCommands(t, e), this._notify("onGroupChange");
|
|
490
230
|
}
|
|
491
231
|
getActive() {
|
|
492
232
|
return this._root._focused ?? this._root;
|
|
493
233
|
}
|
|
494
|
-
activate(
|
|
495
|
-
let
|
|
496
|
-
if (
|
|
234
|
+
activate(t) {
|
|
235
|
+
let e = this;
|
|
236
|
+
if (t && (e = this._nodes.get(t), !e)) return void console.warn("group not found", t);
|
|
497
237
|
let n = this._root._focused ?? this._root;
|
|
498
238
|
for (; n; ) n = n._parent;
|
|
499
|
-
this._root._focused !==
|
|
239
|
+
this._root._focused !== e && (this._root._focused = e, this._notify("onGroupChange"), this._notify("onActiveChange"));
|
|
500
240
|
}
|
|
501
|
-
findCommandByEvent(
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
let n =
|
|
505
|
-
const
|
|
506
|
-
let r =
|
|
507
|
-
r || (n =
|
|
508
|
-
let
|
|
509
|
-
return r && (
|
|
510
|
-
}
|
|
511
|
-
dispatchToFocusedCommand(
|
|
512
|
-
const
|
|
513
|
-
if (!
|
|
514
|
-
const n =
|
|
515
|
-
return !!n && (n.execute(),
|
|
241
|
+
findCommandByEvent(t) {
|
|
242
|
+
const e = [];
|
|
243
|
+
t.altKey && e.push(Y.Alt), t.shiftKey && e.push(Y.Shift), t.ctrlKey && e.push(Y.Ctrl), t.metaKey && e.push(Y.Meta);
|
|
244
|
+
let n = Bt({ key: t.code, modifiers: e });
|
|
245
|
+
const i = this._commandsByShortcut;
|
|
246
|
+
let r = i.get(n);
|
|
247
|
+
r || (n = Bt({ key: t.key, modifiers: e }), r = i.get(n)), !r && t.code.startsWith("Digit") && (n = Bt({ key: t.code.substring(5, t.code.length), modifiers: e }), r = this._commandsByShortcut.get(n)), !r && t.code.startsWith("Key") && (r = Bt({ key: t.code.substring(3, t.code.length), modifiers: e }), r = i.get(n));
|
|
248
|
+
let c = null;
|
|
249
|
+
return r && (c = this._commandsByKey.get(r), c && c.disabled() && (c = null), !c || c.target() && c.target().contains(t.target) || (c = null)), c || (this._parent?.findCommandByEvent(t) ?? null);
|
|
250
|
+
}
|
|
251
|
+
dispatchToFocusedCommand(t) {
|
|
252
|
+
const e = this.getActive();
|
|
253
|
+
if (!e || t.isDefaultPrevented()) return !1;
|
|
254
|
+
const n = e.findCommandByEvent?.(t);
|
|
255
|
+
return !!n && (n.execute(), t.preventDefault(), !0);
|
|
516
256
|
}
|
|
517
257
|
getRoot() {
|
|
518
258
|
return this._parent ? this._parent.getRoot() : this;
|
|
@@ -520,720 +260,609 @@ class Jt {
|
|
|
520
260
|
getParent() {
|
|
521
261
|
return this._parent;
|
|
522
262
|
}
|
|
523
|
-
addListener(
|
|
524
|
-
const n = this._listeners,
|
|
525
|
-
if (
|
|
526
|
-
let
|
|
527
|
-
if (
|
|
528
|
-
const
|
|
529
|
-
if (!
|
|
530
|
-
let
|
|
531
|
-
|
|
263
|
+
addListener(t, e) {
|
|
264
|
+
const n = this._listeners, i = e?.keys, r = this._root._listenersByKey;
|
|
265
|
+
if (i && !t.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
|
|
266
|
+
let c = null;
|
|
267
|
+
if (i) for (let u = 0; u < i.length; u++) {
|
|
268
|
+
const l = i[u];
|
|
269
|
+
if (!l) continue;
|
|
270
|
+
let s = r.get(l);
|
|
271
|
+
s || (s = /* @__PURE__ */ new Set(), r.set(l, s)), c || (c = []), c.push(s), s.add(t);
|
|
532
272
|
}
|
|
533
|
-
return n.add(
|
|
534
|
-
if (
|
|
535
|
-
|
|
536
|
-
n.delete(
|
|
273
|
+
return n.add(t), () => {
|
|
274
|
+
if (c) for (let u = 0; u < c.length; u++)
|
|
275
|
+
c[u].delete(t);
|
|
276
|
+
n.delete(t);
|
|
537
277
|
};
|
|
538
278
|
}
|
|
539
|
-
_notifyCommands(
|
|
540
|
-
const
|
|
279
|
+
_notifyCommands(t, e, n) {
|
|
280
|
+
const i = this;
|
|
541
281
|
setTimeout(() => {
|
|
542
|
-
|
|
543
|
-
r[
|
|
282
|
+
t.forEach((r) => {
|
|
283
|
+
r[e]?.(i, n);
|
|
544
284
|
});
|
|
545
285
|
}, 0);
|
|
546
286
|
}
|
|
547
|
-
_notify(
|
|
287
|
+
_notify(t, e) {
|
|
548
288
|
const n = this;
|
|
549
289
|
setTimeout(() => {
|
|
550
|
-
n._listeners.forEach((
|
|
551
|
-
|
|
552
|
-
}), n._parent && n._parent._notify(
|
|
290
|
+
n._listeners.forEach((i) => {
|
|
291
|
+
i[t]?.(n, e);
|
|
292
|
+
}), n._parent && n._parent._notify(t, e);
|
|
553
293
|
}, 0);
|
|
554
294
|
}
|
|
555
295
|
getAllCommands() {
|
|
556
|
-
const
|
|
296
|
+
const t = [], e = this._groupKey;
|
|
557
297
|
return this._commandsByKey.forEach((n) => {
|
|
558
|
-
|
|
298
|
+
t.push({ command: n, groupKey: e });
|
|
559
299
|
}), this._children.forEach((n) => {
|
|
560
|
-
|
|
561
|
-
}),
|
|
300
|
+
t.push(...n.getAllCommands());
|
|
301
|
+
}), t;
|
|
562
302
|
}
|
|
563
303
|
}
|
|
564
|
-
const
|
|
565
|
-
const
|
|
566
|
-
for (let
|
|
304
|
+
const Dn = q.getOS() === q.OSType.MacOS || q.getOS() === q.OSType.IOS ? "Cmd" : "Ctrl", An = q.getOS() === q.OSType.MacOS || q.getOS() === q.OSType.IOS ? "⌘" : "^", Bt = (o, t = !1) => {
|
|
305
|
+
const e = {};
|
|
306
|
+
for (let i = 0; o.modifiers && i < o.modifiers.length; i++) e[o.modifiers[i]] = !0;
|
|
567
307
|
let n = "";
|
|
568
|
-
return (
|
|
308
|
+
return (e?.[Y.Ctrl] || e?.[Y.Meta]) && (n += (n.length > 0 ? "+" : "") + (t ? An : Dn)), e?.[Y.Alt] && (n += t ? "⌥" : "Alt"), e?.[Y.Shift] && (n += (n.length > 0 ? "+" : "") + (t ? "⇧" : "Shift")), n += (n.length > 0 ? "+" : "") + Ge(o.key), n;
|
|
569
309
|
};
|
|
570
|
-
function
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
const [n,
|
|
574
|
-
return
|
|
310
|
+
function Ko(o, t = null) {
|
|
311
|
+
const e = O(t);
|
|
312
|
+
e.current = t;
|
|
313
|
+
const [n, i] = He((c) => c + 1, 0), r = I(() => Array.isArray(o) ? o : [o], [o]);
|
|
314
|
+
return $(() => {
|
|
575
315
|
if (!r || r.length === 0) return;
|
|
576
|
-
const
|
|
577
|
-
|
|
316
|
+
const c = (s, a) => {
|
|
317
|
+
e.current?.onChange?.(a), i();
|
|
578
318
|
};
|
|
579
|
-
let
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
}, onError(
|
|
583
|
-
|
|
319
|
+
let u = null;
|
|
320
|
+
t && (u = { onExecute(s, a) {
|
|
321
|
+
e.current?.onExecute?.(s, a);
|
|
322
|
+
}, onError(s, a, h) {
|
|
323
|
+
e.current?.onError?.(s, a, h);
|
|
584
324
|
} });
|
|
585
|
-
const
|
|
586
|
-
for (let
|
|
325
|
+
const l = /* @__PURE__ */ new Set();
|
|
326
|
+
for (let s = 0; s < r.length; s++) l.add(r[s]?.addPropertyListener(q.debounce(c, 0), !0)), t && l.add(r[s]?.addExecuteListener(u));
|
|
587
327
|
return () => {
|
|
588
|
-
|
|
589
|
-
|
|
328
|
+
l.forEach((s) => {
|
|
329
|
+
s?.();
|
|
590
330
|
});
|
|
591
331
|
};
|
|
592
|
-
}, [
|
|
332
|
+
}, [o]), n;
|
|
593
333
|
}
|
|
594
|
-
const
|
|
595
|
-
if (!
|
|
596
|
-
const
|
|
597
|
-
for (let
|
|
598
|
-
const r =
|
|
599
|
-
n[
|
|
334
|
+
const Vt = (o, t) => {
|
|
335
|
+
if (!t || !o || t.length === 0) return q.EmptyArray;
|
|
336
|
+
const e = t.length, n = new Array(e);
|
|
337
|
+
for (let i = 0; i < e; i++) {
|
|
338
|
+
const r = t[i], c = r ? o.getCommand(r) : null;
|
|
339
|
+
n[i] = c;
|
|
600
340
|
}
|
|
601
341
|
return n;
|
|
602
342
|
};
|
|
603
|
-
function
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
const [r,
|
|
607
|
-
return
|
|
608
|
-
const
|
|
609
|
-
const d =
|
|
610
|
-
|
|
343
|
+
function Ro(o, t = null, e = null, n) {
|
|
344
|
+
const i = O(e);
|
|
345
|
+
i.current = e, t && !Array.isArray(t) && (t = [t]);
|
|
346
|
+
const [r, c] = V(Vt(o, t)), u = n ? [...n, o] : [o];
|
|
347
|
+
return $(() => {
|
|
348
|
+
const l = { onGroupChange: () => {
|
|
349
|
+
const d = Vt(o, t);
|
|
350
|
+
c(d), i.current?.onChange?.(this);
|
|
611
351
|
} };
|
|
612
|
-
let
|
|
613
|
-
|
|
614
|
-
|
|
352
|
+
let s;
|
|
353
|
+
t && t.length > 0 && (s = { keys: t }, l.onCommandChange = (d, f) => {
|
|
354
|
+
i.current?.onChange?.(o), c(Vt(o, t));
|
|
355
|
+
});
|
|
356
|
+
const a = o?.addListener(l, s), h = Vt(o, t);
|
|
357
|
+
return c(h), i.current?.onChange && i.current?.onChange(o), () => {
|
|
358
|
+
a?.();
|
|
359
|
+
};
|
|
360
|
+
}, u), r;
|
|
361
|
+
}
|
|
362
|
+
const No = { Toolbar: "toolbar", Menuitem: "menuitem" }, Ho = { 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" };
|
|
363
|
+
function se(o, t) {
|
|
364
|
+
if (typeof o == "function") return o(t);
|
|
365
|
+
o && (o.current = t);
|
|
366
|
+
}
|
|
367
|
+
var It = parseInt(_n.split(".")[0], 10) >= 19 ? function(o) {
|
|
368
|
+
return (t) => {
|
|
369
|
+
const e = [];
|
|
370
|
+
for (const n of o) {
|
|
371
|
+
const i = se(n, t), r = typeof i == "function";
|
|
372
|
+
e.push(r ? i : () => se(n, null));
|
|
373
|
+
}
|
|
374
|
+
return () => {
|
|
375
|
+
for (const n of e) n();
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
} : function(o) {
|
|
379
|
+
return (t) => {
|
|
380
|
+
for (const e of o) se(e, t);
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
const Wo = wt(kt((o, t) => {
|
|
384
|
+
const { refFocusStart: e, ...n } = o, i = O(null), r = W(() => {
|
|
385
|
+
if (e) return void e?.current?.focus();
|
|
386
|
+
const c = i.current.parentElement.children;
|
|
387
|
+
let u = [];
|
|
388
|
+
const l = c.length;
|
|
389
|
+
for (let s = 0; s < l && c[s] !== i.current; s++) {
|
|
390
|
+
const a = c[s], h = a.getAttribute("tabindex");
|
|
391
|
+
h == null || h === "-1" || a.getAttribute("disabled") !== "true" && a.focus && u.push({ tabindex: parseInt(h), child: a });
|
|
392
|
+
}
|
|
393
|
+
u.length !== 0 && (u.sort(function(s, a) {
|
|
394
|
+
return s.tabindex - a.tabindex;
|
|
395
|
+
}), u[0].child.focus());
|
|
396
|
+
}, [e]);
|
|
397
|
+
return T("div", { tabIndex: 0, ref: It([i, t]), onFocus: r, ...n });
|
|
398
|
+
}));
|
|
399
|
+
var zn = function() {
|
|
400
|
+
}, qe = typeof window < "u", Bn = qe ? ge : $, Ce = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
401
|
+
const vt = qe && window.ResizeObserver !== void 0 ? function() {
|
|
402
|
+
var o = V(null), t = o[0], e = o[1], n = V(Ce), i = n[0], r = n[1], c = I(function() {
|
|
403
|
+
return new window.ResizeObserver(function(u) {
|
|
404
|
+
if (u[0]) {
|
|
405
|
+
var l = u[0].contentRect, s = l.x, a = l.y, h = l.width, d = l.height, f = l.top, _ = l.left, p = l.bottom, b = l.right;
|
|
406
|
+
r({ x: s, y: a, width: h, height: d, top: f, left: _, bottom: p, right: b });
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
}, []);
|
|
410
|
+
return Bn(function() {
|
|
411
|
+
if (t) return c.observe(t), function() {
|
|
412
|
+
c.disconnect();
|
|
413
|
+
};
|
|
414
|
+
}, [t]), [e, i];
|
|
415
|
+
} : function() {
|
|
416
|
+
return [zn, Ce];
|
|
417
|
+
}, Fo = wt(kt((o, t) => {
|
|
418
|
+
const { className: e, style: n, children: i, radius: r = 4, strokeWidth: c = 1, strokeColor: u = "grey", ...l } = o, [s, { width: a, height: h }] = vt(), d = O(null), f = (M, m = 0) => {
|
|
419
|
+
const v = M / 2, y = h - v + m;
|
|
420
|
+
return (function(A, E, k = !1) {
|
|
421
|
+
if (E === 0) return A;
|
|
422
|
+
function H(g, w, R) {
|
|
423
|
+
let G = w.x - g.x, j = w.y - g.y, J = Math.sqrt(G * G + j * j);
|
|
424
|
+
return S(g, w, Math.min(1, R / J));
|
|
425
|
+
}
|
|
426
|
+
function S(g, w, R) {
|
|
427
|
+
return { x: g.x + (w.x - g.x) * R, y: g.y + (w.y - g.y) * R };
|
|
428
|
+
}
|
|
429
|
+
function L(g, w) {
|
|
430
|
+
g.length > 2 && (g[g.length - 2] = w.x, g[g.length - 1] = w.y);
|
|
431
|
+
}
|
|
432
|
+
function z(g) {
|
|
433
|
+
return { x: parseFloat(g[g.length - 2]), y: parseFloat(g[g.length - 1]) };
|
|
434
|
+
}
|
|
435
|
+
let C = A.split(/[,\s]/).reduce(function(g, w) {
|
|
436
|
+
let R = w.match("([a-zA-Z])(.+)");
|
|
437
|
+
return R ? (g.push(R[1]), g.push(R[2])) : g.push(w), g;
|
|
438
|
+
}, []).reduce(function(g, w) {
|
|
439
|
+
return parseFloat(w) == w && g.length ? g[g.length - 1].push(w) : g.push([w]), g;
|
|
440
|
+
}, []), D = [];
|
|
441
|
+
if (C.length > 1) {
|
|
442
|
+
let g = z(C[0]), w = null;
|
|
443
|
+
C[C.length - 1][0] === "Z" && C[0].length > 2 && (w = ["L", g.x, g.y], C[C.length - 1] = w), D.push(C[0]);
|
|
444
|
+
for (let R = 1; R < C.length; R++) {
|
|
445
|
+
let G = D[D.length - 1], j = C[R], J = j === w ? C[1] : C[R + 1];
|
|
446
|
+
if (J && G && G.length > 2 && j[0] === "L" && J.length > 2 && J[0] === "L") {
|
|
447
|
+
let Z, F, ot = z(G), Q = z(j), bt = z(J);
|
|
448
|
+
k ? (Z = S(Q, G.origPoint || ot, E), F = S(Q, J.origPoint || bt, E)) : (Z = H(Q, ot, E), F = H(Q, bt, E)), L(j, Z), j.origPoint = Q, D.push(j);
|
|
449
|
+
let xt = S(Z, Q, 0.5), St = S(Q, F, 0.5), pt = ["C", xt.x, xt.y, St.x, St.y, F.x, F.y];
|
|
450
|
+
pt.origPoint = Q, D.push(pt);
|
|
451
|
+
} else D.push(j);
|
|
452
|
+
}
|
|
453
|
+
if (w) {
|
|
454
|
+
let R = z(D[D.length - 1]);
|
|
455
|
+
D.push(["Z"]), L(D[0], R);
|
|
456
|
+
}
|
|
457
|
+
} else D = C;
|
|
458
|
+
return D.reduce(function(g, w) {
|
|
459
|
+
return g + w.join(" ") + " ";
|
|
460
|
+
}, "");
|
|
461
|
+
})(`${`M 0 ${v} L ${r - 0.5} ${v} L ${r - 0.5} ${y} L ${2 * r} ${y}`} ${`L ${a - 2 * r} ${y}`} ${`M ${a - 2 * r} ${y} L ${a - r} ${y} L ${a - r} ${v} L ${a} ${v}`}`, r);
|
|
462
|
+
}, _ = I(() => f(c), [a, h, r, c]), p = I(() => {
|
|
463
|
+
if (r === 0) return;
|
|
464
|
+
const M = r / 2;
|
|
465
|
+
return f(r) + `L ${a} 0 L 0 0 L 0 ${M}`;
|
|
466
|
+
}, [_, r, c]), b = I(() => ({ style: { clipPath: `path('${p}')` } }), [p]);
|
|
467
|
+
return Mt("div", { className: e, style: { display: "flex", flexDirection: "row", ...n }, ...l, ref: It([d, s, t]), children: [rt.isValidElement(i) ? rt.cloneElement(i, b) : T(Ct, {}), T("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: a, height: h, viewBox: `0 0 ${a} ${h}`, children: T("path", { d: _, stroke: u, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: c }) })] });
|
|
468
|
+
})), Te = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
|
|
469
|
+
class On extends mn {
|
|
470
|
+
setOverrides(t) {
|
|
471
|
+
super.setOverrides(t);
|
|
472
|
+
}
|
|
473
|
+
getDelegate() {
|
|
474
|
+
return this._overrides;
|
|
475
|
+
}
|
|
476
|
+
showMessage(t, e) {
|
|
477
|
+
const n = this.getDelegate();
|
|
478
|
+
if (n?.showMessage) return n.showMessage(t, e);
|
|
479
|
+
e?.type !== Te.Warning ? e?.type !== Te.Error ? yt.log(t) : yt.error(t) : yt.warn(t);
|
|
480
|
+
}
|
|
481
|
+
showBusy(t, e) {
|
|
482
|
+
const n = this.getDelegate();
|
|
483
|
+
return n?.showBusy ? n.showBusy(t, e) : new Promise((i) => {
|
|
484
|
+
i(() => {
|
|
485
|
+
});
|
|
615
486
|
});
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
487
|
+
}
|
|
488
|
+
showWindow(t, e) {
|
|
489
|
+
const n = this.getDelegate();
|
|
490
|
+
if (n?.showWindow) return n.showWindow(t, e);
|
|
491
|
+
}
|
|
492
|
+
showError(t) {
|
|
493
|
+
const e = this.getDelegate();
|
|
494
|
+
e?.showError ? e.showError(t) : yt.error(t);
|
|
495
|
+
}
|
|
496
|
+
showOptions(t) {
|
|
497
|
+
const e = this.getDelegate();
|
|
498
|
+
return e?.showOptions ? e.showOptions(t) : Promise.resolve("");
|
|
499
|
+
}
|
|
500
|
+
showInput(t) {
|
|
501
|
+
const e = this.getDelegate();
|
|
502
|
+
return e?.showInput ? e.showInput(t) : Promise.resolve({ input: "", option: "" });
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
const Je = We(new On()), Vo = ({ children: o, notifier: t }) => (rt.useEffect(() => {
|
|
506
|
+
const e = yt.getOverrides();
|
|
507
|
+
return yt.setOverrides(t), () => {
|
|
508
|
+
yt.setOverrides(e);
|
|
509
|
+
};
|
|
510
|
+
}, [t]), rt.createElement(Je.Provider, { value: t }, o)), Jt = () => Fe(Je), In = 3, $n = 0.5, Kn = 50, le = (o) => ({ x: o.x, y: o.y, width: o.width, height: o.height, top: o.top, left: o.left, right: o.right, bottom: o.bottom });
|
|
511
|
+
function jo(o = {}) {
|
|
512
|
+
const { threshold: t = $n, stillnessThreshold: e = In, maxHierarchyDepth: n = Kn } = o, [i, r] = vt(), c = O(null), [u, l] = He((_) => _ + 1, 0), s = O(void 0), a = O({ x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0 }), h = W((_) => {
|
|
513
|
+
c.current = _, typeof i == "function" && i(_);
|
|
514
|
+
}, [i]), [d, f] = V(r);
|
|
515
|
+
return $(() => {
|
|
516
|
+
r && !d && f(r);
|
|
517
|
+
}, [r, d]), $(() => {
|
|
518
|
+
const _ = c.current;
|
|
519
|
+
if (!_) return;
|
|
520
|
+
let p = !1, b = 0;
|
|
521
|
+
const M = () => {
|
|
522
|
+
if (!_) return;
|
|
523
|
+
const E = _.getBoundingClientRect(), k = a.current;
|
|
524
|
+
Math.abs(E.x - k.x) > t || Math.abs(E.y - k.y) > t || Math.abs(E.width - k.width) > t || Math.abs(E.height - k.height) > t ? (p || (p = !0, f(le(E)), l()), b = 0) : b++, p && b >= e && (p = !1, f(le(E)), l()), a.current = le(E), s.current = requestAnimationFrame(M);
|
|
525
|
+
};
|
|
526
|
+
s.current = requestAnimationFrame(M);
|
|
527
|
+
const m = (E) => {
|
|
528
|
+
p = !0, l();
|
|
529
|
+
}, v = (E) => {
|
|
530
|
+
p = !1, b = e, l();
|
|
531
|
+
};
|
|
532
|
+
let y = _;
|
|
533
|
+
const A = [];
|
|
534
|
+
for (; y && y !== document.documentElement && (y.addEventListener("animationstart", m, !0), y.addEventListener("animationend", v, !0), y.addEventListener("transitionstart", m, !0), y.addEventListener("transitionend", v, !0), A.push(y), y = y.parentElement, !(A.length > n)); ) ;
|
|
535
|
+
return () => {
|
|
536
|
+
s.current && cancelAnimationFrame(s.current), A.forEach((E) => {
|
|
537
|
+
E.removeEventListener("animationstart", m, !0), E.removeEventListener("animationend", v, !0), E.removeEventListener("transitionstart", m, !0), E.removeEventListener("transitionend", v, !0);
|
|
538
|
+
});
|
|
539
|
+
};
|
|
540
|
+
}, [u, r, t, e, n]), [h, d];
|
|
541
|
+
}
|
|
542
|
+
const P = (o, t) => {
|
|
543
|
+
const e = W((...r) => o?.(...r), t), n = O(null);
|
|
544
|
+
n.current = e;
|
|
545
|
+
const i = W((...r) => n.current?.(...r), []);
|
|
546
|
+
if (n.current) return i;
|
|
547
|
+
};
|
|
548
|
+
function Uo(o) {
|
|
549
|
+
const [t, e] = V(typeof window < "u" ? window.devicePixelRatio : 1), n = O(null);
|
|
550
|
+
return $(() => {
|
|
551
|
+
if (!(typeof window < "u" && "matchMedia" in window)) return;
|
|
552
|
+
const i = () => {
|
|
553
|
+
const r = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
|
|
554
|
+
r.addEventListener("change", i, { once: !0, passive: !0 }), e(window.devicePixelRatio), n.current = { mediaMatcher: r, listener: i };
|
|
555
|
+
};
|
|
556
|
+
return i(), () => {
|
|
557
|
+
n.current && n.current.mediaMatcher.removeEventListener("change", n.current.listener);
|
|
558
|
+
};
|
|
559
|
+
}, [o]), t;
|
|
560
|
+
}
|
|
561
|
+
function Xo(o) {
|
|
562
|
+
if (typeof window > "u") return 1;
|
|
563
|
+
const { defaultDpr: t = 1, maxDpr: e = 3, round: n = !0 } = o || {}, i = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : t;
|
|
564
|
+
return Math.min(Math.max(1, n ? Math.floor(i) : i), e);
|
|
565
|
+
}
|
|
566
|
+
function Yo(o, t, e) {
|
|
567
|
+
const n = P(t, [t]);
|
|
568
|
+
$(() => {
|
|
569
|
+
const i = (r) => {
|
|
570
|
+
o.current && !o.current.contains(r.target) && n(r);
|
|
571
|
+
};
|
|
572
|
+
return e && e.mouseEvents === !1 || (document.addEventListener("mousedown", i), document.addEventListener("touchstart", i)), e && e.focusEvents === !1 || document.addEventListener("focus", i), () => {
|
|
573
|
+
document.removeEventListener("mousedown", i), document.removeEventListener("touchstart", i), document.removeEventListener("focus", i);
|
|
619
574
|
};
|
|
620
|
-
},
|
|
575
|
+
}, [o]);
|
|
621
576
|
}
|
|
622
|
-
|
|
577
|
+
function Rn(o) {
|
|
578
|
+
if (!o) throw new Error("must have a PointerHandlerOptions");
|
|
579
|
+
const { onPointerDown: t, onPointerUp: e, onPointerMoveOrWait: n, processTouch: i = !1, consumeTouch: r = !0 } = o, c = P(t, [t]), u = P(e, [e]), l = P(n, [n]), s = O(!1), a = o?.timerInitial ?? 230, h = o?.timerContinuous ?? a / 2, d = O(null), f = O(null), _ = O(null), p = O(null), b = W(() => {
|
|
580
|
+
p.current && (clearTimeout(p.current), p.current = null);
|
|
581
|
+
}, []), M = W((L) => {
|
|
582
|
+
p.current = setTimeout(() => {
|
|
583
|
+
window.requestAnimationFrame(() => {
|
|
584
|
+
s.current !== !1 && l?.(f.current, _.current, d.current);
|
|
585
|
+
}), M(h);
|
|
586
|
+
}, L ?? a);
|
|
587
|
+
}, []);
|
|
588
|
+
$(() => () => b(), []);
|
|
589
|
+
const m = i ? "pointer" : "mouse", v = W((L) => {
|
|
590
|
+
L.stopPropagation(), L.stopImmediatePropagation(), L.preventDefault();
|
|
591
|
+
}, []), y = P((L) => {
|
|
592
|
+
document.removeEventListener(`${m}move`, k), document.removeEventListener(`${m}up`, y), document.removeEventListener("keydown", H), document.removeEventListener("keyup", S), document.removeEventListener("touchstart", v, { capture: !0 }), document.removeEventListener("touchmove", v, { capture: !0 }), window.removeEventListener("blur", A), b(), window.requestAnimationFrame(() => {
|
|
593
|
+
s.current !== !1 && (s.current = !1, u?.(L, _.current, d.current), _.current = null);
|
|
594
|
+
});
|
|
595
|
+
}, []), A = W(() => {
|
|
596
|
+
s.current !== !1 && (s.current = !1, y(f.current));
|
|
597
|
+
}, []), E = P(() => {
|
|
598
|
+
b(), M(h), window.requestAnimationFrame(() => {
|
|
599
|
+
s.current !== !1 && l?.(f.current, _.current, d.current);
|
|
600
|
+
});
|
|
601
|
+
}, [h]), k = P((L) => {
|
|
602
|
+
f.current = L, E();
|
|
603
|
+
}, []), H = P((L) => {
|
|
604
|
+
_.current = { ctrlKey: L.ctrlKey, shiftKey: L.shiftKey, altKey: L.altKey, metaKey: L.metaKey }, E();
|
|
605
|
+
}, []), S = P((L) => {
|
|
606
|
+
_.current = { ctrlKey: L.ctrlKey, shiftKey: L.shiftKey, altKey: L.altKey, metaKey: L.metaKey }, E();
|
|
607
|
+
}, [h]);
|
|
608
|
+
return P((L) => {
|
|
609
|
+
L.isDefaultPrevented() || (_.current = { ctrlKey: L.ctrlKey, shiftKey: L.shiftKey, altKey: L.altKey, metaKey: L.metaKey }, c(L, _.current) !== !1 && (d.current = L, f.current = L.nativeEvent, document.addEventListener(`${m}up`, y, { passive: !1 }), document.addEventListener(`${m}move`, k, { passive: !1 }), document.addEventListener("keydown", H, { passive: !1 }), document.addEventListener("keyup", S, { passive: !1 }), window.addEventListener("blur", A, { passive: !0 }), i && r && (document.addEventListener("touchstart", v, { passive: !1, capture: !0 }), document.addEventListener("touchmove", v, { passive: !1, capture: !0 })), s.current = !0, M(a)));
|
|
610
|
+
}, [a, i]);
|
|
611
|
+
}
|
|
612
|
+
function Go(o, t) {
|
|
613
|
+
return Rn({ onPointerDown: o, onPointerMoveOrWait: (e, n, i) => {
|
|
614
|
+
o?.(i);
|
|
615
|
+
}, ...t });
|
|
616
|
+
}
|
|
617
|
+
const Nn = ({ initValue: o, useHookBody: t, applyStateChange: e }) => {
|
|
618
|
+
const n = O(o);
|
|
619
|
+
if (typeof t != "function") throw new Error("function expected as hook body parameter. got " + typeof t);
|
|
620
|
+
const i = t();
|
|
621
|
+
return ge(() => {
|
|
622
|
+
n.current !== i && (n.current = i, e(i));
|
|
623
|
+
}, [e, i]), null;
|
|
624
|
+
}, pe = (o) => {
|
|
625
|
+
console && console.warn && console.warn(o);
|
|
626
|
+
}, ae = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
|
|
627
|
+
let Hn = 1, fe = !1, Qe = !1;
|
|
628
|
+
const Yt = [], Lt = [], qt = () => {
|
|
629
|
+
Lt.forEach((o) => o());
|
|
630
|
+
}, Wn = ({ automaticContainerInternalUseOnly: o }) => {
|
|
631
|
+
const [t, e] = V([]), n = O([]);
|
|
632
|
+
return n.current = t, o || fe !== !1 || (Qe = !0), $(() => {
|
|
633
|
+
let i = !0;
|
|
634
|
+
function r() {
|
|
635
|
+
if (i) return Lt[0] !== r ? (o || fe !== !0 || pe("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void e((c) => [])) : void e([...Yt]);
|
|
636
|
+
}
|
|
637
|
+
return Lt.push(r), qt(), () => {
|
|
638
|
+
i = !1, n.current?.length > 0 && pe("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Lt.splice(Lt.indexOf(r), 1), qt();
|
|
639
|
+
};
|
|
640
|
+
}, [o]), T(Ct, { children: t.map(({ hook: i, key: r }) => gn(Nn, { ...i, key: r })) });
|
|
641
|
+
}, Fn = (o) => {
|
|
642
|
+
const t = Hn++;
|
|
643
|
+
return Yt.push({ hook: o, key: t }), Lt.length === 0 && Qe === !1 && (fe = !0, ((e) => {
|
|
644
|
+
if (ae.document && ae.document.createElement) {
|
|
645
|
+
const n = ae.document.createElement("div");
|
|
646
|
+
wn(n).render(T(e, { automaticContainerInternalUseOnly: !0 }));
|
|
647
|
+
} else pe("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
|
|
648
|
+
})(Wn)), qt(), () => {
|
|
649
|
+
Yt.splice(Yt.findIndex((e) => e.key === t), 1), qt();
|
|
650
|
+
};
|
|
651
|
+
};
|
|
652
|
+
let me = null;
|
|
653
|
+
me || (me = (o, t, e = {}) => {
|
|
654
|
+
let n, i, r = !1, c = !1, u = [], { unmountIfNoConsumers: l = !1 } = e;
|
|
655
|
+
const s = (h) => {
|
|
656
|
+
i = h, bn(() => u.forEach((d) => d(h)));
|
|
657
|
+
}, a = () => (c || (i = typeof o == "function" ? o() : o, c = !0), i);
|
|
658
|
+
return () => {
|
|
659
|
+
const [h, d] = V(a);
|
|
660
|
+
return $(() => (r || (r = !0, n = Fn({ initValue: o, useHookBody: t, applyStateChange: s })), u.push(d), i !== h && d(i), () => {
|
|
661
|
+
u.splice(u.indexOf(d), 1), u.length === 0 && l && (n(), r = !1);
|
|
662
|
+
}), []), h;
|
|
663
|
+
};
|
|
664
|
+
});
|
|
665
|
+
const tn = me;
|
|
666
|
+
let en = () => {
|
|
667
|
+
console.warn("You must call useEditMode before setting its state.");
|
|
668
|
+
};
|
|
669
|
+
const Vn = tn(null, () => {
|
|
670
|
+
const [o, t] = V(null);
|
|
671
|
+
return en = t, o;
|
|
672
|
+
}), Zo = () => {
|
|
673
|
+
const o = Vn();
|
|
674
|
+
return I(() => ({ setMode: (t) => {
|
|
675
|
+
en((e) => (typeof t == "function" && (t = t(e)), t?.onModeChange?.(t ?? null), t));
|
|
676
|
+
}, getMode: () => o }), [o]);
|
|
677
|
+
}, jn = tn({ setClipboard: (o) => {
|
|
623
678
|
throw new Error("This is only available via the useClipboard.");
|
|
624
|
-
}, getClipboard: () =>
|
|
625
|
-
const [
|
|
626
|
-
return { setClipboard: (
|
|
627
|
-
}),
|
|
628
|
-
const { source:
|
|
629
|
-
|
|
630
|
-
const
|
|
679
|
+
}, getClipboard: () => Zt.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
|
|
680
|
+
const [o, t] = V(Zt.Global);
|
|
681
|
+
return { setClipboard: (e) => t(e), getClipboard: () => o, refNativeCopy: O(null), refNativeLastKey: O(null) };
|
|
682
|
+
}), qo = (o) => {
|
|
683
|
+
const { source: t, target: e, onPaste: n, onClipboardUpdate: i, commands: r } = o, c = Jt(), u = P(i, [i]), l = P(n, [n]), { getClipboard: s, refNativeCopy: a } = jn(), h = s();
|
|
684
|
+
I(() => {
|
|
685
|
+
const m = t?.element, v = e?.element ?? t?.element;
|
|
631
686
|
if (!r) return;
|
|
632
|
-
const
|
|
633
|
-
r?.addCommands(
|
|
687
|
+
const y = [new re("cut", m, { 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: [Y.Ctrl] } }), new re("copy", m, { 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: [Y.Ctrl] } }), new re("paste", v, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste.yellow", shortcut: [{ key: "V", modifiers: [Y.Ctrl] }, { key: "F8", modifiers: [Y.Ctrl] }] })];
|
|
688
|
+
r?.addCommands(y, !0);
|
|
634
689
|
}, [r]);
|
|
635
|
-
const d =
|
|
636
|
-
if (!
|
|
637
|
-
let
|
|
690
|
+
const d = P(async (m) => {
|
|
691
|
+
if (!t?.element) return;
|
|
692
|
+
let v = null;
|
|
638
693
|
try {
|
|
639
|
-
|
|
640
|
-
} catch (
|
|
641
|
-
throw
|
|
694
|
+
v = t.doCopy?.(m), typeof v == "string" ? await h.writeText(v) : await h.writeReference(v);
|
|
695
|
+
} catch (y) {
|
|
696
|
+
throw y;
|
|
642
697
|
}
|
|
643
|
-
}, [
|
|
644
|
-
const
|
|
645
|
-
if (
|
|
646
|
-
|
|
698
|
+
}, [t, c]), f = P(async (m) => {
|
|
699
|
+
const v = t?.element?.();
|
|
700
|
+
if (v) {
|
|
701
|
+
a.current = { sourceElement: v, args: m };
|
|
647
702
|
try {
|
|
648
|
-
await d(
|
|
649
|
-
} catch (
|
|
650
|
-
|
|
703
|
+
await d(m);
|
|
704
|
+
} catch (y) {
|
|
705
|
+
c.showError?.(y);
|
|
651
706
|
}
|
|
652
707
|
}
|
|
653
|
-
}, [
|
|
708
|
+
}, [t?.element, c]), _ = W(() => {
|
|
654
709
|
f({ isCut: !0 });
|
|
655
|
-
}, []),
|
|
710
|
+
}, []), p = P(async (m, v, y) => {
|
|
656
711
|
try {
|
|
657
|
-
if (await
|
|
658
|
-
|
|
712
|
+
if (await m.doPaste(v, y) === !1) return;
|
|
713
|
+
l?.(v, y);
|
|
659
714
|
} catch (A) {
|
|
660
|
-
|
|
715
|
+
c.showError?.(A);
|
|
661
716
|
}
|
|
662
|
-
}, [
|
|
663
|
-
const A =
|
|
664
|
-
if (A && await q.whenFocus(A), !
|
|
665
|
-
const
|
|
666
|
-
if (
|
|
667
|
-
return await
|
|
668
|
-
} catch (
|
|
669
|
-
|
|
717
|
+
}, [l]), b = P(async (m, v, y) => {
|
|
718
|
+
const A = e?.element?.();
|
|
719
|
+
if (A && await q.whenFocus(A), !m && !v) return;
|
|
720
|
+
const E = await c.showBusy?.("Pasting...");
|
|
721
|
+
if (v) try {
|
|
722
|
+
return await p(e, v, y), void E?.();
|
|
723
|
+
} catch (S) {
|
|
724
|
+
E?.(), c.showError?.(S);
|
|
670
725
|
}
|
|
671
|
-
let
|
|
672
|
-
|
|
726
|
+
let k, H = e.importFromExternal;
|
|
727
|
+
H || (H = (S, L) => ({ getItemType: () => "text", toText: () => m.text, isClipboardItem: !0 }));
|
|
673
728
|
try {
|
|
674
|
-
|
|
675
|
-
} catch (
|
|
676
|
-
|
|
729
|
+
k = await H(m, { isCut: !1 });
|
|
730
|
+
} catch (S) {
|
|
731
|
+
E?.(), c.showError?.(S);
|
|
677
732
|
}
|
|
678
|
-
if (
|
|
679
|
-
const
|
|
680
|
-
await
|
|
681
|
-
} catch (
|
|
682
|
-
|
|
733
|
+
if (k) try {
|
|
734
|
+
const S = await Promise.resolve(k);
|
|
735
|
+
await p(e, S, y), E?.();
|
|
736
|
+
} catch (S) {
|
|
737
|
+
E?.(), c.showError?.(S);
|
|
683
738
|
}
|
|
684
|
-
else
|
|
685
|
-
}, [
|
|
686
|
-
if (
|
|
687
|
-
const
|
|
688
|
-
if (
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
const A = { text:
|
|
692
|
-
await
|
|
693
|
-
} catch (
|
|
694
|
-
if (
|
|
695
|
-
|
|
739
|
+
else E?.();
|
|
740
|
+
}, [p, e, c]), M = P(async (m) => {
|
|
741
|
+
if (e?.element) try {
|
|
742
|
+
const v = await h.readReference();
|
|
743
|
+
if (v) return void await b(null, v, m);
|
|
744
|
+
const y = [];
|
|
745
|
+
y[0] = await oe.readStringFromClipboard(h, ie.plain), y[1] = await oe.readHTMLFromClipboard(h, ie.html), y[2] = await oe.readBlobFromClipboard(h, ie.png);
|
|
746
|
+
const A = { text: y[0] ?? null, html: y[1] ?? null, image: y[2] ?? null };
|
|
747
|
+
await b(A, null, m);
|
|
748
|
+
} catch (v) {
|
|
749
|
+
if (v?.message === "Document is not focused.") return;
|
|
750
|
+
c.showError?.(v);
|
|
696
751
|
}
|
|
697
|
-
}, [
|
|
698
|
-
return
|
|
699
|
-
}, [
|
|
700
|
-
}, [
|
|
701
|
-
if (!
|
|
702
|
-
const
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
},
|
|
706
|
-
|
|
707
|
-
},
|
|
708
|
-
|
|
752
|
+
}, [b, e?.element, c]);
|
|
753
|
+
return P(async (m) => {
|
|
754
|
+
}, [t?.element]), P(async (m) => {
|
|
755
|
+
}, [e?.element, b, c]), $(() => {
|
|
756
|
+
if (!h) return;
|
|
757
|
+
const m = async (A) => {
|
|
758
|
+
const E = await h.readReference();
|
|
759
|
+
u?.(E);
|
|
760
|
+
}, v = (A) => {
|
|
761
|
+
c.showMessage?.(Zt.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
|
|
762
|
+
}, y = (A) => {
|
|
763
|
+
c.showMessage?.(Zt.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
|
|
709
764
|
};
|
|
710
|
-
return
|
|
711
|
-
|
|
765
|
+
return h.addEventListener("clipboardchange", m), h.addEventListener("clipboarderrorread", v), h.addEventListener("clipboarderrorwrite", y), () => {
|
|
766
|
+
h.removeEventListener("clipboardchange", m), h.removeEventListener("clipboarderrorread", v), h.removeEventListener("clipboarderrorwrite", y);
|
|
712
767
|
};
|
|
713
|
-
}, [
|
|
714
|
-
}, [d,
|
|
715
|
-
r?.getCommand("cut")?.updateCallback(_).update({ disabled: !
|
|
716
|
-
}, [
|
|
768
|
+
}, [h, c]), $(() => {
|
|
769
|
+
}, [d, b, t, e]), $(() => {
|
|
770
|
+
r?.getCommand("cut")?.updateCallback(_).update({ disabled: !t || !e }), r?.getCommand("copy")?.updateCallback(f).update({ disabled: !t }), r?.getCommand("paste")?.updateCallback(M).update({ disabled: !e });
|
|
771
|
+
}, [t, e, r]), { paste: M, copy: f, clipboard: h };
|
|
717
772
|
};
|
|
718
|
-
function
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
if (
|
|
722
|
-
const n = Object.entries(
|
|
773
|
+
function Jo(o, t = !0) {
|
|
774
|
+
const e = O(o);
|
|
775
|
+
$(() => {
|
|
776
|
+
if (t) {
|
|
777
|
+
const n = Object.entries(o).reduce((i, [r, c]) => (e.current[r] !== c && (i[r] = [e.current[r], c]), i), {});
|
|
723
778
|
Object.keys(n).length > 0 && console.log("Changed props:", n);
|
|
724
779
|
}
|
|
725
|
-
|
|
780
|
+
e.current = o;
|
|
726
781
|
});
|
|
727
782
|
}
|
|
728
|
-
let
|
|
729
|
-
var
|
|
730
|
-
const
|
|
731
|
-
const [
|
|
732
|
-
return
|
|
733
|
-
|
|
734
|
-
}, []),
|
|
735
|
-
|
|
736
|
-
}, []),
|
|
737
|
-
},
|
|
738
|
-
function
|
|
783
|
+
let ce = !1, Un = 0;
|
|
784
|
+
var Xn = typeof document < "u" ? ge : $;
|
|
785
|
+
const ke = () => "sheetxl-ui-" + Un++, Pe = rt.useId, Qo = Pe ?? function() {
|
|
786
|
+
const [o, t] = rt.useState(() => ce ? ke() : void 0);
|
|
787
|
+
return Xn(() => {
|
|
788
|
+
o == null && t(ke());
|
|
789
|
+
}, []), rt.useEffect(() => {
|
|
790
|
+
ce || (ce = !0);
|
|
791
|
+
}, []), o;
|
|
792
|
+
}, Yn = [];
|
|
793
|
+
function ve(o, t, e = Yn) {
|
|
739
794
|
const n = O(null);
|
|
740
|
-
return
|
|
795
|
+
return yn(o, () => {
|
|
741
796
|
if (!n.current) return;
|
|
742
|
-
const
|
|
797
|
+
const i = n.current, r = t?.();
|
|
743
798
|
if (!r || typeof r != "object") throw new Error("attributes must return a plain object of values");
|
|
744
|
-
const
|
|
745
|
-
for (let
|
|
746
|
-
const
|
|
747
|
-
Object.defineProperty(
|
|
799
|
+
const c = Object.keys(r), u = c.length;
|
|
800
|
+
for (let l = 0; l < u; l++) {
|
|
801
|
+
const s = c[l], a = r[s];
|
|
802
|
+
Object.defineProperty(i, s, { value: a, writable: !0, configurable: !0, enumerable: !0 });
|
|
748
803
|
}
|
|
749
|
-
return
|
|
750
|
-
},
|
|
804
|
+
return i;
|
|
805
|
+
}, e), n;
|
|
751
806
|
}
|
|
752
|
-
const
|
|
753
|
-
const n =
|
|
807
|
+
const De = "Undo the last action.", Ae = "Repeat the last action or undo the redo.", Gn = (o) => `Redo ${o}`, ti = ({ manager: o, commands: t, disabled: e }) => {
|
|
808
|
+
const n = Jt(), i = P((c) => {
|
|
754
809
|
try {
|
|
755
|
-
|
|
756
|
-
} catch (
|
|
757
|
-
n.error(
|
|
810
|
+
o?.undo(c);
|
|
811
|
+
} catch (u) {
|
|
812
|
+
n.error(u);
|
|
758
813
|
}
|
|
759
|
-
}, [
|
|
814
|
+
}, [o]), r = P((c) => {
|
|
760
815
|
try {
|
|
761
|
-
|
|
762
|
-
} catch (
|
|
763
|
-
n.error(
|
|
816
|
+
o?.redo(c);
|
|
817
|
+
} catch (u) {
|
|
818
|
+
n.error(u);
|
|
764
819
|
}
|
|
765
|
-
}, [
|
|
766
|
-
return
|
|
767
|
-
if (!
|
|
768
|
-
const
|
|
769
|
-
} },
|
|
770
|
-
|
|
771
|
-
}, [
|
|
772
|
-
if (!
|
|
773
|
-
const
|
|
774
|
-
const
|
|
775
|
-
var
|
|
776
|
-
|
|
777
|
-
const
|
|
778
|
-
|
|
820
|
+
}, [o]);
|
|
821
|
+
return I(() => {
|
|
822
|
+
if (!t) return;
|
|
823
|
+
const c = { contains: (l) => !0, focus() {
|
|
824
|
+
} }, u = [new ue("undo", c, { label: "Undo", description: De, shortcut: { key: "z", modifiers: [Y.Ctrl] }, disabled: !0 }, i), new ue("redo", c, { label: "Redo", description: Ae, shortcut: [{ key: "y", modifiers: [Y.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [Y.Alt] }], disabled: !0 }, r)];
|
|
825
|
+
t?.addCommands(u, !0);
|
|
826
|
+
}, [t]), $(() => {
|
|
827
|
+
if (!t) return;
|
|
828
|
+
const c = () => {
|
|
829
|
+
const l = o?.getTopUndoDescription(), s = {};
|
|
830
|
+
var a;
|
|
831
|
+
t.getCommand("undo").update({ disabled: e || !o || !o.hasUndo(), description: l ? (a = l, `Undo ${a}`) : De, state: s, context: { undoManager: o } });
|
|
832
|
+
const h = o?.getTopRedoDescription();
|
|
833
|
+
t.getCommand("redo").update({ disabled: e || !o || !o.hasRedo(), description: h ? Gn(h) : Ae, state: s, context: { undoManager: o } });
|
|
779
834
|
};
|
|
780
|
-
if (
|
|
781
|
-
const
|
|
782
|
-
|
|
835
|
+
if (c(), !o) return;
|
|
836
|
+
const u = o.addListener({ onStackChange() {
|
|
837
|
+
c();
|
|
783
838
|
} });
|
|
784
|
-
return () =>
|
|
785
|
-
}, [
|
|
786
|
-
}, Xn = "_scrollbar_1v478_17", Yn = "_vsb-track_1v478_27", Gn = "_vsb-thumb_1v478_39", en = "_scrollbar-button_1v478_80", tn = "M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z", nn = "M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z", Zn = { transform: "rotate(180deg)" }, qn = (i) => {
|
|
787
|
-
const { style: e, orientation: t = ae.Vertical, disabled: n, ...o } = i, r = t === ae.Vertical ? tn : nn;
|
|
788
|
-
return C("button", { style: e, className: le(en, t, "scroll-button"), disabled: n, ...o, children: C("svg", { width: "9", height: "9", viewBox: "0 0 9 9", children: C("path", { d: r }) }) });
|
|
789
|
-
}, Qn = (i) => {
|
|
790
|
-
const { style: e, orientation: t = ae.Vertical, disabled: n, ...o } = i, r = t === ae.Vertical ? tn : nn;
|
|
791
|
-
return C("button", { style: e, className: le(en, t, "scroll-button"), disabled: n, ...o, children: C("svg", { width: "9", height: "9", viewBox: "0 0 9 9", style: Zn, children: C("path", { d: r }) }) });
|
|
792
|
-
}, Uo = (i) => {
|
|
793
|
-
const { style: e, orientation: t = ae.Vertical, ...n } = i, o = t === ae.Vertical;
|
|
794
|
-
return C("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: C("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: o ? "rotate(90) " : "", children: C("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" }) }) });
|
|
839
|
+
return () => u?.();
|
|
840
|
+
}, [o, t, e]), { undo: i, redo: r };
|
|
795
841
|
};
|
|
796
|
-
|
|
797
|
-
function Xo() {
|
|
798
|
-
const [i, e] = F(!!document.fullscreenElement), t = V(() => {
|
|
799
|
-
const n = document.fullscreenElement;
|
|
800
|
-
return n ? n.querySelector(".fullscreen-portal-root") || n : document.body;
|
|
801
|
-
}, []);
|
|
802
|
-
return N(() => {
|
|
803
|
-
function n() {
|
|
804
|
-
const o = document.fullscreenElement;
|
|
805
|
-
if (e(!!o), !o) return;
|
|
806
|
-
let r = o.querySelector(".fullscreen-portal-root");
|
|
807
|
-
r || (r = document.createElement("div"), r.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", o.appendChild(r));
|
|
808
|
-
}
|
|
809
|
-
return je++, n(), document.addEventListener("fullscreenchange", n), () => {
|
|
810
|
-
document.removeEventListener("fullscreenchange", n), je--, je <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((o) => {
|
|
811
|
-
o.parentNode && o.parentNode.removeChild(o);
|
|
812
|
-
}), je = 0);
|
|
813
|
-
};
|
|
814
|
-
}, []), { getPortalContainer: t, isFullscreen: i };
|
|
815
|
-
}
|
|
816
|
-
const Jn = 24, eo = we(ke((i, e) => {
|
|
817
|
-
const { offset: t = 0, totalSize: n = 0, viewportSize: o = 0, style: r, className: a, orientation: h = ae.Vertical, onScrollOffset: s, onScroll: l, showCustomScrollButtons: c = !0, scrollButtonIncrement: u = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: f = 120, minThumbSize: _ = Jn, maxThumbSize: g, createScrollStartButton: M = qn, createScrollEndButton: P = Qn, usePortal: y = !1, ...w } = i;
|
|
818
|
-
k(l, [l]);
|
|
819
|
-
const [m, A] = F({ offset: 0, length: 0 }), S = O(-1), T = h === ae.Vertical, [I, { width: x, height: E }] = ve(), z = T ? E : x, L = k((b, $, U) => {
|
|
820
|
-
if ($ === 0 || U === 0) return void A({ offset: 0, length: _ });
|
|
821
|
-
const me = U / z, _e = $ / me, ze = Math.min(Math.max(_, _e), Math.min(z, g ?? Number.MAX_SAFE_INTEGER)), tt = b / me;
|
|
822
|
-
return { offset: Math.min(Math.max(0, tt), z - ze), length: ze };
|
|
823
|
-
}, [z, _, g]), D = k((b) => {
|
|
824
|
-
const $ = n / z, U = Math.round(b * $);
|
|
825
|
-
A(L(U, o, n)), s?.(U, o, n), S.current = b;
|
|
826
|
-
}, [s, o, n, z, m]), p = k((b) => {
|
|
827
|
-
A(L(b, o, n)), s?.(b, o, n), S.current = b;
|
|
828
|
-
}, [s, o, n]);
|
|
829
|
-
N(() => {
|
|
830
|
-
S.current !== t && z !== 0 && (S.current = -1, A(L(t, o, n)));
|
|
831
|
-
}, [t]), N(() => {
|
|
832
|
-
z !== 0 && A(L(t, o, n));
|
|
833
|
-
}, [o, n, T, z]);
|
|
834
|
-
const v = Math.max(0, n - o), [K, G] = F(!1), j = O(0), Q = O(0), Z = yt(e, () => ({ isScrollbar: () => !0 }), []), W = k((b) => {
|
|
835
|
-
b.currentTarget.setPointerCapture(b.pointerId), G(!0), j.current = T ? b.clientY : b.clientX, Q.current = m.offset, b.preventDefault(), b.stopPropagation();
|
|
836
|
-
}, [T, m]), oe = k((b) => {
|
|
837
|
-
if (!K) return;
|
|
838
|
-
const $ = (T ? b.clientY : b.clientX) - j.current, U = Q.current + $;
|
|
839
|
-
D(U);
|
|
840
|
-
}, [K, T]), J = k((b) => {
|
|
841
|
-
try {
|
|
842
|
-
b.currentTarget.releasePointerCapture(b.pointerId);
|
|
843
|
-
} catch {
|
|
844
|
-
}
|
|
845
|
-
G(!1);
|
|
846
|
-
}, []), be = k((b) => {
|
|
847
|
-
if (!b.currentTarget) return;
|
|
848
|
-
const $ = b.currentTarget.getBoundingClientRect(), U = T ? b.clientY - $.top : b.clientX - $.left;
|
|
849
|
-
D(U);
|
|
850
|
-
}, [T, m, o, n]), xe = k((b) => {
|
|
851
|
-
const $ = Math.max(1, Math.floor(0.9 * o));
|
|
852
|
-
T ? (b.key === "ArrowDown" && D(Math.min(v, t + 1)), b.key === "ArrowUp" && D(Math.max(0, t - 1)), b.key === "PageDown" && D(Math.min(v, t + $)), b.key === "PageUp" && D(Math.max(0, t - $)), b.key === "Home" && D(0), b.key === "End" && D(v)) : (b.key === "ArrowRight" && D(Math.min(v, t + 1)), b.key === "ArrowLeft" && D(Math.max(0, t - 1)), b.key === "PageDown" && D(Math.min(v, t + $)), b.key === "PageUp" && D(Math.max(0, t - $)), b.key === "Home" && D(0), b.key === "End" && D(v));
|
|
853
|
-
}, [T, o, n, t, v]), Se = O(null), pe = R(() => C("div", { className: le(Gn), ref: Se, role: "slider", "aria-label": T ? "Rows" : "Columns", "aria-orientation": T ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": v, "aria-valuenow": t, tabIndex: 0, style: { position: y ? "fixed" : "relative", [T ? "height" : "width"]: `${m.length}px`, [T ? "width" : "height"]: "100%", transform: T ? `translateY(${m.offset}px)` : `translateX(${m.offset}px)`, [T ? "minHeight" : "minWidth"]: `${_}px` }, onPointerDown: W, onPointerMove: oe, onPointerUp: J }), [m, _, v, t, T, !1]), [Re, Ne] = F(null), He = k(() => {
|
|
854
|
-
let b;
|
|
855
|
-
b = typeof u == "function" ? u(t, o, n) : t - u;
|
|
856
|
-
const $ = Math.max(0, b);
|
|
857
|
-
return p($), Ne($), $;
|
|
858
|
-
}, [u, t, o, n]), Pe = k(() => {
|
|
859
|
-
let b;
|
|
860
|
-
b = typeof u == "function" ? u(t, o, n) : t + u;
|
|
861
|
-
const $ = Math.min(v, b);
|
|
862
|
-
return p($), Ne($), $;
|
|
863
|
-
}, [u, t, v, o, n]), fe = O(null), Ee = O(null), se = V(() => {
|
|
864
|
-
fe.current && (clearTimeout(fe.current), fe.current = null, Ee.current = null);
|
|
865
|
-
}, []), De = V((b, $, U, me = d) => {
|
|
866
|
-
Ee.current = b, fe.current = setTimeout(() => {
|
|
867
|
-
const _e = U ? He() : Pe();
|
|
868
|
-
_e !== Ee.current ? De(_e, !1, U, f) : se();
|
|
869
|
-
}, $ ? 0 : me);
|
|
870
|
-
}, [He, Pe, se]);
|
|
871
|
-
N(() => () => se(), [se]);
|
|
872
|
-
const Je = R(() => {
|
|
873
|
-
if (!c) return null;
|
|
874
|
-
const b = { orientation: h, disabled: t <= 0, onMouseUp: se, onMouseLeave: se, onMouseDown: () => De(t, !0, !0) };
|
|
875
|
-
return M?.(b);
|
|
876
|
-
}, [c, h, t, Re]), et = R(() => {
|
|
877
|
-
if (!c) return null;
|
|
878
|
-
const b = { orientation: h, disabled: t >= v, onMouseUp: se, onMouseLeave: se, onMouseDown: () => De(t, !0, !1) };
|
|
879
|
-
return P?.(b);
|
|
880
|
-
}, [c, h, t, v, Re]), Ae = T ? "vertical" : "horizontal";
|
|
881
|
-
return Ce("div", { ref: $e([Z, e]), className: le(a, Xn, Ae, { dragging: K }), style: r, ...w, children: [Je, C("div", { ref: I, role: "scrollbar", "aria-orientation": Ae, "aria-valuemin": 0, "aria-valuemax": v, "aria-valuenow": t, tabIndex: 0, className: le(Yn, "track", Ae), onPointerDown: be, onKeyDown: xe, children: y ? null : pe }), y ? gn(pe, document.body) : null, et] });
|
|
882
|
-
}));
|
|
883
|
-
let At = Date.now, zt = 1e3, de = {}, to = 1;
|
|
884
|
-
const Oe = (i) => {
|
|
885
|
-
let e = de[i] !== null;
|
|
886
|
-
return e && (de[i] = null), e;
|
|
887
|
-
}, Bt = (i, e, t, n = 0, o) => {
|
|
888
|
-
let r = At(), a = r, h = 0, s = 0, l = 0, c = to++;
|
|
889
|
-
if (c % 20 == 0) {
|
|
890
|
-
const d = {};
|
|
891
|
-
for (let f in de) d[f] = !0;
|
|
892
|
-
de = d;
|
|
893
|
-
}
|
|
894
|
-
const u = function(d) {
|
|
895
|
-
let f = d !== !0, _ = At(), g = !0;
|
|
896
|
-
try {
|
|
897
|
-
g = (!e || e(c)) ?? !0;
|
|
898
|
-
} catch {
|
|
899
|
-
g = !1;
|
|
900
|
-
}
|
|
901
|
-
if (!de[c] || !g) return de[c] = null, void t?.(60 - s / ((_ - r) / zt), c, !1);
|
|
902
|
-
if (f) {
|
|
903
|
-
l = Math.round((_ - a) / 16.666666666666668) - 1;
|
|
904
|
-
for (let y = 0; y < Math.min(l, 4); y++) u(!0), s++;
|
|
905
|
-
}
|
|
906
|
-
n && (h = (_ - r) / n, h > 1 && (h = 1));
|
|
907
|
-
let M = o ? o(h) : h, P = !1;
|
|
908
|
-
try {
|
|
909
|
-
P = i(M, _, f);
|
|
910
|
-
} catch {
|
|
911
|
-
P = !1;
|
|
912
|
-
}
|
|
913
|
-
P !== !1 && h !== 1 || !f ? f && (a = _, requestAnimationFrame(u)) : (de[c] = null, t?.(60 - s / ((_ - r) / zt), c, h === 1 || n == null));
|
|
914
|
-
};
|
|
915
|
-
return de[c] = !0, requestAnimationFrame(u), c;
|
|
916
|
-
}, no = function(i) {
|
|
917
|
-
return Math.pow(i - 1, 3) + 1;
|
|
918
|
-
}, oo = function(i) {
|
|
919
|
-
return (i /= 0.5) < 1 ? 0.5 * Math.pow(i, 3) : 0.5 * (Math.pow(i - 2, 3) + 2);
|
|
920
|
-
};
|
|
921
|
-
class io {
|
|
922
|
-
constructor(e, t) {
|
|
923
|
-
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 };
|
|
924
|
-
}
|
|
925
|
-
setDimensions(e, t, n, o) {
|
|
926
|
-
e !== null && (this.__clientWidth = e), t !== null && (this.__clientHeight = t), n !== null && (this.__contentWidth = n), o !== null && (this.__contentHeight = o), this.__computeScrollMax(), this.scrollTo(this.__scrollLeft, this.__scrollTop, !0);
|
|
927
|
-
}
|
|
928
|
-
setPosition(e, t) {
|
|
929
|
-
this.__clientLeft = e || 0, this.__clientTop = t || 0;
|
|
930
|
-
}
|
|
931
|
-
setSnapSize(e, t) {
|
|
932
|
-
this.__snapWidth = e, this.__snapHeight = t;
|
|
933
|
-
}
|
|
934
|
-
getValues() {
|
|
935
|
-
return { left: this.__scrollLeft, top: this.__scrollTop, right: this.__scrollLeft + this.__clientWidth / this.__zoomLevel, bottom: this.__scrollTop + this.__clientHeight / this.__zoomLevel, zoom: this.__zoomLevel };
|
|
936
|
-
}
|
|
937
|
-
getPoint(e, t) {
|
|
938
|
-
const n = this.getValues();
|
|
939
|
-
return { left: e / n.zoom, top: t / n.zoom };
|
|
940
|
-
}
|
|
941
|
-
getScrollMax() {
|
|
942
|
-
return { left: this.__maxScrollLeft, top: this.__maxScrollTop };
|
|
943
|
-
}
|
|
944
|
-
zoomTo(e, t = !1, n, o, r) {
|
|
945
|
-
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
946
|
-
r && (this.__zoomComplete = r), this.__isDecelerating && (Oe(this.__isDecelerating), this.__isDecelerating = 0);
|
|
947
|
-
const a = this.__zoomLevel;
|
|
948
|
-
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);
|
|
949
|
-
const h = e / a;
|
|
950
|
-
let s = h * (this.__scrollLeft + n) - n, l = h * (this.__scrollTop + o) - o;
|
|
951
|
-
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);
|
|
952
|
-
}
|
|
953
|
-
zoomBy(e, t = !1, n = 0, o = 0, r) {
|
|
954
|
-
this.zoomTo(this.__zoomLevel * e, t, n, o, r);
|
|
955
|
-
}
|
|
956
|
-
scrollTo(e, t, n = !1, o = 1) {
|
|
957
|
-
if (this.__isDecelerating && (Oe(this.__isDecelerating), this.__isDecelerating = 0), o !== void 0 && o !== this.__zoomLevel) {
|
|
958
|
-
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
959
|
-
e *= o, t *= o, this.__computeScrollMax(o);
|
|
960
|
-
} else o = this.__zoomLevel;
|
|
961
|
-
this.options.scrollingX ? this.options.paging ? e = Math.round(e / this.__clientWidth) * this.__clientWidth : this.options.snapping && (e = Math.round(e / this.__snapWidth) * this.__snapWidth) : e = this.__scrollLeft, this.options.scrollingY ? this.options.paging ? t = Math.round(t / this.__clientHeight) * this.__clientHeight : this.options.snapping && (t = Math.round(t / this.__snapHeight) * this.__snapHeight) : t = this.__scrollTop, e = Math.max(Math.min(this.__maxScrollLeft, e), 0), t = Math.max(Math.min(this.__maxScrollTop, t), 0), e === this.__scrollLeft && t === this.__scrollTop && (n = !1), this.__publish(e, t, o, n);
|
|
962
|
-
}
|
|
963
|
-
scrollBy(e = 0, t = 0, n = !1) {
|
|
964
|
-
const o = this.__isAnimating ? this.__scheduledLeft : this.__scrollLeft, r = this.__isAnimating ? this.__scheduledTop : this.__scrollTop;
|
|
965
|
-
this.scrollTo(o + (e || 0), r + (t || 0), n);
|
|
966
|
-
}
|
|
967
|
-
doMouseZoom(e, t, n, o) {
|
|
968
|
-
const r = e > 0 ? 0.97 : 1.03;
|
|
969
|
-
return this.zoomTo(this.__zoomLevel * r, !1, n - this.__clientLeft, o - this.__clientTop);
|
|
970
|
-
}
|
|
971
|
-
doTouchStart(e, t) {
|
|
972
|
-
if (e.length === void 0) throw new Error("Invalid touch list: " + e);
|
|
973
|
-
if (t instanceof Date && (t = t.valueOf()), typeof t != "number") throw new Error("Invalid timestamp value: " + t);
|
|
974
|
-
let n, o;
|
|
975
|
-
this.__interruptedAnimation = !0, this.__isDecelerating && (Oe(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = !0), this.__isAnimating && (Oe(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = !0);
|
|
976
|
-
let r = e.length === 1;
|
|
977
|
-
r ? (n = e[0].pageX, o = e[0].pageY) : (n = Math.abs(e[0].pageX + e[1].pageX) / 2, o = Math.abs(e[0].pageY + e[1].pageY) / 2), this.__initialTouchLeft = n, this.__initialTouchTop = o, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n, this.__lastTouchTop = o, this.__lastTouchMove = t, this.__lastScale = 1, this.__enableScrollX = !r && this.options.scrollingX, this.__enableScrollY = !r && this.options.scrollingY, this.__isTracking = !0, this.__didDecelerationComplete = !1, this.__isDragging = !r, this.__isSingleTouch = r, this.__positions = [];
|
|
978
|
-
}
|
|
979
|
-
doTouchMove(e, t, n = 1) {
|
|
980
|
-
if (e.length === void 0) throw new Error("Invalid touch list: " + e);
|
|
981
|
-
if (t instanceof Date && (t = t.valueOf()), typeof t != "number") throw new Error("Invalid timestamp value: " + t);
|
|
982
|
-
if (!this.__isTracking) return;
|
|
983
|
-
let o, r;
|
|
984
|
-
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);
|
|
985
|
-
let a = this.__positions;
|
|
986
|
-
if (this.__isDragging) {
|
|
987
|
-
let h = o - this.__lastTouchLeft, s = r - this.__lastTouchTop, l = this.__scrollLeft, c = this.__scrollTop, u = this.__zoomLevel;
|
|
988
|
-
if (n !== void 0 && this.options.zooming) {
|
|
989
|
-
let d = u;
|
|
990
|
-
if (u = u / this.__lastScale * n, u = Math.max(Math.min(u, this.options.maxZoom), this.options.minZoom), d !== u) {
|
|
991
|
-
let f = o - this.__clientLeft, _ = r - this.__clientTop;
|
|
992
|
-
l = (f + l) * u / d - f, c = (_ + c) * u / d - _, this.__computeScrollMax(u);
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
if (this.__enableScrollX) {
|
|
996
|
-
l -= h * this.options.speedMultiplier;
|
|
997
|
-
let d = this.__maxScrollLeft;
|
|
998
|
-
(l > d || l < 0) && (this.options.bouncing ? l += h / 2 * this.options.speedMultiplier : l = l > d ? d : 0);
|
|
999
|
-
}
|
|
1000
|
-
if (this.__enableScrollY) {
|
|
1001
|
-
c -= s * this.options.speedMultiplier;
|
|
1002
|
-
const d = this.__maxScrollTop;
|
|
1003
|
-
(c > d || c < 0) && (this.options.bouncing ? c += s / 2 * this.options.speedMultiplier : c = c > d ? d : 0);
|
|
1004
|
-
}
|
|
1005
|
-
a.length > 60 && a.splice(0, 30), a.push(l, c, t), this.__publish(l, c, u);
|
|
1006
|
-
} else {
|
|
1007
|
-
let h = this.options.locking ? 3 : 0, s = 5, l = Math.abs(o - this.__initialTouchLeft), c = Math.abs(r - this.__initialTouchTop);
|
|
1008
|
-
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);
|
|
1009
|
-
}
|
|
1010
|
-
this.__lastTouchLeft = o, this.__lastTouchTop = r, this.__lastTouchMove = t, this.__lastScale = n;
|
|
1011
|
-
}
|
|
1012
|
-
doTouchEnd(e) {
|
|
1013
|
-
if (e instanceof Date && (e = e.valueOf()), typeof e != "number") throw new Error("Invalid timestamp value: " + e);
|
|
1014
|
-
if (this.__isTracking) {
|
|
1015
|
-
if (this.__isTracking = !1, this.__isDragging) if (this.__isDragging = !1, this.__isSingleTouch && this.options.animating && e - this.__lastTouchMove <= 100) {
|
|
1016
|
-
let t = this.__positions, n = t.length - 1, o = n;
|
|
1017
|
-
for (let r = n; r > 0 && t[r] > this.__lastTouchMove - 100; r -= 3) o = r;
|
|
1018
|
-
if (o !== n) {
|
|
1019
|
-
const r = t[n] - t[o], a = this.__scrollLeft - t[o - 2], h = this.__scrollTop - t[o - 1];
|
|
1020
|
-
this.__decelerationVelocityX = a / r * (1e3 / 60), this.__decelerationVelocityY = h / r * (1e3 / 60);
|
|
1021
|
-
const s = this.options.paging || this.options.snapping ? 4 : 1;
|
|
1022
|
-
(Math.abs(this.__decelerationVelocityX) > s || Math.abs(this.__decelerationVelocityY) > s) && this.__startDeceleration(e);
|
|
1023
|
-
} else this.options.scrollingComplete?.();
|
|
1024
|
-
} else e - this.__lastTouchMove > 100 && this.options.scrollingComplete?.();
|
|
1025
|
-
this.__isDecelerating || ((this.__interruptedAnimation || this.__isDragging) && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, !0, this.__zoomLevel)), this.__positions.length = 0;
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
__publish(e, t, n, o = !1) {
|
|
1029
|
-
const r = this.__isAnimating;
|
|
1030
|
-
if (r && (Oe(r), this.__isAnimating = 0), o && this.options.animating) {
|
|
1031
|
-
this.__scheduledLeft = e, this.__scheduledTop = t, this.__scheduledZoom = n;
|
|
1032
|
-
const a = this.__scrollLeft, h = this.__scrollTop, s = this.__zoomLevel, l = e - a, c = t - h, u = n - s, d = function(g, M, P) {
|
|
1033
|
-
P && (this.__scrollLeft = a + l * g, this.__scrollTop = h + c * g, this.__zoomLevel = s + u * g, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
|
|
1034
|
-
}.bind(this), f = function(g) {
|
|
1035
|
-
return this.__isAnimating === g;
|
|
1036
|
-
}.bind(this), _ = function(g, M, P) {
|
|
1037
|
-
M === this.__isAnimating && (this.__isAnimating = !1), (this.__didDecelerationComplete || P) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
1038
|
-
}.bind(this);
|
|
1039
|
-
this.__isAnimating = Bt(d, f, _, this.options.animationDuration, r ? no : oo);
|
|
1040
|
-
} 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));
|
|
1041
|
-
}
|
|
1042
|
-
__computeScrollMax(e = this.__zoomLevel) {
|
|
1043
|
-
this.__maxScrollLeft = Math.max(this.__contentWidth * e - this.__clientWidth, 0), this.__maxScrollTop = Math.max(this.__contentHeight * e - this.__clientHeight, 0);
|
|
1044
|
-
}
|
|
1045
|
-
__startDeceleration(e) {
|
|
1046
|
-
if (this.options.paging) {
|
|
1047
|
-
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;
|
|
1048
|
-
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;
|
|
1049
|
-
} else this.__minDecelerationScrollLeft = 0, this.__minDecelerationScrollTop = 0, this.__maxDecelerationScrollLeft = this.__maxScrollLeft, this.__maxDecelerationScrollTop = this.__maxScrollTop;
|
|
1050
|
-
const t = function(a, h, s) {
|
|
1051
|
-
this.__stepThroughDeceleration(s);
|
|
1052
|
-
}.bind(this), n = this.options.snapping ? 4 : 0.1, o = function() {
|
|
1053
|
-
const a = Math.abs(this.__decelerationVelocityX) >= n || Math.abs(this.__decelerationVelocityY) >= n;
|
|
1054
|
-
return a || (this.__didDecelerationComplete = !0), a;
|
|
1055
|
-
}.bind(this), r = function(a, h, s) {
|
|
1056
|
-
this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
|
|
1057
|
-
}.bind(this);
|
|
1058
|
-
this.__isDecelerating = Bt(t, o, r);
|
|
1059
|
-
}
|
|
1060
|
-
__stepThroughDeceleration(e) {
|
|
1061
|
-
let t = this.__scrollLeft + this.__decelerationVelocityX, n = this.__scrollTop + this.__decelerationVelocityY;
|
|
1062
|
-
if (!this.options.bouncing) {
|
|
1063
|
-
const o = Math.max(Math.min(this.__maxDecelerationScrollLeft, t), this.__minDecelerationScrollLeft);
|
|
1064
|
-
o !== t && (t = o, this.__decelerationVelocityX = 0);
|
|
1065
|
-
const r = Math.max(Math.min(this.__maxDecelerationScrollTop, n), this.__minDecelerationScrollTop);
|
|
1066
|
-
r !== n && (n = r, this.__decelerationVelocityY = 0);
|
|
1067
|
-
}
|
|
1068
|
-
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) {
|
|
1069
|
-
let o = 0, r = 0, a = this.options.penetrationDeceleration, h = this.options.penetrationAcceleration;
|
|
1070
|
-
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);
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
const Ke = (i, e) => C(eo, { ...i, ref: e }), Yo = Object.freeze(Object.defineProperty({ __proto__: null, defaultCreateScrollbar: Ke, getScrollTo: (i, e, t, n, o = 0) => {
|
|
1075
|
-
for (let r = 0; r < t.length; r++) {
|
|
1076
|
-
const a = t[r].getBoundingClientRect();
|
|
1077
|
-
let h = a.left - e, s = h + a.width;
|
|
1078
|
-
if (n) {
|
|
1079
|
-
if (h < i && s >= i) return h;
|
|
1080
|
-
} else if (Math.ceil(s) > Math.ceil(i) + 2) return s;
|
|
1081
|
-
}
|
|
1082
|
-
return o;
|
|
1083
|
-
} }, Symbol.toStringTag, { value: "Module" })), ro = ({ width: i, height: e }) => C("div", { className: "corner", style: { minWidth: `${i}px`, width: `${i}px`, minHeight: `${e}px`, height: `${e}px` } }), so = we(ke((i, e) => {
|
|
1084
|
-
const { children: t, viewport: n, onScrollViewport: o, showHorizontalScrollbar: r = !0, showVerticalScrollbar: a = !0, createScrollCorner: h = ro, createHorizontalScrollbar: s = Ke, createVerticalScrollbar: l = Ke, style: c, touchElement: u, disableTouch: d, ...f } = i, _ = r && s, g = a && l, M = k(o, [o]), P = yt(e, () => ({ isScrollPane: () => !0 }), []), y = O(null);
|
|
1085
|
-
N(() => {
|
|
1086
|
-
y.current && (y.current.__scrollTop === n?.top && y.current.__scrollLeft === n?.left || y.current.__isDecelerating || y.current?.scrollTo(n?.left, n?.top, !1));
|
|
1087
|
-
}, [n?.left, n?.top, u]);
|
|
1088
|
-
const w = V((p, v) => {
|
|
1089
|
-
M?.({ left: p, top: v });
|
|
1090
|
-
}, []), m = V((p) => {
|
|
1091
|
-
y.current?.doTouchStart(p.touches, p.timeStamp);
|
|
1092
|
-
}, []), A = V((p) => {
|
|
1093
|
-
p.preventDefault(), y.current?.doTouchMove(p.touches, p.timeStamp);
|
|
1094
|
-
}, []), S = V((p) => {
|
|
1095
|
-
y.current?.doTouchEnd(p.timeStamp);
|
|
1096
|
-
}, []), T = V(({ containerWidth: p, containerHeight: v, totalWidth: K, totalHeight: G }) => {
|
|
1097
|
-
y.current.setDimensions(p, v, K, G);
|
|
1098
|
-
}, []);
|
|
1099
|
-
N(() => {
|
|
1100
|
-
const p = u ?? P.current;
|
|
1101
|
-
if (!d && mt().supportsTouchEvents && p && n) {
|
|
1102
|
-
if (!y.current) {
|
|
1103
|
-
const v = { scrollingX: !0, scrollingY: !0, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
|
|
1104
|
-
y.current = new io(w, v);
|
|
1105
|
-
}
|
|
1106
|
-
mt().supportsTouchEvents && (p.addEventListener("touchstart", m), p.addEventListener("touchend", S), p.addEventListener("touchmove", A)), T({ containerWidth: n?.width, containerHeight: n?.height, totalWidth: n?.totalWidth, totalHeight: n?.totalHeight });
|
|
1107
|
-
}
|
|
1108
|
-
return () => {
|
|
1109
|
-
p?.removeEventListener("touchstart", m), p?.removeEventListener("touchend", S), p?.removeEventListener("touchmove", A);
|
|
1110
|
-
};
|
|
1111
|
-
}, [n?.width, n?.height, n?.totalWidth, n?.totalHeight, d, u]);
|
|
1112
|
-
const [I, { width: x }] = ve(), [E, { height: z }] = ve(), L = R(() => {
|
|
1113
|
-
if (!g) return null;
|
|
1114
|
-
const p = l({ orientation: ae.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (v) => {
|
|
1115
|
-
M?.({ top: v });
|
|
1116
|
-
} });
|
|
1117
|
-
return C("div", { style: { display: "flex", flex: "0" }, ref: I, children: p });
|
|
1118
|
-
}, [l, n?.top, n?.height, n?.totalHeight]), D = R(() => {
|
|
1119
|
-
if (!_) return null;
|
|
1120
|
-
const p = s({ orientation: ae.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (v) => {
|
|
1121
|
-
M?.({ left: v });
|
|
1122
|
-
} });
|
|
1123
|
-
return Ce("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [C("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${x}px)` }, children: C("div", { ref: E, className: "sizer", children: p }) }), g ? h({ width: x, height: z }) : C(Me, {})] });
|
|
1124
|
-
}, [s, n?.left, n?.width, n?.totalWidth, g, h, x, z]);
|
|
1125
|
-
return C("div", { style: { position: "relative", display: "flex", minWidth: g ? `${x}px` : void 0, minHeight: _ ? `${z}px` : void 0, ...c }, ...f, ref: P, children: Ce("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [Ce("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [C("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: t }), g ? L : C(Me, {})] }), _ ? D : C(Me, {})] }) });
|
|
1126
|
-
}));
|
|
1127
|
-
so.displayName = "ScrollPane";
|
|
1128
|
-
const lo = 300, ao = 100, co = 1e6, ho = 100, uo = 50, po = we(ke((i, e) => {
|
|
1129
|
-
const { offset: t = 0, viewportSize: n = 0, totalSize: o = 0, minSize: r = 0, endGap: a = lo, endScrollIncrement: h = ao, style: s = qt, onMouseDown: l, onScrollOffset: c, onScroll: u, scaleLimit: d = co, scaleFactor: f = ho, precisionFactor: _ = uo, createScrollbar: g = Ke, ...M } = i;
|
|
1130
|
-
u && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
|
|
1131
|
-
const P = k(l, [l]), [y, w] = F(!1), m = R(() => {
|
|
1132
|
-
const x = d === 0 ? o : Math.min(o ?? 0, Math.max(r ?? 0, (t ?? 0) + (n ?? 0)) + (a ?? 0)), E = d !== 0 && x > d ? f : 1, z = E / _, L = Math.ceil(x / E);
|
|
1133
|
-
return { offset: Math.ceil(t / E), totalSize: L, viewportSize: Math.ceil(n / E), scaledOffset: t, scaledTotalSize: o, scaledViewportSize: n, factor: E, precision: z };
|
|
1134
|
-
}, [t, o, n, y, r, a, h]), A = k((x, E, z) => {
|
|
1135
|
-
const L = m.offset;
|
|
1136
|
-
Math.abs(x - L) < m.precision && (x = L), c?.(x * m.factor, L, m.viewportSize);
|
|
1137
|
-
}, [c, m]), S = V((x) => {
|
|
1138
|
-
}, []), T = V((x) => {
|
|
1139
|
-
document.removeEventListener("mousemove", S), document.removeEventListener("mouseup", T), w(!1);
|
|
1140
|
-
}, []), I = V((x) => {
|
|
1141
|
-
w(!0), P?.(x), document.addEventListener("mousemove", S, { passive: !0 }), document.addEventListener("mouseup", T, { passive: !0 });
|
|
1142
|
-
}, [S, T]);
|
|
1143
|
-
return Ke({ style: s, ...M, offset: m.offset, totalSize: m.totalSize, viewportSize: m.viewportSize, onMouseDown: I, onScrollOffset: A }, e);
|
|
1144
|
-
}));
|
|
1145
|
-
po.displayName = "VirtualScrollbar";
|
|
1146
|
-
const Go = { 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" }, Zo = we(ke((i, e) => {
|
|
1147
|
-
const { refFocusStart: t, ...n } = i, o = O(null), r = V(() => {
|
|
1148
|
-
if (t) return void t?.current?.focus();
|
|
1149
|
-
const a = o.current.parentElement.children;
|
|
1150
|
-
let h = [];
|
|
1151
|
-
const s = a.length;
|
|
1152
|
-
for (let l = 0; l < s && a[l] !== o.current; l++) {
|
|
1153
|
-
const c = a[l], u = c.getAttribute("tabindex");
|
|
1154
|
-
u == null || u === "-1" || c.getAttribute("disabled") !== "true" && c.focus && h.push({ tabindex: parseInt(u), child: c });
|
|
1155
|
-
}
|
|
1156
|
-
h.length !== 0 && (h.sort(function(l, c) {
|
|
1157
|
-
return l.tabindex - c.tabindex;
|
|
1158
|
-
}), h[0].child.focus());
|
|
1159
|
-
}, [t]);
|
|
1160
|
-
return C("div", { tabIndex: 0, ref: $e([o, e]), onFocus: r, ...n });
|
|
1161
|
-
})), qo = we(ke((i, e) => {
|
|
1162
|
-
const { className: t, style: n, children: o, radius: r = 4, strokeWidth: a = 1, strokeColor: h = "grey", ...s } = i, [l, { width: c, height: u }] = ve(), d = O(null), f = (P, y = 0) => {
|
|
1163
|
-
const w = P / 2, m = u - w + y;
|
|
1164
|
-
return (function(A, S, T = !1) {
|
|
1165
|
-
if (S === 0) return A;
|
|
1166
|
-
function I(p, v, K) {
|
|
1167
|
-
let G = v.x - p.x, j = v.y - p.y, Q = Math.sqrt(G * G + j * j);
|
|
1168
|
-
return x(p, v, Math.min(1, K / Q));
|
|
1169
|
-
}
|
|
1170
|
-
function x(p, v, K) {
|
|
1171
|
-
return { x: p.x + (v.x - p.x) * K, y: p.y + (v.y - p.y) * K };
|
|
1172
|
-
}
|
|
1173
|
-
function E(p, v) {
|
|
1174
|
-
p.length > 2 && (p[p.length - 2] = v.x, p[p.length - 1] = v.y);
|
|
1175
|
-
}
|
|
1176
|
-
function z(p) {
|
|
1177
|
-
return { x: parseFloat(p[p.length - 2]), y: parseFloat(p[p.length - 1]) };
|
|
1178
|
-
}
|
|
1179
|
-
let L = A.split(/[,\s]/).reduce(function(p, v) {
|
|
1180
|
-
let K = v.match("([a-zA-Z])(.+)");
|
|
1181
|
-
return K ? (p.push(K[1]), p.push(K[2])) : p.push(v), p;
|
|
1182
|
-
}, []).reduce(function(p, v) {
|
|
1183
|
-
return parseFloat(v) == v && p.length ? p[p.length - 1].push(v) : p.push([v]), p;
|
|
1184
|
-
}, []), D = [];
|
|
1185
|
-
if (L.length > 1) {
|
|
1186
|
-
let p = z(L[0]), v = null;
|
|
1187
|
-
L[L.length - 1][0] === "Z" && L[0].length > 2 && (v = ["L", p.x, p.y], L[L.length - 1] = v), D.push(L[0]);
|
|
1188
|
-
for (let K = 1; K < L.length; K++) {
|
|
1189
|
-
let G = D[D.length - 1], j = L[K], Q = j === v ? L[1] : L[K + 1];
|
|
1190
|
-
if (Q && G && G.length > 2 && j[0] === "L" && Q.length > 2 && Q[0] === "L") {
|
|
1191
|
-
let Z, W, oe = z(G), J = z(j), be = z(Q);
|
|
1192
|
-
T ? (Z = x(J, G.origPoint || oe, S), W = x(J, Q.origPoint || be, S)) : (Z = I(J, oe, S), W = I(J, be, S)), E(j, Z), j.origPoint = J, D.push(j);
|
|
1193
|
-
let xe = x(Z, J, 0.5), Se = x(J, W, 0.5), pe = ["C", xe.x, xe.y, Se.x, Se.y, W.x, W.y];
|
|
1194
|
-
pe.origPoint = J, D.push(pe);
|
|
1195
|
-
} else D.push(j);
|
|
1196
|
-
}
|
|
1197
|
-
if (v) {
|
|
1198
|
-
let K = z(D[D.length - 1]);
|
|
1199
|
-
D.push(["Z"]), E(D[0], K);
|
|
1200
|
-
}
|
|
1201
|
-
} else D = L;
|
|
1202
|
-
return D.reduce(function(p, v) {
|
|
1203
|
-
return p + v.join(" ") + " ";
|
|
1204
|
-
}, "");
|
|
1205
|
-
})(`${`M 0 ${w} L ${r - 0.5} ${w} L ${r - 0.5} ${m} L ${2 * r} ${m}`} ${`L ${c - 2 * r} ${m}`} ${`M ${c - 2 * r} ${m} L ${c - r} ${m} L ${c - r} ${w} L ${c} ${w}`}`, r);
|
|
1206
|
-
}, _ = R(() => f(a), [c, u, r, a]), g = R(() => {
|
|
1207
|
-
if (r === 0) return;
|
|
1208
|
-
const P = r / 2;
|
|
1209
|
-
return f(r) + `L ${c} 0 L 0 0 L 0 ${P}`;
|
|
1210
|
-
}, [_, r, a]), M = R(() => ({ style: { clipPath: `path('${g}')` } }), [g]);
|
|
1211
|
-
return Ce("div", { className: t, style: { display: "flex", flexDirection: "row", ...n }, ...s, ref: $e([d, l, e]), children: [re.isValidElement(o) ? re.cloneElement(o, M) : C(Me, {}), C("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: c, height: u, viewBox: `0 0 ${c} ${u}`, children: C("path", { d: _, stroke: h, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: a }) })] });
|
|
1212
|
-
}));
|
|
1213
|
-
class fo extends mn {
|
|
842
|
+
class Zn extends vn {
|
|
1214
843
|
static getDerivedStateFromError() {
|
|
1215
844
|
return { hasError: !0 };
|
|
1216
845
|
}
|
|
1217
|
-
componentDidCatch(
|
|
1218
|
-
this.props.onError?.(
|
|
846
|
+
componentDidCatch(t) {
|
|
847
|
+
this.props.onError?.(t);
|
|
1219
848
|
}
|
|
1220
849
|
render() {
|
|
1221
850
|
return this.props.children;
|
|
1222
851
|
}
|
|
1223
852
|
}
|
|
1224
|
-
const
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1227
|
-
}, [
|
|
1228
|
-
return
|
|
853
|
+
const ei = ({ children: o }) => {
|
|
854
|
+
const t = Jt(), e = W((n) => {
|
|
855
|
+
t.showError(n);
|
|
856
|
+
}, [t]);
|
|
857
|
+
return T(Zn, { onError: e, children: o });
|
|
1229
858
|
};
|
|
1230
|
-
class
|
|
1231
|
-
constructor(
|
|
1232
|
-
this.notifier =
|
|
1233
|
-
const n =
|
|
859
|
+
class qn {
|
|
860
|
+
constructor(t) {
|
|
861
|
+
this.notifier = t, this.handleUnhandledRejection = (e) => {
|
|
862
|
+
const n = e.reason;
|
|
1234
863
|
n instanceof DOMException && n.name === "AbortError" || this.notifier.showError(n);
|
|
1235
|
-
}, this.handleGlobalError = (
|
|
1236
|
-
this.notifier.showError(
|
|
864
|
+
}, this.handleGlobalError = (e) => {
|
|
865
|
+
this.notifier.showError(e.error);
|
|
1237
866
|
}, this.setupGlobalHandlers();
|
|
1238
867
|
}
|
|
1239
868
|
setupGlobalHandlers() {
|
|
@@ -1243,396 +872,896 @@ class mo {
|
|
|
1243
872
|
window.removeEventListener("unhandledrejection", this.handleUnhandledRejection), window.removeEventListener("error", this.handleGlobalError);
|
|
1244
873
|
}
|
|
1245
874
|
}
|
|
1246
|
-
const
|
|
1247
|
-
const
|
|
1248
|
-
return
|
|
1249
|
-
const
|
|
875
|
+
const ni = ({ children: o }) => {
|
|
876
|
+
const t = Jt();
|
|
877
|
+
return $(() => {
|
|
878
|
+
const e = new qn(t);
|
|
1250
879
|
return () => {
|
|
1251
|
-
|
|
880
|
+
e.cleanup();
|
|
1252
881
|
};
|
|
1253
|
-
}, [
|
|
1254
|
-
},
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
if (
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
882
|
+
}, [t]), T(Ct, { children: o });
|
|
883
|
+
}, oi = () => null;
|
|
884
|
+
function nn(o) {
|
|
885
|
+
var t, e, n = "";
|
|
886
|
+
if (typeof o == "string" || typeof o == "number") n += o;
|
|
887
|
+
else if (typeof o == "object") if (Array.isArray(o)) {
|
|
888
|
+
var i = o.length;
|
|
889
|
+
for (t = 0; t < i; t++) o[t] && (e = nn(o[t])) && (n && (n += " "), n += e);
|
|
890
|
+
} else for (e in o) o[e] && (n && (n += " "), n += e);
|
|
891
|
+
return n;
|
|
892
|
+
}
|
|
893
|
+
function lt() {
|
|
894
|
+
for (var o, t, e = 0, n = "", i = arguments.length; e < i; e++) (o = arguments[e]) && (t = nn(o)) && (n && (n += " "), n += t);
|
|
895
|
+
return n;
|
|
896
|
+
}
|
|
897
|
+
const Jn = {}, Qn = (o) => {
|
|
898
|
+
const { onPointerDown: t, style: e, splitDirection: n, paddingBefore: i = 0, paddingAfter: r = 0, disabled: c, key: u, hitAreaProps: l = Jn, ...s } = o, a = n === "row", { style: h, className: d, ...f } = l;
|
|
899
|
+
return T("div", { style: { ...e, position: "relative" }, ...s, children: T("div", { className: lt("hit-box", d), style: { left: (a ? -i : 0) + "px", width: `calc(100% + ${a ? i + r : 0}px)`, top: (a ? 0 : -i) + "px", height: `calc(100% + ${a ? 0 : i + r}px)`, position: "absolute", ...h }, onPointerDown: c ? void 0 : t, ...f }) }, u);
|
|
900
|
+
}, jt = {}, gt = (o, t, e = !0) => o === null ? null : o.pixels !== null ? e ? o.pixels : t - o.pixels : (e ? o.percent : 100 - o.percent) / 100 * t, Ut = (o, t = !0) => o?.percent ? `${t ? o.percent : 100 - o.percent}%` : o?.pixels ? `${o.pixels}px` : void 0, ht = (o, t) => {
|
|
901
|
+
if (o == null) return null;
|
|
902
|
+
const e = { percent: null, pixels: null };
|
|
903
|
+
let n = t;
|
|
904
|
+
return typeof o == "string" && ((o = o.trim().toLowerCase()).endsWith("px") ? (o = o.substring(0, o.length - 2), n = !1) : o.endsWith("%") && (o = o.substring(0, o.length - 1), n = !0), o = parseFloat(o)), n ? e.percent = o : e.pixels = o, Object.freeze(e);
|
|
905
|
+
}, to = wt(kt((o, t) => {
|
|
906
|
+
const { elementBefore: e, elementAfter: n, splitDirection: i = "row", fixedPane: r = null, position: c, onPositionChange: u, minBefore: l, maxBefore: s, minAfter: a, maxAfter: h, children: d, className: f, style: _, disabled: p = !1, onDragStart: b, onDragResize: M, onDragFinish: m, resizerProps: v = jt, paneProps: y = jt, paneBeforeProps: A = jt, paneAfterProps: E = jt, createResizer: k = Qn } = o;
|
|
1264
907
|
if (d) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
1265
|
-
const
|
|
908
|
+
const H = I(() => rt.isValidElement(n) && rt.isValidElement(e), [n, e]), S = I(() => {
|
|
1266
909
|
let B = null;
|
|
1267
910
|
r && (r === "before" ? B = 0 : r === "after" && (B = 1));
|
|
1268
|
-
const
|
|
1269
|
-
return { fixedPaneOffset: B, isPercent:
|
|
1270
|
-
}, [
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
}, [
|
|
1274
|
-
const [D, { width:
|
|
1275
|
-
const
|
|
1276
|
-
if (B || (B = { percent: X.fixedPaneOffset === null ? 50 : null, pixels: X.fixedPaneOffset === null ? null : 0 }),
|
|
1277
|
-
let
|
|
1278
|
-
|
|
1279
|
-
const
|
|
1280
|
-
return
|
|
1281
|
-
})(z, Z,
|
|
1282
|
-
const
|
|
1283
|
-
|
|
1284
|
-
}, [r]),
|
|
1285
|
-
if (
|
|
1286
|
-
const
|
|
1287
|
-
let
|
|
1288
|
-
|
|
1289
|
-
}, [
|
|
1290
|
-
if (document.removeEventListener("pointermove",
|
|
1291
|
-
if (
|
|
1292
|
-
const
|
|
1293
|
-
|
|
911
|
+
const N = B === null;
|
|
912
|
+
return { fixedPaneOffset: B, isPercent: N, minBefore: ht(l, N), maxBefore: ht(s, N), minAfter: ht(a, N), maxAfter: ht(h, N) };
|
|
913
|
+
}, [l, s, a, h]), L = P(u, [u]), [z, C] = V(() => ht(c, r === null));
|
|
914
|
+
$(() => {
|
|
915
|
+
C(ht(c, r === null));
|
|
916
|
+
}, [c, r]);
|
|
917
|
+
const [D, { width: g, height: w }] = vt(), [R, { width: G, height: j }] = vt(), J = i === "row" ? G : j, Z = i === "row" ? g : w, F = I(() => ((B, N, tt, X) => {
|
|
918
|
+
const ct = [null, null], it = [null, null];
|
|
919
|
+
if (B || (B = { percent: X.fixedPaneOffset === null ? 50 : null, pixels: X.fixedPaneOffset === null ? null : 0 }), N === 0) return B?.pixels != null ? X.fixedPaneOffset !== 1 ? (ct[0] = B?.pixels, it[1] = 100) : (ct[1] = B?.pixels - tt, it[0] = 100) : B?.percent != null && (X.fixedPaneOffset !== 1 ? (it[0] = B?.percent, it[1] = 100 - B?.percent) : (it[1] = B?.percent, it[0] = 100 - B?.percent)), { percents: it, pixels: ct, minBefore: Ut(X.minBefore, !0), maxBefore: Ut(X.maxBefore, !0), minAfter: Ut(X.minAfter), maxAfter: Ut(X.maxAfter) };
|
|
920
|
+
let ut = gt(B, N, X.fixedPaneOffset !== 1), nt = N - tt, xe = gt(X.minBefore, nt, !0) ?? 0, pn = gt(X.maxBefore, nt, !0) ?? nt, Ft = 0, ne = 0, Se = 0, Ee = nt;
|
|
921
|
+
Ft = (gt(X.maxAfter, N, !1) ?? tt) - tt, ne = gt(X.minAfter, N, !1) ?? N, Se = Math.max(xe, Ft), Ee = Math.min(pn, ne), ut = Math.max(Se, Math.min(ut, Ee)), ne = Math.min(nt - ut, gt(X.maxAfter, nt - ut, !0) ?? nt), Ft = Math.min(nt - ut, gt(X.minAfter, nt - ut, !0) ?? nt), ct[0] = ut, ct[1] = nt - ct[0];
|
|
922
|
+
const fn = Math.max(0, Math.min(100, ut / nt * 100));
|
|
923
|
+
return it[0] = fn, it[1] = 100 - it[0], { percents: it, pixels: ct, minBefore: `${xe}px`, minAfter: `${Ft}px`, maxBefore: `${ct[0]}px`, maxAfter: `${ct[1]}px` };
|
|
924
|
+
})(z, Z, J, S), [S, z, Z, J, i]), [ot, Q] = V(!1), bt = P(b, [b]), xt = P(M, [M]), St = P(m, [m]), pt = O(null), Kt = O(null), Rt = O(null), { style: Nt, className: Pt, ...ft } = y, Et = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...Nt }, { className: st, style: Dt, ...Qt } = A, { className: te, style: At, ...x } = E, K = { flex: "1 1 100%", width: "100%", ..._, flexDirection: i, display: "flex" }, { className: U, style: mt, onPointerDown: _t, ...zt } = v, ee = P((B) => {
|
|
925
|
+
const N = ht(B, r === null);
|
|
926
|
+
C(N);
|
|
927
|
+
}, [r]), Ht = P((B) => {
|
|
928
|
+
if (p || !ot) return;
|
|
929
|
+
const N = be.current?.getBoundingClientRect();
|
|
930
|
+
let tt = 0;
|
|
931
|
+
tt = i === "row" ? (B.clientX ?? B.touches?.[0]?.clientX) - N.x : (B.clientY ?? B.touches?.[0]?.clientY) - N.y, tt = Math.max(0, Math.min(Z, tt)), S.fixedPaneOffset === 1 && (tt = Z - tt), c && z.pixels === tt || C({ pixels: tt, percent: null }), xt?.(tt), B.stopPropagation(), B.preventDefault();
|
|
932
|
+
}, [S, i, p, ot, z, Z]), we = P((B) => {
|
|
933
|
+
if (document.removeEventListener("pointermove", Ht), document.removeEventListener("touchmove", Ht), document.removeEventListener("pointerup", we), !!ot && (Q(!1), !!z)) {
|
|
934
|
+
if (St(z.pixels), !ht(c, r === null) || z.pixels !== c) {
|
|
935
|
+
const N = { ...z };
|
|
936
|
+
N.percent === null && (N.percent = N.pixels / Z * 100), L(N);
|
|
1294
937
|
}
|
|
1295
938
|
B.stopPropagation(), B.preventDefault();
|
|
1296
939
|
}
|
|
1297
|
-
}, [z,
|
|
1298
|
-
|
|
1299
|
-
}, [
|
|
1300
|
-
if (!
|
|
1301
|
-
const B = { ...
|
|
1302
|
-
return
|
|
1303
|
-
}, [
|
|
940
|
+
}, [z, ot, c, r, Z]), cn = P((B) => {
|
|
941
|
+
_t?.(B), B.defaultPrevented || p || ot || (Q(!0), bt(), document.addEventListener("pointermove", Ht, { passive: !1 }), document.addEventListener("touchmove", Ht, { passive: !1 }), document.addEventListener("pointerup", we, { passive: !1 }));
|
|
942
|
+
}, [_t]), be = ve(t, () => ({ setPosition: ee, isSplitPane: () => !0 }), []), un = I(() => H ? k?.({ key: "resizer", ref: It([R, Kt]), className: lt("resizer", U), onPointerDownCapture: cn, style: { cursor: p ? void 0 : i === "row" ? "ew-resize" : "ns-resize", minWidth: i === "row" ? "2px" : void 0, minHeight: i !== "row" ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...mt }, splitDirection: i, disabled: p, ...zt }) : null, [H, U, zt, i, mt, p]), Wt = i === "row" ? "Width" : "Height", hn = I(() => {
|
|
943
|
+
if (!e) return null;
|
|
944
|
+
const B = { ...Et, ...Dt, flex: S.fixedPaneOffset === 0 && F?.pixels[0] !== null ? `0 0 ${Math.round(F?.pixels[0])}px` : `1 1 ${Math.round(F?.percents[0] ?? 100)}%`, [`min${Wt}`]: F?.minBefore, [`max${Wt}`]: n ? F?.maxBefore : "100%" };
|
|
945
|
+
return T("div", { ref: pt, className: lt("before", Pt, st), style: B, ...ft, ...Qt, children: e }, "before");
|
|
946
|
+
}, [e, y, A, S, F]), dn = I(() => {
|
|
1304
947
|
if (!n) return null;
|
|
1305
|
-
const B = { ...
|
|
1306
|
-
return
|
|
1307
|
-
}, [n,
|
|
1308
|
-
return
|
|
948
|
+
const B = { ...Et, ...At, flex: S.fixedPaneOffset === 1 && F?.pixels[1] !== null ? `0 0 ${Math.round(F?.pixels[1])}px` : `1 1 ${Math.round(F?.percents[1] ?? 100)}%`, [`min${Wt}`]: F?.minAfter, [`max${Wt}`]: e ? F?.maxAfter : "100%" };
|
|
949
|
+
return T("div", { ref: Rt, className: lt("after", Pt, te), style: B, ...ft, ...x, children: n }, "after");
|
|
950
|
+
}, [n, y, E, S, F]);
|
|
951
|
+
return Mt("div", { ref: It([D, be]), className: lt("splitPane", i === "row" ? "vertical" : "horizontal", { dragging: ot }, f), style: K, children: [hn, un, dn] });
|
|
1309
952
|
}));
|
|
1310
|
-
function
|
|
1311
|
-
if (typeof
|
|
1312
|
-
if (typeof
|
|
1313
|
-
const
|
|
1314
|
-
if (
|
|
1315
|
-
const
|
|
1316
|
-
const
|
|
1317
|
-
if (!
|
|
1318
|
-
const r =
|
|
953
|
+
function eo(o) {
|
|
954
|
+
if (typeof o == "function") return o;
|
|
955
|
+
if (typeof o == "string") {
|
|
956
|
+
const t = o.trim();
|
|
957
|
+
if (t.startsWith("data:image/svg+xml")) {
|
|
958
|
+
const e = (function(n) {
|
|
959
|
+
const i = /^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());
|
|
960
|
+
if (!i) return null;
|
|
961
|
+
const r = i[1] || "", c = i[2] || "";
|
|
1319
962
|
try {
|
|
1320
963
|
if (/;base64/i.test(r)) {
|
|
1321
964
|
if (typeof atob < "u") {
|
|
1322
|
-
const
|
|
965
|
+
const u = atob(c), l = u.length;
|
|
1323
966
|
if (typeof TextDecoder < "u") {
|
|
1324
|
-
const
|
|
1325
|
-
for (let
|
|
1326
|
-
return new TextDecoder("utf-8").decode(
|
|
967
|
+
const a = new Uint8Array(l);
|
|
968
|
+
for (let h = 0; h < l; h++) a[h] = u.charCodeAt(h);
|
|
969
|
+
return new TextDecoder("utf-8").decode(a);
|
|
1327
970
|
}
|
|
1328
|
-
let
|
|
1329
|
-
for (let
|
|
1330
|
-
|
|
1331
|
-
return decodeURIComponent(
|
|
971
|
+
let s = "";
|
|
972
|
+
for (let a = 0; a < l; a++)
|
|
973
|
+
s += `%${u.charCodeAt(a).toString(16).padStart(2, "0")}`;
|
|
974
|
+
return decodeURIComponent(s);
|
|
1332
975
|
}
|
|
1333
|
-
return (globalThis.Buffer ? globalThis.Buffer.from(
|
|
976
|
+
return (globalThis.Buffer ? globalThis.Buffer.from(c, "base64") : require("buffer").Buffer.from(c, "base64")).toString("utf-8");
|
|
1334
977
|
}
|
|
1335
978
|
try {
|
|
1336
|
-
return decodeURIComponent(
|
|
979
|
+
return decodeURIComponent(c);
|
|
1337
980
|
} catch {
|
|
1338
|
-
return
|
|
981
|
+
return c;
|
|
1339
982
|
}
|
|
1340
983
|
} catch {
|
|
1341
984
|
return null;
|
|
1342
985
|
}
|
|
1343
|
-
})(
|
|
1344
|
-
if (
|
|
986
|
+
})(t);
|
|
987
|
+
if (e) return Oe(e);
|
|
1345
988
|
}
|
|
1346
|
-
if (
|
|
1347
|
-
if (/^<\s*svg\b/i.test(
|
|
1348
|
-
if (/^<\s*path\b/i.test(
|
|
1349
|
-
const
|
|
1350
|
-
if (
|
|
989
|
+
if (t.startsWith("<")) {
|
|
990
|
+
if (/^<\s*svg\b/i.test(t)) return Oe(t);
|
|
991
|
+
if (/^<\s*path\b/i.test(t)) {
|
|
992
|
+
const e = ze(t);
|
|
993
|
+
if (e) return { paths: [{ d: e }] };
|
|
1351
994
|
}
|
|
1352
|
-
return { paths: [{ d:
|
|
995
|
+
return { paths: [{ d: t }] };
|
|
1353
996
|
}
|
|
1354
|
-
return { paths: [{ d:
|
|
997
|
+
return { paths: [{ d: t }] };
|
|
1355
998
|
}
|
|
1356
|
-
if (Array.isArray(
|
|
1357
|
-
const
|
|
1358
|
-
for (const
|
|
1359
|
-
const n = String(
|
|
999
|
+
if (Array.isArray(o)) {
|
|
1000
|
+
const t = [];
|
|
1001
|
+
for (const e of o) if (typeof e == "string") {
|
|
1002
|
+
const n = String(e).trim();
|
|
1360
1003
|
if (n.startsWith("<path")) {
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1363
|
-
} else
|
|
1364
|
-
} else
|
|
1365
|
-
return { paths:
|
|
1004
|
+
const i = ze(n);
|
|
1005
|
+
i && t.push({ d: i });
|
|
1006
|
+
} else t.push({ d: n });
|
|
1007
|
+
} else e && typeof e == "object" && "d" in e && typeof e.d == "string" && t.push({ ...e });
|
|
1008
|
+
return { paths: t };
|
|
1366
1009
|
}
|
|
1367
|
-
return
|
|
1010
|
+
return o;
|
|
1368
1011
|
}
|
|
1369
|
-
function
|
|
1370
|
-
const
|
|
1371
|
-
return
|
|
1012
|
+
function ze(o) {
|
|
1013
|
+
const t = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(o);
|
|
1014
|
+
return t ? t[1] ?? t[2] ?? null : null;
|
|
1372
1015
|
}
|
|
1373
|
-
function
|
|
1374
|
-
if ("svg" in
|
|
1375
|
-
if ("url" in
|
|
1376
|
-
const
|
|
1377
|
-
return { ...
|
|
1016
|
+
function Be(o) {
|
|
1017
|
+
if ("svg" in o) return { ...o, svg: eo(o.svg) };
|
|
1018
|
+
if ("url" in o) {
|
|
1019
|
+
const t = typeof o.url == "string" ? { src: o.url } : o.url;
|
|
1020
|
+
return { ...o, url: t };
|
|
1378
1021
|
}
|
|
1379
|
-
if ("emoji" in
|
|
1380
|
-
const
|
|
1381
|
-
return { ...
|
|
1022
|
+
if ("emoji" in o) {
|
|
1023
|
+
const t = typeof o.emoji == "string" ? o.emoji : o.emoji.text;
|
|
1024
|
+
return { ...o, emoji: t };
|
|
1382
1025
|
}
|
|
1383
|
-
return
|
|
1026
|
+
return o;
|
|
1384
1027
|
}
|
|
1385
|
-
function
|
|
1028
|
+
function Oe(o) {
|
|
1386
1029
|
try {
|
|
1387
1030
|
if (typeof DOMParser < "u") {
|
|
1388
|
-
const
|
|
1389
|
-
return
|
|
1390
|
-
const
|
|
1391
|
-
if (!
|
|
1392
|
-
const d = { d:
|
|
1031
|
+
const c = new DOMParser().parseFromString(o, "image/svg+xml"), u = c.querySelector("svg"), l = u?.getAttribute("viewBox") ?? void 0, s = [];
|
|
1032
|
+
return c.querySelectorAll("path").forEach((a) => {
|
|
1033
|
+
const h = a.getAttribute("d");
|
|
1034
|
+
if (!h) return;
|
|
1035
|
+
const d = { d: h }, f = a.getAttribute("class");
|
|
1393
1036
|
f && (d.className = f);
|
|
1394
|
-
const _ =
|
|
1037
|
+
const _ = a.getAttribute("fill");
|
|
1395
1038
|
_ && _ !== "none" && (d.fill = _);
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1402
|
-
const
|
|
1403
|
-
|
|
1404
|
-
}), { viewBox:
|
|
1039
|
+
const p = a.getAttribute("stroke");
|
|
1040
|
+
p && (d.stroke = p);
|
|
1041
|
+
const b = a.getAttribute("opacity");
|
|
1042
|
+
b && (d.opacity = Number(b));
|
|
1043
|
+
const M = a.getAttribute("fill-rule");
|
|
1044
|
+
M && (d.fillRule = M);
|
|
1045
|
+
const m = a.getAttribute("clip-rule");
|
|
1046
|
+
m && (d.clipRule = m), s.push(d);
|
|
1047
|
+
}), { viewBox: l, paths: s };
|
|
1405
1048
|
}
|
|
1406
1049
|
} catch {
|
|
1407
1050
|
}
|
|
1408
|
-
const
|
|
1051
|
+
const t = o.match(/viewBox="([^"]+)"/i), e = t ? t[1] : void 0, n = [], i = /<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;
|
|
1409
1052
|
let r;
|
|
1410
|
-
for (; r =
|
|
1411
|
-
return { viewBox:
|
|
1053
|
+
for (; r = i.exec(o); ) n.push({ d: r[1] });
|
|
1054
|
+
return { viewBox: e, paths: n };
|
|
1412
1055
|
}
|
|
1413
|
-
function
|
|
1414
|
-
const
|
|
1415
|
-
for (const [r,
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1418
|
-
const n = { meta:
|
|
1419
|
-
if (
|
|
1056
|
+
function Ie(o) {
|
|
1057
|
+
const t = {};
|
|
1058
|
+
for (const [r, c] of Object.entries(o.icons)) t[r] = Be(c);
|
|
1059
|
+
const e = { label: o.meta?.label ?? "Unnamed", version: o.meta?.version ?? "1.0.0", license: o.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: o.meta?.extends ?? [] };
|
|
1060
|
+
e.extends.includes("base") || e.extends.push("base");
|
|
1061
|
+
const n = { meta: e, icons: t }, i = o.overrides;
|
|
1062
|
+
if (i) {
|
|
1420
1063
|
const r = {};
|
|
1421
|
-
for (const [
|
|
1422
|
-
const
|
|
1423
|
-
for (const [
|
|
1424
|
-
r[
|
|
1064
|
+
for (const [c, u] of Object.entries(i)) {
|
|
1065
|
+
const l = {};
|
|
1066
|
+
for (const [s, a] of Object.entries(u)) l[s] = Be(a);
|
|
1067
|
+
r[c] = l;
|
|
1425
1068
|
}
|
|
1426
1069
|
n.__overrides = r;
|
|
1427
1070
|
}
|
|
1428
1071
|
return n;
|
|
1429
1072
|
}
|
|
1430
|
-
function
|
|
1431
|
-
const
|
|
1432
|
-
let
|
|
1433
|
-
async function
|
|
1434
|
-
const
|
|
1435
|
-
if (!
|
|
1436
|
-
if (!
|
|
1437
|
-
if (!
|
|
1438
|
-
if (!
|
|
1439
|
-
|
|
1440
|
-
const
|
|
1441
|
-
|
|
1442
|
-
}).catch((
|
|
1443
|
-
throw
|
|
1073
|
+
function no() {
|
|
1074
|
+
const o = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
1075
|
+
let e = "base", n = /* @__PURE__ */ new Map();
|
|
1076
|
+
async function i(l) {
|
|
1077
|
+
const s = o.get(l ?? e);
|
|
1078
|
+
if (!s) throw new Error(`Icon pack not registered: ${l}`);
|
|
1079
|
+
if (!s.pack) {
|
|
1080
|
+
if (!s.loading) {
|
|
1081
|
+
if (!s.loader) throw new Error(`No loader for icon pack: ${l}`);
|
|
1082
|
+
s.loading = s.loader().then((a) => {
|
|
1083
|
+
const h = a && typeof a == "object" && "default" in a ? a.default : a;
|
|
1084
|
+
s.pack = Ie(h);
|
|
1085
|
+
}).catch((a) => {
|
|
1086
|
+
throw s.loading = void 0, a;
|
|
1444
1087
|
});
|
|
1445
1088
|
}
|
|
1446
|
-
await
|
|
1089
|
+
await s.loading;
|
|
1447
1090
|
}
|
|
1448
1091
|
}
|
|
1449
|
-
function r(
|
|
1450
|
-
const
|
|
1451
|
-
return
|
|
1092
|
+
function r(l) {
|
|
1093
|
+
const s = l.indexOf(":");
|
|
1094
|
+
return s > 0 ? { ns: l.slice(0, s), key: l.slice(s + 1) } : { key: l };
|
|
1452
1095
|
}
|
|
1453
|
-
function
|
|
1454
|
-
const
|
|
1455
|
-
for (const
|
|
1456
|
-
const d =
|
|
1096
|
+
function c(l, s) {
|
|
1097
|
+
const a = [l, ...o.get(l)?.pack?.meta.extends ?? []];
|
|
1098
|
+
for (const h of a) {
|
|
1099
|
+
const d = o.get(h);
|
|
1457
1100
|
if (!d?.pack) continue;
|
|
1458
|
-
const { icons: f } = d.pack, _ = f[
|
|
1459
|
-
if (_) return { glyph: _, pack: d.pack, packKey:
|
|
1101
|
+
const { icons: f } = d.pack, _ = f[t.get(h)?.get(s) ?? s] ?? f[s];
|
|
1102
|
+
if (_) return { glyph: _, pack: d.pack, packKey: h };
|
|
1460
1103
|
}
|
|
1461
1104
|
return null;
|
|
1462
1105
|
}
|
|
1463
|
-
function
|
|
1464
|
-
const
|
|
1465
|
-
if (
|
|
1466
|
-
if (!
|
|
1467
|
-
const { ns:
|
|
1468
|
-
if (
|
|
1469
|
-
const f =
|
|
1106
|
+
function u(l, s) {
|
|
1107
|
+
const a = s?.packKey ?? e;
|
|
1108
|
+
if (s?.packKey) return c(s.packKey, l);
|
|
1109
|
+
if (!l) return null;
|
|
1110
|
+
const { ns: h, key: d } = r(l);
|
|
1111
|
+
if (h) {
|
|
1112
|
+
const f = o.get(h)?.pack;
|
|
1470
1113
|
if (f) {
|
|
1471
|
-
if (
|
|
1472
|
-
const
|
|
1473
|
-
if (
|
|
1114
|
+
if (o.get(e)?.pack) {
|
|
1115
|
+
const p = f.__overrides, b = p?.[e]?.[d];
|
|
1116
|
+
if (b) return { glyph: b, pack: f, packKey: h };
|
|
1474
1117
|
}
|
|
1475
|
-
const _ =
|
|
1118
|
+
const _ = c(h, d);
|
|
1476
1119
|
if (_) return _;
|
|
1477
1120
|
}
|
|
1478
1121
|
return null;
|
|
1479
1122
|
}
|
|
1480
|
-
return a
|
|
1481
|
-
}
|
|
1482
|
-
return { register: function(
|
|
1483
|
-
const
|
|
1484
|
-
typeof
|
|
1485
|
-
}, prefetch: async function(
|
|
1486
|
-
const
|
|
1487
|
-
await Promise.all(
|
|
1488
|
-
}, setActive: function(
|
|
1489
|
-
|
|
1490
|
-
for (const
|
|
1491
|
-
l
|
|
1123
|
+
return c(a, l);
|
|
1124
|
+
}
|
|
1125
|
+
return { register: function(l, s) {
|
|
1126
|
+
const a = o.get(l) ?? {};
|
|
1127
|
+
typeof s == "function" ? a.loader = s : a.pack = Ie(s), o.set(l, a), e || (e = l);
|
|
1128
|
+
}, prefetch: async function(l = e) {
|
|
1129
|
+
const s = Array.isArray(l) ? l : [l];
|
|
1130
|
+
await Promise.all(s.map(i));
|
|
1131
|
+
}, setActive: function(l) {
|
|
1132
|
+
e = l;
|
|
1133
|
+
for (const s of n.keys()) try {
|
|
1134
|
+
s(l);
|
|
1492
1135
|
} catch {
|
|
1493
1136
|
}
|
|
1494
1137
|
}, getActive: function() {
|
|
1495
|
-
return
|
|
1496
|
-
}, resolve: async function(
|
|
1497
|
-
let
|
|
1498
|
-
if (
|
|
1499
|
-
const
|
|
1500
|
-
if (
|
|
1501
|
-
if (await
|
|
1502
|
-
const f =
|
|
1503
|
-
if (f.length && (await Promise.all(f.map(
|
|
1138
|
+
return e;
|
|
1139
|
+
}, resolve: async function(l, s) {
|
|
1140
|
+
let a = u(l, s);
|
|
1141
|
+
if (a) return a;
|
|
1142
|
+
const h = s?.packKey ?? e, { ns: d } = r(l);
|
|
1143
|
+
if (s?.packKey) {
|
|
1144
|
+
if (await i(h), a = u(l, s), a) return a;
|
|
1145
|
+
const f = o.get(h)?.pack?.meta?.extends ?? [];
|
|
1146
|
+
if (f.length && (await Promise.all(f.map(i)), a = u(l, s), a)) return a;
|
|
1504
1147
|
} else if (d) {
|
|
1505
|
-
if (await
|
|
1506
|
-
const f =
|
|
1507
|
-
if (f.length && (await Promise.all(f.map(
|
|
1148
|
+
if (await i(d), a = u(l, s), a) return a;
|
|
1149
|
+
const f = o.get(d)?.pack?.meta?.extends ?? [];
|
|
1150
|
+
if (f.length && (await Promise.all(f.map(i)), a = u(l, s), a)) return a;
|
|
1508
1151
|
} else {
|
|
1509
|
-
if (await
|
|
1510
|
-
const f =
|
|
1511
|
-
if (f.length && (await Promise.all(f.map(
|
|
1152
|
+
if (await i(h), a = u(l, s), a) return a;
|
|
1153
|
+
const f = o.get(h)?.pack?.meta?.extends ?? [];
|
|
1154
|
+
if (f.length && (await Promise.all(f.map(i)), a = u(l, s), a)) return a;
|
|
1512
1155
|
}
|
|
1513
1156
|
return null;
|
|
1514
|
-
}, registerAlias: function(
|
|
1515
|
-
|
|
1516
|
-
}, has: function(
|
|
1517
|
-
return !!
|
|
1518
|
-
}, getPack: function(
|
|
1519
|
-
return
|
|
1520
|
-
}, hasPack: function(
|
|
1521
|
-
return !!
|
|
1157
|
+
}, registerAlias: function(l, s, a) {
|
|
1158
|
+
t.has(l) || t.set(l, /* @__PURE__ */ new Map()), t.get(l).set(s, a);
|
|
1159
|
+
}, has: function(l, s) {
|
|
1160
|
+
return !!u(l, s);
|
|
1161
|
+
}, getPack: function(l) {
|
|
1162
|
+
return o.get(l ?? e)?.pack;
|
|
1163
|
+
}, hasPack: function(l) {
|
|
1164
|
+
return !!o.get(l)?.pack;
|
|
1522
1165
|
}, listPacks: function() {
|
|
1523
|
-
return Array.from(
|
|
1524
|
-
}, listIcons: function(
|
|
1525
|
-
const
|
|
1526
|
-
return
|
|
1527
|
-
}, addActiveListener: function(
|
|
1528
|
-
const
|
|
1529
|
-
if (
|
|
1530
|
-
const
|
|
1531
|
-
n.delete(
|
|
1166
|
+
return Array.from(o.keys());
|
|
1167
|
+
}, listIcons: function(l) {
|
|
1168
|
+
const s = o.get(l)?.pack;
|
|
1169
|
+
return s ? Object.keys(s.icons) : [];
|
|
1170
|
+
}, addActiveListener: function(l) {
|
|
1171
|
+
const s = n.get(l);
|
|
1172
|
+
if (s) return s;
|
|
1173
|
+
const a = () => {
|
|
1174
|
+
n.delete(l);
|
|
1532
1175
|
};
|
|
1533
|
-
return n.set(
|
|
1176
|
+
return n.set(l, a), a;
|
|
1534
1177
|
} };
|
|
1535
1178
|
}
|
|
1536
|
-
|
|
1537
|
-
const
|
|
1538
|
-
|
|
1539
|
-
const
|
|
1540
|
-
const { iconKey:
|
|
1541
|
-
|
|
1542
|
-
let
|
|
1543
|
-
if (!
|
|
1544
|
-
const
|
|
1545
|
-
return void f({ glyph:
|
|
1179
|
+
to.displayName = "SplitPane";
|
|
1180
|
+
const Gt = no();
|
|
1181
|
+
Gt.register("base", () => import("./BGxm64YWS34jS1Mw.mjs"));
|
|
1182
|
+
const $e = (o) => T("svg", { ...o, children: T("path", {}) }), oo = { Icon: "_Icon_1ld90_10" }, io = wt((o) => {
|
|
1183
|
+
const { iconKey: t, packKey: e, className: n, style: i, role: r, title: c, size: u, ariaHidden: l, sourceProps: s, children: a, ...h } = o, [d, f] = rt.useState(null);
|
|
1184
|
+
rt.useEffect(() => {
|
|
1185
|
+
let C = !0, D = e, g = t;
|
|
1186
|
+
if (!g) {
|
|
1187
|
+
const w = Gt.getPack(D);
|
|
1188
|
+
return void f({ glyph: w ? { svg: q.EmptyArray } : void 0, pack: w ?? void 0, packKey: D ?? Gt.getActive() });
|
|
1546
1189
|
}
|
|
1547
|
-
if (
|
|
1548
|
-
const [
|
|
1549
|
-
D =
|
|
1190
|
+
if (g.includes(":")) {
|
|
1191
|
+
const [w, R] = g.split(":");
|
|
1192
|
+
D = w, g = R;
|
|
1550
1193
|
}
|
|
1551
|
-
return
|
|
1552
|
-
|
|
1194
|
+
return Gt.resolve(g, { packKey: D }).then((w) => {
|
|
1195
|
+
C && f(w);
|
|
1553
1196
|
}), () => {
|
|
1554
|
-
|
|
1197
|
+
C = !1;
|
|
1555
1198
|
};
|
|
1556
|
-
}, [
|
|
1557
|
-
const _ = d?.pack,
|
|
1558
|
-
let
|
|
1559
|
-
const
|
|
1560
|
-
const
|
|
1561
|
-
return
|
|
1562
|
-
}, [
|
|
1563
|
-
if (
|
|
1564
|
-
if (
|
|
1565
|
-
if (
|
|
1566
|
-
if (
|
|
1567
|
-
const
|
|
1568
|
-
return
|
|
1569
|
-
}
|
|
1570
|
-
const
|
|
1571
|
-
if (typeof
|
|
1572
|
-
return
|
|
1573
|
-
if (!
|
|
1574
|
-
const z =
|
|
1575
|
-
return
|
|
1199
|
+
}, [t, e]);
|
|
1200
|
+
const _ = d?.pack, p = d?.glyph, b = d?.packKey;
|
|
1201
|
+
let M = p ? p.svg : void 0;
|
|
1202
|
+
const m = p && !M ? p.url : void 0, v = !p || M || m ? void 0 : p.emoji, y = u != null ? typeof u == "number" ? `${u}px` : u : void 0, A = I(() => [oo.Icon, "icon", n].filter(Boolean).join(" "), [n]), E = I(() => {
|
|
1203
|
+
const C = { ...i };
|
|
1204
|
+
return C["--icon-size"] = y, C;
|
|
1205
|
+
}, [i, y]), k = r ?? (c ? "img" : "presentation"), H = l ?? (!c || void 0), S = (C) => T("span", { className: A, style: E, role: k, "aria-hidden": H, title: c, "data-icon-glyph": t, "data-icon-pack": b, ...h, children: C });
|
|
1206
|
+
if (a) return S(a);
|
|
1207
|
+
if (v) return S(T("span", { children: typeof v == "string" ? v : v.text }));
|
|
1208
|
+
if (m) return S(T("img", { src: m.src, alt: c ?? "" }));
|
|
1209
|
+
if (p && "react" in p) {
|
|
1210
|
+
const C = p.react, D = { className: A, style: E, role: k, "aria-hidden": H, title: c, ...h, ...s };
|
|
1211
|
+
return S(T(C, { ...D }));
|
|
1212
|
+
}
|
|
1213
|
+
const L = { viewBox: M?.viewBox ?? _?.meta.defaultViewBox ?? "0 0 24 24" };
|
|
1214
|
+
if (typeof M == "function")
|
|
1215
|
+
return S(M(L) ?? T($e, { ...L }));
|
|
1216
|
+
if (!M) return S(T($e, { ...L }));
|
|
1217
|
+
const z = M.paths;
|
|
1218
|
+
return S(T("svg", { ...L, children: z ? z.map((C, D) => T("path", { d: C.d, className: C.className, fill: C.fill, stroke: C.stroke, opacity: C.opacity, fillRule: C.fillRule, clipRule: C.clipRule }, D)) : null }));
|
|
1576
1219
|
});
|
|
1577
|
-
function
|
|
1578
|
-
const { isWalking:
|
|
1579
|
-
if (!
|
|
1580
|
-
const f = { "--walk-duration": `${n * (
|
|
1581
|
-
return
|
|
1582
|
-
}, [
|
|
1583
|
-
return
|
|
1220
|
+
function ii(o) {
|
|
1221
|
+
const { isWalking: t = !1, themedType: e = "info", speed: n = 120, dashGap: i = 3, dashLength: r = 5, iconKey: c, packKey: u, style: l, className: s, ...a } = o, h = I(() => {
|
|
1222
|
+
if (!t) return;
|
|
1223
|
+
const f = { "--walk-duration": `${n * (i + r)}ms`, "--walk-dash-length": `${r}px`, "--walk-dash-gap": `${i}px` };
|
|
1224
|
+
return e && e !== "accent" && (f["--icon-accent"] = `var(--icon-${e})`), f;
|
|
1225
|
+
}, [t, n, i, r, e]), d = I(() => t ? s + " walking" : s, [t, s]);
|
|
1226
|
+
return T(io, { iconKey: c, packKey: u, className: d, style: { ...l, ...h }, ...a });
|
|
1584
1227
|
}
|
|
1228
|
+
class _e {
|
|
1229
|
+
constructor() {
|
|
1230
|
+
this.store = /* @__PURE__ */ new Map();
|
|
1231
|
+
}
|
|
1232
|
+
async getItem(t) {
|
|
1233
|
+
return this.store.get(t) ?? null;
|
|
1234
|
+
}
|
|
1235
|
+
async setItem(t, e) {
|
|
1236
|
+
this.store.set(t, e);
|
|
1237
|
+
}
|
|
1238
|
+
async removeItem(t) {
|
|
1239
|
+
this.store.delete(t);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
const on = We(null), rn = { parse: (o) => o ? JSON.parse(o) : null, stringify: JSON.stringify }, ro = { store: new _e(), namespace: "", serializer: rn, debounceMs: 0, crossTabSync: !1, notify: () => {
|
|
1243
|
+
}, subscribeKey: () => () => {
|
|
1244
|
+
} };
|
|
1245
|
+
function ri(o, t, e = so) {
|
|
1246
|
+
const { store: n, namespace: i, serializer: r, debounceMs: c, subscribeKey: u } = Fe(on) || ro, l = e.serializer ?? r ?? rn, s = I(() => `${i}:${o}`, [i, o]), a = O(null), h = `${s}::v`, [d, f] = V(() => {
|
|
1247
|
+
let p;
|
|
1248
|
+
try {
|
|
1249
|
+
if (typeof window < "u" && "localStorage" in window && s.startsWith(i)) {
|
|
1250
|
+
const b = window.localStorage?.getItem(s) ?? null;
|
|
1251
|
+
b != null && (p = l.parse(b));
|
|
1252
|
+
}
|
|
1253
|
+
} catch {
|
|
1254
|
+
}
|
|
1255
|
+
if (p === void 0) {
|
|
1256
|
+
const b = t;
|
|
1257
|
+
return typeof b == "function" ? b() : b;
|
|
1258
|
+
}
|
|
1259
|
+
return p;
|
|
1260
|
+
});
|
|
1261
|
+
$(() => {
|
|
1262
|
+
let p = !0;
|
|
1263
|
+
return (async () => {
|
|
1264
|
+
const [b, M] = await Promise.all([n.getItem(s), n.getItem(h)]);
|
|
1265
|
+
let m;
|
|
1266
|
+
try {
|
|
1267
|
+
m = b == null ? void 0 : l.parse(b);
|
|
1268
|
+
} catch {
|
|
1269
|
+
}
|
|
1270
|
+
const v = M == null ? void 0 : Number.parseInt(M, 10);
|
|
1271
|
+
m === void 0 ? !e.lazy && t !== void 0 && (m = typeof t == "function" ? t() : t, await n.setItem(s, l.stringify(m)), e.version != null && await n.setItem(h, String(e.version))) : e.version != null && v !== void 0 && v !== e.version && e.migrate && (m = e.migrate(m, v), await n.setItem(s, l.stringify(m)), await n.setItem(h, String(e.version))), p && m !== void 0 && f(m);
|
|
1272
|
+
})(), () => {
|
|
1273
|
+
p = !1;
|
|
1274
|
+
};
|
|
1275
|
+
}, [n, s, h, e.version, e.migrate, e.lazy]), $(() => u(o, async () => {
|
|
1276
|
+
const p = await n.getItem(s);
|
|
1277
|
+
if (p != null) try {
|
|
1278
|
+
f(l.parse(p));
|
|
1279
|
+
} catch {
|
|
1280
|
+
}
|
|
1281
|
+
}), [n, s, u, o]);
|
|
1282
|
+
const _ = async (p) => {
|
|
1283
|
+
await n.setItem(s, l.stringify(p)), e.version != null && await n.setItem(h, String(e.version));
|
|
1284
|
+
};
|
|
1285
|
+
return [d, (p) => {
|
|
1286
|
+
f((b) => {
|
|
1287
|
+
const M = typeof p == "function" ? p(b) : p;
|
|
1288
|
+
return a.current && clearTimeout(a.current), c > 0 ? a.current = setTimeout(() => {
|
|
1289
|
+
_(M);
|
|
1290
|
+
}, c) : _(M), M;
|
|
1291
|
+
});
|
|
1292
|
+
}, () => {
|
|
1293
|
+
if (a.current && clearTimeout(a.current), n.removeItem(s), n.removeItem(h), t !== void 0) {
|
|
1294
|
+
const p = typeof t == "function" ? t() : t;
|
|
1295
|
+
f(p);
|
|
1296
|
+
} else f(void 0);
|
|
1297
|
+
}];
|
|
1298
|
+
}
|
|
1299
|
+
const so = {};
|
|
1300
|
+
function si(o) {
|
|
1301
|
+
const { store: t, namespace: e = "", serializer: n = lo, debounceMs: i = 0, crossTabSync: r = !0, children: c } = o, u = I(() => typeof window > "u" ? new _e() : t ?? new _e(), [t]), l = O(/* @__PURE__ */ new Map()), s = I(() => ({ store: u, namespace: e, serializer: n, debounceMs: i, crossTabSync: r, notify(a) {
|
|
1302
|
+
const h = l.current.get(a);
|
|
1303
|
+
h && h.forEach((d) => d());
|
|
1304
|
+
}, subscribeKey(a, h) {
|
|
1305
|
+
const d = l.current, f = d.get(a) ?? /* @__PURE__ */ new Set();
|
|
1306
|
+
return f.add(h), d.set(a, f), () => {
|
|
1307
|
+
const _ = d.get(a);
|
|
1308
|
+
_ && (_.delete(h), _.size === 0 && d.delete(a));
|
|
1309
|
+
};
|
|
1310
|
+
} }), [u, e, n, i, r]);
|
|
1311
|
+
return $(() => {
|
|
1312
|
+
if (s.crossTabSync && s.store.subscribe) return s.store.subscribe((a) => {
|
|
1313
|
+
if (!a.startsWith(s.namespace + ":")) return;
|
|
1314
|
+
const h = a.slice(s.namespace.length + 1);
|
|
1315
|
+
s.notify(h);
|
|
1316
|
+
});
|
|
1317
|
+
}, [s]), T(on.Provider, { value: s, children: c });
|
|
1318
|
+
}
|
|
1319
|
+
const lo = { parse: (o) => o == null ? null : JSON.parse(o), stringify: JSON.stringify };
|
|
1320
|
+
class li {
|
|
1321
|
+
constructor(t = window.localStorage) {
|
|
1322
|
+
this.storage = t;
|
|
1323
|
+
}
|
|
1324
|
+
async getItem(t) {
|
|
1325
|
+
try {
|
|
1326
|
+
return this.storage.getItem(t);
|
|
1327
|
+
} catch {
|
|
1328
|
+
return null;
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
async setItem(t, e) {
|
|
1332
|
+
try {
|
|
1333
|
+
this.storage.setItem(t, e);
|
|
1334
|
+
} catch {
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
async removeItem(t) {
|
|
1338
|
+
try {
|
|
1339
|
+
this.storage.removeItem(t);
|
|
1340
|
+
} catch {
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
subscribe(t) {
|
|
1344
|
+
const e = (n) => {
|
|
1345
|
+
n.storageArea === this.storage && n.key && t(n.key);
|
|
1346
|
+
};
|
|
1347
|
+
return window.addEventListener("storage", e), () => window.removeEventListener("storage", e);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
const at = { Horizontal: "horizontal", Vertical: "vertical" }, ao = "_scrollbar_1v478_17", co = "_vsb-track_1v478_27", uo = "_vsb-thumb_1v478_39", sn = "_scrollbar-button_1v478_80", ln = "M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z", an = "M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z", ho = { transform: "rotate(180deg)" }, po = (o) => {
|
|
1351
|
+
const { style: t, orientation: e = at.Vertical, disabled: n, ...i } = o, r = e === at.Vertical ? ln : an;
|
|
1352
|
+
return T("button", { style: t, className: lt(sn, e, "scroll-button"), disabled: n, ...i, children: T("svg", { width: "9", height: "9", viewBox: "0 0 9 9", children: T("path", { d: r }) }) });
|
|
1353
|
+
}, fo = (o) => {
|
|
1354
|
+
const { style: t, orientation: e = at.Vertical, disabled: n, ...i } = o, r = e === at.Vertical ? ln : an;
|
|
1355
|
+
return T("button", { style: t, className: lt(sn, e, "scroll-button"), disabled: n, ...i, children: T("svg", { width: "9", height: "9", viewBox: "0 0 9 9", style: ho, children: T("path", { d: r }) }) });
|
|
1356
|
+
}, ai = (o) => {
|
|
1357
|
+
const { style: t, orientation: e = at.Vertical, ...n } = o, i = e === at.Vertical;
|
|
1358
|
+
return T("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...t }, className: `scrollbar-button ${i ? "vertical" : "horizontal"} edge`, ...n, children: T("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: i ? "rotate(90) " : "", children: T("path", { style: { transition: "opacity 240ms ease 0s", opacity: o.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" }) }) });
|
|
1359
|
+
};
|
|
1360
|
+
let Xt = 0;
|
|
1361
|
+
function ci() {
|
|
1362
|
+
const [o, t] = V(!!document.fullscreenElement), e = W(() => {
|
|
1363
|
+
const n = document.fullscreenElement;
|
|
1364
|
+
return n ? n.querySelector(".fullscreen-portal-root") || n : document.body;
|
|
1365
|
+
}, []);
|
|
1366
|
+
return $(() => {
|
|
1367
|
+
function n() {
|
|
1368
|
+
const i = document.fullscreenElement;
|
|
1369
|
+
if (t(!!i), !i) return;
|
|
1370
|
+
let r = i.querySelector(".fullscreen-portal-root");
|
|
1371
|
+
r || (r = document.createElement("div"), r.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", i.appendChild(r));
|
|
1372
|
+
}
|
|
1373
|
+
return Xt++, n(), document.addEventListener("fullscreenchange", n), () => {
|
|
1374
|
+
document.removeEventListener("fullscreenchange", n), Xt--, Xt <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((i) => {
|
|
1375
|
+
i.parentNode && i.parentNode.removeChild(i);
|
|
1376
|
+
}), Xt = 0);
|
|
1377
|
+
};
|
|
1378
|
+
}, []), { getPortalContainer: e, isFullscreen: o };
|
|
1379
|
+
}
|
|
1380
|
+
const mo = 24, _o = wt(kt((o, t) => {
|
|
1381
|
+
const { offset: e = 0, totalSize: n = 0, viewportSize: i = 0, style: r, className: c, orientation: u = at.Vertical, onScrollOffset: l, onScroll: s, showCustomScrollButtons: a = !0, scrollButtonIncrement: h = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: f = 120, minThumbSize: _ = mo, maxThumbSize: p, createScrollStartButton: b = po, createScrollEndButton: M = fo, usePortal: m = !1, ...v } = o;
|
|
1382
|
+
P(s, [s]);
|
|
1383
|
+
const [y, A] = V({ offset: 0, length: 0 }), E = O(-1), k = u === at.Vertical, [H, { width: S, height: L }] = vt(), z = k ? L : S, C = P((x, K, U) => {
|
|
1384
|
+
if (K === 0 || U === 0) return void A({ offset: 0, length: _ });
|
|
1385
|
+
const mt = U / z, _t = K / mt, zt = Math.min(Math.max(_, _t), Math.min(z, p ?? Number.MAX_SAFE_INTEGER)), ee = x / mt;
|
|
1386
|
+
return { offset: Math.min(Math.max(0, ee), z - zt), length: zt };
|
|
1387
|
+
}, [z, _, p]), D = P((x) => {
|
|
1388
|
+
const K = n / z, U = Math.round(x * K);
|
|
1389
|
+
A(C(U, i, n)), l?.(U, i, n), E.current = x;
|
|
1390
|
+
}, [l, i, n, z, y]), g = P((x) => {
|
|
1391
|
+
A(C(x, i, n)), l?.(x, i, n), E.current = x;
|
|
1392
|
+
}, [l, i, n]);
|
|
1393
|
+
$(() => {
|
|
1394
|
+
E.current !== e && z !== 0 && (E.current = -1, A(C(e, i, n)));
|
|
1395
|
+
}, [e]), $(() => {
|
|
1396
|
+
z !== 0 && A(C(e, i, n));
|
|
1397
|
+
}, [i, n, k, z]);
|
|
1398
|
+
const w = Math.max(0, n - i), [R, G] = V(!1), j = O(0), J = O(0), Z = ve(t, () => ({ isScrollbar: () => !0 }), []), F = P((x) => {
|
|
1399
|
+
x.currentTarget.setPointerCapture(x.pointerId), G(!0), j.current = k ? x.clientY : x.clientX, J.current = y.offset, x.preventDefault(), x.stopPropagation();
|
|
1400
|
+
}, [k, y]), ot = P((x) => {
|
|
1401
|
+
if (!R) return;
|
|
1402
|
+
const K = (k ? x.clientY : x.clientX) - j.current, U = J.current + K;
|
|
1403
|
+
D(U);
|
|
1404
|
+
}, [R, k]), Q = P((x) => {
|
|
1405
|
+
try {
|
|
1406
|
+
x.currentTarget.releasePointerCapture(x.pointerId);
|
|
1407
|
+
} catch {
|
|
1408
|
+
}
|
|
1409
|
+
G(!1);
|
|
1410
|
+
}, []), bt = P((x) => {
|
|
1411
|
+
if (!x.currentTarget) return;
|
|
1412
|
+
const K = x.currentTarget.getBoundingClientRect(), U = k ? x.clientY - K.top : x.clientX - K.left;
|
|
1413
|
+
D(U);
|
|
1414
|
+
}, [k, y, i, n]), xt = P((x) => {
|
|
1415
|
+
const K = Math.max(1, Math.floor(0.9 * i));
|
|
1416
|
+
k ? (x.key === "ArrowDown" && D(Math.min(w, e + 1)), x.key === "ArrowUp" && D(Math.max(0, e - 1)), x.key === "PageDown" && D(Math.min(w, e + K)), x.key === "PageUp" && D(Math.max(0, e - K)), x.key === "Home" && D(0), x.key === "End" && D(w)) : (x.key === "ArrowRight" && D(Math.min(w, e + 1)), x.key === "ArrowLeft" && D(Math.max(0, e - 1)), x.key === "PageDown" && D(Math.min(w, e + K)), x.key === "PageUp" && D(Math.max(0, e - K)), x.key === "Home" && D(0), x.key === "End" && D(w));
|
|
1417
|
+
}, [k, i, n, e, w]), St = O(null), pt = I(() => T("div", { className: lt(uo), ref: St, role: "slider", "aria-label": k ? "Rows" : "Columns", "aria-orientation": k ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": w, "aria-valuenow": e, tabIndex: 0, style: { position: m ? "fixed" : "relative", [k ? "height" : "width"]: `${y.length}px`, [k ? "width" : "height"]: "100%", transform: k ? `translateY(${y.offset}px)` : `translateX(${y.offset}px)`, [k ? "minHeight" : "minWidth"]: `${_}px` }, onPointerDown: F, onPointerMove: ot, onPointerUp: Q }), [y, _, w, e, k, !1]), [Kt, Rt] = V(null), Nt = P(() => {
|
|
1418
|
+
let x;
|
|
1419
|
+
x = typeof h == "function" ? h(e, i, n) : e - h;
|
|
1420
|
+
const K = Math.max(0, x);
|
|
1421
|
+
return g(K), Rt(K), K;
|
|
1422
|
+
}, [h, e, i, n]), Pt = P(() => {
|
|
1423
|
+
let x;
|
|
1424
|
+
x = typeof h == "function" ? h(e, i, n) : e + h;
|
|
1425
|
+
const K = Math.min(w, x);
|
|
1426
|
+
return g(K), Rt(K), K;
|
|
1427
|
+
}, [h, e, w, i, n]), ft = O(null), Et = O(null), st = W(() => {
|
|
1428
|
+
ft.current && (clearTimeout(ft.current), ft.current = null, Et.current = null);
|
|
1429
|
+
}, []), Dt = W((x, K, U, mt = d) => {
|
|
1430
|
+
Et.current = x, ft.current = setTimeout(() => {
|
|
1431
|
+
const _t = U ? Nt() : Pt();
|
|
1432
|
+
_t !== Et.current ? Dt(_t, !1, U, f) : st();
|
|
1433
|
+
}, K ? 0 : mt);
|
|
1434
|
+
}, [Nt, Pt, st]);
|
|
1435
|
+
$(() => () => st(), [st]);
|
|
1436
|
+
const Qt = I(() => {
|
|
1437
|
+
if (!a) return null;
|
|
1438
|
+
const x = { orientation: u, disabled: e <= 0, onMouseUp: st, onMouseLeave: st, onMouseDown: () => Dt(e, !0, !0) };
|
|
1439
|
+
return b?.(x);
|
|
1440
|
+
}, [a, u, e, Kt]), te = I(() => {
|
|
1441
|
+
if (!a) return null;
|
|
1442
|
+
const x = { orientation: u, disabled: e >= w, onMouseUp: st, onMouseLeave: st, onMouseDown: () => Dt(e, !0, !1) };
|
|
1443
|
+
return M?.(x);
|
|
1444
|
+
}, [a, u, e, w, Kt]), At = k ? "vertical" : "horizontal";
|
|
1445
|
+
return Mt("div", { ref: It([Z, t]), className: lt(c, ao, At, { dragging: R }), style: r, ...v, children: [Qt, T("div", { ref: H, role: "scrollbar", "aria-orientation": At, "aria-valuemin": 0, "aria-valuemax": w, "aria-valuenow": e, tabIndex: 0, className: lt(co, "track", At), onPointerDown: bt, onKeyDown: xt, children: m ? null : pt }), m ? xn(pt, document.body) : null, te] });
|
|
1446
|
+
}));
|
|
1447
|
+
let Ke = Date.now, Re = 1e3, dt = {}, go = 1;
|
|
1448
|
+
const Ot = (o) => {
|
|
1449
|
+
let t = dt[o] !== null;
|
|
1450
|
+
return t && (dt[o] = null), t;
|
|
1451
|
+
}, Ne = (o, t, e, n = 0, i) => {
|
|
1452
|
+
let r = Ke(), c = r, u = 0, l = 0, s = 0, a = go++;
|
|
1453
|
+
if (a % 20 == 0) {
|
|
1454
|
+
const d = {};
|
|
1455
|
+
for (let f in dt) d[f] = !0;
|
|
1456
|
+
dt = d;
|
|
1457
|
+
}
|
|
1458
|
+
const h = function(d) {
|
|
1459
|
+
let f = d !== !0, _ = Ke(), p = !0;
|
|
1460
|
+
try {
|
|
1461
|
+
p = (!t || t(a)) ?? !0;
|
|
1462
|
+
} catch {
|
|
1463
|
+
p = !1;
|
|
1464
|
+
}
|
|
1465
|
+
if (!dt[a] || !p) return dt[a] = null, void e?.(60 - l / ((_ - r) / Re), a, !1);
|
|
1466
|
+
if (f) {
|
|
1467
|
+
s = Math.round((_ - c) / 16.666666666666668) - 1;
|
|
1468
|
+
for (let m = 0; m < Math.min(s, 4); m++) h(!0), l++;
|
|
1469
|
+
}
|
|
1470
|
+
n && (u = (_ - r) / n, u > 1 && (u = 1));
|
|
1471
|
+
let b = i ? i(u) : u, M = !1;
|
|
1472
|
+
try {
|
|
1473
|
+
M = o(b, _, f);
|
|
1474
|
+
} catch {
|
|
1475
|
+
M = !1;
|
|
1476
|
+
}
|
|
1477
|
+
M !== !1 && u !== 1 || !f ? f && (c = _, requestAnimationFrame(h)) : (dt[a] = null, e?.(60 - l / ((_ - r) / Re), a, u === 1 || n == null));
|
|
1478
|
+
};
|
|
1479
|
+
return dt[a] = !0, requestAnimationFrame(h), a;
|
|
1480
|
+
}, yo = function(o) {
|
|
1481
|
+
return Math.pow(o - 1, 3) + 1;
|
|
1482
|
+
}, vo = function(o) {
|
|
1483
|
+
return (o /= 0.5) < 1 ? 0.5 * Math.pow(o, 3) : 0.5 * (Math.pow(o - 2, 3) + 2);
|
|
1484
|
+
};
|
|
1485
|
+
class wo {
|
|
1486
|
+
constructor(t, e) {
|
|
1487
|
+
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 = t, 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, ...e };
|
|
1488
|
+
}
|
|
1489
|
+
setDimensions(t, e, n, i) {
|
|
1490
|
+
t !== null && (this.__clientWidth = t), e !== null && (this.__clientHeight = e), n !== null && (this.__contentWidth = n), i !== null && (this.__contentHeight = i), this.__computeScrollMax(), this.scrollTo(this.__scrollLeft, this.__scrollTop, !0);
|
|
1491
|
+
}
|
|
1492
|
+
setPosition(t, e) {
|
|
1493
|
+
this.__clientLeft = t || 0, this.__clientTop = e || 0;
|
|
1494
|
+
}
|
|
1495
|
+
setSnapSize(t, e) {
|
|
1496
|
+
this.__snapWidth = t, this.__snapHeight = e;
|
|
1497
|
+
}
|
|
1498
|
+
getValues() {
|
|
1499
|
+
return { left: this.__scrollLeft, top: this.__scrollTop, right: this.__scrollLeft + this.__clientWidth / this.__zoomLevel, bottom: this.__scrollTop + this.__clientHeight / this.__zoomLevel, zoom: this.__zoomLevel };
|
|
1500
|
+
}
|
|
1501
|
+
getPoint(t, e) {
|
|
1502
|
+
const n = this.getValues();
|
|
1503
|
+
return { left: t / n.zoom, top: e / n.zoom };
|
|
1504
|
+
}
|
|
1505
|
+
getScrollMax() {
|
|
1506
|
+
return { left: this.__maxScrollLeft, top: this.__maxScrollTop };
|
|
1507
|
+
}
|
|
1508
|
+
zoomTo(t, e = !1, n, i, r) {
|
|
1509
|
+
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
1510
|
+
r && (this.__zoomComplete = r), this.__isDecelerating && (Ot(this.__isDecelerating), this.__isDecelerating = 0);
|
|
1511
|
+
const c = this.__zoomLevel;
|
|
1512
|
+
n === void 0 && (n = this.__clientWidth / 2), i === void 0 && (i = this.__clientHeight / 2), t = Math.max(Math.min(t, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(t);
|
|
1513
|
+
const u = t / c;
|
|
1514
|
+
let l = u * (this.__scrollLeft + n) - n, s = u * (this.__scrollTop + i) - i;
|
|
1515
|
+
l > this.__maxScrollLeft ? l = this.__maxScrollLeft : l < 0 && (l = 0), s > this.__maxScrollTop ? s = this.__maxScrollTop : s < 0 && (s = 0), this.__publish(l, s, t, e);
|
|
1516
|
+
}
|
|
1517
|
+
zoomBy(t, e = !1, n = 0, i = 0, r) {
|
|
1518
|
+
this.zoomTo(this.__zoomLevel * t, e, n, i, r);
|
|
1519
|
+
}
|
|
1520
|
+
scrollTo(t, e, n = !1, i = 1) {
|
|
1521
|
+
if (this.__isDecelerating && (Ot(this.__isDecelerating), this.__isDecelerating = 0), i !== void 0 && i !== this.__zoomLevel) {
|
|
1522
|
+
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
1523
|
+
t *= i, e *= i, this.__computeScrollMax(i);
|
|
1524
|
+
} else i = this.__zoomLevel;
|
|
1525
|
+
this.options.scrollingX ? this.options.paging ? t = Math.round(t / this.__clientWidth) * this.__clientWidth : this.options.snapping && (t = Math.round(t / this.__snapWidth) * this.__snapWidth) : t = this.__scrollLeft, this.options.scrollingY ? this.options.paging ? e = Math.round(e / this.__clientHeight) * this.__clientHeight : this.options.snapping && (e = Math.round(e / this.__snapHeight) * this.__snapHeight) : e = this.__scrollTop, t = Math.max(Math.min(this.__maxScrollLeft, t), 0), e = Math.max(Math.min(this.__maxScrollTop, e), 0), t === this.__scrollLeft && e === this.__scrollTop && (n = !1), this.__publish(t, e, i, n);
|
|
1526
|
+
}
|
|
1527
|
+
scrollBy(t = 0, e = 0, n = !1) {
|
|
1528
|
+
const i = this.__isAnimating ? this.__scheduledLeft : this.__scrollLeft, r = this.__isAnimating ? this.__scheduledTop : this.__scrollTop;
|
|
1529
|
+
this.scrollTo(i + (t || 0), r + (e || 0), n);
|
|
1530
|
+
}
|
|
1531
|
+
doMouseZoom(t, e, n, i) {
|
|
1532
|
+
const r = t > 0 ? 0.97 : 1.03;
|
|
1533
|
+
return this.zoomTo(this.__zoomLevel * r, !1, n - this.__clientLeft, i - this.__clientTop);
|
|
1534
|
+
}
|
|
1535
|
+
doTouchStart(t, e) {
|
|
1536
|
+
if (t.length === void 0) throw new Error("Invalid touch list: " + t);
|
|
1537
|
+
if (e instanceof Date && (e = e.valueOf()), typeof e != "number") throw new Error("Invalid timestamp value: " + e);
|
|
1538
|
+
let n, i;
|
|
1539
|
+
this.__interruptedAnimation = !0, this.__isDecelerating && (Ot(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = !0), this.__isAnimating && (Ot(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = !0);
|
|
1540
|
+
let r = t.length === 1;
|
|
1541
|
+
r ? (n = t[0].pageX, i = t[0].pageY) : (n = Math.abs(t[0].pageX + t[1].pageX) / 2, i = Math.abs(t[0].pageY + t[1].pageY) / 2), this.__initialTouchLeft = n, this.__initialTouchTop = i, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n, this.__lastTouchTop = i, this.__lastTouchMove = e, this.__lastScale = 1, this.__enableScrollX = !r && this.options.scrollingX, this.__enableScrollY = !r && this.options.scrollingY, this.__isTracking = !0, this.__didDecelerationComplete = !1, this.__isDragging = !r, this.__isSingleTouch = r, this.__positions = [];
|
|
1542
|
+
}
|
|
1543
|
+
doTouchMove(t, e, n = 1) {
|
|
1544
|
+
if (t.length === void 0) throw new Error("Invalid touch list: " + t);
|
|
1545
|
+
if (e instanceof Date && (e = e.valueOf()), typeof e != "number") throw new Error("Invalid timestamp value: " + e);
|
|
1546
|
+
if (!this.__isTracking) return;
|
|
1547
|
+
let i, r;
|
|
1548
|
+
t.length === 2 ? (i = Math.abs(t[0].pageX + t[1].pageX) / 2, r = Math.abs(t[0].pageY + t[1].pageY) / 2) : (i = t[0].pageX, r = t[0].pageY);
|
|
1549
|
+
let c = this.__positions;
|
|
1550
|
+
if (this.__isDragging) {
|
|
1551
|
+
let u = i - this.__lastTouchLeft, l = r - this.__lastTouchTop, s = this.__scrollLeft, a = this.__scrollTop, h = this.__zoomLevel;
|
|
1552
|
+
if (n !== void 0 && this.options.zooming) {
|
|
1553
|
+
let d = h;
|
|
1554
|
+
if (h = h / this.__lastScale * n, h = Math.max(Math.min(h, this.options.maxZoom), this.options.minZoom), d !== h) {
|
|
1555
|
+
let f = i - this.__clientLeft, _ = r - this.__clientTop;
|
|
1556
|
+
s = (f + s) * h / d - f, a = (_ + a) * h / d - _, this.__computeScrollMax(h);
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
if (this.__enableScrollX) {
|
|
1560
|
+
s -= u * this.options.speedMultiplier;
|
|
1561
|
+
let d = this.__maxScrollLeft;
|
|
1562
|
+
(s > d || s < 0) && (this.options.bouncing ? s += u / 2 * this.options.speedMultiplier : s = s > d ? d : 0);
|
|
1563
|
+
}
|
|
1564
|
+
if (this.__enableScrollY) {
|
|
1565
|
+
a -= l * this.options.speedMultiplier;
|
|
1566
|
+
const d = this.__maxScrollTop;
|
|
1567
|
+
(a > d || a < 0) && (this.options.bouncing ? a += l / 2 * this.options.speedMultiplier : a = a > d ? d : 0);
|
|
1568
|
+
}
|
|
1569
|
+
c.length > 60 && c.splice(0, 30), c.push(s, a, e), this.__publish(s, a, h);
|
|
1570
|
+
} else {
|
|
1571
|
+
let u = this.options.locking ? 3 : 0, l = 5, s = Math.abs(i - this.__initialTouchLeft), a = Math.abs(r - this.__initialTouchTop);
|
|
1572
|
+
this.__enableScrollX = this.options.scrollingX && s >= u, this.__enableScrollY = this.options.scrollingY && a >= u, c.push(this.__scrollLeft, this.__scrollTop, e), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (s >= l || a >= l), this.__isDragging && (this.__interruptedAnimation = !1);
|
|
1573
|
+
}
|
|
1574
|
+
this.__lastTouchLeft = i, this.__lastTouchTop = r, this.__lastTouchMove = e, this.__lastScale = n;
|
|
1575
|
+
}
|
|
1576
|
+
doTouchEnd(t) {
|
|
1577
|
+
if (t instanceof Date && (t = t.valueOf()), typeof t != "number") throw new Error("Invalid timestamp value: " + t);
|
|
1578
|
+
if (this.__isTracking) {
|
|
1579
|
+
if (this.__isTracking = !1, this.__isDragging) if (this.__isDragging = !1, this.__isSingleTouch && this.options.animating && t - this.__lastTouchMove <= 100) {
|
|
1580
|
+
let e = this.__positions, n = e.length - 1, i = n;
|
|
1581
|
+
for (let r = n; r > 0 && e[r] > this.__lastTouchMove - 100; r -= 3) i = r;
|
|
1582
|
+
if (i !== n) {
|
|
1583
|
+
const r = e[n] - e[i], c = this.__scrollLeft - e[i - 2], u = this.__scrollTop - e[i - 1];
|
|
1584
|
+
this.__decelerationVelocityX = c / r * (1e3 / 60), this.__decelerationVelocityY = u / r * (1e3 / 60);
|
|
1585
|
+
const l = this.options.paging || this.options.snapping ? 4 : 1;
|
|
1586
|
+
(Math.abs(this.__decelerationVelocityX) > l || Math.abs(this.__decelerationVelocityY) > l) && this.__startDeceleration(t);
|
|
1587
|
+
} else this.options.scrollingComplete?.();
|
|
1588
|
+
} else t - this.__lastTouchMove > 100 && this.options.scrollingComplete?.();
|
|
1589
|
+
this.__isDecelerating || ((this.__interruptedAnimation || this.__isDragging) && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, !0, this.__zoomLevel)), this.__positions.length = 0;
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
__publish(t, e, n, i = !1) {
|
|
1593
|
+
const r = this.__isAnimating;
|
|
1594
|
+
if (r && (Ot(r), this.__isAnimating = 0), i && this.options.animating) {
|
|
1595
|
+
this.__scheduledLeft = t, this.__scheduledTop = e, this.__scheduledZoom = n;
|
|
1596
|
+
const c = this.__scrollLeft, u = this.__scrollTop, l = this.__zoomLevel, s = t - c, a = e - u, h = n - l, d = function(p, b, M) {
|
|
1597
|
+
M && (this.__scrollLeft = c + s * p, this.__scrollTop = u + a * p, this.__zoomLevel = l + h * p, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
|
|
1598
|
+
}.bind(this), f = function(p) {
|
|
1599
|
+
return this.__isAnimating === p;
|
|
1600
|
+
}.bind(this), _ = function(p, b, M) {
|
|
1601
|
+
b === this.__isAnimating && (this.__isAnimating = !1), (this.__didDecelerationComplete || M) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
1602
|
+
}.bind(this);
|
|
1603
|
+
this.__isAnimating = Ne(d, f, _, this.options.animationDuration, r ? yo : vo);
|
|
1604
|
+
} else this.__scheduledLeft = this.__scrollLeft = t, this.__scheduledTop = this.__scrollTop = e, this.__scheduledZoom = this.__zoomLevel = n, this.__callback && this.__callback(t, e, n), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
1605
|
+
}
|
|
1606
|
+
__computeScrollMax(t = this.__zoomLevel) {
|
|
1607
|
+
this.__maxScrollLeft = Math.max(this.__contentWidth * t - this.__clientWidth, 0), this.__maxScrollTop = Math.max(this.__contentHeight * t - this.__clientHeight, 0);
|
|
1608
|
+
}
|
|
1609
|
+
__startDeceleration(t) {
|
|
1610
|
+
if (this.options.paging) {
|
|
1611
|
+
const c = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), u = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), l = this.__clientWidth, s = this.__clientHeight;
|
|
1612
|
+
this.__minDecelerationScrollLeft = Math.floor(c / l) * l, this.__minDecelerationScrollTop = Math.floor(u / s) * s, this.__maxDecelerationScrollLeft = Math.ceil(c / l) * l, this.__maxDecelerationScrollTop = Math.ceil(u / s) * s;
|
|
1613
|
+
} else this.__minDecelerationScrollLeft = 0, this.__minDecelerationScrollTop = 0, this.__maxDecelerationScrollLeft = this.__maxScrollLeft, this.__maxDecelerationScrollTop = this.__maxScrollTop;
|
|
1614
|
+
const e = function(c, u, l) {
|
|
1615
|
+
this.__stepThroughDeceleration(l);
|
|
1616
|
+
}.bind(this), n = this.options.snapping ? 4 : 0.1, i = function() {
|
|
1617
|
+
const c = Math.abs(this.__decelerationVelocityX) >= n || Math.abs(this.__decelerationVelocityY) >= n;
|
|
1618
|
+
return c || (this.__didDecelerationComplete = !0), c;
|
|
1619
|
+
}.bind(this), r = function(c, u, l) {
|
|
1620
|
+
this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
|
|
1621
|
+
}.bind(this);
|
|
1622
|
+
this.__isDecelerating = Ne(e, i, r);
|
|
1623
|
+
}
|
|
1624
|
+
__stepThroughDeceleration(t) {
|
|
1625
|
+
let e = this.__scrollLeft + this.__decelerationVelocityX, n = this.__scrollTop + this.__decelerationVelocityY;
|
|
1626
|
+
if (!this.options.bouncing) {
|
|
1627
|
+
const i = Math.max(Math.min(this.__maxDecelerationScrollLeft, e), this.__minDecelerationScrollLeft);
|
|
1628
|
+
i !== e && (e = i, this.__decelerationVelocityX = 0);
|
|
1629
|
+
const r = Math.max(Math.min(this.__maxDecelerationScrollTop, n), this.__minDecelerationScrollTop);
|
|
1630
|
+
r !== n && (n = r, this.__decelerationVelocityY = 0);
|
|
1631
|
+
}
|
|
1632
|
+
if (t ? this.__publish(e, n, this.__zoomLevel) : (this.__scrollLeft = e, this.__scrollTop = n), !this.options.paging && (this.__decelerationVelocityX *= 0.95, this.__decelerationVelocityY *= 0.95), this.options.bouncing) {
|
|
1633
|
+
let i = 0, r = 0, c = this.options.penetrationDeceleration, u = this.options.penetrationAcceleration;
|
|
1634
|
+
e < this.__minDecelerationScrollLeft ? i = this.__minDecelerationScrollLeft - e : e > this.__maxDecelerationScrollLeft && (i = this.__maxDecelerationScrollLeft - e), n < this.__minDecelerationScrollTop ? r = this.__minDecelerationScrollTop - n : n > this.__maxDecelerationScrollTop && (r = this.__maxDecelerationScrollTop - n), i !== 0 && (i * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += i * c : this.__decelerationVelocityX = i * u), r !== 0 && (r * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += r * c : this.__decelerationVelocityY = r * u);
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
const $t = (o, t) => T(_o, { ...o, ref: t }), ui = Object.freeze(Object.defineProperty({ __proto__: null, defaultCreateScrollbar: $t, getScrollTo: (o, t, e, n, i = 0) => {
|
|
1639
|
+
for (let r = 0; r < e.length; r++) {
|
|
1640
|
+
const c = e[r].getBoundingClientRect();
|
|
1641
|
+
let u = c.left - t, l = u + c.width;
|
|
1642
|
+
if (n) {
|
|
1643
|
+
if (u < o && l >= o) return u;
|
|
1644
|
+
} else if (Math.ceil(l) > Math.ceil(o) + 2) return l;
|
|
1645
|
+
}
|
|
1646
|
+
return i;
|
|
1647
|
+
} }, Symbol.toStringTag, { value: "Module" })), bo = ({ width: o, height: t }) => T("div", { className: "corner", style: { minWidth: `${o}px`, width: `${o}px`, minHeight: `${t}px`, height: `${t}px` } }), xo = wt(kt((o, t) => {
|
|
1648
|
+
const { children: e, viewport: n, onScrollViewport: i, showHorizontalScrollbar: r = !0, showVerticalScrollbar: c = !0, createScrollCorner: u = bo, createHorizontalScrollbar: l = $t, createVerticalScrollbar: s = $t, style: a, touchElement: h, disableTouch: d, ...f } = o, _ = r && l, p = c && s, b = P(i, [i]), M = ve(t, () => ({ isScrollPane: () => !0 }), []), m = O(null);
|
|
1649
|
+
$(() => {
|
|
1650
|
+
m.current && (m.current.__scrollTop === n?.top && m.current.__scrollLeft === n?.left || m.current.__isDecelerating || m.current?.scrollTo(n?.left, n?.top, !1));
|
|
1651
|
+
}, [n?.left, n?.top, h]);
|
|
1652
|
+
const v = W((g, w) => {
|
|
1653
|
+
b?.({ left: g, top: w });
|
|
1654
|
+
}, []), y = W((g) => {
|
|
1655
|
+
m.current?.doTouchStart(g.touches, g.timeStamp);
|
|
1656
|
+
}, []), A = W((g) => {
|
|
1657
|
+
g.preventDefault(), m.current?.doTouchMove(g.touches, g.timeStamp);
|
|
1658
|
+
}, []), E = W((g) => {
|
|
1659
|
+
m.current?.doTouchEnd(g.timeStamp);
|
|
1660
|
+
}, []), k = W(({ containerWidth: g, containerHeight: w, totalWidth: R, totalHeight: G }) => {
|
|
1661
|
+
m.current.setDimensions(g, w, R, G);
|
|
1662
|
+
}, []);
|
|
1663
|
+
$(() => {
|
|
1664
|
+
const g = h ?? M.current;
|
|
1665
|
+
if (!d && de().supportsTouchEvents && g && n) {
|
|
1666
|
+
if (!m.current) {
|
|
1667
|
+
const w = { scrollingX: !0, scrollingY: !0, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
|
|
1668
|
+
m.current = new wo(v, w);
|
|
1669
|
+
}
|
|
1670
|
+
de().supportsTouchEvents && (g.addEventListener("touchstart", y), g.addEventListener("touchend", E), g.addEventListener("touchmove", A)), k({ containerWidth: n?.width, containerHeight: n?.height, totalWidth: n?.totalWidth, totalHeight: n?.totalHeight });
|
|
1671
|
+
}
|
|
1672
|
+
return () => {
|
|
1673
|
+
g?.removeEventListener("touchstart", y), g?.removeEventListener("touchend", E), g?.removeEventListener("touchmove", A);
|
|
1674
|
+
};
|
|
1675
|
+
}, [n?.width, n?.height, n?.totalWidth, n?.totalHeight, d, h]);
|
|
1676
|
+
const [H, { width: S }] = vt(), [L, { height: z }] = vt(), C = I(() => {
|
|
1677
|
+
if (!p) return null;
|
|
1678
|
+
const g = s({ orientation: at.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (w) => {
|
|
1679
|
+
b?.({ top: w });
|
|
1680
|
+
} });
|
|
1681
|
+
return T("div", { style: { display: "flex", flex: "0" }, ref: H, children: g });
|
|
1682
|
+
}, [s, n?.top, n?.height, n?.totalHeight]), D = I(() => {
|
|
1683
|
+
if (!_) return null;
|
|
1684
|
+
const g = l({ orientation: at.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (w) => {
|
|
1685
|
+
b?.({ left: w });
|
|
1686
|
+
} });
|
|
1687
|
+
return Mt("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [T("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${S}px)` }, children: T("div", { ref: L, className: "sizer", children: g }) }), p ? u({ width: S, height: z }) : T(Ct, {})] });
|
|
1688
|
+
}, [l, n?.left, n?.width, n?.totalWidth, p, u, S, z]);
|
|
1689
|
+
return T("div", { style: { position: "relative", display: "flex", minWidth: p ? `${S}px` : void 0, minHeight: _ ? `${z}px` : void 0, ...a }, ...f, ref: M, children: Mt("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [Mt("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [T("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: e }), p ? C : T(Ct, {})] }), _ ? D : T(Ct, {})] }) });
|
|
1690
|
+
}));
|
|
1691
|
+
xo.displayName = "ScrollPane";
|
|
1692
|
+
const So = 300, Eo = 100, Lo = 1e6, Mo = 100, Co = 50, To = wt(kt((o, t) => {
|
|
1693
|
+
const { offset: e = 0, viewportSize: n = 0, totalSize: i = 0, minSize: r = 0, endGap: c = So, endScrollIncrement: u = Eo, style: l = Ye, onMouseDown: s, onScrollOffset: a, onScroll: h, scaleLimit: d = Lo, scaleFactor: f = Mo, precisionFactor: _ = Co, createScrollbar: p = $t, ...b } = o;
|
|
1694
|
+
h && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
|
|
1695
|
+
const M = P(s, [s]), [m, v] = V(!1), y = I(() => {
|
|
1696
|
+
const S = d === 0 ? i : Math.min(i ?? 0, Math.max(r ?? 0, (e ?? 0) + (n ?? 0)) + (c ?? 0)), L = d !== 0 && S > d ? f : 1, z = L / _, C = Math.ceil(S / L);
|
|
1697
|
+
return { offset: Math.ceil(e / L), totalSize: C, viewportSize: Math.ceil(n / L), scaledOffset: e, scaledTotalSize: i, scaledViewportSize: n, factor: L, precision: z };
|
|
1698
|
+
}, [e, i, n, m, r, c, u]), A = P((S, L, z) => {
|
|
1699
|
+
const C = y.offset;
|
|
1700
|
+
Math.abs(S - C) < y.precision && (S = C), a?.(S * y.factor, C, y.viewportSize);
|
|
1701
|
+
}, [a, y]), E = W((S) => {
|
|
1702
|
+
}, []), k = W((S) => {
|
|
1703
|
+
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", k), v(!1);
|
|
1704
|
+
}, []), H = W((S) => {
|
|
1705
|
+
v(!0), M?.(S), document.addEventListener("mousemove", E, { passive: !0 }), document.addEventListener("mouseup", k, { passive: !0 });
|
|
1706
|
+
}, [E, k]);
|
|
1707
|
+
return $t({ style: l, ...b, offset: y.offset, totalSize: y.totalSize, viewportSize: y.viewportSize, onMouseDown: H, onScrollOffset: A }, t);
|
|
1708
|
+
}));
|
|
1709
|
+
To.displayName = "VirtualScrollbar";
|
|
1585
1710
|
export {
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1711
|
+
ue as Command,
|
|
1712
|
+
No as CommandButtonType,
|
|
1713
|
+
Ze as CommandGroup,
|
|
1714
|
+
Gt as DefaultDynamicIconService,
|
|
1715
|
+
On as DefaultReactNotifier,
|
|
1716
|
+
io as DynamicIcon,
|
|
1717
|
+
oi as ErrorTestPanel,
|
|
1718
|
+
Wo as FocusKeyNavigation,
|
|
1719
|
+
Bo as HorizontalAlignment,
|
|
1720
|
+
_e as InMemoryStore,
|
|
1721
|
+
Oo as KeyCodes,
|
|
1596
1722
|
Y as KeyModifiers,
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1723
|
+
li as LocalStorageStore,
|
|
1724
|
+
Io as MouseButtonCodes,
|
|
1725
|
+
Vo as NotifierProvider,
|
|
1726
|
+
Te as NotifierType,
|
|
1727
|
+
si as PersistenceStateProvider,
|
|
1728
|
+
ei as ReactErrorBoundary,
|
|
1729
|
+
$o as ReactUtils,
|
|
1730
|
+
Fo as RoundedTab,
|
|
1731
|
+
xo as ScrollPane,
|
|
1732
|
+
ui as ScrollUtils,
|
|
1733
|
+
_o as Scrollbar,
|
|
1734
|
+
at as ScrollbarOrientation,
|
|
1735
|
+
re as SimpleCommand,
|
|
1736
|
+
to as SplitPane,
|
|
1737
|
+
Qn as SplitPaneResizer,
|
|
1738
|
+
Ho as ToolTipPlacement,
|
|
1739
|
+
ni as UncaughtErrorBoundary,
|
|
1740
|
+
To as VirtualScrollbar,
|
|
1741
|
+
ii as WalkingIcon,
|
|
1742
|
+
no as createDynamicIconService,
|
|
1743
|
+
bo as defaultCreateScrollCorner,
|
|
1744
|
+
ai as defaultCreateScrollEdgeButton,
|
|
1745
|
+
fo as defaultCreateScrollEndButton,
|
|
1746
|
+
po as defaultCreateScrollStartButton,
|
|
1747
|
+
Xo as getDevicePixelRatio,
|
|
1748
|
+
Bt as toShortcutString,
|
|
1749
|
+
jo as useAnimatedMeasure,
|
|
1750
|
+
P as useCallbackRef,
|
|
1751
|
+
Ko as useCommand,
|
|
1752
|
+
Ro as useCommands,
|
|
1753
|
+
qo as useCopyPaste,
|
|
1754
|
+
Uo as useDevicePixelRatio,
|
|
1755
|
+
Zo as useEditMode,
|
|
1756
|
+
ci as useFullscreenPortal,
|
|
1757
|
+
jn as useGlobalClipboard,
|
|
1758
|
+
Qo as useId,
|
|
1759
|
+
ve as useImperativeElement,
|
|
1760
|
+
Go as useMouseDownAndHoldListener,
|
|
1761
|
+
Jt as useNotifier,
|
|
1762
|
+
Yo as useOnClickOrFocusAway,
|
|
1763
|
+
ri as usePersistenceState,
|
|
1764
|
+
Rn as useSynchronizedPointerHandler,
|
|
1765
|
+
Jo as useTraceUpdate,
|
|
1766
|
+
ti as useUndoManager
|
|
1638
1767
|
};
|