@sheetxl/utils-react 0.7.14 → 0.7.16

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