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