@helsenorge/designsystem-react 8.6.0 → 9.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Button.js +7 -7
- package/Button.js.map +1 -1
- package/CHANGELOG.md +27 -3
- package/Checkbox.js +42 -42
- package/Checkbox.js.map +1 -1
- package/ErrorWrapper.js.map +1 -1
- package/FormGroup.js +47 -40
- package/FormGroup.js.map +1 -1
- package/Icon.js +21 -21
- package/Icon.js.map +1 -1
- package/Input.js +98 -88
- package/Input.js.map +1 -1
- package/Label.js +28 -28
- package/Label.js.map +1 -1
- package/MaxCharacters.js +2 -2
- package/MaxCharacters.js.map +1 -1
- package/RadioButton.js +61 -61
- package/RadioButton.js.map +1 -1
- package/Select.js +34 -33
- package/Select.js.map +1 -1
- package/Slider.js +218 -0
- package/Slider.js.map +1 -0
- package/StatusDot.js +15 -15
- package/StatusDot.js.map +1 -1
- package/TabList.js +88 -53
- package/TabList.js.map +1 -1
- package/TabPanel.js +7 -7
- package/TabPanel.js.map +1 -1
- package/Textarea.js +59 -58
- package/Textarea.js.map +1 -1
- package/Trigger.js +33 -33
- package/Trigger.js.map +1 -1
- package/components/Button/Button.d.ts +2 -2
- package/components/Checkbox/Checkbox.d.ts +4 -3
- package/components/Checkbox/styles.module.scss +0 -14
- package/components/Checkbox/styles.module.scss.d.ts +0 -1
- package/components/Dropdown/Dropdown.d.ts +2 -2
- package/components/Dropdown/index.js +25 -25
- package/components/Dropdown/index.js.map +1 -1
- package/components/ErrorWrapper/ErrorWrapper.d.ts +3 -0
- package/components/ExpanderList/ExpanderList.d.ts +4 -6
- package/components/ExpanderList/index.js +118 -126
- package/components/ExpanderList/index.js.map +1 -1
- package/components/ExpanderList/styles.module.scss +165 -49
- package/components/ExpanderList/styles.module.scss.d.ts +29 -5
- package/components/FormGroup/FormGroup.d.ts +2 -2
- package/components/Icon/Icon.d.ts +4 -4
- package/components/Icons/NoAccess.js +7 -7
- package/components/Icons/NoAccess.js.map +1 -1
- package/components/Input/Input.d.ts +4 -3
- package/components/Label/Label.d.ts +4 -4
- package/components/Label/SubLabel.d.ts +2 -2
- package/components/MaxCharacters/MaxCharacters.d.ts +2 -2
- package/components/RadioButton/RadioButton.d.ts +5 -4
- package/components/RadioButton/styles.module.scss +0 -15
- package/components/RadioButton/styles.module.scss.d.ts +0 -1
- package/components/Select/Select.d.ts +4 -3
- package/components/SharingStatus/SharingStatus.d.ts +1 -1
- package/components/SharingStatus/index.js +5 -5
- package/components/SharingStatus/index.js.map +1 -1
- package/components/SharingStatus/styles.module.scss +0 -16
- package/components/SharingStatus/styles.module.scss.d.ts +0 -4
- package/components/Slider/Slider.d.ts +9 -4
- package/components/Slider/index.js +3 -189
- package/components/Slider/index.js.map +1 -1
- package/components/Slider/styles.module.scss +19 -6
- package/components/Slider/styles.module.scss.d.ts +3 -0
- package/components/StatusDot/StatusDot.d.ts +3 -3
- package/components/StatusDot/index.js +3 -3
- package/components/Tabs/TabList/TabList.d.ts +3 -3
- package/components/Tabs/TabList/styles.module.scss +63 -51
- package/components/Tabs/TabList/styles.module.scss.d.ts +7 -3
- package/components/Tabs/TabPanel/TabPanel.d.ts +1 -2
- package/components/Tabs/TabPanel/styles.module.scss +11 -26
- package/components/Tabs/TabPanel/styles.module.scss.d.ts +0 -2
- package/components/Tabs/Tabs.d.ts +3 -3
- package/components/Tabs/index.js +60 -75
- package/components/Tabs/index.js.map +1 -1
- package/components/Tabs/styles.module.scss +5 -9
- package/components/Tabs/styles.module.scss.d.ts +0 -1
- package/components/Textarea/Textarea.d.ts +4 -3
- package/components/Toggle/index.js +1204 -1170
- package/components/Toggle/index.js.map +1 -1
- package/components/Trigger/Trigger.d.ts +2 -2
- package/components/Validation/index.js +39 -32
- package/components/Validation/index.js.map +1 -1
- package/constants.d.ts +1 -1
- package/constants.js +1 -1
- package/constants.js.map +1 -1
- package/docs/FormExample/FormExample.d.ts +3 -1
- package/index.js +23 -23
- package/package.json +4 -4
- package/utils/component.d.ts +1 -0
- package/utils/component.js +7 -3
- package/utils/component.js.map +1 -1
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsxs as te, Fragment as dt, jsx as K } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as jn, useEffect as ge, useState as pt } from "react";
|
|
3
3
|
import W from "classnames";
|
|
4
|
-
import { AnalyticsId as
|
|
5
|
-
import { usePseudoClasses as
|
|
6
|
-
import { useUuid as
|
|
4
|
+
import { AnalyticsId as Gn } from "../../constants.js";
|
|
5
|
+
import { usePseudoClasses as zn } from "../../hooks/usePseudoClasses.js";
|
|
6
|
+
import { useUuid as ne } from "../../hooks/useUuid.js";
|
|
7
7
|
import M from "./styles.module.scss";
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
t ||
|
|
8
|
+
const mt = /* @__PURE__ */ new Set();
|
|
9
|
+
function We(t, e, n) {
|
|
10
|
+
t || mt.has(e) || (console.warn(e), mt.add(e));
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function qn(t) {
|
|
13
13
|
return t !== null && typeof t == "object" && typeof t.start == "function";
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
function
|
|
15
|
+
const Yn = (t) => Array.isArray(t);
|
|
16
|
+
function Hn(t) {
|
|
17
17
|
return typeof t == "string" || Array.isArray(t);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function gt(t) {
|
|
20
20
|
const e = [{}, {}];
|
|
21
21
|
return t == null || t.values.forEach((n, s) => {
|
|
22
22
|
e[0][s] = n.get(), e[1][s] = n.getVelocity();
|
|
23
23
|
}), e;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Ut(t, e, n, s) {
|
|
26
26
|
if (typeof e == "function") {
|
|
27
|
-
const [
|
|
28
|
-
e = e(n !== void 0 ? n : t.custom,
|
|
27
|
+
const [r, i] = gt(s);
|
|
28
|
+
e = e(n !== void 0 ? n : t.custom, r, i);
|
|
29
29
|
}
|
|
30
30
|
if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") {
|
|
31
|
-
const [
|
|
32
|
-
e = e(n !== void 0 ? n : t.custom,
|
|
31
|
+
const [r, i] = gt(s);
|
|
32
|
+
e = e(n !== void 0 ? n : t.custom, r, i);
|
|
33
33
|
}
|
|
34
34
|
return e;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function Xn(t, e, n) {
|
|
37
37
|
const s = t.getProps();
|
|
38
|
-
return
|
|
38
|
+
return Ut(s, e, s.custom, t);
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const Zn = [
|
|
41
41
|
"animate",
|
|
42
42
|
"whileInView",
|
|
43
43
|
"whileFocus",
|
|
@@ -45,7 +45,7 @@ const Gn = [
|
|
|
45
45
|
"whileTap",
|
|
46
46
|
"whileDrag",
|
|
47
47
|
"exit"
|
|
48
|
-
],
|
|
48
|
+
], Qn = ["initial", ...Zn], le = [
|
|
49
49
|
"transformPerspective",
|
|
50
50
|
"x",
|
|
51
51
|
"y",
|
|
@@ -63,78 +63,75 @@ const Gn = [
|
|
|
63
63
|
"skew",
|
|
64
64
|
"skewX",
|
|
65
65
|
"skewY"
|
|
66
|
-
],
|
|
66
|
+
], G = new Set(le), E = (t) => t * 1e3, I = (t) => t / 1e3, Jn = {
|
|
67
67
|
type: "spring",
|
|
68
68
|
stiffness: 500,
|
|
69
69
|
damping: 25,
|
|
70
70
|
restSpeed: 10
|
|
71
|
-
},
|
|
71
|
+
}, es = (t) => ({
|
|
72
72
|
type: "spring",
|
|
73
73
|
stiffness: 550,
|
|
74
74
|
damping: t === 0 ? 2 * Math.sqrt(550) : 30,
|
|
75
75
|
restSpeed: 10
|
|
76
|
-
}),
|
|
76
|
+
}), ts = {
|
|
77
77
|
type: "keyframes",
|
|
78
78
|
duration: 0.8
|
|
79
|
-
},
|
|
79
|
+
}, ns = {
|
|
80
80
|
type: "keyframes",
|
|
81
81
|
ease: [0.25, 0.1, 0.35, 1],
|
|
82
82
|
duration: 0.3
|
|
83
|
-
},
|
|
84
|
-
function
|
|
85
|
-
return
|
|
86
|
-
}
|
|
87
|
-
function Lt(t, e) {
|
|
88
|
-
return t[e] || t.default || t;
|
|
83
|
+
}, ss = (t, { keyframes: e }) => e.length > 2 ? ts : G.has(t) ? t.startsWith("scale") ? es(e[1]) : Jn : ns;
|
|
84
|
+
function jt(t, e) {
|
|
85
|
+
return t ? t[e] || t.default || t : void 0;
|
|
89
86
|
}
|
|
90
|
-
const
|
|
87
|
+
const rs = {
|
|
91
88
|
skipAnimations: !1,
|
|
92
89
|
useManualTiming: !1
|
|
93
|
-
},
|
|
94
|
-
function
|
|
95
|
-
const
|
|
96
|
-
return !
|
|
97
|
-
}
|
|
98
|
-
const
|
|
99
|
-
function
|
|
100
|
-
let e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = !1,
|
|
101
|
-
const
|
|
90
|
+
}, is = (t) => t !== null;
|
|
91
|
+
function Se(t, { repeat: e, repeatType: n = "loop" }, s) {
|
|
92
|
+
const r = t.filter(is), i = e && n !== "loop" && e % 2 === 1 ? 0 : r.length - 1;
|
|
93
|
+
return !i || s === void 0 ? r[i] : s;
|
|
94
|
+
}
|
|
95
|
+
const L = (t) => t;
|
|
96
|
+
function os(t) {
|
|
97
|
+
let e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = !1, r = !1;
|
|
98
|
+
const i = /* @__PURE__ */ new WeakSet();
|
|
102
99
|
let o = {
|
|
103
100
|
delta: 0,
|
|
104
101
|
timestamp: 0,
|
|
105
102
|
isProcessing: !1
|
|
106
103
|
};
|
|
107
|
-
function
|
|
108
|
-
|
|
104
|
+
function a(u) {
|
|
105
|
+
i.has(u) && (l.schedule(u), t()), u(o);
|
|
109
106
|
}
|
|
110
|
-
const
|
|
107
|
+
const l = {
|
|
111
108
|
/**
|
|
112
109
|
* Schedule a process to run on the next frame.
|
|
113
110
|
*/
|
|
114
|
-
schedule: (u, c = !1,
|
|
115
|
-
const
|
|
116
|
-
return c &&
|
|
111
|
+
schedule: (u, c = !1, f = !1) => {
|
|
112
|
+
const g = f && s ? e : n;
|
|
113
|
+
return c && i.add(u), g.has(u) || g.add(u), u;
|
|
117
114
|
},
|
|
118
115
|
/**
|
|
119
116
|
* Cancel the provided callback from running on the next frame.
|
|
120
117
|
*/
|
|
121
118
|
cancel: (u) => {
|
|
122
|
-
n.delete(u),
|
|
119
|
+
n.delete(u), i.delete(u);
|
|
123
120
|
},
|
|
124
121
|
/**
|
|
125
122
|
* Execute all schedule callbacks.
|
|
126
123
|
*/
|
|
127
124
|
process: (u) => {
|
|
128
125
|
if (o = u, s) {
|
|
129
|
-
|
|
126
|
+
r = !0;
|
|
130
127
|
return;
|
|
131
128
|
}
|
|
132
|
-
s = !0, [e, n] = [n, e], n.clear(), e.forEach(
|
|
129
|
+
s = !0, [e, n] = [n, e], n.clear(), e.forEach(a), s = !1, r && (r = !1, l.process(u));
|
|
133
130
|
}
|
|
134
131
|
};
|
|
135
|
-
return
|
|
132
|
+
return l;
|
|
136
133
|
}
|
|
137
|
-
const
|
|
134
|
+
const pe = [
|
|
138
135
|
"read",
|
|
139
136
|
// Read
|
|
140
137
|
"resolveKeyframes",
|
|
@@ -147,88 +144,95 @@ const me = [
|
|
|
147
144
|
// Write
|
|
148
145
|
"postRender"
|
|
149
146
|
// Compute
|
|
150
|
-
],
|
|
151
|
-
function
|
|
147
|
+
], as = 40;
|
|
148
|
+
function ls(t, e) {
|
|
152
149
|
let n = !1, s = !0;
|
|
153
|
-
const
|
|
150
|
+
const r = {
|
|
154
151
|
delta: 0,
|
|
155
152
|
timestamp: 0,
|
|
156
153
|
isProcessing: !1
|
|
157
|
-
},
|
|
154
|
+
}, i = () => n = !0, o = pe.reduce((m, y) => (m[y] = os(i), m), {}), { read: a, resolveKeyframes: l, update: u, preRender: c, render: f, postRender: h } = o, g = () => {
|
|
158
155
|
const m = performance.now();
|
|
159
|
-
n = !1,
|
|
160
|
-
},
|
|
161
|
-
n = !0, s = !0,
|
|
156
|
+
n = !1, r.delta = s ? 1e3 / 60 : Math.max(Math.min(m - r.timestamp, as), 1), r.timestamp = m, r.isProcessing = !0, a.process(r), l.process(r), u.process(r), c.process(r), f.process(r), h.process(r), r.isProcessing = !1, n && e && (s = !1, t(g));
|
|
157
|
+
}, p = () => {
|
|
158
|
+
n = !0, s = !0, r.isProcessing || t(g);
|
|
162
159
|
};
|
|
163
|
-
return { schedule:
|
|
164
|
-
const
|
|
165
|
-
return m[
|
|
160
|
+
return { schedule: pe.reduce((m, y) => {
|
|
161
|
+
const S = o[y];
|
|
162
|
+
return m[y] = (w, v = !1, x = !1) => (n || p(), S.schedule(w, v, x)), m;
|
|
166
163
|
}, {}), cancel: (m) => {
|
|
167
|
-
for (let
|
|
168
|
-
o[
|
|
169
|
-
}, state:
|
|
164
|
+
for (let y = 0; y < pe.length; y++)
|
|
165
|
+
o[pe[y]].cancel(m);
|
|
166
|
+
}, state: r, steps: o };
|
|
167
|
+
}
|
|
168
|
+
const { schedule: _, cancel: Re, state: ve, steps: to } = ls(typeof requestAnimationFrame < "u" ? requestAnimationFrame : L, !0), Gt = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, us = 1e-7, cs = 12;
|
|
169
|
+
function fs(t, e, n, s, r) {
|
|
170
|
+
let i, o, a = 0;
|
|
171
|
+
do
|
|
172
|
+
o = e + (n - e) / 2, i = Gt(o, s, r) - t, i > 0 ? n = o : e = o;
|
|
173
|
+
while (Math.abs(i) > us && ++a < cs);
|
|
174
|
+
return o;
|
|
170
175
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
176
|
+
function ue(t, e, n, s) {
|
|
177
|
+
if (t === e && n === s)
|
|
178
|
+
return L;
|
|
179
|
+
const r = (i) => fs(i, 0, 1, t, n);
|
|
180
|
+
return (i) => i === 0 || i === 1 ? i : Gt(r(i), e, s);
|
|
174
181
|
}
|
|
175
|
-
|
|
176
|
-
|
|
182
|
+
const zt = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, qt = (t) => (e) => 1 - t(1 - e), Yt = /* @__PURE__ */ ue(0.33, 1.53, 0.69, 0.99), Ue = /* @__PURE__ */ qt(Yt), Ht = /* @__PURE__ */ zt(Ue), Xt = (t) => (t *= 2) < 1 ? 0.5 * Ue(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), je = (t) => 1 - Math.sin(Math.acos(t)), hs = qt(je), Zt = zt(je), Qt = (t) => /^0[^.\s]+$/u.test(t);
|
|
183
|
+
function ds(t) {
|
|
184
|
+
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || Qt(t) : !0;
|
|
185
|
+
}
|
|
186
|
+
let ce = L, $ = L;
|
|
187
|
+
process.env.NODE_ENV !== "production" && (ce = (t, e) => {
|
|
177
188
|
!t && typeof console < "u" && console.warn(e);
|
|
178
|
-
},
|
|
189
|
+
}, $ = (t, e) => {
|
|
179
190
|
if (!t)
|
|
180
191
|
throw new Error(e);
|
|
181
192
|
});
|
|
182
|
-
const
|
|
193
|
+
const Jt = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), en = (t) => (e) => typeof e == "string" && e.startsWith(t), tn = /* @__PURE__ */ en("--"), ps = /* @__PURE__ */ en("var(--"), Ge = (t) => ps(t) ? ms.test(t.split("/*")[0].trim()) : !1, ms = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, gs = (
|
|
183
194
|
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
184
195
|
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
185
196
|
);
|
|
186
|
-
function
|
|
187
|
-
const e =
|
|
197
|
+
function ys(t) {
|
|
198
|
+
const e = gs.exec(t);
|
|
188
199
|
if (!e)
|
|
189
200
|
return [,];
|
|
190
|
-
const [, n, s,
|
|
191
|
-
return [`--${n ?? s}`,
|
|
201
|
+
const [, n, s, r] = e;
|
|
202
|
+
return [`--${n ?? s}`, r];
|
|
192
203
|
}
|
|
193
|
-
const
|
|
194
|
-
function
|
|
195
|
-
|
|
196
|
-
const [s,
|
|
204
|
+
const vs = 4;
|
|
205
|
+
function nn(t, e, n = 1) {
|
|
206
|
+
$(n <= vs, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
|
|
207
|
+
const [s, r] = ys(t);
|
|
197
208
|
if (!s)
|
|
198
209
|
return;
|
|
199
|
-
const
|
|
200
|
-
if (
|
|
201
|
-
const o =
|
|
202
|
-
return
|
|
210
|
+
const i = window.getComputedStyle(e).getPropertyValue(s);
|
|
211
|
+
if (i) {
|
|
212
|
+
const o = i.trim();
|
|
213
|
+
return Jt(o) ? parseFloat(o) : o;
|
|
203
214
|
}
|
|
204
|
-
return
|
|
215
|
+
return Ge(r) ? nn(r, e, n + 1) : r;
|
|
205
216
|
}
|
|
206
|
-
const
|
|
217
|
+
const Y = (t, e, n) => n > e ? e : n < t ? t : n, Z = {
|
|
207
218
|
test: (t) => typeof t == "number",
|
|
208
219
|
parse: parseFloat,
|
|
209
220
|
transform: (t) => t
|
|
210
|
-
},
|
|
211
|
-
...
|
|
212
|
-
transform: (t) =>
|
|
213
|
-
},
|
|
214
|
-
...
|
|
221
|
+
}, ie = {
|
|
222
|
+
...Z,
|
|
223
|
+
transform: (t) => Y(0, 1, t)
|
|
224
|
+
}, me = {
|
|
225
|
+
...Z,
|
|
215
226
|
default: 1
|
|
216
|
-
},
|
|
217
|
-
|
|
218
|
-
return typeof t == "string";
|
|
219
|
-
}
|
|
220
|
-
function hs(t) {
|
|
221
|
-
return t == null;
|
|
222
|
-
}
|
|
223
|
-
const ue = (t) => ({
|
|
224
|
-
test: (e) => le(e) && e.endsWith(t) && e.split(" ").length === 1,
|
|
227
|
+
}, fe = (t) => ({
|
|
228
|
+
test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
|
|
225
229
|
parse: parseFloat,
|
|
226
230
|
transform: (e) => `${e}${t}`
|
|
227
|
-
}),
|
|
228
|
-
...
|
|
229
|
-
parse: (t) =>
|
|
230
|
-
transform: (t) =>
|
|
231
|
-
},
|
|
231
|
+
}), B = /* @__PURE__ */ fe("deg"), q = /* @__PURE__ */ fe("%"), d = /* @__PURE__ */ fe("px"), bs = /* @__PURE__ */ fe("vh"), Ts = /* @__PURE__ */ fe("vw"), yt = {
|
|
232
|
+
...q,
|
|
233
|
+
parse: (t) => q.parse(t) / 100,
|
|
234
|
+
transform: (t) => q.transform(t * 100)
|
|
235
|
+
}, Vs = /* @__PURE__ */ new Set([
|
|
232
236
|
"width",
|
|
233
237
|
"height",
|
|
234
238
|
"top",
|
|
@@ -239,25 +243,25 @@ const ue = (t) => ({
|
|
|
239
243
|
"y",
|
|
240
244
|
"translateX",
|
|
241
245
|
"translateY"
|
|
242
|
-
]),
|
|
246
|
+
]), vt = (t) => t === Z || t === d, bt = (t, e) => parseFloat(t.split(", ")[e]), Tt = (t, e) => (n, { transform: s }) => {
|
|
243
247
|
if (s === "none" || !s)
|
|
244
248
|
return 0;
|
|
245
|
-
const
|
|
246
|
-
if (
|
|
247
|
-
return
|
|
249
|
+
const r = s.match(/^matrix3d\((.+)\)$/u);
|
|
250
|
+
if (r)
|
|
251
|
+
return bt(r[1], e);
|
|
248
252
|
{
|
|
249
|
-
const
|
|
250
|
-
return
|
|
253
|
+
const i = s.match(/^matrix\((.+)\)$/u);
|
|
254
|
+
return i ? bt(i[1], t) : 0;
|
|
251
255
|
}
|
|
252
|
-
},
|
|
253
|
-
function
|
|
256
|
+
}, ws = /* @__PURE__ */ new Set(["x", "y", "z"]), Ss = le.filter((t) => !ws.has(t));
|
|
257
|
+
function xs(t) {
|
|
254
258
|
const e = [];
|
|
255
|
-
return
|
|
259
|
+
return Ss.forEach((n) => {
|
|
256
260
|
const s = t.getValue(n);
|
|
257
261
|
s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
|
|
258
262
|
}), e;
|
|
259
263
|
}
|
|
260
|
-
const
|
|
264
|
+
const H = {
|
|
261
265
|
// Dimensions
|
|
262
266
|
width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
263
267
|
height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
@@ -266,65 +270,65 @@ const Y = {
|
|
|
266
270
|
bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min),
|
|
267
271
|
right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min),
|
|
268
272
|
// Transform
|
|
269
|
-
x:
|
|
270
|
-
y:
|
|
273
|
+
x: Tt(4, 13),
|
|
274
|
+
y: Tt(5, 14)
|
|
271
275
|
};
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
const
|
|
276
|
+
H.translateX = H.x;
|
|
277
|
+
H.translateY = H.y;
|
|
278
|
+
const sn = (t) => (e) => e.test(t), As = {
|
|
275
279
|
test: (t) => t === "auto",
|
|
276
280
|
parse: (t) => t
|
|
277
|
-
},
|
|
278
|
-
let De = !1,
|
|
279
|
-
function
|
|
280
|
-
if (
|
|
281
|
-
const t = Array.from(
|
|
281
|
+
}, rn = [Z, d, q, B, Ts, bs, As], Vt = (t) => rn.find(sn(t)), j = /* @__PURE__ */ new Set();
|
|
282
|
+
let De = !1, Ee = !1;
|
|
283
|
+
function on() {
|
|
284
|
+
if (Ee) {
|
|
285
|
+
const t = Array.from(j).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
|
|
282
286
|
e.forEach((s) => {
|
|
283
|
-
const
|
|
284
|
-
|
|
287
|
+
const r = xs(s);
|
|
288
|
+
r.length && (n.set(s, r), s.render());
|
|
285
289
|
}), t.forEach((s) => s.measureInitialState()), e.forEach((s) => {
|
|
286
290
|
s.render();
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
var
|
|
290
|
-
(
|
|
291
|
+
const r = n.get(s);
|
|
292
|
+
r && r.forEach(([i, o]) => {
|
|
293
|
+
var a;
|
|
294
|
+
(a = s.getValue(i)) === null || a === void 0 || a.set(o);
|
|
291
295
|
});
|
|
292
296
|
}), t.forEach((s) => s.measureEndState()), t.forEach((s) => {
|
|
293
297
|
s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
|
|
294
298
|
});
|
|
295
299
|
}
|
|
296
|
-
|
|
300
|
+
Ee = !1, De = !1, j.forEach((t) => t.complete()), j.clear();
|
|
297
301
|
}
|
|
298
|
-
function
|
|
299
|
-
|
|
300
|
-
t.readKeyframes(), t.needsMeasurement && (
|
|
302
|
+
function an() {
|
|
303
|
+
j.forEach((t) => {
|
|
304
|
+
t.readKeyframes(), t.needsMeasurement && (Ee = !0);
|
|
301
305
|
});
|
|
302
306
|
}
|
|
303
|
-
function
|
|
304
|
-
|
|
307
|
+
function Ms() {
|
|
308
|
+
an(), on();
|
|
305
309
|
}
|
|
306
|
-
class
|
|
307
|
-
constructor(e, n, s,
|
|
308
|
-
this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue =
|
|
310
|
+
class ze {
|
|
311
|
+
constructor(e, n, s, r, i, o = !1) {
|
|
312
|
+
this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = r, this.element = i, this.isAsync = o;
|
|
309
313
|
}
|
|
310
314
|
scheduleResolve() {
|
|
311
|
-
this.isScheduled = !0, this.isAsync ? (
|
|
315
|
+
this.isScheduled = !0, this.isAsync ? (j.add(this), De || (De = !0, _.read(an), _.resolveKeyframes(on))) : (this.readKeyframes(), this.complete());
|
|
312
316
|
}
|
|
313
317
|
readKeyframes() {
|
|
314
|
-
const { unresolvedKeyframes: e, name: n, element: s, motionValue:
|
|
315
|
-
for (let
|
|
316
|
-
if (e[
|
|
317
|
-
if (
|
|
318
|
-
const o =
|
|
318
|
+
const { unresolvedKeyframes: e, name: n, element: s, motionValue: r } = this;
|
|
319
|
+
for (let i = 0; i < e.length; i++)
|
|
320
|
+
if (e[i] === null)
|
|
321
|
+
if (i === 0) {
|
|
322
|
+
const o = r == null ? void 0 : r.get(), a = e[e.length - 1];
|
|
319
323
|
if (o !== void 0)
|
|
320
324
|
e[0] = o;
|
|
321
325
|
else if (s && n) {
|
|
322
|
-
const
|
|
323
|
-
|
|
326
|
+
const l = s.readValue(n, a);
|
|
327
|
+
l != null && (e[0] = l);
|
|
324
328
|
}
|
|
325
|
-
e[0] === void 0 && (e[0] =
|
|
329
|
+
e[0] === void 0 && (e[0] = a), r && o === void 0 && r.set(e[0]);
|
|
326
330
|
} else
|
|
327
|
-
e[
|
|
331
|
+
e[i] = e[i - 1];
|
|
328
332
|
}
|
|
329
333
|
setFinalKeyframe() {
|
|
330
334
|
}
|
|
@@ -335,185 +339,192 @@ class je {
|
|
|
335
339
|
measureEndState() {
|
|
336
340
|
}
|
|
337
341
|
complete() {
|
|
338
|
-
this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe),
|
|
342
|
+
this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), j.delete(this);
|
|
339
343
|
}
|
|
340
344
|
cancel() {
|
|
341
|
-
this.isComplete || (this.isScheduled = !1,
|
|
345
|
+
this.isComplete || (this.isScheduled = !1, j.delete(this));
|
|
342
346
|
}
|
|
343
347
|
resume() {
|
|
344
348
|
this.isComplete || this.scheduleResolve();
|
|
345
349
|
}
|
|
346
350
|
}
|
|
347
|
-
const
|
|
348
|
-
|
|
351
|
+
const re = (t) => Math.round(t * 1e5) / 1e5, qe = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
352
|
+
function Cs(t) {
|
|
353
|
+
return t == null;
|
|
354
|
+
}
|
|
355
|
+
const Fs = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, Ye = (t, e) => (n) => !!(typeof n == "string" && Fs.test(n) && n.startsWith(t) || e && !Cs(n) && Object.prototype.hasOwnProperty.call(n, e)), ln = (t, e, n) => (s) => {
|
|
356
|
+
if (typeof s != "string")
|
|
349
357
|
return s;
|
|
350
|
-
const [
|
|
358
|
+
const [r, i, o, a] = s.match(qe);
|
|
351
359
|
return {
|
|
352
|
-
[t]: parseFloat(
|
|
353
|
-
[e]: parseFloat(
|
|
360
|
+
[t]: parseFloat(r),
|
|
361
|
+
[e]: parseFloat(i),
|
|
354
362
|
[n]: parseFloat(o),
|
|
355
|
-
alpha:
|
|
363
|
+
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
356
364
|
};
|
|
357
|
-
},
|
|
358
|
-
...
|
|
359
|
-
transform: (t) => Math.round(
|
|
360
|
-
},
|
|
361
|
-
test: /* @__PURE__ */
|
|
362
|
-
parse: /* @__PURE__ */
|
|
363
|
-
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + Ce.transform(t) + ", " + Ce.transform(e) + ", " + Ce.transform(n) + ", " +
|
|
365
|
+
}, Ps = (t) => Y(0, 255, t), Ce = {
|
|
366
|
+
...Z,
|
|
367
|
+
transform: (t) => Math.round(Ps(t))
|
|
368
|
+
}, U = {
|
|
369
|
+
test: /* @__PURE__ */ Ye("rgb", "red"),
|
|
370
|
+
parse: /* @__PURE__ */ ln("red", "green", "blue"),
|
|
371
|
+
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + Ce.transform(t) + ", " + Ce.transform(e) + ", " + Ce.transform(n) + ", " + re(ie.transform(s)) + ")"
|
|
364
372
|
};
|
|
365
|
-
function
|
|
366
|
-
let e = "", n = "", s = "",
|
|
367
|
-
return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7),
|
|
373
|
+
function Os(t) {
|
|
374
|
+
let e = "", n = "", s = "", r = "";
|
|
375
|
+
return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7), r = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), s = t.substring(3, 4), r = t.substring(4, 5), e += e, n += n, s += s, r += r), {
|
|
368
376
|
red: parseInt(e, 16),
|
|
369
377
|
green: parseInt(n, 16),
|
|
370
378
|
blue: parseInt(s, 16),
|
|
371
|
-
alpha:
|
|
379
|
+
alpha: r ? parseInt(r, 16) / 255 : 1
|
|
372
380
|
};
|
|
373
381
|
}
|
|
374
|
-
const
|
|
375
|
-
test: /* @__PURE__ */
|
|
376
|
-
parse:
|
|
377
|
-
transform:
|
|
378
|
-
},
|
|
379
|
-
test: /* @__PURE__ */
|
|
380
|
-
parse: /* @__PURE__ */
|
|
381
|
-
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " +
|
|
382
|
+
const Ne = {
|
|
383
|
+
test: /* @__PURE__ */ Ye("#"),
|
|
384
|
+
parse: Os,
|
|
385
|
+
transform: U.transform
|
|
386
|
+
}, z = {
|
|
387
|
+
test: /* @__PURE__ */ Ye("hsl", "hue"),
|
|
388
|
+
parse: /* @__PURE__ */ ln("hue", "saturation", "lightness"),
|
|
389
|
+
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + q.transform(re(e)) + ", " + q.transform(re(n)) + ", " + re(ie.transform(s)) + ")"
|
|
382
390
|
}, C = {
|
|
383
|
-
test: (t) =>
|
|
384
|
-
parse: (t) =>
|
|
385
|
-
transform: (t) =>
|
|
386
|
-
};
|
|
387
|
-
function
|
|
391
|
+
test: (t) => U.test(t) || Ne.test(t) || z.test(t),
|
|
392
|
+
parse: (t) => U.test(t) ? U.parse(t) : z.test(t) ? z.parse(t) : Ne.parse(t),
|
|
393
|
+
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? U.transform(t) : z.transform(t)
|
|
394
|
+
}, Rs = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
395
|
+
function Ds(t) {
|
|
388
396
|
var e, n;
|
|
389
|
-
return isNaN(t) &&
|
|
397
|
+
return isNaN(t) && typeof t == "string" && (((e = t.match(qe)) === null || e === void 0 ? void 0 : e.length) || 0) + (((n = t.match(Rs)) === null || n === void 0 ? void 0 : n.length) || 0) > 0;
|
|
390
398
|
}
|
|
391
|
-
const
|
|
392
|
-
function
|
|
399
|
+
const un = "number", cn = "color", Es = "var", Ns = "var(", wt = "${}", Is = /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;
|
|
400
|
+
function oe(t) {
|
|
393
401
|
const e = t.toString(), n = [], s = {
|
|
394
402
|
color: [],
|
|
395
403
|
number: [],
|
|
396
404
|
var: []
|
|
397
|
-
},
|
|
398
|
-
let
|
|
399
|
-
const
|
|
400
|
-
return { values: n, split:
|
|
405
|
+
}, r = [];
|
|
406
|
+
let i = 0;
|
|
407
|
+
const a = e.replace(Is, (l) => (C.test(l) ? (s.color.push(i), r.push(cn), n.push(C.parse(l))) : l.startsWith(Ns) ? (s.var.push(i), r.push(Es), n.push(l)) : (s.number.push(i), r.push(un), n.push(parseFloat(l))), ++i, wt)).split(wt);
|
|
408
|
+
return { values: n, split: a, indexes: s, types: r };
|
|
401
409
|
}
|
|
402
|
-
function
|
|
403
|
-
return
|
|
410
|
+
function fn(t) {
|
|
411
|
+
return oe(t).values;
|
|
404
412
|
}
|
|
405
|
-
function
|
|
406
|
-
const { split: e, types: n } =
|
|
407
|
-
return (
|
|
408
|
-
let
|
|
413
|
+
function hn(t) {
|
|
414
|
+
const { split: e, types: n } = oe(t), s = e.length;
|
|
415
|
+
return (r) => {
|
|
416
|
+
let i = "";
|
|
409
417
|
for (let o = 0; o < s; o++)
|
|
410
|
-
if (
|
|
411
|
-
const
|
|
412
|
-
|
|
418
|
+
if (i += e[o], r[o] !== void 0) {
|
|
419
|
+
const a = n[o];
|
|
420
|
+
a === un ? i += re(r[o]) : a === cn ? i += C.transform(r[o]) : i += r[o];
|
|
413
421
|
}
|
|
414
|
-
return
|
|
422
|
+
return i;
|
|
415
423
|
};
|
|
416
424
|
}
|
|
417
|
-
const
|
|
418
|
-
function
|
|
419
|
-
const e =
|
|
420
|
-
return
|
|
421
|
-
}
|
|
422
|
-
const
|
|
423
|
-
test:
|
|
424
|
-
parse:
|
|
425
|
-
createTransformer:
|
|
426
|
-
getAnimatableNone:
|
|
427
|
-
},
|
|
428
|
-
function
|
|
425
|
+
const _s = (t) => typeof t == "number" ? 0 : t;
|
|
426
|
+
function Ks(t) {
|
|
427
|
+
const e = fn(t);
|
|
428
|
+
return hn(t)(e.map(_s));
|
|
429
|
+
}
|
|
430
|
+
const Q = {
|
|
431
|
+
test: Ds,
|
|
432
|
+
parse: fn,
|
|
433
|
+
createTransformer: hn,
|
|
434
|
+
getAnimatableNone: Ks
|
|
435
|
+
}, Bs = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
436
|
+
function ks(t) {
|
|
429
437
|
const [e, n] = t.slice(0, -1).split("(");
|
|
430
438
|
if (e === "drop-shadow")
|
|
431
439
|
return t;
|
|
432
|
-
const [s] = n.match(
|
|
440
|
+
const [s] = n.match(qe) || [];
|
|
433
441
|
if (!s)
|
|
434
442
|
return t;
|
|
435
|
-
const
|
|
436
|
-
let
|
|
437
|
-
return s !== n && (
|
|
443
|
+
const r = n.replace(s, "");
|
|
444
|
+
let i = Bs.has(e) ? 1 : 0;
|
|
445
|
+
return s !== n && (i *= 100), e + "(" + i + r + ")";
|
|
438
446
|
}
|
|
439
|
-
const
|
|
440
|
-
...
|
|
447
|
+
const Ls = /\b([a-z-]*)\(.*?\)/gu, Ie = {
|
|
448
|
+
...Q,
|
|
441
449
|
getAnimatableNone: (t) => {
|
|
442
|
-
const e = t.match(
|
|
443
|
-
return e ? e.map(
|
|
450
|
+
const e = t.match(Ls);
|
|
451
|
+
return e ? e.map(ks).join(" ") : t;
|
|
444
452
|
}
|
|
445
|
-
},
|
|
446
|
-
...H,
|
|
447
|
-
transform: Math.round
|
|
448
|
-
}, ze = {
|
|
453
|
+
}, $s = {
|
|
449
454
|
// Border props
|
|
450
|
-
borderWidth:
|
|
451
|
-
borderTopWidth:
|
|
452
|
-
borderRightWidth:
|
|
453
|
-
borderBottomWidth:
|
|
454
|
-
borderLeftWidth:
|
|
455
|
-
borderRadius:
|
|
456
|
-
radius:
|
|
457
|
-
borderTopLeftRadius:
|
|
458
|
-
borderTopRightRadius:
|
|
459
|
-
borderBottomRightRadius:
|
|
460
|
-
borderBottomLeftRadius:
|
|
455
|
+
borderWidth: d,
|
|
456
|
+
borderTopWidth: d,
|
|
457
|
+
borderRightWidth: d,
|
|
458
|
+
borderBottomWidth: d,
|
|
459
|
+
borderLeftWidth: d,
|
|
460
|
+
borderRadius: d,
|
|
461
|
+
radius: d,
|
|
462
|
+
borderTopLeftRadius: d,
|
|
463
|
+
borderTopRightRadius: d,
|
|
464
|
+
borderBottomRightRadius: d,
|
|
465
|
+
borderBottomLeftRadius: d,
|
|
461
466
|
// Positioning props
|
|
462
|
-
width:
|
|
463
|
-
maxWidth:
|
|
464
|
-
height:
|
|
465
|
-
maxHeight:
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
left: p,
|
|
467
|
+
width: d,
|
|
468
|
+
maxWidth: d,
|
|
469
|
+
height: d,
|
|
470
|
+
maxHeight: d,
|
|
471
|
+
top: d,
|
|
472
|
+
right: d,
|
|
473
|
+
bottom: d,
|
|
474
|
+
left: d,
|
|
471
475
|
// Spacing props
|
|
472
|
-
padding:
|
|
473
|
-
paddingTop:
|
|
474
|
-
paddingRight:
|
|
475
|
-
paddingBottom:
|
|
476
|
-
paddingLeft:
|
|
477
|
-
margin:
|
|
478
|
-
marginTop:
|
|
479
|
-
marginRight:
|
|
480
|
-
marginBottom:
|
|
481
|
-
marginLeft:
|
|
482
|
-
// Transform props
|
|
483
|
-
rotate: K,
|
|
484
|
-
rotateX: K,
|
|
485
|
-
rotateY: K,
|
|
486
|
-
rotateZ: K,
|
|
487
|
-
scale: ge,
|
|
488
|
-
scaleX: ge,
|
|
489
|
-
scaleY: ge,
|
|
490
|
-
scaleZ: ge,
|
|
491
|
-
skew: K,
|
|
492
|
-
skewX: K,
|
|
493
|
-
skewY: K,
|
|
494
|
-
distance: p,
|
|
495
|
-
translateX: p,
|
|
496
|
-
translateY: p,
|
|
497
|
-
translateZ: p,
|
|
498
|
-
x: p,
|
|
499
|
-
y: p,
|
|
500
|
-
z: p,
|
|
501
|
-
perspective: p,
|
|
502
|
-
transformPerspective: p,
|
|
503
|
-
opacity: te,
|
|
504
|
-
originX: dt,
|
|
505
|
-
originY: dt,
|
|
506
|
-
originZ: p,
|
|
476
|
+
padding: d,
|
|
477
|
+
paddingTop: d,
|
|
478
|
+
paddingRight: d,
|
|
479
|
+
paddingBottom: d,
|
|
480
|
+
paddingLeft: d,
|
|
481
|
+
margin: d,
|
|
482
|
+
marginTop: d,
|
|
483
|
+
marginRight: d,
|
|
484
|
+
marginBottom: d,
|
|
485
|
+
marginLeft: d,
|
|
507
486
|
// Misc
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
487
|
+
backgroundPositionX: d,
|
|
488
|
+
backgroundPositionY: d
|
|
489
|
+
}, Ws = {
|
|
490
|
+
rotate: B,
|
|
491
|
+
rotateX: B,
|
|
492
|
+
rotateY: B,
|
|
493
|
+
rotateZ: B,
|
|
494
|
+
scale: me,
|
|
495
|
+
scaleX: me,
|
|
496
|
+
scaleY: me,
|
|
497
|
+
scaleZ: me,
|
|
498
|
+
skew: B,
|
|
499
|
+
skewX: B,
|
|
500
|
+
skewY: B,
|
|
501
|
+
distance: d,
|
|
502
|
+
translateX: d,
|
|
503
|
+
translateY: d,
|
|
504
|
+
translateZ: d,
|
|
505
|
+
x: d,
|
|
506
|
+
y: d,
|
|
507
|
+
z: d,
|
|
508
|
+
perspective: d,
|
|
509
|
+
transformPerspective: d,
|
|
510
|
+
opacity: ie,
|
|
511
|
+
originX: yt,
|
|
512
|
+
originY: yt,
|
|
513
|
+
originZ: d
|
|
514
|
+
}, St = {
|
|
515
|
+
...Z,
|
|
516
|
+
transform: Math.round
|
|
517
|
+
}, He = {
|
|
518
|
+
...$s,
|
|
519
|
+
...Ws,
|
|
520
|
+
zIndex: St,
|
|
521
|
+
size: d,
|
|
511
522
|
// SVG
|
|
512
|
-
fillOpacity:
|
|
513
|
-
strokeOpacity:
|
|
514
|
-
numOctaves:
|
|
515
|
-
},
|
|
516
|
-
...
|
|
523
|
+
fillOpacity: ie,
|
|
524
|
+
strokeOpacity: ie,
|
|
525
|
+
numOctaves: St
|
|
526
|
+
}, Us = {
|
|
527
|
+
...He,
|
|
517
528
|
// Color props
|
|
518
529
|
color: C,
|
|
519
530
|
backgroundColor: C,
|
|
@@ -526,96 +537,95 @@ const Rs = /\b([a-z-]*)\(.*?\)/gu, _e = {
|
|
|
526
537
|
borderRightColor: C,
|
|
527
538
|
borderBottomColor: C,
|
|
528
539
|
borderLeftColor: C,
|
|
529
|
-
filter:
|
|
530
|
-
WebkitFilter:
|
|
531
|
-
},
|
|
532
|
-
function
|
|
533
|
-
let n =
|
|
534
|
-
return n !==
|
|
535
|
-
}
|
|
536
|
-
const
|
|
537
|
-
function
|
|
538
|
-
let s = 0,
|
|
539
|
-
for (; s < t.length && !
|
|
540
|
-
const
|
|
541
|
-
typeof
|
|
540
|
+
filter: Ie,
|
|
541
|
+
WebkitFilter: Ie
|
|
542
|
+
}, Xe = (t) => Us[t];
|
|
543
|
+
function dn(t, e) {
|
|
544
|
+
let n = Xe(t);
|
|
545
|
+
return n !== Ie && (n = Q), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
|
|
546
|
+
}
|
|
547
|
+
const js = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
548
|
+
function Gs(t, e, n) {
|
|
549
|
+
let s = 0, r;
|
|
550
|
+
for (; s < t.length && !r; ) {
|
|
551
|
+
const i = t[s];
|
|
552
|
+
typeof i == "string" && !js.has(i) && oe(i).values.length && (r = t[s]), s++;
|
|
542
553
|
}
|
|
543
|
-
if (
|
|
544
|
-
for (const
|
|
545
|
-
t[
|
|
554
|
+
if (r && n)
|
|
555
|
+
for (const i of e)
|
|
556
|
+
t[i] = dn(n, r);
|
|
546
557
|
}
|
|
547
|
-
class
|
|
548
|
-
constructor(e, n, s,
|
|
549
|
-
super(e, n, s,
|
|
558
|
+
class pn extends ze {
|
|
559
|
+
constructor(e, n, s, r, i) {
|
|
560
|
+
super(e, n, s, r, i, !0);
|
|
550
561
|
}
|
|
551
562
|
readKeyframes() {
|
|
552
563
|
const { unresolvedKeyframes: e, element: n, name: s } = this;
|
|
553
564
|
if (!n || !n.current)
|
|
554
565
|
return;
|
|
555
566
|
super.readKeyframes();
|
|
556
|
-
for (let
|
|
557
|
-
let u = e[
|
|
558
|
-
if (typeof u == "string" && (u = u.trim(),
|
|
559
|
-
const c =
|
|
560
|
-
c !== void 0 && (e[
|
|
567
|
+
for (let l = 0; l < e.length; l++) {
|
|
568
|
+
let u = e[l];
|
|
569
|
+
if (typeof u == "string" && (u = u.trim(), Ge(u))) {
|
|
570
|
+
const c = nn(u, n.current);
|
|
571
|
+
c !== void 0 && (e[l] = c), l === e.length - 1 && (this.finalKeyframe = u);
|
|
561
572
|
}
|
|
562
573
|
}
|
|
563
|
-
if (this.resolveNoneKeyframes(), !
|
|
574
|
+
if (this.resolveNoneKeyframes(), !Vs.has(s) || e.length !== 2)
|
|
564
575
|
return;
|
|
565
|
-
const [
|
|
566
|
-
if (o !==
|
|
567
|
-
if (
|
|
568
|
-
for (let
|
|
569
|
-
const u = e[
|
|
570
|
-
typeof u == "string" && (e[
|
|
576
|
+
const [r, i] = e, o = Vt(r), a = Vt(i);
|
|
577
|
+
if (o !== a)
|
|
578
|
+
if (vt(o) && vt(a))
|
|
579
|
+
for (let l = 0; l < e.length; l++) {
|
|
580
|
+
const u = e[l];
|
|
581
|
+
typeof u == "string" && (e[l] = parseFloat(u));
|
|
571
582
|
}
|
|
572
583
|
else
|
|
573
584
|
this.needsMeasurement = !0;
|
|
574
585
|
}
|
|
575
586
|
resolveNoneKeyframes() {
|
|
576
587
|
const { unresolvedKeyframes: e, name: n } = this, s = [];
|
|
577
|
-
for (let
|
|
578
|
-
|
|
579
|
-
s.length &&
|
|
588
|
+
for (let r = 0; r < e.length; r++)
|
|
589
|
+
ds(e[r]) && s.push(r);
|
|
590
|
+
s.length && Gs(e, s, n);
|
|
580
591
|
}
|
|
581
592
|
measureInitialState() {
|
|
582
593
|
const { element: e, unresolvedKeyframes: n, name: s } = this;
|
|
583
594
|
if (!e || !e.current)
|
|
584
595
|
return;
|
|
585
|
-
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin =
|
|
586
|
-
const
|
|
587
|
-
|
|
596
|
+
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = H[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
|
|
597
|
+
const r = n[n.length - 1];
|
|
598
|
+
r !== void 0 && e.getValue(s, r).jump(r, !1);
|
|
588
599
|
}
|
|
589
600
|
measureEndState() {
|
|
590
601
|
var e;
|
|
591
|
-
const { element: n, name: s, unresolvedKeyframes:
|
|
602
|
+
const { element: n, name: s, unresolvedKeyframes: r } = this;
|
|
592
603
|
if (!n || !n.current)
|
|
593
604
|
return;
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
const o =
|
|
597
|
-
|
|
598
|
-
n.getValue(
|
|
605
|
+
const i = n.getValue(s);
|
|
606
|
+
i && i.jump(this.measuredOrigin, !1);
|
|
607
|
+
const o = r.length - 1, a = r[o];
|
|
608
|
+
r[o] = H[s](n.measureViewportBox(), window.getComputedStyle(n.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), !((e = this.removedTransforms) === null || e === void 0) && e.length && this.removedTransforms.forEach(([l, u]) => {
|
|
609
|
+
n.getValue(l).set(u);
|
|
599
610
|
}), this.resolveNoneKeyframes();
|
|
600
611
|
}
|
|
601
612
|
}
|
|
602
|
-
function
|
|
603
|
-
|
|
604
|
-
return () => (e === void 0 && (e = t()), e);
|
|
613
|
+
function xe(t) {
|
|
614
|
+
return typeof t == "function";
|
|
605
615
|
}
|
|
606
|
-
let
|
|
607
|
-
function
|
|
608
|
-
|
|
616
|
+
let ye;
|
|
617
|
+
function zs() {
|
|
618
|
+
ye = void 0;
|
|
609
619
|
}
|
|
610
|
-
const
|
|
611
|
-
now: () => (
|
|
620
|
+
const k = {
|
|
621
|
+
now: () => (ye === void 0 && k.set(ve.isProcessing || rs.useManualTiming ? ve.timestamp : performance.now()), ye),
|
|
612
622
|
set: (t) => {
|
|
613
|
-
|
|
623
|
+
ye = t, queueMicrotask(zs);
|
|
614
624
|
}
|
|
615
|
-
},
|
|
616
|
-
(
|
|
625
|
+
}, xt = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
|
|
626
|
+
(Q.test(t) || t === "0") && // And it contains numbers and/or colors
|
|
617
627
|
!t.startsWith("url("));
|
|
618
|
-
function
|
|
628
|
+
function qs(t) {
|
|
619
629
|
const e = t[0];
|
|
620
630
|
if (t.length === 1)
|
|
621
631
|
return !0;
|
|
@@ -623,26 +633,26 @@ function Is(t) {
|
|
|
623
633
|
if (t[n] !== e)
|
|
624
634
|
return !0;
|
|
625
635
|
}
|
|
626
|
-
function
|
|
627
|
-
const
|
|
628
|
-
if (
|
|
636
|
+
function Ys(t, e, n, s) {
|
|
637
|
+
const r = t[0];
|
|
638
|
+
if (r === null)
|
|
629
639
|
return !1;
|
|
630
640
|
if (e === "display" || e === "visibility")
|
|
631
641
|
return !0;
|
|
632
|
-
const
|
|
633
|
-
return
|
|
642
|
+
const i = t[t.length - 1], o = xt(r, e), a = xt(i, e);
|
|
643
|
+
return ce(o === a, `You are trying to animate ${e} from "${r}" to "${i}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${i} via the \`style\` property.`), !o || !a ? !1 : qs(t) || (n === "spring" || xe(n)) && s;
|
|
634
644
|
}
|
|
635
|
-
const
|
|
636
|
-
class
|
|
637
|
-
constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat:
|
|
638
|
-
this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt =
|
|
645
|
+
const Hs = 40;
|
|
646
|
+
class mn {
|
|
647
|
+
constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat: r = 0, repeatDelay: i = 0, repeatType: o = "loop", ...a }) {
|
|
648
|
+
this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt = k.now(), this.options = {
|
|
639
649
|
autoplay: e,
|
|
640
650
|
delay: n,
|
|
641
651
|
type: s,
|
|
642
|
-
repeat:
|
|
643
|
-
repeatDelay:
|
|
652
|
+
repeat: r,
|
|
653
|
+
repeatDelay: i,
|
|
644
654
|
repeatType: o,
|
|
645
|
-
...
|
|
655
|
+
...a
|
|
646
656
|
}, this.updateFinishedPromise();
|
|
647
657
|
}
|
|
648
658
|
/**
|
|
@@ -656,7 +666,7 @@ class rn {
|
|
|
656
666
|
* to avoid a sudden jump into the animation.
|
|
657
667
|
*/
|
|
658
668
|
calcStartTime() {
|
|
659
|
-
return this.resolvedAt ? this.resolvedAt - this.createdAt >
|
|
669
|
+
return this.resolvedAt ? this.resolvedAt - this.createdAt > Hs ? this.resolvedAt : this.createdAt : this.createdAt;
|
|
660
670
|
}
|
|
661
671
|
/**
|
|
662
672
|
* A getter for resolved data. If keyframes are not yet resolved, accessing
|
|
@@ -664,7 +674,7 @@ class rn {
|
|
|
664
674
|
* This is a deoptimisation, but at its worst still batches read/writes.
|
|
665
675
|
*/
|
|
666
676
|
get resolved() {
|
|
667
|
-
return !this._resolved && !this.hasAttemptedResolve &&
|
|
677
|
+
return !this._resolved && !this.hasAttemptedResolve && Ms(), this._resolved;
|
|
668
678
|
}
|
|
669
679
|
/**
|
|
670
680
|
* A method to be called when the keyframes resolver completes. This method
|
|
@@ -672,13 +682,13 @@ class rn {
|
|
|
672
682
|
* Otherwise, it will call initPlayback on the implementing class.
|
|
673
683
|
*/
|
|
674
684
|
onKeyframesResolved(e, n) {
|
|
675
|
-
this.resolvedAt =
|
|
676
|
-
const { name: s, type:
|
|
677
|
-
if (!u && !
|
|
685
|
+
this.resolvedAt = k.now(), this.hasAttemptedResolve = !0;
|
|
686
|
+
const { name: s, type: r, velocity: i, delay: o, onComplete: a, onUpdate: l, isGenerator: u } = this.options;
|
|
687
|
+
if (!u && !Ys(e, s, r, i))
|
|
678
688
|
if (o)
|
|
679
689
|
this.options.duration = 0;
|
|
680
690
|
else {
|
|
681
|
-
|
|
691
|
+
l == null || l(Se(e, this.options, n)), a == null || a(), this.resolveFinishedPromise();
|
|
682
692
|
return;
|
|
683
693
|
}
|
|
684
694
|
const c = this.initPlayback(e, n);
|
|
@@ -704,41 +714,41 @@ class rn {
|
|
|
704
714
|
});
|
|
705
715
|
}
|
|
706
716
|
}
|
|
707
|
-
function
|
|
717
|
+
function gn(t, e) {
|
|
708
718
|
return e ? t * (1e3 / e) : 0;
|
|
709
719
|
}
|
|
710
|
-
const
|
|
711
|
-
function
|
|
712
|
-
const s = Math.max(e -
|
|
713
|
-
return
|
|
720
|
+
const Xs = 5;
|
|
721
|
+
function yn(t, e, n) {
|
|
722
|
+
const s = Math.max(e - Xs, 0);
|
|
723
|
+
return gn(n - t(s), e - s);
|
|
714
724
|
}
|
|
715
|
-
const Fe = 1e-3,
|
|
716
|
-
function
|
|
717
|
-
let
|
|
718
|
-
|
|
725
|
+
const Fe = 1e-3, Zs = 0.01, At = 10, Qs = 0.05, Js = 1;
|
|
726
|
+
function er({ duration: t = 800, bounce: e = 0.25, velocity: n = 0, mass: s = 1 }) {
|
|
727
|
+
let r, i;
|
|
728
|
+
ce(t <= E(At), "Spring duration must be 10 seconds or less");
|
|
719
729
|
let o = 1 - e;
|
|
720
|
-
o =
|
|
721
|
-
const c = u * o,
|
|
722
|
-
return Fe -
|
|
723
|
-
},
|
|
724
|
-
const
|
|
725
|
-
return (-
|
|
726
|
-
}) : (
|
|
727
|
-
const c = Math.exp(-u * t),
|
|
728
|
-
return -Fe + c *
|
|
729
|
-
},
|
|
730
|
-
const c = Math.exp(-u * t),
|
|
731
|
-
return c *
|
|
730
|
+
o = Y(Qs, Js, o), t = Y(Zs, At, I(t)), o < 1 ? (r = (u) => {
|
|
731
|
+
const c = u * o, f = c * t, h = c - n, g = _e(u, o), p = Math.exp(-f);
|
|
732
|
+
return Fe - h / g * p;
|
|
733
|
+
}, i = (u) => {
|
|
734
|
+
const f = u * o * t, h = f * n + n, g = Math.pow(o, 2) * Math.pow(u, 2) * t, p = Math.exp(-f), b = _e(Math.pow(u, 2), o);
|
|
735
|
+
return (-r(u) + Fe > 0 ? -1 : 1) * ((h - g) * p) / b;
|
|
736
|
+
}) : (r = (u) => {
|
|
737
|
+
const c = Math.exp(-u * t), f = (u - n) * t + 1;
|
|
738
|
+
return -Fe + c * f;
|
|
739
|
+
}, i = (u) => {
|
|
740
|
+
const c = Math.exp(-u * t), f = (n - u) * (t * t);
|
|
741
|
+
return c * f;
|
|
732
742
|
});
|
|
733
|
-
const
|
|
734
|
-
if (t =
|
|
743
|
+
const a = 5 / t, l = nr(r, i, a);
|
|
744
|
+
if (t = E(t), isNaN(l))
|
|
735
745
|
return {
|
|
736
746
|
stiffness: 100,
|
|
737
747
|
damping: 10,
|
|
738
748
|
duration: t
|
|
739
749
|
};
|
|
740
750
|
{
|
|
741
|
-
const u = Math.pow(
|
|
751
|
+
const u = Math.pow(l, 2) * s;
|
|
742
752
|
return {
|
|
743
753
|
stiffness: u,
|
|
744
754
|
damping: o * 2 * Math.sqrt(s * u),
|
|
@@ -746,21 +756,21 @@ function $s({ duration: t = 800, bounce: e = 0.25, velocity: n = 0, mass: s = 1
|
|
|
746
756
|
};
|
|
747
757
|
}
|
|
748
758
|
}
|
|
749
|
-
const
|
|
750
|
-
function
|
|
759
|
+
const tr = 12;
|
|
760
|
+
function nr(t, e, n) {
|
|
751
761
|
let s = n;
|
|
752
|
-
for (let
|
|
762
|
+
for (let r = 1; r < tr; r++)
|
|
753
763
|
s = s - t(s) / e(s);
|
|
754
764
|
return s;
|
|
755
765
|
}
|
|
756
|
-
function
|
|
766
|
+
function _e(t, e) {
|
|
757
767
|
return t * Math.sqrt(1 - e * e);
|
|
758
768
|
}
|
|
759
|
-
const
|
|
760
|
-
function
|
|
769
|
+
const sr = ["duration", "bounce"], rr = ["stiffness", "damping", "mass"];
|
|
770
|
+
function Mt(t, e) {
|
|
761
771
|
return e.some((n) => t[n] !== void 0);
|
|
762
772
|
}
|
|
763
|
-
function
|
|
773
|
+
function ir(t) {
|
|
764
774
|
let e = {
|
|
765
775
|
velocity: 0,
|
|
766
776
|
stiffness: 100,
|
|
@@ -769,8 +779,8 @@ function qs(t) {
|
|
|
769
779
|
isResolvedFromDuration: !1,
|
|
770
780
|
...t
|
|
771
781
|
};
|
|
772
|
-
if (!
|
|
773
|
-
const n =
|
|
782
|
+
if (!Mt(t, rr) && Mt(t, sr)) {
|
|
783
|
+
const n = er(t);
|
|
774
784
|
e = {
|
|
775
785
|
...e,
|
|
776
786
|
...n,
|
|
@@ -779,317 +789,303 @@ function qs(t) {
|
|
|
779
789
|
}
|
|
780
790
|
return e;
|
|
781
791
|
}
|
|
782
|
-
function
|
|
783
|
-
const
|
|
792
|
+
function Ze({ keyframes: t, restDelta: e, restSpeed: n, ...s }) {
|
|
793
|
+
const r = t[0], i = t[t.length - 1], o = { done: !1, value: r }, { stiffness: a, damping: l, mass: u, duration: c, velocity: f, isResolvedFromDuration: h } = ir({
|
|
784
794
|
...s,
|
|
785
795
|
velocity: -I(s.velocity || 0)
|
|
786
|
-
}),
|
|
796
|
+
}), g = f || 0, p = l / (2 * Math.sqrt(a * u)), b = i - r, T = I(Math.sqrt(a / u)), m = Math.abs(b) < 5;
|
|
787
797
|
n || (n = m ? 0.01 : 2), e || (e = m ? 5e-3 : 0.5);
|
|
788
|
-
let
|
|
789
|
-
if (
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
const
|
|
793
|
-
return
|
|
798
|
+
let y;
|
|
799
|
+
if (p < 1) {
|
|
800
|
+
const S = _e(T, p);
|
|
801
|
+
y = (w) => {
|
|
802
|
+
const v = Math.exp(-p * T * w);
|
|
803
|
+
return i - v * ((g + p * T * b) / S * Math.sin(S * w) + b * Math.cos(S * w));
|
|
794
804
|
};
|
|
795
|
-
} else if (
|
|
796
|
-
|
|
805
|
+
} else if (p === 1)
|
|
806
|
+
y = (S) => i - Math.exp(-T * S) * (b + (g + T * b) * S);
|
|
797
807
|
else {
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
const
|
|
801
|
-
return
|
|
808
|
+
const S = T * Math.sqrt(p * p - 1);
|
|
809
|
+
y = (w) => {
|
|
810
|
+
const v = Math.exp(-p * T * w), x = Math.min(S * w, 300);
|
|
811
|
+
return i - v * ((g + p * T * b) * Math.sinh(x) + S * b * Math.cosh(x)) / S;
|
|
802
812
|
};
|
|
803
813
|
}
|
|
804
814
|
return {
|
|
805
|
-
calculatedDuration:
|
|
806
|
-
next: (
|
|
807
|
-
const w = S
|
|
808
|
-
if (
|
|
809
|
-
o.done =
|
|
815
|
+
calculatedDuration: h && c || null,
|
|
816
|
+
next: (S) => {
|
|
817
|
+
const w = y(S);
|
|
818
|
+
if (h)
|
|
819
|
+
o.done = S >= c;
|
|
810
820
|
else {
|
|
811
|
-
let
|
|
812
|
-
|
|
813
|
-
const x = Math.abs(
|
|
821
|
+
let v = 0;
|
|
822
|
+
p < 1 && (v = S === 0 ? E(g) : yn(y, S, w));
|
|
823
|
+
const x = Math.abs(v) <= n, F = Math.abs(i - w) <= e;
|
|
814
824
|
o.done = x && F;
|
|
815
825
|
}
|
|
816
|
-
return o.value = o.done ?
|
|
826
|
+
return o.value = o.done ? i : w, o;
|
|
817
827
|
}
|
|
818
828
|
};
|
|
819
829
|
}
|
|
820
|
-
function
|
|
821
|
-
const
|
|
830
|
+
function Ct({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: r = 10, bounceStiffness: i = 500, modifyTarget: o, min: a, max: l, restDelta: u = 0.5, restSpeed: c }) {
|
|
831
|
+
const f = t[0], h = {
|
|
822
832
|
done: !1,
|
|
823
|
-
value:
|
|
824
|
-
},
|
|
825
|
-
let
|
|
826
|
-
const
|
|
827
|
-
m !==
|
|
828
|
-
const
|
|
829
|
-
const
|
|
830
|
-
|
|
833
|
+
value: f
|
|
834
|
+
}, g = (V) => a !== void 0 && V < a || l !== void 0 && V > l, p = (V) => a === void 0 ? l : l === void 0 || Math.abs(a - V) < Math.abs(l - V) ? a : l;
|
|
835
|
+
let b = n * e;
|
|
836
|
+
const T = f + b, m = o === void 0 ? T : o(T);
|
|
837
|
+
m !== T && (b = m - f);
|
|
838
|
+
const y = (V) => -b * Math.exp(-V / s), S = (V) => m + y(V), w = (V) => {
|
|
839
|
+
const A = y(V), P = S(V);
|
|
840
|
+
h.done = Math.abs(A) <= u, h.value = h.done ? m : P;
|
|
831
841
|
};
|
|
832
|
-
let
|
|
833
|
-
const F = (
|
|
834
|
-
|
|
835
|
-
keyframes: [
|
|
836
|
-
velocity:
|
|
842
|
+
let v, x;
|
|
843
|
+
const F = (V) => {
|
|
844
|
+
g(h.value) && (v = V, x = Ze({
|
|
845
|
+
keyframes: [h.value, p(h.value)],
|
|
846
|
+
velocity: yn(S, V, h.value),
|
|
837
847
|
// TODO: This should be passing * 1000
|
|
838
|
-
damping:
|
|
839
|
-
stiffness:
|
|
848
|
+
damping: r,
|
|
849
|
+
stiffness: i,
|
|
840
850
|
restDelta: u,
|
|
841
851
|
restSpeed: c
|
|
842
852
|
}));
|
|
843
853
|
};
|
|
844
854
|
return F(0), {
|
|
845
855
|
calculatedDuration: null,
|
|
846
|
-
next: (
|
|
847
|
-
let
|
|
848
|
-
return !x &&
|
|
856
|
+
next: (V) => {
|
|
857
|
+
let A = !1;
|
|
858
|
+
return !x && v === void 0 && (A = !0, w(V), F(V)), v !== void 0 && V >= v ? x.next(V - v) : (!A && w(V), h);
|
|
849
859
|
}
|
|
850
860
|
};
|
|
851
861
|
}
|
|
852
|
-
const
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
easeInOut: un,
|
|
870
|
-
easeOut: Qs,
|
|
871
|
-
circIn: He,
|
|
872
|
-
circInOut: ei,
|
|
873
|
-
circOut: Js,
|
|
874
|
-
backIn: Xe,
|
|
875
|
-
backInOut: ti,
|
|
876
|
-
backOut: dn,
|
|
877
|
-
anticipate: ni
|
|
878
|
-
}, At = (t) => {
|
|
879
|
-
if (Array.isArray(t)) {
|
|
880
|
-
k(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
881
|
-
const [e, n, s, i] = t;
|
|
882
|
-
return ce(e, n, s, i);
|
|
862
|
+
const or = /* @__PURE__ */ ue(0.42, 0, 1, 1), ar = /* @__PURE__ */ ue(0, 0, 0.58, 1), vn = /* @__PURE__ */ ue(0.42, 0, 0.58, 1), bn = (t) => Array.isArray(t) && typeof t[0] != "number", Qe = (t) => Array.isArray(t) && typeof t[0] == "number", Ft = {
|
|
863
|
+
linear: L,
|
|
864
|
+
easeIn: or,
|
|
865
|
+
easeInOut: vn,
|
|
866
|
+
easeOut: ar,
|
|
867
|
+
circIn: je,
|
|
868
|
+
circInOut: Zt,
|
|
869
|
+
circOut: hs,
|
|
870
|
+
backIn: Ue,
|
|
871
|
+
backInOut: Ht,
|
|
872
|
+
backOut: Yt,
|
|
873
|
+
anticipate: Xt
|
|
874
|
+
}, Pt = (t) => {
|
|
875
|
+
if (Qe(t)) {
|
|
876
|
+
$(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
877
|
+
const [e, n, s, r] = t;
|
|
878
|
+
return ue(e, n, s, r);
|
|
883
879
|
} else if (typeof t == "string")
|
|
884
|
-
return
|
|
880
|
+
return $(Ft[t] !== void 0, `Invalid easing type '${t}'`), Ft[t];
|
|
885
881
|
return t;
|
|
886
|
-
},
|
|
882
|
+
}, lr = (t, e) => (n) => e(t(n)), Je = (...t) => t.reduce(lr), Ae = (t, e, n) => {
|
|
887
883
|
const s = e - t;
|
|
888
884
|
return s === 0 ? 1 : (n - t) / s;
|
|
889
885
|
}, he = (t, e, n) => t + (e - t) * n;
|
|
890
886
|
function Pe(t, e, n) {
|
|
891
887
|
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;
|
|
892
888
|
}
|
|
893
|
-
function
|
|
889
|
+
function ur({ hue: t, saturation: e, lightness: n, alpha: s }) {
|
|
894
890
|
t /= 360, e /= 100, n /= 100;
|
|
895
|
-
let
|
|
891
|
+
let r = 0, i = 0, o = 0;
|
|
896
892
|
if (!e)
|
|
897
|
-
|
|
893
|
+
r = i = o = n;
|
|
898
894
|
else {
|
|
899
|
-
const
|
|
900
|
-
|
|
895
|
+
const a = n < 0.5 ? n * (1 + e) : n + e - n * e, l = 2 * n - a;
|
|
896
|
+
r = Pe(l, a, t + 1 / 3), i = Pe(l, a, t), o = Pe(l, a, t - 1 / 3);
|
|
901
897
|
}
|
|
902
898
|
return {
|
|
903
|
-
red: Math.round(
|
|
904
|
-
green: Math.round(
|
|
899
|
+
red: Math.round(r * 255),
|
|
900
|
+
green: Math.round(i * 255),
|
|
905
901
|
blue: Math.round(o * 255),
|
|
906
902
|
alpha: s
|
|
907
903
|
};
|
|
908
904
|
}
|
|
909
|
-
function
|
|
905
|
+
function be(t, e) {
|
|
910
906
|
return (n) => n > 0 ? e : t;
|
|
911
907
|
}
|
|
912
|
-
const
|
|
913
|
-
const s = t * t,
|
|
914
|
-
return
|
|
915
|
-
},
|
|
916
|
-
function
|
|
917
|
-
const e =
|
|
918
|
-
if (
|
|
908
|
+
const Oe = (t, e, n) => {
|
|
909
|
+
const s = t * t, r = n * (e * e - s) + s;
|
|
910
|
+
return r < 0 ? 0 : Math.sqrt(r);
|
|
911
|
+
}, cr = [Ne, U, z], fr = (t) => cr.find((e) => e.test(t));
|
|
912
|
+
function Ot(t) {
|
|
913
|
+
const e = fr(t);
|
|
914
|
+
if (ce(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`), !e)
|
|
919
915
|
return !1;
|
|
920
916
|
let n = e.parse(t);
|
|
921
|
-
return e ===
|
|
917
|
+
return e === z && (n = ur(n)), n;
|
|
922
918
|
}
|
|
923
|
-
const
|
|
924
|
-
const n =
|
|
919
|
+
const Rt = (t, e) => {
|
|
920
|
+
const n = Ot(t), s = Ot(e);
|
|
925
921
|
if (!n || !s)
|
|
926
|
-
return
|
|
927
|
-
const
|
|
928
|
-
return (
|
|
929
|
-
},
|
|
930
|
-
function
|
|
931
|
-
return
|
|
932
|
-
}
|
|
933
|
-
function
|
|
922
|
+
return be(t, e);
|
|
923
|
+
const r = { ...n };
|
|
924
|
+
return (i) => (r.red = Oe(n.red, s.red, i), r.green = Oe(n.green, s.green, i), r.blue = Oe(n.blue, s.blue, i), r.alpha = he(n.alpha, s.alpha, i), U.transform(r));
|
|
925
|
+
}, Ke = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
926
|
+
function hr(t, e) {
|
|
927
|
+
return Ke.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
|
|
928
|
+
}
|
|
929
|
+
function dr(t, e) {
|
|
934
930
|
return (n) => he(t, e, n);
|
|
935
931
|
}
|
|
936
|
-
function
|
|
937
|
-
return typeof t == "number" ?
|
|
932
|
+
function et(t) {
|
|
933
|
+
return typeof t == "number" ? dr : typeof t == "string" ? Ge(t) ? be : C.test(t) ? Rt : gr : Array.isArray(t) ? Tn : typeof t == "object" ? C.test(t) ? Rt : pr : be;
|
|
938
934
|
}
|
|
939
|
-
function
|
|
940
|
-
const n = [...t], s = n.length,
|
|
941
|
-
return (
|
|
935
|
+
function Tn(t, e) {
|
|
936
|
+
const n = [...t], s = n.length, r = t.map((i, o) => et(i)(i, e[o]));
|
|
937
|
+
return (i) => {
|
|
942
938
|
for (let o = 0; o < s; o++)
|
|
943
|
-
n[o] =
|
|
939
|
+
n[o] = r[o](i);
|
|
944
940
|
return n;
|
|
945
941
|
};
|
|
946
942
|
}
|
|
947
|
-
function
|
|
943
|
+
function pr(t, e) {
|
|
948
944
|
const n = { ...t, ...e }, s = {};
|
|
949
|
-
for (const
|
|
950
|
-
t[
|
|
951
|
-
return (
|
|
952
|
-
for (const
|
|
953
|
-
n[
|
|
945
|
+
for (const r in n)
|
|
946
|
+
t[r] !== void 0 && e[r] !== void 0 && (s[r] = et(t[r])(t[r], e[r]));
|
|
947
|
+
return (r) => {
|
|
948
|
+
for (const i in s)
|
|
949
|
+
n[i] = s[i](r);
|
|
954
950
|
return n;
|
|
955
951
|
};
|
|
956
952
|
}
|
|
957
|
-
function
|
|
953
|
+
function mr(t, e) {
|
|
958
954
|
var n;
|
|
959
|
-
const s = [],
|
|
960
|
-
for (let
|
|
961
|
-
const o = e.types[
|
|
962
|
-
s[
|
|
955
|
+
const s = [], r = { color: 0, var: 0, number: 0 };
|
|
956
|
+
for (let i = 0; i < e.values.length; i++) {
|
|
957
|
+
const o = e.types[i], a = t.indexes[o][r[o]], l = (n = t.values[a]) !== null && n !== void 0 ? n : 0;
|
|
958
|
+
s[i] = l, r[o]++;
|
|
963
959
|
}
|
|
964
960
|
return s;
|
|
965
961
|
}
|
|
966
|
-
const
|
|
967
|
-
const n =
|
|
968
|
-
return s.indexes.var.length ===
|
|
962
|
+
const gr = (t, e) => {
|
|
963
|
+
const n = Q.createTransformer(e), s = oe(t), r = oe(e);
|
|
964
|
+
return s.indexes.var.length === r.indexes.var.length && s.indexes.color.length === r.indexes.color.length && s.indexes.number.length >= r.indexes.number.length ? Ke.has(t) && !r.values.length || Ke.has(e) && !s.values.length ? hr(t, e) : Je(Tn(mr(s, r), r.values), n) : (ce(!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.`), be(t, e));
|
|
969
965
|
};
|
|
970
|
-
function
|
|
971
|
-
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? he(t, e, n) :
|
|
966
|
+
function Vn(t, e, n) {
|
|
967
|
+
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? he(t, e, n) : et(t)(t, e);
|
|
972
968
|
}
|
|
973
|
-
function
|
|
974
|
-
const s = [],
|
|
975
|
-
for (let o = 0; o <
|
|
976
|
-
let
|
|
969
|
+
function yr(t, e, n) {
|
|
970
|
+
const s = [], r = n || Vn, i = t.length - 1;
|
|
971
|
+
for (let o = 0; o < i; o++) {
|
|
972
|
+
let a = r(t[o], t[o + 1]);
|
|
977
973
|
if (e) {
|
|
978
|
-
const
|
|
979
|
-
|
|
974
|
+
const l = Array.isArray(e) ? e[o] || L : e;
|
|
975
|
+
a = Je(l, a);
|
|
980
976
|
}
|
|
981
|
-
s.push(
|
|
977
|
+
s.push(a);
|
|
982
978
|
}
|
|
983
979
|
return s;
|
|
984
980
|
}
|
|
985
|
-
function
|
|
986
|
-
const
|
|
987
|
-
if (
|
|
981
|
+
function vr(t, e, { clamp: n = !0, ease: s, mixer: r } = {}) {
|
|
982
|
+
const i = t.length;
|
|
983
|
+
if ($(i === e.length, "Both input and output ranges must be the same length"), i === 1)
|
|
988
984
|
return () => e[0];
|
|
989
|
-
if (
|
|
985
|
+
if (i === 2 && t[0] === t[1])
|
|
990
986
|
return () => e[1];
|
|
991
|
-
t[0] > t[
|
|
992
|
-
const o =
|
|
987
|
+
t[0] > t[i - 1] && (t = [...t].reverse(), e = [...e].reverse());
|
|
988
|
+
const o = yr(e, s, r), a = o.length, l = (u) => {
|
|
993
989
|
let c = 0;
|
|
994
|
-
if (
|
|
990
|
+
if (a > 1)
|
|
995
991
|
for (; c < t.length - 2 && !(u < t[c + 1]); c++)
|
|
996
992
|
;
|
|
997
|
-
const
|
|
998
|
-
return o[c](
|
|
993
|
+
const f = Ae(t[c], t[c + 1], u);
|
|
994
|
+
return o[c](f);
|
|
999
995
|
};
|
|
1000
|
-
return n ? (u) =>
|
|
996
|
+
return n ? (u) => l(Y(t[0], t[i - 1], u)) : l;
|
|
1001
997
|
}
|
|
1002
|
-
function
|
|
998
|
+
function wn(t, e) {
|
|
1003
999
|
const n = t[t.length - 1];
|
|
1004
1000
|
for (let s = 1; s <= e; s++) {
|
|
1005
|
-
const
|
|
1006
|
-
t.push(he(n, 1,
|
|
1001
|
+
const r = Ae(0, e, s);
|
|
1002
|
+
t.push(he(n, 1, r));
|
|
1007
1003
|
}
|
|
1008
1004
|
}
|
|
1009
|
-
function
|
|
1005
|
+
function Sn(t) {
|
|
1010
1006
|
const e = [0];
|
|
1011
|
-
return
|
|
1007
|
+
return wn(e, t.length - 1), e;
|
|
1012
1008
|
}
|
|
1013
|
-
function
|
|
1009
|
+
function br(t, e) {
|
|
1014
1010
|
return t.map((n) => n * e);
|
|
1015
1011
|
}
|
|
1016
|
-
function
|
|
1017
|
-
return t.map(() => e ||
|
|
1012
|
+
function Tr(t, e) {
|
|
1013
|
+
return t.map(() => e || vn).splice(0, t.length - 1);
|
|
1018
1014
|
}
|
|
1019
|
-
function
|
|
1020
|
-
const
|
|
1015
|
+
function Te({ duration: t = 300, keyframes: e, times: n, ease: s = "easeInOut" }) {
|
|
1016
|
+
const r = bn(s) ? s.map(Pt) : Pt(s), i = {
|
|
1021
1017
|
done: !1,
|
|
1022
1018
|
value: e[0]
|
|
1023
|
-
}, o =
|
|
1019
|
+
}, o = br(
|
|
1024
1020
|
// Only use the provided offsets if they're the correct length
|
|
1025
1021
|
// TODO Maybe we should warn here if there's a length mismatch
|
|
1026
|
-
n && n.length === e.length ? n :
|
|
1022
|
+
n && n.length === e.length ? n : Sn(e),
|
|
1027
1023
|
t
|
|
1028
|
-
),
|
|
1029
|
-
ease: Array.isArray(
|
|
1024
|
+
), a = vr(o, e, {
|
|
1025
|
+
ease: Array.isArray(r) ? r : Tr(e, r)
|
|
1030
1026
|
});
|
|
1031
1027
|
return {
|
|
1032
1028
|
calculatedDuration: t,
|
|
1033
|
-
next: (
|
|
1029
|
+
next: (l) => (i.value = a(l), i.done = l >= t, i)
|
|
1034
1030
|
};
|
|
1035
1031
|
}
|
|
1036
|
-
const
|
|
1037
|
-
function
|
|
1032
|
+
const Be = 2e4;
|
|
1033
|
+
function xn(t) {
|
|
1038
1034
|
let e = 0;
|
|
1039
1035
|
const n = 50;
|
|
1040
1036
|
let s = t.next(e);
|
|
1041
|
-
for (; !s.done && e <
|
|
1037
|
+
for (; !s.done && e < Be; )
|
|
1042
1038
|
e += n, s = t.next(e);
|
|
1043
|
-
return e >=
|
|
1039
|
+
return e >= Be ? 1 / 0 : e;
|
|
1044
1040
|
}
|
|
1045
|
-
const
|
|
1041
|
+
const Vr = (t) => {
|
|
1046
1042
|
const e = ({ timestamp: n }) => t(n);
|
|
1047
1043
|
return {
|
|
1048
1044
|
start: () => _.update(e, !0),
|
|
1049
|
-
stop: () =>
|
|
1045
|
+
stop: () => Re(e),
|
|
1050
1046
|
/**
|
|
1051
1047
|
* If we're processing this frame we can use the
|
|
1052
1048
|
* framelocked timestamp to keep things in sync.
|
|
1053
1049
|
*/
|
|
1054
|
-
now: () =>
|
|
1050
|
+
now: () => ve.isProcessing ? ve.timestamp : k.now()
|
|
1055
1051
|
};
|
|
1056
|
-
},
|
|
1057
|
-
decay:
|
|
1058
|
-
inertia:
|
|
1059
|
-
tween:
|
|
1060
|
-
keyframes:
|
|
1061
|
-
spring:
|
|
1062
|
-
},
|
|
1063
|
-
class
|
|
1052
|
+
}, wr = {
|
|
1053
|
+
decay: Ct,
|
|
1054
|
+
inertia: Ct,
|
|
1055
|
+
tween: Te,
|
|
1056
|
+
keyframes: Te,
|
|
1057
|
+
spring: Ze
|
|
1058
|
+
}, Sr = (t) => t / 100;
|
|
1059
|
+
class tt extends mn {
|
|
1064
1060
|
constructor(e) {
|
|
1065
1061
|
super(e), this.holdTime = null, this.cancelTime = null, this.currentTime = 0, this.playbackSpeed = 1, this.pendingPlayState = "running", this.startTime = null, this.state = "idle", this.stop = () => {
|
|
1066
1062
|
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
1067
1063
|
return;
|
|
1068
1064
|
this.teardown();
|
|
1069
|
-
const { onStop:
|
|
1070
|
-
|
|
1065
|
+
const { onStop: l } = this.options;
|
|
1066
|
+
l && l();
|
|
1071
1067
|
};
|
|
1072
|
-
const { name: n, motionValue: s, element:
|
|
1073
|
-
this.resolver = new o(
|
|
1068
|
+
const { name: n, motionValue: s, element: r, keyframes: i } = this.options, o = (r == null ? void 0 : r.KeyframeResolver) || ze, a = (l, u) => this.onKeyframesResolved(l, u);
|
|
1069
|
+
this.resolver = new o(i, a, n, s, r), this.resolver.scheduleResolve();
|
|
1074
1070
|
}
|
|
1075
1071
|
initPlayback(e) {
|
|
1076
|
-
const { type: n = "keyframes", repeat: s = 0, repeatDelay:
|
|
1077
|
-
let
|
|
1078
|
-
|
|
1079
|
-
const c =
|
|
1080
|
-
|
|
1072
|
+
const { type: n = "keyframes", repeat: s = 0, repeatDelay: r = 0, repeatType: i, velocity: o = 0 } = this.options, a = xe(n) ? n : wr[n] || Te;
|
|
1073
|
+
let l, u;
|
|
1074
|
+
a !== Te && typeof e[0] != "number" && (process.env.NODE_ENV !== "production" && $(e.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`), l = Je(Sr, Vn(e[0], e[1])), e = [0, 100]);
|
|
1075
|
+
const c = a({ ...this.options, keyframes: e });
|
|
1076
|
+
i === "mirror" && (u = a({
|
|
1081
1077
|
...this.options,
|
|
1082
1078
|
keyframes: [...e].reverse(),
|
|
1083
1079
|
velocity: -o
|
|
1084
|
-
})), c.calculatedDuration === null && (c.calculatedDuration =
|
|
1085
|
-
const { calculatedDuration:
|
|
1080
|
+
})), c.calculatedDuration === null && (c.calculatedDuration = xn(c));
|
|
1081
|
+
const { calculatedDuration: f } = c, h = f + r, g = h * (s + 1) - r;
|
|
1086
1082
|
return {
|
|
1087
1083
|
generator: c,
|
|
1088
1084
|
mirroredGenerator: u,
|
|
1089
|
-
mapPercentToKeyframes:
|
|
1090
|
-
calculatedDuration:
|
|
1091
|
-
resolvedDuration:
|
|
1092
|
-
totalDuration:
|
|
1085
|
+
mapPercentToKeyframes: l,
|
|
1086
|
+
calculatedDuration: f,
|
|
1087
|
+
resolvedDuration: h,
|
|
1088
|
+
totalDuration: g
|
|
1093
1089
|
};
|
|
1094
1090
|
}
|
|
1095
1091
|
onPostResolved() {
|
|
@@ -1099,28 +1095,28 @@ class et extends rn {
|
|
|
1099
1095
|
tick(e, n = !1) {
|
|
1100
1096
|
const { resolved: s } = this;
|
|
1101
1097
|
if (!s) {
|
|
1102
|
-
const { keyframes:
|
|
1103
|
-
return { done: !0, value:
|
|
1098
|
+
const { keyframes: V } = this.options;
|
|
1099
|
+
return { done: !0, value: V[V.length - 1] };
|
|
1104
1100
|
}
|
|
1105
|
-
const { finalKeyframe:
|
|
1101
|
+
const { finalKeyframe: r, generator: i, mirroredGenerator: o, mapPercentToKeyframes: a, keyframes: l, calculatedDuration: u, totalDuration: c, resolvedDuration: f } = s;
|
|
1106
1102
|
if (this.startTime === null)
|
|
1107
|
-
return
|
|
1108
|
-
const { delay:
|
|
1103
|
+
return i.next(0);
|
|
1104
|
+
const { delay: h, repeat: g, repeatType: p, repeatDelay: b, onUpdate: T } = this.options;
|
|
1109
1105
|
this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - c / this.speed, this.startTime)), n ? this.currentTime = e : this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = Math.round(e - this.startTime) * this.speed;
|
|
1110
|
-
const m = this.currentTime -
|
|
1106
|
+
const m = this.currentTime - h * (this.speed >= 0 ? 1 : -1), y = this.speed >= 0 ? m < 0 : m > c;
|
|
1111
1107
|
this.currentTime = Math.max(m, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = c);
|
|
1112
|
-
let
|
|
1113
|
-
if (
|
|
1114
|
-
const
|
|
1115
|
-
let
|
|
1116
|
-
!
|
|
1108
|
+
let S = this.currentTime, w = i;
|
|
1109
|
+
if (g) {
|
|
1110
|
+
const V = Math.min(this.currentTime, c) / f;
|
|
1111
|
+
let A = Math.floor(V), P = V % 1;
|
|
1112
|
+
!P && V >= 1 && (P = 1), P === 1 && A--, A = Math.min(A, g + 1), !!(A % 2) && (p === "reverse" ? (P = 1 - P, b && (P -= b / f)) : p === "mirror" && (w = o)), S = Y(0, 1, P) * f;
|
|
1117
1113
|
}
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1120
|
-
let { done: x } =
|
|
1121
|
-
!
|
|
1114
|
+
const v = y ? { done: !1, value: l[0] } : w.next(S);
|
|
1115
|
+
a && (v.value = a(v.value));
|
|
1116
|
+
let { done: x } = v;
|
|
1117
|
+
!y && u !== null && (x = this.speed >= 0 ? this.currentTime >= c : this.currentTime <= 0);
|
|
1122
1118
|
const F = this.holdTime === null && (this.state === "finished" || this.state === "running" && x);
|
|
1123
|
-
return F &&
|
|
1119
|
+
return F && r !== void 0 && (v.value = Se(l, this.options, r)), T && T(v.value), F && this.finish(), v;
|
|
1124
1120
|
}
|
|
1125
1121
|
get duration() {
|
|
1126
1122
|
const { resolved: e } = this;
|
|
@@ -1130,7 +1126,7 @@ class et extends rn {
|
|
|
1130
1126
|
return I(this.currentTime);
|
|
1131
1127
|
}
|
|
1132
1128
|
set time(e) {
|
|
1133
|
-
e =
|
|
1129
|
+
e = E(e), this.currentTime = e, this.holdTime !== null || this.speed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.speed);
|
|
1134
1130
|
}
|
|
1135
1131
|
get speed() {
|
|
1136
1132
|
return this.playbackSpeed;
|
|
@@ -1146,10 +1142,10 @@ class et extends rn {
|
|
|
1146
1142
|
}
|
|
1147
1143
|
if (this.isStopped)
|
|
1148
1144
|
return;
|
|
1149
|
-
const { driver: e =
|
|
1150
|
-
this.driver || (this.driver = e((
|
|
1151
|
-
const
|
|
1152
|
-
this.holdTime !== null ? this.startTime =
|
|
1145
|
+
const { driver: e = Vr, onPlay: n, startTime: s } = this.options;
|
|
1146
|
+
this.driver || (this.driver = e((i) => this.tick(i))), n && n();
|
|
1147
|
+
const r = this.driver.now();
|
|
1148
|
+
this.holdTime !== null ? this.startTime = r - this.holdTime : this.startTime ? this.state === "finished" && (this.startTime = r) : this.startTime = s ?? this.calcStartTime(), this.state === "finished" && this.updateFinishedPromise(), this.cancelTime = this.startTime, this.holdTime = null, this.state = "running", this.driver.start();
|
|
1153
1149
|
}
|
|
1154
1150
|
pause() {
|
|
1155
1151
|
var e;
|
|
@@ -1180,7 +1176,7 @@ class et extends rn {
|
|
|
1180
1176
|
return this.startTime = 0, this.tick(e, !0);
|
|
1181
1177
|
}
|
|
1182
1178
|
}
|
|
1183
|
-
const
|
|
1179
|
+
const xr = /* @__PURE__ */ new Set([
|
|
1184
1180
|
"opacity",
|
|
1185
1181
|
"clipPath",
|
|
1186
1182
|
"filter",
|
|
@@ -1188,47 +1184,75 @@ const bn = /* @__PURE__ */ new Set([
|
|
|
1188
1184
|
// TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
|
|
1189
1185
|
// or until we implement support for linear() easing.
|
|
1190
1186
|
// "background-color"
|
|
1191
|
-
]),
|
|
1192
|
-
|
|
1193
|
-
|
|
1187
|
+
]), Ar = 10, Mr = (t, e) => {
|
|
1188
|
+
let n = "";
|
|
1189
|
+
const s = Math.max(Math.round(e / Ar), 2);
|
|
1190
|
+
for (let r = 0; r < s; r++)
|
|
1191
|
+
n += t(Ae(0, s - 1, r)) + ", ";
|
|
1192
|
+
return `linear(${n.substring(0, n.length - 2)})`;
|
|
1193
|
+
};
|
|
1194
|
+
function nt(t) {
|
|
1195
|
+
let e;
|
|
1196
|
+
return () => (e === void 0 && (e = t()), e);
|
|
1197
|
+
}
|
|
1198
|
+
const Cr = {
|
|
1199
|
+
linearEasing: void 0
|
|
1200
|
+
};
|
|
1201
|
+
function Fr(t, e) {
|
|
1202
|
+
const n = nt(t);
|
|
1203
|
+
return () => {
|
|
1204
|
+
var s;
|
|
1205
|
+
return (s = Cr[e]) !== null && s !== void 0 ? s : n();
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
const Ve = /* @__PURE__ */ Fr(() => {
|
|
1209
|
+
try {
|
|
1210
|
+
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
1211
|
+
} catch {
|
|
1212
|
+
return !1;
|
|
1213
|
+
}
|
|
1214
|
+
return !0;
|
|
1215
|
+
}, "linearEasing");
|
|
1216
|
+
function An(t) {
|
|
1217
|
+
return !!(typeof t == "function" && Ve() || !t || typeof t == "string" && (t in ke || Ve()) || Qe(t) || Array.isArray(t) && t.every(An));
|
|
1194
1218
|
}
|
|
1195
|
-
const
|
|
1219
|
+
const se = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, ke = {
|
|
1196
1220
|
linear: "linear",
|
|
1197
1221
|
ease: "ease",
|
|
1198
1222
|
easeIn: "ease-in",
|
|
1199
1223
|
easeOut: "ease-out",
|
|
1200
1224
|
easeInOut: "ease-in-out",
|
|
1201
|
-
circIn: /* @__PURE__ */
|
|
1202
|
-
circOut: /* @__PURE__ */
|
|
1203
|
-
backIn: /* @__PURE__ */
|
|
1204
|
-
backOut: /* @__PURE__ */
|
|
1225
|
+
circIn: /* @__PURE__ */ se([0, 0.65, 0.55, 1]),
|
|
1226
|
+
circOut: /* @__PURE__ */ se([0.55, 0, 1, 0.45]),
|
|
1227
|
+
backIn: /* @__PURE__ */ se([0.31, 0.01, 0.66, -0.59]),
|
|
1228
|
+
backOut: /* @__PURE__ */ se([0.33, 1.53, 0.69, 0.99])
|
|
1205
1229
|
};
|
|
1206
|
-
function
|
|
1207
|
-
return wn(t) || tt.easeOut;
|
|
1208
|
-
}
|
|
1209
|
-
function wn(t) {
|
|
1230
|
+
function Mn(t, e) {
|
|
1210
1231
|
if (t)
|
|
1211
|
-
return
|
|
1232
|
+
return typeof t == "function" && Ve() ? Mr(t, e) : Qe(t) ? se(t) : Array.isArray(t) ? t.map((n) => Mn(n, e) || ke.easeOut) : ke[t];
|
|
1212
1233
|
}
|
|
1213
|
-
function
|
|
1234
|
+
function Pr(t, e, n, { delay: s = 0, duration: r = 300, repeat: i = 0, repeatType: o = "loop", ease: a, times: l } = {}) {
|
|
1214
1235
|
const u = { [e]: n };
|
|
1215
|
-
|
|
1216
|
-
const c =
|
|
1236
|
+
l && (u.offset = l);
|
|
1237
|
+
const c = Mn(a, r);
|
|
1217
1238
|
return Array.isArray(c) && (u.easing = c), t.animate(u, {
|
|
1218
1239
|
delay: s,
|
|
1219
|
-
duration:
|
|
1240
|
+
duration: r,
|
|
1220
1241
|
easing: Array.isArray(c) ? "linear" : c,
|
|
1221
1242
|
fill: "both",
|
|
1222
|
-
iterations:
|
|
1243
|
+
iterations: i + 1,
|
|
1223
1244
|
direction: o === "reverse" ? "alternate" : "normal"
|
|
1224
1245
|
});
|
|
1225
1246
|
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1247
|
+
function Dt(t, e) {
|
|
1248
|
+
t.timeline = e, t.onfinish = null;
|
|
1249
|
+
}
|
|
1250
|
+
const Or = /* @__PURE__ */ nt(() => Object.hasOwnProperty.call(Element.prototype, "animate")), we = 10, Rr = 2e4;
|
|
1251
|
+
function Dr(t) {
|
|
1252
|
+
return xe(t.type) || t.type === "spring" || !An(t.ease);
|
|
1229
1253
|
}
|
|
1230
|
-
function
|
|
1231
|
-
const n = new
|
|
1254
|
+
function Er(t, e) {
|
|
1255
|
+
const n = new tt({
|
|
1232
1256
|
...e,
|
|
1233
1257
|
keyframes: t,
|
|
1234
1258
|
repeat: 0,
|
|
@@ -1236,41 +1260,49 @@ function xi(t, e) {
|
|
|
1236
1260
|
isGenerator: !0
|
|
1237
1261
|
});
|
|
1238
1262
|
let s = { done: !1, value: t[0] };
|
|
1239
|
-
const
|
|
1240
|
-
let
|
|
1241
|
-
for (; !s.done &&
|
|
1242
|
-
s = n.sample(
|
|
1263
|
+
const r = [];
|
|
1264
|
+
let i = 0;
|
|
1265
|
+
for (; !s.done && i < Rr; )
|
|
1266
|
+
s = n.sample(i), r.push(s.value), i += we;
|
|
1243
1267
|
return {
|
|
1244
1268
|
times: void 0,
|
|
1245
|
-
keyframes:
|
|
1246
|
-
duration:
|
|
1269
|
+
keyframes: r,
|
|
1270
|
+
duration: i - we,
|
|
1247
1271
|
ease: "linear"
|
|
1248
1272
|
};
|
|
1249
1273
|
}
|
|
1250
|
-
|
|
1274
|
+
const Cn = {
|
|
1275
|
+
anticipate: Xt,
|
|
1276
|
+
backInOut: Ht,
|
|
1277
|
+
circInOut: Zt
|
|
1278
|
+
};
|
|
1279
|
+
function Nr(t) {
|
|
1280
|
+
return t in Cn;
|
|
1281
|
+
}
|
|
1282
|
+
class Et extends mn {
|
|
1251
1283
|
constructor(e) {
|
|
1252
1284
|
super(e);
|
|
1253
|
-
const { name: n, motionValue: s, element:
|
|
1254
|
-
this.resolver = new
|
|
1285
|
+
const { name: n, motionValue: s, element: r, keyframes: i } = this.options;
|
|
1286
|
+
this.resolver = new pn(i, (o, a) => this.onKeyframesResolved(o, a), n, s, r), this.resolver.scheduleResolve();
|
|
1255
1287
|
}
|
|
1256
1288
|
initPlayback(e, n) {
|
|
1257
1289
|
var s;
|
|
1258
|
-
let { duration:
|
|
1259
|
-
if (!(!((s =
|
|
1290
|
+
let { duration: r = 300, times: i, ease: o, type: a, motionValue: l, name: u, startTime: c } = this.options;
|
|
1291
|
+
if (!(!((s = l.owner) === null || s === void 0) && s.current))
|
|
1260
1292
|
return !1;
|
|
1261
|
-
if (
|
|
1262
|
-
const { onComplete:
|
|
1263
|
-
e = m.keyframes, e.length === 1 && (e[1] = e[0]),
|
|
1293
|
+
if (typeof o == "string" && Ve() && Nr(o) && (o = Cn[o]), Dr(this.options)) {
|
|
1294
|
+
const { onComplete: h, onUpdate: g, motionValue: p, element: b, ...T } = this.options, m = Er(e, T);
|
|
1295
|
+
e = m.keyframes, e.length === 1 && (e[1] = e[0]), r = m.duration, i = m.times, o = m.ease, a = "keyframes";
|
|
1264
1296
|
}
|
|
1265
|
-
const
|
|
1266
|
-
return
|
|
1267
|
-
const { onComplete:
|
|
1268
|
-
|
|
1297
|
+
const f = Pr(l.owner.current, u, e, { ...this.options, duration: r, times: i, ease: o });
|
|
1298
|
+
return f.startTime = c ?? this.calcStartTime(), this.pendingTimeline ? (Dt(f, this.pendingTimeline), this.pendingTimeline = void 0) : f.onfinish = () => {
|
|
1299
|
+
const { onComplete: h } = this.options;
|
|
1300
|
+
l.set(Se(e, this.options, n)), h && h(), this.cancel(), this.resolveFinishedPromise();
|
|
1269
1301
|
}, {
|
|
1270
|
-
animation:
|
|
1271
|
-
duration:
|
|
1272
|
-
times:
|
|
1273
|
-
type:
|
|
1302
|
+
animation: f,
|
|
1303
|
+
duration: r,
|
|
1304
|
+
times: i,
|
|
1305
|
+
type: a,
|
|
1274
1306
|
ease: o,
|
|
1275
1307
|
keyframes: e
|
|
1276
1308
|
};
|
|
@@ -1294,7 +1326,7 @@ class Ft extends rn {
|
|
|
1294
1326
|
if (!n)
|
|
1295
1327
|
return;
|
|
1296
1328
|
const { animation: s } = n;
|
|
1297
|
-
s.currentTime =
|
|
1329
|
+
s.currentTime = E(e);
|
|
1298
1330
|
}
|
|
1299
1331
|
get speed() {
|
|
1300
1332
|
const { resolved: e } = this;
|
|
@@ -1334,11 +1366,11 @@ class Ft extends rn {
|
|
|
1334
1366
|
else {
|
|
1335
1367
|
const { resolved: n } = this;
|
|
1336
1368
|
if (!n)
|
|
1337
|
-
return
|
|
1369
|
+
return L;
|
|
1338
1370
|
const { animation: s } = n;
|
|
1339
|
-
s
|
|
1371
|
+
Dt(s, e);
|
|
1340
1372
|
}
|
|
1341
|
-
return
|
|
1373
|
+
return L;
|
|
1342
1374
|
}
|
|
1343
1375
|
play() {
|
|
1344
1376
|
if (this.isStopped)
|
|
@@ -1363,23 +1395,23 @@ class Ft extends rn {
|
|
|
1363
1395
|
const { resolved: e } = this;
|
|
1364
1396
|
if (!e)
|
|
1365
1397
|
return;
|
|
1366
|
-
const { animation: n, keyframes: s, duration:
|
|
1398
|
+
const { animation: n, keyframes: s, duration: r, type: i, ease: o, times: a } = e;
|
|
1367
1399
|
if (n.playState === "idle" || n.playState === "finished")
|
|
1368
1400
|
return;
|
|
1369
1401
|
if (this.time) {
|
|
1370
|
-
const { motionValue: u, onUpdate: c, onComplete:
|
|
1371
|
-
...
|
|
1402
|
+
const { motionValue: u, onUpdate: c, onComplete: f, element: h, ...g } = this.options, p = new tt({
|
|
1403
|
+
...g,
|
|
1372
1404
|
keyframes: s,
|
|
1373
|
-
duration:
|
|
1374
|
-
type:
|
|
1405
|
+
duration: r,
|
|
1406
|
+
type: i,
|
|
1375
1407
|
ease: o,
|
|
1376
|
-
times:
|
|
1408
|
+
times: a,
|
|
1377
1409
|
isGenerator: !0
|
|
1378
|
-
}),
|
|
1379
|
-
u.setWithVelocity(
|
|
1410
|
+
}), b = E(this.time);
|
|
1411
|
+
u.setWithVelocity(p.sample(b - we).value, p.sample(b).value, we);
|
|
1380
1412
|
}
|
|
1381
|
-
const { onStop:
|
|
1382
|
-
|
|
1413
|
+
const { onStop: l } = this.options;
|
|
1414
|
+
l && l(), this.cancel();
|
|
1383
1415
|
}
|
|
1384
1416
|
complete() {
|
|
1385
1417
|
const { resolved: e } = this;
|
|
@@ -1390,24 +1422,16 @@ class Ft extends rn {
|
|
|
1390
1422
|
e && e.animation.cancel();
|
|
1391
1423
|
}
|
|
1392
1424
|
static supports(e) {
|
|
1393
|
-
const { motionValue: n, name: s, repeatDelay:
|
|
1394
|
-
return
|
|
1425
|
+
const { motionValue: n, name: s, repeatDelay: r, repeatType: i, damping: o, type: a } = e;
|
|
1426
|
+
return Or() && s && xr.has(s) && n && n.owner && n.owner.current instanceof HTMLElement && /**
|
|
1395
1427
|
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
1396
1428
|
* no way to read the value from WAAPI every frame.
|
|
1397
1429
|
*/
|
|
1398
|
-
!n.owner.getProps().onUpdate && !
|
|
1430
|
+
!n.owner.getProps().onUpdate && !r && i !== "mirror" && o !== 0 && a !== "inertia";
|
|
1399
1431
|
}
|
|
1400
1432
|
}
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
const s = () => {
|
|
1404
|
-
const { currentTime: i } = e, o = (i === null ? 0 : i.value) / 100;
|
|
1405
|
-
n !== o && t(o), n = o;
|
|
1406
|
-
};
|
|
1407
|
-
return _.update(s, !0), () => be(s);
|
|
1408
|
-
}
|
|
1409
|
-
const Mi = sn(() => window.ScrollTimeline !== void 0);
|
|
1410
|
-
class nt {
|
|
1433
|
+
const Ir = nt(() => window.ScrollTimeline !== void 0);
|
|
1434
|
+
class Fn {
|
|
1411
1435
|
constructor(e) {
|
|
1412
1436
|
this.stop = () => this.runAll("stop"), this.animations = e.filter(Boolean);
|
|
1413
1437
|
}
|
|
@@ -1424,18 +1448,11 @@ class nt {
|
|
|
1424
1448
|
for (let s = 0; s < this.animations.length; s++)
|
|
1425
1449
|
this.animations[s][e] = n;
|
|
1426
1450
|
}
|
|
1427
|
-
attachTimeline(e) {
|
|
1428
|
-
const
|
|
1429
|
-
if (Mi() && s.attachTimeline)
|
|
1430
|
-
s.attachTimeline(e);
|
|
1431
|
-
else
|
|
1432
|
-
return s.pause(), Ai((i) => {
|
|
1433
|
-
s.time = s.duration * i;
|
|
1434
|
-
}, e);
|
|
1435
|
-
});
|
|
1451
|
+
attachTimeline(e, n) {
|
|
1452
|
+
const s = this.animations.map((r) => Ir() && r.attachTimeline ? r.attachTimeline(e) : n(r));
|
|
1436
1453
|
return () => {
|
|
1437
|
-
|
|
1438
|
-
|
|
1454
|
+
s.forEach((r, i) => {
|
|
1455
|
+
r && r(), this.animations[i].stop();
|
|
1439
1456
|
});
|
|
1440
1457
|
};
|
|
1441
1458
|
}
|
|
@@ -1476,63 +1493,65 @@ class nt {
|
|
|
1476
1493
|
this.runAll("complete");
|
|
1477
1494
|
}
|
|
1478
1495
|
}
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1496
|
+
function _r({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: r, repeat: i, repeatType: o, repeatDelay: a, from: l, elapsed: u, ...c }) {
|
|
1497
|
+
return !!Object.keys(c).length;
|
|
1498
|
+
}
|
|
1499
|
+
const Pn = (t, e, n, s = {}, r, i) => (o) => {
|
|
1500
|
+
const a = jt(s, t) || {}, l = a.delay || s.delay || 0;
|
|
1501
|
+
let { elapsed: u = 0 } = s;
|
|
1502
|
+
u = u - E(l);
|
|
1503
|
+
let c = {
|
|
1484
1504
|
keyframes: Array.isArray(n) ? n : [null, n],
|
|
1485
1505
|
ease: "easeOut",
|
|
1486
1506
|
velocity: e.getVelocity(),
|
|
1487
1507
|
...a,
|
|
1488
|
-
delay: -
|
|
1489
|
-
onUpdate: (
|
|
1490
|
-
e.set(
|
|
1508
|
+
delay: -u,
|
|
1509
|
+
onUpdate: (h) => {
|
|
1510
|
+
e.set(h), a.onUpdate && a.onUpdate(h);
|
|
1491
1511
|
},
|
|
1492
1512
|
onComplete: () => {
|
|
1493
|
-
|
|
1513
|
+
o(), a.onComplete && a.onComplete();
|
|
1494
1514
|
},
|
|
1495
|
-
onStop: o,
|
|
1496
1515
|
name: t,
|
|
1497
1516
|
motionValue: e,
|
|
1498
|
-
element:
|
|
1517
|
+
element: i ? void 0 : r
|
|
1499
1518
|
};
|
|
1500
|
-
|
|
1501
|
-
...
|
|
1502
|
-
...
|
|
1503
|
-
}),
|
|
1519
|
+
_r(a) || (c = {
|
|
1520
|
+
...c,
|
|
1521
|
+
...ss(t, c)
|
|
1522
|
+
}), c.duration && (c.duration = E(c.duration)), c.repeatDelay && (c.repeatDelay = E(c.repeatDelay)), c.from !== void 0 && (c.keyframes[0] = c.from);
|
|
1504
1523
|
let f = !1;
|
|
1505
|
-
if ((
|
|
1506
|
-
const
|
|
1507
|
-
if (
|
|
1524
|
+
if ((c.type === !1 || c.duration === 0 && !c.repeatDelay) && (c.duration = 0, c.delay === 0 && (f = !0)), f && !i && e.get() !== void 0) {
|
|
1525
|
+
const h = Se(c.keyframes, a);
|
|
1526
|
+
if (h !== void 0)
|
|
1508
1527
|
return _.update(() => {
|
|
1509
|
-
|
|
1510
|
-
}), new
|
|
1528
|
+
c.onUpdate(h), c.onComplete();
|
|
1529
|
+
}), new Fn([]);
|
|
1511
1530
|
}
|
|
1512
|
-
return !
|
|
1513
|
-
},
|
|
1514
|
-
function
|
|
1531
|
+
return !i && Et.supports(c) ? new Et(c) : new tt(c);
|
|
1532
|
+
}, Kr = (t) => Yn(t) ? t[t.length - 1] || 0 : t;
|
|
1533
|
+
function Br(t, e) {
|
|
1515
1534
|
t.indexOf(e) === -1 && t.push(e);
|
|
1516
1535
|
}
|
|
1517
|
-
function
|
|
1536
|
+
function On(t, e) {
|
|
1518
1537
|
const n = t.indexOf(e);
|
|
1519
1538
|
n > -1 && t.splice(n, 1);
|
|
1520
1539
|
}
|
|
1521
|
-
class
|
|
1540
|
+
class Rn {
|
|
1522
1541
|
constructor() {
|
|
1523
1542
|
this.subscriptions = [];
|
|
1524
1543
|
}
|
|
1525
1544
|
add(e) {
|
|
1526
|
-
return
|
|
1545
|
+
return Br(this.subscriptions, e), () => On(this.subscriptions, e);
|
|
1527
1546
|
}
|
|
1528
1547
|
notify(e, n, s) {
|
|
1529
|
-
const
|
|
1530
|
-
if (
|
|
1531
|
-
if (
|
|
1548
|
+
const r = this.subscriptions.length;
|
|
1549
|
+
if (r)
|
|
1550
|
+
if (r === 1)
|
|
1532
1551
|
this.subscriptions[0](e, n, s);
|
|
1533
1552
|
else
|
|
1534
|
-
for (let
|
|
1535
|
-
const o = this.subscriptions[
|
|
1553
|
+
for (let i = 0; i < r; i++) {
|
|
1554
|
+
const o = this.subscriptions[i];
|
|
1536
1555
|
o && o(e, n, s);
|
|
1537
1556
|
}
|
|
1538
1557
|
}
|
|
@@ -1543,8 +1562,8 @@ class xn {
|
|
|
1543
1562
|
this.subscriptions.length = 0;
|
|
1544
1563
|
}
|
|
1545
1564
|
}
|
|
1546
|
-
const
|
|
1547
|
-
class
|
|
1565
|
+
const Nt = 30, kr = (t) => !isNaN(parseFloat(t));
|
|
1566
|
+
class Lr {
|
|
1548
1567
|
/**
|
|
1549
1568
|
* @param init - The initiating value
|
|
1550
1569
|
* @param config - Optional configuration options
|
|
@@ -1554,13 +1573,13 @@ class An {
|
|
|
1554
1573
|
* @internal
|
|
1555
1574
|
*/
|
|
1556
1575
|
constructor(e, n = {}) {
|
|
1557
|
-
this.version = "11.
|
|
1558
|
-
const
|
|
1559
|
-
this.updatedAt !==
|
|
1576
|
+
this.version = "11.11.9", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s, r = !0) => {
|
|
1577
|
+
const i = k.now();
|
|
1578
|
+
this.updatedAt !== i && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), r && this.events.renderRequest && this.events.renderRequest.notify(this.current);
|
|
1560
1579
|
}, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner;
|
|
1561
1580
|
}
|
|
1562
1581
|
setCurrent(e) {
|
|
1563
|
-
this.current = e, this.updatedAt =
|
|
1582
|
+
this.current = e, this.updatedAt = k.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = kr(this.current));
|
|
1564
1583
|
}
|
|
1565
1584
|
setPrevFrameValue(e = this.current) {
|
|
1566
1585
|
this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
|
|
@@ -1606,10 +1625,10 @@ class An {
|
|
|
1606
1625
|
* @deprecated
|
|
1607
1626
|
*/
|
|
1608
1627
|
onChange(e) {
|
|
1609
|
-
return process.env.NODE_ENV !== "production" &&
|
|
1628
|
+
return process.env.NODE_ENV !== "production" && We(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e);
|
|
1610
1629
|
}
|
|
1611
1630
|
on(e, n) {
|
|
1612
|
-
this.events[e] || (this.events[e] = new
|
|
1631
|
+
this.events[e] || (this.events[e] = new Rn());
|
|
1613
1632
|
const s = this.events[e].add(n);
|
|
1614
1633
|
return e === "change" ? () => {
|
|
1615
1634
|
s(), _.read(() => {
|
|
@@ -1681,11 +1700,11 @@ class An {
|
|
|
1681
1700
|
* @public
|
|
1682
1701
|
*/
|
|
1683
1702
|
getVelocity() {
|
|
1684
|
-
const e =
|
|
1685
|
-
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt >
|
|
1703
|
+
const e = k.now();
|
|
1704
|
+
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Nt)
|
|
1686
1705
|
return 0;
|
|
1687
|
-
const n = Math.min(this.updatedAt - this.prevUpdatedAt,
|
|
1688
|
-
return
|
|
1706
|
+
const n = Math.min(this.updatedAt - this.prevUpdatedAt, Nt);
|
|
1707
|
+
return gn(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
|
|
1689
1708
|
}
|
|
1690
1709
|
/**
|
|
1691
1710
|
* Registers a new animation to control this `MotionValue`. Only one
|
|
@@ -1738,112 +1757,82 @@ class An {
|
|
|
1738
1757
|
this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
1739
1758
|
}
|
|
1740
1759
|
}
|
|
1741
|
-
function
|
|
1742
|
-
return new
|
|
1760
|
+
function ae(t, e) {
|
|
1761
|
+
return new Lr(t, e);
|
|
1743
1762
|
}
|
|
1744
|
-
function
|
|
1745
|
-
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e,
|
|
1763
|
+
function $r(t, e, n) {
|
|
1764
|
+
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, ae(n));
|
|
1746
1765
|
}
|
|
1747
|
-
function
|
|
1748
|
-
const n =
|
|
1749
|
-
let { transitionEnd: s = {}, transition:
|
|
1750
|
-
|
|
1751
|
-
for (const o in
|
|
1752
|
-
const
|
|
1753
|
-
|
|
1766
|
+
function Wr(t, e) {
|
|
1767
|
+
const n = Xn(t, e);
|
|
1768
|
+
let { transitionEnd: s = {}, transition: r = {}, ...i } = n || {};
|
|
1769
|
+
i = { ...i, ...s };
|
|
1770
|
+
for (const o in i) {
|
|
1771
|
+
const a = Kr(i[o]);
|
|
1772
|
+
$r(t, o, a);
|
|
1754
1773
|
}
|
|
1755
1774
|
}
|
|
1756
|
-
const
|
|
1757
|
-
function
|
|
1758
|
-
return t.props[
|
|
1759
|
-
}
|
|
1760
|
-
function Ii(t) {
|
|
1761
|
-
if (L.has(t))
|
|
1762
|
-
return "transform";
|
|
1763
|
-
if (bn.has(t))
|
|
1764
|
-
return Ae(t);
|
|
1765
|
-
}
|
|
1766
|
-
class Ei extends An {
|
|
1767
|
-
constructor() {
|
|
1768
|
-
super(...arguments), this.output = [], this.counts = /* @__PURE__ */ new Map();
|
|
1769
|
-
}
|
|
1770
|
-
add(e) {
|
|
1771
|
-
const n = Ii(e);
|
|
1772
|
-
if (!n)
|
|
1773
|
-
return;
|
|
1774
|
-
const s = this.counts.get(n) || 0;
|
|
1775
|
-
this.counts.set(n, s + 1), s === 0 && (this.output.push(n), this.update());
|
|
1776
|
-
let i = !1;
|
|
1777
|
-
return () => {
|
|
1778
|
-
if (i)
|
|
1779
|
-
return;
|
|
1780
|
-
i = !0;
|
|
1781
|
-
const r = this.counts.get(n) - 1;
|
|
1782
|
-
this.counts.set(n, r), r === 0 && (st(this.output, n), this.update());
|
|
1783
|
-
};
|
|
1784
|
-
}
|
|
1785
|
-
update() {
|
|
1786
|
-
this.set(this.output.length ? this.output.join(", ") : "auto");
|
|
1787
|
-
}
|
|
1775
|
+
const st = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Ur = "framerAppearId", jr = "data-" + st(Ur);
|
|
1776
|
+
function Gr(t) {
|
|
1777
|
+
return t.props[jr];
|
|
1788
1778
|
}
|
|
1789
|
-
const
|
|
1790
|
-
function
|
|
1791
|
-
return !!(
|
|
1779
|
+
const O = (t) => !!(t && t.getVelocity);
|
|
1780
|
+
function zr(t) {
|
|
1781
|
+
return !!(O(t) && t.add);
|
|
1792
1782
|
}
|
|
1793
|
-
function
|
|
1794
|
-
var n;
|
|
1783
|
+
function qr(t, e) {
|
|
1795
1784
|
if (!t.applyWillChange)
|
|
1796
1785
|
return;
|
|
1797
|
-
|
|
1798
|
-
if (
|
|
1799
|
-
return
|
|
1786
|
+
const n = t.getValue("willChange");
|
|
1787
|
+
if (zr(n))
|
|
1788
|
+
return n.add(e);
|
|
1800
1789
|
}
|
|
1801
|
-
function
|
|
1790
|
+
function Yr({ protectedKeys: t, needsAnimating: e }, n) {
|
|
1802
1791
|
const s = t.hasOwnProperty(n) && e[n] !== !0;
|
|
1803
1792
|
return e[n] = !1, s;
|
|
1804
1793
|
}
|
|
1805
|
-
function
|
|
1806
|
-
var
|
|
1807
|
-
let { transition: o = t.getDefaultTransition(), transitionEnd:
|
|
1794
|
+
function Hr(t, e, { delay: n = 0, transitionOverride: s, type: r } = {}) {
|
|
1795
|
+
var i;
|
|
1796
|
+
let { transition: o = t.getDefaultTransition(), transitionEnd: a, ...l } = e;
|
|
1808
1797
|
s && (o = s);
|
|
1809
|
-
const u = [], c =
|
|
1810
|
-
for (const
|
|
1811
|
-
const
|
|
1812
|
-
if (
|
|
1798
|
+
const u = [], c = r && t.animationState && t.animationState.getState()[r];
|
|
1799
|
+
for (const f in l) {
|
|
1800
|
+
const h = t.getValue(f, (i = t.latestValues[f]) !== null && i !== void 0 ? i : null), g = l[f];
|
|
1801
|
+
if (g === void 0 || c && Yr(c, f))
|
|
1813
1802
|
continue;
|
|
1814
|
-
const
|
|
1803
|
+
const p = {
|
|
1815
1804
|
delay: n,
|
|
1816
|
-
...
|
|
1805
|
+
...jt(o || {}, f)
|
|
1817
1806
|
};
|
|
1818
|
-
let
|
|
1807
|
+
let b = !1;
|
|
1819
1808
|
if (window.MotionHandoffAnimation) {
|
|
1820
|
-
const m =
|
|
1809
|
+
const m = Gr(t);
|
|
1821
1810
|
if (m) {
|
|
1822
|
-
const
|
|
1823
|
-
|
|
1811
|
+
const y = window.MotionHandoffAnimation(m, f, _);
|
|
1812
|
+
y !== null && (p.startTime = y, b = !0);
|
|
1824
1813
|
}
|
|
1825
1814
|
}
|
|
1826
|
-
f.start(
|
|
1827
|
-
const
|
|
1828
|
-
|
|
1815
|
+
qr(t, f), h.start(Pn(f, h, g, t.shouldReduceMotion && G.has(f) ? { type: !1 } : p, t, b));
|
|
1816
|
+
const T = h.animation;
|
|
1817
|
+
T && u.push(T);
|
|
1829
1818
|
}
|
|
1830
|
-
return
|
|
1819
|
+
return a && Promise.all(u).then(() => {
|
|
1831
1820
|
_.update(() => {
|
|
1832
|
-
|
|
1821
|
+
a && Wr(t, a);
|
|
1833
1822
|
});
|
|
1834
1823
|
}), u;
|
|
1835
1824
|
}
|
|
1836
|
-
const
|
|
1837
|
-
x:
|
|
1838
|
-
y:
|
|
1825
|
+
const It = () => ({ min: 0, max: 0 }), rt = () => ({
|
|
1826
|
+
x: It(),
|
|
1827
|
+
y: It()
|
|
1839
1828
|
});
|
|
1840
|
-
function
|
|
1829
|
+
function Xr({ top: t, left: e, right: n, bottom: s }) {
|
|
1841
1830
|
return {
|
|
1842
1831
|
x: { min: e, max: n },
|
|
1843
1832
|
y: { min: t, max: s }
|
|
1844
1833
|
};
|
|
1845
1834
|
}
|
|
1846
|
-
function
|
|
1835
|
+
function Zr(t, e) {
|
|
1847
1836
|
if (!e)
|
|
1848
1837
|
return t;
|
|
1849
1838
|
const n = e({ x: t.left, y: t.top }), s = e({ x: t.right, y: t.bottom });
|
|
@@ -1854,25 +1843,25 @@ function $i(t, e) {
|
|
|
1854
1843
|
right: s.x
|
|
1855
1844
|
};
|
|
1856
1845
|
}
|
|
1857
|
-
function
|
|
1858
|
-
return
|
|
1846
|
+
function Qr(t, e) {
|
|
1847
|
+
return Xr(Zr(t.getBoundingClientRect(), e));
|
|
1859
1848
|
}
|
|
1860
|
-
const
|
|
1861
|
-
function
|
|
1849
|
+
const Jr = {};
|
|
1850
|
+
function ei(t) {
|
|
1862
1851
|
return t instanceof SVGElement && t.tagName !== "svg";
|
|
1863
1852
|
}
|
|
1864
|
-
function
|
|
1865
|
-
const s =
|
|
1866
|
-
return s.start(
|
|
1853
|
+
function ti(t, e, n) {
|
|
1854
|
+
const s = O(t) ? t : ae(t);
|
|
1855
|
+
return s.start(Pn("", s, e, n)), s.animation;
|
|
1867
1856
|
}
|
|
1868
|
-
const
|
|
1869
|
-
function
|
|
1870
|
-
return
|
|
1857
|
+
const ni = typeof window < "u";
|
|
1858
|
+
function Dn(t) {
|
|
1859
|
+
return qn(t.animate) || Qn.some((e) => Hn(t[e]));
|
|
1871
1860
|
}
|
|
1872
|
-
function
|
|
1873
|
-
return !!(
|
|
1861
|
+
function si(t) {
|
|
1862
|
+
return !!(Dn(t) || t.variants);
|
|
1874
1863
|
}
|
|
1875
|
-
const
|
|
1864
|
+
const _t = {
|
|
1876
1865
|
animation: [
|
|
1877
1866
|
"animate",
|
|
1878
1867
|
"variants",
|
|
@@ -1891,17 +1880,17 @@ const Dt = {
|
|
|
1891
1880
|
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
|
|
1892
1881
|
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
1893
1882
|
layout: ["layout", "layoutId"]
|
|
1894
|
-
},
|
|
1895
|
-
for (const t in
|
|
1896
|
-
|
|
1897
|
-
isEnabled: (e) =>
|
|
1883
|
+
}, Le = {};
|
|
1884
|
+
for (const t in _t)
|
|
1885
|
+
Le[t] = {
|
|
1886
|
+
isEnabled: (e) => _t[t].some((n) => !!e[n])
|
|
1898
1887
|
};
|
|
1899
|
-
function
|
|
1900
|
-
Object.assign(t.style, e,
|
|
1901
|
-
for (const
|
|
1902
|
-
t.style.setProperty(
|
|
1888
|
+
function En(t, { style: e, vars: n }, s, r) {
|
|
1889
|
+
Object.assign(t.style, e, r && r.getProjectionStyles(s));
|
|
1890
|
+
for (const i in n)
|
|
1891
|
+
t.style.setProperty(i, n[i]);
|
|
1903
1892
|
}
|
|
1904
|
-
const
|
|
1893
|
+
const Nn = /* @__PURE__ */ new Set([
|
|
1905
1894
|
"baseFrequency",
|
|
1906
1895
|
"diffuseConstant",
|
|
1907
1896
|
"kernelMatrix",
|
|
@@ -1926,151 +1915,151 @@ const Rn = /* @__PURE__ */ new Set([
|
|
|
1926
1915
|
"textLength",
|
|
1927
1916
|
"lengthAdjust"
|
|
1928
1917
|
]);
|
|
1929
|
-
function
|
|
1930
|
-
|
|
1931
|
-
for (const
|
|
1932
|
-
t.setAttribute(
|
|
1918
|
+
function ri(t, e, n, s) {
|
|
1919
|
+
En(t, e, void 0, s);
|
|
1920
|
+
for (const r in e.attrs)
|
|
1921
|
+
t.setAttribute(Nn.has(r) ? r : st(r), e.attrs[r]);
|
|
1933
1922
|
}
|
|
1934
|
-
function
|
|
1935
|
-
return
|
|
1923
|
+
function ii(t, { layout: e, layoutId: n }) {
|
|
1924
|
+
return G.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!Jr[t] || t === "opacity");
|
|
1936
1925
|
}
|
|
1937
|
-
function
|
|
1926
|
+
function In(t, e, n) {
|
|
1938
1927
|
var s;
|
|
1939
|
-
const { style:
|
|
1940
|
-
for (const o in
|
|
1941
|
-
(
|
|
1942
|
-
return n &&
|
|
1943
|
-
}
|
|
1944
|
-
function
|
|
1945
|
-
const s =
|
|
1946
|
-
for (const
|
|
1947
|
-
if (
|
|
1948
|
-
const
|
|
1949
|
-
s[
|
|
1928
|
+
const { style: r } = t, i = {};
|
|
1929
|
+
for (const o in r)
|
|
1930
|
+
(O(r[o]) || e.style && O(e.style[o]) || ii(o, t) || ((s = n == null ? void 0 : n.getValue(o)) === null || s === void 0 ? void 0 : s.liveStyle) !== void 0) && (i[o] = r[o]);
|
|
1931
|
+
return n && r && typeof r.willChange == "string" && (n.applyWillChange = !1), i;
|
|
1932
|
+
}
|
|
1933
|
+
function oi(t, e, n) {
|
|
1934
|
+
const s = In(t, e, n);
|
|
1935
|
+
for (const r in t)
|
|
1936
|
+
if (O(t[r]) || O(e[r])) {
|
|
1937
|
+
const i = le.indexOf(r) !== -1 ? "attr" + r.charAt(0).toUpperCase() + r.substring(1) : r;
|
|
1938
|
+
s[i] = t[r];
|
|
1950
1939
|
}
|
|
1951
1940
|
return s;
|
|
1952
1941
|
}
|
|
1953
|
-
function
|
|
1954
|
-
const e =
|
|
1942
|
+
function Kt(t) {
|
|
1943
|
+
const e = jn(null);
|
|
1955
1944
|
return e.current === null && (e.current = t()), e.current;
|
|
1956
1945
|
}
|
|
1957
|
-
const
|
|
1946
|
+
const _n = (t, e) => e && typeof t == "number" ? e.transform(t) : t, ai = {
|
|
1958
1947
|
x: "translateX",
|
|
1959
1948
|
y: "translateY",
|
|
1960
1949
|
z: "translateZ",
|
|
1961
1950
|
transformPerspective: "perspective"
|
|
1962
|
-
},
|
|
1963
|
-
function
|
|
1964
|
-
let s = "",
|
|
1965
|
-
for (let
|
|
1966
|
-
const o =
|
|
1967
|
-
if (
|
|
1951
|
+
}, li = le.length;
|
|
1952
|
+
function ui(t, e, n) {
|
|
1953
|
+
let s = "", r = !0;
|
|
1954
|
+
for (let i = 0; i < li; i++) {
|
|
1955
|
+
const o = le[i], a = t[o];
|
|
1956
|
+
if (a === void 0)
|
|
1968
1957
|
continue;
|
|
1969
|
-
let
|
|
1970
|
-
if (typeof
|
|
1971
|
-
const u =
|
|
1972
|
-
if (!
|
|
1973
|
-
|
|
1974
|
-
const c =
|
|
1958
|
+
let l = !0;
|
|
1959
|
+
if (typeof a == "number" ? l = a === (o.startsWith("scale") ? 1 : 0) : l = parseFloat(a) === 0, !l || n) {
|
|
1960
|
+
const u = _n(a, He[o]);
|
|
1961
|
+
if (!l) {
|
|
1962
|
+
r = !1;
|
|
1963
|
+
const c = ai[o] || o;
|
|
1975
1964
|
s += `${c}(${u}) `;
|
|
1976
1965
|
}
|
|
1977
1966
|
n && (e[o] = u);
|
|
1978
1967
|
}
|
|
1979
1968
|
}
|
|
1980
|
-
return s = s.trim(), n ? s = n(e,
|
|
1969
|
+
return s = s.trim(), n ? s = n(e, r ? "" : s) : r && (s = "none"), s;
|
|
1981
1970
|
}
|
|
1982
|
-
function
|
|
1983
|
-
const { style: s, vars:
|
|
1984
|
-
let o = !1,
|
|
1985
|
-
for (const
|
|
1986
|
-
const u = e[
|
|
1987
|
-
if (
|
|
1971
|
+
function Kn(t, e, n) {
|
|
1972
|
+
const { style: s, vars: r, transformOrigin: i } = t;
|
|
1973
|
+
let o = !1, a = !1;
|
|
1974
|
+
for (const l in e) {
|
|
1975
|
+
const u = e[l];
|
|
1976
|
+
if (G.has(l)) {
|
|
1988
1977
|
o = !0;
|
|
1989
1978
|
continue;
|
|
1990
|
-
} else if (
|
|
1991
|
-
|
|
1979
|
+
} else if (tn(l)) {
|
|
1980
|
+
r[l] = u;
|
|
1992
1981
|
continue;
|
|
1993
1982
|
} else {
|
|
1994
|
-
const c =
|
|
1995
|
-
|
|
1983
|
+
const c = _n(u, He[l]);
|
|
1984
|
+
l.startsWith("origin") ? (a = !0, i[l] = c) : s[l] = c;
|
|
1996
1985
|
}
|
|
1997
1986
|
}
|
|
1998
|
-
if (e.transform || (o || n ? s.transform =
|
|
1999
|
-
const { originX:
|
|
2000
|
-
s.transformOrigin = `${
|
|
1987
|
+
if (e.transform || (o || n ? s.transform = ui(e, t.transform, n) : s.transform && (s.transform = "none")), a) {
|
|
1988
|
+
const { originX: l = "50%", originY: u = "50%", originZ: c = 0 } = i;
|
|
1989
|
+
s.transformOrigin = `${l} ${u} ${c}`;
|
|
2001
1990
|
}
|
|
2002
1991
|
}
|
|
2003
|
-
function
|
|
2004
|
-
return typeof t == "string" ? t :
|
|
1992
|
+
function Bt(t, e, n) {
|
|
1993
|
+
return typeof t == "string" ? t : d.transform(e + n * t);
|
|
2005
1994
|
}
|
|
2006
|
-
function
|
|
2007
|
-
const s =
|
|
2008
|
-
return `${s} ${
|
|
1995
|
+
function ci(t, e, n) {
|
|
1996
|
+
const s = Bt(e, t.x, t.width), r = Bt(n, t.y, t.height);
|
|
1997
|
+
return `${s} ${r}`;
|
|
2009
1998
|
}
|
|
2010
|
-
const
|
|
1999
|
+
const fi = {
|
|
2011
2000
|
offset: "stroke-dashoffset",
|
|
2012
2001
|
array: "stroke-dasharray"
|
|
2013
|
-
},
|
|
2002
|
+
}, hi = {
|
|
2014
2003
|
offset: "strokeDashoffset",
|
|
2015
2004
|
array: "strokeDasharray"
|
|
2016
2005
|
};
|
|
2017
|
-
function
|
|
2006
|
+
function di(t, e, n = 1, s = 0, r = !0) {
|
|
2018
2007
|
t.pathLength = 1;
|
|
2019
|
-
const
|
|
2020
|
-
t[
|
|
2021
|
-
const o =
|
|
2022
|
-
t[
|
|
2008
|
+
const i = r ? fi : hi;
|
|
2009
|
+
t[i.offset] = d.transform(-s);
|
|
2010
|
+
const o = d.transform(e), a = d.transform(n);
|
|
2011
|
+
t[i.array] = `${o} ${a}`;
|
|
2023
2012
|
}
|
|
2024
|
-
function
|
|
2013
|
+
function pi(t, {
|
|
2025
2014
|
attrX: e,
|
|
2026
2015
|
attrY: n,
|
|
2027
2016
|
attrScale: s,
|
|
2028
|
-
originX:
|
|
2029
|
-
originY:
|
|
2017
|
+
originX: r,
|
|
2018
|
+
originY: i,
|
|
2030
2019
|
pathLength: o,
|
|
2031
|
-
pathSpacing:
|
|
2032
|
-
pathOffset:
|
|
2020
|
+
pathSpacing: a = 1,
|
|
2021
|
+
pathOffset: l = 0,
|
|
2033
2022
|
// This is object creation, which we try to avoid per-frame.
|
|
2034
2023
|
...u
|
|
2035
|
-
}, c,
|
|
2036
|
-
if (
|
|
2024
|
+
}, c, f) {
|
|
2025
|
+
if (Kn(t, u, f), c) {
|
|
2037
2026
|
t.style.viewBox && (t.attrs.viewBox = t.style.viewBox);
|
|
2038
2027
|
return;
|
|
2039
2028
|
}
|
|
2040
2029
|
t.attrs = t.style, t.style = {};
|
|
2041
|
-
const { attrs:
|
|
2042
|
-
|
|
2030
|
+
const { attrs: h, style: g, dimensions: p } = t;
|
|
2031
|
+
h.transform && (p && (g.transform = h.transform), delete h.transform), p && (r !== void 0 || i !== void 0 || g.transform) && (g.transformOrigin = ci(p, r !== void 0 ? r : 0.5, i !== void 0 ? i : 0.5)), e !== void 0 && (h.x = e), n !== void 0 && (h.y = n), s !== void 0 && (h.scale = s), o !== void 0 && di(h, o, a, l, !1);
|
|
2043
2032
|
}
|
|
2044
|
-
const
|
|
2045
|
-
function
|
|
2046
|
-
if (
|
|
2033
|
+
const mi = (t) => typeof t == "string" && t.toLowerCase() === "svg", $e = { current: null }, Bn = { current: !1 };
|
|
2034
|
+
function gi() {
|
|
2035
|
+
if (Bn.current = !0, !!ni)
|
|
2047
2036
|
if (window.matchMedia) {
|
|
2048
|
-
const t = window.matchMedia("(prefers-reduced-motion)"), e = () =>
|
|
2037
|
+
const t = window.matchMedia("(prefers-reduced-motion)"), e = () => $e.current = t.matches;
|
|
2049
2038
|
t.addListener(e), e();
|
|
2050
2039
|
} else
|
|
2051
|
-
|
|
2040
|
+
$e.current = !1;
|
|
2052
2041
|
}
|
|
2053
|
-
function
|
|
2042
|
+
function yi(t, e, n) {
|
|
2054
2043
|
for (const s in e) {
|
|
2055
|
-
const
|
|
2056
|
-
if (
|
|
2057
|
-
t.addValue(s,
|
|
2058
|
-
else if (
|
|
2059
|
-
t.addValue(s,
|
|
2060
|
-
else if (
|
|
2044
|
+
const r = e[s], i = n[s];
|
|
2045
|
+
if (O(r))
|
|
2046
|
+
t.addValue(s, r), process.env.NODE_ENV === "development" && We(r.version === "11.11.9", `Attempting to mix Framer Motion versions ${r.version} with 11.11.9 may not work as expected.`);
|
|
2047
|
+
else if (O(i))
|
|
2048
|
+
t.addValue(s, ae(r, { owner: t }));
|
|
2049
|
+
else if (i !== r)
|
|
2061
2050
|
if (t.hasValue(s)) {
|
|
2062
2051
|
const o = t.getValue(s);
|
|
2063
|
-
o.liveStyle === !0 ? o.jump(
|
|
2052
|
+
o.liveStyle === !0 ? o.jump(r) : o.hasAnimated || o.set(r);
|
|
2064
2053
|
} else {
|
|
2065
2054
|
const o = t.getStaticValue(s);
|
|
2066
|
-
t.addValue(s,
|
|
2055
|
+
t.addValue(s, ae(o !== void 0 ? o : r, { owner: t }));
|
|
2067
2056
|
}
|
|
2068
2057
|
}
|
|
2069
2058
|
for (const s in n)
|
|
2070
2059
|
e[s] === void 0 && t.removeValue(s);
|
|
2071
2060
|
return e;
|
|
2072
2061
|
}
|
|
2073
|
-
const
|
|
2062
|
+
const X = /* @__PURE__ */ new WeakMap(), vi = [...rn, C, Q], bi = (t) => vi.find(sn(t)), kt = [
|
|
2074
2063
|
"AnimationStart",
|
|
2075
2064
|
"AnimationComplete",
|
|
2076
2065
|
"Update",
|
|
@@ -2078,8 +2067,8 @@ const re = /* @__PURE__ */ new WeakMap(), lr = [...qt, C, X], ur = (t) => lr.fin
|
|
|
2078
2067
|
"LayoutMeasure",
|
|
2079
2068
|
"LayoutAnimationStart",
|
|
2080
2069
|
"LayoutAnimationComplete"
|
|
2081
|
-
]
|
|
2082
|
-
class
|
|
2070
|
+
];
|
|
2071
|
+
class kn {
|
|
2083
2072
|
/**
|
|
2084
2073
|
* This method takes React props and returns found MotionValues. For example, HTML
|
|
2085
2074
|
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
@@ -2090,25 +2079,26 @@ class hr {
|
|
|
2090
2079
|
scrapeMotionValuesFromProps(e, n, s) {
|
|
2091
2080
|
return {};
|
|
2092
2081
|
}
|
|
2093
|
-
constructor({ parent: e, props: n, presenceContext: s, reducedMotionConfig:
|
|
2094
|
-
this.applyWillChange = !1, this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver =
|
|
2095
|
-
this.
|
|
2096
|
-
}, this.
|
|
2097
|
-
|
|
2082
|
+
constructor({ parent: e, props: n, presenceContext: s, reducedMotionConfig: r, blockInitialAnimation: i, visualState: o }, a = {}) {
|
|
2083
|
+
this.applyWillChange = !1, this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = ze, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
2084
|
+
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
2085
|
+
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
2086
|
+
const h = k.now();
|
|
2087
|
+
this.renderScheduledAt < h && (this.renderScheduledAt = h, _.render(this.render, !1, !0));
|
|
2098
2088
|
};
|
|
2099
|
-
const { latestValues:
|
|
2100
|
-
this.latestValues =
|
|
2101
|
-
const { willChange: c, ...
|
|
2102
|
-
for (const
|
|
2103
|
-
const
|
|
2104
|
-
|
|
2089
|
+
const { latestValues: l, renderState: u } = o;
|
|
2090
|
+
this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = u, this.parent = e, this.props = n, this.presenceContext = s, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = r, this.options = a, this.blockInitialAnimation = !!i, this.isControllingVariants = Dn(n), this.isVariantNode = si(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
2091
|
+
const { willChange: c, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
2092
|
+
for (const h in f) {
|
|
2093
|
+
const g = f[h];
|
|
2094
|
+
l[h] !== void 0 && O(g) && g.set(l[h], !1);
|
|
2105
2095
|
}
|
|
2106
2096
|
}
|
|
2107
2097
|
mount(e) {
|
|
2108
|
-
this.current = e,
|
|
2098
|
+
this.current = e, X.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)), Bn.current || gi(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : $e.current, process.env.NODE_ENV !== "production" && We(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
2109
2099
|
}
|
|
2110
2100
|
unmount() {
|
|
2111
|
-
|
|
2101
|
+
X.delete(this.current), this.projection && this.projection.unmount(), Re(this.notifyUpdate), Re(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
|
|
2112
2102
|
for (const e in this.events)
|
|
2113
2103
|
this.events[e].clear();
|
|
2114
2104
|
for (const e in this.features) {
|
|
@@ -2119,12 +2109,12 @@ class hr {
|
|
|
2119
2109
|
}
|
|
2120
2110
|
bindToMotionValue(e, n) {
|
|
2121
2111
|
this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)();
|
|
2122
|
-
const s =
|
|
2123
|
-
this.latestValues[e] =
|
|
2124
|
-
}),
|
|
2112
|
+
const s = G.has(e), r = n.on("change", (a) => {
|
|
2113
|
+
this.latestValues[e] = a, this.props.onUpdate && _.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0);
|
|
2114
|
+
}), i = n.on("renderRequest", this.scheduleRender);
|
|
2125
2115
|
let o;
|
|
2126
2116
|
window.MotionCheckAppearSync && (o = window.MotionCheckAppearSync(this, e, n)), this.valueSubscriptions.set(e, () => {
|
|
2127
|
-
|
|
2117
|
+
r(), i(), o && o(), n.owner && n.stop();
|
|
2128
2118
|
});
|
|
2129
2119
|
}
|
|
2130
2120
|
sortNodePosition(e) {
|
|
@@ -2132,14 +2122,14 @@ class hr {
|
|
|
2132
2122
|
}
|
|
2133
2123
|
updateFeatures() {
|
|
2134
2124
|
let e = "animation";
|
|
2135
|
-
for (e in
|
|
2136
|
-
const n =
|
|
2125
|
+
for (e in Le) {
|
|
2126
|
+
const n = Le[e];
|
|
2137
2127
|
if (!n)
|
|
2138
2128
|
continue;
|
|
2139
|
-
const { isEnabled: s, Feature:
|
|
2140
|
-
if (!this.features[e] &&
|
|
2141
|
-
const
|
|
2142
|
-
|
|
2129
|
+
const { isEnabled: s, Feature: r } = n;
|
|
2130
|
+
if (!this.features[e] && r && s(this.props) && (this.features[e] = new r(this)), this.features[e]) {
|
|
2131
|
+
const i = this.features[e];
|
|
2132
|
+
i.isMounted ? i.update() : (i.mount(), i.isMounted = !0);
|
|
2143
2133
|
}
|
|
2144
2134
|
}
|
|
2145
2135
|
}
|
|
@@ -2152,7 +2142,7 @@ class hr {
|
|
|
2152
2142
|
* removed with a re-render to work.
|
|
2153
2143
|
*/
|
|
2154
2144
|
measureViewportBox() {
|
|
2155
|
-
return this.current ? this.measureInstanceViewportBox(this.current, this.props) :
|
|
2145
|
+
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : rt();
|
|
2156
2146
|
}
|
|
2157
2147
|
getStaticValue(e) {
|
|
2158
2148
|
return this.latestValues[e];
|
|
@@ -2166,13 +2156,13 @@ class hr {
|
|
|
2166
2156
|
*/
|
|
2167
2157
|
update(e, n) {
|
|
2168
2158
|
(e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
|
|
2169
|
-
for (let s = 0; s <
|
|
2170
|
-
const
|
|
2171
|
-
this.propEventSubscriptions[
|
|
2172
|
-
const
|
|
2173
|
-
o && (this.propEventSubscriptions[
|
|
2159
|
+
for (let s = 0; s < kt.length; s++) {
|
|
2160
|
+
const r = kt[s];
|
|
2161
|
+
this.propEventSubscriptions[r] && (this.propEventSubscriptions[r](), delete this.propEventSubscriptions[r]);
|
|
2162
|
+
const i = "on" + r, o = e[i];
|
|
2163
|
+
o && (this.propEventSubscriptions[r] = this.on(r, o));
|
|
2174
2164
|
}
|
|
2175
|
-
this.prevMotionValues =
|
|
2165
|
+
this.prevMotionValues = yi(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
2176
2166
|
}
|
|
2177
2167
|
getProps() {
|
|
2178
2168
|
return this.props;
|
|
@@ -2195,20 +2185,6 @@ class hr {
|
|
|
2195
2185
|
getClosestVariantNode() {
|
|
2196
2186
|
return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
|
|
2197
2187
|
}
|
|
2198
|
-
getVariantContext(e = !1) {
|
|
2199
|
-
if (e)
|
|
2200
|
-
return this.parent ? this.parent.getVariantContext() : void 0;
|
|
2201
|
-
if (!this.isControllingVariants) {
|
|
2202
|
-
const s = this.parent ? this.parent.getVariantContext() || {} : {};
|
|
2203
|
-
return this.props.initial !== void 0 && (s.initial = this.props.initial), s;
|
|
2204
|
-
}
|
|
2205
|
-
const n = {};
|
|
2206
|
-
for (let s = 0; s < cr; s++) {
|
|
2207
|
-
const i = We[s], r = this.props[i];
|
|
2208
|
-
(Bt(r) || r === !1) && (n[i] = r);
|
|
2209
|
-
}
|
|
2210
|
-
return n;
|
|
2211
|
-
}
|
|
2212
2188
|
/**
|
|
2213
2189
|
* Add a child visual element to our set of children.
|
|
2214
2190
|
*/
|
|
@@ -2242,7 +2218,7 @@ class hr {
|
|
|
2242
2218
|
if (this.props.values && this.props.values[e])
|
|
2243
2219
|
return this.props.values[e];
|
|
2244
2220
|
let s = this.values.get(e);
|
|
2245
|
-
return s === void 0 && n !== void 0 && (s =
|
|
2221
|
+
return s === void 0 && n !== void 0 && (s = ae(n === null ? void 0 : n, { owner: this }), this.addValue(e, s)), s;
|
|
2246
2222
|
}
|
|
2247
2223
|
/**
|
|
2248
2224
|
* If we're trying to animate to a previously unencountered value,
|
|
@@ -2251,8 +2227,8 @@ class hr {
|
|
|
2251
2227
|
*/
|
|
2252
2228
|
readValue(e, n) {
|
|
2253
2229
|
var s;
|
|
2254
|
-
let
|
|
2255
|
-
return
|
|
2230
|
+
let r = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : (s = this.getBaseTargetFromProps(this.props, e)) !== null && s !== void 0 ? s : this.readValueFromInstance(this.current, e, this.options);
|
|
2231
|
+
return r != null && (typeof r == "string" && (Jt(r) || Qt(r)) ? r = parseFloat(r) : !bi(r) && Q.test(n) && (r = dn(e, n)), this.setBaseTarget(e, O(r) ? r.get() : r)), O(r) ? r.get() : r;
|
|
2256
2232
|
}
|
|
2257
2233
|
/**
|
|
2258
2234
|
* Set the base target to later animate back to. This is currently
|
|
@@ -2268,26 +2244,26 @@ class hr {
|
|
|
2268
2244
|
getBaseTarget(e) {
|
|
2269
2245
|
var n;
|
|
2270
2246
|
const { initial: s } = this.props;
|
|
2271
|
-
let
|
|
2247
|
+
let r;
|
|
2272
2248
|
if (typeof s == "string" || typeof s == "object") {
|
|
2273
|
-
const o =
|
|
2274
|
-
o && (
|
|
2249
|
+
const o = Ut(this.props, s, (n = this.presenceContext) === null || n === void 0 ? void 0 : n.custom);
|
|
2250
|
+
o && (r = o[e]);
|
|
2275
2251
|
}
|
|
2276
|
-
if (s &&
|
|
2277
|
-
return
|
|
2278
|
-
const
|
|
2279
|
-
return
|
|
2252
|
+
if (s && r !== void 0)
|
|
2253
|
+
return r;
|
|
2254
|
+
const i = this.getBaseTargetFromProps(this.props, e);
|
|
2255
|
+
return i !== void 0 && !O(i) ? i : this.initialValues[e] !== void 0 && r === void 0 ? void 0 : this.baseTarget[e];
|
|
2280
2256
|
}
|
|
2281
2257
|
on(e, n) {
|
|
2282
|
-
return this.events[e] || (this.events[e] = new
|
|
2258
|
+
return this.events[e] || (this.events[e] = new Rn()), this.events[e].add(n);
|
|
2283
2259
|
}
|
|
2284
2260
|
notify(e, ...n) {
|
|
2285
2261
|
this.events[e] && this.events[e].notify(...n);
|
|
2286
2262
|
}
|
|
2287
2263
|
}
|
|
2288
|
-
class
|
|
2264
|
+
class Ln extends kn {
|
|
2289
2265
|
constructor() {
|
|
2290
|
-
super(...arguments), this.KeyframeResolver =
|
|
2266
|
+
super(...arguments), this.KeyframeResolver = pn;
|
|
2291
2267
|
}
|
|
2292
2268
|
sortInstanceNodePosition(e, n) {
|
|
2293
2269
|
return e.compareDocumentPosition(n) & 2 ? 1 : -1;
|
|
@@ -2299,315 +2275,373 @@ class In extends hr {
|
|
|
2299
2275
|
delete n[e], delete s[e];
|
|
2300
2276
|
}
|
|
2301
2277
|
}
|
|
2302
|
-
function
|
|
2278
|
+
function Ti(t) {
|
|
2303
2279
|
return window.getComputedStyle(t);
|
|
2304
2280
|
}
|
|
2305
|
-
class
|
|
2281
|
+
class Vi extends Ln {
|
|
2306
2282
|
constructor() {
|
|
2307
|
-
super(...arguments), this.type = "html", this.applyWillChange = !0, this.renderInstance =
|
|
2283
|
+
super(...arguments), this.type = "html", this.applyWillChange = !0, this.renderInstance = En;
|
|
2308
2284
|
}
|
|
2309
2285
|
readValueFromInstance(e, n) {
|
|
2310
|
-
if (
|
|
2311
|
-
const s =
|
|
2286
|
+
if (G.has(n)) {
|
|
2287
|
+
const s = Xe(n);
|
|
2312
2288
|
return s && s.default || 0;
|
|
2313
2289
|
} else {
|
|
2314
|
-
const s =
|
|
2315
|
-
return typeof
|
|
2290
|
+
const s = Ti(e), r = (tn(n) ? s.getPropertyValue(n) : s[n]) || 0;
|
|
2291
|
+
return typeof r == "string" ? r.trim() : r;
|
|
2316
2292
|
}
|
|
2317
2293
|
}
|
|
2318
2294
|
measureInstanceViewportBox(e, { transformPagePoint: n }) {
|
|
2319
|
-
return
|
|
2295
|
+
return Qr(e, n);
|
|
2320
2296
|
}
|
|
2321
2297
|
build(e, n, s) {
|
|
2322
|
-
|
|
2298
|
+
Kn(e, n, s.transformTemplate);
|
|
2323
2299
|
}
|
|
2324
2300
|
scrapeMotionValuesFromProps(e, n, s) {
|
|
2325
|
-
return
|
|
2301
|
+
return In(e, n, s);
|
|
2326
2302
|
}
|
|
2327
2303
|
handleChildMotionValue() {
|
|
2328
2304
|
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
2329
2305
|
const { children: e } = this.props;
|
|
2330
|
-
|
|
2306
|
+
O(e) && (this.childSubscription = e.on("change", (n) => {
|
|
2331
2307
|
this.current && (this.current.textContent = `${n}`);
|
|
2332
2308
|
}));
|
|
2333
2309
|
}
|
|
2334
2310
|
}
|
|
2335
|
-
class
|
|
2311
|
+
class wi extends Ln {
|
|
2336
2312
|
constructor() {
|
|
2337
|
-
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox =
|
|
2313
|
+
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = rt;
|
|
2338
2314
|
}
|
|
2339
2315
|
getBaseTargetFromProps(e, n) {
|
|
2340
2316
|
return e[n];
|
|
2341
2317
|
}
|
|
2342
2318
|
readValueFromInstance(e, n) {
|
|
2343
|
-
if (
|
|
2344
|
-
const s =
|
|
2319
|
+
if (G.has(n)) {
|
|
2320
|
+
const s = Xe(n);
|
|
2345
2321
|
return s && s.default || 0;
|
|
2346
2322
|
}
|
|
2347
|
-
return n =
|
|
2323
|
+
return n = Nn.has(n) ? n : st(n), e.getAttribute(n);
|
|
2348
2324
|
}
|
|
2349
2325
|
scrapeMotionValuesFromProps(e, n, s) {
|
|
2350
|
-
return
|
|
2326
|
+
return oi(e, n, s);
|
|
2351
2327
|
}
|
|
2352
2328
|
build(e, n, s) {
|
|
2353
|
-
|
|
2329
|
+
pi(e, n, this.isSVGTag, s.transformTemplate);
|
|
2354
2330
|
}
|
|
2355
|
-
renderInstance(e, n, s,
|
|
2356
|
-
|
|
2331
|
+
renderInstance(e, n, s, r) {
|
|
2332
|
+
ri(e, n, s, r);
|
|
2357
2333
|
}
|
|
2358
2334
|
mount(e) {
|
|
2359
|
-
this.isSVGTag =
|
|
2335
|
+
this.isSVGTag = mi(e.tagName), super.mount(e);
|
|
2360
2336
|
}
|
|
2361
2337
|
}
|
|
2362
|
-
function
|
|
2338
|
+
function Si(t, e, n) {
|
|
2363
2339
|
var s;
|
|
2364
2340
|
if (typeof t == "string") {
|
|
2365
|
-
let
|
|
2366
|
-
e && (
|
|
2341
|
+
let r = document;
|
|
2342
|
+
e && ($(!!e.current, "Scope provided, but no element detected."), r = e.current), n ? ((s = n[t]) !== null && s !== void 0 || (n[t] = r.querySelectorAll(t)), t = n[t]) : t = r.querySelectorAll(t);
|
|
2367
2343
|
} else t instanceof Element && (t = [t]);
|
|
2368
2344
|
return Array.from(t || []);
|
|
2369
2345
|
}
|
|
2370
|
-
function
|
|
2371
|
-
return
|
|
2372
|
-
}
|
|
2373
|
-
function gr(t) {
|
|
2374
|
-
return typeof t == "object" && !Array.isArray(t);
|
|
2375
|
-
}
|
|
2376
|
-
function yr(t) {
|
|
2377
|
-
const e = {
|
|
2378
|
-
presenceContext: null,
|
|
2379
|
-
props: {},
|
|
2380
|
-
visualState: {
|
|
2381
|
-
renderState: {
|
|
2382
|
-
transform: {},
|
|
2383
|
-
transformOrigin: {},
|
|
2384
|
-
style: {},
|
|
2385
|
-
vars: {},
|
|
2386
|
-
attrs: {}
|
|
2387
|
-
},
|
|
2388
|
-
latestValues: {}
|
|
2389
|
-
}
|
|
2390
|
-
}, n = Gi(t) ? new pr(e) : new dr(e);
|
|
2391
|
-
n.mount(t), re.set(t, n);
|
|
2346
|
+
function xi(t) {
|
|
2347
|
+
return ge(() => () => t(), []);
|
|
2392
2348
|
}
|
|
2393
|
-
function
|
|
2394
|
-
const
|
|
2349
|
+
function Ai(t, e = 100, n) {
|
|
2350
|
+
const s = n({ ...t, keyframes: [0, e] }), r = Math.min(xn(s), Be);
|
|
2395
2351
|
return {
|
|
2396
2352
|
type: "keyframes",
|
|
2397
|
-
ease: (i) =>
|
|
2398
|
-
duration: I(
|
|
2353
|
+
ease: (i) => s.next(r * i).value / e,
|
|
2354
|
+
duration: I(r)
|
|
2399
2355
|
};
|
|
2400
2356
|
}
|
|
2401
|
-
function
|
|
2402
|
-
|
|
2403
|
-
|
|
2357
|
+
function it(t) {
|
|
2358
|
+
return typeof t == "object" && !Array.isArray(t);
|
|
2359
|
+
}
|
|
2360
|
+
function $n(t, e, n, s) {
|
|
2361
|
+
return typeof t == "string" && it(e) ? Si(t, n, s) : t instanceof NodeList ? Array.from(t) : Array.isArray(t) ? t : [t];
|
|
2362
|
+
}
|
|
2363
|
+
function Lt(t, e, n, s) {
|
|
2364
|
+
var r;
|
|
2365
|
+
return typeof e == "number" ? e : e.startsWith("-") || e.startsWith("+") ? Math.max(0, t + parseFloat(e)) : e === "<" ? n : (r = s.get(e)) !== null && r !== void 0 ? r : t;
|
|
2404
2366
|
}
|
|
2405
|
-
const
|
|
2367
|
+
const Mi = (t, e, n) => {
|
|
2406
2368
|
const s = e - t;
|
|
2407
2369
|
return ((n - t) % s + s) % s + t;
|
|
2408
2370
|
};
|
|
2409
|
-
function
|
|
2410
|
-
return
|
|
2371
|
+
function Ci(t, e) {
|
|
2372
|
+
return bn(t) ? t[Mi(0, t.length, e)] : t;
|
|
2411
2373
|
}
|
|
2412
|
-
function
|
|
2374
|
+
function Fi(t, e, n) {
|
|
2413
2375
|
for (let s = 0; s < t.length; s++) {
|
|
2414
|
-
const
|
|
2415
|
-
|
|
2376
|
+
const r = t[s];
|
|
2377
|
+
r.at > e && r.at < n && (On(t, r), s--);
|
|
2416
2378
|
}
|
|
2417
2379
|
}
|
|
2418
|
-
function
|
|
2419
|
-
|
|
2380
|
+
function Pi(t, e, n, s, r, i) {
|
|
2381
|
+
Fi(t, r, i);
|
|
2420
2382
|
for (let o = 0; o < e.length; o++)
|
|
2421
2383
|
t.push({
|
|
2422
2384
|
value: e[o],
|
|
2423
|
-
at: he(
|
|
2424
|
-
easing:
|
|
2385
|
+
at: he(r, i, s[o]),
|
|
2386
|
+
easing: Ci(n, o)
|
|
2425
2387
|
});
|
|
2426
2388
|
}
|
|
2427
|
-
function
|
|
2389
|
+
function Oi(t, e) {
|
|
2428
2390
|
return t.at === e.at ? t.value === null ? 1 : e.value === null ? -1 : 0 : t.at - e.at;
|
|
2429
2391
|
}
|
|
2430
|
-
const
|
|
2431
|
-
function
|
|
2432
|
-
const i = e.duration || 0.3,
|
|
2433
|
-
let
|
|
2434
|
-
for (let
|
|
2435
|
-
const
|
|
2436
|
-
if (typeof
|
|
2437
|
-
|
|
2392
|
+
const Ri = "easeInOut";
|
|
2393
|
+
function Di(t, { defaultTransition: e = {}, ...n } = {}, s, r) {
|
|
2394
|
+
const i = e.duration || 0.3, o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = {}, u = /* @__PURE__ */ new Map();
|
|
2395
|
+
let c = 0, f = 0, h = 0;
|
|
2396
|
+
for (let g = 0; g < t.length; g++) {
|
|
2397
|
+
const p = t[g];
|
|
2398
|
+
if (typeof p == "string") {
|
|
2399
|
+
u.set(p, f);
|
|
2438
2400
|
continue;
|
|
2439
|
-
} else if (!Array.isArray(
|
|
2440
|
-
|
|
2401
|
+
} else if (!Array.isArray(p)) {
|
|
2402
|
+
u.set(p.name, Lt(f, p.at, c, u));
|
|
2441
2403
|
continue;
|
|
2442
2404
|
}
|
|
2443
|
-
let [
|
|
2444
|
-
|
|
2445
|
-
let
|
|
2446
|
-
const S = (
|
|
2447
|
-
const
|
|
2448
|
-
let { ease:
|
|
2449
|
-
const
|
|
2450
|
-
if (
|
|
2451
|
-
let
|
|
2452
|
-
if (
|
|
2453
|
-
const
|
|
2454
|
-
|
|
2405
|
+
let [b, T, m = {}] = p;
|
|
2406
|
+
m.at !== void 0 && (f = Lt(f, m.at, c, u));
|
|
2407
|
+
let y = 0;
|
|
2408
|
+
const S = (w, v, x, F = 0, V = 0) => {
|
|
2409
|
+
const A = Ei(w), { delay: P = 0, times: N = Sn(A), type: J = "keyframes", ...Me } = v;
|
|
2410
|
+
let { ease: ee = e.ease || "easeOut", duration: D } = v;
|
|
2411
|
+
const R = typeof P == "function" ? P(F, V) : P, de = A.length, ot = xe(J) ? J : r == null ? void 0 : r[J];
|
|
2412
|
+
if (de <= 2 && ot) {
|
|
2413
|
+
let ct = 100;
|
|
2414
|
+
if (de === 2 && _i(A)) {
|
|
2415
|
+
const Un = A[1] - A[0];
|
|
2416
|
+
ct = Math.abs(Un);
|
|
2455
2417
|
}
|
|
2456
|
-
const
|
|
2457
|
-
|
|
2458
|
-
const
|
|
2459
|
-
|
|
2418
|
+
const ft = { ...Me };
|
|
2419
|
+
D !== void 0 && (ft.duration = E(D));
|
|
2420
|
+
const ht = Ai(ft, ct, ot);
|
|
2421
|
+
ee = ht.ease, D = ht.duration;
|
|
2460
2422
|
}
|
|
2461
|
-
|
|
2462
|
-
const
|
|
2463
|
-
|
|
2464
|
-
const
|
|
2465
|
-
|
|
2423
|
+
D ?? (D = i);
|
|
2424
|
+
const at = f + R, lt = at + D;
|
|
2425
|
+
N.length === 1 && N[0] === 0 && (N[1] = 1);
|
|
2426
|
+
const ut = N.length - A.length;
|
|
2427
|
+
ut > 0 && wn(N, ut), A.length === 1 && A.unshift(null), Pi(x, A, ee, N, at, lt), y = Math.max(R + D, y), h = Math.max(lt, h);
|
|
2466
2428
|
};
|
|
2467
|
-
if (
|
|
2468
|
-
const
|
|
2469
|
-
S(
|
|
2429
|
+
if (O(b)) {
|
|
2430
|
+
const w = $t(b, a);
|
|
2431
|
+
S(T, m, Wt("default", w));
|
|
2470
2432
|
} else {
|
|
2471
|
-
const
|
|
2472
|
-
for (let
|
|
2473
|
-
|
|
2474
|
-
const
|
|
2475
|
-
for (const
|
|
2476
|
-
S(
|
|
2433
|
+
const w = $n(b, T, s, l), v = w.length;
|
|
2434
|
+
for (let x = 0; x < v; x++) {
|
|
2435
|
+
T = T, m = m;
|
|
2436
|
+
const F = w[x], V = $t(F, a);
|
|
2437
|
+
for (const A in T)
|
|
2438
|
+
S(T[A], Ni(m, A), Wt(A, V), x, v);
|
|
2477
2439
|
}
|
|
2478
2440
|
}
|
|
2479
|
-
|
|
2480
|
-
}
|
|
2481
|
-
return
|
|
2482
|
-
for (const
|
|
2483
|
-
const
|
|
2484
|
-
|
|
2485
|
-
const
|
|
2486
|
-
for (let
|
|
2487
|
-
const { at:
|
|
2488
|
-
|
|
2441
|
+
c = f, f += y;
|
|
2442
|
+
}
|
|
2443
|
+
return a.forEach((g, p) => {
|
|
2444
|
+
for (const b in g) {
|
|
2445
|
+
const T = g[b];
|
|
2446
|
+
T.sort(Oi);
|
|
2447
|
+
const m = [], y = [], S = [];
|
|
2448
|
+
for (let v = 0; v < T.length; v++) {
|
|
2449
|
+
const { at: x, value: F, easing: V } = T[v];
|
|
2450
|
+
m.push(F), y.push(Ae(0, h, x)), S.push(V || "easeOut");
|
|
2489
2451
|
}
|
|
2490
|
-
|
|
2452
|
+
y[0] !== 0 && (y.unshift(0), m.unshift(m[0]), S.unshift(Ri)), y[y.length - 1] !== 1 && (y.push(1), m.push(null)), o.has(p) || o.set(p, {
|
|
2491
2453
|
keyframes: {},
|
|
2492
2454
|
transition: {}
|
|
2493
2455
|
});
|
|
2494
|
-
const
|
|
2495
|
-
|
|
2456
|
+
const w = o.get(p);
|
|
2457
|
+
w.keyframes[b] = m, w.transition[b] = {
|
|
2496
2458
|
...e,
|
|
2497
2459
|
duration: h,
|
|
2498
2460
|
ease: S,
|
|
2499
|
-
times:
|
|
2461
|
+
times: y,
|
|
2500
2462
|
...n
|
|
2501
2463
|
};
|
|
2502
2464
|
}
|
|
2503
|
-
}),
|
|
2465
|
+
}), o;
|
|
2504
2466
|
}
|
|
2505
|
-
function
|
|
2467
|
+
function $t(t, e) {
|
|
2506
2468
|
return !e.has(t) && e.set(t, {}), e.get(t);
|
|
2507
2469
|
}
|
|
2508
|
-
function
|
|
2470
|
+
function Wt(t, e) {
|
|
2509
2471
|
return e[t] || (e[t] = []), e[t];
|
|
2510
2472
|
}
|
|
2511
|
-
function
|
|
2473
|
+
function Ei(t) {
|
|
2512
2474
|
return Array.isArray(t) ? t : [t];
|
|
2513
2475
|
}
|
|
2514
|
-
function
|
|
2515
|
-
return t[e] ? {
|
|
2476
|
+
function Ni(t, e) {
|
|
2477
|
+
return t && t[e] ? {
|
|
2516
2478
|
...t,
|
|
2517
2479
|
...t[e]
|
|
2518
2480
|
} : { ...t };
|
|
2519
2481
|
}
|
|
2520
|
-
const
|
|
2521
|
-
function
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2482
|
+
const Ii = (t) => typeof t == "number", _i = (t) => t.every(Ii);
|
|
2483
|
+
function Ki(t, e) {
|
|
2484
|
+
return t in e;
|
|
2485
|
+
}
|
|
2486
|
+
class Bi extends kn {
|
|
2487
|
+
constructor() {
|
|
2488
|
+
super(...arguments), this.type = "object";
|
|
2489
|
+
}
|
|
2490
|
+
readValueFromInstance(e, n) {
|
|
2491
|
+
if (Ki(n, e)) {
|
|
2492
|
+
const s = e[n];
|
|
2493
|
+
if (typeof s == "string" || typeof s == "number")
|
|
2494
|
+
return s;
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
getBaseTargetFromProps() {
|
|
2498
|
+
}
|
|
2499
|
+
removeValueFromRenderState(e, n) {
|
|
2500
|
+
delete n.output[e];
|
|
2501
|
+
}
|
|
2502
|
+
measureInstanceViewportBox() {
|
|
2503
|
+
return rt();
|
|
2504
|
+
}
|
|
2505
|
+
build(e, n) {
|
|
2506
|
+
Object.assign(e.output, n);
|
|
2507
|
+
}
|
|
2508
|
+
renderInstance(e, { output: n }) {
|
|
2509
|
+
Object.assign(e, n);
|
|
2510
|
+
}
|
|
2511
|
+
sortInstanceNodePosition() {
|
|
2512
|
+
return 0;
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
function ki(t) {
|
|
2516
|
+
const e = {
|
|
2517
|
+
presenceContext: null,
|
|
2518
|
+
props: {},
|
|
2519
|
+
visualState: {
|
|
2520
|
+
renderState: {
|
|
2521
|
+
transform: {},
|
|
2522
|
+
transformOrigin: {},
|
|
2523
|
+
style: {},
|
|
2524
|
+
vars: {},
|
|
2525
|
+
attrs: {}
|
|
2526
|
+
},
|
|
2527
|
+
latestValues: {}
|
|
2528
|
+
}
|
|
2529
|
+
}, n = ei(t) ? new wi(e) : new Vi(e);
|
|
2530
|
+
n.mount(t), X.set(t, n);
|
|
2531
|
+
}
|
|
2532
|
+
function Li(t) {
|
|
2533
|
+
const e = {
|
|
2534
|
+
presenceContext: null,
|
|
2535
|
+
props: {},
|
|
2536
|
+
visualState: {
|
|
2537
|
+
renderState: {
|
|
2538
|
+
output: {}
|
|
2539
|
+
},
|
|
2540
|
+
latestValues: {}
|
|
2541
|
+
}
|
|
2542
|
+
}, n = new Bi(e);
|
|
2543
|
+
n.mount(t), X.set(t, n);
|
|
2544
|
+
}
|
|
2545
|
+
function $i(t, e) {
|
|
2546
|
+
return O(t) || typeof t == "number" || typeof t == "string" && !it(e);
|
|
2547
|
+
}
|
|
2548
|
+
function Wn(t, e, n, s) {
|
|
2549
|
+
const r = [];
|
|
2550
|
+
if ($i(t, e))
|
|
2551
|
+
r.push(ti(t, it(e) && e.default || e, n && (n.default || n)));
|
|
2552
|
+
else {
|
|
2553
|
+
const i = $n(t, e, s), o = i.length;
|
|
2554
|
+
$(!!o, "No valid elements provided.");
|
|
2555
|
+
for (let a = 0; a < o; a++) {
|
|
2556
|
+
const l = i[a], u = l instanceof Element ? ki : Li;
|
|
2557
|
+
X.has(l) || u(l);
|
|
2558
|
+
const c = X.get(l), f = { ...n };
|
|
2559
|
+
"delay" in f && typeof f.delay == "function" && (f.delay = f.delay(a, o)), r.push(...Hr(c, { ...e, transition: f }, {}));
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
return r;
|
|
2563
|
+
}
|
|
2564
|
+
function Wi(t, e, n) {
|
|
2535
2565
|
const s = [];
|
|
2536
|
-
return
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
}), new nt(s);
|
|
2566
|
+
return Di(t, e, n, { spring: Ze }).forEach(({ keyframes: i, transition: o }, a) => {
|
|
2567
|
+
s.push(...Wn(a, i, o));
|
|
2568
|
+
}), s;
|
|
2540
2569
|
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2570
|
+
function Ui(t) {
|
|
2571
|
+
return Array.isArray(t) && Array.isArray(t[0]);
|
|
2572
|
+
}
|
|
2573
|
+
function ji(t) {
|
|
2574
|
+
function e(n, s, r) {
|
|
2575
|
+
let i = [];
|
|
2576
|
+
Ui(n) ? i = Wi(n, s, t) : i = Wn(n, s, r, t);
|
|
2577
|
+
const o = new Fn(i);
|
|
2578
|
+
return t && t.animations.push(o), o;
|
|
2545
2579
|
}
|
|
2546
2580
|
return e;
|
|
2547
|
-
}
|
|
2548
|
-
function
|
|
2549
|
-
const t =
|
|
2581
|
+
}
|
|
2582
|
+
function Gi() {
|
|
2583
|
+
const t = Kt(() => ({
|
|
2550
2584
|
current: null,
|
|
2551
2585
|
// Will be hydrated by React
|
|
2552
2586
|
animations: []
|
|
2553
|
-
})), e =
|
|
2554
|
-
return
|
|
2587
|
+
})), e = Kt(() => ji(t));
|
|
2588
|
+
return xi(() => {
|
|
2555
2589
|
t.animations.forEach((n) => n.stop());
|
|
2556
2590
|
}), [t, e];
|
|
2557
2591
|
}
|
|
2558
|
-
var
|
|
2559
|
-
const
|
|
2592
|
+
var zi = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t))(zi || {}), qi = /* @__PURE__ */ ((t) => (t.onwhite = "onwhite", t.onneutral = "onneutral", t.onblueberry = "onblueberry", t))(qi || {});
|
|
2593
|
+
const no = ({
|
|
2560
2594
|
checked: t = !1,
|
|
2561
2595
|
label: e,
|
|
2562
2596
|
onChange: n,
|
|
2563
2597
|
onColor: s = "onwhite",
|
|
2564
|
-
subLabel:
|
|
2565
|
-
togglePosition:
|
|
2598
|
+
subLabel: r,
|
|
2599
|
+
togglePosition: i = "left",
|
|
2566
2600
|
testId: o
|
|
2567
2601
|
}) => {
|
|
2568
|
-
const [
|
|
2569
|
-
|
|
2602
|
+
const [a, l] = pt(t), [u, c] = pt(!1), [f, h] = Gi(), g = ne(), p = ne(), b = ne(), T = ne(), m = ne(), { refObject: y, isHovered: S, isActive: w } = zn(f), v = S && !u, x = s === "onwhite";
|
|
2603
|
+
ge(() => {
|
|
2570
2604
|
if (u) {
|
|
2571
|
-
const
|
|
2572
|
-
return () => clearTimeout(
|
|
2605
|
+
const R = setTimeout(() => c(!1), 300);
|
|
2606
|
+
return () => clearTimeout(R);
|
|
2573
2607
|
}
|
|
2574
|
-
}, [u]),
|
|
2575
|
-
|
|
2576
|
-
}, [t]),
|
|
2577
|
-
|
|
2578
|
-
"#" +
|
|
2579
|
-
{ background:
|
|
2608
|
+
}, [u]), ge(() => {
|
|
2609
|
+
l(t);
|
|
2610
|
+
}, [t]), ge(() => {
|
|
2611
|
+
h("#" + p, { background: F() }, { duration: 0.2, ease: "easeInOut" }), h(
|
|
2612
|
+
"#" + b,
|
|
2613
|
+
{ background: a ? "var(--color-action-graphics-ondark)" : "var(--core-color-neutral-700)" },
|
|
2580
2614
|
{ duration: 0.2, ease: "easeInOut" }
|
|
2581
|
-
),
|
|
2582
|
-
}, [
|
|
2583
|
-
const F = () =>
|
|
2584
|
-
|
|
2585
|
-
},
|
|
2586
|
-
[M["toggle-container__row--right"]]:
|
|
2615
|
+
), h("#" + b, { x: v ? 9 : a ? 18 : 0 }, { duration: 0.2, ease: "easeInOut" }), h("svg", { opacity: a ? 1 : 0 }, { duration: 0.2, ease: "easeInOut" });
|
|
2616
|
+
}, [a, v, w]);
|
|
2617
|
+
const F = () => a && w ? "var(--core-color-blueberry-800)" : a ? v ? "var(--color-action-graphics-onlight-hover)" : "var(--color-action-graphics-onlight)" : x && w ? "var(--core-color-neutral-400)" : x ? v ? "var(--core-color-neutral-200)" : "var(--core-color-neutral-50)" : w ? "var(--core-color-neutral-200)" : v ? "var(--core-color-neutral-50)" : "var(--core-color-white)", V = (R) => {
|
|
2618
|
+
l(R.target.checked), c(!0), n == null || n(R);
|
|
2619
|
+
}, A = W(M["toggle-container"]), P = W(M["toggle-container__row"], {
|
|
2620
|
+
[M["toggle-container__row--right"]]: i === "right"
|
|
2587
2621
|
/* right */
|
|
2588
|
-
}),
|
|
2589
|
-
[M["toggle-container__sublabel--toggle-right"]]:
|
|
2622
|
+
}), N = W(M["toggle-container__sublabel"], {
|
|
2623
|
+
[M["toggle-container__sublabel--toggle-right"]]: i === "right"
|
|
2590
2624
|
/* right */
|
|
2591
|
-
}),
|
|
2625
|
+
}), J = W(M["toggle-container__toggle"], {
|
|
2592
2626
|
[M["toggle-container__toggle--ignore-hover"]]: u,
|
|
2593
2627
|
[M["toggle-container__toggle--on-white"]]: s === "onwhite"
|
|
2594
2628
|
/* onwhite */
|
|
2595
|
-
}),
|
|
2629
|
+
}), Me = W(M["toggle-container__toggle__dot"], {
|
|
2596
2630
|
[M["toggle-container__toggle__dot--ignore-hover"]]: u
|
|
2597
|
-
}),
|
|
2598
|
-
/* @__PURE__ */
|
|
2631
|
+
}), ee = () => /* @__PURE__ */ te("label", { ref: y, className: M["toggle-container__toggle-group"], children: [
|
|
2632
|
+
/* @__PURE__ */ K(
|
|
2599
2633
|
"input",
|
|
2600
2634
|
{
|
|
2601
|
-
id:
|
|
2635
|
+
id: g,
|
|
2602
2636
|
type: "checkbox",
|
|
2603
|
-
checked:
|
|
2604
|
-
onChange:
|
|
2637
|
+
checked: a,
|
|
2638
|
+
onChange: V,
|
|
2605
2639
|
className: M["toggle-container__input"],
|
|
2606
|
-
"aria-label": e.map((
|
|
2607
|
-
"aria-describedby":
|
|
2640
|
+
"aria-label": e.map((R) => R.text).join(" "),
|
|
2641
|
+
"aria-describedby": r ? m : void 0
|
|
2608
2642
|
}
|
|
2609
2643
|
),
|
|
2610
|
-
/* @__PURE__ */
|
|
2644
|
+
/* @__PURE__ */ K("span", { id: p, className: J, "aria-hidden": "true", children: /* @__PURE__ */ K("span", { id: b, className: Me, "aria-hidden": "true", children: /* @__PURE__ */ K(
|
|
2611
2645
|
"svg",
|
|
2612
2646
|
{
|
|
2613
2647
|
width: "17",
|
|
@@ -2615,42 +2649,42 @@ const jr = ({
|
|
|
2615
2649
|
viewBox: "0 0 17 13",
|
|
2616
2650
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2617
2651
|
className: M["toggle-container__toggle__dot__icon"],
|
|
2618
|
-
children: /* @__PURE__ */
|
|
2652
|
+
children: /* @__PURE__ */ K("path", { d: "M15 2L6.80839 10.548L2 5.53145", fill: "none", strokeWidth: "3" })
|
|
2619
2653
|
}
|
|
2620
2654
|
) }) })
|
|
2621
|
-
] }),
|
|
2655
|
+
] }), D = () => /* @__PURE__ */ K(
|
|
2622
2656
|
"span",
|
|
2623
2657
|
{
|
|
2624
|
-
id:
|
|
2658
|
+
id: T,
|
|
2625
2659
|
className: W(M["toggle-container__label"], {
|
|
2626
|
-
[M["toggle-container__label--toggle-right"]]:
|
|
2660
|
+
[M["toggle-container__label--toggle-right"]]: i === "right"
|
|
2627
2661
|
/* right */
|
|
2628
2662
|
}),
|
|
2629
|
-
children: e.map((
|
|
2630
|
-
const
|
|
2631
|
-
[M["toggle-container__label__text--semibold"]]:
|
|
2663
|
+
children: e.map((R) => {
|
|
2664
|
+
const de = W({
|
|
2665
|
+
[M["toggle-container__label__text--semibold"]]: R.type === "semibold"
|
|
2632
2666
|
});
|
|
2633
|
-
return /* @__PURE__ */
|
|
2667
|
+
return /* @__PURE__ */ K("span", { className: de, children: R.text }, T + R.text);
|
|
2634
2668
|
})
|
|
2635
2669
|
}
|
|
2636
2670
|
);
|
|
2637
|
-
return /* @__PURE__ */
|
|
2638
|
-
/* @__PURE__ */
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2671
|
+
return /* @__PURE__ */ te("div", { className: A, "data-testid": o, "data-analyticsid": Gn.Toggle, children: [
|
|
2672
|
+
/* @__PURE__ */ te("div", { className: P, children: [
|
|
2673
|
+
i === "left" && /* @__PURE__ */ te(dt, { children: [
|
|
2674
|
+
ee(),
|
|
2675
|
+
D()
|
|
2642
2676
|
] }),
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2677
|
+
i === "right" && /* @__PURE__ */ te(dt, { children: [
|
|
2678
|
+
D(),
|
|
2679
|
+
ee()
|
|
2646
2680
|
] })
|
|
2647
2681
|
] }),
|
|
2648
|
-
|
|
2682
|
+
r && /* @__PURE__ */ K("div", { id: m, className: N, children: r })
|
|
2649
2683
|
] });
|
|
2650
2684
|
};
|
|
2651
2685
|
export {
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2686
|
+
qi as ToggleOnColor,
|
|
2687
|
+
zi as TogglePosition,
|
|
2688
|
+
no as default
|
|
2655
2689
|
};
|
|
2656
2690
|
//# sourceMappingURL=index.js.map
|