@kommo-crm/crm-react-ui-kit 1.1.1-beta.13 → 1.1.1-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ContextMenu/ContextMenu.js +1 -1
- package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.js +1 -1
- package/dist/components/ContextMenu/components/Content/Content.d.ts +1 -1
- package/dist/components/ContextMenu/components/Content/Content.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/Content/Content.js +1 -1
- package/dist/components/ContextMenu/components/Content/Content.props.d.ts +5 -1
- package/dist/components/ContextMenu/components/Content/Content.props.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/Content/index.js +1 -1
- package/dist/components/ContextMenu/components/FocusBlocker/FocusBlocker.js +1 -1
- package/dist/components/ContextMenu/components/FocusBlocker/index.js +1 -1
- package/dist/components/ContextMenu/components/Item/Item.js +1 -1
- package/dist/components/ContextMenu/components/ItemRightSlot/ItemRightSlot.js +1 -1
- package/dist/components/ContextMenu/components/Label/Label.js +1 -1
- package/dist/components/ContextMenu/components/RadioItem/RadioItem.js +1 -1
- package/dist/components/ContextMenu/components/Sub/Sub.js +1 -1
- package/dist/components/ContextMenu/components/SubContent/SubContent.d.ts +1 -0
- package/dist/components/ContextMenu/components/SubContent/SubContent.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubContent/SubContent.js +60 -58
- package/dist/components/ContextMenu/components/SubContent/SubContent.props.d.ts +4 -0
- package/dist/components/ContextMenu/components/SubContent/SubContent.props.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubRoot/SubRoot.js +1 -1
- package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.d.ts +1 -1
- package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.js +59 -57
- package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.js +1 -1
- package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.js +1 -1
- package/dist/components/ContextMenu/hooks/index.d.ts +1 -0
- package/dist/components/ContextMenu/hooks/index.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/index.js +9 -7
- package/dist/components/ContextMenu/hooks/useChildrenWithBlocker/useChildrenWithBlocker.js +1 -1
- package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.d.ts +1 -1
- package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.js +2 -1
- package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.types.d.ts +4 -0
- package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.types.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.js +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.js +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.js +1 -1
- package/dist/components/ContextMenu/hooks/useInheritedArrowColor/useInheritedArrowColor.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useInheritedArrowColor/useInheritedArrowColor.js +12 -12
- package/dist/components/ContextMenu/hooks/useItemInnerFocus/useItemInnerFocus.js +1 -1
- package/dist/components/ContextMenu/hooks/usePrevious/usePrevious.d.ts +2 -0
- package/dist/components/ContextMenu/hooks/usePrevious/usePrevious.d.ts.map +1 -0
- package/dist/components/ContextMenu/hooks/usePrevious/usePrevious.js +10 -0
- package/dist/components/ContextMenu/index.js +1 -1
- package/dist/useContentPositioning-CLU2E_Oz.mjs +2433 -0
- package/package.json +1 -1
- package/dist/useContentPositioning-BokVuzge.mjs +0 -2425
|
@@ -0,0 +1,2433 @@
|
|
|
1
|
+
import * as Qt from "react";
|
|
2
|
+
import { forwardRef as st, useEffect as Oe, useLayoutEffect as We, useState as ee, useRef as K, useCallback as Un, useMemo as Pe, useContext as Dn } from "react";
|
|
3
|
+
import { jsx as Re, jsxs as qn } from "react/jsx-runtime";
|
|
4
|
+
import { g as jn } from "./index-DmGLJEdp.mjs";
|
|
5
|
+
import { c as Mt } from "./index-L8X2o7IH.mjs";
|
|
6
|
+
import $n, { unstable_batchedUpdates as zn } from "react-dom";
|
|
7
|
+
import { mergeRefs as Ln } from "./lib/utils.js";
|
|
8
|
+
import { LevelProvider as Qn } from "./components/ContextMenu/providers/LevelProvider/LevelProvider.js";
|
|
9
|
+
import { useContextMenuContext as Mn } from "./components/ContextMenu/ContextMenu.context.js";
|
|
10
|
+
import { ContextMenuMode as _t } from "./components/ContextMenu/ContextMenu.enums.js";
|
|
11
|
+
import "./components/ContextMenu/providers/SubMenuProvider/SubMenuProvider.js";
|
|
12
|
+
import { directionToSide as Gn } from "./components/ContextMenu/components/Content/Content.utils.js";
|
|
13
|
+
import { useStopContextMenuEvents as Bn } from "./components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.js";
|
|
14
|
+
import { Direction as T } from "./components/ContextMenu/components/Content/Content.enums.js";
|
|
15
|
+
import { usePrevious as Hn } from "./components/ContextMenu/hooks/usePrevious/usePrevious.js";
|
|
16
|
+
import './assets/useContentPositioning.css';var bt, Se = $n;
|
|
17
|
+
if (process.env.NODE_ENV === "production")
|
|
18
|
+
bt = Se.createRoot, Se.hydrateRoot;
|
|
19
|
+
else {
|
|
20
|
+
var wt = Se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
21
|
+
bt = function(e, t) {
|
|
22
|
+
wt.usingClientEntryPoint = !0;
|
|
23
|
+
try {
|
|
24
|
+
return Se.createRoot(e, t);
|
|
25
|
+
} finally {
|
|
26
|
+
wt.usingClientEntryPoint = !1;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const Wn = "_blocker_1msg5_1", Kn = {
|
|
31
|
+
blocker: Wn
|
|
32
|
+
}, Gt = st(
|
|
33
|
+
(e, t) => {
|
|
34
|
+
const {
|
|
35
|
+
className: n,
|
|
36
|
+
onFocus: s,
|
|
37
|
+
onClick: i,
|
|
38
|
+
onKeyDown: r,
|
|
39
|
+
onKeyUp: a,
|
|
40
|
+
onKeyPress: u,
|
|
41
|
+
onPointerDown: l,
|
|
42
|
+
onPointerUp: o,
|
|
43
|
+
onPointerEnter: m,
|
|
44
|
+
onPointerLeave: d,
|
|
45
|
+
onPointerMove: h,
|
|
46
|
+
...g
|
|
47
|
+
} = e, y = Bn({
|
|
48
|
+
onClick: i,
|
|
49
|
+
onKeyDown: r,
|
|
50
|
+
onKeyUp: a,
|
|
51
|
+
onKeyPress: u,
|
|
52
|
+
onPointerDown: l,
|
|
53
|
+
onPointerUp: o,
|
|
54
|
+
onPointerEnter: m,
|
|
55
|
+
onPointerLeave: d,
|
|
56
|
+
onPointerMove: h
|
|
57
|
+
});
|
|
58
|
+
return /* @__PURE__ */ Re(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
ref: t,
|
|
62
|
+
className: Mt(Kn.blocker, n),
|
|
63
|
+
tabIndex: 0,
|
|
64
|
+
onFocus: (p) => {
|
|
65
|
+
p.preventDefault(), s == null || s(p);
|
|
66
|
+
},
|
|
67
|
+
"data-blocker": !0,
|
|
68
|
+
...y,
|
|
69
|
+
...g
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
Gt.displayName = "FocusBlocker";
|
|
75
|
+
var it = Ae(), w = (e) => we(e, it), rt = Ae();
|
|
76
|
+
w.write = (e) => we(e, rt);
|
|
77
|
+
var Ve = Ae();
|
|
78
|
+
w.onStart = (e) => we(e, Ve);
|
|
79
|
+
var at = Ae();
|
|
80
|
+
w.onFrame = (e) => we(e, at);
|
|
81
|
+
var ot = Ae();
|
|
82
|
+
w.onFinish = (e) => we(e, ot);
|
|
83
|
+
var te = [];
|
|
84
|
+
w.setTimeout = (e, t) => {
|
|
85
|
+
const n = w.now() + t, s = () => {
|
|
86
|
+
const r = te.findIndex((a) => a.cancel == s);
|
|
87
|
+
~r && te.splice(r, 1), W -= ~r ? 1 : 0;
|
|
88
|
+
}, i = { time: n, handler: e, cancel: s };
|
|
89
|
+
return te.splice(Bt(n), 0, i), W += 1, Ht(), i;
|
|
90
|
+
};
|
|
91
|
+
var Bt = (e) => ~(~te.findIndex((t) => t.time > e) || ~te.length);
|
|
92
|
+
w.cancel = (e) => {
|
|
93
|
+
Ve.delete(e), at.delete(e), ot.delete(e), it.delete(e), rt.delete(e);
|
|
94
|
+
};
|
|
95
|
+
w.sync = (e) => {
|
|
96
|
+
Ke = !0, w.batchedUpdates(e), Ke = !1;
|
|
97
|
+
};
|
|
98
|
+
w.throttle = (e) => {
|
|
99
|
+
let t;
|
|
100
|
+
function n() {
|
|
101
|
+
try {
|
|
102
|
+
e(...t);
|
|
103
|
+
} finally {
|
|
104
|
+
t = null;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function s(...i) {
|
|
108
|
+
t = i, w.onStart(n);
|
|
109
|
+
}
|
|
110
|
+
return s.handler = e, s.cancel = () => {
|
|
111
|
+
Ve.delete(n), t = null;
|
|
112
|
+
}, s;
|
|
113
|
+
};
|
|
114
|
+
var ut = typeof window < "u" ? window.requestAnimationFrame : (
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
116
|
+
() => {
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
w.use = (e) => ut = e;
|
|
120
|
+
w.now = typeof performance < "u" ? () => performance.now() : Date.now;
|
|
121
|
+
w.batchedUpdates = (e) => e();
|
|
122
|
+
w.catch = console.error;
|
|
123
|
+
w.frameLoop = "always";
|
|
124
|
+
w.advance = () => {
|
|
125
|
+
w.frameLoop !== "demand" ? console.warn(
|
|
126
|
+
"Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"
|
|
127
|
+
) : Kt();
|
|
128
|
+
};
|
|
129
|
+
var H = -1, W = 0, Ke = !1;
|
|
130
|
+
function we(e, t) {
|
|
131
|
+
Ke ? (t.delete(e), e(0)) : (t.add(e), Ht());
|
|
132
|
+
}
|
|
133
|
+
function Ht() {
|
|
134
|
+
H < 0 && (H = 0, w.frameLoop !== "demand" && ut(Wt));
|
|
135
|
+
}
|
|
136
|
+
function Yn() {
|
|
137
|
+
H = -1;
|
|
138
|
+
}
|
|
139
|
+
function Wt() {
|
|
140
|
+
~H && (ut(Wt), w.batchedUpdates(Kt));
|
|
141
|
+
}
|
|
142
|
+
function Kt() {
|
|
143
|
+
const e = H;
|
|
144
|
+
H = w.now();
|
|
145
|
+
const t = Bt(H);
|
|
146
|
+
if (t && (Yt(te.splice(0, t), (n) => n.handler()), W -= t), !W) {
|
|
147
|
+
Yn();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
Ve.flush(), it.flush(e ? Math.min(64, H - e) : 16.667), at.flush(), rt.flush(), ot.flush();
|
|
151
|
+
}
|
|
152
|
+
function Ae() {
|
|
153
|
+
let e = /* @__PURE__ */ new Set(), t = e;
|
|
154
|
+
return {
|
|
155
|
+
add(n) {
|
|
156
|
+
W += t == e && !e.has(n) ? 1 : 0, e.add(n);
|
|
157
|
+
},
|
|
158
|
+
delete(n) {
|
|
159
|
+
return W -= t == e && e.has(n) ? 1 : 0, e.delete(n);
|
|
160
|
+
},
|
|
161
|
+
flush(n) {
|
|
162
|
+
t.size && (e = /* @__PURE__ */ new Set(), W -= t.size, Yt(t, (s) => s(n) && e.add(s)), W += e.size, t = e);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function Yt(e, t) {
|
|
167
|
+
e.forEach((n) => {
|
|
168
|
+
try {
|
|
169
|
+
t(n);
|
|
170
|
+
} catch (s) {
|
|
171
|
+
w.catch(s);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
var Zn = Object.defineProperty, Xn = (e, t) => {
|
|
176
|
+
for (var n in t)
|
|
177
|
+
Zn(e, n, { get: t[n], enumerable: !0 });
|
|
178
|
+
}, j = {};
|
|
179
|
+
Xn(j, {
|
|
180
|
+
assign: () => es,
|
|
181
|
+
colors: () => Y,
|
|
182
|
+
createStringInterpolator: () => lt,
|
|
183
|
+
skipAnimation: () => Xt,
|
|
184
|
+
to: () => Zt,
|
|
185
|
+
willAdvance: () => dt
|
|
186
|
+
});
|
|
187
|
+
function Ye() {
|
|
188
|
+
}
|
|
189
|
+
var Jn = (e, t, n) => Object.defineProperty(e, t, { value: n, writable: !0, configurable: !0 }), c = {
|
|
190
|
+
arr: Array.isArray,
|
|
191
|
+
obj: (e) => !!e && e.constructor.name === "Object",
|
|
192
|
+
fun: (e) => typeof e == "function",
|
|
193
|
+
str: (e) => typeof e == "string",
|
|
194
|
+
num: (e) => typeof e == "number",
|
|
195
|
+
und: (e) => e === void 0
|
|
196
|
+
};
|
|
197
|
+
function G(e, t) {
|
|
198
|
+
if (c.arr(e)) {
|
|
199
|
+
if (!c.arr(t) || e.length !== t.length) return !1;
|
|
200
|
+
for (let n = 0; n < e.length; n++)
|
|
201
|
+
if (e[n] !== t[n]) return !1;
|
|
202
|
+
return !0;
|
|
203
|
+
}
|
|
204
|
+
return e === t;
|
|
205
|
+
}
|
|
206
|
+
var P = (e, t) => e.forEach(t);
|
|
207
|
+
function Q(e, t, n) {
|
|
208
|
+
if (c.arr(e)) {
|
|
209
|
+
for (let s = 0; s < e.length; s++)
|
|
210
|
+
t.call(n, e[s], `${s}`);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
for (const s in e)
|
|
214
|
+
e.hasOwnProperty(s) && t.call(n, e[s], s);
|
|
215
|
+
}
|
|
216
|
+
var O = (e) => c.und(e) ? [] : c.arr(e) ? e : [e];
|
|
217
|
+
function ce(e, t) {
|
|
218
|
+
if (e.size) {
|
|
219
|
+
const n = Array.from(e);
|
|
220
|
+
e.clear(), P(n, t);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
var ue = (e, ...t) => ce(e, (n) => n(...t)), ct = () => typeof window > "u" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent), lt, Zt, Y = null, Xt = !1, dt = Ye, es = (e) => {
|
|
224
|
+
e.to && (Zt = e.to), e.now && (w.now = e.now), e.colors !== void 0 && (Y = e.colors), e.skipAnimation != null && (Xt = e.skipAnimation), e.createStringInterpolator && (lt = e.createStringInterpolator), e.requestAnimationFrame && w.use(e.requestAnimationFrame), e.batchedUpdates && (w.batchedUpdates = e.batchedUpdates), e.willAdvance && (dt = e.willAdvance), e.frameLoop && (w.frameLoop = e.frameLoop);
|
|
225
|
+
}, le = /* @__PURE__ */ new Set(), N = [], Le = [], ke = 0, Ne = {
|
|
226
|
+
get idle() {
|
|
227
|
+
return !le.size && !N.length;
|
|
228
|
+
},
|
|
229
|
+
/** Advance the given animation on every frame until idle. */
|
|
230
|
+
start(e) {
|
|
231
|
+
ke > e.priority ? (le.add(e), w.onStart(ts)) : (Jt(e), w(Ze));
|
|
232
|
+
},
|
|
233
|
+
/** Advance all animations by the given time. */
|
|
234
|
+
advance: Ze,
|
|
235
|
+
/** Call this when an animation's priority changes. */
|
|
236
|
+
sort(e) {
|
|
237
|
+
if (ke)
|
|
238
|
+
w.onFrame(() => Ne.sort(e));
|
|
239
|
+
else {
|
|
240
|
+
const t = N.indexOf(e);
|
|
241
|
+
~t && (N.splice(t, 1), en(e));
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
/**
|
|
245
|
+
* Clear all animations. For testing purposes.
|
|
246
|
+
*
|
|
247
|
+
* ☠️ Never call this from within the frameloop.
|
|
248
|
+
*/
|
|
249
|
+
clear() {
|
|
250
|
+
N = [], le.clear();
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
function ts() {
|
|
254
|
+
le.forEach(Jt), le.clear(), w(Ze);
|
|
255
|
+
}
|
|
256
|
+
function Jt(e) {
|
|
257
|
+
N.includes(e) || en(e);
|
|
258
|
+
}
|
|
259
|
+
function en(e) {
|
|
260
|
+
N.splice(
|
|
261
|
+
ns(N, (t) => t.priority > e.priority),
|
|
262
|
+
0,
|
|
263
|
+
e
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
function Ze(e) {
|
|
267
|
+
const t = Le;
|
|
268
|
+
for (let n = 0; n < N.length; n++) {
|
|
269
|
+
const s = N[n];
|
|
270
|
+
ke = s.priority, s.idle || (dt(s), s.advance(e), s.idle || t.push(s));
|
|
271
|
+
}
|
|
272
|
+
return ke = 0, Le = N, Le.length = 0, N = t, N.length > 0;
|
|
273
|
+
}
|
|
274
|
+
function ns(e, t) {
|
|
275
|
+
const n = e.findIndex(t);
|
|
276
|
+
return n < 0 ? e.length : n;
|
|
277
|
+
}
|
|
278
|
+
var ss = {
|
|
279
|
+
transparent: 0,
|
|
280
|
+
aliceblue: 4042850303,
|
|
281
|
+
antiquewhite: 4209760255,
|
|
282
|
+
aqua: 16777215,
|
|
283
|
+
aquamarine: 2147472639,
|
|
284
|
+
azure: 4043309055,
|
|
285
|
+
beige: 4126530815,
|
|
286
|
+
bisque: 4293182719,
|
|
287
|
+
black: 255,
|
|
288
|
+
blanchedalmond: 4293643775,
|
|
289
|
+
blue: 65535,
|
|
290
|
+
blueviolet: 2318131967,
|
|
291
|
+
brown: 2771004159,
|
|
292
|
+
burlywood: 3736635391,
|
|
293
|
+
burntsienna: 3934150143,
|
|
294
|
+
cadetblue: 1604231423,
|
|
295
|
+
chartreuse: 2147418367,
|
|
296
|
+
chocolate: 3530104575,
|
|
297
|
+
coral: 4286533887,
|
|
298
|
+
cornflowerblue: 1687547391,
|
|
299
|
+
cornsilk: 4294499583,
|
|
300
|
+
crimson: 3692313855,
|
|
301
|
+
cyan: 16777215,
|
|
302
|
+
darkblue: 35839,
|
|
303
|
+
darkcyan: 9145343,
|
|
304
|
+
darkgoldenrod: 3095792639,
|
|
305
|
+
darkgray: 2846468607,
|
|
306
|
+
darkgreen: 6553855,
|
|
307
|
+
darkgrey: 2846468607,
|
|
308
|
+
darkkhaki: 3182914559,
|
|
309
|
+
darkmagenta: 2332068863,
|
|
310
|
+
darkolivegreen: 1433087999,
|
|
311
|
+
darkorange: 4287365375,
|
|
312
|
+
darkorchid: 2570243327,
|
|
313
|
+
darkred: 2332033279,
|
|
314
|
+
darksalmon: 3918953215,
|
|
315
|
+
darkseagreen: 2411499519,
|
|
316
|
+
darkslateblue: 1211993087,
|
|
317
|
+
darkslategray: 793726975,
|
|
318
|
+
darkslategrey: 793726975,
|
|
319
|
+
darkturquoise: 13554175,
|
|
320
|
+
darkviolet: 2483082239,
|
|
321
|
+
deeppink: 4279538687,
|
|
322
|
+
deepskyblue: 12582911,
|
|
323
|
+
dimgray: 1768516095,
|
|
324
|
+
dimgrey: 1768516095,
|
|
325
|
+
dodgerblue: 512819199,
|
|
326
|
+
firebrick: 2988581631,
|
|
327
|
+
floralwhite: 4294635775,
|
|
328
|
+
forestgreen: 579543807,
|
|
329
|
+
fuchsia: 4278255615,
|
|
330
|
+
gainsboro: 3705462015,
|
|
331
|
+
ghostwhite: 4177068031,
|
|
332
|
+
gold: 4292280575,
|
|
333
|
+
goldenrod: 3668254975,
|
|
334
|
+
gray: 2155905279,
|
|
335
|
+
green: 8388863,
|
|
336
|
+
greenyellow: 2919182335,
|
|
337
|
+
grey: 2155905279,
|
|
338
|
+
honeydew: 4043305215,
|
|
339
|
+
hotpink: 4285117695,
|
|
340
|
+
indianred: 3445382399,
|
|
341
|
+
indigo: 1258324735,
|
|
342
|
+
ivory: 4294963455,
|
|
343
|
+
khaki: 4041641215,
|
|
344
|
+
lavender: 3873897215,
|
|
345
|
+
lavenderblush: 4293981695,
|
|
346
|
+
lawngreen: 2096890111,
|
|
347
|
+
lemonchiffon: 4294626815,
|
|
348
|
+
lightblue: 2916673279,
|
|
349
|
+
lightcoral: 4034953471,
|
|
350
|
+
lightcyan: 3774873599,
|
|
351
|
+
lightgoldenrodyellow: 4210742015,
|
|
352
|
+
lightgray: 3553874943,
|
|
353
|
+
lightgreen: 2431553791,
|
|
354
|
+
lightgrey: 3553874943,
|
|
355
|
+
lightpink: 4290167295,
|
|
356
|
+
lightsalmon: 4288707327,
|
|
357
|
+
lightseagreen: 548580095,
|
|
358
|
+
lightskyblue: 2278488831,
|
|
359
|
+
lightslategray: 2005441023,
|
|
360
|
+
lightslategrey: 2005441023,
|
|
361
|
+
lightsteelblue: 2965692159,
|
|
362
|
+
lightyellow: 4294959359,
|
|
363
|
+
lime: 16711935,
|
|
364
|
+
limegreen: 852308735,
|
|
365
|
+
linen: 4210091775,
|
|
366
|
+
magenta: 4278255615,
|
|
367
|
+
maroon: 2147483903,
|
|
368
|
+
mediumaquamarine: 1724754687,
|
|
369
|
+
mediumblue: 52735,
|
|
370
|
+
mediumorchid: 3126187007,
|
|
371
|
+
mediumpurple: 2473647103,
|
|
372
|
+
mediumseagreen: 1018393087,
|
|
373
|
+
mediumslateblue: 2070474495,
|
|
374
|
+
mediumspringgreen: 16423679,
|
|
375
|
+
mediumturquoise: 1221709055,
|
|
376
|
+
mediumvioletred: 3340076543,
|
|
377
|
+
midnightblue: 421097727,
|
|
378
|
+
mintcream: 4127193855,
|
|
379
|
+
mistyrose: 4293190143,
|
|
380
|
+
moccasin: 4293178879,
|
|
381
|
+
navajowhite: 4292783615,
|
|
382
|
+
navy: 33023,
|
|
383
|
+
oldlace: 4260751103,
|
|
384
|
+
olive: 2155872511,
|
|
385
|
+
olivedrab: 1804477439,
|
|
386
|
+
orange: 4289003775,
|
|
387
|
+
orangered: 4282712319,
|
|
388
|
+
orchid: 3664828159,
|
|
389
|
+
palegoldenrod: 4008225535,
|
|
390
|
+
palegreen: 2566625535,
|
|
391
|
+
paleturquoise: 2951671551,
|
|
392
|
+
palevioletred: 3681588223,
|
|
393
|
+
papayawhip: 4293907967,
|
|
394
|
+
peachpuff: 4292524543,
|
|
395
|
+
peru: 3448061951,
|
|
396
|
+
pink: 4290825215,
|
|
397
|
+
plum: 3718307327,
|
|
398
|
+
powderblue: 2967529215,
|
|
399
|
+
purple: 2147516671,
|
|
400
|
+
rebeccapurple: 1714657791,
|
|
401
|
+
red: 4278190335,
|
|
402
|
+
rosybrown: 3163525119,
|
|
403
|
+
royalblue: 1097458175,
|
|
404
|
+
saddlebrown: 2336560127,
|
|
405
|
+
salmon: 4202722047,
|
|
406
|
+
sandybrown: 4104413439,
|
|
407
|
+
seagreen: 780883967,
|
|
408
|
+
seashell: 4294307583,
|
|
409
|
+
sienna: 2689740287,
|
|
410
|
+
silver: 3233857791,
|
|
411
|
+
skyblue: 2278484991,
|
|
412
|
+
slateblue: 1784335871,
|
|
413
|
+
slategray: 1887473919,
|
|
414
|
+
slategrey: 1887473919,
|
|
415
|
+
snow: 4294638335,
|
|
416
|
+
springgreen: 16744447,
|
|
417
|
+
steelblue: 1182971135,
|
|
418
|
+
tan: 3535047935,
|
|
419
|
+
teal: 8421631,
|
|
420
|
+
thistle: 3636451583,
|
|
421
|
+
tomato: 4284696575,
|
|
422
|
+
turquoise: 1088475391,
|
|
423
|
+
violet: 4001558271,
|
|
424
|
+
wheat: 4125012991,
|
|
425
|
+
white: 4294967295,
|
|
426
|
+
whitesmoke: 4126537215,
|
|
427
|
+
yellow: 4294902015,
|
|
428
|
+
yellowgreen: 2597139199
|
|
429
|
+
}, q = "[-+]?\\d*\\.?\\d+", Fe = q + "%";
|
|
430
|
+
function Ue(...e) {
|
|
431
|
+
return "\\(\\s*(" + e.join(")\\s*,\\s*(") + ")\\s*\\)";
|
|
432
|
+
}
|
|
433
|
+
var is = new RegExp("rgb" + Ue(q, q, q)), rs = new RegExp("rgba" + Ue(q, q, q, q)), as = new RegExp("hsl" + Ue(q, Fe, Fe)), os = new RegExp(
|
|
434
|
+
"hsla" + Ue(q, Fe, Fe, q)
|
|
435
|
+
), us = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, cs = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, ls = /^#([0-9a-fA-F]{6})$/, ds = /^#([0-9a-fA-F]{8})$/;
|
|
436
|
+
function fs(e) {
|
|
437
|
+
let t;
|
|
438
|
+
return typeof e == "number" ? e >>> 0 === e && e >= 0 && e <= 4294967295 ? e : null : (t = ls.exec(e)) ? parseInt(t[1] + "ff", 16) >>> 0 : Y && Y[e] !== void 0 ? Y[e] : (t = is.exec(e)) ? (J(t[1]) << 24 | // r
|
|
439
|
+
J(t[2]) << 16 | // g
|
|
440
|
+
J(t[3]) << 8 | // b
|
|
441
|
+
255) >>> // a
|
|
442
|
+
0 : (t = rs.exec(e)) ? (J(t[1]) << 24 | // r
|
|
443
|
+
J(t[2]) << 16 | // g
|
|
444
|
+
J(t[3]) << 8 | // b
|
|
445
|
+
St(t[4])) >>> // a
|
|
446
|
+
0 : (t = us.exec(e)) ? parseInt(
|
|
447
|
+
t[1] + t[1] + // r
|
|
448
|
+
t[2] + t[2] + // g
|
|
449
|
+
t[3] + t[3] + // b
|
|
450
|
+
"ff",
|
|
451
|
+
// a
|
|
452
|
+
16
|
|
453
|
+
) >>> 0 : (t = ds.exec(e)) ? parseInt(t[1], 16) >>> 0 : (t = cs.exec(e)) ? parseInt(
|
|
454
|
+
t[1] + t[1] + // r
|
|
455
|
+
t[2] + t[2] + // g
|
|
456
|
+
t[3] + t[3] + // b
|
|
457
|
+
t[4] + t[4],
|
|
458
|
+
// a
|
|
459
|
+
16
|
|
460
|
+
) >>> 0 : (t = as.exec(e)) ? (At(
|
|
461
|
+
Pt(t[1]),
|
|
462
|
+
// h
|
|
463
|
+
Ie(t[2]),
|
|
464
|
+
// s
|
|
465
|
+
Ie(t[3])
|
|
466
|
+
// l
|
|
467
|
+
) | 255) >>> // a
|
|
468
|
+
0 : (t = os.exec(e)) ? (At(
|
|
469
|
+
Pt(t[1]),
|
|
470
|
+
// h
|
|
471
|
+
Ie(t[2]),
|
|
472
|
+
// s
|
|
473
|
+
Ie(t[3])
|
|
474
|
+
// l
|
|
475
|
+
) | St(t[4])) >>> // a
|
|
476
|
+
0 : null;
|
|
477
|
+
}
|
|
478
|
+
function Qe(e, t, n) {
|
|
479
|
+
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
480
|
+
}
|
|
481
|
+
function At(e, t, n) {
|
|
482
|
+
const s = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - s, r = Qe(i, s, e + 1 / 3), a = Qe(i, s, e), u = Qe(i, s, e - 1 / 3);
|
|
483
|
+
return Math.round(r * 255) << 24 | Math.round(a * 255) << 16 | Math.round(u * 255) << 8;
|
|
484
|
+
}
|
|
485
|
+
function J(e) {
|
|
486
|
+
const t = parseInt(e, 10);
|
|
487
|
+
return t < 0 ? 0 : t > 255 ? 255 : t;
|
|
488
|
+
}
|
|
489
|
+
function Pt(e) {
|
|
490
|
+
return (parseFloat(e) % 360 + 360) % 360 / 360;
|
|
491
|
+
}
|
|
492
|
+
function St(e) {
|
|
493
|
+
const t = parseFloat(e);
|
|
494
|
+
return t < 0 ? 0 : t > 1 ? 255 : Math.round(t * 255);
|
|
495
|
+
}
|
|
496
|
+
function Ie(e) {
|
|
497
|
+
const t = parseFloat(e);
|
|
498
|
+
return t < 0 ? 0 : t > 100 ? 1 : t / 100;
|
|
499
|
+
}
|
|
500
|
+
function It(e) {
|
|
501
|
+
let t = fs(e);
|
|
502
|
+
if (t === null) return e;
|
|
503
|
+
t = t || 0;
|
|
504
|
+
const n = (t & 4278190080) >>> 24, s = (t & 16711680) >>> 16, i = (t & 65280) >>> 8, r = (t & 255) / 255;
|
|
505
|
+
return `rgba(${n}, ${s}, ${i}, ${r})`;
|
|
506
|
+
}
|
|
507
|
+
var he = (e, t, n) => {
|
|
508
|
+
if (c.fun(e))
|
|
509
|
+
return e;
|
|
510
|
+
if (c.arr(e))
|
|
511
|
+
return he({
|
|
512
|
+
range: e,
|
|
513
|
+
output: t,
|
|
514
|
+
extrapolate: n
|
|
515
|
+
});
|
|
516
|
+
if (c.str(e.output[0]))
|
|
517
|
+
return lt(e);
|
|
518
|
+
const s = e, i = s.output, r = s.range || [0, 1], a = s.extrapolateLeft || s.extrapolate || "extend", u = s.extrapolateRight || s.extrapolate || "extend", l = s.easing || ((o) => o);
|
|
519
|
+
return (o) => {
|
|
520
|
+
const m = ms(o, r);
|
|
521
|
+
return hs(
|
|
522
|
+
o,
|
|
523
|
+
r[m],
|
|
524
|
+
r[m + 1],
|
|
525
|
+
i[m],
|
|
526
|
+
i[m + 1],
|
|
527
|
+
l,
|
|
528
|
+
a,
|
|
529
|
+
u,
|
|
530
|
+
s.map
|
|
531
|
+
);
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
function hs(e, t, n, s, i, r, a, u, l) {
|
|
535
|
+
let o = l ? l(e) : e;
|
|
536
|
+
if (o < t) {
|
|
537
|
+
if (a === "identity") return o;
|
|
538
|
+
a === "clamp" && (o = t);
|
|
539
|
+
}
|
|
540
|
+
if (o > n) {
|
|
541
|
+
if (u === "identity") return o;
|
|
542
|
+
u === "clamp" && (o = n);
|
|
543
|
+
}
|
|
544
|
+
return s === i ? s : t === n ? e <= t ? s : i : (t === -1 / 0 ? o = -o : n === 1 / 0 ? o = o - t : o = (o - t) / (n - t), o = r(o), s === -1 / 0 ? o = -o : i === 1 / 0 ? o = o + s : o = o * (i - s) + s, o);
|
|
545
|
+
}
|
|
546
|
+
function ms(e, t) {
|
|
547
|
+
for (var n = 1; n < t.length - 1 && !(t[n] >= e); ++n)
|
|
548
|
+
;
|
|
549
|
+
return n - 1;
|
|
550
|
+
}
|
|
551
|
+
var tn = {
|
|
552
|
+
linear: (e) => e,
|
|
553
|
+
easeInOutCubic: (e) => e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2
|
|
554
|
+
}, me = Symbol.for("FluidValue.get"), se = Symbol.for("FluidValue.observers"), V = (e) => !!(e && e[me]), E = (e) => e && e[me] ? e[me]() : e, Rt = (e) => e[se] || null;
|
|
555
|
+
function ps(e, t) {
|
|
556
|
+
e.eventObserved ? e.eventObserved(t) : e(t);
|
|
557
|
+
}
|
|
558
|
+
function pe(e, t) {
|
|
559
|
+
const n = e[se];
|
|
560
|
+
n && n.forEach((s) => {
|
|
561
|
+
ps(s, t);
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
var nn = class {
|
|
565
|
+
constructor(e) {
|
|
566
|
+
if (!e && !(e = this.get))
|
|
567
|
+
throw Error("Unknown getter");
|
|
568
|
+
gs(this, e);
|
|
569
|
+
}
|
|
570
|
+
}, gs = (e, t) => sn(e, me, t);
|
|
571
|
+
function ie(e, t) {
|
|
572
|
+
if (e[me]) {
|
|
573
|
+
let n = e[se];
|
|
574
|
+
n || sn(e, se, n = /* @__PURE__ */ new Set()), n.has(t) || (n.add(t), e.observerAdded && e.observerAdded(n.size, t));
|
|
575
|
+
}
|
|
576
|
+
return t;
|
|
577
|
+
}
|
|
578
|
+
function ge(e, t) {
|
|
579
|
+
const n = e[se];
|
|
580
|
+
if (n && n.has(t)) {
|
|
581
|
+
const s = n.size - 1;
|
|
582
|
+
s ? n.delete(t) : e[se] = null, e.observerRemoved && e.observerRemoved(s, t);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
var sn = (e, t, n) => Object.defineProperty(e, t, {
|
|
586
|
+
value: n,
|
|
587
|
+
writable: !0,
|
|
588
|
+
configurable: !0
|
|
589
|
+
}), xe = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, vs = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi, xt = new RegExp(`(${xe.source})(%|[a-z]+)`, "i"), ys = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, De = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/, rn = (e) => {
|
|
590
|
+
const [t, n] = _s(e);
|
|
591
|
+
if (!t || ct())
|
|
592
|
+
return e;
|
|
593
|
+
const s = window.getComputedStyle(document.documentElement).getPropertyValue(t);
|
|
594
|
+
if (s)
|
|
595
|
+
return s.trim();
|
|
596
|
+
if (n && n.startsWith("--")) {
|
|
597
|
+
const i = window.getComputedStyle(document.documentElement).getPropertyValue(n);
|
|
598
|
+
return i || e;
|
|
599
|
+
} else {
|
|
600
|
+
if (n && De.test(n))
|
|
601
|
+
return rn(n);
|
|
602
|
+
if (n)
|
|
603
|
+
return n;
|
|
604
|
+
}
|
|
605
|
+
return e;
|
|
606
|
+
}, _s = (e) => {
|
|
607
|
+
const t = De.exec(e);
|
|
608
|
+
if (!t) return [,];
|
|
609
|
+
const [, n, s] = t;
|
|
610
|
+
return [n, s];
|
|
611
|
+
}, Me, bs = (e, t, n, s, i) => `rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(s)}, ${i})`, an = (e) => {
|
|
612
|
+
Me || (Me = Y ? (
|
|
613
|
+
// match color names, ignore partial matches
|
|
614
|
+
new RegExp(`(${Object.keys(Y).join("|")})(?!\\w)`, "g")
|
|
615
|
+
) : (
|
|
616
|
+
// never match
|
|
617
|
+
/^\b$/
|
|
618
|
+
));
|
|
619
|
+
const t = e.output.map((r) => E(r).replace(De, rn).replace(vs, It).replace(Me, It)), n = t.map((r) => r.match(xe).map(Number)), i = n[0].map(
|
|
620
|
+
(r, a) => n.map((u) => {
|
|
621
|
+
if (!(a in u))
|
|
622
|
+
throw Error('The arity of each "output" value must be equal');
|
|
623
|
+
return u[a];
|
|
624
|
+
})
|
|
625
|
+
).map(
|
|
626
|
+
(r) => he({ ...e, output: r })
|
|
627
|
+
);
|
|
628
|
+
return (r) => {
|
|
629
|
+
var l;
|
|
630
|
+
const a = !xt.test(t[0]) && ((l = t.find((o) => xt.test(o))) == null ? void 0 : l.replace(xe, ""));
|
|
631
|
+
let u = 0;
|
|
632
|
+
return t[0].replace(
|
|
633
|
+
xe,
|
|
634
|
+
() => `${i[u++](r)}${a || ""}`
|
|
635
|
+
).replace(ys, bs);
|
|
636
|
+
};
|
|
637
|
+
}, ft = "react-spring: ", on = (e) => {
|
|
638
|
+
const t = e;
|
|
639
|
+
let n = !1;
|
|
640
|
+
if (typeof t != "function")
|
|
641
|
+
throw new TypeError(`${ft}once requires a function parameter`);
|
|
642
|
+
return (...s) => {
|
|
643
|
+
n || (t(...s), n = !0);
|
|
644
|
+
};
|
|
645
|
+
}, ws = on(console.warn);
|
|
646
|
+
function As() {
|
|
647
|
+
ws(
|
|
648
|
+
`${ft}The "interpolate" function is deprecated in v9 (use "to" instead)`
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
var Ps = on(console.warn);
|
|
652
|
+
function Ss() {
|
|
653
|
+
Ps(
|
|
654
|
+
`${ft}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`
|
|
655
|
+
);
|
|
656
|
+
}
|
|
657
|
+
function qe(e) {
|
|
658
|
+
return c.str(e) && (e[0] == "#" || /\d/.test(e) || // Do not identify a CSS variable as an AnimatedString if its SSR
|
|
659
|
+
!ct() && De.test(e) || e in (Y || {}));
|
|
660
|
+
}
|
|
661
|
+
var ht = ct() ? Oe : We, Is = () => {
|
|
662
|
+
const e = K(!1);
|
|
663
|
+
return ht(() => (e.current = !0, () => {
|
|
664
|
+
e.current = !1;
|
|
665
|
+
}), []), e;
|
|
666
|
+
};
|
|
667
|
+
function un() {
|
|
668
|
+
const e = ee()[1], t = Is();
|
|
669
|
+
return () => {
|
|
670
|
+
t.current && e(Math.random());
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
var cn = (e) => Oe(e, Rs), Rs = [];
|
|
674
|
+
function Ct(e) {
|
|
675
|
+
const t = K(void 0);
|
|
676
|
+
return Oe(() => {
|
|
677
|
+
t.current = e;
|
|
678
|
+
}), t.current;
|
|
679
|
+
}
|
|
680
|
+
var ve = Symbol.for("Animated:node"), xs = (e) => !!e && e[ve] === e, L = (e) => e && e[ve], mt = (e, t) => Jn(e, ve, t), je = (e) => e && e[ve] && e[ve].getPayload(), ln = class {
|
|
681
|
+
constructor() {
|
|
682
|
+
mt(this, this);
|
|
683
|
+
}
|
|
684
|
+
/** Get every `AnimatedValue` used by this node. */
|
|
685
|
+
getPayload() {
|
|
686
|
+
return this.payload || [];
|
|
687
|
+
}
|
|
688
|
+
}, $e = class dn extends ln {
|
|
689
|
+
constructor(t) {
|
|
690
|
+
super(), this._value = t, this.done = !0, this.durationProgress = 0, c.num(this._value) && (this.lastPosition = this._value);
|
|
691
|
+
}
|
|
692
|
+
/** @internal */
|
|
693
|
+
static create(t) {
|
|
694
|
+
return new dn(t);
|
|
695
|
+
}
|
|
696
|
+
getPayload() {
|
|
697
|
+
return [this];
|
|
698
|
+
}
|
|
699
|
+
getValue() {
|
|
700
|
+
return this._value;
|
|
701
|
+
}
|
|
702
|
+
setValue(t, n) {
|
|
703
|
+
return c.num(t) && (this.lastPosition = t, n && (t = Math.round(t / n) * n, this.done && (this.lastPosition = t))), this._value === t ? !1 : (this._value = t, !0);
|
|
704
|
+
}
|
|
705
|
+
reset() {
|
|
706
|
+
const { done: t } = this;
|
|
707
|
+
this.done = !1, c.num(this._value) && (this.elapsedTime = 0, this.durationProgress = 0, this.lastPosition = this._value, t && (this.lastVelocity = null), this.v0 = null);
|
|
708
|
+
}
|
|
709
|
+
}, Te = class fn extends $e {
|
|
710
|
+
constructor(t) {
|
|
711
|
+
super(0), this._string = null, this._toString = he({
|
|
712
|
+
output: [t, t]
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
/** @internal */
|
|
716
|
+
static create(t) {
|
|
717
|
+
return new fn(t);
|
|
718
|
+
}
|
|
719
|
+
getValue() {
|
|
720
|
+
const t = this._string;
|
|
721
|
+
return t ?? (this._string = this._toString(this._value));
|
|
722
|
+
}
|
|
723
|
+
setValue(t) {
|
|
724
|
+
if (c.str(t)) {
|
|
725
|
+
if (t == this._string)
|
|
726
|
+
return !1;
|
|
727
|
+
this._string = t, this._value = 1;
|
|
728
|
+
} else if (super.setValue(t))
|
|
729
|
+
this._string = null;
|
|
730
|
+
else
|
|
731
|
+
return !1;
|
|
732
|
+
return !0;
|
|
733
|
+
}
|
|
734
|
+
reset(t) {
|
|
735
|
+
t && (this._toString = he({
|
|
736
|
+
output: [this.getValue(), t]
|
|
737
|
+
})), this._value = 0, super.reset();
|
|
738
|
+
}
|
|
739
|
+
}, Ee = { dependencies: null }, ze = class extends ln {
|
|
740
|
+
constructor(e) {
|
|
741
|
+
super(), this.source = e, this.setValue(e);
|
|
742
|
+
}
|
|
743
|
+
getValue(e) {
|
|
744
|
+
const t = {};
|
|
745
|
+
return Q(this.source, (n, s) => {
|
|
746
|
+
xs(n) ? t[s] = n.getValue(e) : V(n) ? t[s] = E(n) : e || (t[s] = n);
|
|
747
|
+
}), t;
|
|
748
|
+
}
|
|
749
|
+
/** Replace the raw object data */
|
|
750
|
+
setValue(e) {
|
|
751
|
+
this.source = e, this.payload = this._makePayload(e);
|
|
752
|
+
}
|
|
753
|
+
reset() {
|
|
754
|
+
this.payload && P(this.payload, (e) => e.reset());
|
|
755
|
+
}
|
|
756
|
+
/** Create a payload set. */
|
|
757
|
+
_makePayload(e) {
|
|
758
|
+
if (e) {
|
|
759
|
+
const t = /* @__PURE__ */ new Set();
|
|
760
|
+
return Q(e, this._addToPayload, t), Array.from(t);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
/** Add to a payload set. */
|
|
764
|
+
_addToPayload(e) {
|
|
765
|
+
Ee.dependencies && V(e) && Ee.dependencies.add(e);
|
|
766
|
+
const t = je(e);
|
|
767
|
+
t && P(t, (n) => this.add(n));
|
|
768
|
+
}
|
|
769
|
+
}, Cs = class hn extends ze {
|
|
770
|
+
constructor(t) {
|
|
771
|
+
super(t);
|
|
772
|
+
}
|
|
773
|
+
/** @internal */
|
|
774
|
+
static create(t) {
|
|
775
|
+
return new hn(t);
|
|
776
|
+
}
|
|
777
|
+
getValue() {
|
|
778
|
+
return this.source.map((t) => t.getValue());
|
|
779
|
+
}
|
|
780
|
+
setValue(t) {
|
|
781
|
+
const n = this.getPayload();
|
|
782
|
+
return t.length == n.length ? n.map((s, i) => s.setValue(t[i])).some(Boolean) : (super.setValue(t.map(ks)), !0);
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
function ks(e) {
|
|
786
|
+
return (qe(e) ? Te : $e).create(e);
|
|
787
|
+
}
|
|
788
|
+
function Xe(e) {
|
|
789
|
+
const t = L(e);
|
|
790
|
+
return t ? t.constructor : c.arr(e) ? Cs : qe(e) ? Te : $e;
|
|
791
|
+
}
|
|
792
|
+
var kt = (e, t) => {
|
|
793
|
+
const n = (
|
|
794
|
+
// Function components must use "forwardRef" to avoid being
|
|
795
|
+
// re-rendered on every animation frame.
|
|
796
|
+
!c.fun(e) || e.prototype && e.prototype.isReactComponent
|
|
797
|
+
);
|
|
798
|
+
return st((s, i) => {
|
|
799
|
+
const r = K(null), a = n && // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
800
|
+
Un(
|
|
801
|
+
(_) => {
|
|
802
|
+
r.current = Es(i, _);
|
|
803
|
+
},
|
|
804
|
+
[i]
|
|
805
|
+
), [u, l] = Ts(s, t), o = un(), m = () => {
|
|
806
|
+
const _ = r.current;
|
|
807
|
+
if (n && !_)
|
|
808
|
+
return;
|
|
809
|
+
(_ ? t.applyAnimatedValues(_, u.getValue(!0)) : !1) === !1 && o();
|
|
810
|
+
}, d = new Fs(m, l), h = K(void 0);
|
|
811
|
+
ht(() => (h.current = d, P(l, (_) => ie(_, d)), () => {
|
|
812
|
+
h.current && (P(
|
|
813
|
+
h.current.deps,
|
|
814
|
+
(_) => ge(_, h.current)
|
|
815
|
+
), w.cancel(h.current.update));
|
|
816
|
+
})), Oe(m, []), cn(() => () => {
|
|
817
|
+
const _ = h.current;
|
|
818
|
+
P(_.deps, (y) => ge(y, _));
|
|
819
|
+
});
|
|
820
|
+
const g = t.getComponentProps(u.getValue());
|
|
821
|
+
return /* @__PURE__ */ Qt.createElement(e, { ...g, ref: a });
|
|
822
|
+
});
|
|
823
|
+
}, Fs = class {
|
|
824
|
+
constructor(e, t) {
|
|
825
|
+
this.update = e, this.deps = t;
|
|
826
|
+
}
|
|
827
|
+
eventObserved(e) {
|
|
828
|
+
e.type == "change" && w.write(this.update);
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
function Ts(e, t) {
|
|
832
|
+
const n = /* @__PURE__ */ new Set();
|
|
833
|
+
return Ee.dependencies = n, e.style && (e = {
|
|
834
|
+
...e,
|
|
835
|
+
style: t.createAnimatedStyle(e.style)
|
|
836
|
+
}), e = new ze(e), Ee.dependencies = null, [e, n];
|
|
837
|
+
}
|
|
838
|
+
function Es(e, t) {
|
|
839
|
+
return e && (c.fun(e) ? e(t) : e.current = t), t;
|
|
840
|
+
}
|
|
841
|
+
var Ft = Symbol.for("AnimatedComponent"), Os = (e, {
|
|
842
|
+
applyAnimatedValues: t = () => !1,
|
|
843
|
+
createAnimatedStyle: n = (i) => new ze(i),
|
|
844
|
+
getComponentProps: s = (i) => i
|
|
845
|
+
} = {}) => {
|
|
846
|
+
const i = {
|
|
847
|
+
applyAnimatedValues: t,
|
|
848
|
+
createAnimatedStyle: n,
|
|
849
|
+
getComponentProps: s
|
|
850
|
+
}, r = (a) => {
|
|
851
|
+
const u = Tt(a) || "Anonymous";
|
|
852
|
+
return c.str(a) ? a = r[a] || (r[a] = kt(a, i)) : a = a[Ft] || (a[Ft] = kt(a, i)), a.displayName = `Animated(${u})`, a;
|
|
853
|
+
};
|
|
854
|
+
return Q(e, (a, u) => {
|
|
855
|
+
c.arr(e) && (u = Tt(a)), r[u] = r(a);
|
|
856
|
+
}), {
|
|
857
|
+
animated: r
|
|
858
|
+
};
|
|
859
|
+
}, Tt = (e) => c.str(e) ? e : e && c.str(e.displayName) ? e.displayName : c.fun(e) && e.name || null;
|
|
860
|
+
function Z(e, ...t) {
|
|
861
|
+
return c.fun(e) ? e(...t) : e;
|
|
862
|
+
}
|
|
863
|
+
var de = (e, t) => e === !0 || !!(t && e && (c.fun(e) ? e(t) : O(e).includes(t))), mn = (e, t) => c.obj(e) ? t && e[t] : e, pn = (e, t) => e.default === !0 ? e[t] : e.default ? e.default[t] : void 0, Vs = (e) => e, pt = (e, t = Vs) => {
|
|
864
|
+
let n = Ns;
|
|
865
|
+
e.default && e.default !== !0 && (e = e.default, n = Object.keys(e));
|
|
866
|
+
const s = {};
|
|
867
|
+
for (const i of n) {
|
|
868
|
+
const r = t(e[i], i);
|
|
869
|
+
c.und(r) || (s[i] = r);
|
|
870
|
+
}
|
|
871
|
+
return s;
|
|
872
|
+
}, Ns = [
|
|
873
|
+
"config",
|
|
874
|
+
"onProps",
|
|
875
|
+
"onStart",
|
|
876
|
+
"onChange",
|
|
877
|
+
"onPause",
|
|
878
|
+
"onResume",
|
|
879
|
+
"onRest"
|
|
880
|
+
], Us = {
|
|
881
|
+
config: 1,
|
|
882
|
+
from: 1,
|
|
883
|
+
to: 1,
|
|
884
|
+
ref: 1,
|
|
885
|
+
loop: 1,
|
|
886
|
+
reset: 1,
|
|
887
|
+
pause: 1,
|
|
888
|
+
cancel: 1,
|
|
889
|
+
reverse: 1,
|
|
890
|
+
immediate: 1,
|
|
891
|
+
default: 1,
|
|
892
|
+
delay: 1,
|
|
893
|
+
onProps: 1,
|
|
894
|
+
onStart: 1,
|
|
895
|
+
onChange: 1,
|
|
896
|
+
onPause: 1,
|
|
897
|
+
onResume: 1,
|
|
898
|
+
onRest: 1,
|
|
899
|
+
onResolve: 1,
|
|
900
|
+
// Transition props
|
|
901
|
+
items: 1,
|
|
902
|
+
trail: 1,
|
|
903
|
+
sort: 1,
|
|
904
|
+
expires: 1,
|
|
905
|
+
initial: 1,
|
|
906
|
+
enter: 1,
|
|
907
|
+
update: 1,
|
|
908
|
+
leave: 1,
|
|
909
|
+
children: 1,
|
|
910
|
+
onDestroyed: 1,
|
|
911
|
+
// Internal props
|
|
912
|
+
keys: 1,
|
|
913
|
+
callId: 1,
|
|
914
|
+
parentId: 1
|
|
915
|
+
};
|
|
916
|
+
function Ds(e) {
|
|
917
|
+
const t = {};
|
|
918
|
+
let n = 0;
|
|
919
|
+
if (Q(e, (s, i) => {
|
|
920
|
+
Us[i] || (t[i] = s, n++);
|
|
921
|
+
}), n)
|
|
922
|
+
return t;
|
|
923
|
+
}
|
|
924
|
+
function gn(e) {
|
|
925
|
+
const t = Ds(e);
|
|
926
|
+
if (t) {
|
|
927
|
+
const n = { to: t };
|
|
928
|
+
return Q(e, (s, i) => i in t || (n[i] = s)), n;
|
|
929
|
+
}
|
|
930
|
+
return { ...e };
|
|
931
|
+
}
|
|
932
|
+
function ye(e) {
|
|
933
|
+
return e = E(e), c.arr(e) ? e.map(ye) : qe(e) ? j.createStringInterpolator({
|
|
934
|
+
range: [0, 1],
|
|
935
|
+
output: [e, e]
|
|
936
|
+
})(1) : e;
|
|
937
|
+
}
|
|
938
|
+
function qs(e) {
|
|
939
|
+
for (const t in e) return !0;
|
|
940
|
+
return !1;
|
|
941
|
+
}
|
|
942
|
+
function Je(e) {
|
|
943
|
+
return c.fun(e) || c.arr(e) && c.obj(e[0]);
|
|
944
|
+
}
|
|
945
|
+
function js(e, t) {
|
|
946
|
+
var n;
|
|
947
|
+
(n = e.ref) == null || n.delete(e), t == null || t.delete(e);
|
|
948
|
+
}
|
|
949
|
+
function $s(e, t) {
|
|
950
|
+
var n;
|
|
951
|
+
t && e.ref !== t && ((n = e.ref) == null || n.delete(e), t.add(e), e.ref = t);
|
|
952
|
+
}
|
|
953
|
+
var zs = {
|
|
954
|
+
default: { tension: 170, friction: 26 }
|
|
955
|
+
}, et = {
|
|
956
|
+
...zs.default,
|
|
957
|
+
mass: 1,
|
|
958
|
+
damping: 1,
|
|
959
|
+
easing: tn.linear,
|
|
960
|
+
clamp: !1
|
|
961
|
+
}, Ls = class {
|
|
962
|
+
constructor() {
|
|
963
|
+
this.velocity = 0, Object.assign(this, et);
|
|
964
|
+
}
|
|
965
|
+
};
|
|
966
|
+
function Qs(e, t, n) {
|
|
967
|
+
n && (n = { ...n }, Et(n, t), t = { ...n, ...t }), Et(e, t), Object.assign(e, t);
|
|
968
|
+
for (const a in et)
|
|
969
|
+
e[a] == null && (e[a] = et[a]);
|
|
970
|
+
let { frequency: s, damping: i } = e;
|
|
971
|
+
const { mass: r } = e;
|
|
972
|
+
return c.und(s) || (s < 0.01 && (s = 0.01), i < 0 && (i = 0), e.tension = Math.pow(2 * Math.PI / s, 2) * r, e.friction = 4 * Math.PI * i * r / s), e;
|
|
973
|
+
}
|
|
974
|
+
function Et(e, t) {
|
|
975
|
+
if (!c.und(t.decay))
|
|
976
|
+
e.duration = void 0;
|
|
977
|
+
else {
|
|
978
|
+
const n = !c.und(t.tension) || !c.und(t.friction);
|
|
979
|
+
(n || !c.und(t.frequency) || !c.und(t.damping) || !c.und(t.mass)) && (e.duration = void 0, e.decay = void 0), n && (e.frequency = void 0);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
var Ot = [], Ms = class {
|
|
983
|
+
constructor() {
|
|
984
|
+
this.changed = !1, this.values = Ot, this.toValues = null, this.fromValues = Ot, this.config = new Ls(), this.immediate = !1;
|
|
985
|
+
}
|
|
986
|
+
};
|
|
987
|
+
function vn(e, { key: t, props: n, defaultProps: s, state: i, actions: r }) {
|
|
988
|
+
return new Promise((a, u) => {
|
|
989
|
+
let l, o, m = de(n.cancel ?? (s == null ? void 0 : s.cancel), t);
|
|
990
|
+
if (m)
|
|
991
|
+
g();
|
|
992
|
+
else {
|
|
993
|
+
c.und(n.pause) || (i.paused = de(n.pause, t));
|
|
994
|
+
let _ = s == null ? void 0 : s.pause;
|
|
995
|
+
_ !== !0 && (_ = i.paused || de(_, t)), l = Z(n.delay || 0, t), _ ? (i.resumeQueue.add(h), r.pause()) : (r.resume(), h());
|
|
996
|
+
}
|
|
997
|
+
function d() {
|
|
998
|
+
i.resumeQueue.add(h), i.timeouts.delete(o), o.cancel(), l = o.time - w.now();
|
|
999
|
+
}
|
|
1000
|
+
function h() {
|
|
1001
|
+
l > 0 && !j.skipAnimation ? (i.delayed = !0, o = w.setTimeout(g, l), i.pauseQueue.add(d), i.timeouts.add(o)) : g();
|
|
1002
|
+
}
|
|
1003
|
+
function g() {
|
|
1004
|
+
i.delayed && (i.delayed = !1), i.pauseQueue.delete(d), i.timeouts.delete(o), e <= (i.cancelId || 0) && (m = !0);
|
|
1005
|
+
try {
|
|
1006
|
+
r.start({ ...n, callId: e, cancel: m }, a);
|
|
1007
|
+
} catch (_) {
|
|
1008
|
+
u(_);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
1013
|
+
var gt = (e, t) => t.length == 1 ? t[0] : t.some((n) => n.cancelled) ? ne(e.get()) : t.every((n) => n.noop) ? yn(e.get()) : D(
|
|
1014
|
+
e.get(),
|
|
1015
|
+
t.every((n) => n.finished)
|
|
1016
|
+
), yn = (e) => ({
|
|
1017
|
+
value: e,
|
|
1018
|
+
noop: !0,
|
|
1019
|
+
finished: !0,
|
|
1020
|
+
cancelled: !1
|
|
1021
|
+
}), D = (e, t, n = !1) => ({
|
|
1022
|
+
value: e,
|
|
1023
|
+
finished: t,
|
|
1024
|
+
cancelled: n
|
|
1025
|
+
}), ne = (e) => ({
|
|
1026
|
+
value: e,
|
|
1027
|
+
cancelled: !0,
|
|
1028
|
+
finished: !1
|
|
1029
|
+
});
|
|
1030
|
+
function _n(e, t, n, s) {
|
|
1031
|
+
const { callId: i, parentId: r, onRest: a } = t, { asyncTo: u, promise: l } = n;
|
|
1032
|
+
return !r && e === u && !t.reset ? l : n.promise = (async () => {
|
|
1033
|
+
n.asyncId = i, n.asyncTo = e;
|
|
1034
|
+
const o = pt(
|
|
1035
|
+
t,
|
|
1036
|
+
(p, f) => (
|
|
1037
|
+
// The `onRest` prop is only called when the `runAsync` promise is resolved.
|
|
1038
|
+
f === "onRest" ? void 0 : p
|
|
1039
|
+
)
|
|
1040
|
+
);
|
|
1041
|
+
let m, d;
|
|
1042
|
+
const h = new Promise(
|
|
1043
|
+
(p, f) => (m = p, d = f)
|
|
1044
|
+
), g = (p) => {
|
|
1045
|
+
const f = (
|
|
1046
|
+
// The `cancel` prop or `stop` method was used.
|
|
1047
|
+
i <= (n.cancelId || 0) && ne(s) || // The async `to` prop was replaced.
|
|
1048
|
+
i !== n.asyncId && D(s, !1)
|
|
1049
|
+
);
|
|
1050
|
+
if (f)
|
|
1051
|
+
throw p.result = f, d(p), p;
|
|
1052
|
+
}, _ = (p, f) => {
|
|
1053
|
+
const b = new Vt(), v = new Nt();
|
|
1054
|
+
return (async () => {
|
|
1055
|
+
if (j.skipAnimation)
|
|
1056
|
+
throw _e(n), v.result = D(s, !1), d(v), v;
|
|
1057
|
+
g(b);
|
|
1058
|
+
const A = c.obj(p) ? { ...p } : { ...f, to: p };
|
|
1059
|
+
A.parentId = i, Q(o, (k, x) => {
|
|
1060
|
+
c.und(A[x]) && (A[x] = k);
|
|
1061
|
+
});
|
|
1062
|
+
const S = await s.start(A);
|
|
1063
|
+
return g(b), n.paused && await new Promise((k) => {
|
|
1064
|
+
n.resumeQueue.add(k);
|
|
1065
|
+
}), S;
|
|
1066
|
+
})();
|
|
1067
|
+
};
|
|
1068
|
+
let y;
|
|
1069
|
+
if (j.skipAnimation)
|
|
1070
|
+
return _e(n), D(s, !1);
|
|
1071
|
+
try {
|
|
1072
|
+
let p;
|
|
1073
|
+
c.arr(e) ? p = (async (f) => {
|
|
1074
|
+
for (const b of f)
|
|
1075
|
+
await _(b);
|
|
1076
|
+
})(e) : p = Promise.resolve(e(_, s.stop.bind(s))), await Promise.all([p.then(m), h]), y = D(s.get(), !0, !1);
|
|
1077
|
+
} catch (p) {
|
|
1078
|
+
if (p instanceof Vt)
|
|
1079
|
+
y = p.result;
|
|
1080
|
+
else if (p instanceof Nt)
|
|
1081
|
+
y = p.result;
|
|
1082
|
+
else
|
|
1083
|
+
throw p;
|
|
1084
|
+
} finally {
|
|
1085
|
+
i == n.asyncId && (n.asyncId = r, n.asyncTo = r ? u : void 0, n.promise = r ? l : void 0);
|
|
1086
|
+
}
|
|
1087
|
+
return c.fun(a) && w.batchedUpdates(() => {
|
|
1088
|
+
a(y, s, s.item);
|
|
1089
|
+
}), y;
|
|
1090
|
+
})();
|
|
1091
|
+
}
|
|
1092
|
+
function _e(e, t) {
|
|
1093
|
+
ce(e.timeouts, (n) => n.cancel()), e.pauseQueue.clear(), e.resumeQueue.clear(), e.asyncId = e.asyncTo = e.promise = void 0, t && (e.cancelId = t);
|
|
1094
|
+
}
|
|
1095
|
+
var Vt = class extends Error {
|
|
1096
|
+
constructor() {
|
|
1097
|
+
super(
|
|
1098
|
+
"An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."
|
|
1099
|
+
);
|
|
1100
|
+
}
|
|
1101
|
+
}, Nt = class extends Error {
|
|
1102
|
+
constructor() {
|
|
1103
|
+
super("SkipAnimationSignal");
|
|
1104
|
+
}
|
|
1105
|
+
}, tt = (e) => e instanceof vt, Gs = 1, vt = class extends nn {
|
|
1106
|
+
constructor() {
|
|
1107
|
+
super(...arguments), this.id = Gs++, this._priority = 0;
|
|
1108
|
+
}
|
|
1109
|
+
get priority() {
|
|
1110
|
+
return this._priority;
|
|
1111
|
+
}
|
|
1112
|
+
set priority(e) {
|
|
1113
|
+
this._priority != e && (this._priority = e, this._onPriorityChange(e));
|
|
1114
|
+
}
|
|
1115
|
+
/** Get the current value */
|
|
1116
|
+
get() {
|
|
1117
|
+
const e = L(this);
|
|
1118
|
+
return e && e.getValue();
|
|
1119
|
+
}
|
|
1120
|
+
/** Create a spring that maps our value to another value */
|
|
1121
|
+
to(...e) {
|
|
1122
|
+
return j.to(this, e);
|
|
1123
|
+
}
|
|
1124
|
+
/** @deprecated Use the `to` method instead. */
|
|
1125
|
+
interpolate(...e) {
|
|
1126
|
+
return As(), j.to(this, e);
|
|
1127
|
+
}
|
|
1128
|
+
toJSON() {
|
|
1129
|
+
return this.get();
|
|
1130
|
+
}
|
|
1131
|
+
observerAdded(e) {
|
|
1132
|
+
e == 1 && this._attach();
|
|
1133
|
+
}
|
|
1134
|
+
observerRemoved(e) {
|
|
1135
|
+
e == 0 && this._detach();
|
|
1136
|
+
}
|
|
1137
|
+
/** Called when the first child is added. */
|
|
1138
|
+
_attach() {
|
|
1139
|
+
}
|
|
1140
|
+
/** Called when the last child is removed. */
|
|
1141
|
+
_detach() {
|
|
1142
|
+
}
|
|
1143
|
+
/** Tell our children about our new value */
|
|
1144
|
+
_onChange(e, t = !1) {
|
|
1145
|
+
pe(this, {
|
|
1146
|
+
type: "change",
|
|
1147
|
+
parent: this,
|
|
1148
|
+
value: e,
|
|
1149
|
+
idle: t
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1152
|
+
/** Tell our children about our new priority */
|
|
1153
|
+
_onPriorityChange(e) {
|
|
1154
|
+
this.idle || Ne.sort(this), pe(this, {
|
|
1155
|
+
type: "priority",
|
|
1156
|
+
parent: this,
|
|
1157
|
+
priority: e
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
}, X = Symbol.for("SpringPhase"), bn = 1, wn = 2, An = 4, Ge = (e) => (e[X] & bn) > 0, B = (e) => (e[X] & wn) > 0, re = (e) => (e[X] & An) > 0, Ut = (e, t) => t ? e[X] |= wn | bn : e[X] &= -3, Dt = (e, t) => t ? e[X] |= An : e[X] &= -5, Bs = class extends vt {
|
|
1161
|
+
constructor(e, t) {
|
|
1162
|
+
if (super(), this.animation = new Ms(), this.defaultProps = {}, this._state = {
|
|
1163
|
+
paused: !1,
|
|
1164
|
+
delayed: !1,
|
|
1165
|
+
pauseQueue: /* @__PURE__ */ new Set(),
|
|
1166
|
+
resumeQueue: /* @__PURE__ */ new Set(),
|
|
1167
|
+
timeouts: /* @__PURE__ */ new Set()
|
|
1168
|
+
}, this._pendingCalls = /* @__PURE__ */ new Set(), this._lastCallId = 0, this._lastToId = 0, this._memoizedDuration = 0, !c.und(e) || !c.und(t)) {
|
|
1169
|
+
const n = c.obj(e) ? { ...e } : { ...t, from: e };
|
|
1170
|
+
c.und(n.default) && (n.default = !0), this.start(n);
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
/** Equals true when not advancing on each frame. */
|
|
1174
|
+
get idle() {
|
|
1175
|
+
return !(B(this) || this._state.asyncTo) || re(this);
|
|
1176
|
+
}
|
|
1177
|
+
get goal() {
|
|
1178
|
+
return E(this.animation.to);
|
|
1179
|
+
}
|
|
1180
|
+
get velocity() {
|
|
1181
|
+
const e = L(this);
|
|
1182
|
+
return e instanceof $e ? e.lastVelocity || 0 : e.getPayload().map((t) => t.lastVelocity || 0);
|
|
1183
|
+
}
|
|
1184
|
+
/**
|
|
1185
|
+
* When true, this value has been animated at least once.
|
|
1186
|
+
*/
|
|
1187
|
+
get hasAnimated() {
|
|
1188
|
+
return Ge(this);
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* When true, this value has an unfinished animation,
|
|
1192
|
+
* which is either active or paused.
|
|
1193
|
+
*/
|
|
1194
|
+
get isAnimating() {
|
|
1195
|
+
return B(this);
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* When true, all current and future animations are paused.
|
|
1199
|
+
*/
|
|
1200
|
+
get isPaused() {
|
|
1201
|
+
return re(this);
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
*
|
|
1205
|
+
*
|
|
1206
|
+
*/
|
|
1207
|
+
get isDelayed() {
|
|
1208
|
+
return this._state.delayed;
|
|
1209
|
+
}
|
|
1210
|
+
/** Advance the current animation by a number of milliseconds */
|
|
1211
|
+
advance(e) {
|
|
1212
|
+
let t = !0, n = !1;
|
|
1213
|
+
const s = this.animation;
|
|
1214
|
+
let { toValues: i } = s;
|
|
1215
|
+
const { config: r } = s, a = je(s.to);
|
|
1216
|
+
!a && V(s.to) && (i = O(E(s.to))), s.values.forEach((o, m) => {
|
|
1217
|
+
if (o.done) return;
|
|
1218
|
+
const d = (
|
|
1219
|
+
// Animated strings always go from 0 to 1.
|
|
1220
|
+
o.constructor == Te ? 1 : a ? a[m].lastPosition : i[m]
|
|
1221
|
+
);
|
|
1222
|
+
let h = s.immediate, g = d;
|
|
1223
|
+
if (!h) {
|
|
1224
|
+
if (g = o.lastPosition, r.tension <= 0) {
|
|
1225
|
+
o.done = !0;
|
|
1226
|
+
return;
|
|
1227
|
+
}
|
|
1228
|
+
let _ = o.elapsedTime += e;
|
|
1229
|
+
const y = s.fromValues[m], p = o.v0 != null ? o.v0 : o.v0 = c.arr(r.velocity) ? r.velocity[m] : r.velocity;
|
|
1230
|
+
let f;
|
|
1231
|
+
const b = r.precision || (y == d ? 5e-3 : Math.min(1, Math.abs(d - y) * 1e-3));
|
|
1232
|
+
if (c.und(r.duration))
|
|
1233
|
+
if (r.decay) {
|
|
1234
|
+
const v = r.decay === !0 ? 0.998 : r.decay, A = Math.exp(-(1 - v) * _);
|
|
1235
|
+
g = y + p / (1 - v) * (1 - A), h = Math.abs(o.lastPosition - g) <= b, f = p * A;
|
|
1236
|
+
} else {
|
|
1237
|
+
f = o.lastVelocity == null ? p : o.lastVelocity;
|
|
1238
|
+
const v = r.restVelocity || b / 10, A = r.clamp ? 0 : r.bounce, S = !c.und(A), k = y == d ? o.v0 > 0 : y < d;
|
|
1239
|
+
let x, F = !1;
|
|
1240
|
+
const I = 1, R = Math.ceil(e / I);
|
|
1241
|
+
for (let C = 0; C < R && (x = Math.abs(f) > v, !(!x && (h = Math.abs(d - g) <= b, h))); ++C) {
|
|
1242
|
+
S && (F = g == d || g > d == k, F && (f = -f * A, g = d));
|
|
1243
|
+
const $ = -r.tension * 1e-6 * (g - d), z = -r.friction * 1e-3 * f, M = ($ + z) / r.mass;
|
|
1244
|
+
f = f + M * I, g = g + f * I;
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
else {
|
|
1248
|
+
let v = 1;
|
|
1249
|
+
r.duration > 0 && (this._memoizedDuration !== r.duration && (this._memoizedDuration = r.duration, o.durationProgress > 0 && (o.elapsedTime = r.duration * o.durationProgress, _ = o.elapsedTime += e)), v = (r.progress || 0) + _ / this._memoizedDuration, v = v > 1 ? 1 : v < 0 ? 0 : v, o.durationProgress = v), g = y + r.easing(v) * (d - y), f = (g - o.lastPosition) / e, h = v == 1;
|
|
1250
|
+
}
|
|
1251
|
+
o.lastVelocity = f, Number.isNaN(g) && (console.warn("Got NaN while animating:", this), h = !0);
|
|
1252
|
+
}
|
|
1253
|
+
a && !a[m].done && (h = !1), h ? o.done = !0 : t = !1, o.setValue(g, r.round) && (n = !0);
|
|
1254
|
+
});
|
|
1255
|
+
const u = L(this), l = u.getValue();
|
|
1256
|
+
if (t) {
|
|
1257
|
+
const o = E(s.to);
|
|
1258
|
+
(l !== o || n) && !r.decay ? (u.setValue(o), this._onChange(o)) : n && r.decay && this._onChange(l), this._stop();
|
|
1259
|
+
} else n && this._onChange(l);
|
|
1260
|
+
}
|
|
1261
|
+
/** Set the current value, while stopping the current animation */
|
|
1262
|
+
set(e) {
|
|
1263
|
+
return w.batchedUpdates(() => {
|
|
1264
|
+
this._stop(), this._focus(e), this._set(e);
|
|
1265
|
+
}), this;
|
|
1266
|
+
}
|
|
1267
|
+
/**
|
|
1268
|
+
* Freeze the active animation in time, as well as any updates merged
|
|
1269
|
+
* before `resume` is called.
|
|
1270
|
+
*/
|
|
1271
|
+
pause() {
|
|
1272
|
+
this._update({ pause: !0 });
|
|
1273
|
+
}
|
|
1274
|
+
/** Resume the animation if paused. */
|
|
1275
|
+
resume() {
|
|
1276
|
+
this._update({ pause: !1 });
|
|
1277
|
+
}
|
|
1278
|
+
/** Skip to the end of the current animation. */
|
|
1279
|
+
finish() {
|
|
1280
|
+
if (B(this)) {
|
|
1281
|
+
const { to: e, config: t } = this.animation;
|
|
1282
|
+
w.batchedUpdates(() => {
|
|
1283
|
+
this._onStart(), t.decay || this._set(e, !1), this._stop();
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1286
|
+
return this;
|
|
1287
|
+
}
|
|
1288
|
+
/** Push props into the pending queue. */
|
|
1289
|
+
update(e) {
|
|
1290
|
+
return (this.queue || (this.queue = [])).push(e), this;
|
|
1291
|
+
}
|
|
1292
|
+
start(e, t) {
|
|
1293
|
+
let n;
|
|
1294
|
+
return c.und(e) ? (n = this.queue || [], this.queue = []) : n = [c.obj(e) ? e : { ...t, to: e }], Promise.all(
|
|
1295
|
+
n.map((s) => this._update(s))
|
|
1296
|
+
).then((s) => gt(this, s));
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* Stop the current animation, and cancel any delayed updates.
|
|
1300
|
+
*
|
|
1301
|
+
* Pass `true` to call `onRest` with `cancelled: true`.
|
|
1302
|
+
*/
|
|
1303
|
+
stop(e) {
|
|
1304
|
+
const { to: t } = this.animation;
|
|
1305
|
+
return this._focus(this.get()), _e(this._state, e && this._lastCallId), w.batchedUpdates(() => this._stop(t, e)), this;
|
|
1306
|
+
}
|
|
1307
|
+
/** Restart the animation. */
|
|
1308
|
+
reset() {
|
|
1309
|
+
this._update({ reset: !0 });
|
|
1310
|
+
}
|
|
1311
|
+
/** @internal */
|
|
1312
|
+
eventObserved(e) {
|
|
1313
|
+
e.type == "change" ? this._start() : e.type == "priority" && (this.priority = e.priority + 1);
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* Parse the `to` and `from` range from the given `props` object.
|
|
1317
|
+
*
|
|
1318
|
+
* This also ensures the initial value is available to animated components
|
|
1319
|
+
* during the render phase.
|
|
1320
|
+
*/
|
|
1321
|
+
_prepareNode(e) {
|
|
1322
|
+
const t = this.key || "";
|
|
1323
|
+
let { to: n, from: s } = e;
|
|
1324
|
+
n = c.obj(n) ? n[t] : n, (n == null || Je(n)) && (n = void 0), s = c.obj(s) ? s[t] : s, s == null && (s = void 0);
|
|
1325
|
+
const i = { to: n, from: s };
|
|
1326
|
+
return Ge(this) || (e.reverse && ([n, s] = [s, n]), s = E(s), c.und(s) ? L(this) || this._set(n) : this._set(s)), i;
|
|
1327
|
+
}
|
|
1328
|
+
/** Every update is processed by this method before merging. */
|
|
1329
|
+
_update({ ...e }, t) {
|
|
1330
|
+
const { key: n, defaultProps: s } = this;
|
|
1331
|
+
e.default && Object.assign(
|
|
1332
|
+
s,
|
|
1333
|
+
pt(
|
|
1334
|
+
e,
|
|
1335
|
+
(a, u) => /^on/.test(u) ? mn(a, n) : a
|
|
1336
|
+
)
|
|
1337
|
+
), jt(this, e, "onProps"), oe(this, "onProps", e, this);
|
|
1338
|
+
const i = this._prepareNode(e);
|
|
1339
|
+
if (Object.isFrozen(this))
|
|
1340
|
+
throw Error(
|
|
1341
|
+
"Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?"
|
|
1342
|
+
);
|
|
1343
|
+
const r = this._state;
|
|
1344
|
+
return vn(++this._lastCallId, {
|
|
1345
|
+
key: n,
|
|
1346
|
+
props: e,
|
|
1347
|
+
defaultProps: s,
|
|
1348
|
+
state: r,
|
|
1349
|
+
actions: {
|
|
1350
|
+
pause: () => {
|
|
1351
|
+
re(this) || (Dt(this, !0), ue(r.pauseQueue), oe(
|
|
1352
|
+
this,
|
|
1353
|
+
"onPause",
|
|
1354
|
+
D(this, ae(this, this.animation.to)),
|
|
1355
|
+
this
|
|
1356
|
+
));
|
|
1357
|
+
},
|
|
1358
|
+
resume: () => {
|
|
1359
|
+
re(this) && (Dt(this, !1), B(this) && this._resume(), ue(r.resumeQueue), oe(
|
|
1360
|
+
this,
|
|
1361
|
+
"onResume",
|
|
1362
|
+
D(this, ae(this, this.animation.to)),
|
|
1363
|
+
this
|
|
1364
|
+
));
|
|
1365
|
+
},
|
|
1366
|
+
start: this._merge.bind(this, i)
|
|
1367
|
+
}
|
|
1368
|
+
}).then((a) => {
|
|
1369
|
+
if (e.loop && a.finished && !(t && a.noop)) {
|
|
1370
|
+
const u = Pn(e);
|
|
1371
|
+
if (u)
|
|
1372
|
+
return this._update(u, !0);
|
|
1373
|
+
}
|
|
1374
|
+
return a;
|
|
1375
|
+
});
|
|
1376
|
+
}
|
|
1377
|
+
/** Merge props into the current animation */
|
|
1378
|
+
_merge(e, t, n) {
|
|
1379
|
+
if (t.cancel)
|
|
1380
|
+
return this.stop(!0), n(ne(this));
|
|
1381
|
+
const s = !c.und(e.to), i = !c.und(e.from);
|
|
1382
|
+
if (s || i)
|
|
1383
|
+
if (t.callId > this._lastToId)
|
|
1384
|
+
this._lastToId = t.callId;
|
|
1385
|
+
else
|
|
1386
|
+
return n(ne(this));
|
|
1387
|
+
const { key: r, defaultProps: a, animation: u } = this, { to: l, from: o } = u;
|
|
1388
|
+
let { to: m = l, from: d = o } = e;
|
|
1389
|
+
i && !s && (!t.default || c.und(m)) && (m = d), t.reverse && ([m, d] = [d, m]);
|
|
1390
|
+
const h = !G(d, o);
|
|
1391
|
+
h && (u.from = d), d = E(d);
|
|
1392
|
+
const g = !G(m, l);
|
|
1393
|
+
g && this._focus(m);
|
|
1394
|
+
const _ = Je(t.to), { config: y } = u, { decay: p, velocity: f } = y;
|
|
1395
|
+
(s || i) && (y.velocity = 0), t.config && !_ && Qs(
|
|
1396
|
+
y,
|
|
1397
|
+
Z(t.config, r),
|
|
1398
|
+
// Avoid calling the same "config" prop twice.
|
|
1399
|
+
t.config !== a.config ? Z(a.config, r) : void 0
|
|
1400
|
+
);
|
|
1401
|
+
let b = L(this);
|
|
1402
|
+
if (!b || c.und(m))
|
|
1403
|
+
return n(D(this, !0));
|
|
1404
|
+
const v = (
|
|
1405
|
+
// When `reset` is undefined, the `from` prop implies `reset: true`,
|
|
1406
|
+
// except for declarative updates. When `reset` is defined, there
|
|
1407
|
+
// must exist a value to animate from.
|
|
1408
|
+
c.und(t.reset) ? i && !t.default : !c.und(d) && de(t.reset, r)
|
|
1409
|
+
), A = v ? d : this.get(), S = ye(m), k = c.num(S) || c.arr(S) || qe(S), x = !_ && (!k || de(a.immediate || t.immediate, r));
|
|
1410
|
+
if (g) {
|
|
1411
|
+
const C = Xe(m);
|
|
1412
|
+
if (C !== b.constructor)
|
|
1413
|
+
if (x)
|
|
1414
|
+
b = this._set(S);
|
|
1415
|
+
else
|
|
1416
|
+
throw Error(
|
|
1417
|
+
`Cannot animate between ${b.constructor.name} and ${C.name}, as the "to" prop suggests`
|
|
1418
|
+
);
|
|
1419
|
+
}
|
|
1420
|
+
const F = b.constructor;
|
|
1421
|
+
let I = V(m), R = !1;
|
|
1422
|
+
if (!I) {
|
|
1423
|
+
const C = v || !Ge(this) && h;
|
|
1424
|
+
(g || C) && (R = G(ye(A), S), I = !R), (!G(u.immediate, x) && !x || !G(y.decay, p) || !G(y.velocity, f)) && (I = !0);
|
|
1425
|
+
}
|
|
1426
|
+
if (R && B(this) && (u.changed && !v ? I = !0 : I || this._stop(l)), !_ && ((I || V(l)) && (u.values = b.getPayload(), u.toValues = V(m) ? null : F == Te ? [1] : O(S)), u.immediate != x && (u.immediate = x, !x && !v && this._set(l)), I)) {
|
|
1427
|
+
const { onRest: C } = u;
|
|
1428
|
+
P(Ws, (z) => jt(this, t, z));
|
|
1429
|
+
const $ = D(this, ae(this, l));
|
|
1430
|
+
ue(this._pendingCalls, $), this._pendingCalls.add(n), u.changed && w.batchedUpdates(() => {
|
|
1431
|
+
var z;
|
|
1432
|
+
u.changed = !v, C == null || C($, this), v ? Z(a.onRest, $) : (z = u.onStart) == null || z.call(u, $, this);
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
v && this._set(A), _ ? n(_n(t.to, t, this._state, this)) : I ? this._start() : B(this) && !g ? this._pendingCalls.add(n) : n(yn(A));
|
|
1436
|
+
}
|
|
1437
|
+
/** Update the `animation.to` value, which might be a `FluidValue` */
|
|
1438
|
+
_focus(e) {
|
|
1439
|
+
const t = this.animation;
|
|
1440
|
+
e !== t.to && (Rt(this) && this._detach(), t.to = e, Rt(this) && this._attach());
|
|
1441
|
+
}
|
|
1442
|
+
_attach() {
|
|
1443
|
+
let e = 0;
|
|
1444
|
+
const { to: t } = this.animation;
|
|
1445
|
+
V(t) && (ie(t, this), tt(t) && (e = t.priority + 1)), this.priority = e;
|
|
1446
|
+
}
|
|
1447
|
+
_detach() {
|
|
1448
|
+
const { to: e } = this.animation;
|
|
1449
|
+
V(e) && ge(e, this);
|
|
1450
|
+
}
|
|
1451
|
+
/**
|
|
1452
|
+
* Update the current value from outside the frameloop,
|
|
1453
|
+
* and return the `Animated` node.
|
|
1454
|
+
*/
|
|
1455
|
+
_set(e, t = !0) {
|
|
1456
|
+
const n = E(e);
|
|
1457
|
+
if (!c.und(n)) {
|
|
1458
|
+
const s = L(this);
|
|
1459
|
+
if (!s || !G(n, s.getValue())) {
|
|
1460
|
+
const i = Xe(n);
|
|
1461
|
+
!s || s.constructor != i ? mt(this, i.create(n)) : s.setValue(n), s && w.batchedUpdates(() => {
|
|
1462
|
+
this._onChange(n, t);
|
|
1463
|
+
});
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
return L(this);
|
|
1467
|
+
}
|
|
1468
|
+
_onStart() {
|
|
1469
|
+
const e = this.animation;
|
|
1470
|
+
e.changed || (e.changed = !0, oe(
|
|
1471
|
+
this,
|
|
1472
|
+
"onStart",
|
|
1473
|
+
D(this, ae(this, e.to)),
|
|
1474
|
+
this
|
|
1475
|
+
));
|
|
1476
|
+
}
|
|
1477
|
+
_onChange(e, t) {
|
|
1478
|
+
t || (this._onStart(), Z(this.animation.onChange, e, this)), Z(this.defaultProps.onChange, e, this), super._onChange(e, t);
|
|
1479
|
+
}
|
|
1480
|
+
// This method resets the animation state (even if already animating) to
|
|
1481
|
+
// ensure the latest from/to range is used, and it also ensures this spring
|
|
1482
|
+
// is added to the frameloop.
|
|
1483
|
+
_start() {
|
|
1484
|
+
const e = this.animation;
|
|
1485
|
+
L(this).reset(E(e.to)), e.immediate || (e.fromValues = e.values.map((t) => t.lastPosition)), B(this) || (Ut(this, !0), re(this) || this._resume());
|
|
1486
|
+
}
|
|
1487
|
+
_resume() {
|
|
1488
|
+
j.skipAnimation ? this.finish() : Ne.start(this);
|
|
1489
|
+
}
|
|
1490
|
+
/**
|
|
1491
|
+
* Exit the frameloop and notify `onRest` listeners.
|
|
1492
|
+
*
|
|
1493
|
+
* Always wrap `_stop` calls with `batchedUpdates`.
|
|
1494
|
+
*/
|
|
1495
|
+
_stop(e, t) {
|
|
1496
|
+
if (B(this)) {
|
|
1497
|
+
Ut(this, !1);
|
|
1498
|
+
const n = this.animation;
|
|
1499
|
+
P(n.values, (i) => {
|
|
1500
|
+
i.done = !0;
|
|
1501
|
+
}), n.toValues && (n.onChange = n.onPause = n.onResume = void 0), pe(this, {
|
|
1502
|
+
type: "idle",
|
|
1503
|
+
parent: this
|
|
1504
|
+
});
|
|
1505
|
+
const s = t ? ne(this.get()) : D(this.get(), ae(this, e ?? n.to));
|
|
1506
|
+
ue(this._pendingCalls, s), n.changed && (n.changed = !1, oe(this, "onRest", s, this));
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
};
|
|
1510
|
+
function ae(e, t) {
|
|
1511
|
+
const n = ye(t), s = ye(e.get());
|
|
1512
|
+
return G(s, n);
|
|
1513
|
+
}
|
|
1514
|
+
function Pn(e, t = e.loop, n = e.to) {
|
|
1515
|
+
const s = Z(t);
|
|
1516
|
+
if (s) {
|
|
1517
|
+
const i = s !== !0 && gn(s), r = (i || e).reverse, a = !i || i.reset;
|
|
1518
|
+
return be({
|
|
1519
|
+
...e,
|
|
1520
|
+
loop: t,
|
|
1521
|
+
// Avoid updating default props when looping.
|
|
1522
|
+
default: !1,
|
|
1523
|
+
// Never loop the `pause` prop.
|
|
1524
|
+
pause: void 0,
|
|
1525
|
+
// For the "reverse" prop to loop as expected, the "to" prop
|
|
1526
|
+
// must be undefined. The "reverse" prop is ignored when the
|
|
1527
|
+
// "to" prop is an array or function.
|
|
1528
|
+
to: !r || Je(n) ? n : void 0,
|
|
1529
|
+
// Ignore the "from" prop except on reset.
|
|
1530
|
+
from: a ? e.from : void 0,
|
|
1531
|
+
reset: a,
|
|
1532
|
+
// The "loop" prop can return a "useSpring" props object to
|
|
1533
|
+
// override any of the original props.
|
|
1534
|
+
...i
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
function be(e) {
|
|
1539
|
+
const { to: t, from: n } = e = gn(e), s = /* @__PURE__ */ new Set();
|
|
1540
|
+
return c.obj(t) && qt(t, s), c.obj(n) && qt(n, s), e.keys = s.size ? Array.from(s) : null, e;
|
|
1541
|
+
}
|
|
1542
|
+
function Hs(e) {
|
|
1543
|
+
const t = be(e);
|
|
1544
|
+
return c.und(t.default) && (t.default = pt(t)), t;
|
|
1545
|
+
}
|
|
1546
|
+
function qt(e, t) {
|
|
1547
|
+
Q(e, (n, s) => n != null && t.add(s));
|
|
1548
|
+
}
|
|
1549
|
+
var Ws = [
|
|
1550
|
+
"onStart",
|
|
1551
|
+
"onRest",
|
|
1552
|
+
"onChange",
|
|
1553
|
+
"onPause",
|
|
1554
|
+
"onResume"
|
|
1555
|
+
];
|
|
1556
|
+
function jt(e, t, n) {
|
|
1557
|
+
e.animation[n] = t[n] !== pn(t, n) ? mn(t[n], e.key) : void 0;
|
|
1558
|
+
}
|
|
1559
|
+
function oe(e, t, ...n) {
|
|
1560
|
+
var s, i, r, a;
|
|
1561
|
+
(i = (s = e.animation)[t]) == null || i.call(s, ...n), (a = (r = e.defaultProps)[t]) == null || a.call(r, ...n);
|
|
1562
|
+
}
|
|
1563
|
+
var Ks = ["onStart", "onChange", "onRest"], Ys = 1, Zs = class {
|
|
1564
|
+
constructor(e, t) {
|
|
1565
|
+
this.id = Ys++, this.springs = {}, this.queue = [], this._lastAsyncId = 0, this._active = /* @__PURE__ */ new Set(), this._changed = /* @__PURE__ */ new Set(), this._started = !1, this._state = {
|
|
1566
|
+
paused: !1,
|
|
1567
|
+
pauseQueue: /* @__PURE__ */ new Set(),
|
|
1568
|
+
resumeQueue: /* @__PURE__ */ new Set(),
|
|
1569
|
+
timeouts: /* @__PURE__ */ new Set()
|
|
1570
|
+
}, this._events = {
|
|
1571
|
+
onStart: /* @__PURE__ */ new Map(),
|
|
1572
|
+
onChange: /* @__PURE__ */ new Map(),
|
|
1573
|
+
onRest: /* @__PURE__ */ new Map()
|
|
1574
|
+
}, this._onFrame = this._onFrame.bind(this), t && (this._flush = t), e && this.start({ default: !0, ...e });
|
|
1575
|
+
}
|
|
1576
|
+
/**
|
|
1577
|
+
* Equals `true` when no spring values are in the frameloop, and
|
|
1578
|
+
* no async animation is currently active.
|
|
1579
|
+
*/
|
|
1580
|
+
get idle() {
|
|
1581
|
+
return !this._state.asyncTo && Object.values(this.springs).every((e) => e.idle && !e.isDelayed && !e.isPaused);
|
|
1582
|
+
}
|
|
1583
|
+
get item() {
|
|
1584
|
+
return this._item;
|
|
1585
|
+
}
|
|
1586
|
+
set item(e) {
|
|
1587
|
+
this._item = e;
|
|
1588
|
+
}
|
|
1589
|
+
/** Get the current values of our springs */
|
|
1590
|
+
get() {
|
|
1591
|
+
const e = {};
|
|
1592
|
+
return this.each((t, n) => e[n] = t.get()), e;
|
|
1593
|
+
}
|
|
1594
|
+
/** Set the current values without animating. */
|
|
1595
|
+
set(e) {
|
|
1596
|
+
for (const t in e) {
|
|
1597
|
+
const n = e[t];
|
|
1598
|
+
c.und(n) || this.springs[t].set(n);
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
/** Push an update onto the queue of each value. */
|
|
1602
|
+
update(e) {
|
|
1603
|
+
return e && this.queue.push(be(e)), this;
|
|
1604
|
+
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Start the queued animations for every spring, and resolve the returned
|
|
1607
|
+
* promise once all queued animations have finished or been cancelled.
|
|
1608
|
+
*
|
|
1609
|
+
* When you pass a queue (instead of nothing), that queue is used instead of
|
|
1610
|
+
* the queued animations added with the `update` method, which are left alone.
|
|
1611
|
+
*/
|
|
1612
|
+
start(e) {
|
|
1613
|
+
let { queue: t } = this;
|
|
1614
|
+
return e ? t = O(e).map(be) : this.queue = [], this._flush ? this._flush(this, t) : (Cn(this, t), nt(this, t));
|
|
1615
|
+
}
|
|
1616
|
+
/** @internal */
|
|
1617
|
+
stop(e, t) {
|
|
1618
|
+
if (e !== !!e && (t = e), t) {
|
|
1619
|
+
const n = this.springs;
|
|
1620
|
+
P(O(t), (s) => n[s].stop(!!e));
|
|
1621
|
+
} else
|
|
1622
|
+
_e(this._state, this._lastAsyncId), this.each((n) => n.stop(!!e));
|
|
1623
|
+
return this;
|
|
1624
|
+
}
|
|
1625
|
+
/** Freeze the active animation in time */
|
|
1626
|
+
pause(e) {
|
|
1627
|
+
if (c.und(e))
|
|
1628
|
+
this.start({ pause: !0 });
|
|
1629
|
+
else {
|
|
1630
|
+
const t = this.springs;
|
|
1631
|
+
P(O(e), (n) => t[n].pause());
|
|
1632
|
+
}
|
|
1633
|
+
return this;
|
|
1634
|
+
}
|
|
1635
|
+
/** Resume the animation if paused. */
|
|
1636
|
+
resume(e) {
|
|
1637
|
+
if (c.und(e))
|
|
1638
|
+
this.start({ pause: !1 });
|
|
1639
|
+
else {
|
|
1640
|
+
const t = this.springs;
|
|
1641
|
+
P(O(e), (n) => t[n].resume());
|
|
1642
|
+
}
|
|
1643
|
+
return this;
|
|
1644
|
+
}
|
|
1645
|
+
/** Call a function once per spring value */
|
|
1646
|
+
each(e) {
|
|
1647
|
+
Q(this.springs, e);
|
|
1648
|
+
}
|
|
1649
|
+
/** @internal Called at the end of every animation frame */
|
|
1650
|
+
_onFrame() {
|
|
1651
|
+
const { onStart: e, onChange: t, onRest: n } = this._events, s = this._active.size > 0, i = this._changed.size > 0;
|
|
1652
|
+
(s && !this._started || i && !this._started) && (this._started = !0, ce(e, ([u, l]) => {
|
|
1653
|
+
l.value = this.get(), u(l, this, this._item);
|
|
1654
|
+
}));
|
|
1655
|
+
const r = !s && this._started, a = i || r && n.size ? this.get() : null;
|
|
1656
|
+
i && t.size && ce(t, ([u, l]) => {
|
|
1657
|
+
l.value = a, u(l, this, this._item);
|
|
1658
|
+
}), r && (this._started = !1, ce(n, ([u, l]) => {
|
|
1659
|
+
l.value = a, u(l, this, this._item);
|
|
1660
|
+
}));
|
|
1661
|
+
}
|
|
1662
|
+
/** @internal */
|
|
1663
|
+
eventObserved(e) {
|
|
1664
|
+
if (e.type == "change")
|
|
1665
|
+
this._changed.add(e.parent), e.idle || this._active.add(e.parent);
|
|
1666
|
+
else if (e.type == "idle")
|
|
1667
|
+
this._active.delete(e.parent);
|
|
1668
|
+
else return;
|
|
1669
|
+
w.onFrame(this._onFrame);
|
|
1670
|
+
}
|
|
1671
|
+
};
|
|
1672
|
+
function nt(e, t) {
|
|
1673
|
+
return Promise.all(t.map((n) => Sn(e, n))).then(
|
|
1674
|
+
(n) => gt(e, n)
|
|
1675
|
+
);
|
|
1676
|
+
}
|
|
1677
|
+
async function Sn(e, t, n) {
|
|
1678
|
+
const { keys: s, to: i, from: r, loop: a, onRest: u, onResolve: l } = t, o = c.obj(t.default) && t.default;
|
|
1679
|
+
a && (t.loop = !1), i === !1 && (t.to = null), r === !1 && (t.from = null);
|
|
1680
|
+
const m = c.arr(i) || c.fun(i) ? i : void 0;
|
|
1681
|
+
m ? (t.to = void 0, t.onRest = void 0, o && (o.onRest = void 0)) : P(Ks, (y) => {
|
|
1682
|
+
const p = t[y];
|
|
1683
|
+
if (c.fun(p)) {
|
|
1684
|
+
const f = e._events[y];
|
|
1685
|
+
t[y] = ({ finished: b, cancelled: v }) => {
|
|
1686
|
+
const A = f.get(p);
|
|
1687
|
+
A ? (b || (A.finished = !1), v && (A.cancelled = !0)) : f.set(p, {
|
|
1688
|
+
value: null,
|
|
1689
|
+
finished: b || !1,
|
|
1690
|
+
cancelled: v || !1
|
|
1691
|
+
});
|
|
1692
|
+
}, o && (o[y] = t[y]);
|
|
1693
|
+
}
|
|
1694
|
+
});
|
|
1695
|
+
const d = e._state;
|
|
1696
|
+
t.pause === !d.paused ? (d.paused = t.pause, ue(t.pause ? d.pauseQueue : d.resumeQueue)) : d.paused && (t.pause = !0);
|
|
1697
|
+
const h = (s || Object.keys(e.springs)).map(
|
|
1698
|
+
(y) => e.springs[y].start(t)
|
|
1699
|
+
), g = t.cancel === !0 || pn(t, "cancel") === !0;
|
|
1700
|
+
(m || g && d.asyncId) && h.push(
|
|
1701
|
+
vn(++e._lastAsyncId, {
|
|
1702
|
+
props: t,
|
|
1703
|
+
state: d,
|
|
1704
|
+
actions: {
|
|
1705
|
+
pause: Ye,
|
|
1706
|
+
resume: Ye,
|
|
1707
|
+
start(y, p) {
|
|
1708
|
+
g ? (_e(d, e._lastAsyncId), p(ne(e))) : (y.onRest = u, p(
|
|
1709
|
+
_n(
|
|
1710
|
+
m,
|
|
1711
|
+
y,
|
|
1712
|
+
d,
|
|
1713
|
+
e
|
|
1714
|
+
)
|
|
1715
|
+
));
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
})
|
|
1719
|
+
), d.paused && await new Promise((y) => {
|
|
1720
|
+
d.resumeQueue.add(y);
|
|
1721
|
+
});
|
|
1722
|
+
const _ = gt(e, await Promise.all(h));
|
|
1723
|
+
if (a && _.finished && !(n && _.noop)) {
|
|
1724
|
+
const y = Pn(t, a, i);
|
|
1725
|
+
if (y)
|
|
1726
|
+
return Cn(e, [y]), Sn(e, y, !0);
|
|
1727
|
+
}
|
|
1728
|
+
return l && w.batchedUpdates(() => l(_, e, e.item)), _;
|
|
1729
|
+
}
|
|
1730
|
+
function $t(e, t) {
|
|
1731
|
+
const n = { ...e.springs };
|
|
1732
|
+
return t && P(O(t), (s) => {
|
|
1733
|
+
c.und(s.keys) && (s = be(s)), c.obj(s.to) || (s = { ...s, to: void 0 }), xn(n, s, (i) => Rn(i));
|
|
1734
|
+
}), In(e, n), n;
|
|
1735
|
+
}
|
|
1736
|
+
function In(e, t) {
|
|
1737
|
+
Q(t, (n, s) => {
|
|
1738
|
+
e.springs[s] || (e.springs[s] = n, ie(n, e));
|
|
1739
|
+
});
|
|
1740
|
+
}
|
|
1741
|
+
function Rn(e, t) {
|
|
1742
|
+
const n = new Bs();
|
|
1743
|
+
return n.key = e, t && ie(n, t), n;
|
|
1744
|
+
}
|
|
1745
|
+
function xn(e, t, n) {
|
|
1746
|
+
t.keys && P(t.keys, (s) => {
|
|
1747
|
+
(e[s] || (e[s] = n(s)))._prepareNode(t);
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
function Cn(e, t) {
|
|
1751
|
+
P(t, (n) => {
|
|
1752
|
+
xn(e.springs, n, (s) => Rn(s, e));
|
|
1753
|
+
});
|
|
1754
|
+
}
|
|
1755
|
+
var Xs = Qt.createContext({
|
|
1756
|
+
pause: !1,
|
|
1757
|
+
immediate: !1
|
|
1758
|
+
}), Js = () => {
|
|
1759
|
+
const e = [], t = function(s) {
|
|
1760
|
+
Ss();
|
|
1761
|
+
const i = [];
|
|
1762
|
+
return P(e, (r, a) => {
|
|
1763
|
+
if (c.und(s))
|
|
1764
|
+
i.push(r.start());
|
|
1765
|
+
else {
|
|
1766
|
+
const u = n(s, r, a);
|
|
1767
|
+
u && i.push(r.start(u));
|
|
1768
|
+
}
|
|
1769
|
+
}), i;
|
|
1770
|
+
};
|
|
1771
|
+
t.current = e, t.add = function(s) {
|
|
1772
|
+
e.includes(s) || e.push(s);
|
|
1773
|
+
}, t.delete = function(s) {
|
|
1774
|
+
const i = e.indexOf(s);
|
|
1775
|
+
~i && e.splice(i, 1);
|
|
1776
|
+
}, t.pause = function() {
|
|
1777
|
+
return P(e, (s) => s.pause(...arguments)), this;
|
|
1778
|
+
}, t.resume = function() {
|
|
1779
|
+
return P(e, (s) => s.resume(...arguments)), this;
|
|
1780
|
+
}, t.set = function(s) {
|
|
1781
|
+
P(e, (i, r) => {
|
|
1782
|
+
const a = c.fun(s) ? s(r, i) : s;
|
|
1783
|
+
a && i.set(a);
|
|
1784
|
+
});
|
|
1785
|
+
}, t.start = function(s) {
|
|
1786
|
+
const i = [];
|
|
1787
|
+
return P(e, (r, a) => {
|
|
1788
|
+
if (c.und(s))
|
|
1789
|
+
i.push(r.start());
|
|
1790
|
+
else {
|
|
1791
|
+
const u = this._getProps(s, r, a);
|
|
1792
|
+
u && i.push(r.start(u));
|
|
1793
|
+
}
|
|
1794
|
+
}), i;
|
|
1795
|
+
}, t.stop = function() {
|
|
1796
|
+
return P(e, (s) => s.stop(...arguments)), this;
|
|
1797
|
+
}, t.update = function(s) {
|
|
1798
|
+
return P(e, (i, r) => i.update(this._getProps(s, i, r))), this;
|
|
1799
|
+
};
|
|
1800
|
+
const n = function(s, i, r) {
|
|
1801
|
+
return c.fun(s) ? s(r, i) : s;
|
|
1802
|
+
};
|
|
1803
|
+
return t._getProps = n, t;
|
|
1804
|
+
};
|
|
1805
|
+
function ei(e, t, n) {
|
|
1806
|
+
const s = c.fun(t) && t;
|
|
1807
|
+
s && !n && (n = []);
|
|
1808
|
+
const i = Pe(
|
|
1809
|
+
() => s || arguments.length == 3 ? Js() : void 0,
|
|
1810
|
+
[]
|
|
1811
|
+
), r = K(0), a = un(), u = Pe(
|
|
1812
|
+
() => ({
|
|
1813
|
+
ctrls: [],
|
|
1814
|
+
queue: [],
|
|
1815
|
+
flush(f, b) {
|
|
1816
|
+
const v = $t(f, b);
|
|
1817
|
+
return r.current > 0 && !u.queue.length && !Object.keys(v).some((S) => !f.springs[S]) ? nt(f, b) : new Promise((S) => {
|
|
1818
|
+
In(f, v), u.queue.push(() => {
|
|
1819
|
+
S(nt(f, b));
|
|
1820
|
+
}), a();
|
|
1821
|
+
});
|
|
1822
|
+
}
|
|
1823
|
+
}),
|
|
1824
|
+
[]
|
|
1825
|
+
), l = K([...u.ctrls]), o = K([]), m = Ct(e) || 0;
|
|
1826
|
+
Pe(() => {
|
|
1827
|
+
P(l.current.slice(e, m), (f) => {
|
|
1828
|
+
js(f, i), f.stop(!0);
|
|
1829
|
+
}), l.current.length = e, d(m, e);
|
|
1830
|
+
}, [e]), Pe(() => {
|
|
1831
|
+
d(0, Math.min(m, e));
|
|
1832
|
+
}, n);
|
|
1833
|
+
function d(f, b) {
|
|
1834
|
+
for (let v = f; v < b; v++) {
|
|
1835
|
+
const A = l.current[v] || (l.current[v] = new Zs(null, u.flush)), S = s ? s(v, A) : t[v];
|
|
1836
|
+
S && (o.current[v] = Hs(S));
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
const h = l.current.map(
|
|
1840
|
+
(f, b) => $t(f, o.current[b])
|
|
1841
|
+
), g = Dn(Xs), _ = Ct(g), y = g !== _ && qs(g);
|
|
1842
|
+
ht(() => {
|
|
1843
|
+
r.current++, u.ctrls = l.current;
|
|
1844
|
+
const { queue: f } = u;
|
|
1845
|
+
f.length && (u.queue = [], P(f, (b) => b())), P(l.current, (b, v) => {
|
|
1846
|
+
i == null || i.add(b), y && b.start({ default: g });
|
|
1847
|
+
const A = o.current[v];
|
|
1848
|
+
A && ($s(b, A.ref), b.ref ? b.queue.push(A) : b.start(A));
|
|
1849
|
+
});
|
|
1850
|
+
}), cn(() => () => {
|
|
1851
|
+
P(u.ctrls, (f) => f.stop(!0));
|
|
1852
|
+
});
|
|
1853
|
+
const p = h.map((f) => ({ ...f }));
|
|
1854
|
+
return i ? [p, i] : p;
|
|
1855
|
+
}
|
|
1856
|
+
function ti(e, t) {
|
|
1857
|
+
const n = c.fun(e), [[s], i] = ei(
|
|
1858
|
+
1,
|
|
1859
|
+
n ? e : [e],
|
|
1860
|
+
n ? [] : t
|
|
1861
|
+
);
|
|
1862
|
+
return n || arguments.length == 2 ? [s, i] : s;
|
|
1863
|
+
}
|
|
1864
|
+
var ni = class extends vt {
|
|
1865
|
+
constructor(e, t) {
|
|
1866
|
+
super(), this.source = e, this.idle = !0, this._active = /* @__PURE__ */ new Set(), this.calc = he(...t);
|
|
1867
|
+
const n = this._get(), s = Xe(n);
|
|
1868
|
+
mt(this, s.create(n));
|
|
1869
|
+
}
|
|
1870
|
+
advance(e) {
|
|
1871
|
+
const t = this._get(), n = this.get();
|
|
1872
|
+
G(t, n) || (L(this).setValue(t), this._onChange(t, this.idle)), !this.idle && zt(this._active) && Be(this);
|
|
1873
|
+
}
|
|
1874
|
+
_get() {
|
|
1875
|
+
const e = c.arr(this.source) ? this.source.map(E) : O(E(this.source));
|
|
1876
|
+
return this.calc(...e);
|
|
1877
|
+
}
|
|
1878
|
+
_start() {
|
|
1879
|
+
this.idle && !zt(this._active) && (this.idle = !1, P(je(this), (e) => {
|
|
1880
|
+
e.done = !1;
|
|
1881
|
+
}), j.skipAnimation ? (w.batchedUpdates(() => this.advance()), Be(this)) : Ne.start(this));
|
|
1882
|
+
}
|
|
1883
|
+
// Observe our sources only when we're observed.
|
|
1884
|
+
_attach() {
|
|
1885
|
+
let e = 1;
|
|
1886
|
+
P(O(this.source), (t) => {
|
|
1887
|
+
V(t) && ie(t, this), tt(t) && (t.idle || this._active.add(t), e = Math.max(e, t.priority + 1));
|
|
1888
|
+
}), this.priority = e, this._start();
|
|
1889
|
+
}
|
|
1890
|
+
// Stop observing our sources once we have no observers.
|
|
1891
|
+
_detach() {
|
|
1892
|
+
P(O(this.source), (e) => {
|
|
1893
|
+
V(e) && ge(e, this);
|
|
1894
|
+
}), this._active.clear(), Be(this);
|
|
1895
|
+
}
|
|
1896
|
+
/** @internal */
|
|
1897
|
+
eventObserved(e) {
|
|
1898
|
+
e.type == "change" ? e.idle ? this.advance() : (this._active.add(e.parent), this._start()) : e.type == "idle" ? this._active.delete(e.parent) : e.type == "priority" && (this.priority = O(this.source).reduce(
|
|
1899
|
+
(t, n) => Math.max(t, (tt(n) ? n.priority : 0) + 1),
|
|
1900
|
+
0
|
|
1901
|
+
));
|
|
1902
|
+
}
|
|
1903
|
+
};
|
|
1904
|
+
function si(e) {
|
|
1905
|
+
return e.idle !== !1;
|
|
1906
|
+
}
|
|
1907
|
+
function zt(e) {
|
|
1908
|
+
return !e.size || Array.from(e).every(si);
|
|
1909
|
+
}
|
|
1910
|
+
function Be(e) {
|
|
1911
|
+
e.idle || (e.idle = !0, P(je(e), (t) => {
|
|
1912
|
+
t.done = !0;
|
|
1913
|
+
}), pe(e, {
|
|
1914
|
+
type: "idle",
|
|
1915
|
+
parent: e
|
|
1916
|
+
}));
|
|
1917
|
+
}
|
|
1918
|
+
j.assign({
|
|
1919
|
+
createStringInterpolator: an,
|
|
1920
|
+
to: (e, t) => new ni(e, t)
|
|
1921
|
+
});
|
|
1922
|
+
var kn = /^--/;
|
|
1923
|
+
function ii(e, t) {
|
|
1924
|
+
return t == null || typeof t == "boolean" || t === "" ? "" : typeof t == "number" && t !== 0 && !kn.test(e) && !(fe.hasOwnProperty(e) && fe[e]) ? t + "px" : ("" + t).trim();
|
|
1925
|
+
}
|
|
1926
|
+
var Lt = {};
|
|
1927
|
+
function ri(e, t) {
|
|
1928
|
+
if (!e.nodeType || !e.setAttribute)
|
|
1929
|
+
return !1;
|
|
1930
|
+
const n = e.nodeName === "filter" || e.parentNode && e.parentNode.nodeName === "filter", {
|
|
1931
|
+
className: s,
|
|
1932
|
+
style: i,
|
|
1933
|
+
children: r,
|
|
1934
|
+
scrollTop: a,
|
|
1935
|
+
scrollLeft: u,
|
|
1936
|
+
viewBox: l,
|
|
1937
|
+
...o
|
|
1938
|
+
} = t, m = Object.values(o), d = Object.keys(o).map(
|
|
1939
|
+
(h) => n || e.hasAttribute(h) ? h : Lt[h] || (Lt[h] = h.replace(
|
|
1940
|
+
/([A-Z])/g,
|
|
1941
|
+
// Attributes are written in dash case
|
|
1942
|
+
(g) => "-" + g.toLowerCase()
|
|
1943
|
+
))
|
|
1944
|
+
);
|
|
1945
|
+
r !== void 0 && (e.textContent = r);
|
|
1946
|
+
for (const h in i)
|
|
1947
|
+
if (i.hasOwnProperty(h)) {
|
|
1948
|
+
const g = ii(h, i[h]);
|
|
1949
|
+
kn.test(h) ? e.style.setProperty(h, g) : e.style[h] = g;
|
|
1950
|
+
}
|
|
1951
|
+
d.forEach((h, g) => {
|
|
1952
|
+
e.setAttribute(h, m[g]);
|
|
1953
|
+
}), s !== void 0 && (e.className = s), a !== void 0 && (e.scrollTop = a), u !== void 0 && (e.scrollLeft = u), l !== void 0 && e.setAttribute("viewBox", l);
|
|
1954
|
+
}
|
|
1955
|
+
var fe = {
|
|
1956
|
+
animationIterationCount: !0,
|
|
1957
|
+
borderImageOutset: !0,
|
|
1958
|
+
borderImageSlice: !0,
|
|
1959
|
+
borderImageWidth: !0,
|
|
1960
|
+
boxFlex: !0,
|
|
1961
|
+
boxFlexGroup: !0,
|
|
1962
|
+
boxOrdinalGroup: !0,
|
|
1963
|
+
columnCount: !0,
|
|
1964
|
+
columns: !0,
|
|
1965
|
+
flex: !0,
|
|
1966
|
+
flexGrow: !0,
|
|
1967
|
+
flexPositive: !0,
|
|
1968
|
+
flexShrink: !0,
|
|
1969
|
+
flexNegative: !0,
|
|
1970
|
+
flexOrder: !0,
|
|
1971
|
+
gridRow: !0,
|
|
1972
|
+
gridRowEnd: !0,
|
|
1973
|
+
gridRowSpan: !0,
|
|
1974
|
+
gridRowStart: !0,
|
|
1975
|
+
gridColumn: !0,
|
|
1976
|
+
gridColumnEnd: !0,
|
|
1977
|
+
gridColumnSpan: !0,
|
|
1978
|
+
gridColumnStart: !0,
|
|
1979
|
+
fontWeight: !0,
|
|
1980
|
+
lineClamp: !0,
|
|
1981
|
+
lineHeight: !0,
|
|
1982
|
+
opacity: !0,
|
|
1983
|
+
order: !0,
|
|
1984
|
+
orphans: !0,
|
|
1985
|
+
tabSize: !0,
|
|
1986
|
+
widows: !0,
|
|
1987
|
+
zIndex: !0,
|
|
1988
|
+
zoom: !0,
|
|
1989
|
+
// SVG-related properties
|
|
1990
|
+
fillOpacity: !0,
|
|
1991
|
+
floodOpacity: !0,
|
|
1992
|
+
stopOpacity: !0,
|
|
1993
|
+
strokeDasharray: !0,
|
|
1994
|
+
strokeDashoffset: !0,
|
|
1995
|
+
strokeMiterlimit: !0,
|
|
1996
|
+
strokeOpacity: !0,
|
|
1997
|
+
strokeWidth: !0
|
|
1998
|
+
}, ai = (e, t) => e + t.charAt(0).toUpperCase() + t.substring(1), oi = ["Webkit", "Ms", "Moz", "O"];
|
|
1999
|
+
fe = Object.keys(fe).reduce((e, t) => (oi.forEach((n) => e[ai(n, t)] = e[t]), e), fe);
|
|
2000
|
+
var ui = /^(matrix|translate|scale|rotate|skew)/, ci = /^(translate)/, li = /^(rotate|skew)/, He = (e, t) => c.num(e) && e !== 0 ? e + t : e, Ce = (e, t) => c.arr(e) ? e.every((n) => Ce(n, t)) : c.num(e) ? e === t : parseFloat(e) === t, di = class extends ze {
|
|
2001
|
+
constructor({ x: e, y: t, z: n, ...s }) {
|
|
2002
|
+
const i = [], r = [];
|
|
2003
|
+
(e || t || n) && (i.push([e || 0, t || 0, n || 0]), r.push((a) => [
|
|
2004
|
+
`translate3d(${a.map((u) => He(u, "px")).join(",")})`,
|
|
2005
|
+
// prettier-ignore
|
|
2006
|
+
Ce(a, 0)
|
|
2007
|
+
])), Q(s, (a, u) => {
|
|
2008
|
+
if (u === "transform")
|
|
2009
|
+
i.push([a || ""]), r.push((l) => [l, l === ""]);
|
|
2010
|
+
else if (ui.test(u)) {
|
|
2011
|
+
if (delete s[u], c.und(a)) return;
|
|
2012
|
+
const l = ci.test(u) ? "px" : li.test(u) ? "deg" : "";
|
|
2013
|
+
i.push(O(a)), r.push(
|
|
2014
|
+
u === "rotate3d" ? ([o, m, d, h]) => [
|
|
2015
|
+
`rotate3d(${o},${m},${d},${He(h, l)})`,
|
|
2016
|
+
Ce(h, 0)
|
|
2017
|
+
] : (o) => [
|
|
2018
|
+
`${u}(${o.map((m) => He(m, l)).join(",")})`,
|
|
2019
|
+
Ce(o, u.startsWith("scale") ? 1 : 0)
|
|
2020
|
+
]
|
|
2021
|
+
);
|
|
2022
|
+
}
|
|
2023
|
+
}), i.length && (s.transform = new fi(i, r)), super(s);
|
|
2024
|
+
}
|
|
2025
|
+
}, fi = class extends nn {
|
|
2026
|
+
constructor(e, t) {
|
|
2027
|
+
super(), this.inputs = e, this.transforms = t, this._value = null;
|
|
2028
|
+
}
|
|
2029
|
+
get() {
|
|
2030
|
+
return this._value || (this._value = this._get());
|
|
2031
|
+
}
|
|
2032
|
+
_get() {
|
|
2033
|
+
let e = "", t = !0;
|
|
2034
|
+
return P(this.inputs, (n, s) => {
|
|
2035
|
+
const i = E(n[0]), [r, a] = this.transforms[s](
|
|
2036
|
+
c.arr(i) ? i : n.map(E)
|
|
2037
|
+
);
|
|
2038
|
+
e += " " + r, t = t && a;
|
|
2039
|
+
}), t ? "none" : e;
|
|
2040
|
+
}
|
|
2041
|
+
// Start observing our inputs once we have an observer.
|
|
2042
|
+
observerAdded(e) {
|
|
2043
|
+
e == 1 && P(
|
|
2044
|
+
this.inputs,
|
|
2045
|
+
(t) => P(
|
|
2046
|
+
t,
|
|
2047
|
+
(n) => V(n) && ie(n, this)
|
|
2048
|
+
)
|
|
2049
|
+
);
|
|
2050
|
+
}
|
|
2051
|
+
// Stop observing our inputs once we have no observers.
|
|
2052
|
+
observerRemoved(e) {
|
|
2053
|
+
e == 0 && P(
|
|
2054
|
+
this.inputs,
|
|
2055
|
+
(t) => P(
|
|
2056
|
+
t,
|
|
2057
|
+
(n) => V(n) && ge(n, this)
|
|
2058
|
+
)
|
|
2059
|
+
);
|
|
2060
|
+
}
|
|
2061
|
+
eventObserved(e) {
|
|
2062
|
+
e.type == "change" && (this._value = null), pe(this, e);
|
|
2063
|
+
}
|
|
2064
|
+
}, hi = [
|
|
2065
|
+
"a",
|
|
2066
|
+
"abbr",
|
|
2067
|
+
"address",
|
|
2068
|
+
"area",
|
|
2069
|
+
"article",
|
|
2070
|
+
"aside",
|
|
2071
|
+
"audio",
|
|
2072
|
+
"b",
|
|
2073
|
+
"base",
|
|
2074
|
+
"bdi",
|
|
2075
|
+
"bdo",
|
|
2076
|
+
"big",
|
|
2077
|
+
"blockquote",
|
|
2078
|
+
"body",
|
|
2079
|
+
"br",
|
|
2080
|
+
"button",
|
|
2081
|
+
"canvas",
|
|
2082
|
+
"caption",
|
|
2083
|
+
"cite",
|
|
2084
|
+
"code",
|
|
2085
|
+
"col",
|
|
2086
|
+
"colgroup",
|
|
2087
|
+
"data",
|
|
2088
|
+
"datalist",
|
|
2089
|
+
"dd",
|
|
2090
|
+
"del",
|
|
2091
|
+
"details",
|
|
2092
|
+
"dfn",
|
|
2093
|
+
"dialog",
|
|
2094
|
+
"div",
|
|
2095
|
+
"dl",
|
|
2096
|
+
"dt",
|
|
2097
|
+
"em",
|
|
2098
|
+
"embed",
|
|
2099
|
+
"fieldset",
|
|
2100
|
+
"figcaption",
|
|
2101
|
+
"figure",
|
|
2102
|
+
"footer",
|
|
2103
|
+
"form",
|
|
2104
|
+
"h1",
|
|
2105
|
+
"h2",
|
|
2106
|
+
"h3",
|
|
2107
|
+
"h4",
|
|
2108
|
+
"h5",
|
|
2109
|
+
"h6",
|
|
2110
|
+
"head",
|
|
2111
|
+
"header",
|
|
2112
|
+
"hgroup",
|
|
2113
|
+
"hr",
|
|
2114
|
+
"html",
|
|
2115
|
+
"i",
|
|
2116
|
+
"iframe",
|
|
2117
|
+
"img",
|
|
2118
|
+
"input",
|
|
2119
|
+
"ins",
|
|
2120
|
+
"kbd",
|
|
2121
|
+
"keygen",
|
|
2122
|
+
"label",
|
|
2123
|
+
"legend",
|
|
2124
|
+
"li",
|
|
2125
|
+
"link",
|
|
2126
|
+
"main",
|
|
2127
|
+
"map",
|
|
2128
|
+
"mark",
|
|
2129
|
+
"menu",
|
|
2130
|
+
"menuitem",
|
|
2131
|
+
"meta",
|
|
2132
|
+
"meter",
|
|
2133
|
+
"nav",
|
|
2134
|
+
"noscript",
|
|
2135
|
+
"object",
|
|
2136
|
+
"ol",
|
|
2137
|
+
"optgroup",
|
|
2138
|
+
"option",
|
|
2139
|
+
"output",
|
|
2140
|
+
"p",
|
|
2141
|
+
"param",
|
|
2142
|
+
"picture",
|
|
2143
|
+
"pre",
|
|
2144
|
+
"progress",
|
|
2145
|
+
"q",
|
|
2146
|
+
"rp",
|
|
2147
|
+
"rt",
|
|
2148
|
+
"ruby",
|
|
2149
|
+
"s",
|
|
2150
|
+
"samp",
|
|
2151
|
+
"script",
|
|
2152
|
+
"section",
|
|
2153
|
+
"select",
|
|
2154
|
+
"small",
|
|
2155
|
+
"source",
|
|
2156
|
+
"span",
|
|
2157
|
+
"strong",
|
|
2158
|
+
"style",
|
|
2159
|
+
"sub",
|
|
2160
|
+
"summary",
|
|
2161
|
+
"sup",
|
|
2162
|
+
"table",
|
|
2163
|
+
"tbody",
|
|
2164
|
+
"td",
|
|
2165
|
+
"textarea",
|
|
2166
|
+
"tfoot",
|
|
2167
|
+
"th",
|
|
2168
|
+
"thead",
|
|
2169
|
+
"time",
|
|
2170
|
+
"title",
|
|
2171
|
+
"tr",
|
|
2172
|
+
"track",
|
|
2173
|
+
"u",
|
|
2174
|
+
"ul",
|
|
2175
|
+
"var",
|
|
2176
|
+
"video",
|
|
2177
|
+
"wbr",
|
|
2178
|
+
// SVG
|
|
2179
|
+
"circle",
|
|
2180
|
+
"clipPath",
|
|
2181
|
+
"defs",
|
|
2182
|
+
"ellipse",
|
|
2183
|
+
"foreignObject",
|
|
2184
|
+
"g",
|
|
2185
|
+
"image",
|
|
2186
|
+
"line",
|
|
2187
|
+
"linearGradient",
|
|
2188
|
+
"mask",
|
|
2189
|
+
"path",
|
|
2190
|
+
"pattern",
|
|
2191
|
+
"polygon",
|
|
2192
|
+
"polyline",
|
|
2193
|
+
"radialGradient",
|
|
2194
|
+
"rect",
|
|
2195
|
+
"stop",
|
|
2196
|
+
"svg",
|
|
2197
|
+
"text",
|
|
2198
|
+
"tspan"
|
|
2199
|
+
];
|
|
2200
|
+
j.assign({
|
|
2201
|
+
batchedUpdates: zn,
|
|
2202
|
+
createStringInterpolator: an,
|
|
2203
|
+
colors: ss
|
|
2204
|
+
});
|
|
2205
|
+
var mi = Os(hi, {
|
|
2206
|
+
applyAnimatedValues: ri,
|
|
2207
|
+
createAnimatedStyle: (e) => new di(e),
|
|
2208
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2209
|
+
getComponentProps: ({ scrollTop: e, scrollLeft: t, ...n }) => n
|
|
2210
|
+
}), pi = mi.animated;
|
|
2211
|
+
const gi = "_content_12gg8_1", vi = {
|
|
2212
|
+
content: gi
|
|
2213
|
+
}, Fn = "ContextMenu.Content", yi = st(
|
|
2214
|
+
({
|
|
2215
|
+
style: e,
|
|
2216
|
+
className: t,
|
|
2217
|
+
children: n,
|
|
2218
|
+
alignOffset: s,
|
|
2219
|
+
arrowPadding: i = 5,
|
|
2220
|
+
collisionBoundary: r,
|
|
2221
|
+
direction: a = T.DOWN_RIGHT,
|
|
2222
|
+
disableAutoPositioning: u = !1,
|
|
2223
|
+
disableRepositioning: l = !1,
|
|
2224
|
+
onMouseEnter: o,
|
|
2225
|
+
onMouseLeave: m,
|
|
2226
|
+
onInteractOutside: d,
|
|
2227
|
+
onEscapeKeyDown: h,
|
|
2228
|
+
...g
|
|
2229
|
+
}, _) => {
|
|
2230
|
+
const [y, p] = ee(!1), [f, b] = ee(null), {
|
|
2231
|
+
triggerRef: v,
|
|
2232
|
+
contentRef: A,
|
|
2233
|
+
isOpen: S,
|
|
2234
|
+
animatedOpen: k,
|
|
2235
|
+
animationDuration: x,
|
|
2236
|
+
mode: F,
|
|
2237
|
+
temporaryHoverClose: I,
|
|
2238
|
+
onMouseEnter: R,
|
|
2239
|
+
onMouseLeave: C,
|
|
2240
|
+
onChildOpen: $,
|
|
2241
|
+
isRootContentBlocked: z,
|
|
2242
|
+
isChildOpen: M,
|
|
2243
|
+
closeMenuImmediately: Tn,
|
|
2244
|
+
isCloseOnClick: En
|
|
2245
|
+
} = Mn(Fn), { align: On, offset: Vn, isPositioned: yt } = _i({
|
|
2246
|
+
direction: a,
|
|
2247
|
+
alignOffset: s,
|
|
2248
|
+
disableAutoPositioning: u,
|
|
2249
|
+
triggerRef: v,
|
|
2250
|
+
contentRef: A,
|
|
2251
|
+
collisionBoundary: r,
|
|
2252
|
+
children: n,
|
|
2253
|
+
disableRepositioning: l
|
|
2254
|
+
}), Nn = ti({
|
|
2255
|
+
opacity: yt && (F === _t.CLICK && !I || k) ? 1 : 0,
|
|
2256
|
+
config: F === _t.CLICK && !I ? { duration: 0 } : { duration: x, easing: tn.easeInOutCubic }
|
|
2257
|
+
});
|
|
2258
|
+
return /* @__PURE__ */ Re(
|
|
2259
|
+
Qn,
|
|
2260
|
+
{
|
|
2261
|
+
hasItemWithIcon: y,
|
|
2262
|
+
setHasItemWithIcon: p,
|
|
2263
|
+
activeItemId: f,
|
|
2264
|
+
setActiveItemId: b,
|
|
2265
|
+
onChildOpen: $,
|
|
2266
|
+
isCloseOnClick: En,
|
|
2267
|
+
closeMenuImmediately: Tn,
|
|
2268
|
+
shouldCloseRootMenuOnClick: !1,
|
|
2269
|
+
level: 1,
|
|
2270
|
+
children: S && /* @__PURE__ */ Re(
|
|
2271
|
+
pi.div,
|
|
2272
|
+
{
|
|
2273
|
+
style: {
|
|
2274
|
+
zIndex: Number.MAX_SAFE_INTEGER - 10,
|
|
2275
|
+
position: "fixed",
|
|
2276
|
+
...Nn
|
|
2277
|
+
},
|
|
2278
|
+
"data-content-wrapper": !0,
|
|
2279
|
+
children: /* @__PURE__ */ qn(
|
|
2280
|
+
jn,
|
|
2281
|
+
{
|
|
2282
|
+
ref: Ln(A, _),
|
|
2283
|
+
className: Mt(vi.content, t),
|
|
2284
|
+
style: {
|
|
2285
|
+
...e || {},
|
|
2286
|
+
pointerEvents: u || yt ? "auto" : "none"
|
|
2287
|
+
},
|
|
2288
|
+
collisionBoundary: r,
|
|
2289
|
+
side: Gn[a],
|
|
2290
|
+
align: On,
|
|
2291
|
+
arrowPadding: i,
|
|
2292
|
+
alignOffset: Vn,
|
|
2293
|
+
onMouseEnter: (U) => {
|
|
2294
|
+
R == null || R(U), o == null || o(U);
|
|
2295
|
+
},
|
|
2296
|
+
onMouseLeave: (U) => {
|
|
2297
|
+
C == null || C(U), m == null || m(U);
|
|
2298
|
+
},
|
|
2299
|
+
onInteractOutside: (U) => {
|
|
2300
|
+
M && U.preventDefault(), d == null || d(U);
|
|
2301
|
+
},
|
|
2302
|
+
onEscapeKeyDown: (U) => {
|
|
2303
|
+
M && U.preventDefault(), h == null || h(U);
|
|
2304
|
+
},
|
|
2305
|
+
...g,
|
|
2306
|
+
children: [
|
|
2307
|
+
n,
|
|
2308
|
+
z && /* @__PURE__ */ Re(Gt, {})
|
|
2309
|
+
]
|
|
2310
|
+
}
|
|
2311
|
+
)
|
|
2312
|
+
}
|
|
2313
|
+
)
|
|
2314
|
+
}
|
|
2315
|
+
);
|
|
2316
|
+
}
|
|
2317
|
+
);
|
|
2318
|
+
yi.displayName = Fn;
|
|
2319
|
+
function _i({
|
|
2320
|
+
direction: e,
|
|
2321
|
+
alignOffset: t = 0,
|
|
2322
|
+
disableAutoPositioning: n,
|
|
2323
|
+
triggerRef: s,
|
|
2324
|
+
contentRef: i,
|
|
2325
|
+
collisionBoundary: r,
|
|
2326
|
+
disableRepositioning: a,
|
|
2327
|
+
children: u
|
|
2328
|
+
}) {
|
|
2329
|
+
const [l, o] = ee(
|
|
2330
|
+
e === T.UP_RIGHT || e === T.DOWN_RIGHT || e === T.RIGHT_DOWN || e === T.LEFT_DOWN || !e ? "start" : "end"
|
|
2331
|
+
), [m, d] = ee(t), [h, g] = ee(!1), _ = K(!1), y = Hn(l);
|
|
2332
|
+
return We(() => {
|
|
2333
|
+
if (n || !(s != null && s.current) || !e)
|
|
2334
|
+
return;
|
|
2335
|
+
let p = null, f = !0;
|
|
2336
|
+
const b = r instanceof Element && r || document.documentElement, v = () => {
|
|
2337
|
+
if (!f)
|
|
2338
|
+
return;
|
|
2339
|
+
const A = s.current, S = i.current;
|
|
2340
|
+
if (!A || !S)
|
|
2341
|
+
return;
|
|
2342
|
+
const k = A.getBoundingClientRect(), x = S.getBoundingClientRect();
|
|
2343
|
+
if (x.width <= 0)
|
|
2344
|
+
return;
|
|
2345
|
+
const F = b.getBoundingClientRect(), I = {
|
|
2346
|
+
right: F.right - k.right >= x.width,
|
|
2347
|
+
left: k.left - F.left >= x.width,
|
|
2348
|
+
bottom: F.bottom - k.bottom >= x.height,
|
|
2349
|
+
top: k.top - F.top >= x.height
|
|
2350
|
+
};
|
|
2351
|
+
let R = "start";
|
|
2352
|
+
switch (e) {
|
|
2353
|
+
case T.UP_RIGHT:
|
|
2354
|
+
case T.DOWN_RIGHT: {
|
|
2355
|
+
I.right ? R = "start" : I.left ? R = "end" : R = "start";
|
|
2356
|
+
break;
|
|
2357
|
+
}
|
|
2358
|
+
case T.UP_LEFT:
|
|
2359
|
+
case T.DOWN_LEFT: {
|
|
2360
|
+
I.left ? R = "end" : I.right ? R = "start" : R = "end";
|
|
2361
|
+
break;
|
|
2362
|
+
}
|
|
2363
|
+
case T.RIGHT_DOWN:
|
|
2364
|
+
case T.LEFT_DOWN: {
|
|
2365
|
+
I.bottom ? R = "start" : I.top ? R = "end" : R = "start";
|
|
2366
|
+
break;
|
|
2367
|
+
}
|
|
2368
|
+
case T.RIGHT_UP:
|
|
2369
|
+
case T.LEFT_UP: {
|
|
2370
|
+
I.top ? R = "end" : I.bottom ? R = "start" : R = "end";
|
|
2371
|
+
break;
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
o(R), g(!0);
|
|
2375
|
+
};
|
|
2376
|
+
return requestAnimationFrame(v), !a && i.current && typeof ResizeObserver < "u" && (p = new ResizeObserver(v), p.observe(i.current)), () => {
|
|
2377
|
+
f = !1, p == null || p.disconnect();
|
|
2378
|
+
};
|
|
2379
|
+
}, [
|
|
2380
|
+
e,
|
|
2381
|
+
n,
|
|
2382
|
+
a,
|
|
2383
|
+
s,
|
|
2384
|
+
i,
|
|
2385
|
+
r
|
|
2386
|
+
]), We(() => {
|
|
2387
|
+
const p = i == null ? void 0 : i.current, f = s == null ? void 0 : s.current;
|
|
2388
|
+
if (a && _.current && y === l || !p || !f || n || [
|
|
2389
|
+
T.DOWN_LEFT,
|
|
2390
|
+
T.DOWN_RIGHT,
|
|
2391
|
+
T.UP_LEFT,
|
|
2392
|
+
T.UP_RIGHT
|
|
2393
|
+
].includes(e))
|
|
2394
|
+
return;
|
|
2395
|
+
const b = Array.from(p.querySelectorAll("[data-item]"));
|
|
2396
|
+
if (b.length === 0)
|
|
2397
|
+
return;
|
|
2398
|
+
const v = l === "start" ? b[0] : b[b.length - 1], A = () => {
|
|
2399
|
+
const k = f.getBoundingClientRect(), x = p.getBoundingClientRect(), F = v.getBoundingClientRect(), I = (M) => !M.width || !M.height || !isFinite(M.top) || !isFinite(M.left);
|
|
2400
|
+
if ([k, x, F].some(I)) {
|
|
2401
|
+
requestAnimationFrame(A);
|
|
2402
|
+
return;
|
|
2403
|
+
}
|
|
2404
|
+
const R = k.height / 2, C = F.height / 2, $ = F.top - x.top, z = F.bottom - x.bottom;
|
|
2405
|
+
d(l === "start" ? t + R - $ - C : t + R + z - C), _.current = !0;
|
|
2406
|
+
};
|
|
2407
|
+
if (requestAnimationFrame(A), a)
|
|
2408
|
+
return;
|
|
2409
|
+
const S = new ResizeObserver(() => {
|
|
2410
|
+
requestAnimationFrame(A);
|
|
2411
|
+
});
|
|
2412
|
+
return S.observe(v), S.observe(f), () => S.disconnect();
|
|
2413
|
+
}, [
|
|
2414
|
+
u,
|
|
2415
|
+
e,
|
|
2416
|
+
a,
|
|
2417
|
+
l,
|
|
2418
|
+
i,
|
|
2419
|
+
s,
|
|
2420
|
+
l,
|
|
2421
|
+
t,
|
|
2422
|
+
n
|
|
2423
|
+
]), { align: l, offset: m, isPositioned: h };
|
|
2424
|
+
}
|
|
2425
|
+
export {
|
|
2426
|
+
yi as C,
|
|
2427
|
+
Gt as F,
|
|
2428
|
+
ti as a,
|
|
2429
|
+
pi as b,
|
|
2430
|
+
bt as c,
|
|
2431
|
+
tn as e,
|
|
2432
|
+
_i as u
|
|
2433
|
+
};
|