lizaui 8.3.9 → 8.5.9
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/button/index.cjs.js +1 -1
- package/dist/button/index.es.js +1 -1
- package/dist/calendar/index.cjs.js +1 -1
- package/dist/calendar/index.es.js +1 -1
- package/dist/chunks/{button-DaAJ3J_i.js → button-DFrxQHAW.js} +2 -2
- package/dist/chunks/{button-DaAJ3J_i.js.map → button-DFrxQHAW.js.map} +1 -1
- package/dist/chunks/{button-DJYse8Dw.js → button-uo4_Xad_.js} +2 -2
- package/dist/chunks/{button-DJYse8Dw.js.map → button-uo4_Xad_.js.map} +1 -1
- package/dist/chunks/features-animation-BRAvwYFN.js +3437 -0
- package/dist/chunks/features-animation-BRAvwYFN.js.map +1 -0
- package/dist/chunks/features-animation-BoXKk5t2.js +2 -0
- package/dist/chunks/features-animation-BoXKk5t2.js.map +1 -0
- package/dist/chunks/index-BbDfYVLO.js +174 -0
- package/dist/chunks/index-BbDfYVLO.js.map +1 -0
- package/dist/chunks/index-CL73JQgs.js +2 -0
- package/dist/chunks/index-CL73JQgs.js.map +1 -0
- package/dist/chunks/index-DC9BfnBH.js +208 -0
- package/dist/chunks/index-DC9BfnBH.js.map +1 -0
- package/dist/chunks/index-lrI_r1ww.js +10 -0
- package/dist/chunks/index-lrI_r1ww.js.map +1 -0
- package/dist/chunks/{index-VJ2Qvmen.js → index-ybbFyaIJ.js} +4 -4
- package/dist/chunks/{index-VJ2Qvmen.js.map → index-ybbFyaIJ.js.map} +1 -1
- package/dist/chunks/proxy-BwQyOw8U.js +2 -0
- package/dist/chunks/proxy-BwQyOw8U.js.map +1 -0
- package/dist/chunks/proxy-kv_Ue2k_.js +1346 -0
- package/dist/chunks/proxy-kv_Ue2k_.js.map +1 -0
- package/dist/chunks/ripple-CzU7YM2G.js +69 -0
- package/dist/chunks/{ripple-DMI95LHg.js.map → ripple-CzU7YM2G.js.map} +1 -1
- package/dist/chunks/ripple-SBteSEo3.js +2 -0
- package/dist/chunks/{ripple-DieNd7XQ.js.map → ripple-SBteSEo3.js.map} +1 -1
- package/dist/chunks/{scroll-area-BwqigcJy.js → scroll-area-B0mWCpSW.js} +2 -2
- package/dist/chunks/{scroll-area-BwqigcJy.js.map → scroll-area-B0mWCpSW.js.map} +1 -1
- package/dist/chunks/{scroll-area-1okMO4N6.js → scroll-area-CNrVfRxh.js} +3 -3
- package/dist/chunks/{scroll-area-1okMO4N6.js.map → scroll-area-CNrVfRxh.js.map} +1 -1
- package/dist/chunks/{select-B6a8A7js.js → select-DET3MySD.js} +3 -3
- package/dist/chunks/{select-B6a8A7js.js.map → select-DET3MySD.js.map} +1 -1
- package/dist/chunks/{select-CFefk2Xz.js → select-DGSPwoy8.js} +2 -2
- package/dist/chunks/{select-CFefk2Xz.js.map → select-DGSPwoy8.js.map} +1 -1
- package/dist/chunks/{textarea-BPsle-xc.js → textarea-BYbersWf.js} +32 -31
- package/dist/chunks/{textarea-BPsle-xc.js.map → textarea-BYbersWf.js.map} +1 -1
- package/dist/chunks/{textarea-C2i9A3jn.js → textarea-D9X4fUkV.js} +12 -12
- package/dist/chunks/{textarea-C2i9A3jn.js.map → textarea-D9X4fUkV.js.map} +1 -1
- package/dist/modal/index.cjs.js +1 -1
- package/dist/modal/index.cjs.js.map +1 -1
- package/dist/modal/index.es.js +15 -14
- package/dist/modal/index.es.js.map +1 -1
- package/dist/pagination/index.cjs.js +1 -1
- package/dist/pagination/index.es.js +3 -3
- package/dist/phone-input/index.cjs.js +14 -1
- package/dist/phone-input/index.cjs.js.map +1 -1
- package/dist/phone-input/index.es.js +3332 -137
- package/dist/phone-input/index.es.js.map +1 -1
- package/dist/ripple/index.cjs.js +1 -1
- package/dist/ripple/index.es.js +1 -1
- package/dist/table/index.cjs.js +1 -1
- package/dist/table/index.cjs.js.map +1 -1
- package/dist/table/index.es.js +11 -11
- package/dist/table/index.es.js.map +1 -1
- package/dist/time-input/index.cjs.js +1 -1
- package/dist/time-input/index.es.js +2 -2
- package/dist/ui/index.cjs.js +1 -1
- package/dist/ui/index.es.js +8 -8
- package/package.json +1 -1
- package/dist/chunks/ripple-DMI95LHg.js +0 -68
- package/dist/chunks/ripple-DieNd7XQ.js +0 -2
|
@@ -0,0 +1,3437 @@
|
|
|
1
|
+
import { j as Ie } from "./jsx-runtime-Cl_4eDuT.js";
|
|
2
|
+
import { createContext as vn, useContext as R, useMemo as St, Fragment as wn, createElement as js, useCallback as Ws, useRef as Dt, useInsertionEffect as $s, useEffect as _s, forwardRef as Gs } from "react";
|
|
3
|
+
import { d as Us, P as Vn, e as zs, f as xn, M as An, u as Hs, l as Ys, i as Sn, b as Xs, g as Kt } from "./index-DC9BfnBH.js";
|
|
4
|
+
function qs(t, e) {
|
|
5
|
+
t.indexOf(e) === -1 && t.push(e);
|
|
6
|
+
}
|
|
7
|
+
function Zs(t, e) {
|
|
8
|
+
const n = t.indexOf(e);
|
|
9
|
+
n > -1 && t.splice(n, 1);
|
|
10
|
+
}
|
|
11
|
+
const H = (t, e, n) => n > e ? e : n < t ? t : n;
|
|
12
|
+
function Js(t, e) {
|
|
13
|
+
return e ? `${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}` : t;
|
|
14
|
+
}
|
|
15
|
+
let tt = () => {
|
|
16
|
+
}, j = () => {
|
|
17
|
+
};
|
|
18
|
+
process.env.NODE_ENV !== "production" && (tt = (t, e, n) => {
|
|
19
|
+
}, j = (t, e, n) => {
|
|
20
|
+
if (!t)
|
|
21
|
+
throw new Error(Js(e, n));
|
|
22
|
+
});
|
|
23
|
+
const B = {}, Mn = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), Cn = (t) => /^0[^.\s]+$/u.test(t);
|
|
24
|
+
// @__NO_SIDE_EFFECTS__
|
|
25
|
+
function ae(t) {
|
|
26
|
+
let e;
|
|
27
|
+
return () => (e === void 0 && (e = t()), e);
|
|
28
|
+
}
|
|
29
|
+
const et = /* @__NO_SIDE_EFFECTS__ */ (t) => t, Qs = (t, e) => (n) => e(t(n)), Mt = (...t) => t.reduce(Qs), Pn = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
|
|
30
|
+
const s = e - t;
|
|
31
|
+
return s === 0 ? 1 : (n - t) / s;
|
|
32
|
+
};
|
|
33
|
+
class Fn {
|
|
34
|
+
constructor() {
|
|
35
|
+
this.subscriptions = [];
|
|
36
|
+
}
|
|
37
|
+
add(e) {
|
|
38
|
+
return qs(this.subscriptions, e), () => Zs(this.subscriptions, e);
|
|
39
|
+
}
|
|
40
|
+
notify(e, n, s) {
|
|
41
|
+
const i = this.subscriptions.length;
|
|
42
|
+
if (i)
|
|
43
|
+
if (i === 1)
|
|
44
|
+
this.subscriptions[0](e, n, s);
|
|
45
|
+
else
|
|
46
|
+
for (let r = 0; r < i; r++) {
|
|
47
|
+
const a = this.subscriptions[r];
|
|
48
|
+
a && a(e, n, s);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
getSize() {
|
|
52
|
+
return this.subscriptions.length;
|
|
53
|
+
}
|
|
54
|
+
clear() {
|
|
55
|
+
this.subscriptions.length = 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const N = /* @__NO_SIDE_EFFECTS__ */ (t) => t * 1e3, L = /* @__NO_SIDE_EFFECTS__ */ (t) => t / 1e3;
|
|
59
|
+
function Dn(t, e) {
|
|
60
|
+
return e ? t * (1e3 / e) : 0;
|
|
61
|
+
}
|
|
62
|
+
const Re = /* @__PURE__ */ new Set();
|
|
63
|
+
function oe(t, e, n) {
|
|
64
|
+
t || Re.has(e) || Re.add(e);
|
|
65
|
+
}
|
|
66
|
+
const On = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, ti = 1e-7, ei = 12;
|
|
67
|
+
function ni(t, e, n, s, i) {
|
|
68
|
+
let r, a, o = 0;
|
|
69
|
+
do
|
|
70
|
+
a = e + (n - e) / 2, r = On(a, s, i) - t, r > 0 ? n = a : e = a;
|
|
71
|
+
while (Math.abs(r) > ti && ++o < ei);
|
|
72
|
+
return a;
|
|
73
|
+
}
|
|
74
|
+
function dt(t, e, n, s) {
|
|
75
|
+
if (t === e && n === s)
|
|
76
|
+
return et;
|
|
77
|
+
const i = (r) => ni(r, 0, 1, t, n);
|
|
78
|
+
return (r) => r === 0 || r === 1 ? r : On(i(r), e, s);
|
|
79
|
+
}
|
|
80
|
+
const En = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, In = (t) => (e) => 1 - t(1 - e), Rn = /* @__PURE__ */ dt(0.33, 1.53, 0.69, 0.99), ue = /* @__PURE__ */ In(Rn), kn = /* @__PURE__ */ En(ue), Nn = (t) => (t *= 2) < 1 ? 0.5 * ue(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), ce = (t) => 1 - Math.sin(Math.acos(t)), si = In(ce), Ln = En(ce), ii = /* @__PURE__ */ dt(0.42, 0, 1, 1), ri = /* @__PURE__ */ dt(0, 0, 0.58, 1), Bn = /* @__PURE__ */ dt(0.42, 0, 0.58, 1), ai = (t) => Array.isArray(t) && typeof t[0] != "number", Kn = (t) => Array.isArray(t) && typeof t[0] == "number", ke = {
|
|
81
|
+
linear: et,
|
|
82
|
+
easeIn: ii,
|
|
83
|
+
easeInOut: Bn,
|
|
84
|
+
easeOut: ri,
|
|
85
|
+
circIn: ce,
|
|
86
|
+
circInOut: Ln,
|
|
87
|
+
circOut: si,
|
|
88
|
+
backIn: ue,
|
|
89
|
+
backInOut: kn,
|
|
90
|
+
backOut: Rn,
|
|
91
|
+
anticipate: Nn
|
|
92
|
+
}, oi = (t) => typeof t == "string", Ne = (t) => {
|
|
93
|
+
if (Kn(t)) {
|
|
94
|
+
j(t.length === 4, "Cubic bezier arrays must contain four numerical values.", "cubic-bezier-length");
|
|
95
|
+
const [e, n, s, i] = t;
|
|
96
|
+
return dt(e, n, s, i);
|
|
97
|
+
} else if (oi(t))
|
|
98
|
+
return j(ke[t] !== void 0, `Invalid easing type '${t}'`, "invalid-easing-type"), ke[t];
|
|
99
|
+
return t;
|
|
100
|
+
}, pt = [
|
|
101
|
+
"setup",
|
|
102
|
+
// Compute
|
|
103
|
+
"read",
|
|
104
|
+
// Read
|
|
105
|
+
"resolveKeyframes",
|
|
106
|
+
// Write/Read/Write/Read
|
|
107
|
+
"preUpdate",
|
|
108
|
+
// Compute
|
|
109
|
+
"update",
|
|
110
|
+
// Compute
|
|
111
|
+
"preRender",
|
|
112
|
+
// Compute
|
|
113
|
+
"render",
|
|
114
|
+
// Write
|
|
115
|
+
"postRender"
|
|
116
|
+
// Compute
|
|
117
|
+
];
|
|
118
|
+
function ui(t, e) {
|
|
119
|
+
let n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), i = !1, r = !1;
|
|
120
|
+
const a = /* @__PURE__ */ new WeakSet();
|
|
121
|
+
let o = {
|
|
122
|
+
delta: 0,
|
|
123
|
+
timestamp: 0,
|
|
124
|
+
isProcessing: !1
|
|
125
|
+
};
|
|
126
|
+
function c(u) {
|
|
127
|
+
a.has(u) && (l.schedule(u), t()), u(o);
|
|
128
|
+
}
|
|
129
|
+
const l = {
|
|
130
|
+
/**
|
|
131
|
+
* Schedule a process to run on the next frame.
|
|
132
|
+
*/
|
|
133
|
+
schedule: (u, f = !1, d = !1) => {
|
|
134
|
+
const y = d && i ? n : s;
|
|
135
|
+
return f && a.add(u), y.has(u) || y.add(u), u;
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
* Cancel the provided callback from running on the next frame.
|
|
139
|
+
*/
|
|
140
|
+
cancel: (u) => {
|
|
141
|
+
s.delete(u), a.delete(u);
|
|
142
|
+
},
|
|
143
|
+
/**
|
|
144
|
+
* Execute all schedule callbacks.
|
|
145
|
+
*/
|
|
146
|
+
process: (u) => {
|
|
147
|
+
if (o = u, i) {
|
|
148
|
+
r = !0;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
i = !0, [n, s] = [s, n], n.forEach(c), n.clear(), i = !1, r && (r = !1, l.process(u));
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
return l;
|
|
155
|
+
}
|
|
156
|
+
const ci = 40;
|
|
157
|
+
function jn(t, e) {
|
|
158
|
+
let n = !1, s = !0;
|
|
159
|
+
const i = {
|
|
160
|
+
delta: 0,
|
|
161
|
+
timestamp: 0,
|
|
162
|
+
isProcessing: !1
|
|
163
|
+
}, r = () => n = !0, a = pt.reduce((p, A) => (p[A] = ui(r), p), {}), { setup: o, read: c, resolveKeyframes: l, preUpdate: u, update: f, preRender: d, render: h, postRender: y } = a, v = () => {
|
|
164
|
+
const p = B.useManualTiming ? i.timestamp : performance.now();
|
|
165
|
+
n = !1, B.useManualTiming || (i.delta = s ? 1e3 / 60 : Math.max(Math.min(p - i.timestamp, ci), 1)), i.timestamp = p, i.isProcessing = !0, o.process(i), c.process(i), l.process(i), u.process(i), f.process(i), d.process(i), h.process(i), y.process(i), i.isProcessing = !1, n && e && (s = !1, t(v));
|
|
166
|
+
}, V = () => {
|
|
167
|
+
n = !0, s = !0, i.isProcessing || t(v);
|
|
168
|
+
};
|
|
169
|
+
return { schedule: pt.reduce((p, A) => {
|
|
170
|
+
const b = a[A];
|
|
171
|
+
return p[A] = (x, C = !1, T = !1) => (n || V(), b.schedule(x, C, T)), p;
|
|
172
|
+
}, {}), cancel: (p) => {
|
|
173
|
+
for (let A = 0; A < pt.length; A++)
|
|
174
|
+
a[pt[A]].cancel(p);
|
|
175
|
+
}, state: i, steps: a };
|
|
176
|
+
}
|
|
177
|
+
const { schedule: k, cancel: jt, state: Tt, steps: Eo } = /* @__PURE__ */ jn(typeof requestAnimationFrame < "u" ? requestAnimationFrame : et, !0);
|
|
178
|
+
let yt;
|
|
179
|
+
function li() {
|
|
180
|
+
yt = void 0;
|
|
181
|
+
}
|
|
182
|
+
const I = {
|
|
183
|
+
now: () => (yt === void 0 && I.set(Tt.isProcessing || B.useManualTiming ? Tt.timestamp : performance.now()), yt),
|
|
184
|
+
set: (t) => {
|
|
185
|
+
yt = t, queueMicrotask(li);
|
|
186
|
+
}
|
|
187
|
+
}, Wn = (t) => (e) => typeof e == "string" && e.startsWith(t), le = /* @__PURE__ */ Wn("--"), fi = /* @__PURE__ */ Wn("var(--"), fe = (t) => fi(t) ? di.test(t.split("/*")[0].trim()) : !1, di = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, nt = {
|
|
188
|
+
test: (t) => typeof t == "number",
|
|
189
|
+
parse: parseFloat,
|
|
190
|
+
transform: (t) => t
|
|
191
|
+
}, ct = {
|
|
192
|
+
...nt,
|
|
193
|
+
transform: (t) => H(0, 1, t)
|
|
194
|
+
}, gt = {
|
|
195
|
+
...nt,
|
|
196
|
+
default: 1
|
|
197
|
+
}, ut = (t) => Math.round(t * 1e5) / 1e5, de = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
198
|
+
function hi(t) {
|
|
199
|
+
return t == null;
|
|
200
|
+
}
|
|
201
|
+
const mi = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, he = (t, e) => (n) => !!(typeof n == "string" && mi.test(n) && n.startsWith(t) || e && !hi(n) && Object.prototype.hasOwnProperty.call(n, e)), $n = (t, e, n) => (s) => {
|
|
202
|
+
if (typeof s != "string")
|
|
203
|
+
return s;
|
|
204
|
+
const [i, r, a, o] = s.match(de);
|
|
205
|
+
return {
|
|
206
|
+
[t]: parseFloat(i),
|
|
207
|
+
[e]: parseFloat(r),
|
|
208
|
+
[n]: parseFloat(a),
|
|
209
|
+
alpha: o !== void 0 ? parseFloat(o) : 1
|
|
210
|
+
};
|
|
211
|
+
}, pi = (t) => H(0, 255, t), Ot = {
|
|
212
|
+
...nt,
|
|
213
|
+
transform: (t) => Math.round(pi(t))
|
|
214
|
+
}, _ = {
|
|
215
|
+
test: /* @__PURE__ */ he("rgb", "red"),
|
|
216
|
+
parse: /* @__PURE__ */ $n("red", "green", "blue"),
|
|
217
|
+
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + Ot.transform(t) + ", " + Ot.transform(e) + ", " + Ot.transform(n) + ", " + ut(ct.transform(s)) + ")"
|
|
218
|
+
};
|
|
219
|
+
function gi(t) {
|
|
220
|
+
let e = "", n = "", s = "", i = "";
|
|
221
|
+
return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7), i = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), s = t.substring(3, 4), i = t.substring(4, 5), e += e, n += n, s += s, i += i), {
|
|
222
|
+
red: parseInt(e, 16),
|
|
223
|
+
green: parseInt(n, 16),
|
|
224
|
+
blue: parseInt(s, 16),
|
|
225
|
+
alpha: i ? parseInt(i, 16) / 255 : 1
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
const Wt = {
|
|
229
|
+
test: /* @__PURE__ */ he("#"),
|
|
230
|
+
parse: gi,
|
|
231
|
+
transform: _.transform
|
|
232
|
+
}, ht = /* @__NO_SIDE_EFFECTS__ */ (t) => ({
|
|
233
|
+
test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
|
|
234
|
+
parse: parseFloat,
|
|
235
|
+
transform: (e) => `${e}${t}`
|
|
236
|
+
}), K = /* @__PURE__ */ ht("deg"), J = /* @__PURE__ */ ht("%"), m = /* @__PURE__ */ ht("px"), yi = /* @__PURE__ */ ht("vh"), bi = /* @__PURE__ */ ht("vw"), Le = {
|
|
237
|
+
...J,
|
|
238
|
+
parse: (t) => J.parse(t) / 100,
|
|
239
|
+
transform: (t) => J.transform(t * 100)
|
|
240
|
+
}, q = {
|
|
241
|
+
test: /* @__PURE__ */ he("hsl", "hue"),
|
|
242
|
+
parse: /* @__PURE__ */ $n("hue", "saturation", "lightness"),
|
|
243
|
+
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + J.transform(ut(e)) + ", " + J.transform(ut(n)) + ", " + ut(ct.transform(s)) + ")"
|
|
244
|
+
}, M = {
|
|
245
|
+
test: (t) => _.test(t) || Wt.test(t) || q.test(t),
|
|
246
|
+
parse: (t) => _.test(t) ? _.parse(t) : q.test(t) ? q.parse(t) : Wt.parse(t),
|
|
247
|
+
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? _.transform(t) : q.transform(t),
|
|
248
|
+
getAnimatableNone: (t) => {
|
|
249
|
+
const e = M.parse(t);
|
|
250
|
+
return e.alpha = 0, M.transform(e);
|
|
251
|
+
}
|
|
252
|
+
}, Ti = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
253
|
+
function vi(t) {
|
|
254
|
+
return isNaN(t) && typeof t == "string" && (t.match(de)?.length || 0) + (t.match(Ti)?.length || 0) > 0;
|
|
255
|
+
}
|
|
256
|
+
const _n = "number", Gn = "color", wi = "var", Vi = "var(", Be = "${}", xi = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
|
|
257
|
+
function lt(t) {
|
|
258
|
+
const e = t.toString(), n = [], s = {
|
|
259
|
+
color: [],
|
|
260
|
+
number: [],
|
|
261
|
+
var: []
|
|
262
|
+
}, i = [];
|
|
263
|
+
let r = 0;
|
|
264
|
+
const o = e.replace(xi, (c) => (M.test(c) ? (s.color.push(r), i.push(Gn), n.push(M.parse(c))) : c.startsWith(Vi) ? (s.var.push(r), i.push(wi), n.push(c)) : (s.number.push(r), i.push(_n), n.push(parseFloat(c))), ++r, Be)).split(Be);
|
|
265
|
+
return { values: n, split: o, indexes: s, types: i };
|
|
266
|
+
}
|
|
267
|
+
function Un(t) {
|
|
268
|
+
return lt(t).values;
|
|
269
|
+
}
|
|
270
|
+
function zn(t) {
|
|
271
|
+
const { split: e, types: n } = lt(t), s = e.length;
|
|
272
|
+
return (i) => {
|
|
273
|
+
let r = "";
|
|
274
|
+
for (let a = 0; a < s; a++)
|
|
275
|
+
if (r += e[a], i[a] !== void 0) {
|
|
276
|
+
const o = n[a];
|
|
277
|
+
o === _n ? r += ut(i[a]) : o === Gn ? r += M.transform(i[a]) : r += i[a];
|
|
278
|
+
}
|
|
279
|
+
return r;
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
const Ai = (t) => typeof t == "number" ? 0 : M.test(t) ? M.getAnimatableNone(t) : t;
|
|
283
|
+
function Si(t) {
|
|
284
|
+
const e = Un(t);
|
|
285
|
+
return zn(t)(e.map(Ai));
|
|
286
|
+
}
|
|
287
|
+
const st = {
|
|
288
|
+
test: vi,
|
|
289
|
+
parse: Un,
|
|
290
|
+
createTransformer: zn,
|
|
291
|
+
getAnimatableNone: Si
|
|
292
|
+
};
|
|
293
|
+
function Et(t, e, n) {
|
|
294
|
+
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t;
|
|
295
|
+
}
|
|
296
|
+
function Mi({ hue: t, saturation: e, lightness: n, alpha: s }) {
|
|
297
|
+
t /= 360, e /= 100, n /= 100;
|
|
298
|
+
let i = 0, r = 0, a = 0;
|
|
299
|
+
if (!e)
|
|
300
|
+
i = r = a = n;
|
|
301
|
+
else {
|
|
302
|
+
const o = n < 0.5 ? n * (1 + e) : n + e - n * e, c = 2 * n - o;
|
|
303
|
+
i = Et(c, o, t + 1 / 3), r = Et(c, o, t), a = Et(c, o, t - 1 / 3);
|
|
304
|
+
}
|
|
305
|
+
return {
|
|
306
|
+
red: Math.round(i * 255),
|
|
307
|
+
green: Math.round(r * 255),
|
|
308
|
+
blue: Math.round(a * 255),
|
|
309
|
+
alpha: s
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
function vt(t, e) {
|
|
313
|
+
return (n) => n > 0 ? e : t;
|
|
314
|
+
}
|
|
315
|
+
const mt = (t, e, n) => t + (e - t) * n, It = (t, e, n) => {
|
|
316
|
+
const s = t * t, i = n * (e * e - s) + s;
|
|
317
|
+
return i < 0 ? 0 : Math.sqrt(i);
|
|
318
|
+
}, Ci = [Wt, _, q], Pi = (t) => Ci.find((e) => e.test(t));
|
|
319
|
+
function Ke(t) {
|
|
320
|
+
const e = Pi(t);
|
|
321
|
+
if (tt(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"), !e)
|
|
322
|
+
return !1;
|
|
323
|
+
let n = e.parse(t);
|
|
324
|
+
return e === q && (n = Mi(n)), n;
|
|
325
|
+
}
|
|
326
|
+
const je = (t, e) => {
|
|
327
|
+
const n = Ke(t), s = Ke(e);
|
|
328
|
+
if (!n || !s)
|
|
329
|
+
return vt(t, e);
|
|
330
|
+
const i = { ...n };
|
|
331
|
+
return (r) => (i.red = It(n.red, s.red, r), i.green = It(n.green, s.green, r), i.blue = It(n.blue, s.blue, r), i.alpha = mt(n.alpha, s.alpha, r), _.transform(i));
|
|
332
|
+
}, $t = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
333
|
+
function Fi(t, e) {
|
|
334
|
+
return $t.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
|
|
335
|
+
}
|
|
336
|
+
function Di(t, e) {
|
|
337
|
+
return (n) => mt(t, e, n);
|
|
338
|
+
}
|
|
339
|
+
function me(t) {
|
|
340
|
+
return typeof t == "number" ? Di : typeof t == "string" ? fe(t) ? vt : M.test(t) ? je : Ii : Array.isArray(t) ? Hn : typeof t == "object" ? M.test(t) ? je : Oi : vt;
|
|
341
|
+
}
|
|
342
|
+
function Hn(t, e) {
|
|
343
|
+
const n = [...t], s = n.length, i = t.map((r, a) => me(r)(r, e[a]));
|
|
344
|
+
return (r) => {
|
|
345
|
+
for (let a = 0; a < s; a++)
|
|
346
|
+
n[a] = i[a](r);
|
|
347
|
+
return n;
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function Oi(t, e) {
|
|
351
|
+
const n = { ...t, ...e }, s = {};
|
|
352
|
+
for (const i in n)
|
|
353
|
+
t[i] !== void 0 && e[i] !== void 0 && (s[i] = me(t[i])(t[i], e[i]));
|
|
354
|
+
return (i) => {
|
|
355
|
+
for (const r in s)
|
|
356
|
+
n[r] = s[r](i);
|
|
357
|
+
return n;
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
function Ei(t, e) {
|
|
361
|
+
const n = [], s = { color: 0, var: 0, number: 0 };
|
|
362
|
+
for (let i = 0; i < e.values.length; i++) {
|
|
363
|
+
const r = e.types[i], a = t.indexes[r][s[r]], o = t.values[a] ?? 0;
|
|
364
|
+
n[i] = o, s[r]++;
|
|
365
|
+
}
|
|
366
|
+
return n;
|
|
367
|
+
}
|
|
368
|
+
const Ii = (t, e) => {
|
|
369
|
+
const n = st.createTransformer(e), s = lt(t), i = lt(e);
|
|
370
|
+
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? $t.has(t) && !i.values.length || $t.has(e) && !s.values.length ? Fi(t, e) : Mt(Hn(Ei(s, i), i.values), n) : (tt(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"), vt(t, e));
|
|
371
|
+
};
|
|
372
|
+
function Yn(t, e, n) {
|
|
373
|
+
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? mt(t, e, n) : me(t)(t, e);
|
|
374
|
+
}
|
|
375
|
+
const Ri = (t) => {
|
|
376
|
+
const e = ({ timestamp: n }) => t(n);
|
|
377
|
+
return {
|
|
378
|
+
start: (n = !0) => k.update(e, n),
|
|
379
|
+
stop: () => jt(e),
|
|
380
|
+
/**
|
|
381
|
+
* If we're processing this frame we can use the
|
|
382
|
+
* framelocked timestamp to keep things in sync.
|
|
383
|
+
*/
|
|
384
|
+
now: () => Tt.isProcessing ? Tt.timestamp : I.now()
|
|
385
|
+
};
|
|
386
|
+
}, Xn = (t, e, n = 10) => {
|
|
387
|
+
let s = "";
|
|
388
|
+
const i = Math.max(Math.round(e / n), 2);
|
|
389
|
+
for (let r = 0; r < i; r++)
|
|
390
|
+
s += Math.round(t(r / (i - 1)) * 1e4) / 1e4 + ", ";
|
|
391
|
+
return `linear(${s.substring(0, s.length - 2)})`;
|
|
392
|
+
}, wt = 2e4;
|
|
393
|
+
function pe(t) {
|
|
394
|
+
let e = 0;
|
|
395
|
+
const n = 50;
|
|
396
|
+
let s = t.next(e);
|
|
397
|
+
for (; !s.done && e < wt; )
|
|
398
|
+
e += n, s = t.next(e);
|
|
399
|
+
return e >= wt ? 1 / 0 : e;
|
|
400
|
+
}
|
|
401
|
+
function ki(t, e = 100, n) {
|
|
402
|
+
const s = n({ ...t, keyframes: [0, e] }), i = Math.min(pe(s), wt);
|
|
403
|
+
return {
|
|
404
|
+
type: "keyframes",
|
|
405
|
+
ease: (r) => s.next(i * r).value / e,
|
|
406
|
+
duration: /* @__PURE__ */ L(i)
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
const Ni = 5;
|
|
410
|
+
function qn(t, e, n) {
|
|
411
|
+
const s = Math.max(e - Ni, 0);
|
|
412
|
+
return Dn(n - t(s), e - s);
|
|
413
|
+
}
|
|
414
|
+
const S = {
|
|
415
|
+
// Default spring physics
|
|
416
|
+
stiffness: 100,
|
|
417
|
+
damping: 10,
|
|
418
|
+
mass: 1,
|
|
419
|
+
velocity: 0,
|
|
420
|
+
// Default duration/bounce-based options
|
|
421
|
+
duration: 800,
|
|
422
|
+
// in ms
|
|
423
|
+
bounce: 0.3,
|
|
424
|
+
visualDuration: 0.3,
|
|
425
|
+
// in seconds
|
|
426
|
+
// Rest thresholds
|
|
427
|
+
restSpeed: {
|
|
428
|
+
granular: 0.01,
|
|
429
|
+
default: 2
|
|
430
|
+
},
|
|
431
|
+
restDelta: {
|
|
432
|
+
granular: 5e-3,
|
|
433
|
+
default: 0.5
|
|
434
|
+
},
|
|
435
|
+
// Limits
|
|
436
|
+
minDuration: 0.01,
|
|
437
|
+
// in seconds
|
|
438
|
+
maxDuration: 10,
|
|
439
|
+
// in seconds
|
|
440
|
+
minDamping: 0.05,
|
|
441
|
+
maxDamping: 1
|
|
442
|
+
}, Rt = 1e-3;
|
|
443
|
+
function Li({ duration: t = S.duration, bounce: e = S.bounce, velocity: n = S.velocity, mass: s = S.mass }) {
|
|
444
|
+
let i, r;
|
|
445
|
+
tt(t <= /* @__PURE__ */ N(S.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
|
|
446
|
+
let a = 1 - e;
|
|
447
|
+
a = H(S.minDamping, S.maxDamping, a), t = H(S.minDuration, S.maxDuration, /* @__PURE__ */ L(t)), a < 1 ? (i = (l) => {
|
|
448
|
+
const u = l * a, f = u * t, d = u - n, h = _t(l, a), y = Math.exp(-f);
|
|
449
|
+
return Rt - d / h * y;
|
|
450
|
+
}, r = (l) => {
|
|
451
|
+
const f = l * a * t, d = f * n + n, h = Math.pow(a, 2) * Math.pow(l, 2) * t, y = Math.exp(-f), v = _t(Math.pow(l, 2), a);
|
|
452
|
+
return (-i(l) + Rt > 0 ? -1 : 1) * ((d - h) * y) / v;
|
|
453
|
+
}) : (i = (l) => {
|
|
454
|
+
const u = Math.exp(-l * t), f = (l - n) * t + 1;
|
|
455
|
+
return -Rt + u * f;
|
|
456
|
+
}, r = (l) => {
|
|
457
|
+
const u = Math.exp(-l * t), f = (n - l) * (t * t);
|
|
458
|
+
return u * f;
|
|
459
|
+
});
|
|
460
|
+
const o = 5 / t, c = Ki(i, r, o);
|
|
461
|
+
if (t = /* @__PURE__ */ N(t), isNaN(c))
|
|
462
|
+
return {
|
|
463
|
+
stiffness: S.stiffness,
|
|
464
|
+
damping: S.damping,
|
|
465
|
+
duration: t
|
|
466
|
+
};
|
|
467
|
+
{
|
|
468
|
+
const l = Math.pow(c, 2) * s;
|
|
469
|
+
return {
|
|
470
|
+
stiffness: l,
|
|
471
|
+
damping: a * 2 * Math.sqrt(s * l),
|
|
472
|
+
duration: t
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
const Bi = 12;
|
|
477
|
+
function Ki(t, e, n) {
|
|
478
|
+
let s = n;
|
|
479
|
+
for (let i = 1; i < Bi; i++)
|
|
480
|
+
s = s - t(s) / e(s);
|
|
481
|
+
return s;
|
|
482
|
+
}
|
|
483
|
+
function _t(t, e) {
|
|
484
|
+
return t * Math.sqrt(1 - e * e);
|
|
485
|
+
}
|
|
486
|
+
const ji = ["duration", "bounce"], Wi = ["stiffness", "damping", "mass"];
|
|
487
|
+
function We(t, e) {
|
|
488
|
+
return e.some((n) => t[n] !== void 0);
|
|
489
|
+
}
|
|
490
|
+
function $i(t) {
|
|
491
|
+
let e = {
|
|
492
|
+
velocity: S.velocity,
|
|
493
|
+
stiffness: S.stiffness,
|
|
494
|
+
damping: S.damping,
|
|
495
|
+
mass: S.mass,
|
|
496
|
+
isResolvedFromDuration: !1,
|
|
497
|
+
...t
|
|
498
|
+
};
|
|
499
|
+
if (!We(t, Wi) && We(t, ji))
|
|
500
|
+
if (t.visualDuration) {
|
|
501
|
+
const n = t.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 * H(0.05, 1, 1 - (t.bounce || 0)) * Math.sqrt(i);
|
|
502
|
+
e = {
|
|
503
|
+
...e,
|
|
504
|
+
mass: S.mass,
|
|
505
|
+
stiffness: i,
|
|
506
|
+
damping: r
|
|
507
|
+
};
|
|
508
|
+
} else {
|
|
509
|
+
const n = Li(t);
|
|
510
|
+
e = {
|
|
511
|
+
...e,
|
|
512
|
+
...n,
|
|
513
|
+
mass: S.mass
|
|
514
|
+
}, e.isResolvedFromDuration = !0;
|
|
515
|
+
}
|
|
516
|
+
return e;
|
|
517
|
+
}
|
|
518
|
+
function Vt(t = S.visualDuration, e = S.bounce) {
|
|
519
|
+
const n = typeof t != "object" ? {
|
|
520
|
+
visualDuration: t,
|
|
521
|
+
keyframes: [0, 1],
|
|
522
|
+
bounce: e
|
|
523
|
+
} : t;
|
|
524
|
+
let { restSpeed: s, restDelta: i } = n;
|
|
525
|
+
const r = n.keyframes[0], a = n.keyframes[n.keyframes.length - 1], o = { done: !1, value: r }, { stiffness: c, damping: l, mass: u, duration: f, velocity: d, isResolvedFromDuration: h } = $i({
|
|
526
|
+
...n,
|
|
527
|
+
velocity: -/* @__PURE__ */ L(n.velocity || 0)
|
|
528
|
+
}), y = d || 0, v = l / (2 * Math.sqrt(c * u)), V = a - r, g = /* @__PURE__ */ L(Math.sqrt(c / u)), w = Math.abs(V) < 5;
|
|
529
|
+
s || (s = w ? S.restSpeed.granular : S.restSpeed.default), i || (i = w ? S.restDelta.granular : S.restDelta.default);
|
|
530
|
+
let p;
|
|
531
|
+
if (v < 1) {
|
|
532
|
+
const b = _t(g, v);
|
|
533
|
+
p = (x) => {
|
|
534
|
+
const C = Math.exp(-v * g * x);
|
|
535
|
+
return a - C * ((y + v * g * V) / b * Math.sin(b * x) + V * Math.cos(b * x));
|
|
536
|
+
};
|
|
537
|
+
} else if (v === 1)
|
|
538
|
+
p = (b) => a - Math.exp(-g * b) * (V + (y + g * V) * b);
|
|
539
|
+
else {
|
|
540
|
+
const b = g * Math.sqrt(v * v - 1);
|
|
541
|
+
p = (x) => {
|
|
542
|
+
const C = Math.exp(-v * g * x), T = Math.min(b * x, 300);
|
|
543
|
+
return a - C * ((y + v * g * V) * Math.sinh(T) + b * V * Math.cosh(T)) / b;
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
const A = {
|
|
547
|
+
calculatedDuration: h && f || null,
|
|
548
|
+
next: (b) => {
|
|
549
|
+
const x = p(b);
|
|
550
|
+
if (h)
|
|
551
|
+
o.done = b >= f;
|
|
552
|
+
else {
|
|
553
|
+
let C = b === 0 ? y : 0;
|
|
554
|
+
v < 1 && (C = b === 0 ? /* @__PURE__ */ N(y) : qn(p, b, x));
|
|
555
|
+
const T = Math.abs(C) <= s, D = Math.abs(a - x) <= i;
|
|
556
|
+
o.done = T && D;
|
|
557
|
+
}
|
|
558
|
+
return o.value = o.done ? a : x, o;
|
|
559
|
+
},
|
|
560
|
+
toString: () => {
|
|
561
|
+
const b = Math.min(pe(A), wt), x = Xn((C) => A.next(b * C).value, b, 30);
|
|
562
|
+
return b + "ms " + x;
|
|
563
|
+
},
|
|
564
|
+
toTransition: () => {
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
return A;
|
|
568
|
+
}
|
|
569
|
+
Vt.applyToOptions = (t) => {
|
|
570
|
+
const e = ki(t, 100, Vt);
|
|
571
|
+
return t.ease = e.ease, t.duration = /* @__PURE__ */ N(e.duration), t.type = "keyframes", t;
|
|
572
|
+
};
|
|
573
|
+
function Gt({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: a, min: o, max: c, restDelta: l = 0.5, restSpeed: u }) {
|
|
574
|
+
const f = t[0], d = {
|
|
575
|
+
done: !1,
|
|
576
|
+
value: f
|
|
577
|
+
}, h = (T) => o !== void 0 && T < o || c !== void 0 && T > c, y = (T) => o === void 0 ? c : c === void 0 || Math.abs(o - T) < Math.abs(c - T) ? o : c;
|
|
578
|
+
let v = n * e;
|
|
579
|
+
const V = f + v, g = a === void 0 ? V : a(V);
|
|
580
|
+
g !== V && (v = g - f);
|
|
581
|
+
const w = (T) => -v * Math.exp(-T / s), p = (T) => g + w(T), A = (T) => {
|
|
582
|
+
const D = w(T), O = p(T);
|
|
583
|
+
d.done = Math.abs(D) <= l, d.value = d.done ? g : O;
|
|
584
|
+
};
|
|
585
|
+
let b, x;
|
|
586
|
+
const C = (T) => {
|
|
587
|
+
h(d.value) && (b = T, x = Vt({
|
|
588
|
+
keyframes: [d.value, y(d.value)],
|
|
589
|
+
velocity: qn(p, T, d.value),
|
|
590
|
+
// TODO: This should be passing * 1000
|
|
591
|
+
damping: i,
|
|
592
|
+
stiffness: r,
|
|
593
|
+
restDelta: l,
|
|
594
|
+
restSpeed: u
|
|
595
|
+
}));
|
|
596
|
+
};
|
|
597
|
+
return C(0), {
|
|
598
|
+
calculatedDuration: null,
|
|
599
|
+
next: (T) => {
|
|
600
|
+
let D = !1;
|
|
601
|
+
return !x && b === void 0 && (D = !0, A(T), C(T)), b !== void 0 && T >= b ? x.next(T - b) : (!D && A(T), d);
|
|
602
|
+
}
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
function _i(t, e, n) {
|
|
606
|
+
const s = [], i = n || B.mix || Yn, r = t.length - 1;
|
|
607
|
+
for (let a = 0; a < r; a++) {
|
|
608
|
+
let o = i(t[a], t[a + 1]);
|
|
609
|
+
if (e) {
|
|
610
|
+
const c = Array.isArray(e) ? e[a] || et : e;
|
|
611
|
+
o = Mt(c, o);
|
|
612
|
+
}
|
|
613
|
+
s.push(o);
|
|
614
|
+
}
|
|
615
|
+
return s;
|
|
616
|
+
}
|
|
617
|
+
function Gi(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
618
|
+
const r = t.length;
|
|
619
|
+
if (j(r === e.length, "Both input and output ranges must be the same length", "range-length"), r === 1)
|
|
620
|
+
return () => e[0];
|
|
621
|
+
if (r === 2 && e[0] === e[1])
|
|
622
|
+
return () => e[1];
|
|
623
|
+
const a = t[0] === t[1];
|
|
624
|
+
t[0] > t[r - 1] && (t = [...t].reverse(), e = [...e].reverse());
|
|
625
|
+
const o = _i(e, s, i), c = o.length, l = (u) => {
|
|
626
|
+
if (a && u < t[0])
|
|
627
|
+
return e[0];
|
|
628
|
+
let f = 0;
|
|
629
|
+
if (c > 1)
|
|
630
|
+
for (; f < t.length - 2 && !(u < t[f + 1]); f++)
|
|
631
|
+
;
|
|
632
|
+
const d = /* @__PURE__ */ Pn(t[f], t[f + 1], u);
|
|
633
|
+
return o[f](d);
|
|
634
|
+
};
|
|
635
|
+
return n ? (u) => l(H(t[0], t[r - 1], u)) : l;
|
|
636
|
+
}
|
|
637
|
+
function Ui(t, e) {
|
|
638
|
+
const n = t[t.length - 1];
|
|
639
|
+
for (let s = 1; s <= e; s++) {
|
|
640
|
+
const i = /* @__PURE__ */ Pn(0, e, s);
|
|
641
|
+
t.push(mt(n, 1, i));
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
function zi(t) {
|
|
645
|
+
const e = [0];
|
|
646
|
+
return Ui(e, t.length - 1), e;
|
|
647
|
+
}
|
|
648
|
+
function Hi(t, e) {
|
|
649
|
+
return t.map((n) => n * e);
|
|
650
|
+
}
|
|
651
|
+
function Yi(t, e) {
|
|
652
|
+
return t.map(() => e || Bn).splice(0, t.length - 1);
|
|
653
|
+
}
|
|
654
|
+
function Z({ duration: t = 300, keyframes: e, times: n, ease: s = "easeInOut" }) {
|
|
655
|
+
const i = ai(s) ? s.map(Ne) : Ne(s), r = {
|
|
656
|
+
done: !1,
|
|
657
|
+
value: e[0]
|
|
658
|
+
}, a = Hi(
|
|
659
|
+
// Only use the provided offsets if they're the correct length
|
|
660
|
+
// TODO Maybe we should warn here if there's a length mismatch
|
|
661
|
+
n && n.length === e.length ? n : zi(e),
|
|
662
|
+
t
|
|
663
|
+
), o = Gi(a, e, {
|
|
664
|
+
ease: Array.isArray(i) ? i : Yi(e, i)
|
|
665
|
+
});
|
|
666
|
+
return {
|
|
667
|
+
calculatedDuration: t,
|
|
668
|
+
next: (c) => (r.value = o(c), r.done = c >= t, r)
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
const Xi = (t) => t !== null;
|
|
672
|
+
function ge(t, { repeat: e, repeatType: n = "loop" }, s, i = 1) {
|
|
673
|
+
const r = t.filter(Xi), o = i < 0 || e && n !== "loop" && e % 2 === 1 ? 0 : r.length - 1;
|
|
674
|
+
return !o || s === void 0 ? r[o] : s;
|
|
675
|
+
}
|
|
676
|
+
const qi = {
|
|
677
|
+
decay: Gt,
|
|
678
|
+
inertia: Gt,
|
|
679
|
+
tween: Z,
|
|
680
|
+
keyframes: Z,
|
|
681
|
+
spring: Vt
|
|
682
|
+
};
|
|
683
|
+
function Zn(t) {
|
|
684
|
+
typeof t.type == "string" && (t.type = qi[t.type]);
|
|
685
|
+
}
|
|
686
|
+
class ye {
|
|
687
|
+
constructor() {
|
|
688
|
+
this.updateFinished();
|
|
689
|
+
}
|
|
690
|
+
get finished() {
|
|
691
|
+
return this._finished;
|
|
692
|
+
}
|
|
693
|
+
updateFinished() {
|
|
694
|
+
this._finished = new Promise((e) => {
|
|
695
|
+
this.resolve = e;
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
notifyFinished() {
|
|
699
|
+
this.resolve();
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Allows the animation to be awaited.
|
|
703
|
+
*
|
|
704
|
+
* @deprecated Use `finished` instead.
|
|
705
|
+
*/
|
|
706
|
+
then(e, n) {
|
|
707
|
+
return this.finished.then(e, n);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
const Zi = (t) => t / 100;
|
|
711
|
+
class be extends ye {
|
|
712
|
+
constructor(e) {
|
|
713
|
+
super(), this.state = "idle", this.startTime = null, this.isStopped = !1, this.currentTime = 0, this.holdTime = null, this.playbackSpeed = 1, this.stop = () => {
|
|
714
|
+
const { motionValue: n } = this.options;
|
|
715
|
+
n && n.updatedAt !== I.now() && this.tick(I.now()), this.isStopped = !0, this.state !== "idle" && (this.teardown(), this.options.onStop?.());
|
|
716
|
+
}, this.options = e, this.initAnimation(), this.play(), e.autoplay === !1 && this.pause();
|
|
717
|
+
}
|
|
718
|
+
initAnimation() {
|
|
719
|
+
const { options: e } = this;
|
|
720
|
+
Zn(e);
|
|
721
|
+
const { type: n = Z, repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: a = 0 } = e;
|
|
722
|
+
let { keyframes: o } = e;
|
|
723
|
+
const c = n || Z;
|
|
724
|
+
process.env.NODE_ENV !== "production" && c !== Z && j(o.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`, "spring-two-frames"), c !== Z && typeof o[0] != "number" && (this.mixKeyframes = Mt(Zi, Yn(o[0], o[1])), o = [0, 100]);
|
|
725
|
+
const l = c({ ...e, keyframes: o });
|
|
726
|
+
r === "mirror" && (this.mirroredGenerator = c({
|
|
727
|
+
...e,
|
|
728
|
+
keyframes: [...o].reverse(),
|
|
729
|
+
velocity: -a
|
|
730
|
+
})), l.calculatedDuration === null && (l.calculatedDuration = pe(l));
|
|
731
|
+
const { calculatedDuration: u } = l;
|
|
732
|
+
this.calculatedDuration = u, this.resolvedDuration = u + i, this.totalDuration = this.resolvedDuration * (s + 1) - i, this.generator = l;
|
|
733
|
+
}
|
|
734
|
+
updateTime(e) {
|
|
735
|
+
const n = Math.round(e - this.startTime) * this.playbackSpeed;
|
|
736
|
+
this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = n;
|
|
737
|
+
}
|
|
738
|
+
tick(e, n = !1) {
|
|
739
|
+
const { generator: s, totalDuration: i, mixKeyframes: r, mirroredGenerator: a, resolvedDuration: o, calculatedDuration: c } = this;
|
|
740
|
+
if (this.startTime === null)
|
|
741
|
+
return s.next(0);
|
|
742
|
+
const { delay: l = 0, keyframes: u, repeat: f, repeatType: d, repeatDelay: h, type: y, onUpdate: v, finalKeyframe: V } = this.options;
|
|
743
|
+
this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - i / this.speed, this.startTime)), n ? this.currentTime = e : this.updateTime(e);
|
|
744
|
+
const g = this.currentTime - l * (this.playbackSpeed >= 0 ? 1 : -1), w = this.playbackSpeed >= 0 ? g < 0 : g > i;
|
|
745
|
+
this.currentTime = Math.max(g, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = i);
|
|
746
|
+
let p = this.currentTime, A = s;
|
|
747
|
+
if (f) {
|
|
748
|
+
const T = Math.min(this.currentTime, i) / o;
|
|
749
|
+
let D = Math.floor(T), O = T % 1;
|
|
750
|
+
!O && T >= 1 && (O = 1), O === 1 && D--, D = Math.min(D, f + 1), !!(D % 2) && (d === "reverse" ? (O = 1 - O, h && (O -= h / o)) : d === "mirror" && (A = a)), p = H(0, 1, O) * o;
|
|
751
|
+
}
|
|
752
|
+
const b = w ? { done: !1, value: u[0] } : A.next(p);
|
|
753
|
+
r && (b.value = r(b.value));
|
|
754
|
+
let { done: x } = b;
|
|
755
|
+
!w && c !== null && (x = this.playbackSpeed >= 0 ? this.currentTime >= i : this.currentTime <= 0);
|
|
756
|
+
const C = this.holdTime === null && (this.state === "finished" || this.state === "running" && x);
|
|
757
|
+
return C && y !== Gt && (b.value = ge(u, this.options, V, this.speed)), v && v(b.value), C && this.finish(), b;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Allows the returned animation to be awaited or promise-chained. Currently
|
|
761
|
+
* resolves when the animation finishes at all but in a future update could/should
|
|
762
|
+
* reject if its cancels.
|
|
763
|
+
*/
|
|
764
|
+
then(e, n) {
|
|
765
|
+
return this.finished.then(e, n);
|
|
766
|
+
}
|
|
767
|
+
get duration() {
|
|
768
|
+
return /* @__PURE__ */ L(this.calculatedDuration);
|
|
769
|
+
}
|
|
770
|
+
get time() {
|
|
771
|
+
return /* @__PURE__ */ L(this.currentTime);
|
|
772
|
+
}
|
|
773
|
+
set time(e) {
|
|
774
|
+
e = /* @__PURE__ */ N(e), this.currentTime = e, this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.playbackSpeed), this.driver?.start(!1);
|
|
775
|
+
}
|
|
776
|
+
get speed() {
|
|
777
|
+
return this.playbackSpeed;
|
|
778
|
+
}
|
|
779
|
+
set speed(e) {
|
|
780
|
+
this.updateTime(I.now());
|
|
781
|
+
const n = this.playbackSpeed !== e;
|
|
782
|
+
this.playbackSpeed = e, n && (this.time = /* @__PURE__ */ L(this.currentTime));
|
|
783
|
+
}
|
|
784
|
+
play() {
|
|
785
|
+
if (this.isStopped)
|
|
786
|
+
return;
|
|
787
|
+
const { driver: e = Ri, startTime: n } = this.options;
|
|
788
|
+
this.driver || (this.driver = e((i) => this.tick(i))), this.options.onPlay?.();
|
|
789
|
+
const s = this.driver.now();
|
|
790
|
+
this.state === "finished" ? (this.updateFinished(), this.startTime = s) : this.holdTime !== null ? this.startTime = s - this.holdTime : this.startTime || (this.startTime = n ?? s), this.state === "finished" && this.speed < 0 && (this.startTime += this.calculatedDuration), this.holdTime = null, this.state = "running", this.driver.start();
|
|
791
|
+
}
|
|
792
|
+
pause() {
|
|
793
|
+
this.state = "paused", this.updateTime(I.now()), this.holdTime = this.currentTime;
|
|
794
|
+
}
|
|
795
|
+
complete() {
|
|
796
|
+
this.state !== "running" && this.play(), this.state = "finished", this.holdTime = null;
|
|
797
|
+
}
|
|
798
|
+
finish() {
|
|
799
|
+
this.notifyFinished(), this.teardown(), this.state = "finished", this.options.onComplete?.();
|
|
800
|
+
}
|
|
801
|
+
cancel() {
|
|
802
|
+
this.holdTime = null, this.startTime = 0, this.tick(0), this.teardown(), this.options.onCancel?.();
|
|
803
|
+
}
|
|
804
|
+
teardown() {
|
|
805
|
+
this.state = "idle", this.stopDriver(), this.startTime = this.holdTime = null;
|
|
806
|
+
}
|
|
807
|
+
stopDriver() {
|
|
808
|
+
this.driver && (this.driver.stop(), this.driver = void 0);
|
|
809
|
+
}
|
|
810
|
+
sample(e) {
|
|
811
|
+
return this.startTime = 0, this.tick(e, !0);
|
|
812
|
+
}
|
|
813
|
+
attachTimeline(e) {
|
|
814
|
+
return this.options.allowFlatten && (this.options.type = "keyframes", this.options.ease = "linear", this.initAnimation()), this.driver?.stop(), e.observe(this);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
function Ji(t) {
|
|
818
|
+
for (let e = 1; e < t.length; e++)
|
|
819
|
+
t[e] ?? (t[e] = t[e - 1]);
|
|
820
|
+
}
|
|
821
|
+
const G = (t) => t * 180 / Math.PI, Ut = (t) => {
|
|
822
|
+
const e = G(Math.atan2(t[1], t[0]));
|
|
823
|
+
return zt(e);
|
|
824
|
+
}, Qi = {
|
|
825
|
+
x: 4,
|
|
826
|
+
y: 5,
|
|
827
|
+
translateX: 4,
|
|
828
|
+
translateY: 5,
|
|
829
|
+
scaleX: 0,
|
|
830
|
+
scaleY: 3,
|
|
831
|
+
scale: (t) => (Math.abs(t[0]) + Math.abs(t[3])) / 2,
|
|
832
|
+
rotate: Ut,
|
|
833
|
+
rotateZ: Ut,
|
|
834
|
+
skewX: (t) => G(Math.atan(t[1])),
|
|
835
|
+
skewY: (t) => G(Math.atan(t[2])),
|
|
836
|
+
skew: (t) => (Math.abs(t[1]) + Math.abs(t[2])) / 2
|
|
837
|
+
}, zt = (t) => (t = t % 360, t < 0 && (t += 360), t), $e = Ut, _e = (t) => Math.sqrt(t[0] * t[0] + t[1] * t[1]), Ge = (t) => Math.sqrt(t[4] * t[4] + t[5] * t[5]), tr = {
|
|
838
|
+
x: 12,
|
|
839
|
+
y: 13,
|
|
840
|
+
z: 14,
|
|
841
|
+
translateX: 12,
|
|
842
|
+
translateY: 13,
|
|
843
|
+
translateZ: 14,
|
|
844
|
+
scaleX: _e,
|
|
845
|
+
scaleY: Ge,
|
|
846
|
+
scale: (t) => (_e(t) + Ge(t)) / 2,
|
|
847
|
+
rotateX: (t) => zt(G(Math.atan2(t[6], t[5]))),
|
|
848
|
+
rotateY: (t) => zt(G(Math.atan2(-t[2], t[0]))),
|
|
849
|
+
rotateZ: $e,
|
|
850
|
+
rotate: $e,
|
|
851
|
+
skewX: (t) => G(Math.atan(t[4])),
|
|
852
|
+
skewY: (t) => G(Math.atan(t[1])),
|
|
853
|
+
skew: (t) => (Math.abs(t[1]) + Math.abs(t[4])) / 2
|
|
854
|
+
};
|
|
855
|
+
function Ht(t) {
|
|
856
|
+
return t.includes("scale") ? 1 : 0;
|
|
857
|
+
}
|
|
858
|
+
function Yt(t, e) {
|
|
859
|
+
if (!t || t === "none")
|
|
860
|
+
return Ht(e);
|
|
861
|
+
const n = t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
|
|
862
|
+
let s, i;
|
|
863
|
+
if (n)
|
|
864
|
+
s = tr, i = n;
|
|
865
|
+
else {
|
|
866
|
+
const o = t.match(/^matrix\(([-\d.e\s,]+)\)$/u);
|
|
867
|
+
s = Qi, i = o;
|
|
868
|
+
}
|
|
869
|
+
if (!i)
|
|
870
|
+
return Ht(e);
|
|
871
|
+
const r = s[e], a = i[1].split(",").map(nr);
|
|
872
|
+
return typeof r == "function" ? r(a) : a[r];
|
|
873
|
+
}
|
|
874
|
+
const er = (t, e) => {
|
|
875
|
+
const { transform: n = "none" } = getComputedStyle(t);
|
|
876
|
+
return Yt(n, e);
|
|
877
|
+
};
|
|
878
|
+
function nr(t) {
|
|
879
|
+
return parseFloat(t.trim());
|
|
880
|
+
}
|
|
881
|
+
const it = [
|
|
882
|
+
"transformPerspective",
|
|
883
|
+
"x",
|
|
884
|
+
"y",
|
|
885
|
+
"z",
|
|
886
|
+
"translateX",
|
|
887
|
+
"translateY",
|
|
888
|
+
"translateZ",
|
|
889
|
+
"scale",
|
|
890
|
+
"scaleX",
|
|
891
|
+
"scaleY",
|
|
892
|
+
"rotate",
|
|
893
|
+
"rotateX",
|
|
894
|
+
"rotateY",
|
|
895
|
+
"rotateZ",
|
|
896
|
+
"skew",
|
|
897
|
+
"skewX",
|
|
898
|
+
"skewY"
|
|
899
|
+
], rt = new Set(it), Ue = (t) => t === nt || t === m, sr = /* @__PURE__ */ new Set(["x", "y", "z"]), ir = it.filter((t) => !sr.has(t));
|
|
900
|
+
function rr(t) {
|
|
901
|
+
const e = [];
|
|
902
|
+
return ir.forEach((n) => {
|
|
903
|
+
const s = t.getValue(n);
|
|
904
|
+
s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
|
|
905
|
+
}), e;
|
|
906
|
+
}
|
|
907
|
+
const U = {
|
|
908
|
+
// Dimensions
|
|
909
|
+
width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
910
|
+
height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
911
|
+
top: (t, { top: e }) => parseFloat(e),
|
|
912
|
+
left: (t, { left: e }) => parseFloat(e),
|
|
913
|
+
bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min),
|
|
914
|
+
right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min),
|
|
915
|
+
// Transform
|
|
916
|
+
x: (t, { transform: e }) => Yt(e, "x"),
|
|
917
|
+
y: (t, { transform: e }) => Yt(e, "y")
|
|
918
|
+
};
|
|
919
|
+
U.translateX = U.x;
|
|
920
|
+
U.translateY = U.y;
|
|
921
|
+
const z = /* @__PURE__ */ new Set();
|
|
922
|
+
let Xt = !1, qt = !1, Zt = !1;
|
|
923
|
+
function Jn() {
|
|
924
|
+
if (qt) {
|
|
925
|
+
const t = Array.from(z).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
|
|
926
|
+
e.forEach((s) => {
|
|
927
|
+
const i = rr(s);
|
|
928
|
+
i.length && (n.set(s, i), s.render());
|
|
929
|
+
}), t.forEach((s) => s.measureInitialState()), e.forEach((s) => {
|
|
930
|
+
s.render();
|
|
931
|
+
const i = n.get(s);
|
|
932
|
+
i && i.forEach(([r, a]) => {
|
|
933
|
+
s.getValue(r)?.set(a);
|
|
934
|
+
});
|
|
935
|
+
}), t.forEach((s) => s.measureEndState()), t.forEach((s) => {
|
|
936
|
+
s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
qt = !1, Xt = !1, z.forEach((t) => t.complete(Zt)), z.clear();
|
|
940
|
+
}
|
|
941
|
+
function Qn() {
|
|
942
|
+
z.forEach((t) => {
|
|
943
|
+
t.readKeyframes(), t.needsMeasurement && (qt = !0);
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
function ar() {
|
|
947
|
+
Zt = !0, Qn(), Jn(), Zt = !1;
|
|
948
|
+
}
|
|
949
|
+
class Te {
|
|
950
|
+
constructor(e, n, s, i, r, a = !1) {
|
|
951
|
+
this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = i, this.element = r, this.isAsync = a;
|
|
952
|
+
}
|
|
953
|
+
scheduleResolve() {
|
|
954
|
+
this.state = "scheduled", this.isAsync ? (z.add(this), Xt || (Xt = !0, k.read(Qn), k.resolveKeyframes(Jn))) : (this.readKeyframes(), this.complete());
|
|
955
|
+
}
|
|
956
|
+
readKeyframes() {
|
|
957
|
+
const { unresolvedKeyframes: e, name: n, element: s, motionValue: i } = this;
|
|
958
|
+
if (e[0] === null) {
|
|
959
|
+
const r = i?.get(), a = e[e.length - 1];
|
|
960
|
+
if (r !== void 0)
|
|
961
|
+
e[0] = r;
|
|
962
|
+
else if (s && n) {
|
|
963
|
+
const o = s.readValue(n, a);
|
|
964
|
+
o != null && (e[0] = o);
|
|
965
|
+
}
|
|
966
|
+
e[0] === void 0 && (e[0] = a), i && r === void 0 && i.set(e[0]);
|
|
967
|
+
}
|
|
968
|
+
Ji(e);
|
|
969
|
+
}
|
|
970
|
+
setFinalKeyframe() {
|
|
971
|
+
}
|
|
972
|
+
measureInitialState() {
|
|
973
|
+
}
|
|
974
|
+
renderEndStyles() {
|
|
975
|
+
}
|
|
976
|
+
measureEndState() {
|
|
977
|
+
}
|
|
978
|
+
complete(e = !1) {
|
|
979
|
+
this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e), z.delete(this);
|
|
980
|
+
}
|
|
981
|
+
cancel() {
|
|
982
|
+
this.state === "scheduled" && (z.delete(this), this.state = "pending");
|
|
983
|
+
}
|
|
984
|
+
resume() {
|
|
985
|
+
this.state === "pending" && this.scheduleResolve();
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
const or = (t) => t.startsWith("--");
|
|
989
|
+
function ur(t, e, n) {
|
|
990
|
+
or(e) ? t.style.setProperty(e, n) : t.style[e] = n;
|
|
991
|
+
}
|
|
992
|
+
const cr = /* @__PURE__ */ ae(() => window.ScrollTimeline !== void 0), lr = {};
|
|
993
|
+
function fr(t, e) {
|
|
994
|
+
const n = /* @__PURE__ */ ae(t);
|
|
995
|
+
return () => lr[e] ?? n();
|
|
996
|
+
}
|
|
997
|
+
const ts = /* @__PURE__ */ fr(() => {
|
|
998
|
+
try {
|
|
999
|
+
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
1000
|
+
} catch {
|
|
1001
|
+
return !1;
|
|
1002
|
+
}
|
|
1003
|
+
return !0;
|
|
1004
|
+
}, "linearEasing"), ot = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, ze = {
|
|
1005
|
+
linear: "linear",
|
|
1006
|
+
ease: "ease",
|
|
1007
|
+
easeIn: "ease-in",
|
|
1008
|
+
easeOut: "ease-out",
|
|
1009
|
+
easeInOut: "ease-in-out",
|
|
1010
|
+
circIn: /* @__PURE__ */ ot([0, 0.65, 0.55, 1]),
|
|
1011
|
+
circOut: /* @__PURE__ */ ot([0.55, 0, 1, 0.45]),
|
|
1012
|
+
backIn: /* @__PURE__ */ ot([0.31, 0.01, 0.66, -0.59]),
|
|
1013
|
+
backOut: /* @__PURE__ */ ot([0.33, 1.53, 0.69, 0.99])
|
|
1014
|
+
};
|
|
1015
|
+
function es(t, e) {
|
|
1016
|
+
if (t)
|
|
1017
|
+
return typeof t == "function" ? ts() ? Xn(t, e) : "ease-out" : Kn(t) ? ot(t) : Array.isArray(t) ? t.map((n) => es(n, e) || ze.easeOut) : ze[t];
|
|
1018
|
+
}
|
|
1019
|
+
function dr(t, e, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: a = "loop", ease: o = "easeOut", times: c } = {}, l = void 0) {
|
|
1020
|
+
const u = {
|
|
1021
|
+
[e]: n
|
|
1022
|
+
};
|
|
1023
|
+
c && (u.offset = c);
|
|
1024
|
+
const f = es(o, i);
|
|
1025
|
+
Array.isArray(f) && (u.easing = f);
|
|
1026
|
+
const d = {
|
|
1027
|
+
delay: s,
|
|
1028
|
+
duration: i,
|
|
1029
|
+
easing: Array.isArray(f) ? "linear" : f,
|
|
1030
|
+
fill: "both",
|
|
1031
|
+
iterations: r + 1,
|
|
1032
|
+
direction: a === "reverse" ? "alternate" : "normal"
|
|
1033
|
+
};
|
|
1034
|
+
return l && (d.pseudoElement = l), t.animate(u, d);
|
|
1035
|
+
}
|
|
1036
|
+
function ns(t) {
|
|
1037
|
+
return typeof t == "function" && "applyToOptions" in t;
|
|
1038
|
+
}
|
|
1039
|
+
function hr({ type: t, ...e }) {
|
|
1040
|
+
return ns(t) && ts() ? t.applyToOptions(e) : (e.duration ?? (e.duration = 300), e.ease ?? (e.ease = "easeOut"), e);
|
|
1041
|
+
}
|
|
1042
|
+
class mr extends ye {
|
|
1043
|
+
constructor(e) {
|
|
1044
|
+
if (super(), this.finishedTime = null, this.isStopped = !1, !e)
|
|
1045
|
+
return;
|
|
1046
|
+
const { element: n, name: s, keyframes: i, pseudoElement: r, allowFlatten: a = !1, finalKeyframe: o, onComplete: c } = e;
|
|
1047
|
+
this.isPseudoElement = !!r, this.allowFlatten = a, this.options = e, j(typeof e.type != "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring");
|
|
1048
|
+
const l = hr(e);
|
|
1049
|
+
this.animation = dr(n, s, i, l, r), l.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
|
|
1050
|
+
if (this.finishedTime = this.time, !r) {
|
|
1051
|
+
const u = ge(i, this.options, o, this.speed);
|
|
1052
|
+
this.updateMotionValue ? this.updateMotionValue(u) : ur(n, s, u), this.animation.cancel();
|
|
1053
|
+
}
|
|
1054
|
+
c?.(), this.notifyFinished();
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
play() {
|
|
1058
|
+
this.isStopped || (this.animation.play(), this.state === "finished" && this.updateFinished());
|
|
1059
|
+
}
|
|
1060
|
+
pause() {
|
|
1061
|
+
this.animation.pause();
|
|
1062
|
+
}
|
|
1063
|
+
complete() {
|
|
1064
|
+
this.animation.finish?.();
|
|
1065
|
+
}
|
|
1066
|
+
cancel() {
|
|
1067
|
+
try {
|
|
1068
|
+
this.animation.cancel();
|
|
1069
|
+
} catch {
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
stop() {
|
|
1073
|
+
if (this.isStopped)
|
|
1074
|
+
return;
|
|
1075
|
+
this.isStopped = !0;
|
|
1076
|
+
const { state: e } = this;
|
|
1077
|
+
e === "idle" || e === "finished" || (this.updateMotionValue ? this.updateMotionValue() : this.commitStyles(), this.isPseudoElement || this.cancel());
|
|
1078
|
+
}
|
|
1079
|
+
/**
|
|
1080
|
+
* WAAPI doesn't natively have any interruption capabilities.
|
|
1081
|
+
*
|
|
1082
|
+
* In this method, we commit styles back to the DOM before cancelling
|
|
1083
|
+
* the animation.
|
|
1084
|
+
*
|
|
1085
|
+
* This is designed to be overridden by NativeAnimationExtended, which
|
|
1086
|
+
* will create a renderless JS animation and sample it twice to calculate
|
|
1087
|
+
* its current value, "previous" value, and therefore allow
|
|
1088
|
+
* Motion to also correctly calculate velocity for any subsequent animation
|
|
1089
|
+
* while deferring the commit until the next animation frame.
|
|
1090
|
+
*/
|
|
1091
|
+
commitStyles() {
|
|
1092
|
+
this.isPseudoElement || this.animation.commitStyles?.();
|
|
1093
|
+
}
|
|
1094
|
+
get duration() {
|
|
1095
|
+
const e = this.animation.effect?.getComputedTiming?.().duration || 0;
|
|
1096
|
+
return /* @__PURE__ */ L(Number(e));
|
|
1097
|
+
}
|
|
1098
|
+
get time() {
|
|
1099
|
+
return /* @__PURE__ */ L(Number(this.animation.currentTime) || 0);
|
|
1100
|
+
}
|
|
1101
|
+
set time(e) {
|
|
1102
|
+
this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */ N(e);
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* The playback speed of the animation.
|
|
1106
|
+
* 1 = normal speed, 2 = double speed, 0.5 = half speed.
|
|
1107
|
+
*/
|
|
1108
|
+
get speed() {
|
|
1109
|
+
return this.animation.playbackRate;
|
|
1110
|
+
}
|
|
1111
|
+
set speed(e) {
|
|
1112
|
+
e < 0 && (this.finishedTime = null), this.animation.playbackRate = e;
|
|
1113
|
+
}
|
|
1114
|
+
get state() {
|
|
1115
|
+
return this.finishedTime !== null ? "finished" : this.animation.playState;
|
|
1116
|
+
}
|
|
1117
|
+
get startTime() {
|
|
1118
|
+
return Number(this.animation.startTime);
|
|
1119
|
+
}
|
|
1120
|
+
set startTime(e) {
|
|
1121
|
+
this.animation.startTime = e;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Attaches a timeline to the animation, for instance the `ScrollTimeline`.
|
|
1125
|
+
*/
|
|
1126
|
+
attachTimeline({ timeline: e, observe: n }) {
|
|
1127
|
+
return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, e && cr() ? (this.animation.timeline = e, et) : n(this);
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
const ss = {
|
|
1131
|
+
anticipate: Nn,
|
|
1132
|
+
backInOut: kn,
|
|
1133
|
+
circInOut: Ln
|
|
1134
|
+
};
|
|
1135
|
+
function pr(t) {
|
|
1136
|
+
return t in ss;
|
|
1137
|
+
}
|
|
1138
|
+
function gr(t) {
|
|
1139
|
+
typeof t.ease == "string" && pr(t.ease) && (t.ease = ss[t.ease]);
|
|
1140
|
+
}
|
|
1141
|
+
const He = 10;
|
|
1142
|
+
class yr extends mr {
|
|
1143
|
+
constructor(e) {
|
|
1144
|
+
gr(e), Zn(e), super(e), e.startTime && (this.startTime = e.startTime), this.options = e;
|
|
1145
|
+
}
|
|
1146
|
+
/**
|
|
1147
|
+
* WAAPI doesn't natively have any interruption capabilities.
|
|
1148
|
+
*
|
|
1149
|
+
* Rather than read commited styles back out of the DOM, we can
|
|
1150
|
+
* create a renderless JS animation and sample it twice to calculate
|
|
1151
|
+
* its current value, "previous" value, and therefore allow
|
|
1152
|
+
* Motion to calculate velocity for any subsequent animation.
|
|
1153
|
+
*/
|
|
1154
|
+
updateMotionValue(e) {
|
|
1155
|
+
const { motionValue: n, onUpdate: s, onComplete: i, element: r, ...a } = this.options;
|
|
1156
|
+
if (!n)
|
|
1157
|
+
return;
|
|
1158
|
+
if (e !== void 0) {
|
|
1159
|
+
n.set(e);
|
|
1160
|
+
return;
|
|
1161
|
+
}
|
|
1162
|
+
const o = new be({
|
|
1163
|
+
...a,
|
|
1164
|
+
autoplay: !1
|
|
1165
|
+
}), c = /* @__PURE__ */ N(this.finishedTime ?? this.time);
|
|
1166
|
+
n.setWithVelocity(o.sample(c - He).value, o.sample(c).value, He), o.stop();
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
const Ye = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
|
|
1170
|
+
(st.test(t) || t === "0") && // And it contains numbers and/or colors
|
|
1171
|
+
!t.startsWith("url("));
|
|
1172
|
+
function br(t) {
|
|
1173
|
+
const e = t[0];
|
|
1174
|
+
if (t.length === 1)
|
|
1175
|
+
return !0;
|
|
1176
|
+
for (let n = 0; n < t.length; n++)
|
|
1177
|
+
if (t[n] !== e)
|
|
1178
|
+
return !0;
|
|
1179
|
+
}
|
|
1180
|
+
function Tr(t, e, n, s) {
|
|
1181
|
+
const i = t[0];
|
|
1182
|
+
if (i === null)
|
|
1183
|
+
return !1;
|
|
1184
|
+
if (e === "display" || e === "visibility")
|
|
1185
|
+
return !0;
|
|
1186
|
+
const r = t[t.length - 1], a = Ye(i, e), o = Ye(r, e);
|
|
1187
|
+
return tt(a === o, `You are trying to animate ${e} from "${i}" to "${r}". "${a ? r : i}" is not an animatable value.`, "value-not-animatable"), !a || !o ? !1 : br(t) || (n === "spring" || ns(n)) && s;
|
|
1188
|
+
}
|
|
1189
|
+
function Jt(t) {
|
|
1190
|
+
t.duration = 0, t.type;
|
|
1191
|
+
}
|
|
1192
|
+
const vr = /* @__PURE__ */ new Set([
|
|
1193
|
+
"opacity",
|
|
1194
|
+
"clipPath",
|
|
1195
|
+
"filter",
|
|
1196
|
+
"transform"
|
|
1197
|
+
// TODO: Could be re-enabled now we have support for linear() easing
|
|
1198
|
+
// "background-color"
|
|
1199
|
+
]), wr = /* @__PURE__ */ ae(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
|
|
1200
|
+
function Vr(t) {
|
|
1201
|
+
const { motionValue: e, name: n, repeatDelay: s, repeatType: i, damping: r, type: a } = t;
|
|
1202
|
+
if (!(e?.owner?.current instanceof HTMLElement))
|
|
1203
|
+
return !1;
|
|
1204
|
+
const { onUpdate: c, transformTemplate: l } = e.owner.getProps();
|
|
1205
|
+
return wr() && n && vr.has(n) && (n !== "transform" || !l) && /**
|
|
1206
|
+
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
1207
|
+
* no way to read the value from WAAPI every frame.
|
|
1208
|
+
*/
|
|
1209
|
+
!c && !s && i !== "mirror" && r !== 0 && a !== "inertia";
|
|
1210
|
+
}
|
|
1211
|
+
const xr = 40;
|
|
1212
|
+
class Ar extends ye {
|
|
1213
|
+
constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: a = "loop", keyframes: o, name: c, motionValue: l, element: u, ...f }) {
|
|
1214
|
+
super(), this.stop = () => {
|
|
1215
|
+
this._animation && (this._animation.stop(), this.stopTimeline?.()), this.keyframeResolver?.cancel();
|
|
1216
|
+
}, this.createdAt = I.now();
|
|
1217
|
+
const d = {
|
|
1218
|
+
autoplay: e,
|
|
1219
|
+
delay: n,
|
|
1220
|
+
type: s,
|
|
1221
|
+
repeat: i,
|
|
1222
|
+
repeatDelay: r,
|
|
1223
|
+
repeatType: a,
|
|
1224
|
+
name: c,
|
|
1225
|
+
motionValue: l,
|
|
1226
|
+
element: u,
|
|
1227
|
+
...f
|
|
1228
|
+
}, h = u?.KeyframeResolver || Te;
|
|
1229
|
+
this.keyframeResolver = new h(o, (y, v, V) => this.onKeyframesResolved(y, v, d, !V), c, l, u), this.keyframeResolver?.scheduleResolve();
|
|
1230
|
+
}
|
|
1231
|
+
onKeyframesResolved(e, n, s, i) {
|
|
1232
|
+
this.keyframeResolver = void 0;
|
|
1233
|
+
const { name: r, type: a, velocity: o, delay: c, isHandoff: l, onUpdate: u } = s;
|
|
1234
|
+
this.resolvedAt = I.now(), Tr(e, r, a, o) || ((B.instantAnimations || !c) && u?.(ge(e, s, n)), e[0] = e[e.length - 1], Jt(s), s.repeat = 0);
|
|
1235
|
+
const d = {
|
|
1236
|
+
startTime: i ? this.resolvedAt ? this.resolvedAt - this.createdAt > xr ? this.resolvedAt : this.createdAt : this.createdAt : void 0,
|
|
1237
|
+
finalKeyframe: n,
|
|
1238
|
+
...s,
|
|
1239
|
+
keyframes: e
|
|
1240
|
+
}, h = !l && Vr(d) ? new yr({
|
|
1241
|
+
...d,
|
|
1242
|
+
element: d.motionValue.owner.current
|
|
1243
|
+
}) : new be(d);
|
|
1244
|
+
h.finished.then(() => this.notifyFinished()).catch(et), this.pendingTimeline && (this.stopTimeline = h.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = h;
|
|
1245
|
+
}
|
|
1246
|
+
get finished() {
|
|
1247
|
+
return this._animation ? this.animation.finished : this._finished;
|
|
1248
|
+
}
|
|
1249
|
+
then(e, n) {
|
|
1250
|
+
return this.finished.finally(e).then(() => {
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1253
|
+
get animation() {
|
|
1254
|
+
return this._animation || (this.keyframeResolver?.resume(), ar()), this._animation;
|
|
1255
|
+
}
|
|
1256
|
+
get duration() {
|
|
1257
|
+
return this.animation.duration;
|
|
1258
|
+
}
|
|
1259
|
+
get time() {
|
|
1260
|
+
return this.animation.time;
|
|
1261
|
+
}
|
|
1262
|
+
set time(e) {
|
|
1263
|
+
this.animation.time = e;
|
|
1264
|
+
}
|
|
1265
|
+
get speed() {
|
|
1266
|
+
return this.animation.speed;
|
|
1267
|
+
}
|
|
1268
|
+
get state() {
|
|
1269
|
+
return this.animation.state;
|
|
1270
|
+
}
|
|
1271
|
+
set speed(e) {
|
|
1272
|
+
this.animation.speed = e;
|
|
1273
|
+
}
|
|
1274
|
+
get startTime() {
|
|
1275
|
+
return this.animation.startTime;
|
|
1276
|
+
}
|
|
1277
|
+
attachTimeline(e) {
|
|
1278
|
+
return this._animation ? this.stopTimeline = this.animation.attachTimeline(e) : this.pendingTimeline = e, () => this.stop();
|
|
1279
|
+
}
|
|
1280
|
+
play() {
|
|
1281
|
+
this.animation.play();
|
|
1282
|
+
}
|
|
1283
|
+
pause() {
|
|
1284
|
+
this.animation.pause();
|
|
1285
|
+
}
|
|
1286
|
+
complete() {
|
|
1287
|
+
this.animation.complete();
|
|
1288
|
+
}
|
|
1289
|
+
cancel() {
|
|
1290
|
+
this._animation && this.animation.cancel(), this.keyframeResolver?.cancel();
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
const Sr = (
|
|
1294
|
+
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
1295
|
+
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
1296
|
+
);
|
|
1297
|
+
function Mr(t) {
|
|
1298
|
+
const e = Sr.exec(t);
|
|
1299
|
+
if (!e)
|
|
1300
|
+
return [,];
|
|
1301
|
+
const [, n, s, i] = e;
|
|
1302
|
+
return [`--${n ?? s}`, i];
|
|
1303
|
+
}
|
|
1304
|
+
const Cr = 4;
|
|
1305
|
+
function is(t, e, n = 1) {
|
|
1306
|
+
j(n <= Cr, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`, "max-css-var-depth");
|
|
1307
|
+
const [s, i] = Mr(t);
|
|
1308
|
+
if (!s)
|
|
1309
|
+
return;
|
|
1310
|
+
const r = window.getComputedStyle(e).getPropertyValue(s);
|
|
1311
|
+
if (r) {
|
|
1312
|
+
const a = r.trim();
|
|
1313
|
+
return Mn(a) ? parseFloat(a) : a;
|
|
1314
|
+
}
|
|
1315
|
+
return fe(i) ? is(i, e, n + 1) : i;
|
|
1316
|
+
}
|
|
1317
|
+
function rs(t, e) {
|
|
1318
|
+
return t?.[e] ?? t?.default ?? t;
|
|
1319
|
+
}
|
|
1320
|
+
const as = /* @__PURE__ */ new Set([
|
|
1321
|
+
"width",
|
|
1322
|
+
"height",
|
|
1323
|
+
"top",
|
|
1324
|
+
"left",
|
|
1325
|
+
"right",
|
|
1326
|
+
"bottom",
|
|
1327
|
+
...it
|
|
1328
|
+
]), Pr = {
|
|
1329
|
+
test: (t) => t === "auto",
|
|
1330
|
+
parse: (t) => t
|
|
1331
|
+
}, os = (t) => (e) => e.test(t), us = [nt, m, J, K, bi, yi, Pr], Xe = (t) => us.find(os(t));
|
|
1332
|
+
function Fr(t) {
|
|
1333
|
+
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || Cn(t) : !0;
|
|
1334
|
+
}
|
|
1335
|
+
const Dr = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
1336
|
+
function Or(t) {
|
|
1337
|
+
const [e, n] = t.slice(0, -1).split("(");
|
|
1338
|
+
if (e === "drop-shadow")
|
|
1339
|
+
return t;
|
|
1340
|
+
const [s] = n.match(de) || [];
|
|
1341
|
+
if (!s)
|
|
1342
|
+
return t;
|
|
1343
|
+
const i = n.replace(s, "");
|
|
1344
|
+
let r = Dr.has(e) ? 1 : 0;
|
|
1345
|
+
return s !== n && (r *= 100), e + "(" + r + i + ")";
|
|
1346
|
+
}
|
|
1347
|
+
const Er = /\b([a-z-]*)\(.*?\)/gu, Qt = {
|
|
1348
|
+
...st,
|
|
1349
|
+
getAnimatableNone: (t) => {
|
|
1350
|
+
const e = t.match(Er);
|
|
1351
|
+
return e ? e.map(Or).join(" ") : t;
|
|
1352
|
+
}
|
|
1353
|
+
}, qe = {
|
|
1354
|
+
...nt,
|
|
1355
|
+
transform: Math.round
|
|
1356
|
+
}, Ir = {
|
|
1357
|
+
rotate: K,
|
|
1358
|
+
rotateX: K,
|
|
1359
|
+
rotateY: K,
|
|
1360
|
+
rotateZ: K,
|
|
1361
|
+
scale: gt,
|
|
1362
|
+
scaleX: gt,
|
|
1363
|
+
scaleY: gt,
|
|
1364
|
+
scaleZ: gt,
|
|
1365
|
+
skew: K,
|
|
1366
|
+
skewX: K,
|
|
1367
|
+
skewY: K,
|
|
1368
|
+
distance: m,
|
|
1369
|
+
translateX: m,
|
|
1370
|
+
translateY: m,
|
|
1371
|
+
translateZ: m,
|
|
1372
|
+
x: m,
|
|
1373
|
+
y: m,
|
|
1374
|
+
z: m,
|
|
1375
|
+
perspective: m,
|
|
1376
|
+
transformPerspective: m,
|
|
1377
|
+
opacity: ct,
|
|
1378
|
+
originX: Le,
|
|
1379
|
+
originY: Le,
|
|
1380
|
+
originZ: m
|
|
1381
|
+
}, ve = {
|
|
1382
|
+
// Border props
|
|
1383
|
+
borderWidth: m,
|
|
1384
|
+
borderTopWidth: m,
|
|
1385
|
+
borderRightWidth: m,
|
|
1386
|
+
borderBottomWidth: m,
|
|
1387
|
+
borderLeftWidth: m,
|
|
1388
|
+
borderRadius: m,
|
|
1389
|
+
radius: m,
|
|
1390
|
+
borderTopLeftRadius: m,
|
|
1391
|
+
borderTopRightRadius: m,
|
|
1392
|
+
borderBottomRightRadius: m,
|
|
1393
|
+
borderBottomLeftRadius: m,
|
|
1394
|
+
// Positioning props
|
|
1395
|
+
width: m,
|
|
1396
|
+
maxWidth: m,
|
|
1397
|
+
height: m,
|
|
1398
|
+
maxHeight: m,
|
|
1399
|
+
top: m,
|
|
1400
|
+
right: m,
|
|
1401
|
+
bottom: m,
|
|
1402
|
+
left: m,
|
|
1403
|
+
// Spacing props
|
|
1404
|
+
padding: m,
|
|
1405
|
+
paddingTop: m,
|
|
1406
|
+
paddingRight: m,
|
|
1407
|
+
paddingBottom: m,
|
|
1408
|
+
paddingLeft: m,
|
|
1409
|
+
margin: m,
|
|
1410
|
+
marginTop: m,
|
|
1411
|
+
marginRight: m,
|
|
1412
|
+
marginBottom: m,
|
|
1413
|
+
marginLeft: m,
|
|
1414
|
+
// Misc
|
|
1415
|
+
backgroundPositionX: m,
|
|
1416
|
+
backgroundPositionY: m,
|
|
1417
|
+
...Ir,
|
|
1418
|
+
zIndex: qe,
|
|
1419
|
+
// SVG
|
|
1420
|
+
fillOpacity: ct,
|
|
1421
|
+
strokeOpacity: ct,
|
|
1422
|
+
numOctaves: qe
|
|
1423
|
+
}, Rr = {
|
|
1424
|
+
...ve,
|
|
1425
|
+
// Color props
|
|
1426
|
+
color: M,
|
|
1427
|
+
backgroundColor: M,
|
|
1428
|
+
outlineColor: M,
|
|
1429
|
+
fill: M,
|
|
1430
|
+
stroke: M,
|
|
1431
|
+
// Border props
|
|
1432
|
+
borderColor: M,
|
|
1433
|
+
borderTopColor: M,
|
|
1434
|
+
borderRightColor: M,
|
|
1435
|
+
borderBottomColor: M,
|
|
1436
|
+
borderLeftColor: M,
|
|
1437
|
+
filter: Qt,
|
|
1438
|
+
WebkitFilter: Qt
|
|
1439
|
+
}, cs = (t) => Rr[t];
|
|
1440
|
+
function ls(t, e) {
|
|
1441
|
+
let n = cs(t);
|
|
1442
|
+
return n !== Qt && (n = st), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
|
|
1443
|
+
}
|
|
1444
|
+
const kr = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
1445
|
+
function Nr(t, e, n) {
|
|
1446
|
+
let s = 0, i;
|
|
1447
|
+
for (; s < t.length && !i; ) {
|
|
1448
|
+
const r = t[s];
|
|
1449
|
+
typeof r == "string" && !kr.has(r) && lt(r).values.length && (i = t[s]), s++;
|
|
1450
|
+
}
|
|
1451
|
+
if (i && n)
|
|
1452
|
+
for (const r of e)
|
|
1453
|
+
t[r] = ls(n, i);
|
|
1454
|
+
}
|
|
1455
|
+
class Lr extends Te {
|
|
1456
|
+
constructor(e, n, s, i, r) {
|
|
1457
|
+
super(e, n, s, i, r, !0);
|
|
1458
|
+
}
|
|
1459
|
+
readKeyframes() {
|
|
1460
|
+
const { unresolvedKeyframes: e, element: n, name: s } = this;
|
|
1461
|
+
if (!n || !n.current)
|
|
1462
|
+
return;
|
|
1463
|
+
super.readKeyframes();
|
|
1464
|
+
for (let c = 0; c < e.length; c++) {
|
|
1465
|
+
let l = e[c];
|
|
1466
|
+
if (typeof l == "string" && (l = l.trim(), fe(l))) {
|
|
1467
|
+
const u = is(l, n.current);
|
|
1468
|
+
u !== void 0 && (e[c] = u), c === e.length - 1 && (this.finalKeyframe = l);
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
if (this.resolveNoneKeyframes(), !as.has(s) || e.length !== 2)
|
|
1472
|
+
return;
|
|
1473
|
+
const [i, r] = e, a = Xe(i), o = Xe(r);
|
|
1474
|
+
if (a !== o)
|
|
1475
|
+
if (Ue(a) && Ue(o))
|
|
1476
|
+
for (let c = 0; c < e.length; c++) {
|
|
1477
|
+
const l = e[c];
|
|
1478
|
+
typeof l == "string" && (e[c] = parseFloat(l));
|
|
1479
|
+
}
|
|
1480
|
+
else U[s] && (this.needsMeasurement = !0);
|
|
1481
|
+
}
|
|
1482
|
+
resolveNoneKeyframes() {
|
|
1483
|
+
const { unresolvedKeyframes: e, name: n } = this, s = [];
|
|
1484
|
+
for (let i = 0; i < e.length; i++)
|
|
1485
|
+
(e[i] === null || Fr(e[i])) && s.push(i);
|
|
1486
|
+
s.length && Nr(e, s, n);
|
|
1487
|
+
}
|
|
1488
|
+
measureInitialState() {
|
|
1489
|
+
const { element: e, unresolvedKeyframes: n, name: s } = this;
|
|
1490
|
+
if (!e || !e.current)
|
|
1491
|
+
return;
|
|
1492
|
+
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = U[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
|
|
1493
|
+
const i = n[n.length - 1];
|
|
1494
|
+
i !== void 0 && e.getValue(s, i).jump(i, !1);
|
|
1495
|
+
}
|
|
1496
|
+
measureEndState() {
|
|
1497
|
+
const { element: e, name: n, unresolvedKeyframes: s } = this;
|
|
1498
|
+
if (!e || !e.current)
|
|
1499
|
+
return;
|
|
1500
|
+
const i = e.getValue(n);
|
|
1501
|
+
i && i.jump(this.measuredOrigin, !1);
|
|
1502
|
+
const r = s.length - 1, a = s[r];
|
|
1503
|
+
s[r] = U[n](e.measureViewportBox(), window.getComputedStyle(e.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), this.removedTransforms?.length && this.removedTransforms.forEach(([o, c]) => {
|
|
1504
|
+
e.getValue(o).set(c);
|
|
1505
|
+
}), this.resolveNoneKeyframes();
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
function Br(t, e, n) {
|
|
1509
|
+
if (t instanceof EventTarget)
|
|
1510
|
+
return [t];
|
|
1511
|
+
if (typeof t == "string") {
|
|
1512
|
+
let s = document;
|
|
1513
|
+
const i = n?.[t] ?? s.querySelectorAll(t);
|
|
1514
|
+
return i ? Array.from(i) : [];
|
|
1515
|
+
}
|
|
1516
|
+
return Array.from(t);
|
|
1517
|
+
}
|
|
1518
|
+
const fs = (t, e) => e && typeof t == "number" ? e.transform(t) : t, Ze = 30, Kr = (t) => !isNaN(parseFloat(t));
|
|
1519
|
+
class jr {
|
|
1520
|
+
/**
|
|
1521
|
+
* @param init - The initiating value
|
|
1522
|
+
* @param config - Optional configuration options
|
|
1523
|
+
*
|
|
1524
|
+
* - `transformer`: A function to transform incoming values with.
|
|
1525
|
+
*/
|
|
1526
|
+
constructor(e, n = {}) {
|
|
1527
|
+
this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s) => {
|
|
1528
|
+
const i = I.now();
|
|
1529
|
+
if (this.updatedAt !== i && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && (this.events.change?.notify(this.current), this.dependents))
|
|
1530
|
+
for (const r of this.dependents)
|
|
1531
|
+
r.dirty();
|
|
1532
|
+
}, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner;
|
|
1533
|
+
}
|
|
1534
|
+
setCurrent(e) {
|
|
1535
|
+
this.current = e, this.updatedAt = I.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = Kr(this.current));
|
|
1536
|
+
}
|
|
1537
|
+
setPrevFrameValue(e = this.current) {
|
|
1538
|
+
this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
|
|
1539
|
+
}
|
|
1540
|
+
/**
|
|
1541
|
+
* Adds a function that will be notified when the `MotionValue` is updated.
|
|
1542
|
+
*
|
|
1543
|
+
* It returns a function that, when called, will cancel the subscription.
|
|
1544
|
+
*
|
|
1545
|
+
* When calling `onChange` inside a React component, it should be wrapped with the
|
|
1546
|
+
* `useEffect` hook. As it returns an unsubscribe function, this should be returned
|
|
1547
|
+
* from the `useEffect` function to ensure you don't add duplicate subscribers..
|
|
1548
|
+
*
|
|
1549
|
+
* ```jsx
|
|
1550
|
+
* export const MyComponent = () => {
|
|
1551
|
+
* const x = useMotionValue(0)
|
|
1552
|
+
* const y = useMotionValue(0)
|
|
1553
|
+
* const opacity = useMotionValue(1)
|
|
1554
|
+
*
|
|
1555
|
+
* useEffect(() => {
|
|
1556
|
+
* function updateOpacity() {
|
|
1557
|
+
* const maxXY = Math.max(x.get(), y.get())
|
|
1558
|
+
* const newOpacity = transform(maxXY, [0, 100], [1, 0])
|
|
1559
|
+
* opacity.set(newOpacity)
|
|
1560
|
+
* }
|
|
1561
|
+
*
|
|
1562
|
+
* const unsubscribeX = x.on("change", updateOpacity)
|
|
1563
|
+
* const unsubscribeY = y.on("change", updateOpacity)
|
|
1564
|
+
*
|
|
1565
|
+
* return () => {
|
|
1566
|
+
* unsubscribeX()
|
|
1567
|
+
* unsubscribeY()
|
|
1568
|
+
* }
|
|
1569
|
+
* }, [])
|
|
1570
|
+
*
|
|
1571
|
+
* return <motion.div style={{ x }} />
|
|
1572
|
+
* }
|
|
1573
|
+
* ```
|
|
1574
|
+
*
|
|
1575
|
+
* @param subscriber - A function that receives the latest value.
|
|
1576
|
+
* @returns A function that, when called, will cancel this subscription.
|
|
1577
|
+
*
|
|
1578
|
+
* @deprecated
|
|
1579
|
+
*/
|
|
1580
|
+
onChange(e) {
|
|
1581
|
+
return process.env.NODE_ENV !== "production" && oe(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e);
|
|
1582
|
+
}
|
|
1583
|
+
on(e, n) {
|
|
1584
|
+
this.events[e] || (this.events[e] = new Fn());
|
|
1585
|
+
const s = this.events[e].add(n);
|
|
1586
|
+
return e === "change" ? () => {
|
|
1587
|
+
s(), k.read(() => {
|
|
1588
|
+
this.events.change.getSize() || this.stop();
|
|
1589
|
+
});
|
|
1590
|
+
} : s;
|
|
1591
|
+
}
|
|
1592
|
+
clearListeners() {
|
|
1593
|
+
for (const e in this.events)
|
|
1594
|
+
this.events[e].clear();
|
|
1595
|
+
}
|
|
1596
|
+
/**
|
|
1597
|
+
* Attaches a passive effect to the `MotionValue`.
|
|
1598
|
+
*/
|
|
1599
|
+
attach(e, n) {
|
|
1600
|
+
this.passiveEffect = e, this.stopPassiveEffect = n;
|
|
1601
|
+
}
|
|
1602
|
+
/**
|
|
1603
|
+
* Sets the state of the `MotionValue`.
|
|
1604
|
+
*
|
|
1605
|
+
* @remarks
|
|
1606
|
+
*
|
|
1607
|
+
* ```jsx
|
|
1608
|
+
* const x = useMotionValue(0)
|
|
1609
|
+
* x.set(10)
|
|
1610
|
+
* ```
|
|
1611
|
+
*
|
|
1612
|
+
* @param latest - Latest value to set.
|
|
1613
|
+
* @param render - Whether to notify render subscribers. Defaults to `true`
|
|
1614
|
+
*
|
|
1615
|
+
* @public
|
|
1616
|
+
*/
|
|
1617
|
+
set(e) {
|
|
1618
|
+
this.passiveEffect ? this.passiveEffect(e, this.updateAndNotify) : this.updateAndNotify(e);
|
|
1619
|
+
}
|
|
1620
|
+
setWithVelocity(e, n, s) {
|
|
1621
|
+
this.set(n), this.prev = void 0, this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt - s;
|
|
1622
|
+
}
|
|
1623
|
+
/**
|
|
1624
|
+
* Set the state of the `MotionValue`, stopping any active animations,
|
|
1625
|
+
* effects, and resets velocity to `0`.
|
|
1626
|
+
*/
|
|
1627
|
+
jump(e, n = !0) {
|
|
1628
|
+
this.updateAndNotify(e), this.prev = e, this.prevUpdatedAt = this.prevFrameValue = void 0, n && this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
1629
|
+
}
|
|
1630
|
+
dirty() {
|
|
1631
|
+
this.events.change?.notify(this.current);
|
|
1632
|
+
}
|
|
1633
|
+
addDependent(e) {
|
|
1634
|
+
this.dependents || (this.dependents = /* @__PURE__ */ new Set()), this.dependents.add(e);
|
|
1635
|
+
}
|
|
1636
|
+
removeDependent(e) {
|
|
1637
|
+
this.dependents && this.dependents.delete(e);
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* Returns the latest state of `MotionValue`
|
|
1641
|
+
*
|
|
1642
|
+
* @returns - The latest state of `MotionValue`
|
|
1643
|
+
*
|
|
1644
|
+
* @public
|
|
1645
|
+
*/
|
|
1646
|
+
get() {
|
|
1647
|
+
return this.current;
|
|
1648
|
+
}
|
|
1649
|
+
/**
|
|
1650
|
+
* @public
|
|
1651
|
+
*/
|
|
1652
|
+
getPrevious() {
|
|
1653
|
+
return this.prev;
|
|
1654
|
+
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Returns the latest velocity of `MotionValue`
|
|
1657
|
+
*
|
|
1658
|
+
* @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
|
|
1659
|
+
*
|
|
1660
|
+
* @public
|
|
1661
|
+
*/
|
|
1662
|
+
getVelocity() {
|
|
1663
|
+
const e = I.now();
|
|
1664
|
+
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Ze)
|
|
1665
|
+
return 0;
|
|
1666
|
+
const n = Math.min(this.updatedAt - this.prevUpdatedAt, Ze);
|
|
1667
|
+
return Dn(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
|
|
1668
|
+
}
|
|
1669
|
+
/**
|
|
1670
|
+
* Registers a new animation to control this `MotionValue`. Only one
|
|
1671
|
+
* animation can drive a `MotionValue` at one time.
|
|
1672
|
+
*
|
|
1673
|
+
* ```jsx
|
|
1674
|
+
* value.start()
|
|
1675
|
+
* ```
|
|
1676
|
+
*
|
|
1677
|
+
* @param animation - A function that starts the provided animation
|
|
1678
|
+
*/
|
|
1679
|
+
start(e) {
|
|
1680
|
+
return this.stop(), new Promise((n) => {
|
|
1681
|
+
this.hasAnimated = !0, this.animation = e(n), this.events.animationStart && this.events.animationStart.notify();
|
|
1682
|
+
}).then(() => {
|
|
1683
|
+
this.events.animationComplete && this.events.animationComplete.notify(), this.clearAnimation();
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1686
|
+
/**
|
|
1687
|
+
* Stop the currently active animation.
|
|
1688
|
+
*
|
|
1689
|
+
* @public
|
|
1690
|
+
*/
|
|
1691
|
+
stop() {
|
|
1692
|
+
this.animation && (this.animation.stop(), this.events.animationCancel && this.events.animationCancel.notify()), this.clearAnimation();
|
|
1693
|
+
}
|
|
1694
|
+
/**
|
|
1695
|
+
* Returns `true` if this value is currently animating.
|
|
1696
|
+
*
|
|
1697
|
+
* @public
|
|
1698
|
+
*/
|
|
1699
|
+
isAnimating() {
|
|
1700
|
+
return !!this.animation;
|
|
1701
|
+
}
|
|
1702
|
+
clearAnimation() {
|
|
1703
|
+
delete this.animation;
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Destroy and clean up subscribers to this `MotionValue`.
|
|
1707
|
+
*
|
|
1708
|
+
* The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
|
|
1709
|
+
* handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
|
|
1710
|
+
* created a `MotionValue` via the `motionValue` function.
|
|
1711
|
+
*
|
|
1712
|
+
* @public
|
|
1713
|
+
*/
|
|
1714
|
+
destroy() {
|
|
1715
|
+
this.dependents?.clear(), this.events.destroy?.notify(), this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
function xt(t, e) {
|
|
1719
|
+
return new jr(t, e);
|
|
1720
|
+
}
|
|
1721
|
+
const { schedule: Wr } = /* @__PURE__ */ jn(queueMicrotask, !1), Je = {
|
|
1722
|
+
x: !1,
|
|
1723
|
+
y: !1
|
|
1724
|
+
};
|
|
1725
|
+
function ds() {
|
|
1726
|
+
return Je.x || Je.y;
|
|
1727
|
+
}
|
|
1728
|
+
function hs(t, e) {
|
|
1729
|
+
const n = Br(t), s = new AbortController(), i = {
|
|
1730
|
+
passive: !0,
|
|
1731
|
+
...e,
|
|
1732
|
+
signal: s.signal
|
|
1733
|
+
};
|
|
1734
|
+
return [n, i, () => s.abort()];
|
|
1735
|
+
}
|
|
1736
|
+
function Qe(t) {
|
|
1737
|
+
return !(t.pointerType === "touch" || ds());
|
|
1738
|
+
}
|
|
1739
|
+
function $r(t, e, n = {}) {
|
|
1740
|
+
const [s, i, r] = hs(t, n), a = (o) => {
|
|
1741
|
+
if (!Qe(o))
|
|
1742
|
+
return;
|
|
1743
|
+
const { target: c } = o, l = e(c, o);
|
|
1744
|
+
if (typeof l != "function" || !c)
|
|
1745
|
+
return;
|
|
1746
|
+
const u = (f) => {
|
|
1747
|
+
Qe(f) && (l(f), c.removeEventListener("pointerleave", u));
|
|
1748
|
+
};
|
|
1749
|
+
c.addEventListener("pointerleave", u, i);
|
|
1750
|
+
};
|
|
1751
|
+
return s.forEach((o) => {
|
|
1752
|
+
o.addEventListener("pointerenter", a, i);
|
|
1753
|
+
}), r;
|
|
1754
|
+
}
|
|
1755
|
+
const ms = (t, e) => e ? t === e ? !0 : ms(t, e.parentElement) : !1, ps = (t) => t.pointerType === "mouse" ? typeof t.button != "number" || t.button <= 0 : t.isPrimary !== !1, _r = /* @__PURE__ */ new Set([
|
|
1756
|
+
"BUTTON",
|
|
1757
|
+
"INPUT",
|
|
1758
|
+
"SELECT",
|
|
1759
|
+
"TEXTAREA",
|
|
1760
|
+
"A"
|
|
1761
|
+
]);
|
|
1762
|
+
function Gr(t) {
|
|
1763
|
+
return _r.has(t.tagName) || t.tabIndex !== -1;
|
|
1764
|
+
}
|
|
1765
|
+
const bt = /* @__PURE__ */ new WeakSet();
|
|
1766
|
+
function tn(t) {
|
|
1767
|
+
return (e) => {
|
|
1768
|
+
e.key === "Enter" && t(e);
|
|
1769
|
+
};
|
|
1770
|
+
}
|
|
1771
|
+
function kt(t, e) {
|
|
1772
|
+
t.dispatchEvent(new PointerEvent("pointer" + e, { isPrimary: !0, bubbles: !0 }));
|
|
1773
|
+
}
|
|
1774
|
+
const Ur = (t, e) => {
|
|
1775
|
+
const n = t.currentTarget;
|
|
1776
|
+
if (!n)
|
|
1777
|
+
return;
|
|
1778
|
+
const s = tn(() => {
|
|
1779
|
+
if (bt.has(n))
|
|
1780
|
+
return;
|
|
1781
|
+
kt(n, "down");
|
|
1782
|
+
const i = tn(() => {
|
|
1783
|
+
kt(n, "up");
|
|
1784
|
+
}), r = () => kt(n, "cancel");
|
|
1785
|
+
n.addEventListener("keyup", i, e), n.addEventListener("blur", r, e);
|
|
1786
|
+
});
|
|
1787
|
+
n.addEventListener("keydown", s, e), n.addEventListener("blur", () => n.removeEventListener("keydown", s), e);
|
|
1788
|
+
};
|
|
1789
|
+
function en(t) {
|
|
1790
|
+
return ps(t) && !ds();
|
|
1791
|
+
}
|
|
1792
|
+
function zr(t, e, n = {}) {
|
|
1793
|
+
const [s, i, r] = hs(t, n), a = (o) => {
|
|
1794
|
+
const c = o.currentTarget;
|
|
1795
|
+
if (!en(o))
|
|
1796
|
+
return;
|
|
1797
|
+
bt.add(c);
|
|
1798
|
+
const l = e(c, o), u = (h, y) => {
|
|
1799
|
+
window.removeEventListener("pointerup", f), window.removeEventListener("pointercancel", d), bt.has(c) && bt.delete(c), en(h) && typeof l == "function" && l(h, { success: y });
|
|
1800
|
+
}, f = (h) => {
|
|
1801
|
+
u(h, c === window || c === document || n.useGlobalTarget || ms(c, h.target));
|
|
1802
|
+
}, d = (h) => {
|
|
1803
|
+
u(h, !1);
|
|
1804
|
+
};
|
|
1805
|
+
window.addEventListener("pointerup", f, i), window.addEventListener("pointercancel", d, i);
|
|
1806
|
+
};
|
|
1807
|
+
return s.forEach((o) => {
|
|
1808
|
+
(n.useGlobalTarget ? window : o).addEventListener("pointerdown", a, i), Us(o) && (o.addEventListener("focus", (l) => Ur(l, i)), !Gr(o) && !o.hasAttribute("tabindex") && (o.tabIndex = 0));
|
|
1809
|
+
}), r;
|
|
1810
|
+
}
|
|
1811
|
+
const F = (t) => !!(t && t.getVelocity), Hr = [...us, M, st], Yr = (t) => Hr.find(os(t)), Xr = /* @__PURE__ */ new Set([
|
|
1812
|
+
"animate",
|
|
1813
|
+
"exit",
|
|
1814
|
+
"variants",
|
|
1815
|
+
"initial",
|
|
1816
|
+
"style",
|
|
1817
|
+
"values",
|
|
1818
|
+
"variants",
|
|
1819
|
+
"transition",
|
|
1820
|
+
"transformTemplate",
|
|
1821
|
+
"custom",
|
|
1822
|
+
"inherit",
|
|
1823
|
+
"onBeforeLayoutMeasure",
|
|
1824
|
+
"onAnimationStart",
|
|
1825
|
+
"onAnimationComplete",
|
|
1826
|
+
"onUpdate",
|
|
1827
|
+
"onDragStart",
|
|
1828
|
+
"onDrag",
|
|
1829
|
+
"onDragEnd",
|
|
1830
|
+
"onMeasureDragConstraints",
|
|
1831
|
+
"onDirectionLock",
|
|
1832
|
+
"onDragTransitionEnd",
|
|
1833
|
+
"_dragX",
|
|
1834
|
+
"_dragY",
|
|
1835
|
+
"onHoverStart",
|
|
1836
|
+
"onHoverEnd",
|
|
1837
|
+
"onViewportEnter",
|
|
1838
|
+
"onViewportLeave",
|
|
1839
|
+
"globalTapTarget",
|
|
1840
|
+
"ignoreStrict",
|
|
1841
|
+
"viewport"
|
|
1842
|
+
]);
|
|
1843
|
+
function At(t) {
|
|
1844
|
+
return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || Xr.has(t);
|
|
1845
|
+
}
|
|
1846
|
+
let gs = (t) => !At(t);
|
|
1847
|
+
function qr(t) {
|
|
1848
|
+
typeof t == "function" && (gs = (e) => e.startsWith("on") ? !At(e) : t(e));
|
|
1849
|
+
}
|
|
1850
|
+
try {
|
|
1851
|
+
qr(require("@emotion/is-prop-valid").default);
|
|
1852
|
+
} catch {
|
|
1853
|
+
}
|
|
1854
|
+
function Zr(t, e, n) {
|
|
1855
|
+
const s = {};
|
|
1856
|
+
for (const i in t)
|
|
1857
|
+
i === "values" && typeof t.values == "object" || (gs(i) || n === !0 && At(i) || !e && !At(i) || // If trying to use native HTML drag events, forward drag listeners
|
|
1858
|
+
t.draggable && i.startsWith("onDrag")) && (s[i] = t[i]);
|
|
1859
|
+
return s;
|
|
1860
|
+
}
|
|
1861
|
+
const Ct = /* @__PURE__ */ vn({});
|
|
1862
|
+
function Pt(t) {
|
|
1863
|
+
return t !== null && typeof t == "object" && typeof t.start == "function";
|
|
1864
|
+
}
|
|
1865
|
+
function ft(t) {
|
|
1866
|
+
return typeof t == "string" || Array.isArray(t);
|
|
1867
|
+
}
|
|
1868
|
+
const we = [
|
|
1869
|
+
"animate",
|
|
1870
|
+
"whileInView",
|
|
1871
|
+
"whileFocus",
|
|
1872
|
+
"whileHover",
|
|
1873
|
+
"whileTap",
|
|
1874
|
+
"whileDrag",
|
|
1875
|
+
"exit"
|
|
1876
|
+
], Ve = ["initial", ...we];
|
|
1877
|
+
function Ft(t) {
|
|
1878
|
+
return Pt(t.animate) || Ve.some((e) => ft(t[e]));
|
|
1879
|
+
}
|
|
1880
|
+
function ys(t) {
|
|
1881
|
+
return !!(Ft(t) || t.variants);
|
|
1882
|
+
}
|
|
1883
|
+
function Jr(t, e) {
|
|
1884
|
+
if (Ft(t)) {
|
|
1885
|
+
const { initial: n, animate: s } = t;
|
|
1886
|
+
return {
|
|
1887
|
+
initial: n === !1 || ft(n) ? n : void 0,
|
|
1888
|
+
animate: ft(s) ? s : void 0
|
|
1889
|
+
};
|
|
1890
|
+
}
|
|
1891
|
+
return t.inherit !== !1 ? e : {};
|
|
1892
|
+
}
|
|
1893
|
+
function Qr(t) {
|
|
1894
|
+
const { initial: e, animate: n } = Jr(t, R(Ct));
|
|
1895
|
+
return St(() => ({ initial: e, animate: n }), [nn(e), nn(n)]);
|
|
1896
|
+
}
|
|
1897
|
+
function nn(t) {
|
|
1898
|
+
return Array.isArray(t) ? t.join(" ") : t;
|
|
1899
|
+
}
|
|
1900
|
+
const te = {};
|
|
1901
|
+
function Io(t) {
|
|
1902
|
+
for (const e in t)
|
|
1903
|
+
te[e] = t[e], le(e) && (te[e].isCSSVariable = !0);
|
|
1904
|
+
}
|
|
1905
|
+
function bs(t, { layout: e, layoutId: n }) {
|
|
1906
|
+
return rt.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!te[t] || t === "opacity");
|
|
1907
|
+
}
|
|
1908
|
+
const ta = {
|
|
1909
|
+
x: "translateX",
|
|
1910
|
+
y: "translateY",
|
|
1911
|
+
z: "translateZ",
|
|
1912
|
+
transformPerspective: "perspective"
|
|
1913
|
+
}, ea = it.length;
|
|
1914
|
+
function na(t, e, n) {
|
|
1915
|
+
let s = "", i = !0;
|
|
1916
|
+
for (let r = 0; r < ea; r++) {
|
|
1917
|
+
const a = it[r], o = t[a];
|
|
1918
|
+
if (o === void 0)
|
|
1919
|
+
continue;
|
|
1920
|
+
let c = !0;
|
|
1921
|
+
if (typeof o == "number" ? c = o === (a.startsWith("scale") ? 1 : 0) : c = parseFloat(o) === 0, !c || n) {
|
|
1922
|
+
const l = fs(o, ve[a]);
|
|
1923
|
+
if (!c) {
|
|
1924
|
+
i = !1;
|
|
1925
|
+
const u = ta[a] || a;
|
|
1926
|
+
s += `${u}(${l}) `;
|
|
1927
|
+
}
|
|
1928
|
+
n && (e[a] = l);
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
return s = s.trim(), n ? s = n(e, i ? "" : s) : i && (s = "none"), s;
|
|
1932
|
+
}
|
|
1933
|
+
function xe(t, e, n) {
|
|
1934
|
+
const { style: s, vars: i, transformOrigin: r } = t;
|
|
1935
|
+
let a = !1, o = !1;
|
|
1936
|
+
for (const c in e) {
|
|
1937
|
+
const l = e[c];
|
|
1938
|
+
if (rt.has(c)) {
|
|
1939
|
+
a = !0;
|
|
1940
|
+
continue;
|
|
1941
|
+
} else if (le(c)) {
|
|
1942
|
+
i[c] = l;
|
|
1943
|
+
continue;
|
|
1944
|
+
} else {
|
|
1945
|
+
const u = fs(l, ve[c]);
|
|
1946
|
+
c.startsWith("origin") ? (o = !0, r[c] = u) : s[c] = u;
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
if (e.transform || (a || n ? s.transform = na(e, t.transform, n) : s.transform && (s.transform = "none")), o) {
|
|
1950
|
+
const { originX: c = "50%", originY: l = "50%", originZ: u = 0 } = r;
|
|
1951
|
+
s.transformOrigin = `${c} ${l} ${u}`;
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
const Ae = () => ({
|
|
1955
|
+
style: {},
|
|
1956
|
+
transform: {},
|
|
1957
|
+
transformOrigin: {},
|
|
1958
|
+
vars: {}
|
|
1959
|
+
});
|
|
1960
|
+
function Ts(t, e, n) {
|
|
1961
|
+
for (const s in e)
|
|
1962
|
+
!F(e[s]) && !bs(s, n) && (t[s] = e[s]);
|
|
1963
|
+
}
|
|
1964
|
+
function sa({ transformTemplate: t }, e) {
|
|
1965
|
+
return St(() => {
|
|
1966
|
+
const n = Ae();
|
|
1967
|
+
return xe(n, e, t), Object.assign({}, n.vars, n.style);
|
|
1968
|
+
}, [e]);
|
|
1969
|
+
}
|
|
1970
|
+
function ia(t, e) {
|
|
1971
|
+
const n = t.style || {}, s = {};
|
|
1972
|
+
return Ts(s, n, t), Object.assign(s, sa(t, e)), s;
|
|
1973
|
+
}
|
|
1974
|
+
function ra(t, e) {
|
|
1975
|
+
const n = {}, s = ia(t, e);
|
|
1976
|
+
return t.drag && t.dragListener !== !1 && (n.draggable = !1, s.userSelect = s.WebkitUserSelect = s.WebkitTouchCallout = "none", s.touchAction = t.drag === !0 ? "none" : `pan-${t.drag === "x" ? "y" : "x"}`), t.tabIndex === void 0 && (t.onTap || t.onTapStart || t.whileTap) && (n.tabIndex = 0), n.style = s, n;
|
|
1977
|
+
}
|
|
1978
|
+
const aa = {
|
|
1979
|
+
offset: "stroke-dashoffset",
|
|
1980
|
+
array: "stroke-dasharray"
|
|
1981
|
+
}, oa = {
|
|
1982
|
+
offset: "strokeDashoffset",
|
|
1983
|
+
array: "strokeDasharray"
|
|
1984
|
+
};
|
|
1985
|
+
function ua(t, e, n = 1, s = 0, i = !0) {
|
|
1986
|
+
t.pathLength = 1;
|
|
1987
|
+
const r = i ? aa : oa;
|
|
1988
|
+
t[r.offset] = m.transform(-s);
|
|
1989
|
+
const a = m.transform(e), o = m.transform(n);
|
|
1990
|
+
t[r.array] = `${a} ${o}`;
|
|
1991
|
+
}
|
|
1992
|
+
function vs(t, {
|
|
1993
|
+
attrX: e,
|
|
1994
|
+
attrY: n,
|
|
1995
|
+
attrScale: s,
|
|
1996
|
+
pathLength: i,
|
|
1997
|
+
pathSpacing: r = 1,
|
|
1998
|
+
pathOffset: a = 0,
|
|
1999
|
+
// This is object creation, which we try to avoid per-frame.
|
|
2000
|
+
...o
|
|
2001
|
+
}, c, l, u) {
|
|
2002
|
+
if (xe(t, o, l), c) {
|
|
2003
|
+
t.style.viewBox && (t.attrs.viewBox = t.style.viewBox);
|
|
2004
|
+
return;
|
|
2005
|
+
}
|
|
2006
|
+
t.attrs = t.style, t.style = {};
|
|
2007
|
+
const { attrs: f, style: d } = t;
|
|
2008
|
+
f.transform && (d.transform = f.transform, delete f.transform), (d.transform || f.transformOrigin) && (d.transformOrigin = f.transformOrigin ?? "50% 50%", delete f.transformOrigin), d.transform && (d.transformBox = u?.transformBox ?? "fill-box", delete f.transformBox), e !== void 0 && (f.x = e), n !== void 0 && (f.y = n), s !== void 0 && (f.scale = s), i !== void 0 && ua(f, i, r, a, !1);
|
|
2009
|
+
}
|
|
2010
|
+
const ws = () => ({
|
|
2011
|
+
...Ae(),
|
|
2012
|
+
attrs: {}
|
|
2013
|
+
}), Vs = (t) => typeof t == "string" && t.toLowerCase() === "svg";
|
|
2014
|
+
function ca(t, e, n, s) {
|
|
2015
|
+
const i = St(() => {
|
|
2016
|
+
const r = ws();
|
|
2017
|
+
return vs(r, e, Vs(s), t.transformTemplate, t.style), {
|
|
2018
|
+
...r.attrs,
|
|
2019
|
+
style: { ...r.style }
|
|
2020
|
+
};
|
|
2021
|
+
}, [e]);
|
|
2022
|
+
if (t.style) {
|
|
2023
|
+
const r = {};
|
|
2024
|
+
Ts(r, t.style, t), i.style = { ...r, ...i.style };
|
|
2025
|
+
}
|
|
2026
|
+
return i;
|
|
2027
|
+
}
|
|
2028
|
+
const la = [
|
|
2029
|
+
"animate",
|
|
2030
|
+
"circle",
|
|
2031
|
+
"defs",
|
|
2032
|
+
"desc",
|
|
2033
|
+
"ellipse",
|
|
2034
|
+
"g",
|
|
2035
|
+
"image",
|
|
2036
|
+
"line",
|
|
2037
|
+
"filter",
|
|
2038
|
+
"marker",
|
|
2039
|
+
"mask",
|
|
2040
|
+
"metadata",
|
|
2041
|
+
"path",
|
|
2042
|
+
"pattern",
|
|
2043
|
+
"polygon",
|
|
2044
|
+
"polyline",
|
|
2045
|
+
"rect",
|
|
2046
|
+
"stop",
|
|
2047
|
+
"switch",
|
|
2048
|
+
"symbol",
|
|
2049
|
+
"svg",
|
|
2050
|
+
"text",
|
|
2051
|
+
"tspan",
|
|
2052
|
+
"use",
|
|
2053
|
+
"view"
|
|
2054
|
+
];
|
|
2055
|
+
function Se(t) {
|
|
2056
|
+
return (
|
|
2057
|
+
/**
|
|
2058
|
+
* If it's not a string, it's a custom React component. Currently we only support
|
|
2059
|
+
* HTML custom React components.
|
|
2060
|
+
*/
|
|
2061
|
+
typeof t != "string" || /**
|
|
2062
|
+
* If it contains a dash, the element is a custom HTML webcomponent.
|
|
2063
|
+
*/
|
|
2064
|
+
t.includes("-") ? !1 : (
|
|
2065
|
+
/**
|
|
2066
|
+
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
2067
|
+
*/
|
|
2068
|
+
!!(la.indexOf(t) > -1 || /**
|
|
2069
|
+
* If it contains a capital letter, it's an SVG component
|
|
2070
|
+
*/
|
|
2071
|
+
/[A-Z]/u.test(t))
|
|
2072
|
+
)
|
|
2073
|
+
);
|
|
2074
|
+
}
|
|
2075
|
+
function fa(t, e, n, { latestValues: s }, i, r = !1) {
|
|
2076
|
+
const o = (Se(t) ? ca : ra)(e, s, i, t), c = Zr(e, typeof t == "string", r), l = t !== wn ? { ...c, ...o, ref: n } : {}, { children: u } = e, f = St(() => F(u) ? u.get() : u, [u]);
|
|
2077
|
+
return js(t, {
|
|
2078
|
+
...l,
|
|
2079
|
+
children: f
|
|
2080
|
+
});
|
|
2081
|
+
}
|
|
2082
|
+
function sn(t) {
|
|
2083
|
+
const e = [{}, {}];
|
|
2084
|
+
return t?.values.forEach((n, s) => {
|
|
2085
|
+
e[0][s] = n.get(), e[1][s] = n.getVelocity();
|
|
2086
|
+
}), e;
|
|
2087
|
+
}
|
|
2088
|
+
function Me(t, e, n, s) {
|
|
2089
|
+
if (typeof e == "function") {
|
|
2090
|
+
const [i, r] = sn(s);
|
|
2091
|
+
e = e(n !== void 0 ? n : t.custom, i, r);
|
|
2092
|
+
}
|
|
2093
|
+
if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") {
|
|
2094
|
+
const [i, r] = sn(s);
|
|
2095
|
+
e = e(n !== void 0 ? n : t.custom, i, r);
|
|
2096
|
+
}
|
|
2097
|
+
return e;
|
|
2098
|
+
}
|
|
2099
|
+
function da(t) {
|
|
2100
|
+
return F(t) ? t.get() : t;
|
|
2101
|
+
}
|
|
2102
|
+
function ha({ scrapeMotionValuesFromProps: t, createRenderState: e }, n, s, i) {
|
|
2103
|
+
return {
|
|
2104
|
+
latestValues: ma(n, s, i, t),
|
|
2105
|
+
renderState: e()
|
|
2106
|
+
};
|
|
2107
|
+
}
|
|
2108
|
+
function ma(t, e, n, s) {
|
|
2109
|
+
const i = {}, r = s(t, {});
|
|
2110
|
+
for (const d in r)
|
|
2111
|
+
i[d] = da(r[d]);
|
|
2112
|
+
let { initial: a, animate: o } = t;
|
|
2113
|
+
const c = Ft(t), l = ys(t);
|
|
2114
|
+
e && l && !c && t.inherit !== !1 && (a === void 0 && (a = e.initial), o === void 0 && (o = e.animate));
|
|
2115
|
+
let u = n ? n.initial === !1 : !1;
|
|
2116
|
+
u = u || a === !1;
|
|
2117
|
+
const f = u ? o : a;
|
|
2118
|
+
if (f && typeof f != "boolean" && !Pt(f)) {
|
|
2119
|
+
const d = Array.isArray(f) ? f : [f];
|
|
2120
|
+
for (let h = 0; h < d.length; h++) {
|
|
2121
|
+
const y = Me(t, d[h]);
|
|
2122
|
+
if (y) {
|
|
2123
|
+
const { transitionEnd: v, transition: V, ...g } = y;
|
|
2124
|
+
for (const w in g) {
|
|
2125
|
+
let p = g[w];
|
|
2126
|
+
if (Array.isArray(p)) {
|
|
2127
|
+
const A = u ? p.length - 1 : 0;
|
|
2128
|
+
p = p[A];
|
|
2129
|
+
}
|
|
2130
|
+
p !== null && (i[w] = p);
|
|
2131
|
+
}
|
|
2132
|
+
for (const w in v)
|
|
2133
|
+
i[w] = v[w];
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
return i;
|
|
2138
|
+
}
|
|
2139
|
+
const xs = (t) => (e, n) => {
|
|
2140
|
+
const s = R(Ct), i = R(Vn), r = () => ha(t, e, s, i);
|
|
2141
|
+
return n ? r() : zs(r);
|
|
2142
|
+
};
|
|
2143
|
+
function Ce(t, e, n) {
|
|
2144
|
+
const { style: s } = t, i = {};
|
|
2145
|
+
for (const r in s)
|
|
2146
|
+
(F(s[r]) || e.style && F(e.style[r]) || bs(r, t) || n?.getValue(r)?.liveStyle !== void 0) && (i[r] = s[r]);
|
|
2147
|
+
return i;
|
|
2148
|
+
}
|
|
2149
|
+
const pa = /* @__PURE__ */ xs({
|
|
2150
|
+
scrapeMotionValuesFromProps: Ce,
|
|
2151
|
+
createRenderState: Ae
|
|
2152
|
+
});
|
|
2153
|
+
function As(t, e, n) {
|
|
2154
|
+
const s = Ce(t, e, n);
|
|
2155
|
+
for (const i in t)
|
|
2156
|
+
if (F(t[i]) || F(e[i])) {
|
|
2157
|
+
const r = it.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
|
|
2158
|
+
s[r] = t[i];
|
|
2159
|
+
}
|
|
2160
|
+
return s;
|
|
2161
|
+
}
|
|
2162
|
+
const ga = /* @__PURE__ */ xs({
|
|
2163
|
+
scrapeMotionValuesFromProps: As,
|
|
2164
|
+
createRenderState: ws
|
|
2165
|
+
}), ya = Symbol.for("motionComponentSymbol");
|
|
2166
|
+
function Ss(t) {
|
|
2167
|
+
return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
|
|
2168
|
+
}
|
|
2169
|
+
function ba(t, e, n) {
|
|
2170
|
+
return Ws(
|
|
2171
|
+
(s) => {
|
|
2172
|
+
s && t.onMount && t.onMount(s), e && (s ? e.mount(s) : e.unmount()), n && (typeof n == "function" ? n(s) : Ss(n) && (n.current = s));
|
|
2173
|
+
},
|
|
2174
|
+
/**
|
|
2175
|
+
* Only pass a new ref callback to React if we've received a visual element
|
|
2176
|
+
* factory. Otherwise we'll be mounting/remounting every time externalRef
|
|
2177
|
+
* or other dependencies change.
|
|
2178
|
+
*/
|
|
2179
|
+
[e]
|
|
2180
|
+
);
|
|
2181
|
+
}
|
|
2182
|
+
const Pe = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Ta = "framerAppearId", Ms = "data-" + Pe(Ta), va = vn({});
|
|
2183
|
+
function wa(t, e, n, s, i) {
|
|
2184
|
+
const { visualElement: r } = R(Ct), a = R(xn), o = R(Vn), c = R(An).reducedMotion, l = Dt(null);
|
|
2185
|
+
s = s || a.renderer, !l.current && s && (l.current = s(t, {
|
|
2186
|
+
visualState: e,
|
|
2187
|
+
parent: r,
|
|
2188
|
+
props: n,
|
|
2189
|
+
presenceContext: o,
|
|
2190
|
+
blockInitialAnimation: o ? o.initial === !1 : !1,
|
|
2191
|
+
reducedMotionConfig: c
|
|
2192
|
+
}));
|
|
2193
|
+
const u = l.current, f = R(va);
|
|
2194
|
+
u && !u.projection && i && (u.type === "html" || u.type === "svg") && Va(l.current, n, i, f);
|
|
2195
|
+
const d = Dt(!1);
|
|
2196
|
+
$s(() => {
|
|
2197
|
+
u && d.current && u.update(n, o);
|
|
2198
|
+
});
|
|
2199
|
+
const h = n[Ms], y = Dt(!!h && !window.MotionHandoffIsComplete?.(h) && window.MotionHasOptimisedAnimation?.(h));
|
|
2200
|
+
return Hs(() => {
|
|
2201
|
+
u && (d.current = !0, window.MotionIsMounted = !0, u.updateFeatures(), u.scheduleRenderMicrotask(), y.current && u.animationState && u.animationState.animateChanges());
|
|
2202
|
+
}), _s(() => {
|
|
2203
|
+
u && (!y.current && u.animationState && u.animationState.animateChanges(), y.current && (queueMicrotask(() => {
|
|
2204
|
+
window.MotionHandoffMarkAsComplete?.(h);
|
|
2205
|
+
}), y.current = !1), u.enteringChildren = void 0);
|
|
2206
|
+
}), u;
|
|
2207
|
+
}
|
|
2208
|
+
function Va(t, e, n, s) {
|
|
2209
|
+
const { layoutId: i, layout: r, drag: a, dragConstraints: o, layoutScroll: c, layoutRoot: l, layoutCrossfade: u } = e;
|
|
2210
|
+
t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : Cs(t.parent)), t.projection.setOptions({
|
|
2211
|
+
layoutId: i,
|
|
2212
|
+
layout: r,
|
|
2213
|
+
alwaysMeasureLayout: !!a || o && Ss(o),
|
|
2214
|
+
visualElement: t,
|
|
2215
|
+
/**
|
|
2216
|
+
* TODO: Update options in an effect. This could be tricky as it'll be too late
|
|
2217
|
+
* to update by the time layout animations run.
|
|
2218
|
+
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
|
|
2219
|
+
* ensuring it gets called if there's no potential layout animations.
|
|
2220
|
+
*
|
|
2221
|
+
*/
|
|
2222
|
+
animationType: typeof r == "string" ? r : "both",
|
|
2223
|
+
initialPromotionConfig: s,
|
|
2224
|
+
crossfade: u,
|
|
2225
|
+
layoutScroll: c,
|
|
2226
|
+
layoutRoot: l
|
|
2227
|
+
});
|
|
2228
|
+
}
|
|
2229
|
+
function Cs(t) {
|
|
2230
|
+
if (t)
|
|
2231
|
+
return t.options.allowProjection !== !1 ? t.projection : Cs(t.parent);
|
|
2232
|
+
}
|
|
2233
|
+
function Nt(t, { forwardMotionProps: e = !1 } = {}, n, s) {
|
|
2234
|
+
n && Ys(n);
|
|
2235
|
+
const i = Se(t) ? ga : pa;
|
|
2236
|
+
function r(o, c) {
|
|
2237
|
+
let l;
|
|
2238
|
+
const u = {
|
|
2239
|
+
...R(An),
|
|
2240
|
+
...o,
|
|
2241
|
+
layoutId: xa(o)
|
|
2242
|
+
}, { isStatic: f } = u, d = Qr(o), h = i(o, f);
|
|
2243
|
+
if (!f && Sn) {
|
|
2244
|
+
Aa(u, n);
|
|
2245
|
+
const y = Sa(u);
|
|
2246
|
+
l = y.MeasureLayout, d.visualElement = wa(t, h, u, s, y.ProjectionNode);
|
|
2247
|
+
}
|
|
2248
|
+
return Ie.jsxs(Ct.Provider, { value: d, children: [l && d.visualElement ? Ie.jsx(l, { visualElement: d.visualElement, ...u }) : null, fa(t, o, ba(h, d.visualElement, c), h, f, e)] });
|
|
2249
|
+
}
|
|
2250
|
+
r.displayName = `motion.${typeof t == "string" ? t : `create(${t.displayName ?? t.name ?? ""})`}`;
|
|
2251
|
+
const a = Gs(r);
|
|
2252
|
+
return a[ya] = t, a;
|
|
2253
|
+
}
|
|
2254
|
+
function xa({ layoutId: t }) {
|
|
2255
|
+
const e = R(Xs).id;
|
|
2256
|
+
return e && t !== void 0 ? e + "-" + t : t;
|
|
2257
|
+
}
|
|
2258
|
+
function Aa(t, e) {
|
|
2259
|
+
const n = R(xn).strict;
|
|
2260
|
+
if (process.env.NODE_ENV !== "production" && e && n) {
|
|
2261
|
+
const s = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
2262
|
+
t.ignoreStrict ? tt(!1, s, "lazy-strict-mode") : j(!1, s, "lazy-strict-mode");
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
function Sa(t) {
|
|
2266
|
+
const { drag: e, layout: n } = Kt;
|
|
2267
|
+
if (!e && !n)
|
|
2268
|
+
return {};
|
|
2269
|
+
const s = { ...e, ...n };
|
|
2270
|
+
return {
|
|
2271
|
+
MeasureLayout: e?.isEnabled(t) || n?.isEnabled(t) ? s.MeasureLayout : void 0,
|
|
2272
|
+
ProjectionNode: s.ProjectionNode
|
|
2273
|
+
};
|
|
2274
|
+
}
|
|
2275
|
+
function Ma(t, e) {
|
|
2276
|
+
if (typeof Proxy > "u")
|
|
2277
|
+
return Nt;
|
|
2278
|
+
const n = /* @__PURE__ */ new Map(), s = (r, a) => Nt(r, a, t, e), i = (r, a) => (process.env.NODE_ENV !== "production" && oe(!1, "motion() is deprecated. Use motion.create() instead."), s(r, a));
|
|
2279
|
+
return new Proxy(i, {
|
|
2280
|
+
/**
|
|
2281
|
+
* Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
|
|
2282
|
+
* The prop name is passed through as `key` and we can use that to generate a `motion`
|
|
2283
|
+
* DOM component with that name.
|
|
2284
|
+
*/
|
|
2285
|
+
get: (r, a) => a === "create" ? s : (n.has(a) || n.set(a, Nt(a, void 0, t, e)), n.get(a))
|
|
2286
|
+
});
|
|
2287
|
+
}
|
|
2288
|
+
const Ro = /* @__PURE__ */ Ma();
|
|
2289
|
+
function Ca({ top: t, left: e, right: n, bottom: s }) {
|
|
2290
|
+
return {
|
|
2291
|
+
x: { min: e, max: n },
|
|
2292
|
+
y: { min: t, max: s }
|
|
2293
|
+
};
|
|
2294
|
+
}
|
|
2295
|
+
function ko({ x: t, y: e }) {
|
|
2296
|
+
return { top: e.min, right: t.max, bottom: e.max, left: t.min };
|
|
2297
|
+
}
|
|
2298
|
+
function Pa(t, e) {
|
|
2299
|
+
if (!e)
|
|
2300
|
+
return t;
|
|
2301
|
+
const n = e({ x: t.left, y: t.top }), s = e({ x: t.right, y: t.bottom });
|
|
2302
|
+
return {
|
|
2303
|
+
top: n.y,
|
|
2304
|
+
left: n.x,
|
|
2305
|
+
bottom: s.y,
|
|
2306
|
+
right: s.x
|
|
2307
|
+
};
|
|
2308
|
+
}
|
|
2309
|
+
function Lt(t) {
|
|
2310
|
+
return t === void 0 || t === 1;
|
|
2311
|
+
}
|
|
2312
|
+
function Fa({ scale: t, scaleX: e, scaleY: n }) {
|
|
2313
|
+
return !Lt(t) || !Lt(e) || !Lt(n);
|
|
2314
|
+
}
|
|
2315
|
+
function Da(t) {
|
|
2316
|
+
return Fa(t) || Oa(t) || t.z || t.rotate || t.rotateX || t.rotateY || t.skewX || t.skewY;
|
|
2317
|
+
}
|
|
2318
|
+
function Oa(t) {
|
|
2319
|
+
return rn(t.x) || rn(t.y);
|
|
2320
|
+
}
|
|
2321
|
+
function rn(t) {
|
|
2322
|
+
return t && t !== "0%";
|
|
2323
|
+
}
|
|
2324
|
+
function an(t, e, n) {
|
|
2325
|
+
const s = t - n, i = e * s;
|
|
2326
|
+
return n + i;
|
|
2327
|
+
}
|
|
2328
|
+
function on(t, e, n, s, i) {
|
|
2329
|
+
return i !== void 0 && (t = an(t, i, s)), an(t, n, s) + e;
|
|
2330
|
+
}
|
|
2331
|
+
function ee(t, e = 0, n = 1, s, i) {
|
|
2332
|
+
t.min = on(t.min, e, n, s, i), t.max = on(t.max, e, n, s, i);
|
|
2333
|
+
}
|
|
2334
|
+
function Ea(t, { x: e, y: n }) {
|
|
2335
|
+
ee(t.x, e.translate, e.scale, e.originPoint), ee(t.y, n.translate, n.scale, n.originPoint);
|
|
2336
|
+
}
|
|
2337
|
+
const un = 0.999999999999, cn = 1.0000000000001;
|
|
2338
|
+
function No(t, e, n, s = !1) {
|
|
2339
|
+
const i = n.length;
|
|
2340
|
+
if (!i)
|
|
2341
|
+
return;
|
|
2342
|
+
e.x = e.y = 1;
|
|
2343
|
+
let r, a;
|
|
2344
|
+
for (let o = 0; o < i; o++) {
|
|
2345
|
+
r = n[o], a = r.projectionDelta;
|
|
2346
|
+
const { visualElement: c } = r.options;
|
|
2347
|
+
c && c.props.style && c.props.style.display === "contents" || (s && r.options.layoutScroll && r.scroll && r !== r.root && dn(t, {
|
|
2348
|
+
x: -r.scroll.offset.x,
|
|
2349
|
+
y: -r.scroll.offset.y
|
|
2350
|
+
}), a && (e.x *= a.x.scale, e.y *= a.y.scale, Ea(t, a)), s && Da(r.latestValues) && dn(t, r.latestValues));
|
|
2351
|
+
}
|
|
2352
|
+
e.x < cn && e.x > un && (e.x = 1), e.y < cn && e.y > un && (e.y = 1);
|
|
2353
|
+
}
|
|
2354
|
+
function ln(t, e) {
|
|
2355
|
+
t.min = t.min + e, t.max = t.max + e;
|
|
2356
|
+
}
|
|
2357
|
+
function fn(t, e, n, s, i = 0.5) {
|
|
2358
|
+
const r = mt(t.min, t.max, i);
|
|
2359
|
+
ee(t, e, n, r, s);
|
|
2360
|
+
}
|
|
2361
|
+
function dn(t, e) {
|
|
2362
|
+
fn(t.x, e.x, e.scaleX, e.scale, e.originX), fn(t.y, e.y, e.scaleY, e.scale, e.originY);
|
|
2363
|
+
}
|
|
2364
|
+
function Ps(t, e) {
|
|
2365
|
+
return Ca(Pa(t.getBoundingClientRect(), e));
|
|
2366
|
+
}
|
|
2367
|
+
function Lo(t, e, n) {
|
|
2368
|
+
const s = Ps(t, n), { scroll: i } = e;
|
|
2369
|
+
return i && (ln(s.x, i.offset.x), ln(s.y, i.offset.y)), s;
|
|
2370
|
+
}
|
|
2371
|
+
const hn = () => ({
|
|
2372
|
+
translate: 0,
|
|
2373
|
+
scale: 1,
|
|
2374
|
+
origin: 0,
|
|
2375
|
+
originPoint: 0
|
|
2376
|
+
}), Bo = () => ({
|
|
2377
|
+
x: hn(),
|
|
2378
|
+
y: hn()
|
|
2379
|
+
}), mn = () => ({ min: 0, max: 0 }), Fs = () => ({
|
|
2380
|
+
x: mn(),
|
|
2381
|
+
y: mn()
|
|
2382
|
+
}), ne = { current: null }, Ds = { current: !1 };
|
|
2383
|
+
function Ia() {
|
|
2384
|
+
if (Ds.current = !0, !!Sn)
|
|
2385
|
+
if (window.matchMedia) {
|
|
2386
|
+
const t = window.matchMedia("(prefers-reduced-motion)"), e = () => ne.current = t.matches;
|
|
2387
|
+
t.addEventListener("change", e), e();
|
|
2388
|
+
} else
|
|
2389
|
+
ne.current = !1;
|
|
2390
|
+
}
|
|
2391
|
+
const Ra = /* @__PURE__ */ new WeakMap();
|
|
2392
|
+
function ka(t, e, n) {
|
|
2393
|
+
for (const s in e) {
|
|
2394
|
+
const i = e[s], r = n[s];
|
|
2395
|
+
if (F(i))
|
|
2396
|
+
t.addValue(s, i);
|
|
2397
|
+
else if (F(r))
|
|
2398
|
+
t.addValue(s, xt(i, { owner: t }));
|
|
2399
|
+
else if (r !== i)
|
|
2400
|
+
if (t.hasValue(s)) {
|
|
2401
|
+
const a = t.getValue(s);
|
|
2402
|
+
a.liveStyle === !0 ? a.jump(i) : a.hasAnimated || a.set(i);
|
|
2403
|
+
} else {
|
|
2404
|
+
const a = t.getStaticValue(s);
|
|
2405
|
+
t.addValue(s, xt(a !== void 0 ? a : i, { owner: t }));
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
for (const s in n)
|
|
2409
|
+
e[s] === void 0 && t.removeValue(s);
|
|
2410
|
+
return e;
|
|
2411
|
+
}
|
|
2412
|
+
const pn = [
|
|
2413
|
+
"AnimationStart",
|
|
2414
|
+
"AnimationComplete",
|
|
2415
|
+
"Update",
|
|
2416
|
+
"BeforeLayoutMeasure",
|
|
2417
|
+
"LayoutMeasure",
|
|
2418
|
+
"LayoutAnimationStart",
|
|
2419
|
+
"LayoutAnimationComplete"
|
|
2420
|
+
];
|
|
2421
|
+
class Na {
|
|
2422
|
+
/**
|
|
2423
|
+
* This method takes React props and returns found MotionValues. For example, HTML
|
|
2424
|
+
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
2425
|
+
*
|
|
2426
|
+
* This isn't an abstract method as it needs calling in the constructor, but it is
|
|
2427
|
+
* intended to be one.
|
|
2428
|
+
*/
|
|
2429
|
+
scrapeMotionValuesFromProps(e, n, s) {
|
|
2430
|
+
return {};
|
|
2431
|
+
}
|
|
2432
|
+
constructor({ parent: e, props: n, presenceContext: s, reducedMotionConfig: i, blockInitialAnimation: r, visualState: a }, o = {}) {
|
|
2433
|
+
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = Te, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
2434
|
+
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
2435
|
+
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
2436
|
+
const d = I.now();
|
|
2437
|
+
this.renderScheduledAt < d && (this.renderScheduledAt = d, k.render(this.render, !1, !0));
|
|
2438
|
+
};
|
|
2439
|
+
const { latestValues: c, renderState: l } = a;
|
|
2440
|
+
this.latestValues = c, this.baseTarget = { ...c }, this.initialValues = n.initial ? { ...c } : {}, this.renderState = l, this.parent = e, this.props = n, this.presenceContext = s, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = i, this.options = o, this.blockInitialAnimation = !!r, this.isControllingVariants = Ft(n), this.isVariantNode = ys(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
2441
|
+
const { willChange: u, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
2442
|
+
for (const d in f) {
|
|
2443
|
+
const h = f[d];
|
|
2444
|
+
c[d] !== void 0 && F(h) && h.set(c[d]);
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
mount(e) {
|
|
2448
|
+
this.current = e, Ra.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)), Ds.current || Ia(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : ne.current, process.env.NODE_ENV !== "production" && oe(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), this.parent?.addChild(this), this.update(this.props, this.presenceContext);
|
|
2449
|
+
}
|
|
2450
|
+
unmount() {
|
|
2451
|
+
this.projection && this.projection.unmount(), jt(this.notifyUpdate), jt(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent?.removeChild(this);
|
|
2452
|
+
for (const e in this.events)
|
|
2453
|
+
this.events[e].clear();
|
|
2454
|
+
for (const e in this.features) {
|
|
2455
|
+
const n = this.features[e];
|
|
2456
|
+
n && (n.unmount(), n.isMounted = !1);
|
|
2457
|
+
}
|
|
2458
|
+
this.current = null;
|
|
2459
|
+
}
|
|
2460
|
+
addChild(e) {
|
|
2461
|
+
this.children.add(e), this.enteringChildren ?? (this.enteringChildren = /* @__PURE__ */ new Set()), this.enteringChildren.add(e);
|
|
2462
|
+
}
|
|
2463
|
+
removeChild(e) {
|
|
2464
|
+
this.children.delete(e), this.enteringChildren && this.enteringChildren.delete(e);
|
|
2465
|
+
}
|
|
2466
|
+
bindToMotionValue(e, n) {
|
|
2467
|
+
this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)();
|
|
2468
|
+
const s = rt.has(e);
|
|
2469
|
+
s && this.onBindTransform && this.onBindTransform();
|
|
2470
|
+
const i = n.on("change", (a) => {
|
|
2471
|
+
this.latestValues[e] = a, this.props.onUpdate && k.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
|
|
2472
|
+
});
|
|
2473
|
+
let r;
|
|
2474
|
+
window.MotionCheckAppearSync && (r = window.MotionCheckAppearSync(this, e, n)), this.valueSubscriptions.set(e, () => {
|
|
2475
|
+
i(), r && r(), n.owner && n.stop();
|
|
2476
|
+
});
|
|
2477
|
+
}
|
|
2478
|
+
sortNodePosition(e) {
|
|
2479
|
+
return !this.current || !this.sortInstanceNodePosition || this.type !== e.type ? 0 : this.sortInstanceNodePosition(this.current, e.current);
|
|
2480
|
+
}
|
|
2481
|
+
updateFeatures() {
|
|
2482
|
+
let e = "animation";
|
|
2483
|
+
for (e in Kt) {
|
|
2484
|
+
const n = Kt[e];
|
|
2485
|
+
if (!n)
|
|
2486
|
+
continue;
|
|
2487
|
+
const { isEnabled: s, Feature: i } = n;
|
|
2488
|
+
if (!this.features[e] && i && s(this.props) && (this.features[e] = new i(this)), this.features[e]) {
|
|
2489
|
+
const r = this.features[e];
|
|
2490
|
+
r.isMounted ? r.update() : (r.mount(), r.isMounted = !0);
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
triggerBuild() {
|
|
2495
|
+
this.build(this.renderState, this.latestValues, this.props);
|
|
2496
|
+
}
|
|
2497
|
+
/**
|
|
2498
|
+
* Measure the current viewport box with or without transforms.
|
|
2499
|
+
* Only measures axis-aligned boxes, rotate and skew must be manually
|
|
2500
|
+
* removed with a re-render to work.
|
|
2501
|
+
*/
|
|
2502
|
+
measureViewportBox() {
|
|
2503
|
+
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : Fs();
|
|
2504
|
+
}
|
|
2505
|
+
getStaticValue(e) {
|
|
2506
|
+
return this.latestValues[e];
|
|
2507
|
+
}
|
|
2508
|
+
setStaticValue(e, n) {
|
|
2509
|
+
this.latestValues[e] = n;
|
|
2510
|
+
}
|
|
2511
|
+
/**
|
|
2512
|
+
* Update the provided props. Ensure any newly-added motion values are
|
|
2513
|
+
* added to our map, old ones removed, and listeners updated.
|
|
2514
|
+
*/
|
|
2515
|
+
update(e, n) {
|
|
2516
|
+
(e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
|
|
2517
|
+
for (let s = 0; s < pn.length; s++) {
|
|
2518
|
+
const i = pn[s];
|
|
2519
|
+
this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
|
|
2520
|
+
const r = "on" + i, a = e[r];
|
|
2521
|
+
a && (this.propEventSubscriptions[i] = this.on(i, a));
|
|
2522
|
+
}
|
|
2523
|
+
this.prevMotionValues = ka(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
2524
|
+
}
|
|
2525
|
+
getProps() {
|
|
2526
|
+
return this.props;
|
|
2527
|
+
}
|
|
2528
|
+
/**
|
|
2529
|
+
* Returns the variant definition with a given name.
|
|
2530
|
+
*/
|
|
2531
|
+
getVariant(e) {
|
|
2532
|
+
return this.props.variants ? this.props.variants[e] : void 0;
|
|
2533
|
+
}
|
|
2534
|
+
/**
|
|
2535
|
+
* Returns the defined default transition on this component.
|
|
2536
|
+
*/
|
|
2537
|
+
getDefaultTransition() {
|
|
2538
|
+
return this.props.transition;
|
|
2539
|
+
}
|
|
2540
|
+
getTransformPagePoint() {
|
|
2541
|
+
return this.props.transformPagePoint;
|
|
2542
|
+
}
|
|
2543
|
+
getClosestVariantNode() {
|
|
2544
|
+
return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
|
|
2545
|
+
}
|
|
2546
|
+
/**
|
|
2547
|
+
* Add a child visual element to our set of children.
|
|
2548
|
+
*/
|
|
2549
|
+
addVariantChild(e) {
|
|
2550
|
+
const n = this.getClosestVariantNode();
|
|
2551
|
+
if (n)
|
|
2552
|
+
return n.variantChildren && n.variantChildren.add(e), () => n.variantChildren.delete(e);
|
|
2553
|
+
}
|
|
2554
|
+
/**
|
|
2555
|
+
* Add a motion value and bind it to this visual element.
|
|
2556
|
+
*/
|
|
2557
|
+
addValue(e, n) {
|
|
2558
|
+
const s = this.values.get(e);
|
|
2559
|
+
n !== s && (s && this.removeValue(e), this.bindToMotionValue(e, n), this.values.set(e, n), this.latestValues[e] = n.get());
|
|
2560
|
+
}
|
|
2561
|
+
/**
|
|
2562
|
+
* Remove a motion value and unbind any active subscriptions.
|
|
2563
|
+
*/
|
|
2564
|
+
removeValue(e) {
|
|
2565
|
+
this.values.delete(e);
|
|
2566
|
+
const n = this.valueSubscriptions.get(e);
|
|
2567
|
+
n && (n(), this.valueSubscriptions.delete(e)), delete this.latestValues[e], this.removeValueFromRenderState(e, this.renderState);
|
|
2568
|
+
}
|
|
2569
|
+
/**
|
|
2570
|
+
* Check whether we have a motion value for this key
|
|
2571
|
+
*/
|
|
2572
|
+
hasValue(e) {
|
|
2573
|
+
return this.values.has(e);
|
|
2574
|
+
}
|
|
2575
|
+
getValue(e, n) {
|
|
2576
|
+
if (this.props.values && this.props.values[e])
|
|
2577
|
+
return this.props.values[e];
|
|
2578
|
+
let s = this.values.get(e);
|
|
2579
|
+
return s === void 0 && n !== void 0 && (s = xt(n === null ? void 0 : n, { owner: this }), this.addValue(e, s)), s;
|
|
2580
|
+
}
|
|
2581
|
+
/**
|
|
2582
|
+
* If we're trying to animate to a previously unencountered value,
|
|
2583
|
+
* we need to check for it in our state and as a last resort read it
|
|
2584
|
+
* directly from the instance (which might have performance implications).
|
|
2585
|
+
*/
|
|
2586
|
+
readValue(e, n) {
|
|
2587
|
+
let s = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : this.getBaseTargetFromProps(this.props, e) ?? this.readValueFromInstance(this.current, e, this.options);
|
|
2588
|
+
return s != null && (typeof s == "string" && (Mn(s) || Cn(s)) ? s = parseFloat(s) : !Yr(s) && st.test(n) && (s = ls(e, n)), this.setBaseTarget(e, F(s) ? s.get() : s)), F(s) ? s.get() : s;
|
|
2589
|
+
}
|
|
2590
|
+
/**
|
|
2591
|
+
* Set the base target to later animate back to. This is currently
|
|
2592
|
+
* only hydrated on creation and when we first read a value.
|
|
2593
|
+
*/
|
|
2594
|
+
setBaseTarget(e, n) {
|
|
2595
|
+
this.baseTarget[e] = n;
|
|
2596
|
+
}
|
|
2597
|
+
/**
|
|
2598
|
+
* Find the base target for a value thats been removed from all animation
|
|
2599
|
+
* props.
|
|
2600
|
+
*/
|
|
2601
|
+
getBaseTarget(e) {
|
|
2602
|
+
const { initial: n } = this.props;
|
|
2603
|
+
let s;
|
|
2604
|
+
if (typeof n == "string" || typeof n == "object") {
|
|
2605
|
+
const r = Me(this.props, n, this.presenceContext?.custom);
|
|
2606
|
+
r && (s = r[e]);
|
|
2607
|
+
}
|
|
2608
|
+
if (n && s !== void 0)
|
|
2609
|
+
return s;
|
|
2610
|
+
const i = this.getBaseTargetFromProps(this.props, e);
|
|
2611
|
+
return i !== void 0 && !F(i) ? i : this.initialValues[e] !== void 0 && s === void 0 ? void 0 : this.baseTarget[e];
|
|
2612
|
+
}
|
|
2613
|
+
on(e, n) {
|
|
2614
|
+
return this.events[e] || (this.events[e] = new Fn()), this.events[e].add(n);
|
|
2615
|
+
}
|
|
2616
|
+
notify(e, ...n) {
|
|
2617
|
+
this.events[e] && this.events[e].notify(...n);
|
|
2618
|
+
}
|
|
2619
|
+
scheduleRenderMicrotask() {
|
|
2620
|
+
Wr.render(this.render);
|
|
2621
|
+
}
|
|
2622
|
+
}
|
|
2623
|
+
class Os extends Na {
|
|
2624
|
+
constructor() {
|
|
2625
|
+
super(...arguments), this.KeyframeResolver = Lr;
|
|
2626
|
+
}
|
|
2627
|
+
sortInstanceNodePosition(e, n) {
|
|
2628
|
+
return e.compareDocumentPosition(n) & 2 ? 1 : -1;
|
|
2629
|
+
}
|
|
2630
|
+
getBaseTargetFromProps(e, n) {
|
|
2631
|
+
return e.style ? e.style[n] : void 0;
|
|
2632
|
+
}
|
|
2633
|
+
removeValueFromRenderState(e, { vars: n, style: s }) {
|
|
2634
|
+
delete n[e], delete s[e];
|
|
2635
|
+
}
|
|
2636
|
+
handleChildMotionValue() {
|
|
2637
|
+
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
2638
|
+
const { children: e } = this.props;
|
|
2639
|
+
F(e) && (this.childSubscription = e.on("change", (n) => {
|
|
2640
|
+
this.current && (this.current.textContent = `${n}`);
|
|
2641
|
+
}));
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
function Es(t, { style: e, vars: n }, s, i) {
|
|
2645
|
+
const r = t.style;
|
|
2646
|
+
let a;
|
|
2647
|
+
for (a in e)
|
|
2648
|
+
r[a] = e[a];
|
|
2649
|
+
i?.applyProjectionStyles(r, s);
|
|
2650
|
+
for (a in n)
|
|
2651
|
+
r.setProperty(a, n[a]);
|
|
2652
|
+
}
|
|
2653
|
+
function La(t) {
|
|
2654
|
+
return window.getComputedStyle(t);
|
|
2655
|
+
}
|
|
2656
|
+
class Ba extends Os {
|
|
2657
|
+
constructor() {
|
|
2658
|
+
super(...arguments), this.type = "html", this.renderInstance = Es;
|
|
2659
|
+
}
|
|
2660
|
+
readValueFromInstance(e, n) {
|
|
2661
|
+
if (rt.has(n))
|
|
2662
|
+
return this.projection?.isProjecting ? Ht(n) : er(e, n);
|
|
2663
|
+
{
|
|
2664
|
+
const s = La(e), i = (le(n) ? s.getPropertyValue(n) : s[n]) || 0;
|
|
2665
|
+
return typeof i == "string" ? i.trim() : i;
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
measureInstanceViewportBox(e, { transformPagePoint: n }) {
|
|
2669
|
+
return Ps(e, n);
|
|
2670
|
+
}
|
|
2671
|
+
build(e, n, s) {
|
|
2672
|
+
xe(e, n, s.transformTemplate);
|
|
2673
|
+
}
|
|
2674
|
+
scrapeMotionValuesFromProps(e, n, s) {
|
|
2675
|
+
return Ce(e, n, s);
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
const Is = /* @__PURE__ */ new Set([
|
|
2679
|
+
"baseFrequency",
|
|
2680
|
+
"diffuseConstant",
|
|
2681
|
+
"kernelMatrix",
|
|
2682
|
+
"kernelUnitLength",
|
|
2683
|
+
"keySplines",
|
|
2684
|
+
"keyTimes",
|
|
2685
|
+
"limitingConeAngle",
|
|
2686
|
+
"markerHeight",
|
|
2687
|
+
"markerWidth",
|
|
2688
|
+
"numOctaves",
|
|
2689
|
+
"targetX",
|
|
2690
|
+
"targetY",
|
|
2691
|
+
"surfaceScale",
|
|
2692
|
+
"specularConstant",
|
|
2693
|
+
"specularExponent",
|
|
2694
|
+
"stdDeviation",
|
|
2695
|
+
"tableValues",
|
|
2696
|
+
"viewBox",
|
|
2697
|
+
"gradientTransform",
|
|
2698
|
+
"pathLength",
|
|
2699
|
+
"startOffset",
|
|
2700
|
+
"textLength",
|
|
2701
|
+
"lengthAdjust"
|
|
2702
|
+
]);
|
|
2703
|
+
function Ka(t, e, n, s) {
|
|
2704
|
+
Es(t, e, void 0, s);
|
|
2705
|
+
for (const i in e.attrs)
|
|
2706
|
+
t.setAttribute(Is.has(i) ? i : Pe(i), e.attrs[i]);
|
|
2707
|
+
}
|
|
2708
|
+
class ja extends Os {
|
|
2709
|
+
constructor() {
|
|
2710
|
+
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = Fs;
|
|
2711
|
+
}
|
|
2712
|
+
getBaseTargetFromProps(e, n) {
|
|
2713
|
+
return e[n];
|
|
2714
|
+
}
|
|
2715
|
+
readValueFromInstance(e, n) {
|
|
2716
|
+
if (rt.has(n)) {
|
|
2717
|
+
const s = cs(n);
|
|
2718
|
+
return s && s.default || 0;
|
|
2719
|
+
}
|
|
2720
|
+
return n = Is.has(n) ? n : Pe(n), e.getAttribute(n);
|
|
2721
|
+
}
|
|
2722
|
+
scrapeMotionValuesFromProps(e, n, s) {
|
|
2723
|
+
return As(e, n, s);
|
|
2724
|
+
}
|
|
2725
|
+
build(e, n, s) {
|
|
2726
|
+
vs(e, n, this.isSVGTag, s.transformTemplate, s.style);
|
|
2727
|
+
}
|
|
2728
|
+
renderInstance(e, n, s, i) {
|
|
2729
|
+
Ka(e, n, s, i);
|
|
2730
|
+
}
|
|
2731
|
+
mount(e) {
|
|
2732
|
+
this.isSVGTag = Vs(e.tagName), super.mount(e);
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
const Wa = (t, e) => Se(t) ? new ja(e) : new Ba(e, {
|
|
2736
|
+
allowProjection: t !== wn
|
|
2737
|
+
});
|
|
2738
|
+
function Q(t, e, n) {
|
|
2739
|
+
const s = t.getProps();
|
|
2740
|
+
return Me(s, e, n !== void 0 ? n : s.custom, t);
|
|
2741
|
+
}
|
|
2742
|
+
const se = (t) => Array.isArray(t);
|
|
2743
|
+
function $a(t, e, n) {
|
|
2744
|
+
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, xt(n));
|
|
2745
|
+
}
|
|
2746
|
+
function _a(t) {
|
|
2747
|
+
return se(t) ? t[t.length - 1] || 0 : t;
|
|
2748
|
+
}
|
|
2749
|
+
function Ga(t, e) {
|
|
2750
|
+
const n = Q(t, e);
|
|
2751
|
+
let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
|
|
2752
|
+
r = { ...r, ...s };
|
|
2753
|
+
for (const a in r) {
|
|
2754
|
+
const o = _a(r[a]);
|
|
2755
|
+
$a(t, a, o);
|
|
2756
|
+
}
|
|
2757
|
+
}
|
|
2758
|
+
function Ua(t) {
|
|
2759
|
+
return !!(F(t) && t.add);
|
|
2760
|
+
}
|
|
2761
|
+
function za(t, e) {
|
|
2762
|
+
const n = t.getValue("willChange");
|
|
2763
|
+
if (Ua(n))
|
|
2764
|
+
return n.add(e);
|
|
2765
|
+
if (!n && B.WillChange) {
|
|
2766
|
+
const s = new B.WillChange("auto");
|
|
2767
|
+
t.addValue("willChange", s), s.add(e);
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
function Ha(t) {
|
|
2771
|
+
return t.props[Ms];
|
|
2772
|
+
}
|
|
2773
|
+
const Ya = (t) => t !== null;
|
|
2774
|
+
function Xa(t, { repeat: e, repeatType: n = "loop" }, s) {
|
|
2775
|
+
const i = t.filter(Ya), r = e && n !== "loop" && e % 2 === 1 ? 0 : i.length - 1;
|
|
2776
|
+
return i[r];
|
|
2777
|
+
}
|
|
2778
|
+
const qa = {
|
|
2779
|
+
type: "spring",
|
|
2780
|
+
stiffness: 500,
|
|
2781
|
+
damping: 25,
|
|
2782
|
+
restSpeed: 10
|
|
2783
|
+
}, Za = (t) => ({
|
|
2784
|
+
type: "spring",
|
|
2785
|
+
stiffness: 550,
|
|
2786
|
+
damping: t === 0 ? 2 * Math.sqrt(550) : 30,
|
|
2787
|
+
restSpeed: 10
|
|
2788
|
+
}), Ja = {
|
|
2789
|
+
type: "keyframes",
|
|
2790
|
+
duration: 0.8
|
|
2791
|
+
}, Qa = {
|
|
2792
|
+
type: "keyframes",
|
|
2793
|
+
ease: [0.25, 0.1, 0.35, 1],
|
|
2794
|
+
duration: 0.3
|
|
2795
|
+
}, to = (t, { keyframes: e }) => e.length > 2 ? Ja : rt.has(t) ? t.startsWith("scale") ? Za(e[1]) : qa : Qa;
|
|
2796
|
+
function eo({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: a, repeatDelay: o, from: c, elapsed: l, ...u }) {
|
|
2797
|
+
return !!Object.keys(u).length;
|
|
2798
|
+
}
|
|
2799
|
+
const no = (t, e, n, s = {}, i, r) => (a) => {
|
|
2800
|
+
const o = rs(s, t) || {}, c = o.delay || s.delay || 0;
|
|
2801
|
+
let { elapsed: l = 0 } = s;
|
|
2802
|
+
l = l - /* @__PURE__ */ N(c);
|
|
2803
|
+
const u = {
|
|
2804
|
+
keyframes: Array.isArray(n) ? n : [null, n],
|
|
2805
|
+
ease: "easeOut",
|
|
2806
|
+
velocity: e.getVelocity(),
|
|
2807
|
+
...o,
|
|
2808
|
+
delay: -l,
|
|
2809
|
+
onUpdate: (d) => {
|
|
2810
|
+
e.set(d), o.onUpdate && o.onUpdate(d);
|
|
2811
|
+
},
|
|
2812
|
+
onComplete: () => {
|
|
2813
|
+
a(), o.onComplete && o.onComplete();
|
|
2814
|
+
},
|
|
2815
|
+
name: t,
|
|
2816
|
+
motionValue: e,
|
|
2817
|
+
element: r ? void 0 : i
|
|
2818
|
+
};
|
|
2819
|
+
eo(o) || Object.assign(u, to(t, u)), u.duration && (u.duration = /* @__PURE__ */ N(u.duration)), u.repeatDelay && (u.repeatDelay = /* @__PURE__ */ N(u.repeatDelay)), u.from !== void 0 && (u.keyframes[0] = u.from);
|
|
2820
|
+
let f = !1;
|
|
2821
|
+
if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (Jt(u), u.delay === 0 && (f = !0)), (B.instantAnimations || B.skipAnimations) && (f = !0, Jt(u), u.delay = 0), u.allowFlatten = !o.type && !o.ease, f && !r && e.get() !== void 0) {
|
|
2822
|
+
const d = Xa(u.keyframes, o);
|
|
2823
|
+
if (d !== void 0) {
|
|
2824
|
+
k.update(() => {
|
|
2825
|
+
u.onUpdate(d), u.onComplete();
|
|
2826
|
+
});
|
|
2827
|
+
return;
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
return o.isSync ? new be(u) : new Ar(u);
|
|
2831
|
+
};
|
|
2832
|
+
function so({ protectedKeys: t, needsAnimating: e }, n) {
|
|
2833
|
+
const s = t.hasOwnProperty(n) && e[n] !== !0;
|
|
2834
|
+
return e[n] = !1, s;
|
|
2835
|
+
}
|
|
2836
|
+
function Rs(t, e, { delay: n = 0, transitionOverride: s, type: i } = {}) {
|
|
2837
|
+
let { transition: r = t.getDefaultTransition(), transitionEnd: a, ...o } = e;
|
|
2838
|
+
s && (r = s);
|
|
2839
|
+
const c = [], l = i && t.animationState && t.animationState.getState()[i];
|
|
2840
|
+
for (const u in o) {
|
|
2841
|
+
const f = t.getValue(u, t.latestValues[u] ?? null), d = o[u];
|
|
2842
|
+
if (d === void 0 || l && so(l, u))
|
|
2843
|
+
continue;
|
|
2844
|
+
const h = {
|
|
2845
|
+
delay: n,
|
|
2846
|
+
...rs(r || {}, u)
|
|
2847
|
+
}, y = f.get();
|
|
2848
|
+
if (y !== void 0 && !f.isAnimating && !Array.isArray(d) && d === y && !h.velocity)
|
|
2849
|
+
continue;
|
|
2850
|
+
let v = !1;
|
|
2851
|
+
if (window.MotionHandoffAnimation) {
|
|
2852
|
+
const g = Ha(t);
|
|
2853
|
+
if (g) {
|
|
2854
|
+
const w = window.MotionHandoffAnimation(g, u, k);
|
|
2855
|
+
w !== null && (h.startTime = w, v = !0);
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
za(t, u), f.start(no(u, f, d, t.shouldReduceMotion && as.has(u) ? { type: !1 } : h, t, v));
|
|
2859
|
+
const V = f.animation;
|
|
2860
|
+
V && c.push(V);
|
|
2861
|
+
}
|
|
2862
|
+
return a && Promise.all(c).then(() => {
|
|
2863
|
+
k.update(() => {
|
|
2864
|
+
a && Ga(t, a);
|
|
2865
|
+
});
|
|
2866
|
+
}), c;
|
|
2867
|
+
}
|
|
2868
|
+
function ks(t, e, n, s = 0, i = 1) {
|
|
2869
|
+
const r = Array.from(t).sort((l, u) => l.sortNodePosition(u)).indexOf(e), a = t.size, o = (a - 1) * s;
|
|
2870
|
+
return typeof n == "function" ? n(r, a) : i === 1 ? r * s : o - r * s;
|
|
2871
|
+
}
|
|
2872
|
+
function ie(t, e, n = {}) {
|
|
2873
|
+
const s = Q(t, e, n.type === "exit" ? t.presenceContext?.custom : void 0);
|
|
2874
|
+
let { transition: i = t.getDefaultTransition() || {} } = s || {};
|
|
2875
|
+
n.transitionOverride && (i = n.transitionOverride);
|
|
2876
|
+
const r = s ? () => Promise.all(Rs(t, s, n)) : () => Promise.resolve(), a = t.variantChildren && t.variantChildren.size ? (c = 0) => {
|
|
2877
|
+
const { delayChildren: l = 0, staggerChildren: u, staggerDirection: f } = i;
|
|
2878
|
+
return io(t, e, c, l, u, f, n);
|
|
2879
|
+
} : () => Promise.resolve(), { when: o } = i;
|
|
2880
|
+
if (o) {
|
|
2881
|
+
const [c, l] = o === "beforeChildren" ? [r, a] : [a, r];
|
|
2882
|
+
return c().then(() => l());
|
|
2883
|
+
} else
|
|
2884
|
+
return Promise.all([r(), a(n.delay)]);
|
|
2885
|
+
}
|
|
2886
|
+
function io(t, e, n = 0, s = 0, i = 0, r = 1, a) {
|
|
2887
|
+
const o = [];
|
|
2888
|
+
for (const c of t.variantChildren)
|
|
2889
|
+
c.notify("AnimationStart", e), o.push(ie(c, e, {
|
|
2890
|
+
...a,
|
|
2891
|
+
delay: n + (typeof s == "function" ? 0 : s) + ks(t.variantChildren, c, s, i, r)
|
|
2892
|
+
}).then(() => c.notify("AnimationComplete", e)));
|
|
2893
|
+
return Promise.all(o);
|
|
2894
|
+
}
|
|
2895
|
+
function ro(t, e, n = {}) {
|
|
2896
|
+
t.notify("AnimationStart", e);
|
|
2897
|
+
let s;
|
|
2898
|
+
if (Array.isArray(e)) {
|
|
2899
|
+
const i = e.map((r) => ie(t, r, n));
|
|
2900
|
+
s = Promise.all(i);
|
|
2901
|
+
} else if (typeof e == "string")
|
|
2902
|
+
s = ie(t, e, n);
|
|
2903
|
+
else {
|
|
2904
|
+
const i = typeof e == "function" ? Q(t, e, n.custom) : e;
|
|
2905
|
+
s = Promise.all(Rs(t, i, n));
|
|
2906
|
+
}
|
|
2907
|
+
return s.then(() => {
|
|
2908
|
+
t.notify("AnimationComplete", e);
|
|
2909
|
+
});
|
|
2910
|
+
}
|
|
2911
|
+
function Ns(t, e) {
|
|
2912
|
+
if (!Array.isArray(e))
|
|
2913
|
+
return !1;
|
|
2914
|
+
const n = e.length;
|
|
2915
|
+
if (n !== t.length)
|
|
2916
|
+
return !1;
|
|
2917
|
+
for (let s = 0; s < n; s++)
|
|
2918
|
+
if (e[s] !== t[s])
|
|
2919
|
+
return !1;
|
|
2920
|
+
return !0;
|
|
2921
|
+
}
|
|
2922
|
+
const ao = Ve.length;
|
|
2923
|
+
function Ls(t) {
|
|
2924
|
+
if (!t)
|
|
2925
|
+
return;
|
|
2926
|
+
if (!t.isControllingVariants) {
|
|
2927
|
+
const n = t.parent ? Ls(t.parent) || {} : {};
|
|
2928
|
+
return t.props.initial !== void 0 && (n.initial = t.props.initial), n;
|
|
2929
|
+
}
|
|
2930
|
+
const e = {};
|
|
2931
|
+
for (let n = 0; n < ao; n++) {
|
|
2932
|
+
const s = Ve[n], i = t.props[s];
|
|
2933
|
+
(ft(i) || i === !1) && (e[s] = i);
|
|
2934
|
+
}
|
|
2935
|
+
return e;
|
|
2936
|
+
}
|
|
2937
|
+
const oo = [...we].reverse(), uo = we.length;
|
|
2938
|
+
function co(t) {
|
|
2939
|
+
return (e) => Promise.all(e.map(({ animation: n, options: s }) => ro(t, n, s)));
|
|
2940
|
+
}
|
|
2941
|
+
function lo(t) {
|
|
2942
|
+
let e = co(t), n = gn(), s = !0;
|
|
2943
|
+
const i = (c) => (l, u) => {
|
|
2944
|
+
const f = Q(t, u, c === "exit" ? t.presenceContext?.custom : void 0);
|
|
2945
|
+
if (f) {
|
|
2946
|
+
const { transition: d, transitionEnd: h, ...y } = f;
|
|
2947
|
+
l = { ...l, ...y, ...h };
|
|
2948
|
+
}
|
|
2949
|
+
return l;
|
|
2950
|
+
};
|
|
2951
|
+
function r(c) {
|
|
2952
|
+
e = c(t);
|
|
2953
|
+
}
|
|
2954
|
+
function a(c) {
|
|
2955
|
+
const { props: l } = t, u = Ls(t.parent) || {}, f = [], d = /* @__PURE__ */ new Set();
|
|
2956
|
+
let h = {}, y = 1 / 0;
|
|
2957
|
+
for (let V = 0; V < uo; V++) {
|
|
2958
|
+
const g = oo[V], w = n[g], p = l[g] !== void 0 ? l[g] : u[g], A = ft(p), b = g === c ? w.isActive : null;
|
|
2959
|
+
b === !1 && (y = V);
|
|
2960
|
+
let x = p === u[g] && p !== l[g] && A;
|
|
2961
|
+
if (x && s && t.manuallyAnimateOnMount && (x = !1), w.protectedKeys = { ...h }, // If it isn't active and hasn't *just* been set as inactive
|
|
2962
|
+
!w.isActive && b === null || // If we didn't and don't have any defined prop for this animation type
|
|
2963
|
+
!p && !w.prevProp || // Or if the prop doesn't define an animation
|
|
2964
|
+
Pt(p) || typeof p == "boolean")
|
|
2965
|
+
continue;
|
|
2966
|
+
const C = fo(w.prevProp, p);
|
|
2967
|
+
let T = C || // If we're making this variant active, we want to always make it active
|
|
2968
|
+
g === c && w.isActive && !x && A || // If we removed a higher-priority variant (i is in reverse order)
|
|
2969
|
+
V > y && A, D = !1;
|
|
2970
|
+
const O = Array.isArray(p) ? p : [p];
|
|
2971
|
+
let Y = O.reduce(i(g), {});
|
|
2972
|
+
b === !1 && (Y = {});
|
|
2973
|
+
const { prevResolvedValues: De = {} } = w, Bs = {
|
|
2974
|
+
...De,
|
|
2975
|
+
...Y
|
|
2976
|
+
}, Oe = (P) => {
|
|
2977
|
+
T = !0, d.has(P) && (D = !0, d.delete(P)), w.needsAnimating[P] = !0;
|
|
2978
|
+
const E = t.getValue(P);
|
|
2979
|
+
E && (E.liveStyle = !1);
|
|
2980
|
+
};
|
|
2981
|
+
for (const P in Bs) {
|
|
2982
|
+
const E = Y[P], W = De[P];
|
|
2983
|
+
if (h.hasOwnProperty(P))
|
|
2984
|
+
continue;
|
|
2985
|
+
let X = !1;
|
|
2986
|
+
se(E) && se(W) ? X = !Ns(E, W) : X = E !== W, X ? E != null ? Oe(P) : d.add(P) : E !== void 0 && d.has(P) ? Oe(P) : w.protectedKeys[P] = !0;
|
|
2987
|
+
}
|
|
2988
|
+
w.prevProp = p, w.prevResolvedValues = Y, w.isActive && (h = { ...h, ...Y }), s && t.blockInitialAnimation && (T = !1);
|
|
2989
|
+
const Ee = x && C;
|
|
2990
|
+
T && (!Ee || D) && f.push(...O.map((P) => {
|
|
2991
|
+
const E = { type: g };
|
|
2992
|
+
if (typeof P == "string" && s && !Ee && t.manuallyAnimateOnMount && t.parent) {
|
|
2993
|
+
const { parent: W } = t, X = Q(W, P);
|
|
2994
|
+
if (W.enteringChildren && X) {
|
|
2995
|
+
const { delayChildren: Ks } = X.transition || {};
|
|
2996
|
+
E.delay = ks(W.enteringChildren, t, Ks);
|
|
2997
|
+
}
|
|
2998
|
+
}
|
|
2999
|
+
return {
|
|
3000
|
+
animation: P,
|
|
3001
|
+
options: E
|
|
3002
|
+
};
|
|
3003
|
+
}));
|
|
3004
|
+
}
|
|
3005
|
+
if (d.size) {
|
|
3006
|
+
const V = {};
|
|
3007
|
+
if (typeof l.initial != "boolean") {
|
|
3008
|
+
const g = Q(t, Array.isArray(l.initial) ? l.initial[0] : l.initial);
|
|
3009
|
+
g && g.transition && (V.transition = g.transition);
|
|
3010
|
+
}
|
|
3011
|
+
d.forEach((g) => {
|
|
3012
|
+
const w = t.getBaseTarget(g), p = t.getValue(g);
|
|
3013
|
+
p && (p.liveStyle = !0), V[g] = w ?? null;
|
|
3014
|
+
}), f.push({ animation: V });
|
|
3015
|
+
}
|
|
3016
|
+
let v = !!f.length;
|
|
3017
|
+
return s && (l.initial === !1 || l.initial === l.animate) && !t.manuallyAnimateOnMount && (v = !1), s = !1, v ? e(f) : Promise.resolve();
|
|
3018
|
+
}
|
|
3019
|
+
function o(c, l) {
|
|
3020
|
+
if (n[c].isActive === l)
|
|
3021
|
+
return Promise.resolve();
|
|
3022
|
+
t.variantChildren?.forEach((f) => f.animationState?.setActive(c, l)), n[c].isActive = l;
|
|
3023
|
+
const u = a(c);
|
|
3024
|
+
for (const f in n)
|
|
3025
|
+
n[f].protectedKeys = {};
|
|
3026
|
+
return u;
|
|
3027
|
+
}
|
|
3028
|
+
return {
|
|
3029
|
+
animateChanges: a,
|
|
3030
|
+
setActive: o,
|
|
3031
|
+
setAnimateFunction: r,
|
|
3032
|
+
getState: () => n,
|
|
3033
|
+
reset: () => {
|
|
3034
|
+
n = gn(), s = !0;
|
|
3035
|
+
}
|
|
3036
|
+
};
|
|
3037
|
+
}
|
|
3038
|
+
function fo(t, e) {
|
|
3039
|
+
return typeof e == "string" ? e !== t : Array.isArray(e) ? !Ns(e, t) : !1;
|
|
3040
|
+
}
|
|
3041
|
+
function $(t = !1) {
|
|
3042
|
+
return {
|
|
3043
|
+
isActive: t,
|
|
3044
|
+
protectedKeys: {},
|
|
3045
|
+
needsAnimating: {},
|
|
3046
|
+
prevResolvedValues: {}
|
|
3047
|
+
};
|
|
3048
|
+
}
|
|
3049
|
+
function gn() {
|
|
3050
|
+
return {
|
|
3051
|
+
animate: $(!0),
|
|
3052
|
+
whileInView: $(),
|
|
3053
|
+
whileHover: $(),
|
|
3054
|
+
whileTap: $(),
|
|
3055
|
+
whileDrag: $(),
|
|
3056
|
+
whileFocus: $(),
|
|
3057
|
+
exit: $()
|
|
3058
|
+
};
|
|
3059
|
+
}
|
|
3060
|
+
class at {
|
|
3061
|
+
constructor(e) {
|
|
3062
|
+
this.isMounted = !1, this.node = e;
|
|
3063
|
+
}
|
|
3064
|
+
update() {
|
|
3065
|
+
}
|
|
3066
|
+
}
|
|
3067
|
+
class ho extends at {
|
|
3068
|
+
/**
|
|
3069
|
+
* We dynamically generate the AnimationState manager as it contains a reference
|
|
3070
|
+
* to the underlying animation library. We only want to load that if we load this,
|
|
3071
|
+
* so people can optionally code split it out using the `m` component.
|
|
3072
|
+
*/
|
|
3073
|
+
constructor(e) {
|
|
3074
|
+
super(e), e.animationState || (e.animationState = lo(e));
|
|
3075
|
+
}
|
|
3076
|
+
updateAnimationControlsSubscription() {
|
|
3077
|
+
const { animate: e } = this.node.getProps();
|
|
3078
|
+
Pt(e) && (this.unmountControls = e.subscribe(this.node));
|
|
3079
|
+
}
|
|
3080
|
+
/**
|
|
3081
|
+
* Subscribe any provided AnimationControls to the component's VisualElement
|
|
3082
|
+
*/
|
|
3083
|
+
mount() {
|
|
3084
|
+
this.updateAnimationControlsSubscription();
|
|
3085
|
+
}
|
|
3086
|
+
update() {
|
|
3087
|
+
const { animate: e } = this.node.getProps(), { animate: n } = this.node.prevProps || {};
|
|
3088
|
+
e !== n && this.updateAnimationControlsSubscription();
|
|
3089
|
+
}
|
|
3090
|
+
unmount() {
|
|
3091
|
+
this.node.animationState.reset(), this.unmountControls?.();
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
let mo = 0;
|
|
3095
|
+
class po extends at {
|
|
3096
|
+
constructor() {
|
|
3097
|
+
super(...arguments), this.id = mo++;
|
|
3098
|
+
}
|
|
3099
|
+
update() {
|
|
3100
|
+
if (!this.node.presenceContext)
|
|
3101
|
+
return;
|
|
3102
|
+
const { isPresent: e, onExitComplete: n } = this.node.presenceContext, { isPresent: s } = this.node.prevPresenceContext || {};
|
|
3103
|
+
if (!this.node.animationState || e === s)
|
|
3104
|
+
return;
|
|
3105
|
+
const i = this.node.animationState.setActive("exit", !e);
|
|
3106
|
+
n && !e && i.then(() => {
|
|
3107
|
+
n(this.id);
|
|
3108
|
+
});
|
|
3109
|
+
}
|
|
3110
|
+
mount() {
|
|
3111
|
+
const { register: e, onExitComplete: n } = this.node.presenceContext || {};
|
|
3112
|
+
n && n(this.id), e && (this.unmount = e(this.id));
|
|
3113
|
+
}
|
|
3114
|
+
unmount() {
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
const go = {
|
|
3118
|
+
animation: {
|
|
3119
|
+
Feature: ho
|
|
3120
|
+
},
|
|
3121
|
+
exit: {
|
|
3122
|
+
Feature: po
|
|
3123
|
+
}
|
|
3124
|
+
};
|
|
3125
|
+
function yn(t, e, n, s = { passive: !0 }) {
|
|
3126
|
+
return t.addEventListener(e, n, s), () => t.removeEventListener(e, n);
|
|
3127
|
+
}
|
|
3128
|
+
function Fe(t) {
|
|
3129
|
+
return {
|
|
3130
|
+
point: {
|
|
3131
|
+
x: t.pageX,
|
|
3132
|
+
y: t.pageY
|
|
3133
|
+
}
|
|
3134
|
+
};
|
|
3135
|
+
}
|
|
3136
|
+
const Ko = (t) => (e) => ps(e) && t(e, Fe(e));
|
|
3137
|
+
function bn(t, e, n) {
|
|
3138
|
+
const { props: s } = t;
|
|
3139
|
+
t.animationState && s.whileHover && t.animationState.setActive("whileHover", n === "Start");
|
|
3140
|
+
const i = "onHover" + n, r = s[i];
|
|
3141
|
+
r && k.postRender(() => r(e, Fe(e)));
|
|
3142
|
+
}
|
|
3143
|
+
class yo extends at {
|
|
3144
|
+
mount() {
|
|
3145
|
+
const { current: e } = this.node;
|
|
3146
|
+
e && (this.unmount = $r(e, (n, s) => (bn(this.node, s, "Start"), (i) => bn(this.node, i, "End"))));
|
|
3147
|
+
}
|
|
3148
|
+
unmount() {
|
|
3149
|
+
}
|
|
3150
|
+
}
|
|
3151
|
+
class bo extends at {
|
|
3152
|
+
constructor() {
|
|
3153
|
+
super(...arguments), this.isActive = !1;
|
|
3154
|
+
}
|
|
3155
|
+
onFocus() {
|
|
3156
|
+
let e = !1;
|
|
3157
|
+
try {
|
|
3158
|
+
e = this.node.current.matches(":focus-visible");
|
|
3159
|
+
} catch {
|
|
3160
|
+
e = !0;
|
|
3161
|
+
}
|
|
3162
|
+
!e || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
|
|
3163
|
+
}
|
|
3164
|
+
onBlur() {
|
|
3165
|
+
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
3166
|
+
}
|
|
3167
|
+
mount() {
|
|
3168
|
+
this.unmount = Mt(yn(this.node.current, "focus", () => this.onFocus()), yn(this.node.current, "blur", () => this.onBlur()));
|
|
3169
|
+
}
|
|
3170
|
+
unmount() {
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3173
|
+
function Tn(t, e, n) {
|
|
3174
|
+
const { props: s } = t;
|
|
3175
|
+
if (t.current instanceof HTMLButtonElement && t.current.disabled)
|
|
3176
|
+
return;
|
|
3177
|
+
t.animationState && s.whileTap && t.animationState.setActive("whileTap", n === "Start");
|
|
3178
|
+
const i = "onTap" + (n === "End" ? "" : n), r = s[i];
|
|
3179
|
+
r && k.postRender(() => r(e, Fe(e)));
|
|
3180
|
+
}
|
|
3181
|
+
class To extends at {
|
|
3182
|
+
mount() {
|
|
3183
|
+
const { current: e } = this.node;
|
|
3184
|
+
e && (this.unmount = zr(e, (n, s) => (Tn(this.node, s, "Start"), (i, { success: r }) => Tn(this.node, i, r ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
|
|
3185
|
+
}
|
|
3186
|
+
unmount() {
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
3189
|
+
const re = /* @__PURE__ */ new WeakMap(), Bt = /* @__PURE__ */ new WeakMap(), vo = (t) => {
|
|
3190
|
+
const e = re.get(t.target);
|
|
3191
|
+
e && e(t);
|
|
3192
|
+
}, wo = (t) => {
|
|
3193
|
+
t.forEach(vo);
|
|
3194
|
+
};
|
|
3195
|
+
function Vo({ root: t, ...e }) {
|
|
3196
|
+
const n = t || document;
|
|
3197
|
+
Bt.has(n) || Bt.set(n, {});
|
|
3198
|
+
const s = Bt.get(n), i = JSON.stringify(e);
|
|
3199
|
+
return s[i] || (s[i] = new IntersectionObserver(wo, { root: t, ...e })), s[i];
|
|
3200
|
+
}
|
|
3201
|
+
function xo(t, e, n) {
|
|
3202
|
+
const s = Vo(e);
|
|
3203
|
+
return re.set(t, n), s.observe(t), () => {
|
|
3204
|
+
re.delete(t), s.unobserve(t);
|
|
3205
|
+
};
|
|
3206
|
+
}
|
|
3207
|
+
const Ao = {
|
|
3208
|
+
some: 0,
|
|
3209
|
+
all: 1
|
|
3210
|
+
};
|
|
3211
|
+
class So extends at {
|
|
3212
|
+
constructor() {
|
|
3213
|
+
super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
|
|
3214
|
+
}
|
|
3215
|
+
startObserver() {
|
|
3216
|
+
this.unmount();
|
|
3217
|
+
const { viewport: e = {} } = this.node.getProps(), { root: n, margin: s, amount: i = "some", once: r } = e, a = {
|
|
3218
|
+
root: n ? n.current : void 0,
|
|
3219
|
+
rootMargin: s,
|
|
3220
|
+
threshold: typeof i == "number" ? i : Ao[i]
|
|
3221
|
+
}, o = (c) => {
|
|
3222
|
+
const { isIntersecting: l } = c;
|
|
3223
|
+
if (this.isInView === l || (this.isInView = l, r && !l && this.hasEnteredView))
|
|
3224
|
+
return;
|
|
3225
|
+
l && (this.hasEnteredView = !0), this.node.animationState && this.node.animationState.setActive("whileInView", l);
|
|
3226
|
+
const { onViewportEnter: u, onViewportLeave: f } = this.node.getProps(), d = l ? u : f;
|
|
3227
|
+
d && d(c);
|
|
3228
|
+
};
|
|
3229
|
+
return xo(this.node.current, a, o);
|
|
3230
|
+
}
|
|
3231
|
+
mount() {
|
|
3232
|
+
this.startObserver();
|
|
3233
|
+
}
|
|
3234
|
+
update() {
|
|
3235
|
+
if (typeof IntersectionObserver > "u")
|
|
3236
|
+
return;
|
|
3237
|
+
const { props: e, prevProps: n } = this.node;
|
|
3238
|
+
["amount", "margin", "root"].some(Mo(e, n)) && this.startObserver();
|
|
3239
|
+
}
|
|
3240
|
+
unmount() {
|
|
3241
|
+
}
|
|
3242
|
+
}
|
|
3243
|
+
function Mo({ viewport: t = {} }, { viewport: e = {} } = {}) {
|
|
3244
|
+
return (n) => t[n] !== e[n];
|
|
3245
|
+
}
|
|
3246
|
+
const Co = {
|
|
3247
|
+
inView: {
|
|
3248
|
+
Feature: So
|
|
3249
|
+
},
|
|
3250
|
+
tap: {
|
|
3251
|
+
Feature: To
|
|
3252
|
+
},
|
|
3253
|
+
focus: {
|
|
3254
|
+
Feature: bo
|
|
3255
|
+
},
|
|
3256
|
+
hover: {
|
|
3257
|
+
Feature: yo
|
|
3258
|
+
}
|
|
3259
|
+
}, jo = {
|
|
3260
|
+
renderer: Wa,
|
|
3261
|
+
...go,
|
|
3262
|
+
...Co
|
|
3263
|
+
};
|
|
3264
|
+
export {
|
|
3265
|
+
yr as $,
|
|
3266
|
+
Fn as A,
|
|
3267
|
+
L as B,
|
|
3268
|
+
N as C,
|
|
3269
|
+
Dn as D,
|
|
3270
|
+
oe as E,
|
|
3271
|
+
Nn as F,
|
|
3272
|
+
ue as G,
|
|
3273
|
+
kn as H,
|
|
3274
|
+
Rn as I,
|
|
3275
|
+
ce as J,
|
|
3276
|
+
Ln as K,
|
|
3277
|
+
si as L,
|
|
3278
|
+
B as M,
|
|
3279
|
+
dt as N,
|
|
3280
|
+
ii as O,
|
|
3281
|
+
Bn as P,
|
|
3282
|
+
ri as Q,
|
|
3283
|
+
En as R,
|
|
3284
|
+
va as S,
|
|
3285
|
+
In as T,
|
|
3286
|
+
Kn as U,
|
|
3287
|
+
Na as V,
|
|
3288
|
+
ai as W,
|
|
3289
|
+
Ne as X,
|
|
3290
|
+
Ar as Y,
|
|
3291
|
+
be as Z,
|
|
3292
|
+
mr as _,
|
|
3293
|
+
Ko as a,
|
|
3294
|
+
Wt as a$,
|
|
3295
|
+
is as a0,
|
|
3296
|
+
Mr as a1,
|
|
3297
|
+
rs as a2,
|
|
3298
|
+
le as a3,
|
|
3299
|
+
fe as a4,
|
|
3300
|
+
Jt as a5,
|
|
3301
|
+
Gt as a6,
|
|
3302
|
+
Yi as a7,
|
|
3303
|
+
Z as a8,
|
|
3304
|
+
Vt as a9,
|
|
3305
|
+
ps as aA,
|
|
3306
|
+
Ht as aB,
|
|
3307
|
+
Yt as aC,
|
|
3308
|
+
er as aD,
|
|
3309
|
+
ur as aE,
|
|
3310
|
+
as as aF,
|
|
3311
|
+
it as aG,
|
|
3312
|
+
rt as aH,
|
|
3313
|
+
Gi as aI,
|
|
3314
|
+
Yn as aJ,
|
|
3315
|
+
je as aK,
|
|
3316
|
+
It as aL,
|
|
3317
|
+
me as aM,
|
|
3318
|
+
Hn as aN,
|
|
3319
|
+
Ii as aO,
|
|
3320
|
+
Oi as aP,
|
|
3321
|
+
vt as aQ,
|
|
3322
|
+
mt as aR,
|
|
3323
|
+
$t as aS,
|
|
3324
|
+
Fi as aT,
|
|
3325
|
+
Br as aU,
|
|
3326
|
+
lr as aV,
|
|
3327
|
+
ts as aW,
|
|
3328
|
+
cr as aX,
|
|
3329
|
+
jr as aY,
|
|
3330
|
+
xt as aZ,
|
|
3331
|
+
M as a_,
|
|
3332
|
+
pe as aa,
|
|
3333
|
+
wt as ab,
|
|
3334
|
+
ki as ac,
|
|
3335
|
+
ns as ad,
|
|
3336
|
+
Lr as ae,
|
|
3337
|
+
Te as af,
|
|
3338
|
+
ar as ag,
|
|
3339
|
+
zi as ah,
|
|
3340
|
+
Ui as ai,
|
|
3341
|
+
Hi as aj,
|
|
3342
|
+
Ji as ak,
|
|
3343
|
+
ot as al,
|
|
3344
|
+
es as am,
|
|
3345
|
+
ze as an,
|
|
3346
|
+
dr as ao,
|
|
3347
|
+
Vr as ap,
|
|
3348
|
+
hr as aq,
|
|
3349
|
+
Xn as ar,
|
|
3350
|
+
jn as as,
|
|
3351
|
+
Wr as at,
|
|
3352
|
+
I as au,
|
|
3353
|
+
ds as av,
|
|
3354
|
+
Je as aw,
|
|
3355
|
+
$r as ax,
|
|
3356
|
+
zr as ay,
|
|
3357
|
+
ms as az,
|
|
3358
|
+
go as b,
|
|
3359
|
+
q as b0,
|
|
3360
|
+
Mi as b1,
|
|
3361
|
+
Ot as b2,
|
|
3362
|
+
_ as b3,
|
|
3363
|
+
lt as b4,
|
|
3364
|
+
st as b5,
|
|
3365
|
+
us as b6,
|
|
3366
|
+
Xe as b7,
|
|
3367
|
+
Rr as b8,
|
|
3368
|
+
cs as b9,
|
|
3369
|
+
za as bA,
|
|
3370
|
+
no as bB,
|
|
3371
|
+
at as bC,
|
|
3372
|
+
an as bD,
|
|
3373
|
+
Da as bE,
|
|
3374
|
+
ln as bF,
|
|
3375
|
+
dn as bG,
|
|
3376
|
+
Fa as bH,
|
|
3377
|
+
Ea as bI,
|
|
3378
|
+
Oa as bJ,
|
|
3379
|
+
No as bK,
|
|
3380
|
+
Bo as bL,
|
|
3381
|
+
te as bM,
|
|
3382
|
+
Ha as bN,
|
|
3383
|
+
Co as bO,
|
|
3384
|
+
Ma as bP,
|
|
3385
|
+
Wa as bQ,
|
|
3386
|
+
ve as ba,
|
|
3387
|
+
Ir as bb,
|
|
3388
|
+
ct as bc,
|
|
3389
|
+
nt as bd,
|
|
3390
|
+
gt as be,
|
|
3391
|
+
K as bf,
|
|
3392
|
+
J as bg,
|
|
3393
|
+
Le as bh,
|
|
3394
|
+
m as bi,
|
|
3395
|
+
yi as bj,
|
|
3396
|
+
bi as bk,
|
|
3397
|
+
os as bl,
|
|
3398
|
+
ls as bm,
|
|
3399
|
+
Yr as bn,
|
|
3400
|
+
fs as bo,
|
|
3401
|
+
F as bp,
|
|
3402
|
+
jt as bq,
|
|
3403
|
+
k as br,
|
|
3404
|
+
Tt as bs,
|
|
3405
|
+
Eo as bt,
|
|
3406
|
+
yn as bu,
|
|
3407
|
+
Fe as bv,
|
|
3408
|
+
Ss as bw,
|
|
3409
|
+
Lo as bx,
|
|
3410
|
+
ko as by,
|
|
3411
|
+
Ca as bz,
|
|
3412
|
+
xs as c,
|
|
3413
|
+
Fs as d,
|
|
3414
|
+
jo as e,
|
|
3415
|
+
Zr as f,
|
|
3416
|
+
ro as g,
|
|
3417
|
+
Io as h,
|
|
3418
|
+
At as i,
|
|
3419
|
+
na as j,
|
|
3420
|
+
Ct as k,
|
|
3421
|
+
qs as l,
|
|
3422
|
+
Ro as m,
|
|
3423
|
+
Zs as n,
|
|
3424
|
+
Ms as o,
|
|
3425
|
+
H as p,
|
|
3426
|
+
j as q,
|
|
3427
|
+
da as r,
|
|
3428
|
+
Mn as s,
|
|
3429
|
+
Cn as t,
|
|
3430
|
+
ae as u,
|
|
3431
|
+
Ra as v,
|
|
3432
|
+
tt as w,
|
|
3433
|
+
et as x,
|
|
3434
|
+
Mt as y,
|
|
3435
|
+
Pn as z
|
|
3436
|
+
};
|
|
3437
|
+
//# sourceMappingURL=features-animation-BRAvwYFN.js.map
|