@versini/sassysaint 8.99.1 → 8.99.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AboutChangelog.D02zn0LK.js → AboutChangelog.C_qMLuiB.js} +3 -3
- package/dist/chunks/{AboutEntry.D2cwQtD2.js → AboutEntry.CKKvxJXb.js} +7 -7
- package/dist/chunks/{App.sQ3wU0lJ.js → App.BUZaV6AF.js} +1609 -1591
- package/dist/chunks/{Chart.CTun5qf8.js → Chart.DvSv2Eza.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.pngDgGic.js → ChatBubbleAssistant.DPvPqKP2.js} +794 -754
- package/dist/chunks/{ChatBubbleUser.Cfoux4eQ.js → ChatBubbleUser.BCEiPwpY.js} +28 -27
- package/dist/chunks/{ChatHistoryTable.CDjRKyvZ.js → ChatHistoryTable.BV0EO83B.js} +7 -7
- package/dist/chunks/{HistoryEntry.D0uaFad7.js → HistoryEntry.DdsxhGAV.js} +16 -16
- package/dist/chunks/{ProfileEntry.BEHLT1CZ.js → ProfileEntry.C-3cFRJF.js} +2 -2
- package/dist/chunks/{SettingsEntry.DO6srgDU.js → SettingsEntry.AuH85ovZ.js} +16 -16
- package/dist/chunks/{UsageEntry.DC9zKsfT.js → UsageEntry.C5_CSslN.js} +23 -23
- package/dist/chunks/{UserMemoriesPanel.-fv-1_am.js → UserMemoriesPanel.B7Vh6shw.js} +8 -8
- package/dist/chunks/{index.B9GCA2Iv.js → index.3sEe64_a.js} +1 -1
- package/dist/chunks/{index.ZxP3Yv8a.js → index.BbB1hl1m.js} +70 -70
- package/dist/chunks/{index.BNW48OCM.js → index.BtC6g5QI.js} +1 -1
- package/dist/chunks/{index.SRAmjHI8.js → index.C8gT8NUq.js} +2 -2
- package/dist/chunks/{index.DAZOAmkW.js → index.CHoYdZu2.js} +3 -3
- package/dist/chunks/{index.Sv4RjGsQ.js → index.D3zzxjS0.js} +1 -1
- package/dist/chunks/{index.B5i9jF9N.js → index.DQOeZzJl.js} +7 -7
- package/dist/chunks/{index.CYfXOuUd.js → index.DRSAc_Rh.js} +4 -4
- package/dist/chunks/{index.BsKtVCXE.js → index.IFwWrDqI.js} +4 -4
- package/dist/chunks/{useMarkdown.CK423j2p.js → useMarkdown.CFmffPvi.js} +11 -10
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +2 -2
- package/package.json +6 -6
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { ChatContext as
|
|
3
|
-
import { BUBBLE_FOOTER_EMPTY as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
function
|
|
1
|
+
import { jsx as ss } from "react/jsx-runtime";
|
|
2
|
+
import { ChatContext as is, AppContext as rs, n as as, useUserPreferences as os, convertCamelCaseToReadable as ls, numberFormatter as us, pluralize as cs } from "./index.BbB1hl1m.js";
|
|
3
|
+
import { BUBBLE_FOOTER_EMPTY as fs } from "./index.IFwWrDqI.js";
|
|
4
|
+
import Xt from "clsx";
|
|
5
|
+
import hs, { useState as Me, useEffect as qt, useContext as vt } from "react";
|
|
6
|
+
import { useMarkdown as ds } from "./useMarkdown.CFmffPvi.js";
|
|
7
|
+
import { AsyncBubble as ps } from "./App.BUZaV6AF.js";
|
|
8
|
+
function ms(e, t) {
|
|
9
9
|
e.indexOf(t) === -1 && e.push(t);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function Ht(e, t) {
|
|
12
12
|
const n = e.indexOf(t);
|
|
13
13
|
n > -1 && e.splice(n, 1);
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const Y = (e, t, n) => n > t ? t : n < e ? e : n;
|
|
16
16
|
function Pe(e, t) {
|
|
17
17
|
return t ? `${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}` : e;
|
|
18
18
|
}
|
|
19
|
-
let
|
|
19
|
+
let de = () => {
|
|
20
20
|
}, k = () => {
|
|
21
21
|
};
|
|
22
|
-
process.env.NODE_ENV !== "production" && (
|
|
22
|
+
process.env.NODE_ENV !== "production" && (de = (e, t, n) => {
|
|
23
23
|
!e && typeof console < "u" && console.warn(Pe(t, n));
|
|
24
24
|
}, k = (e, t, n) => {
|
|
25
25
|
if (!e)
|
|
26
26
|
throw new Error(Pe(t, n));
|
|
27
27
|
});
|
|
28
|
-
const
|
|
29
|
-
function
|
|
28
|
+
const I = {}, Zt = (e) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);
|
|
29
|
+
function gs(e) {
|
|
30
30
|
return typeof e == "object" && e !== null;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const Jt = (e) => /^0[^.\s]+$/u.test(e);
|
|
33
33
|
// @__NO_SIDE_EFFECTS__
|
|
34
|
-
function
|
|
34
|
+
function qe(e) {
|
|
35
35
|
let t;
|
|
36
36
|
return () => (t === void 0 && (t = e()), t);
|
|
37
37
|
}
|
|
38
|
-
const
|
|
38
|
+
const H = /* @__NO_SIDE_EFFECTS__ */ (e) => e, ys = (e, t) => (n) => t(e(n)), He = (...e) => e.reduce(ys), Ze = /* @__NO_SIDE_EFFECTS__ */ (e, t, n) => {
|
|
39
39
|
const s = t - e;
|
|
40
40
|
return s === 0 ? 1 : (n - e) / s;
|
|
41
41
|
};
|
|
42
|
-
class
|
|
42
|
+
class Qt {
|
|
43
43
|
constructor() {
|
|
44
44
|
this.subscriptions = [];
|
|
45
45
|
}
|
|
46
46
|
add(t) {
|
|
47
|
-
return
|
|
47
|
+
return ms(this.subscriptions, t), () => Ht(this.subscriptions, t);
|
|
48
48
|
}
|
|
49
49
|
notify(t, n, s) {
|
|
50
50
|
const i = this.subscriptions.length;
|
|
@@ -64,56 +64,56 @@ class Zt {
|
|
|
64
64
|
this.subscriptions.length = 0;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
const
|
|
68
|
-
function
|
|
67
|
+
const O = /* @__NO_SIDE_EFFECTS__ */ (e) => e * 1e3, P = /* @__NO_SIDE_EFFECTS__ */ (e) => e / 1e3;
|
|
68
|
+
function en(e, t) {
|
|
69
69
|
return t ? e * (1e3 / t) : 0;
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
function
|
|
73
|
-
e ||
|
|
71
|
+
const Vt = /* @__PURE__ */ new Set();
|
|
72
|
+
function tn(e, t, n) {
|
|
73
|
+
e || Vt.has(t) || (console.warn(Pe(t, n)), Vt.add(t));
|
|
74
74
|
}
|
|
75
|
-
const
|
|
75
|
+
const bs = (e, t, n) => {
|
|
76
76
|
const s = t - e;
|
|
77
77
|
return ((n - e) % s + s) % s + e;
|
|
78
|
-
},
|
|
79
|
-
function
|
|
78
|
+
}, nn = (e, t, n) => (((1 - 3 * n + 3 * t) * e + (3 * n - 6 * t)) * e + 3 * t) * e, Ts = 1e-7, vs = 12;
|
|
79
|
+
function Vs(e, t, n, s, i) {
|
|
80
80
|
let r, a, o = 0;
|
|
81
81
|
do
|
|
82
|
-
a = t + (n - t) / 2, r =
|
|
83
|
-
while (Math.abs(r) >
|
|
82
|
+
a = t + (n - t) / 2, r = nn(a, s, i) - e, r > 0 ? n = a : t = a;
|
|
83
|
+
while (Math.abs(r) > Ts && ++o < vs);
|
|
84
84
|
return a;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function pe(e, t, n, s) {
|
|
87
87
|
if (e === t && n === s)
|
|
88
|
-
return
|
|
89
|
-
const i = (r) =>
|
|
90
|
-
return (r) => r === 0 || r === 1 ? r :
|
|
91
|
-
}
|
|
92
|
-
const
|
|
93
|
-
function
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
const
|
|
97
|
-
linear:
|
|
98
|
-
easeIn:
|
|
99
|
-
easeInOut:
|
|
100
|
-
easeOut:
|
|
101
|
-
circIn:
|
|
102
|
-
circInOut:
|
|
103
|
-
circOut:
|
|
104
|
-
backIn:
|
|
105
|
-
backInOut:
|
|
106
|
-
backOut:
|
|
107
|
-
anticipate:
|
|
108
|
-
},
|
|
109
|
-
if (
|
|
88
|
+
return H;
|
|
89
|
+
const i = (r) => Vs(r, 0, 1, e, n);
|
|
90
|
+
return (r) => r === 0 || r === 1 ? r : nn(i(r), t, s);
|
|
91
|
+
}
|
|
92
|
+
const sn = (e) => (t) => t <= 0.5 ? e(2 * t) / 2 : (2 - e(2 * (1 - t))) / 2, rn = (e) => (t) => 1 - e(1 - t), an = /* @__PURE__ */ pe(0.33, 1.53, 0.69, 0.99), Je = /* @__PURE__ */ rn(an), on = /* @__PURE__ */ sn(Je), ln = (e) => (e *= 2) < 1 ? 0.5 * Je(e) : 0.5 * (2 - Math.pow(2, -10 * (e - 1))), Qe = (e) => 1 - Math.sin(Math.acos(e)), Ss = rn(Qe), un = sn(Qe), ws = /* @__PURE__ */ pe(0.42, 0, 1, 1), xs = /* @__PURE__ */ pe(0, 0, 0.58, 1), cn = /* @__PURE__ */ pe(0.42, 0, 0.58, 1), fn = (e) => Array.isArray(e) && typeof e[0] != "number";
|
|
93
|
+
function hn(e, t) {
|
|
94
|
+
return fn(e) ? e[bs(0, e.length, t)] : e;
|
|
95
|
+
}
|
|
96
|
+
const dn = (e) => Array.isArray(e) && typeof e[0] == "number", St = {
|
|
97
|
+
linear: H,
|
|
98
|
+
easeIn: ws,
|
|
99
|
+
easeInOut: cn,
|
|
100
|
+
easeOut: xs,
|
|
101
|
+
circIn: Qe,
|
|
102
|
+
circInOut: un,
|
|
103
|
+
circOut: Ss,
|
|
104
|
+
backIn: Je,
|
|
105
|
+
backInOut: on,
|
|
106
|
+
backOut: an,
|
|
107
|
+
anticipate: ln
|
|
108
|
+
}, As = (e) => typeof e == "string", wt = (e) => {
|
|
109
|
+
if (dn(e)) {
|
|
110
110
|
k(e.length === 4, "Cubic bezier arrays must contain four numerical values.", "cubic-bezier-length");
|
|
111
111
|
const [t, n, s, i] = e;
|
|
112
|
-
return
|
|
113
|
-
} else if (
|
|
114
|
-
return k(
|
|
112
|
+
return pe(t, n, s, i);
|
|
113
|
+
} else if (As(e))
|
|
114
|
+
return k(St[e] !== void 0, `Invalid easing type '${e}'`, "invalid-easing-type"), St[e];
|
|
115
115
|
return e;
|
|
116
|
-
},
|
|
116
|
+
}, be = [
|
|
117
117
|
"setup",
|
|
118
118
|
// Compute
|
|
119
119
|
"read",
|
|
@@ -131,7 +131,7 @@ const fn = (e) => Array.isArray(e) && typeof e[0] == "number", Vt = {
|
|
|
131
131
|
"postRender"
|
|
132
132
|
// Compute
|
|
133
133
|
];
|
|
134
|
-
function
|
|
134
|
+
function Ms(e, t) {
|
|
135
135
|
let n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), i = !1, r = !1;
|
|
136
136
|
const a = /* @__PURE__ */ new WeakSet();
|
|
137
137
|
let o = {
|
|
@@ -169,70 +169,70 @@ function As(e, t) {
|
|
|
169
169
|
};
|
|
170
170
|
return c;
|
|
171
171
|
}
|
|
172
|
-
const
|
|
173
|
-
function
|
|
172
|
+
const Cs = 40;
|
|
173
|
+
function pn(e, t) {
|
|
174
174
|
let n = !1, s = !0;
|
|
175
175
|
const i = {
|
|
176
176
|
delta: 0,
|
|
177
177
|
timestamp: 0,
|
|
178
178
|
isProcessing: !1
|
|
179
|
-
}, r = () => n = !0, a =
|
|
180
|
-
const V =
|
|
181
|
-
n = !1,
|
|
179
|
+
}, r = () => n = !0, a = be.reduce((V, w) => (V[w] = Ms(r), V), {}), { setup: o, read: l, resolveKeyframes: c, preUpdate: u, update: f, preRender: h, render: m, postRender: b } = a, y = () => {
|
|
180
|
+
const V = I.useManualTiming ? i.timestamp : performance.now();
|
|
181
|
+
n = !1, I.useManualTiming || (i.delta = s ? 1e3 / 60 : Math.max(Math.min(V - i.timestamp, Cs), 1)), i.timestamp = V, i.isProcessing = !0, o.process(i), l.process(i), c.process(i), u.process(i), f.process(i), h.process(i), m.process(i), b.process(i), i.isProcessing = !1, n && t && (s = !1, e(y));
|
|
182
182
|
}, v = () => {
|
|
183
183
|
n = !0, s = !0, i.isProcessing || e(y);
|
|
184
184
|
};
|
|
185
|
-
return { schedule:
|
|
185
|
+
return { schedule: be.reduce((V, w) => {
|
|
186
186
|
const p = a[w];
|
|
187
187
|
return V[w] = (S, C = !1, g = !1) => (n || v(), p.schedule(S, C, g)), V;
|
|
188
188
|
}, {}), cancel: (V) => {
|
|
189
|
-
for (let w = 0; w <
|
|
190
|
-
a[
|
|
189
|
+
for (let w = 0; w < be.length; w++)
|
|
190
|
+
a[be[w]].cancel(V);
|
|
191
191
|
}, state: i, steps: a };
|
|
192
192
|
}
|
|
193
|
-
const { schedule: K, cancel: Oe, state:
|
|
194
|
-
let
|
|
195
|
-
function
|
|
196
|
-
|
|
193
|
+
const { schedule: K, cancel: Oe, state: Se } = /* @__PURE__ */ pn(typeof requestAnimationFrame < "u" ? requestAnimationFrame : H, !0);
|
|
194
|
+
let Ve;
|
|
195
|
+
function Fs() {
|
|
196
|
+
Ve = void 0;
|
|
197
197
|
}
|
|
198
|
-
const
|
|
199
|
-
now: () => (
|
|
198
|
+
const R = {
|
|
199
|
+
now: () => (Ve === void 0 && R.set(Se.isProcessing || I.useManualTiming ? Se.timestamp : performance.now()), Ve),
|
|
200
200
|
set: (e) => {
|
|
201
|
-
|
|
201
|
+
Ve = e, queueMicrotask(Fs);
|
|
202
202
|
}
|
|
203
|
-
},
|
|
203
|
+
}, mn = (e) => (t) => typeof t == "string" && t.startsWith(e), gn = /* @__PURE__ */ mn("--"), Ds = /* @__PURE__ */ mn("var(--"), et = (e) => Ds(e) ? Es.test(e.split("/*")[0].trim()) : !1, Es = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, Z = {
|
|
204
204
|
test: (e) => typeof e == "number",
|
|
205
205
|
parse: parseFloat,
|
|
206
206
|
transform: (e) => e
|
|
207
|
-
},
|
|
208
|
-
...
|
|
209
|
-
transform: (e) =>
|
|
210
|
-
},
|
|
211
|
-
...
|
|
207
|
+
}, le = {
|
|
208
|
+
...Z,
|
|
209
|
+
transform: (e) => Y(0, 1, e)
|
|
210
|
+
}, Te = {
|
|
211
|
+
...Z,
|
|
212
212
|
default: 1
|
|
213
|
-
},
|
|
214
|
-
function
|
|
213
|
+
}, oe = (e) => Math.round(e * 1e5) / 1e5, tt = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
214
|
+
function Rs(e) {
|
|
215
215
|
return e == null;
|
|
216
216
|
}
|
|
217
|
-
const
|
|
217
|
+
const Ps = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, nt = (e, t) => (n) => !!(typeof n == "string" && Ps.test(n) && n.startsWith(e) || t && !Rs(n) && Object.prototype.hasOwnProperty.call(n, t)), yn = (e, t, n) => (s) => {
|
|
218
218
|
if (typeof s != "string")
|
|
219
219
|
return s;
|
|
220
|
-
const [i, r, a, o] = s.match(
|
|
220
|
+
const [i, r, a, o] = s.match(tt);
|
|
221
221
|
return {
|
|
222
222
|
[e]: parseFloat(i),
|
|
223
223
|
[t]: parseFloat(r),
|
|
224
224
|
[n]: parseFloat(a),
|
|
225
225
|
alpha: o !== void 0 ? parseFloat(o) : 1
|
|
226
226
|
};
|
|
227
|
-
},
|
|
228
|
-
...
|
|
229
|
-
transform: (e) => Math.round(
|
|
230
|
-
},
|
|
231
|
-
test: /* @__PURE__ */
|
|
232
|
-
parse: /* @__PURE__ */
|
|
233
|
-
transform: ({ red: e, green: t, blue: n, alpha: s = 1 }) => "rgba(" +
|
|
227
|
+
}, Os = (e) => Y(0, 255, e), Ce = {
|
|
228
|
+
...Z,
|
|
229
|
+
transform: (e) => Math.round(Os(e))
|
|
230
|
+
}, _ = {
|
|
231
|
+
test: /* @__PURE__ */ nt("rgb", "red"),
|
|
232
|
+
parse: /* @__PURE__ */ yn("red", "green", "blue"),
|
|
233
|
+
transform: ({ red: e, green: t, blue: n, alpha: s = 1 }) => "rgba(" + Ce.transform(e) + ", " + Ce.transform(t) + ", " + Ce.transform(n) + ", " + oe(le.transform(s)) + ")"
|
|
234
234
|
};
|
|
235
|
-
function
|
|
235
|
+
function Ns(e) {
|
|
236
236
|
let t = "", n = "", s = "", i = "";
|
|
237
237
|
return e.length > 5 ? (t = e.substring(1, 3), n = e.substring(3, 5), s = e.substring(5, 7), i = e.substring(7, 9)) : (t = e.substring(1, 2), n = e.substring(2, 3), s = e.substring(3, 4), i = e.substring(4, 5), t += t, n += n, s += s, i += i), {
|
|
238
238
|
red: parseInt(t, 16),
|
|
@@ -241,82 +241,82 @@ function Os(e) {
|
|
|
241
241
|
alpha: i ? parseInt(i, 16) / 255 : 1
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
const
|
|
245
|
-
test: /* @__PURE__ */
|
|
246
|
-
parse:
|
|
247
|
-
transform:
|
|
248
|
-
},
|
|
244
|
+
const Ne = {
|
|
245
|
+
test: /* @__PURE__ */ nt("#"),
|
|
246
|
+
parse: Ns,
|
|
247
|
+
transform: _.transform
|
|
248
|
+
}, me = /* @__NO_SIDE_EFFECTS__ */ (e) => ({
|
|
249
249
|
test: (t) => typeof t == "string" && t.endsWith(e) && t.split(" ").length === 1,
|
|
250
250
|
parse: parseFloat,
|
|
251
251
|
transform: (t) => `${t}${e}`
|
|
252
|
-
}),
|
|
253
|
-
...
|
|
254
|
-
parse: (e) =>
|
|
255
|
-
transform: (e) =>
|
|
256
|
-
},
|
|
257
|
-
test: /* @__PURE__ */
|
|
258
|
-
parse: /* @__PURE__ */
|
|
259
|
-
transform: ({ hue: e, saturation: t, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(e) + ", " +
|
|
260
|
-
},
|
|
261
|
-
test: (e) =>
|
|
262
|
-
parse: (e) =>
|
|
263
|
-
transform: (e) => typeof e == "string" ? e : e.hasOwnProperty("red") ?
|
|
252
|
+
}), $ = /* @__PURE__ */ me("deg"), q = /* @__PURE__ */ me("%"), d = /* @__PURE__ */ me("px"), ks = /* @__PURE__ */ me("vh"), Bs = /* @__PURE__ */ me("vw"), xt = {
|
|
253
|
+
...q,
|
|
254
|
+
parse: (e) => q.parse(e) / 100,
|
|
255
|
+
transform: (e) => q.transform(e * 100)
|
|
256
|
+
}, z = {
|
|
257
|
+
test: /* @__PURE__ */ nt("hsl", "hue"),
|
|
258
|
+
parse: /* @__PURE__ */ yn("hue", "saturation", "lightness"),
|
|
259
|
+
transform: ({ hue: e, saturation: t, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(e) + ", " + q.transform(oe(t)) + ", " + q.transform(oe(n)) + ", " + oe(le.transform(s)) + ")"
|
|
260
|
+
}, F = {
|
|
261
|
+
test: (e) => _.test(e) || Ne.test(e) || z.test(e),
|
|
262
|
+
parse: (e) => _.test(e) ? _.parse(e) : z.test(e) ? z.parse(e) : Ne.parse(e),
|
|
263
|
+
transform: (e) => typeof e == "string" ? e : e.hasOwnProperty("red") ? _.transform(e) : z.transform(e),
|
|
264
264
|
getAnimatableNone: (e) => {
|
|
265
|
-
const t =
|
|
266
|
-
return t.alpha = 0,
|
|
265
|
+
const t = F.parse(e);
|
|
266
|
+
return t.alpha = 0, F.transform(t);
|
|
267
267
|
}
|
|
268
|
-
},
|
|
269
|
-
function
|
|
270
|
-
return isNaN(e) && typeof e == "string" && (e.match(
|
|
268
|
+
}, Is = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
269
|
+
function Ks(e) {
|
|
270
|
+
return isNaN(e) && typeof e == "string" && (e.match(tt)?.length || 0) + (e.match(Is)?.length || 0) > 0;
|
|
271
271
|
}
|
|
272
|
-
const
|
|
273
|
-
function
|
|
272
|
+
const bn = "number", Tn = "color", Ls = "var", $s = "var(", At = "${}", Ws = /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;
|
|
273
|
+
function ue(e) {
|
|
274
274
|
const t = e.toString(), n = [], s = {
|
|
275
275
|
color: [],
|
|
276
276
|
number: [],
|
|
277
277
|
var: []
|
|
278
278
|
}, i = [];
|
|
279
279
|
let r = 0;
|
|
280
|
-
const o = t.replace(
|
|
280
|
+
const o = t.replace(Ws, (l) => (F.test(l) ? (s.color.push(r), i.push(Tn), n.push(F.parse(l))) : l.startsWith($s) ? (s.var.push(r), i.push(Ls), n.push(l)) : (s.number.push(r), i.push(bn), n.push(parseFloat(l))), ++r, At)).split(At);
|
|
281
281
|
return { values: n, split: o, indexes: s, types: i };
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
return
|
|
283
|
+
function vn(e) {
|
|
284
|
+
return ue(e).values;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
const { split: t, types: n } =
|
|
286
|
+
function Vn(e) {
|
|
287
|
+
const { split: t, types: n } = ue(e), s = t.length;
|
|
288
288
|
return (i) => {
|
|
289
289
|
let r = "";
|
|
290
290
|
for (let a = 0; a < s; a++)
|
|
291
291
|
if (r += t[a], i[a] !== void 0) {
|
|
292
292
|
const o = n[a];
|
|
293
|
-
o ===
|
|
293
|
+
o === bn ? r += oe(i[a]) : o === Tn ? r += F.transform(i[a]) : r += i[a];
|
|
294
294
|
}
|
|
295
295
|
return r;
|
|
296
296
|
};
|
|
297
297
|
}
|
|
298
|
-
const
|
|
299
|
-
function
|
|
300
|
-
const t =
|
|
301
|
-
return
|
|
298
|
+
const _s = (e) => typeof e == "number" ? 0 : F.test(e) ? F.getAnimatableNone(e) : e;
|
|
299
|
+
function Us(e) {
|
|
300
|
+
const t = vn(e);
|
|
301
|
+
return Vn(e)(t.map(_s));
|
|
302
302
|
}
|
|
303
|
-
const
|
|
304
|
-
test:
|
|
305
|
-
parse:
|
|
306
|
-
createTransformer:
|
|
307
|
-
getAnimatableNone:
|
|
303
|
+
const W = {
|
|
304
|
+
test: Ks,
|
|
305
|
+
parse: vn,
|
|
306
|
+
createTransformer: Vn,
|
|
307
|
+
getAnimatableNone: Us
|
|
308
308
|
};
|
|
309
|
-
function
|
|
309
|
+
function Fe(e, t, n) {
|
|
310
310
|
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function js({ hue: e, saturation: t, lightness: n, alpha: s }) {
|
|
313
313
|
e /= 360, t /= 100, n /= 100;
|
|
314
314
|
let i = 0, r = 0, a = 0;
|
|
315
315
|
if (!t)
|
|
316
316
|
i = r = a = n;
|
|
317
317
|
else {
|
|
318
318
|
const o = n < 0.5 ? n * (1 + t) : n + t - n * t, l = 2 * n - o;
|
|
319
|
-
i =
|
|
319
|
+
i = Fe(l, o, e + 1 / 3), r = Fe(l, o, e), a = Fe(l, o, e - 1 / 3);
|
|
320
320
|
}
|
|
321
321
|
return {
|
|
322
322
|
red: Math.round(i * 255),
|
|
@@ -325,55 +325,55 @@ function _s({ hue: e, saturation: t, lightness: n, alpha: s }) {
|
|
|
325
325
|
alpha: s
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function we(e, t) {
|
|
329
329
|
return (n) => n > 0 ? t : e;
|
|
330
330
|
}
|
|
331
|
-
const
|
|
331
|
+
const J = (e, t, n) => e + (t - e) * n, De = (e, t, n) => {
|
|
332
332
|
const s = e * e, i = n * (t * t - s) + s;
|
|
333
333
|
return i < 0 ? 0 : Math.sqrt(i);
|
|
334
|
-
},
|
|
335
|
-
function
|
|
336
|
-
const t =
|
|
337
|
-
if (
|
|
334
|
+
}, Gs = [Ne, _, z], Ys = (e) => Gs.find((t) => t.test(e));
|
|
335
|
+
function Mt(e) {
|
|
336
|
+
const t = Ys(e);
|
|
337
|
+
if (de(!!t, `'${e}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"), !t)
|
|
338
338
|
return !1;
|
|
339
339
|
let n = t.parse(e);
|
|
340
|
-
return t ===
|
|
340
|
+
return t === z && (n = js(n)), n;
|
|
341
341
|
}
|
|
342
|
-
const
|
|
343
|
-
const n =
|
|
342
|
+
const Ct = (e, t) => {
|
|
343
|
+
const n = Mt(e), s = Mt(t);
|
|
344
344
|
if (!n || !s)
|
|
345
|
-
return
|
|
345
|
+
return we(e, t);
|
|
346
346
|
const i = { ...n };
|
|
347
|
-
return (r) => (i.red = De(n.red, s.red, r), i.green = De(n.green, s.green, r), i.blue = De(n.blue, s.blue, r), i.alpha =
|
|
348
|
-
},
|
|
349
|
-
function
|
|
350
|
-
return
|
|
347
|
+
return (r) => (i.red = De(n.red, s.red, r), i.green = De(n.green, s.green, r), i.blue = De(n.blue, s.blue, r), i.alpha = J(n.alpha, s.alpha, r), _.transform(i));
|
|
348
|
+
}, ke = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
349
|
+
function zs(e, t) {
|
|
350
|
+
return ke.has(e) ? (n) => n <= 0 ? e : t : (n) => n >= 1 ? t : e;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
return (n) =>
|
|
352
|
+
function Xs(e, t) {
|
|
353
|
+
return (n) => J(e, t, n);
|
|
354
354
|
}
|
|
355
|
-
function
|
|
356
|
-
return typeof e == "number" ?
|
|
355
|
+
function st(e) {
|
|
356
|
+
return typeof e == "number" ? Xs : typeof e == "string" ? et(e) ? we : F.test(e) ? Ct : Zs : Array.isArray(e) ? Sn : typeof e == "object" ? F.test(e) ? Ct : qs : we;
|
|
357
357
|
}
|
|
358
|
-
function
|
|
359
|
-
const n = [...e], s = n.length, i = e.map((r, a) =>
|
|
358
|
+
function Sn(e, t) {
|
|
359
|
+
const n = [...e], s = n.length, i = e.map((r, a) => st(r)(r, t[a]));
|
|
360
360
|
return (r) => {
|
|
361
361
|
for (let a = 0; a < s; a++)
|
|
362
362
|
n[a] = i[a](r);
|
|
363
363
|
return n;
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function qs(e, t) {
|
|
367
367
|
const n = { ...e, ...t }, s = {};
|
|
368
368
|
for (const i in n)
|
|
369
|
-
e[i] !== void 0 && t[i] !== void 0 && (s[i] =
|
|
369
|
+
e[i] !== void 0 && t[i] !== void 0 && (s[i] = st(e[i])(e[i], t[i]));
|
|
370
370
|
return (i) => {
|
|
371
371
|
for (const r in s)
|
|
372
372
|
n[r] = s[r](i);
|
|
373
373
|
return n;
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function Hs(e, t) {
|
|
377
377
|
const n = [], s = { color: 0, var: 0, number: 0 };
|
|
378
378
|
for (let i = 0; i < t.values.length; i++) {
|
|
379
379
|
const r = t.types[i], a = e.indexes[r][s[r]], o = e.values[a] ?? 0;
|
|
@@ -381,14 +381,14 @@ function Xs(e, t) {
|
|
|
381
381
|
}
|
|
382
382
|
return n;
|
|
383
383
|
}
|
|
384
|
-
const
|
|
385
|
-
const n =
|
|
386
|
-
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ?
|
|
384
|
+
const Zs = (e, t) => {
|
|
385
|
+
const n = W.createTransformer(t), s = ue(e), i = ue(t);
|
|
386
|
+
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? ke.has(e) && !i.values.length || ke.has(t) && !s.values.length ? zs(e, t) : He(Sn(Hs(s, i), i.values), n) : (de(!0, `Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"), we(e, t));
|
|
387
387
|
};
|
|
388
|
-
function
|
|
389
|
-
return typeof e == "number" && typeof t == "number" && typeof n == "number" ?
|
|
388
|
+
function wn(e, t, n) {
|
|
389
|
+
return typeof e == "number" && typeof t == "number" && typeof n == "number" ? J(e, t, n) : st(e)(e, t);
|
|
390
390
|
}
|
|
391
|
-
const
|
|
391
|
+
const Js = (e) => {
|
|
392
392
|
const t = ({ timestamp: n }) => e(n);
|
|
393
393
|
return {
|
|
394
394
|
start: (n = !0) => K.update(t, n),
|
|
@@ -397,35 +397,35 @@ const Hs = (e) => {
|
|
|
397
397
|
* If we're processing this frame we can use the
|
|
398
398
|
* framelocked timestamp to keep things in sync.
|
|
399
399
|
*/
|
|
400
|
-
now: () =>
|
|
400
|
+
now: () => Se.isProcessing ? Se.timestamp : R.now()
|
|
401
401
|
};
|
|
402
|
-
},
|
|
402
|
+
}, xn = (e, t, n = 10) => {
|
|
403
403
|
let s = "";
|
|
404
404
|
const i = Math.max(Math.round(t / n), 2);
|
|
405
405
|
for (let r = 0; r < i; r++)
|
|
406
406
|
s += Math.round(e(r / (i - 1)) * 1e4) / 1e4 + ", ";
|
|
407
407
|
return `linear(${s.substring(0, s.length - 2)})`;
|
|
408
|
-
},
|
|
409
|
-
function
|
|
408
|
+
}, xe = 2e4;
|
|
409
|
+
function it(e) {
|
|
410
410
|
let t = 0;
|
|
411
411
|
const n = 50;
|
|
412
412
|
let s = e.next(t);
|
|
413
|
-
for (; !s.done && t <
|
|
413
|
+
for (; !s.done && t < xe; )
|
|
414
414
|
t += n, s = e.next(t);
|
|
415
|
-
return t >=
|
|
415
|
+
return t >= xe ? 1 / 0 : t;
|
|
416
416
|
}
|
|
417
|
-
function
|
|
418
|
-
const s = n({ ...e, keyframes: [0, t] }), i = Math.min(
|
|
417
|
+
function An(e, t = 100, n) {
|
|
418
|
+
const s = n({ ...e, keyframes: [0, t] }), i = Math.min(it(s), xe);
|
|
419
419
|
return {
|
|
420
420
|
type: "keyframes",
|
|
421
421
|
ease: (r) => s.next(i * r).value / t,
|
|
422
|
-
duration: /* @__PURE__ */
|
|
422
|
+
duration: /* @__PURE__ */ P(i)
|
|
423
423
|
};
|
|
424
424
|
}
|
|
425
|
-
const
|
|
426
|
-
function
|
|
427
|
-
const s = Math.max(t -
|
|
428
|
-
return
|
|
425
|
+
const Qs = 5;
|
|
426
|
+
function Mn(e, t, n) {
|
|
427
|
+
const s = Math.max(t - Qs, 0);
|
|
428
|
+
return en(n - e(s), t - s);
|
|
429
429
|
}
|
|
430
430
|
const M = {
|
|
431
431
|
// Default spring physics
|
|
@@ -455,26 +455,26 @@ const M = {
|
|
|
455
455
|
// in seconds
|
|
456
456
|
minDamping: 0.05,
|
|
457
457
|
maxDamping: 1
|
|
458
|
-
},
|
|
459
|
-
function
|
|
458
|
+
}, Ee = 1e-3;
|
|
459
|
+
function ei({ duration: e = M.duration, bounce: t = M.bounce, velocity: n = M.velocity, mass: s = M.mass }) {
|
|
460
460
|
let i, r;
|
|
461
|
-
|
|
461
|
+
de(e <= /* @__PURE__ */ O(M.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
|
|
462
462
|
let a = 1 - t;
|
|
463
|
-
a =
|
|
464
|
-
const u = c * a, f = u * e, h = u - n, m =
|
|
465
|
-
return
|
|
463
|
+
a = Y(M.minDamping, M.maxDamping, a), e = Y(M.minDuration, M.maxDuration, /* @__PURE__ */ P(e)), a < 1 ? (i = (c) => {
|
|
464
|
+
const u = c * a, f = u * e, h = u - n, m = Be(c, a), b = Math.exp(-f);
|
|
465
|
+
return Ee - h / m * b;
|
|
466
466
|
}, r = (c) => {
|
|
467
|
-
const f = c * a * e, h = f * n + n, m = Math.pow(a, 2) * Math.pow(c, 2) * e, b = Math.exp(-f), y =
|
|
468
|
-
return (-i(c) +
|
|
467
|
+
const f = c * a * e, h = f * n + n, m = Math.pow(a, 2) * Math.pow(c, 2) * e, b = Math.exp(-f), y = Be(Math.pow(c, 2), a);
|
|
468
|
+
return (-i(c) + Ee > 0 ? -1 : 1) * ((h - m) * b) / y;
|
|
469
469
|
}) : (i = (c) => {
|
|
470
470
|
const u = Math.exp(-c * e), f = (c - n) * e + 1;
|
|
471
|
-
return -
|
|
471
|
+
return -Ee + u * f;
|
|
472
472
|
}, r = (c) => {
|
|
473
473
|
const u = Math.exp(-c * e), f = (n - c) * (e * e);
|
|
474
474
|
return u * f;
|
|
475
475
|
});
|
|
476
|
-
const o = 5 / e, l =
|
|
477
|
-
if (e = /* @__PURE__ */
|
|
476
|
+
const o = 5 / e, l = ni(i, r, o);
|
|
477
|
+
if (e = /* @__PURE__ */ O(e), isNaN(l))
|
|
478
478
|
return {
|
|
479
479
|
stiffness: M.stiffness,
|
|
480
480
|
damping: M.damping,
|
|
@@ -489,21 +489,21 @@ function Js({ duration: e = M.duration, bounce: t = M.bounce, velocity: n = M.ve
|
|
|
489
489
|
};
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
|
-
const
|
|
493
|
-
function
|
|
492
|
+
const ti = 12;
|
|
493
|
+
function ni(e, t, n) {
|
|
494
494
|
let s = n;
|
|
495
|
-
for (let i = 1; i <
|
|
495
|
+
for (let i = 1; i < ti; i++)
|
|
496
496
|
s = s - e(s) / t(s);
|
|
497
497
|
return s;
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function Be(e, t) {
|
|
500
500
|
return e * Math.sqrt(1 - t * t);
|
|
501
501
|
}
|
|
502
|
-
const
|
|
503
|
-
function
|
|
502
|
+
const si = ["duration", "bounce"], ii = ["stiffness", "damping", "mass"];
|
|
503
|
+
function Ft(e, t) {
|
|
504
504
|
return t.some((n) => e[n] !== void 0);
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function ri(e) {
|
|
507
507
|
let t = {
|
|
508
508
|
velocity: M.velocity,
|
|
509
509
|
stiffness: M.stiffness,
|
|
@@ -512,9 +512,9 @@ function si(e) {
|
|
|
512
512
|
isResolvedFromDuration: !1,
|
|
513
513
|
...e
|
|
514
514
|
};
|
|
515
|
-
if (!
|
|
515
|
+
if (!Ft(e, ii) && Ft(e, si))
|
|
516
516
|
if (e.visualDuration) {
|
|
517
|
-
const n = e.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 *
|
|
517
|
+
const n = e.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 * Y(0.05, 1, 1 - (e.bounce || 0)) * Math.sqrt(i);
|
|
518
518
|
t = {
|
|
519
519
|
...t,
|
|
520
520
|
mass: M.mass,
|
|
@@ -522,7 +522,7 @@ function si(e) {
|
|
|
522
522
|
damping: r
|
|
523
523
|
};
|
|
524
524
|
} else {
|
|
525
|
-
const n =
|
|
525
|
+
const n = ei(e);
|
|
526
526
|
t = {
|
|
527
527
|
...t,
|
|
528
528
|
...n,
|
|
@@ -531,21 +531,21 @@ function si(e) {
|
|
|
531
531
|
}
|
|
532
532
|
return t;
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function ce(e = M.visualDuration, t = M.bounce) {
|
|
535
535
|
const n = typeof e != "object" ? {
|
|
536
536
|
visualDuration: e,
|
|
537
537
|
keyframes: [0, 1],
|
|
538
538
|
bounce: t
|
|
539
539
|
} : e;
|
|
540
540
|
let { restSpeed: s, restDelta: i } = n;
|
|
541
|
-
const r = n.keyframes[0], a = n.keyframes[n.keyframes.length - 1], o = { done: !1, value: r }, { stiffness: l, damping: c, mass: u, duration: f, velocity: h, isResolvedFromDuration: m } =
|
|
541
|
+
const r = n.keyframes[0], a = n.keyframes[n.keyframes.length - 1], o = { done: !1, value: r }, { stiffness: l, damping: c, mass: u, duration: f, velocity: h, isResolvedFromDuration: m } = ri({
|
|
542
542
|
...n,
|
|
543
|
-
velocity: -/* @__PURE__ */
|
|
544
|
-
}), b = h || 0, y = c / (2 * Math.sqrt(l * u)), v = a - r, T = /* @__PURE__ */
|
|
545
|
-
s || (s =
|
|
543
|
+
velocity: -/* @__PURE__ */ P(n.velocity || 0)
|
|
544
|
+
}), b = h || 0, y = c / (2 * Math.sqrt(l * u)), v = a - r, T = /* @__PURE__ */ P(Math.sqrt(l / u)), A = Math.abs(v) < 5;
|
|
545
|
+
s || (s = A ? M.restSpeed.granular : M.restSpeed.default), i || (i = A ? M.restDelta.granular : M.restDelta.default);
|
|
546
546
|
let V;
|
|
547
547
|
if (y < 1) {
|
|
548
|
-
const p =
|
|
548
|
+
const p = Be(T, y);
|
|
549
549
|
V = (S) => {
|
|
550
550
|
const C = Math.exp(-y * T * S);
|
|
551
551
|
return a - C * ((b + y * T * v) / p * Math.sin(p * S) + v * Math.cos(p * S));
|
|
@@ -567,14 +567,14 @@ function le(e = M.visualDuration, t = M.bounce) {
|
|
|
567
567
|
o.done = p >= f;
|
|
568
568
|
else {
|
|
569
569
|
let C = p === 0 ? b : 0;
|
|
570
|
-
y < 1 && (C = p === 0 ? /* @__PURE__ */
|
|
571
|
-
const g = Math.abs(C) <= s,
|
|
572
|
-
o.done = g &&
|
|
570
|
+
y < 1 && (C = p === 0 ? /* @__PURE__ */ O(b) : Mn(V, p, S));
|
|
571
|
+
const g = Math.abs(C) <= s, x = Math.abs(a - S) <= i;
|
|
572
|
+
o.done = g && x;
|
|
573
573
|
}
|
|
574
574
|
return o.value = o.done ? a : S, o;
|
|
575
575
|
},
|
|
576
576
|
toString: () => {
|
|
577
|
-
const p = Math.min(
|
|
577
|
+
const p = Math.min(it(w), xe), S = xn((C) => w.next(p * C).value, p, 30);
|
|
578
578
|
return p + "ms " + S;
|
|
579
579
|
},
|
|
580
580
|
toTransition: () => {
|
|
@@ -582,9 +582,9 @@ function le(e = M.visualDuration, t = M.bounce) {
|
|
|
582
582
|
};
|
|
583
583
|
return w;
|
|
584
584
|
}
|
|
585
|
-
|
|
586
|
-
const t =
|
|
587
|
-
return e.ease = t.ease, e.duration = /* @__PURE__ */
|
|
585
|
+
ce.applyToOptions = (e) => {
|
|
586
|
+
const t = An(e, 100, ce);
|
|
587
|
+
return e.ease = t.ease, e.duration = /* @__PURE__ */ O(t.duration), e.type = "keyframes", e;
|
|
588
588
|
};
|
|
589
589
|
function Ie({ keyframes: e, velocity: t = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: a, min: o, max: l, restDelta: c = 0.5, restSpeed: u }) {
|
|
590
590
|
const f = e[0], h = {
|
|
@@ -594,15 +594,15 @@ function Ie({ keyframes: e, velocity: t = 0, power: n = 0.8, timeConstant: s = 3
|
|
|
594
594
|
let y = n * t;
|
|
595
595
|
const v = f + y, T = a === void 0 ? v : a(v);
|
|
596
596
|
T !== v && (y = T - f);
|
|
597
|
-
const
|
|
598
|
-
const
|
|
599
|
-
h.done = Math.abs(
|
|
597
|
+
const A = (g) => -y * Math.exp(-g / s), V = (g) => T + A(g), w = (g) => {
|
|
598
|
+
const x = A(g), E = V(g);
|
|
599
|
+
h.done = Math.abs(x) <= c, h.value = h.done ? T : E;
|
|
600
600
|
};
|
|
601
601
|
let p, S;
|
|
602
602
|
const C = (g) => {
|
|
603
|
-
m(h.value) && (p = g, S =
|
|
603
|
+
m(h.value) && (p = g, S = ce({
|
|
604
604
|
keyframes: [h.value, b(h.value)],
|
|
605
|
-
velocity:
|
|
605
|
+
velocity: Mn(V, g, h.value),
|
|
606
606
|
// TODO: This should be passing * 1000
|
|
607
607
|
damping: i,
|
|
608
608
|
stiffness: r,
|
|
@@ -613,24 +613,24 @@ function Ie({ keyframes: e, velocity: t = 0, power: n = 0.8, timeConstant: s = 3
|
|
|
613
613
|
return C(0), {
|
|
614
614
|
calculatedDuration: null,
|
|
615
615
|
next: (g) => {
|
|
616
|
-
let
|
|
617
|
-
return !S && p === void 0 && (
|
|
616
|
+
let x = !1;
|
|
617
|
+
return !S && p === void 0 && (x = !0, w(g), C(g)), p !== void 0 && g >= p ? S.next(g - p) : (!x && w(g), h);
|
|
618
618
|
}
|
|
619
619
|
};
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
const s = [], i = n ||
|
|
621
|
+
function ai(e, t, n) {
|
|
622
|
+
const s = [], i = n || I.mix || wn, r = e.length - 1;
|
|
623
623
|
for (let a = 0; a < r; a++) {
|
|
624
624
|
let o = i(e[a], e[a + 1]);
|
|
625
625
|
if (t) {
|
|
626
|
-
const l = Array.isArray(t) ? t[a] ||
|
|
627
|
-
o =
|
|
626
|
+
const l = Array.isArray(t) ? t[a] || H : t;
|
|
627
|
+
o = He(l, o);
|
|
628
628
|
}
|
|
629
629
|
s.push(o);
|
|
630
630
|
}
|
|
631
631
|
return s;
|
|
632
632
|
}
|
|
633
|
-
function
|
|
633
|
+
function oi(e, t, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
634
634
|
const r = e.length;
|
|
635
635
|
if (k(r === t.length, "Both input and output ranges must be the same length", "range-length"), r === 1)
|
|
636
636
|
return () => t[0];
|
|
@@ -638,68 +638,68 @@ function ri(e, t, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
|
638
638
|
return () => t[1];
|
|
639
639
|
const a = e[0] === e[1];
|
|
640
640
|
e[0] > e[r - 1] && (e = [...e].reverse(), t = [...t].reverse());
|
|
641
|
-
const o =
|
|
641
|
+
const o = ai(t, s, i), l = o.length, c = (u) => {
|
|
642
642
|
if (a && u < e[0])
|
|
643
643
|
return t[0];
|
|
644
644
|
let f = 0;
|
|
645
645
|
if (l > 1)
|
|
646
646
|
for (; f < e.length - 2 && !(u < e[f + 1]); f++)
|
|
647
647
|
;
|
|
648
|
-
const h = /* @__PURE__ */
|
|
648
|
+
const h = /* @__PURE__ */ Ze(e[f], e[f + 1], u);
|
|
649
649
|
return o[f](h);
|
|
650
650
|
};
|
|
651
|
-
return n ? (u) => c(
|
|
651
|
+
return n ? (u) => c(Y(e[0], e[r - 1], u)) : c;
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function Cn(e, t) {
|
|
654
654
|
const n = e[e.length - 1];
|
|
655
655
|
for (let s = 1; s <= t; s++) {
|
|
656
|
-
const i = /* @__PURE__ */
|
|
657
|
-
e.push(
|
|
656
|
+
const i = /* @__PURE__ */ Ze(0, t, s);
|
|
657
|
+
e.push(J(n, 1, i));
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function Fn(e) {
|
|
661
661
|
const t = [0];
|
|
662
|
-
return
|
|
662
|
+
return Cn(t, e.length - 1), t;
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function li(e, t) {
|
|
665
665
|
return e.map((n) => n * t);
|
|
666
666
|
}
|
|
667
|
-
function
|
|
668
|
-
return e.map(() => t ||
|
|
667
|
+
function ui(e, t) {
|
|
668
|
+
return e.map(() => t || cn).splice(0, e.length - 1);
|
|
669
669
|
}
|
|
670
|
-
function
|
|
671
|
-
const i =
|
|
670
|
+
function X({ duration: e = 300, keyframes: t, times: n, ease: s = "easeInOut" }) {
|
|
671
|
+
const i = fn(s) ? s.map(wt) : wt(s), r = {
|
|
672
672
|
done: !1,
|
|
673
673
|
value: t[0]
|
|
674
|
-
}, a =
|
|
674
|
+
}, a = li(
|
|
675
675
|
// Only use the provided offsets if they're the correct length
|
|
676
676
|
// TODO Maybe we should warn here if there's a length mismatch
|
|
677
|
-
n && n.length === t.length ? n :
|
|
677
|
+
n && n.length === t.length ? n : Fn(t),
|
|
678
678
|
e
|
|
679
|
-
), o =
|
|
680
|
-
ease: Array.isArray(i) ? i :
|
|
679
|
+
), o = oi(a, t, {
|
|
680
|
+
ease: Array.isArray(i) ? i : ui(t, i)
|
|
681
681
|
});
|
|
682
682
|
return {
|
|
683
683
|
calculatedDuration: e,
|
|
684
684
|
next: (l) => (r.value = o(l), r.done = l >= e, r)
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
|
-
const
|
|
688
|
-
function
|
|
689
|
-
const r = e.filter(
|
|
687
|
+
const ci = (e) => e !== null;
|
|
688
|
+
function rt(e, { repeat: t, repeatType: n = "loop" }, s, i = 1) {
|
|
689
|
+
const r = e.filter(ci), o = i < 0 || t && n !== "loop" && t % 2 === 1 ? 0 : r.length - 1;
|
|
690
690
|
return !o || s === void 0 ? r[o] : s;
|
|
691
691
|
}
|
|
692
|
-
const
|
|
692
|
+
const fi = {
|
|
693
693
|
decay: Ie,
|
|
694
694
|
inertia: Ie,
|
|
695
|
-
tween:
|
|
696
|
-
keyframes:
|
|
697
|
-
spring:
|
|
695
|
+
tween: X,
|
|
696
|
+
keyframes: X,
|
|
697
|
+
spring: ce
|
|
698
698
|
};
|
|
699
|
-
function
|
|
700
|
-
typeof e.type == "string" && (e.type =
|
|
699
|
+
function Dn(e) {
|
|
700
|
+
typeof e.type == "string" && (e.type = fi[e.type]);
|
|
701
701
|
}
|
|
702
|
-
class
|
|
702
|
+
class at {
|
|
703
703
|
constructor() {
|
|
704
704
|
this.updateFinished();
|
|
705
705
|
}
|
|
@@ -723,27 +723,27 @@ class rt {
|
|
|
723
723
|
return this.finished.then(t, n);
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
|
-
const
|
|
727
|
-
class
|
|
726
|
+
const hi = (e) => e / 100;
|
|
727
|
+
class ot extends at {
|
|
728
728
|
constructor(t) {
|
|
729
729
|
super(), this.state = "idle", this.startTime = null, this.isStopped = !1, this.currentTime = 0, this.holdTime = null, this.playbackSpeed = 1, this.stop = () => {
|
|
730
730
|
const { motionValue: n } = this.options;
|
|
731
|
-
n && n.updatedAt !==
|
|
731
|
+
n && n.updatedAt !== R.now() && this.tick(R.now()), this.isStopped = !0, this.state !== "idle" && (this.teardown(), this.options.onStop?.());
|
|
732
732
|
}, this.options = t, this.initAnimation(), this.play(), t.autoplay === !1 && this.pause();
|
|
733
733
|
}
|
|
734
734
|
initAnimation() {
|
|
735
735
|
const { options: t } = this;
|
|
736
|
-
|
|
737
|
-
const { type: n =
|
|
736
|
+
Dn(t);
|
|
737
|
+
const { type: n = X, repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: a = 0 } = t;
|
|
738
738
|
let { keyframes: o } = t;
|
|
739
|
-
const l = n ||
|
|
740
|
-
process.env.NODE_ENV !== "production" && l !==
|
|
739
|
+
const l = n || X;
|
|
740
|
+
process.env.NODE_ENV !== "production" && l !== X && k(o.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`, "spring-two-frames"), l !== X && typeof o[0] != "number" && (this.mixKeyframes = He(hi, wn(o[0], o[1])), o = [0, 100]);
|
|
741
741
|
const c = l({ ...t, keyframes: o });
|
|
742
742
|
r === "mirror" && (this.mirroredGenerator = l({
|
|
743
743
|
...t,
|
|
744
744
|
keyframes: [...o].reverse(),
|
|
745
745
|
velocity: -a
|
|
746
|
-
})), c.calculatedDuration === null && (c.calculatedDuration =
|
|
746
|
+
})), c.calculatedDuration === null && (c.calculatedDuration = it(c));
|
|
747
747
|
const { calculatedDuration: u } = c;
|
|
748
748
|
this.calculatedDuration = u, this.resolvedDuration = u + i, this.totalDuration = this.resolvedDuration * (s + 1) - i, this.generator = c;
|
|
749
749
|
}
|
|
@@ -757,20 +757,20 @@ class at extends rt {
|
|
|
757
757
|
return s.next(0);
|
|
758
758
|
const { delay: c = 0, keyframes: u, repeat: f, repeatType: h, repeatDelay: m, type: b, onUpdate: y, finalKeyframe: v } = this.options;
|
|
759
759
|
this.speed > 0 ? this.startTime = Math.min(this.startTime, t) : this.speed < 0 && (this.startTime = Math.min(t - i / this.speed, this.startTime)), n ? this.currentTime = t : this.updateTime(t);
|
|
760
|
-
const T = this.currentTime - c * (this.playbackSpeed >= 0 ? 1 : -1),
|
|
760
|
+
const T = this.currentTime - c * (this.playbackSpeed >= 0 ? 1 : -1), A = this.playbackSpeed >= 0 ? T < 0 : T > i;
|
|
761
761
|
this.currentTime = Math.max(T, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = i);
|
|
762
762
|
let V = this.currentTime, w = s;
|
|
763
763
|
if (f) {
|
|
764
764
|
const g = Math.min(this.currentTime, i) / o;
|
|
765
|
-
let
|
|
766
|
-
!E && g >= 1 && (E = 1), E === 1 &&
|
|
765
|
+
let x = Math.floor(g), E = g % 1;
|
|
766
|
+
!E && g >= 1 && (E = 1), E === 1 && x--, x = Math.min(x, f + 1), !!(x % 2) && (h === "reverse" ? (E = 1 - E, m && (E -= m / o)) : h === "mirror" && (w = a)), V = Y(0, 1, E) * o;
|
|
767
767
|
}
|
|
768
|
-
const p =
|
|
768
|
+
const p = A ? { done: !1, value: u[0] } : w.next(V);
|
|
769
769
|
r && (p.value = r(p.value));
|
|
770
770
|
let { done: S } = p;
|
|
771
|
-
!
|
|
771
|
+
!A && l !== null && (S = this.playbackSpeed >= 0 ? this.currentTime >= i : this.currentTime <= 0);
|
|
772
772
|
const C = this.holdTime === null && (this.state === "finished" || this.state === "running" && S);
|
|
773
|
-
return C && b !== Ie && (p.value =
|
|
773
|
+
return C && b !== Ie && (p.value = rt(u, this.options, v, this.speed)), y && y(p.value), C && this.finish(), p;
|
|
774
774
|
}
|
|
775
775
|
/**
|
|
776
776
|
* Allows the returned animation to be awaited or promise-chained. Currently
|
|
@@ -781,36 +781,36 @@ class at extends rt {
|
|
|
781
781
|
return this.finished.then(t, n);
|
|
782
782
|
}
|
|
783
783
|
get duration() {
|
|
784
|
-
return /* @__PURE__ */
|
|
784
|
+
return /* @__PURE__ */ P(this.calculatedDuration);
|
|
785
785
|
}
|
|
786
786
|
get iterationDuration() {
|
|
787
787
|
const { delay: t = 0 } = this.options || {};
|
|
788
|
-
return this.duration + /* @__PURE__ */
|
|
788
|
+
return this.duration + /* @__PURE__ */ P(t);
|
|
789
789
|
}
|
|
790
790
|
get time() {
|
|
791
|
-
return /* @__PURE__ */
|
|
791
|
+
return /* @__PURE__ */ P(this.currentTime);
|
|
792
792
|
}
|
|
793
793
|
set time(t) {
|
|
794
|
-
t = /* @__PURE__ */
|
|
794
|
+
t = /* @__PURE__ */ O(t), this.currentTime = t, this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0 ? this.holdTime = t : this.driver && (this.startTime = this.driver.now() - t / this.playbackSpeed), this.driver?.start(!1);
|
|
795
795
|
}
|
|
796
796
|
get speed() {
|
|
797
797
|
return this.playbackSpeed;
|
|
798
798
|
}
|
|
799
799
|
set speed(t) {
|
|
800
|
-
this.updateTime(
|
|
800
|
+
this.updateTime(R.now());
|
|
801
801
|
const n = this.playbackSpeed !== t;
|
|
802
|
-
this.playbackSpeed = t, n && (this.time = /* @__PURE__ */
|
|
802
|
+
this.playbackSpeed = t, n && (this.time = /* @__PURE__ */ P(this.currentTime));
|
|
803
803
|
}
|
|
804
804
|
play() {
|
|
805
805
|
if (this.isStopped)
|
|
806
806
|
return;
|
|
807
|
-
const { driver: t =
|
|
807
|
+
const { driver: t = Js, startTime: n } = this.options;
|
|
808
808
|
this.driver || (this.driver = t((i) => this.tick(i))), this.options.onPlay?.();
|
|
809
809
|
const s = this.driver.now();
|
|
810
810
|
this.state === "finished" ? (this.updateFinished(), this.startTime = s) : this.holdTime !== null ? this.startTime = s - this.holdTime : this.startTime || (this.startTime = n ?? s), this.state === "finished" && this.speed < 0 && (this.startTime += this.calculatedDuration), this.holdTime = null, this.state = "running", this.driver.start();
|
|
811
811
|
}
|
|
812
812
|
pause() {
|
|
813
|
-
this.state = "paused", this.updateTime(
|
|
813
|
+
this.state = "paused", this.updateTime(R.now()), this.holdTime = this.currentTime;
|
|
814
814
|
}
|
|
815
815
|
complete() {
|
|
816
816
|
this.state !== "running" && this.play(), this.state = "finished", this.holdTime = null;
|
|
@@ -834,14 +834,14 @@ class at extends rt {
|
|
|
834
834
|
return this.options.allowFlatten && (this.options.type = "keyframes", this.options.ease = "linear", this.initAnimation()), this.driver?.stop(), t.observe(this);
|
|
835
835
|
}
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function di(e) {
|
|
838
838
|
for (let t = 1; t < e.length; t++)
|
|
839
839
|
e[t] ?? (e[t] = e[t - 1]);
|
|
840
840
|
}
|
|
841
|
-
const
|
|
842
|
-
const t =
|
|
843
|
-
return
|
|
844
|
-
},
|
|
841
|
+
const U = (e) => e * 180 / Math.PI, Ke = (e) => {
|
|
842
|
+
const t = U(Math.atan2(e[1], e[0]));
|
|
843
|
+
return Le(t);
|
|
844
|
+
}, pi = {
|
|
845
845
|
x: 4,
|
|
846
846
|
y: 5,
|
|
847
847
|
translateX: 4,
|
|
@@ -849,56 +849,56 @@ const _ = (e) => e * 180 / Math.PI, Be = (e) => {
|
|
|
849
849
|
scaleX: 0,
|
|
850
850
|
scaleY: 3,
|
|
851
851
|
scale: (e) => (Math.abs(e[0]) + Math.abs(e[3])) / 2,
|
|
852
|
-
rotate:
|
|
853
|
-
rotateZ:
|
|
854
|
-
skewX: (e) =>
|
|
855
|
-
skewY: (e) =>
|
|
852
|
+
rotate: Ke,
|
|
853
|
+
rotateZ: Ke,
|
|
854
|
+
skewX: (e) => U(Math.atan(e[1])),
|
|
855
|
+
skewY: (e) => U(Math.atan(e[2])),
|
|
856
856
|
skew: (e) => (Math.abs(e[1]) + Math.abs(e[2])) / 2
|
|
857
|
-
},
|
|
857
|
+
}, Le = (e) => (e = e % 360, e < 0 && (e += 360), e), Dt = Ke, Et = (e) => Math.sqrt(e[0] * e[0] + e[1] * e[1]), Rt = (e) => Math.sqrt(e[4] * e[4] + e[5] * e[5]), mi = {
|
|
858
858
|
x: 12,
|
|
859
859
|
y: 13,
|
|
860
860
|
z: 14,
|
|
861
861
|
translateX: 12,
|
|
862
862
|
translateY: 13,
|
|
863
863
|
translateZ: 14,
|
|
864
|
-
scaleX:
|
|
865
|
-
scaleY:
|
|
866
|
-
scale: (e) => (
|
|
867
|
-
rotateX: (e) =>
|
|
868
|
-
rotateY: (e) =>
|
|
864
|
+
scaleX: Et,
|
|
865
|
+
scaleY: Rt,
|
|
866
|
+
scale: (e) => (Et(e) + Rt(e)) / 2,
|
|
867
|
+
rotateX: (e) => Le(U(Math.atan2(e[6], e[5]))),
|
|
868
|
+
rotateY: (e) => Le(U(Math.atan2(-e[2], e[0]))),
|
|
869
869
|
rotateZ: Dt,
|
|
870
870
|
rotate: Dt,
|
|
871
|
-
skewX: (e) =>
|
|
872
|
-
skewY: (e) =>
|
|
871
|
+
skewX: (e) => U(Math.atan(e[4])),
|
|
872
|
+
skewY: (e) => U(Math.atan(e[1])),
|
|
873
873
|
skew: (e) => (Math.abs(e[1]) + Math.abs(e[4])) / 2
|
|
874
874
|
};
|
|
875
875
|
function $e(e) {
|
|
876
876
|
return e.includes("scale") ? 1 : 0;
|
|
877
877
|
}
|
|
878
|
-
function
|
|
878
|
+
function We(e, t) {
|
|
879
879
|
if (!e || e === "none")
|
|
880
880
|
return $e(t);
|
|
881
881
|
const n = e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
|
|
882
882
|
let s, i;
|
|
883
883
|
if (n)
|
|
884
|
-
s =
|
|
884
|
+
s = mi, i = n;
|
|
885
885
|
else {
|
|
886
886
|
const o = e.match(/^matrix\(([-\d.e\s,]+)\)$/u);
|
|
887
|
-
s =
|
|
887
|
+
s = pi, i = o;
|
|
888
888
|
}
|
|
889
889
|
if (!i)
|
|
890
890
|
return $e(t);
|
|
891
|
-
const r = s[t], a = i[1].split(",").map(
|
|
891
|
+
const r = s[t], a = i[1].split(",").map(yi);
|
|
892
892
|
return typeof r == "function" ? r(a) : a[r];
|
|
893
893
|
}
|
|
894
|
-
const
|
|
894
|
+
const gi = (e, t) => {
|
|
895
895
|
const { transform: n = "none" } = getComputedStyle(e);
|
|
896
|
-
return
|
|
896
|
+
return We(n, t);
|
|
897
897
|
};
|
|
898
|
-
function
|
|
898
|
+
function yi(e) {
|
|
899
899
|
return parseFloat(e.trim());
|
|
900
900
|
}
|
|
901
|
-
const
|
|
901
|
+
const Q = [
|
|
902
902
|
"transformPerspective",
|
|
903
903
|
"x",
|
|
904
904
|
"y",
|
|
@@ -916,15 +916,15 @@ const J = [
|
|
|
916
916
|
"skew",
|
|
917
917
|
"skewX",
|
|
918
918
|
"skewY"
|
|
919
|
-
],
|
|
920
|
-
function
|
|
919
|
+
], ee = new Set(Q), Pt = (e) => e === Z || e === d, bi = /* @__PURE__ */ new Set(["x", "y", "z"]), Ti = Q.filter((e) => !bi.has(e));
|
|
920
|
+
function vi(e) {
|
|
921
921
|
const t = [];
|
|
922
|
-
return
|
|
922
|
+
return Ti.forEach((n) => {
|
|
923
923
|
const s = e.getValue(n);
|
|
924
924
|
s !== void 0 && (t.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
|
|
925
925
|
}), t;
|
|
926
926
|
}
|
|
927
|
-
const
|
|
927
|
+
const j = {
|
|
928
928
|
// Dimensions
|
|
929
929
|
width: ({ x: e }, { paddingLeft: t = "0", paddingRight: n = "0" }) => e.max - e.min - parseFloat(t) - parseFloat(n),
|
|
930
930
|
height: ({ y: e }, { paddingTop: t = "0", paddingBottom: n = "0" }) => e.max - e.min - parseFloat(t) - parseFloat(n),
|
|
@@ -933,18 +933,18 @@ const U = {
|
|
|
933
933
|
bottom: ({ y: e }, { top: t }) => parseFloat(t) + (e.max - e.min),
|
|
934
934
|
right: ({ x: e }, { left: t }) => parseFloat(t) + (e.max - e.min),
|
|
935
935
|
// Transform
|
|
936
|
-
x: (e, { transform: t }) =>
|
|
937
|
-
y: (e, { transform: t }) =>
|
|
936
|
+
x: (e, { transform: t }) => We(t, "x"),
|
|
937
|
+
y: (e, { transform: t }) => We(t, "y")
|
|
938
938
|
};
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
const
|
|
942
|
-
let
|
|
943
|
-
function
|
|
944
|
-
if (
|
|
945
|
-
const e = Array.from(
|
|
939
|
+
j.translateX = j.x;
|
|
940
|
+
j.translateY = j.y;
|
|
941
|
+
const G = /* @__PURE__ */ new Set();
|
|
942
|
+
let _e = !1, Ue = !1, je = !1;
|
|
943
|
+
function En() {
|
|
944
|
+
if (Ue) {
|
|
945
|
+
const e = Array.from(G).filter((s) => s.needsMeasurement), t = new Set(e.map((s) => s.element)), n = /* @__PURE__ */ new Map();
|
|
946
946
|
t.forEach((s) => {
|
|
947
|
-
const i =
|
|
947
|
+
const i = vi(s);
|
|
948
948
|
i.length && (n.set(s, i), s.render());
|
|
949
949
|
}), e.forEach((s) => s.measureInitialState()), t.forEach((s) => {
|
|
950
950
|
s.render();
|
|
@@ -956,22 +956,22 @@ function Dn() {
|
|
|
956
956
|
s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
|
|
957
957
|
});
|
|
958
958
|
}
|
|
959
|
-
|
|
959
|
+
Ue = !1, _e = !1, G.forEach((e) => e.complete(je)), G.clear();
|
|
960
960
|
}
|
|
961
|
-
function
|
|
962
|
-
|
|
963
|
-
e.readKeyframes(), e.needsMeasurement && (
|
|
961
|
+
function Rn() {
|
|
962
|
+
G.forEach((e) => {
|
|
963
|
+
e.readKeyframes(), e.needsMeasurement && (Ue = !0);
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
|
-
function
|
|
967
|
-
|
|
966
|
+
function Vi() {
|
|
967
|
+
je = !0, Rn(), En(), je = !1;
|
|
968
968
|
}
|
|
969
|
-
class
|
|
969
|
+
class lt {
|
|
970
970
|
constructor(t, n, s, i, r, a = !1) {
|
|
971
971
|
this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...t], this.onComplete = n, this.name = s, this.motionValue = i, this.element = r, this.isAsync = a;
|
|
972
972
|
}
|
|
973
973
|
scheduleResolve() {
|
|
974
|
-
this.state = "scheduled", this.isAsync ? (
|
|
974
|
+
this.state = "scheduled", this.isAsync ? (G.add(this), _e || (_e = !0, K.read(Rn), K.resolveKeyframes(En))) : (this.readKeyframes(), this.complete());
|
|
975
975
|
}
|
|
976
976
|
readKeyframes() {
|
|
977
977
|
const { unresolvedKeyframes: t, name: n, element: s, motionValue: i } = this;
|
|
@@ -985,7 +985,7 @@ class ot {
|
|
|
985
985
|
}
|
|
986
986
|
t[0] === void 0 && (t[0] = a), i && r === void 0 && i.set(t[0]);
|
|
987
987
|
}
|
|
988
|
-
|
|
988
|
+
di(t);
|
|
989
989
|
}
|
|
990
990
|
setFinalKeyframe() {
|
|
991
991
|
}
|
|
@@ -996,52 +996,52 @@ class ot {
|
|
|
996
996
|
measureEndState() {
|
|
997
997
|
}
|
|
998
998
|
complete(t = !1) {
|
|
999
|
-
this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, t),
|
|
999
|
+
this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, t), G.delete(this);
|
|
1000
1000
|
}
|
|
1001
1001
|
cancel() {
|
|
1002
|
-
this.state === "scheduled" && (
|
|
1002
|
+
this.state === "scheduled" && (G.delete(this), this.state = "pending");
|
|
1003
1003
|
}
|
|
1004
1004
|
resume() {
|
|
1005
1005
|
this.state === "pending" && this.scheduleResolve();
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|
|
1008
|
-
const
|
|
1009
|
-
function
|
|
1010
|
-
|
|
1008
|
+
const Si = (e) => e.startsWith("--");
|
|
1009
|
+
function wi(e, t, n) {
|
|
1010
|
+
Si(t) ? e.style.setProperty(t, n) : e.style[t] = n;
|
|
1011
1011
|
}
|
|
1012
|
-
const
|
|
1013
|
-
function
|
|
1014
|
-
const n = /* @__PURE__ */
|
|
1015
|
-
return () =>
|
|
1012
|
+
const xi = /* @__PURE__ */ qe(() => window.ScrollTimeline !== void 0), Ai = {};
|
|
1013
|
+
function Mi(e, t) {
|
|
1014
|
+
const n = /* @__PURE__ */ qe(e);
|
|
1015
|
+
return () => Ai[t] ?? n();
|
|
1016
1016
|
}
|
|
1017
|
-
const
|
|
1017
|
+
const Pn = /* @__PURE__ */ Mi(() => {
|
|
1018
1018
|
try {
|
|
1019
1019
|
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
1020
1020
|
} catch {
|
|
1021
1021
|
return !1;
|
|
1022
1022
|
}
|
|
1023
1023
|
return !0;
|
|
1024
|
-
}, "linearEasing"),
|
|
1024
|
+
}, "linearEasing"), ae = ([e, t, n, s]) => `cubic-bezier(${e}, ${t}, ${n}, ${s})`, Ot = {
|
|
1025
1025
|
linear: "linear",
|
|
1026
1026
|
ease: "ease",
|
|
1027
1027
|
easeIn: "ease-in",
|
|
1028
1028
|
easeOut: "ease-out",
|
|
1029
1029
|
easeInOut: "ease-in-out",
|
|
1030
|
-
circIn: /* @__PURE__ */
|
|
1031
|
-
circOut: /* @__PURE__ */
|
|
1032
|
-
backIn: /* @__PURE__ */
|
|
1033
|
-
backOut: /* @__PURE__ */
|
|
1030
|
+
circIn: /* @__PURE__ */ ae([0, 0.65, 0.55, 1]),
|
|
1031
|
+
circOut: /* @__PURE__ */ ae([0.55, 0, 1, 0.45]),
|
|
1032
|
+
backIn: /* @__PURE__ */ ae([0.31, 0.01, 0.66, -0.59]),
|
|
1033
|
+
backOut: /* @__PURE__ */ ae([0.33, 1.53, 0.69, 0.99])
|
|
1034
1034
|
};
|
|
1035
|
-
function
|
|
1035
|
+
function On(e, t) {
|
|
1036
1036
|
if (e)
|
|
1037
|
-
return typeof e == "function" ?
|
|
1037
|
+
return typeof e == "function" ? Pn() ? xn(e, t) : "ease-out" : dn(e) ? ae(e) : Array.isArray(e) ? e.map((n) => On(n, t) || Ot.easeOut) : Ot[e];
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function Ci(e, t, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: a = "loop", ease: o = "easeOut", times: l } = {}, c = void 0) {
|
|
1040
1040
|
const u = {
|
|
1041
1041
|
[t]: n
|
|
1042
1042
|
};
|
|
1043
1043
|
l && (u.offset = l);
|
|
1044
|
-
const f =
|
|
1044
|
+
const f = On(o, i);
|
|
1045
1045
|
Array.isArray(f) && (u.easing = f);
|
|
1046
1046
|
const h = {
|
|
1047
1047
|
delay: s,
|
|
@@ -1053,23 +1053,23 @@ function xi(e, t, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatTyp
|
|
|
1053
1053
|
};
|
|
1054
1054
|
return c && (h.pseudoElement = c), e.animate(u, h);
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function ut(e) {
|
|
1057
1057
|
return typeof e == "function" && "applyToOptions" in e;
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1060
|
-
return
|
|
1059
|
+
function Fi({ type: e, ...t }) {
|
|
1060
|
+
return ut(e) && Pn() ? e.applyToOptions(t) : (t.duration ?? (t.duration = 300), t.ease ?? (t.ease = "easeOut"), t);
|
|
1061
1061
|
}
|
|
1062
|
-
class
|
|
1062
|
+
class Di extends at {
|
|
1063
1063
|
constructor(t) {
|
|
1064
1064
|
if (super(), this.finishedTime = null, this.isStopped = !1, !t)
|
|
1065
1065
|
return;
|
|
1066
1066
|
const { element: n, name: s, keyframes: i, pseudoElement: r, allowFlatten: a = !1, finalKeyframe: o, onComplete: l } = t;
|
|
1067
1067
|
this.isPseudoElement = !!r, this.allowFlatten = a, this.options = t, k(typeof t.type != "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring");
|
|
1068
|
-
const c =
|
|
1069
|
-
this.animation =
|
|
1068
|
+
const c = Fi(t);
|
|
1069
|
+
this.animation = Ci(n, s, i, c, r), c.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
|
|
1070
1070
|
if (this.finishedTime = this.time, !r) {
|
|
1071
|
-
const u =
|
|
1072
|
-
this.updateMotionValue ? this.updateMotionValue(u) :
|
|
1071
|
+
const u = rt(i, this.options, o, this.speed);
|
|
1072
|
+
this.updateMotionValue ? this.updateMotionValue(u) : wi(n, s, u), this.animation.cancel();
|
|
1073
1073
|
}
|
|
1074
1074
|
l?.(), this.notifyFinished();
|
|
1075
1075
|
};
|
|
@@ -1113,17 +1113,17 @@ class Ci extends rt {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
get duration() {
|
|
1115
1115
|
const t = this.animation.effect?.getComputedTiming?.().duration || 0;
|
|
1116
|
-
return /* @__PURE__ */
|
|
1116
|
+
return /* @__PURE__ */ P(Number(t));
|
|
1117
1117
|
}
|
|
1118
1118
|
get iterationDuration() {
|
|
1119
1119
|
const { delay: t = 0 } = this.options || {};
|
|
1120
|
-
return this.duration + /* @__PURE__ */
|
|
1120
|
+
return this.duration + /* @__PURE__ */ P(t);
|
|
1121
1121
|
}
|
|
1122
1122
|
get time() {
|
|
1123
|
-
return /* @__PURE__ */
|
|
1123
|
+
return /* @__PURE__ */ P(Number(this.animation.currentTime) || 0);
|
|
1124
1124
|
}
|
|
1125
1125
|
set time(t) {
|
|
1126
|
-
this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */
|
|
1126
|
+
this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */ O(t);
|
|
1127
1127
|
}
|
|
1128
1128
|
/**
|
|
1129
1129
|
* The playback speed of the animation.
|
|
@@ -1148,24 +1148,24 @@ class Ci extends rt {
|
|
|
1148
1148
|
* Attaches a timeline to the animation, for instance the `ScrollTimeline`.
|
|
1149
1149
|
*/
|
|
1150
1150
|
attachTimeline({ timeline: t, observe: n }) {
|
|
1151
|
-
return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, t &&
|
|
1151
|
+
return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, t && xi() ? (this.animation.timeline = t, H) : n(this);
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
1154
|
-
const
|
|
1155
|
-
anticipate:
|
|
1156
|
-
backInOut:
|
|
1157
|
-
circInOut:
|
|
1154
|
+
const Nn = {
|
|
1155
|
+
anticipate: ln,
|
|
1156
|
+
backInOut: on,
|
|
1157
|
+
circInOut: un
|
|
1158
1158
|
};
|
|
1159
|
-
function
|
|
1160
|
-
return e in
|
|
1159
|
+
function Ei(e) {
|
|
1160
|
+
return e in Nn;
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1163
|
-
typeof e.ease == "string" &&
|
|
1162
|
+
function Ri(e) {
|
|
1163
|
+
typeof e.ease == "string" && Ei(e.ease) && (e.ease = Nn[e.ease]);
|
|
1164
1164
|
}
|
|
1165
|
-
const
|
|
1166
|
-
class
|
|
1165
|
+
const Nt = 10;
|
|
1166
|
+
class Pi extends Di {
|
|
1167
1167
|
constructor(t) {
|
|
1168
|
-
|
|
1168
|
+
Ri(t), Dn(t), super(t), t.startTime && (this.startTime = t.startTime), this.options = t;
|
|
1169
1169
|
}
|
|
1170
1170
|
/**
|
|
1171
1171
|
* WAAPI doesn't natively have any interruption capabilities.
|
|
@@ -1183,17 +1183,17 @@ class Ei extends Ci {
|
|
|
1183
1183
|
n.set(t);
|
|
1184
1184
|
return;
|
|
1185
1185
|
}
|
|
1186
|
-
const o = new
|
|
1186
|
+
const o = new ot({
|
|
1187
1187
|
...a,
|
|
1188
1188
|
autoplay: !1
|
|
1189
|
-
}), l = /* @__PURE__ */
|
|
1190
|
-
n.setWithVelocity(o.sample(l -
|
|
1189
|
+
}), l = /* @__PURE__ */ O(this.finishedTime ?? this.time);
|
|
1190
|
+
n.setWithVelocity(o.sample(l - Nt).value, o.sample(l).value, Nt), o.stop();
|
|
1191
1191
|
}
|
|
1192
1192
|
}
|
|
1193
|
-
const
|
|
1194
|
-
(
|
|
1193
|
+
const kt = (e, t) => t === "zIndex" ? !1 : !!(typeof e == "number" || Array.isArray(e) || typeof e == "string" && // It's animatable if we have a string
|
|
1194
|
+
(W.test(e) || e === "0") && // And it contains numbers and/or colors
|
|
1195
1195
|
!e.startsWith("url("));
|
|
1196
|
-
function
|
|
1196
|
+
function Oi(e) {
|
|
1197
1197
|
const t = e[0];
|
|
1198
1198
|
if (e.length === 1)
|
|
1199
1199
|
return !0;
|
|
@@ -1201,43 +1201,43 @@ function Pi(e) {
|
|
|
1201
1201
|
if (e[n] !== t)
|
|
1202
1202
|
return !0;
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1204
|
+
function Ni(e, t, n, s) {
|
|
1205
1205
|
const i = e[0];
|
|
1206
1206
|
if (i === null)
|
|
1207
1207
|
return !1;
|
|
1208
1208
|
if (t === "display" || t === "visibility")
|
|
1209
1209
|
return !0;
|
|
1210
|
-
const r = e[e.length - 1], a =
|
|
1211
|
-
return
|
|
1210
|
+
const r = e[e.length - 1], a = kt(i, t), o = kt(r, t);
|
|
1211
|
+
return de(a === o, `You are trying to animate ${t} from "${i}" to "${r}". "${a ? r : i}" is not an animatable value.`, "value-not-animatable"), !a || !o ? !1 : Oi(e) || (n === "spring" || ut(n)) && s;
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function Ge(e) {
|
|
1214
1214
|
e.duration = 0, e.type = "keyframes";
|
|
1215
1215
|
}
|
|
1216
|
-
const
|
|
1216
|
+
const ki = /* @__PURE__ */ new Set([
|
|
1217
1217
|
"opacity",
|
|
1218
1218
|
"clipPath",
|
|
1219
1219
|
"filter",
|
|
1220
1220
|
"transform"
|
|
1221
1221
|
// TODO: Could be re-enabled now we have support for linear() easing
|
|
1222
1222
|
// "background-color"
|
|
1223
|
-
]),
|
|
1224
|
-
function
|
|
1223
|
+
]), Bi = /* @__PURE__ */ qe(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
|
|
1224
|
+
function Ii(e) {
|
|
1225
1225
|
const { motionValue: t, name: n, repeatDelay: s, repeatType: i, damping: r, type: a } = e;
|
|
1226
1226
|
if (!(t?.owner?.current instanceof HTMLElement))
|
|
1227
1227
|
return !1;
|
|
1228
1228
|
const { onUpdate: l, transformTemplate: c } = t.owner.getProps();
|
|
1229
|
-
return
|
|
1229
|
+
return Bi() && n && ki.has(n) && (n !== "transform" || !c) && /**
|
|
1230
1230
|
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
1231
1231
|
* no way to read the value from WAAPI every frame.
|
|
1232
1232
|
*/
|
|
1233
1233
|
!l && !s && i !== "mirror" && r !== 0 && a !== "inertia";
|
|
1234
1234
|
}
|
|
1235
|
-
const
|
|
1236
|
-
class
|
|
1235
|
+
const Ki = 40;
|
|
1236
|
+
class Li extends at {
|
|
1237
1237
|
constructor({ autoplay: t = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: a = "loop", keyframes: o, name: l, motionValue: c, element: u, ...f }) {
|
|
1238
1238
|
super(), this.stop = () => {
|
|
1239
1239
|
this._animation && (this._animation.stop(), this.stopTimeline?.()), this.keyframeResolver?.cancel();
|
|
1240
|
-
}, this.createdAt =
|
|
1240
|
+
}, this.createdAt = R.now();
|
|
1241
1241
|
const h = {
|
|
1242
1242
|
autoplay: t,
|
|
1243
1243
|
delay: n,
|
|
@@ -1249,23 +1249,23 @@ class Bi extends rt {
|
|
|
1249
1249
|
motionValue: c,
|
|
1250
1250
|
element: u,
|
|
1251
1251
|
...f
|
|
1252
|
-
}, m = u?.KeyframeResolver ||
|
|
1252
|
+
}, m = u?.KeyframeResolver || lt;
|
|
1253
1253
|
this.keyframeResolver = new m(o, (b, y, v) => this.onKeyframesResolved(b, y, h, !v), l, c, u), this.keyframeResolver?.scheduleResolve();
|
|
1254
1254
|
}
|
|
1255
1255
|
onKeyframesResolved(t, n, s, i) {
|
|
1256
1256
|
this.keyframeResolver = void 0;
|
|
1257
1257
|
const { name: r, type: a, velocity: o, delay: l, isHandoff: c, onUpdate: u } = s;
|
|
1258
|
-
this.resolvedAt =
|
|
1258
|
+
this.resolvedAt = R.now(), Ni(t, r, a, o) || ((I.instantAnimations || !l) && u?.(rt(t, s, n)), t[0] = t[t.length - 1], Ge(s), s.repeat = 0);
|
|
1259
1259
|
const h = {
|
|
1260
|
-
startTime: i ? this.resolvedAt ? this.resolvedAt - this.createdAt >
|
|
1260
|
+
startTime: i ? this.resolvedAt ? this.resolvedAt - this.createdAt > Ki ? this.resolvedAt : this.createdAt : this.createdAt : void 0,
|
|
1261
1261
|
finalKeyframe: n,
|
|
1262
1262
|
...s,
|
|
1263
1263
|
keyframes: t
|
|
1264
|
-
}, m = !c &&
|
|
1264
|
+
}, m = !c && Ii(h) ? new Pi({
|
|
1265
1265
|
...h,
|
|
1266
1266
|
element: h.motionValue.owner.current
|
|
1267
|
-
}) : new
|
|
1268
|
-
m.finished.then(() => this.notifyFinished()).catch(
|
|
1267
|
+
}) : new ot(h);
|
|
1268
|
+
m.finished.then(() => this.notifyFinished()).catch(H), this.pendingTimeline && (this.stopTimeline = m.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = m;
|
|
1269
1269
|
}
|
|
1270
1270
|
get finished() {
|
|
1271
1271
|
return this._animation ? this.animation.finished : this._finished;
|
|
@@ -1275,7 +1275,7 @@ class Bi extends rt {
|
|
|
1275
1275
|
});
|
|
1276
1276
|
}
|
|
1277
1277
|
get animation() {
|
|
1278
|
-
return this._animation || (this.keyframeResolver?.resume(),
|
|
1278
|
+
return this._animation || (this.keyframeResolver?.resume(), Vi()), this._animation;
|
|
1279
1279
|
}
|
|
1280
1280
|
get duration() {
|
|
1281
1281
|
return this.animation.duration;
|
|
@@ -1317,7 +1317,7 @@ class Bi extends rt {
|
|
|
1317
1317
|
this._animation && this.animation.cancel(), this.keyframeResolver?.cancel();
|
|
1318
1318
|
}
|
|
1319
1319
|
}
|
|
1320
|
-
class
|
|
1320
|
+
class $i {
|
|
1321
1321
|
constructor(t) {
|
|
1322
1322
|
this.stop = () => this.runAll("stop"), this.animations = t.filter(Boolean);
|
|
1323
1323
|
}
|
|
@@ -1361,10 +1361,10 @@ class Ki {
|
|
|
1361
1361
|
return this.getAll("startTime");
|
|
1362
1362
|
}
|
|
1363
1363
|
get duration() {
|
|
1364
|
-
return
|
|
1364
|
+
return Bt(this.animations, "duration");
|
|
1365
1365
|
}
|
|
1366
1366
|
get iterationDuration() {
|
|
1367
|
-
return
|
|
1367
|
+
return Bt(this.animations, "iterationDuration");
|
|
1368
1368
|
}
|
|
1369
1369
|
runAll(t) {
|
|
1370
1370
|
this.animations.forEach((n) => n[t]());
|
|
@@ -1382,7 +1382,7 @@ class Ki {
|
|
|
1382
1382
|
this.runAll("complete");
|
|
1383
1383
|
}
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1385
|
+
function Bt(e, t) {
|
|
1386
1386
|
let n = 0;
|
|
1387
1387
|
for (let s = 0; s < e.length; s++) {
|
|
1388
1388
|
const i = e[s][t];
|
|
@@ -1390,87 +1390,87 @@ function kt(e, t) {
|
|
|
1390
1390
|
}
|
|
1391
1391
|
return n;
|
|
1392
1392
|
}
|
|
1393
|
-
class
|
|
1393
|
+
class Wi extends $i {
|
|
1394
1394
|
then(t, n) {
|
|
1395
1395
|
return this.finished.finally(t).then(() => {
|
|
1396
1396
|
});
|
|
1397
1397
|
}
|
|
1398
1398
|
}
|
|
1399
|
-
const
|
|
1399
|
+
const _i = (
|
|
1400
1400
|
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
1401
1401
|
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
1402
1402
|
);
|
|
1403
|
-
function
|
|
1404
|
-
const t =
|
|
1403
|
+
function Ui(e) {
|
|
1404
|
+
const t = _i.exec(e);
|
|
1405
1405
|
if (!t)
|
|
1406
1406
|
return [,];
|
|
1407
1407
|
const [, n, s, i] = t;
|
|
1408
1408
|
return [`--${n ?? s}`, i];
|
|
1409
1409
|
}
|
|
1410
|
-
const
|
|
1411
|
-
function
|
|
1412
|
-
k(n <=
|
|
1413
|
-
const [s, i] =
|
|
1410
|
+
const ji = 4;
|
|
1411
|
+
function kn(e, t, n = 1) {
|
|
1412
|
+
k(n <= ji, `Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`, "max-css-var-depth");
|
|
1413
|
+
const [s, i] = Ui(e);
|
|
1414
1414
|
if (!s)
|
|
1415
1415
|
return;
|
|
1416
1416
|
const r = window.getComputedStyle(t).getPropertyValue(s);
|
|
1417
1417
|
if (r) {
|
|
1418
1418
|
const a = r.trim();
|
|
1419
|
-
return
|
|
1419
|
+
return Zt(a) ? parseFloat(a) : a;
|
|
1420
1420
|
}
|
|
1421
|
-
return
|
|
1421
|
+
return et(i) ? kn(i, t, n + 1) : i;
|
|
1422
1422
|
}
|
|
1423
|
-
function
|
|
1423
|
+
function Bn(e, t) {
|
|
1424
1424
|
return e?.[t] ?? e?.default ?? e;
|
|
1425
1425
|
}
|
|
1426
|
-
const
|
|
1426
|
+
const In = /* @__PURE__ */ new Set([
|
|
1427
1427
|
"width",
|
|
1428
1428
|
"height",
|
|
1429
1429
|
"top",
|
|
1430
1430
|
"left",
|
|
1431
1431
|
"right",
|
|
1432
1432
|
"bottom",
|
|
1433
|
-
...
|
|
1434
|
-
]),
|
|
1433
|
+
...Q
|
|
1434
|
+
]), Gi = {
|
|
1435
1435
|
test: (e) => e === "auto",
|
|
1436
1436
|
parse: (e) => e
|
|
1437
|
-
},
|
|
1438
|
-
function ji(e) {
|
|
1439
|
-
return typeof e == "number" ? e === 0 : e !== null ? e === "none" || e === "0" || Ht(e) : !0;
|
|
1440
|
-
}
|
|
1441
|
-
const Gi = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
1437
|
+
}, Kn = (e) => (t) => t.test(e), Ln = [Z, d, q, $, Bs, ks, Gi], It = (e) => Ln.find(Kn(e));
|
|
1442
1438
|
function Yi(e) {
|
|
1439
|
+
return typeof e == "number" ? e === 0 : e !== null ? e === "none" || e === "0" || Jt(e) : !0;
|
|
1440
|
+
}
|
|
1441
|
+
const zi = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
1442
|
+
function Xi(e) {
|
|
1443
1443
|
const [t, n] = e.slice(0, -1).split("(");
|
|
1444
1444
|
if (t === "drop-shadow")
|
|
1445
1445
|
return e;
|
|
1446
|
-
const [s] = n.match(
|
|
1446
|
+
const [s] = n.match(tt) || [];
|
|
1447
1447
|
if (!s)
|
|
1448
1448
|
return e;
|
|
1449
1449
|
const i = n.replace(s, "");
|
|
1450
|
-
let r =
|
|
1450
|
+
let r = zi.has(t) ? 1 : 0;
|
|
1451
1451
|
return s !== n && (r *= 100), t + "(" + r + i + ")";
|
|
1452
1452
|
}
|
|
1453
|
-
const
|
|
1454
|
-
...
|
|
1453
|
+
const qi = /\b([a-z-]*)\(.*?\)/gu, Ye = {
|
|
1454
|
+
...W,
|
|
1455
1455
|
getAnimatableNone: (e) => {
|
|
1456
|
-
const t = e.match(
|
|
1457
|
-
return t ? t.map(
|
|
1456
|
+
const t = e.match(qi);
|
|
1457
|
+
return t ? t.map(Xi).join(" ") : e;
|
|
1458
1458
|
}
|
|
1459
|
-
},
|
|
1460
|
-
...
|
|
1459
|
+
}, Kt = {
|
|
1460
|
+
...Z,
|
|
1461
1461
|
transform: Math.round
|
|
1462
|
-
},
|
|
1463
|
-
rotate:
|
|
1464
|
-
rotateX:
|
|
1465
|
-
rotateY:
|
|
1466
|
-
rotateZ:
|
|
1467
|
-
scale:
|
|
1468
|
-
scaleX:
|
|
1469
|
-
scaleY:
|
|
1470
|
-
scaleZ:
|
|
1471
|
-
skew:
|
|
1472
|
-
skewX:
|
|
1473
|
-
skewY:
|
|
1462
|
+
}, Hi = {
|
|
1463
|
+
rotate: $,
|
|
1464
|
+
rotateX: $,
|
|
1465
|
+
rotateY: $,
|
|
1466
|
+
rotateZ: $,
|
|
1467
|
+
scale: Te,
|
|
1468
|
+
scaleX: Te,
|
|
1469
|
+
scaleY: Te,
|
|
1470
|
+
scaleZ: Te,
|
|
1471
|
+
skew: $,
|
|
1472
|
+
skewX: $,
|
|
1473
|
+
skewY: $,
|
|
1474
1474
|
distance: d,
|
|
1475
1475
|
translateX: d,
|
|
1476
1476
|
translateY: d,
|
|
@@ -1480,11 +1480,11 @@ const zi = /\b([a-z-]*)\(.*?\)/gu, Ge = {
|
|
|
1480
1480
|
z: d,
|
|
1481
1481
|
perspective: d,
|
|
1482
1482
|
transformPerspective: d,
|
|
1483
|
-
opacity:
|
|
1484
|
-
originX:
|
|
1485
|
-
originY:
|
|
1483
|
+
opacity: le,
|
|
1484
|
+
originX: xt,
|
|
1485
|
+
originY: xt,
|
|
1486
1486
|
originZ: d
|
|
1487
|
-
},
|
|
1487
|
+
}, ct = {
|
|
1488
1488
|
// Border props
|
|
1489
1489
|
borderWidth: d,
|
|
1490
1490
|
borderTopWidth: d,
|
|
@@ -1520,45 +1520,45 @@ const zi = /\b([a-z-]*)\(.*?\)/gu, Ge = {
|
|
|
1520
1520
|
// Misc
|
|
1521
1521
|
backgroundPositionX: d,
|
|
1522
1522
|
backgroundPositionY: d,
|
|
1523
|
-
...
|
|
1524
|
-
zIndex:
|
|
1523
|
+
...Hi,
|
|
1524
|
+
zIndex: Kt,
|
|
1525
1525
|
// SVG
|
|
1526
|
-
fillOpacity:
|
|
1527
|
-
strokeOpacity:
|
|
1528
|
-
numOctaves:
|
|
1529
|
-
},
|
|
1530
|
-
...
|
|
1526
|
+
fillOpacity: le,
|
|
1527
|
+
strokeOpacity: le,
|
|
1528
|
+
numOctaves: Kt
|
|
1529
|
+
}, Zi = {
|
|
1530
|
+
...ct,
|
|
1531
1531
|
// Color props
|
|
1532
|
-
color:
|
|
1533
|
-
backgroundColor:
|
|
1534
|
-
outlineColor:
|
|
1535
|
-
fill:
|
|
1536
|
-
stroke:
|
|
1532
|
+
color: F,
|
|
1533
|
+
backgroundColor: F,
|
|
1534
|
+
outlineColor: F,
|
|
1535
|
+
fill: F,
|
|
1536
|
+
stroke: F,
|
|
1537
1537
|
// Border props
|
|
1538
|
-
borderColor:
|
|
1539
|
-
borderTopColor:
|
|
1540
|
-
borderRightColor:
|
|
1541
|
-
borderBottomColor:
|
|
1542
|
-
borderLeftColor:
|
|
1543
|
-
filter:
|
|
1544
|
-
WebkitFilter:
|
|
1545
|
-
},
|
|
1546
|
-
function
|
|
1547
|
-
let n =
|
|
1548
|
-
return n !==
|
|
1549
|
-
}
|
|
1550
|
-
const
|
|
1551
|
-
function
|
|
1538
|
+
borderColor: F,
|
|
1539
|
+
borderTopColor: F,
|
|
1540
|
+
borderRightColor: F,
|
|
1541
|
+
borderBottomColor: F,
|
|
1542
|
+
borderLeftColor: F,
|
|
1543
|
+
filter: Ye,
|
|
1544
|
+
WebkitFilter: Ye
|
|
1545
|
+
}, $n = (e) => Zi[e];
|
|
1546
|
+
function Wn(e, t) {
|
|
1547
|
+
let n = $n(e);
|
|
1548
|
+
return n !== Ye && (n = W), n.getAnimatableNone ? n.getAnimatableNone(t) : void 0;
|
|
1549
|
+
}
|
|
1550
|
+
const Ji = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
1551
|
+
function Qi(e, t, n) {
|
|
1552
1552
|
let s = 0, i;
|
|
1553
1553
|
for (; s < e.length && !i; ) {
|
|
1554
1554
|
const r = e[s];
|
|
1555
|
-
typeof r == "string" && !
|
|
1555
|
+
typeof r == "string" && !Ji.has(r) && ue(r).values.length && (i = e[s]), s++;
|
|
1556
1556
|
}
|
|
1557
1557
|
if (i && n)
|
|
1558
1558
|
for (const r of t)
|
|
1559
|
-
e[r] =
|
|
1559
|
+
e[r] = Wn(n, i);
|
|
1560
1560
|
}
|
|
1561
|
-
class
|
|
1561
|
+
class er extends lt {
|
|
1562
1562
|
constructor(t, n, s, i, r) {
|
|
1563
1563
|
super(t, n, s, i, r, !0);
|
|
1564
1564
|
}
|
|
@@ -1569,12 +1569,12 @@ class Ji extends ot {
|
|
|
1569
1569
|
super.readKeyframes();
|
|
1570
1570
|
for (let l = 0; l < t.length; l++) {
|
|
1571
1571
|
let c = t[l];
|
|
1572
|
-
if (typeof c == "string" && (c = c.trim(),
|
|
1573
|
-
const u =
|
|
1572
|
+
if (typeof c == "string" && (c = c.trim(), et(c))) {
|
|
1573
|
+
const u = kn(c, n.current);
|
|
1574
1574
|
u !== void 0 && (t[l] = u), l === t.length - 1 && (this.finalKeyframe = c);
|
|
1575
1575
|
}
|
|
1576
1576
|
}
|
|
1577
|
-
if (this.resolveNoneKeyframes(), !
|
|
1577
|
+
if (this.resolveNoneKeyframes(), !In.has(s) || t.length !== 2)
|
|
1578
1578
|
return;
|
|
1579
1579
|
const [i, r] = t, a = It(i), o = It(r);
|
|
1580
1580
|
if (a !== o)
|
|
@@ -1583,19 +1583,19 @@ class Ji extends ot {
|
|
|
1583
1583
|
const c = t[l];
|
|
1584
1584
|
typeof c == "string" && (t[l] = parseFloat(c));
|
|
1585
1585
|
}
|
|
1586
|
-
else
|
|
1586
|
+
else j[s] && (this.needsMeasurement = !0);
|
|
1587
1587
|
}
|
|
1588
1588
|
resolveNoneKeyframes() {
|
|
1589
1589
|
const { unresolvedKeyframes: t, name: n } = this, s = [];
|
|
1590
1590
|
for (let i = 0; i < t.length; i++)
|
|
1591
|
-
(t[i] === null ||
|
|
1592
|
-
s.length &&
|
|
1591
|
+
(t[i] === null || Yi(t[i])) && s.push(i);
|
|
1592
|
+
s.length && Qi(t, s, n);
|
|
1593
1593
|
}
|
|
1594
1594
|
measureInitialState() {
|
|
1595
1595
|
const { element: t, unresolvedKeyframes: n, name: s } = this;
|
|
1596
1596
|
if (!t || !t.current)
|
|
1597
1597
|
return;
|
|
1598
|
-
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin =
|
|
1598
|
+
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = j[s](t.measureViewportBox(), window.getComputedStyle(t.current)), n[0] = this.measuredOrigin;
|
|
1599
1599
|
const i = n[n.length - 1];
|
|
1600
1600
|
i !== void 0 && t.getValue(s, i).jump(i, !1);
|
|
1601
1601
|
}
|
|
@@ -1606,12 +1606,12 @@ class Ji extends ot {
|
|
|
1606
1606
|
const i = t.getValue(n);
|
|
1607
1607
|
i && i.jump(this.measuredOrigin, !1);
|
|
1608
1608
|
const r = s.length - 1, a = s[r];
|
|
1609
|
-
s[r] =
|
|
1609
|
+
s[r] = j[n](t.measureViewportBox(), window.getComputedStyle(t.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), this.removedTransforms?.length && this.removedTransforms.forEach(([o, l]) => {
|
|
1610
1610
|
t.getValue(o).set(l);
|
|
1611
1611
|
}), this.resolveNoneKeyframes();
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
1614
|
-
function
|
|
1614
|
+
function tr(e, t, n) {
|
|
1615
1615
|
if (e instanceof EventTarget)
|
|
1616
1616
|
return [e];
|
|
1617
1617
|
if (typeof e == "string") {
|
|
@@ -1621,8 +1621,8 @@ function Qi(e, t, n) {
|
|
|
1621
1621
|
}
|
|
1622
1622
|
return Array.from(e);
|
|
1623
1623
|
}
|
|
1624
|
-
const
|
|
1625
|
-
class
|
|
1624
|
+
const _n = (e, t) => t && typeof e == "number" ? t.transform(e) : e, Lt = 30, nr = (e) => !isNaN(parseFloat(e));
|
|
1625
|
+
class sr {
|
|
1626
1626
|
/**
|
|
1627
1627
|
* @param init - The initiating value
|
|
1628
1628
|
* @param config - Optional configuration options
|
|
@@ -1631,14 +1631,14 @@ class tr {
|
|
|
1631
1631
|
*/
|
|
1632
1632
|
constructor(t, n = {}) {
|
|
1633
1633
|
this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s) => {
|
|
1634
|
-
const i =
|
|
1634
|
+
const i = R.now();
|
|
1635
1635
|
if (this.updatedAt !== i && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && (this.events.change?.notify(this.current), this.dependents))
|
|
1636
1636
|
for (const r of this.dependents)
|
|
1637
1637
|
r.dirty();
|
|
1638
1638
|
}, this.hasAnimated = !1, this.setCurrent(t), this.owner = n.owner;
|
|
1639
1639
|
}
|
|
1640
1640
|
setCurrent(t) {
|
|
1641
|
-
this.current = t, this.updatedAt =
|
|
1641
|
+
this.current = t, this.updatedAt = R.now(), this.canTrackVelocity === null && t !== void 0 && (this.canTrackVelocity = nr(this.current));
|
|
1642
1642
|
}
|
|
1643
1643
|
setPrevFrameValue(t = this.current) {
|
|
1644
1644
|
this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt;
|
|
@@ -1684,10 +1684,10 @@ class tr {
|
|
|
1684
1684
|
* @deprecated
|
|
1685
1685
|
*/
|
|
1686
1686
|
onChange(t) {
|
|
1687
|
-
return process.env.NODE_ENV !== "production" &&
|
|
1687
|
+
return process.env.NODE_ENV !== "production" && tn(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", t);
|
|
1688
1688
|
}
|
|
1689
1689
|
on(t, n) {
|
|
1690
|
-
this.events[t] || (this.events[t] = new
|
|
1690
|
+
this.events[t] || (this.events[t] = new Qt());
|
|
1691
1691
|
const s = this.events[t].add(n);
|
|
1692
1692
|
return t === "change" ? () => {
|
|
1693
1693
|
s(), K.read(() => {
|
|
@@ -1766,11 +1766,11 @@ class tr {
|
|
|
1766
1766
|
* @public
|
|
1767
1767
|
*/
|
|
1768
1768
|
getVelocity() {
|
|
1769
|
-
const t =
|
|
1770
|
-
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || t - this.updatedAt >
|
|
1769
|
+
const t = R.now();
|
|
1770
|
+
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || t - this.updatedAt > Lt)
|
|
1771
1771
|
return 0;
|
|
1772
|
-
const n = Math.min(this.updatedAt - this.prevUpdatedAt,
|
|
1773
|
-
return
|
|
1772
|
+
const n = Math.min(this.updatedAt - this.prevUpdatedAt, Lt);
|
|
1773
|
+
return en(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
|
|
1774
1774
|
}
|
|
1775
1775
|
/**
|
|
1776
1776
|
* Registers a new animation to control this `MotionValue`. Only one
|
|
@@ -1821,53 +1821,53 @@ class tr {
|
|
|
1821
1821
|
this.dependents?.clear(), this.events.destroy?.notify(), this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
1822
1822
|
}
|
|
1823
1823
|
}
|
|
1824
|
-
function
|
|
1825
|
-
return new
|
|
1824
|
+
function fe(e, t) {
|
|
1825
|
+
return new sr(e, t);
|
|
1826
1826
|
}
|
|
1827
|
-
const { schedule:
|
|
1828
|
-
function
|
|
1829
|
-
return
|
|
1827
|
+
const { schedule: ir } = /* @__PURE__ */ pn(queueMicrotask, !1);
|
|
1828
|
+
function Un(e) {
|
|
1829
|
+
return gs(e) && "ownerSVGElement" in e;
|
|
1830
1830
|
}
|
|
1831
|
-
function
|
|
1832
|
-
return
|
|
1831
|
+
function rr(e) {
|
|
1832
|
+
return Un(e) && e.tagName === "svg";
|
|
1833
1833
|
}
|
|
1834
|
-
const
|
|
1835
|
-
function
|
|
1834
|
+
const D = (e) => !!(e && e.getVelocity), ar = [...Ln, F, W], or = (e) => ar.find(Kn(e));
|
|
1835
|
+
function ft(e) {
|
|
1836
1836
|
return typeof e == "object" && !Array.isArray(e);
|
|
1837
1837
|
}
|
|
1838
|
-
function
|
|
1839
|
-
return typeof e == "string" &&
|
|
1838
|
+
function jn(e, t, n, s) {
|
|
1839
|
+
return typeof e == "string" && ft(t) ? tr(e, n, s) : e instanceof NodeList ? Array.from(e) : Array.isArray(e) ? e : [e];
|
|
1840
1840
|
}
|
|
1841
|
-
function
|
|
1841
|
+
function lr(e, t, n) {
|
|
1842
1842
|
return e * (t + 1);
|
|
1843
1843
|
}
|
|
1844
1844
|
function $t(e, t, n, s) {
|
|
1845
1845
|
return typeof t == "number" ? t : t.startsWith("-") || t.startsWith("+") ? Math.max(0, e + parseFloat(t)) : t === "<" ? n : t.startsWith("<") ? Math.max(0, n + parseFloat(t.slice(1))) : s.get(t) ?? e;
|
|
1846
1846
|
}
|
|
1847
|
-
function
|
|
1847
|
+
function ur(e, t, n) {
|
|
1848
1848
|
for (let s = 0; s < e.length; s++) {
|
|
1849
1849
|
const i = e[s];
|
|
1850
|
-
i.at > t && i.at < n && (
|
|
1850
|
+
i.at > t && i.at < n && (Ht(e, i), s--);
|
|
1851
1851
|
}
|
|
1852
1852
|
}
|
|
1853
|
-
function
|
|
1854
|
-
|
|
1853
|
+
function cr(e, t, n, s, i, r) {
|
|
1854
|
+
ur(e, i, r);
|
|
1855
1855
|
for (let a = 0; a < t.length; a++)
|
|
1856
1856
|
e.push({
|
|
1857
1857
|
value: t[a],
|
|
1858
|
-
at:
|
|
1859
|
-
easing:
|
|
1858
|
+
at: J(i, r, s[a]),
|
|
1859
|
+
easing: hn(n, a)
|
|
1860
1860
|
});
|
|
1861
1861
|
}
|
|
1862
|
-
function
|
|
1862
|
+
function fr(e, t) {
|
|
1863
1863
|
for (let n = 0; n < e.length; n++)
|
|
1864
1864
|
e[n] = e[n] / (t + 1);
|
|
1865
1865
|
}
|
|
1866
|
-
function
|
|
1866
|
+
function hr(e, t) {
|
|
1867
1867
|
return e.at === t.at ? e.value === null ? 1 : t.value === null ? -1 : 0 : e.at - t.at;
|
|
1868
1868
|
}
|
|
1869
|
-
const
|
|
1870
|
-
function
|
|
1869
|
+
const dr = "easeInOut", pr = 20;
|
|
1870
|
+
function mr(e, { defaultTransition: t = {}, ...n } = {}, s, i) {
|
|
1871
1871
|
const r = t.duration || 0.3, a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = {}, c = /* @__PURE__ */ new Map();
|
|
1872
1872
|
let u = 0, f = 0, h = 0;
|
|
1873
1873
|
for (let m = 0; m < e.length; m++) {
|
|
@@ -1881,65 +1881,65 @@ function dr(e, { defaultTransition: t = {}, ...n } = {}, s, i) {
|
|
|
1881
1881
|
}
|
|
1882
1882
|
let [y, v, T = {}] = b;
|
|
1883
1883
|
T.at !== void 0 && (f = $t(f, T.at, u, c));
|
|
1884
|
-
let
|
|
1884
|
+
let A = 0;
|
|
1885
1885
|
const V = (w, p, S, C = 0, g = 0) => {
|
|
1886
|
-
const
|
|
1887
|
-
let { ease:
|
|
1888
|
-
const
|
|
1889
|
-
if (
|
|
1890
|
-
let
|
|
1891
|
-
if (
|
|
1892
|
-
const
|
|
1893
|
-
|
|
1886
|
+
const x = gr(w), { delay: E = 0, times: N = Fn(x), type: Ae = "keyframes", repeat: te, repeatType: Aa, repeatDelay: Ma = 0, ...ns } = p;
|
|
1887
|
+
let { ease: L = t.ease || "easeOut", duration: B } = p;
|
|
1888
|
+
const pt = typeof E == "function" ? E(C, g) : E, mt = x.length, gt = ut(Ae) ? Ae : i?.[Ae || "keyframes"];
|
|
1889
|
+
if (mt <= 2 && gt) {
|
|
1890
|
+
let ne = 100;
|
|
1891
|
+
if (mt === 2 && Tr(x)) {
|
|
1892
|
+
const se = x[1] - x[0];
|
|
1893
|
+
ne = Math.abs(se);
|
|
1894
1894
|
}
|
|
1895
|
-
const
|
|
1896
|
-
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1895
|
+
const ge = { ...ns };
|
|
1896
|
+
B !== void 0 && (ge.duration = /* @__PURE__ */ O(B));
|
|
1897
|
+
const ye = An(ge, ne, gt);
|
|
1898
|
+
L = ye.ease, B = ye.duration;
|
|
1899
1899
|
}
|
|
1900
|
-
|
|
1901
|
-
const
|
|
1900
|
+
B ?? (B = r);
|
|
1901
|
+
const yt = f + pt;
|
|
1902
1902
|
N.length === 1 && N[0] === 0 && (N[1] = 1);
|
|
1903
|
-
const
|
|
1904
|
-
if (
|
|
1905
|
-
k(
|
|
1906
|
-
const
|
|
1907
|
-
|
|
1908
|
-
const
|
|
1909
|
-
for (let
|
|
1910
|
-
|
|
1911
|
-
for (let
|
|
1912
|
-
N.push(
|
|
1903
|
+
const bt = N.length - x.length;
|
|
1904
|
+
if (bt > 0 && Cn(N, bt), x.length === 1 && x.unshift(null), te) {
|
|
1905
|
+
k(te < pr, "Repeat count too high, must be less than 20", "repeat-count-high"), B = lr(B, te);
|
|
1906
|
+
const ne = [...x], ge = [...N];
|
|
1907
|
+
L = Array.isArray(L) ? [...L] : [L];
|
|
1908
|
+
const ye = [...L];
|
|
1909
|
+
for (let se = 0; se < te; se++) {
|
|
1910
|
+
x.push(...ne);
|
|
1911
|
+
for (let ie = 0; ie < ne.length; ie++)
|
|
1912
|
+
N.push(ge[ie] + (se + 1)), L.push(ie === 0 ? "linear" : hn(ye, ie - 1));
|
|
1913
1913
|
}
|
|
1914
|
-
|
|
1914
|
+
fr(N, te);
|
|
1915
1915
|
}
|
|
1916
|
-
const
|
|
1917
|
-
|
|
1916
|
+
const Tt = yt + B;
|
|
1917
|
+
cr(S, x, L, N, yt, Tt), A = Math.max(pt + B, A), h = Math.max(Tt, h);
|
|
1918
1918
|
};
|
|
1919
|
-
if (
|
|
1920
|
-
const w =
|
|
1921
|
-
V(v, T,
|
|
1919
|
+
if (D(y)) {
|
|
1920
|
+
const w = Wt(y, o);
|
|
1921
|
+
V(v, T, _t("default", w));
|
|
1922
1922
|
} else {
|
|
1923
|
-
const w =
|
|
1923
|
+
const w = jn(y, v, s, l), p = w.length;
|
|
1924
1924
|
for (let S = 0; S < p; S++) {
|
|
1925
1925
|
v = v, T = T;
|
|
1926
|
-
const C = w[S], g =
|
|
1927
|
-
for (const
|
|
1928
|
-
V(v[
|
|
1926
|
+
const C = w[S], g = Wt(C, o);
|
|
1927
|
+
for (const x in v)
|
|
1928
|
+
V(v[x], yr(T, x), _t(x, g), S, p);
|
|
1929
1929
|
}
|
|
1930
1930
|
}
|
|
1931
|
-
u = f, f +=
|
|
1931
|
+
u = f, f += A;
|
|
1932
1932
|
}
|
|
1933
1933
|
return o.forEach((m, b) => {
|
|
1934
1934
|
for (const y in m) {
|
|
1935
1935
|
const v = m[y];
|
|
1936
|
-
v.sort(
|
|
1937
|
-
const T = [],
|
|
1936
|
+
v.sort(hr);
|
|
1937
|
+
const T = [], A = [], V = [];
|
|
1938
1938
|
for (let p = 0; p < v.length; p++) {
|
|
1939
1939
|
const { at: S, value: C, easing: g } = v[p];
|
|
1940
|
-
T.push(C),
|
|
1940
|
+
T.push(C), A.push(/* @__PURE__ */ Ze(0, h, S)), V.push(g || "easeOut");
|
|
1941
1941
|
}
|
|
1942
|
-
|
|
1942
|
+
A[0] !== 0 && (A.unshift(0), T.unshift(T[0]), V.unshift(dr)), A[A.length - 1] !== 1 && (A.push(1), T.push(null)), a.has(b) || a.set(b, {
|
|
1943
1943
|
keyframes: {},
|
|
1944
1944
|
transition: {}
|
|
1945
1945
|
});
|
|
@@ -1948,110 +1948,110 @@ function dr(e, { defaultTransition: t = {}, ...n } = {}, s, i) {
|
|
|
1948
1948
|
...t,
|
|
1949
1949
|
duration: h,
|
|
1950
1950
|
ease: V,
|
|
1951
|
-
times:
|
|
1951
|
+
times: A,
|
|
1952
1952
|
...n
|
|
1953
1953
|
};
|
|
1954
1954
|
}
|
|
1955
1955
|
}), a;
|
|
1956
1956
|
}
|
|
1957
|
-
function
|
|
1957
|
+
function Wt(e, t) {
|
|
1958
1958
|
return !t.has(e) && t.set(e, {}), t.get(e);
|
|
1959
1959
|
}
|
|
1960
|
-
function
|
|
1960
|
+
function _t(e, t) {
|
|
1961
1961
|
return t[e] || (t[e] = []), t[e];
|
|
1962
1962
|
}
|
|
1963
|
-
function
|
|
1963
|
+
function gr(e) {
|
|
1964
1964
|
return Array.isArray(e) ? e : [e];
|
|
1965
1965
|
}
|
|
1966
|
-
function
|
|
1966
|
+
function yr(e, t) {
|
|
1967
1967
|
return e && e[t] ? {
|
|
1968
1968
|
...e,
|
|
1969
1969
|
...e[t]
|
|
1970
1970
|
} : { ...e };
|
|
1971
1971
|
}
|
|
1972
|
-
const
|
|
1973
|
-
function
|
|
1972
|
+
const br = (e) => typeof e == "number", Tr = (e) => e.every(br), he = /* @__PURE__ */ new WeakMap(), vr = (e) => Array.isArray(e);
|
|
1973
|
+
function Ut(e) {
|
|
1974
1974
|
const t = [{}, {}];
|
|
1975
1975
|
return e?.values.forEach((n, s) => {
|
|
1976
1976
|
t[0][s] = n.get(), t[1][s] = n.getVelocity();
|
|
1977
1977
|
}), t;
|
|
1978
1978
|
}
|
|
1979
|
-
function
|
|
1979
|
+
function Gn(e, t, n, s) {
|
|
1980
1980
|
if (typeof t == "function") {
|
|
1981
|
-
const [i, r] =
|
|
1981
|
+
const [i, r] = Ut(s);
|
|
1982
1982
|
t = t(n !== void 0 ? n : e.custom, i, r);
|
|
1983
1983
|
}
|
|
1984
1984
|
if (typeof t == "string" && (t = e.variants && e.variants[t]), typeof t == "function") {
|
|
1985
|
-
const [i, r] =
|
|
1985
|
+
const [i, r] = Ut(s);
|
|
1986
1986
|
t = t(n !== void 0 ? n : e.custom, i, r);
|
|
1987
1987
|
}
|
|
1988
1988
|
return t;
|
|
1989
1989
|
}
|
|
1990
|
-
function
|
|
1990
|
+
function Vr(e, t, n) {
|
|
1991
1991
|
const s = e.getProps();
|
|
1992
|
-
return
|
|
1992
|
+
return Gn(s, t, s.custom, e);
|
|
1993
1993
|
}
|
|
1994
|
-
function
|
|
1995
|
-
e.hasValue(t) ? e.getValue(t).set(n) : e.addValue(t,
|
|
1994
|
+
function Sr(e, t, n) {
|
|
1995
|
+
e.hasValue(t) ? e.getValue(t).set(n) : e.addValue(t, fe(n));
|
|
1996
1996
|
}
|
|
1997
|
-
function
|
|
1998
|
-
return
|
|
1997
|
+
function wr(e) {
|
|
1998
|
+
return vr(e) ? e[e.length - 1] || 0 : e;
|
|
1999
1999
|
}
|
|
2000
|
-
function
|
|
2001
|
-
const n =
|
|
2000
|
+
function xr(e, t) {
|
|
2001
|
+
const n = Vr(e, t);
|
|
2002
2002
|
let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
|
|
2003
2003
|
r = { ...r, ...s };
|
|
2004
2004
|
for (const a in r) {
|
|
2005
|
-
const o =
|
|
2006
|
-
|
|
2005
|
+
const o = wr(r[a]);
|
|
2006
|
+
Sr(e, a, o);
|
|
2007
2007
|
}
|
|
2008
2008
|
}
|
|
2009
|
-
function
|
|
2010
|
-
return !!(
|
|
2009
|
+
function Ar(e) {
|
|
2010
|
+
return !!(D(e) && e.add);
|
|
2011
2011
|
}
|
|
2012
|
-
function
|
|
2012
|
+
function Mr(e, t) {
|
|
2013
2013
|
const n = e.getValue("willChange");
|
|
2014
|
-
if (
|
|
2014
|
+
if (Ar(n))
|
|
2015
2015
|
return n.add(t);
|
|
2016
|
-
if (!n &&
|
|
2017
|
-
const s = new
|
|
2016
|
+
if (!n && I.WillChange) {
|
|
2017
|
+
const s = new I.WillChange("auto");
|
|
2018
2018
|
e.addValue("willChange", s), s.add(t);
|
|
2019
2019
|
}
|
|
2020
2020
|
}
|
|
2021
|
-
const
|
|
2022
|
-
function
|
|
2023
|
-
return e.props[
|
|
2021
|
+
const ht = (e) => e.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Cr = "framerAppearId", Fr = "data-" + ht(Cr);
|
|
2022
|
+
function Dr(e) {
|
|
2023
|
+
return e.props[Fr];
|
|
2024
2024
|
}
|
|
2025
|
-
const
|
|
2026
|
-
function
|
|
2027
|
-
const i = e.filter(
|
|
2025
|
+
const Er = (e) => e !== null;
|
|
2026
|
+
function Rr(e, { repeat: t, repeatType: n = "loop" }, s) {
|
|
2027
|
+
const i = e.filter(Er), r = t && n !== "loop" && t % 2 === 1 ? 0 : i.length - 1;
|
|
2028
2028
|
return i[r];
|
|
2029
2029
|
}
|
|
2030
|
-
const
|
|
2030
|
+
const Pr = {
|
|
2031
2031
|
type: "spring",
|
|
2032
2032
|
stiffness: 500,
|
|
2033
2033
|
damping: 25,
|
|
2034
2034
|
restSpeed: 10
|
|
2035
|
-
},
|
|
2035
|
+
}, Or = (e) => ({
|
|
2036
2036
|
type: "spring",
|
|
2037
2037
|
stiffness: 550,
|
|
2038
2038
|
damping: e === 0 ? 2 * Math.sqrt(550) : 30,
|
|
2039
2039
|
restSpeed: 10
|
|
2040
|
-
}),
|
|
2040
|
+
}), Nr = {
|
|
2041
2041
|
type: "keyframes",
|
|
2042
2042
|
duration: 0.8
|
|
2043
|
-
},
|
|
2043
|
+
}, kr = {
|
|
2044
2044
|
type: "keyframes",
|
|
2045
2045
|
ease: [0.25, 0.1, 0.35, 1],
|
|
2046
2046
|
duration: 0.3
|
|
2047
|
-
},
|
|
2048
|
-
function
|
|
2047
|
+
}, Br = (e, { keyframes: t }) => t.length > 2 ? Nr : ee.has(e) ? e.startsWith("scale") ? Or(t[1]) : Pr : kr;
|
|
2048
|
+
function Ir({ when: e, delay: t, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: a, repeatDelay: o, from: l, elapsed: c, ...u }) {
|
|
2049
2049
|
return !!Object.keys(u).length;
|
|
2050
2050
|
}
|
|
2051
|
-
const
|
|
2052
|
-
const o =
|
|
2051
|
+
const Yn = (e, t, n, s = {}, i, r) => (a) => {
|
|
2052
|
+
const o = Bn(s, e) || {}, l = o.delay || s.delay || 0;
|
|
2053
2053
|
let { elapsed: c = 0 } = s;
|
|
2054
|
-
c = c - /* @__PURE__ */
|
|
2054
|
+
c = c - /* @__PURE__ */ O(l);
|
|
2055
2055
|
const u = {
|
|
2056
2056
|
keyframes: Array.isArray(n) ? n : [null, n],
|
|
2057
2057
|
ease: "easeOut",
|
|
@@ -2068,10 +2068,10 @@ const jn = (e, t, n, s = {}, i, r) => (a) => {
|
|
|
2068
2068
|
motionValue: t,
|
|
2069
2069
|
element: r ? void 0 : i
|
|
2070
2070
|
};
|
|
2071
|
-
|
|
2071
|
+
Ir(o) || Object.assign(u, Br(e, u)), u.duration && (u.duration = /* @__PURE__ */ O(u.duration)), u.repeatDelay && (u.repeatDelay = /* @__PURE__ */ O(u.repeatDelay)), u.from !== void 0 && (u.keyframes[0] = u.from);
|
|
2072
2072
|
let f = !1;
|
|
2073
|
-
if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (
|
|
2074
|
-
const h =
|
|
2073
|
+
if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (Ge(u), u.delay === 0 && (f = !0)), (I.instantAnimations || I.skipAnimations) && (f = !0, Ge(u), u.delay = 0), u.allowFlatten = !o.type && !o.ease, f && !r && t.get() !== void 0) {
|
|
2074
|
+
const h = Rr(u.keyframes, o);
|
|
2075
2075
|
if (h !== void 0) {
|
|
2076
2076
|
K.update(() => {
|
|
2077
2077
|
u.onUpdate(h), u.onComplete();
|
|
@@ -2079,51 +2079,51 @@ const jn = (e, t, n, s = {}, i, r) => (a) => {
|
|
|
2079
2079
|
return;
|
|
2080
2080
|
}
|
|
2081
2081
|
}
|
|
2082
|
-
return o.isSync ? new
|
|
2082
|
+
return o.isSync ? new ot(u) : new Li(u);
|
|
2083
2083
|
};
|
|
2084
|
-
function
|
|
2084
|
+
function Kr({ protectedKeys: e, needsAnimating: t }, n) {
|
|
2085
2085
|
const s = e.hasOwnProperty(n) && t[n] !== !0;
|
|
2086
2086
|
return t[n] = !1, s;
|
|
2087
2087
|
}
|
|
2088
|
-
function
|
|
2088
|
+
function Lr(e, t, { delay: n = 0, transitionOverride: s, type: i } = {}) {
|
|
2089
2089
|
let { transition: r = e.getDefaultTransition(), transitionEnd: a, ...o } = t;
|
|
2090
2090
|
s && (r = s);
|
|
2091
2091
|
const l = [], c = i && e.animationState && e.animationState.getState()[i];
|
|
2092
2092
|
for (const u in o) {
|
|
2093
2093
|
const f = e.getValue(u, e.latestValues[u] ?? null), h = o[u];
|
|
2094
|
-
if (h === void 0 || c &&
|
|
2094
|
+
if (h === void 0 || c && Kr(c, u))
|
|
2095
2095
|
continue;
|
|
2096
2096
|
const m = {
|
|
2097
2097
|
delay: n,
|
|
2098
|
-
...
|
|
2098
|
+
...Bn(r || {}, u)
|
|
2099
2099
|
}, b = f.get();
|
|
2100
2100
|
if (b !== void 0 && !f.isAnimating && !Array.isArray(h) && h === b && !m.velocity)
|
|
2101
2101
|
continue;
|
|
2102
2102
|
let y = !1;
|
|
2103
2103
|
if (window.MotionHandoffAnimation) {
|
|
2104
|
-
const T =
|
|
2104
|
+
const T = Dr(e);
|
|
2105
2105
|
if (T) {
|
|
2106
|
-
const
|
|
2107
|
-
|
|
2106
|
+
const A = window.MotionHandoffAnimation(T, u, K);
|
|
2107
|
+
A !== null && (m.startTime = A, y = !0);
|
|
2108
2108
|
}
|
|
2109
2109
|
}
|
|
2110
|
-
|
|
2110
|
+
Mr(e, u), f.start(Yn(u, f, h, e.shouldReduceMotion && In.has(u) ? { type: !1 } : m, e, y));
|
|
2111
2111
|
const v = f.animation;
|
|
2112
2112
|
v && l.push(v);
|
|
2113
2113
|
}
|
|
2114
2114
|
return a && Promise.all(l).then(() => {
|
|
2115
2115
|
K.update(() => {
|
|
2116
|
-
a &&
|
|
2116
|
+
a && xr(e, a);
|
|
2117
2117
|
});
|
|
2118
2118
|
}), l;
|
|
2119
2119
|
}
|
|
2120
|
-
function
|
|
2120
|
+
function $r({ top: e, left: t, right: n, bottom: s }) {
|
|
2121
2121
|
return {
|
|
2122
2122
|
x: { min: t, max: n },
|
|
2123
2123
|
y: { min: e, max: s }
|
|
2124
2124
|
};
|
|
2125
2125
|
}
|
|
2126
|
-
function
|
|
2126
|
+
function Wr(e, t) {
|
|
2127
2127
|
if (!t)
|
|
2128
2128
|
return e;
|
|
2129
2129
|
const n = t({ x: e.left, y: e.top }), s = t({ x: e.right, y: e.bottom });
|
|
@@ -2134,10 +2134,10 @@ function $r(e, t) {
|
|
|
2134
2134
|
right: s.x
|
|
2135
2135
|
};
|
|
2136
2136
|
}
|
|
2137
|
-
function
|
|
2138
|
-
return
|
|
2137
|
+
function _r(e, t) {
|
|
2138
|
+
return $r(Wr(e.getBoundingClientRect(), t));
|
|
2139
2139
|
}
|
|
2140
|
-
const
|
|
2140
|
+
const jt = {
|
|
2141
2141
|
animation: [
|
|
2142
2142
|
"animate",
|
|
2143
2143
|
"variants",
|
|
@@ -2156,30 +2156,30 @@ const Ut = {
|
|
|
2156
2156
|
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
|
|
2157
2157
|
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
2158
2158
|
layout: ["layout", "layoutId"]
|
|
2159
|
-
},
|
|
2160
|
-
for (const e in
|
|
2161
|
-
|
|
2162
|
-
isEnabled: (t) =>
|
|
2159
|
+
}, ze = {};
|
|
2160
|
+
for (const e in jt)
|
|
2161
|
+
ze[e] = {
|
|
2162
|
+
isEnabled: (t) => jt[e].some((n) => !!t[n])
|
|
2163
2163
|
};
|
|
2164
|
-
const
|
|
2165
|
-
x:
|
|
2166
|
-
y:
|
|
2167
|
-
}),
|
|
2168
|
-
function
|
|
2169
|
-
if (
|
|
2164
|
+
const Gt = () => ({ min: 0, max: 0 }), dt = () => ({
|
|
2165
|
+
x: Gt(),
|
|
2166
|
+
y: Gt()
|
|
2167
|
+
}), Ur = typeof window < "u", Xe = { current: null }, zn = { current: !1 };
|
|
2168
|
+
function jr() {
|
|
2169
|
+
if (zn.current = !0, !!Ur)
|
|
2170
2170
|
if (window.matchMedia) {
|
|
2171
|
-
const e = window.matchMedia("(prefers-reduced-motion)"), t = () =>
|
|
2171
|
+
const e = window.matchMedia("(prefers-reduced-motion)"), t = () => Xe.current = e.matches;
|
|
2172
2172
|
e.addEventListener("change", t), t();
|
|
2173
2173
|
} else
|
|
2174
|
-
|
|
2174
|
+
Xe.current = !1;
|
|
2175
2175
|
}
|
|
2176
|
-
function
|
|
2176
|
+
function Gr(e) {
|
|
2177
2177
|
return e !== null && typeof e == "object" && typeof e.start == "function";
|
|
2178
2178
|
}
|
|
2179
|
-
function
|
|
2179
|
+
function Yr(e) {
|
|
2180
2180
|
return typeof e == "string" || Array.isArray(e);
|
|
2181
2181
|
}
|
|
2182
|
-
const
|
|
2182
|
+
const zr = [
|
|
2183
2183
|
"animate",
|
|
2184
2184
|
"whileInView",
|
|
2185
2185
|
"whileFocus",
|
|
@@ -2187,34 +2187,34 @@ const Gr = [
|
|
|
2187
2187
|
"whileTap",
|
|
2188
2188
|
"whileDrag",
|
|
2189
2189
|
"exit"
|
|
2190
|
-
],
|
|
2191
|
-
function
|
|
2192
|
-
return
|
|
2190
|
+
], Xr = ["initial", ...zr];
|
|
2191
|
+
function Xn(e) {
|
|
2192
|
+
return Gr(e.animate) || Xr.some((t) => Yr(e[t]));
|
|
2193
2193
|
}
|
|
2194
|
-
function
|
|
2195
|
-
return !!(
|
|
2194
|
+
function qr(e) {
|
|
2195
|
+
return !!(Xn(e) || e.variants);
|
|
2196
2196
|
}
|
|
2197
|
-
function
|
|
2197
|
+
function Hr(e, t, n) {
|
|
2198
2198
|
for (const s in t) {
|
|
2199
2199
|
const i = t[s], r = n[s];
|
|
2200
|
-
if (
|
|
2200
|
+
if (D(i))
|
|
2201
2201
|
e.addValue(s, i);
|
|
2202
|
-
else if (
|
|
2203
|
-
e.addValue(s,
|
|
2202
|
+
else if (D(r))
|
|
2203
|
+
e.addValue(s, fe(i, { owner: e }));
|
|
2204
2204
|
else if (r !== i)
|
|
2205
2205
|
if (e.hasValue(s)) {
|
|
2206
2206
|
const a = e.getValue(s);
|
|
2207
2207
|
a.liveStyle === !0 ? a.jump(i) : a.hasAnimated || a.set(i);
|
|
2208
2208
|
} else {
|
|
2209
2209
|
const a = e.getStaticValue(s);
|
|
2210
|
-
e.addValue(s,
|
|
2210
|
+
e.addValue(s, fe(a !== void 0 ? a : i, { owner: e }));
|
|
2211
2211
|
}
|
|
2212
2212
|
}
|
|
2213
2213
|
for (const s in n)
|
|
2214
2214
|
t[s] === void 0 && e.removeValue(s);
|
|
2215
2215
|
return t;
|
|
2216
2216
|
}
|
|
2217
|
-
const
|
|
2217
|
+
const Yt = [
|
|
2218
2218
|
"AnimationStart",
|
|
2219
2219
|
"AnimationComplete",
|
|
2220
2220
|
"Update",
|
|
@@ -2223,7 +2223,7 @@ const Gt = [
|
|
|
2223
2223
|
"LayoutAnimationStart",
|
|
2224
2224
|
"LayoutAnimationComplete"
|
|
2225
2225
|
];
|
|
2226
|
-
class
|
|
2226
|
+
class qn {
|
|
2227
2227
|
/**
|
|
2228
2228
|
* This method takes React props and returns found MotionValues. For example, HTML
|
|
2229
2229
|
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
@@ -2235,22 +2235,22 @@ class zn {
|
|
|
2235
2235
|
return {};
|
|
2236
2236
|
}
|
|
2237
2237
|
constructor({ parent: t, props: n, presenceContext: s, reducedMotionConfig: i, blockInitialAnimation: r, visualState: a }, o = {}) {
|
|
2238
|
-
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver =
|
|
2238
|
+
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = lt, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
2239
2239
|
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
2240
2240
|
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
2241
|
-
const h =
|
|
2241
|
+
const h = R.now();
|
|
2242
2242
|
this.renderScheduledAt < h && (this.renderScheduledAt = h, K.render(this.render, !1, !0));
|
|
2243
2243
|
};
|
|
2244
2244
|
const { latestValues: l, renderState: c } = a;
|
|
2245
|
-
this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = c, this.parent = t, this.props = n, this.presenceContext = s, this.depth = t ? t.depth + 1 : 0, this.reducedMotionConfig = i, this.options = o, this.blockInitialAnimation = !!r, this.isControllingVariants =
|
|
2245
|
+
this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = c, this.parent = t, this.props = n, this.presenceContext = s, this.depth = t ? t.depth + 1 : 0, this.reducedMotionConfig = i, this.options = o, this.blockInitialAnimation = !!r, this.isControllingVariants = Xn(n), this.isVariantNode = qr(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(t && t.current);
|
|
2246
2246
|
const { willChange: u, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
2247
2247
|
for (const h in f) {
|
|
2248
2248
|
const m = f[h];
|
|
2249
|
-
l[h] !== void 0 &&
|
|
2249
|
+
l[h] !== void 0 && D(m) && m.set(l[h]);
|
|
2250
2250
|
}
|
|
2251
2251
|
}
|
|
2252
2252
|
mount(t) {
|
|
2253
|
-
this.current = t,
|
|
2253
|
+
this.current = t, he.set(t, this), this.projection && !this.projection.instance && this.projection.mount(t), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)), zn.current || jr(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : Xe.current, process.env.NODE_ENV !== "production" && tn(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), this.parent?.addChild(this), this.update(this.props, this.presenceContext);
|
|
2254
2254
|
}
|
|
2255
2255
|
unmount() {
|
|
2256
2256
|
this.projection && this.projection.unmount(), Oe(this.notifyUpdate), Oe(this.render), this.valueSubscriptions.forEach((t) => t()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent?.removeChild(this);
|
|
@@ -2270,7 +2270,7 @@ class zn {
|
|
|
2270
2270
|
}
|
|
2271
2271
|
bindToMotionValue(t, n) {
|
|
2272
2272
|
this.valueSubscriptions.has(t) && this.valueSubscriptions.get(t)();
|
|
2273
|
-
const s =
|
|
2273
|
+
const s = ee.has(t);
|
|
2274
2274
|
s && this.onBindTransform && this.onBindTransform();
|
|
2275
2275
|
const i = n.on("change", (a) => {
|
|
2276
2276
|
this.latestValues[t] = a, this.props.onUpdate && K.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
|
|
@@ -2285,8 +2285,8 @@ class zn {
|
|
|
2285
2285
|
}
|
|
2286
2286
|
updateFeatures() {
|
|
2287
2287
|
let t = "animation";
|
|
2288
|
-
for (t in
|
|
2289
|
-
const n =
|
|
2288
|
+
for (t in ze) {
|
|
2289
|
+
const n = ze[t];
|
|
2290
2290
|
if (!n)
|
|
2291
2291
|
continue;
|
|
2292
2292
|
const { isEnabled: s, Feature: i } = n;
|
|
@@ -2305,7 +2305,7 @@ class zn {
|
|
|
2305
2305
|
* removed with a re-render to work.
|
|
2306
2306
|
*/
|
|
2307
2307
|
measureViewportBox() {
|
|
2308
|
-
return this.current ? this.measureInstanceViewportBox(this.current, this.props) :
|
|
2308
|
+
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : dt();
|
|
2309
2309
|
}
|
|
2310
2310
|
getStaticValue(t) {
|
|
2311
2311
|
return this.latestValues[t];
|
|
@@ -2319,13 +2319,13 @@ class zn {
|
|
|
2319
2319
|
*/
|
|
2320
2320
|
update(t, n) {
|
|
2321
2321
|
(t.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = t, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
|
|
2322
|
-
for (let s = 0; s <
|
|
2323
|
-
const i =
|
|
2322
|
+
for (let s = 0; s < Yt.length; s++) {
|
|
2323
|
+
const i = Yt[s];
|
|
2324
2324
|
this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
|
|
2325
2325
|
const r = "on" + i, a = t[r];
|
|
2326
2326
|
a && (this.propEventSubscriptions[i] = this.on(i, a));
|
|
2327
2327
|
}
|
|
2328
|
-
this.prevMotionValues =
|
|
2328
|
+
this.prevMotionValues = Hr(this, this.scrapeMotionValuesFromProps(t, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
2329
2329
|
}
|
|
2330
2330
|
getProps() {
|
|
2331
2331
|
return this.props;
|
|
@@ -2381,7 +2381,7 @@ class zn {
|
|
|
2381
2381
|
if (this.props.values && this.props.values[t])
|
|
2382
2382
|
return this.props.values[t];
|
|
2383
2383
|
let s = this.values.get(t);
|
|
2384
|
-
return s === void 0 && n !== void 0 && (s =
|
|
2384
|
+
return s === void 0 && n !== void 0 && (s = fe(n === null ? void 0 : n, { owner: this }), this.addValue(t, s)), s;
|
|
2385
2385
|
}
|
|
2386
2386
|
/**
|
|
2387
2387
|
* If we're trying to animate to a previously unencountered value,
|
|
@@ -2390,7 +2390,7 @@ class zn {
|
|
|
2390
2390
|
*/
|
|
2391
2391
|
readValue(t, n) {
|
|
2392
2392
|
let s = this.latestValues[t] !== void 0 || !this.current ? this.latestValues[t] : this.getBaseTargetFromProps(this.props, t) ?? this.readValueFromInstance(this.current, t, this.options);
|
|
2393
|
-
return s != null && (typeof s == "string" && (
|
|
2393
|
+
return s != null && (typeof s == "string" && (Zt(s) || Jt(s)) ? s = parseFloat(s) : !or(s) && W.test(n) && (s = Wn(t, n)), this.setBaseTarget(t, D(s) ? s.get() : s)), D(s) ? s.get() : s;
|
|
2394
2394
|
}
|
|
2395
2395
|
/**
|
|
2396
2396
|
* Set the base target to later animate back to. This is currently
|
|
@@ -2407,27 +2407,27 @@ class zn {
|
|
|
2407
2407
|
const { initial: n } = this.props;
|
|
2408
2408
|
let s;
|
|
2409
2409
|
if (typeof n == "string" || typeof n == "object") {
|
|
2410
|
-
const r =
|
|
2410
|
+
const r = Gn(this.props, n, this.presenceContext?.custom);
|
|
2411
2411
|
r && (s = r[t]);
|
|
2412
2412
|
}
|
|
2413
2413
|
if (n && s !== void 0)
|
|
2414
2414
|
return s;
|
|
2415
2415
|
const i = this.getBaseTargetFromProps(this.props, t);
|
|
2416
|
-
return i !== void 0 && !
|
|
2416
|
+
return i !== void 0 && !D(i) ? i : this.initialValues[t] !== void 0 && s === void 0 ? void 0 : this.baseTarget[t];
|
|
2417
2417
|
}
|
|
2418
2418
|
on(t, n) {
|
|
2419
|
-
return this.events[t] || (this.events[t] = new
|
|
2419
|
+
return this.events[t] || (this.events[t] = new Qt()), this.events[t].add(n);
|
|
2420
2420
|
}
|
|
2421
2421
|
notify(t, ...n) {
|
|
2422
2422
|
this.events[t] && this.events[t].notify(...n);
|
|
2423
2423
|
}
|
|
2424
2424
|
scheduleRenderMicrotask() {
|
|
2425
|
-
|
|
2425
|
+
ir.render(this.render);
|
|
2426
2426
|
}
|
|
2427
2427
|
}
|
|
2428
|
-
class
|
|
2428
|
+
class Hn extends qn {
|
|
2429
2429
|
constructor() {
|
|
2430
|
-
super(...arguments), this.KeyframeResolver =
|
|
2430
|
+
super(...arguments), this.KeyframeResolver = er;
|
|
2431
2431
|
}
|
|
2432
2432
|
sortInstanceNodePosition(t, n) {
|
|
2433
2433
|
return t.compareDocumentPosition(n) & 2 ? 1 : -1;
|
|
@@ -2441,29 +2441,29 @@ class Xn extends zn {
|
|
|
2441
2441
|
handleChildMotionValue() {
|
|
2442
2442
|
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
2443
2443
|
const { children: t } = this.props;
|
|
2444
|
-
|
|
2444
|
+
D(t) && (this.childSubscription = t.on("change", (n) => {
|
|
2445
2445
|
this.current && (this.current.textContent = `${n}`);
|
|
2446
2446
|
}));
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
|
-
const
|
|
2449
|
+
const Zr = {
|
|
2450
2450
|
x: "translateX",
|
|
2451
2451
|
y: "translateY",
|
|
2452
2452
|
z: "translateZ",
|
|
2453
2453
|
transformPerspective: "perspective"
|
|
2454
|
-
},
|
|
2455
|
-
function
|
|
2454
|
+
}, Jr = Q.length;
|
|
2455
|
+
function Qr(e, t, n) {
|
|
2456
2456
|
let s = "", i = !0;
|
|
2457
|
-
for (let r = 0; r <
|
|
2458
|
-
const a =
|
|
2457
|
+
for (let r = 0; r < Jr; r++) {
|
|
2458
|
+
const a = Q[r], o = e[a];
|
|
2459
2459
|
if (o === void 0)
|
|
2460
2460
|
continue;
|
|
2461
2461
|
let l = !0;
|
|
2462
2462
|
if (typeof o == "number" ? l = o === (a.startsWith("scale") ? 1 : 0) : l = parseFloat(o) === 0, !l || n) {
|
|
2463
|
-
const c =
|
|
2463
|
+
const c = _n(o, ct[a]);
|
|
2464
2464
|
if (!l) {
|
|
2465
2465
|
i = !1;
|
|
2466
|
-
const u =
|
|
2466
|
+
const u = Zr[a] || a;
|
|
2467
2467
|
s += `${u}(${c}) `;
|
|
2468
2468
|
}
|
|
2469
2469
|
n && (t[a] = c);
|
|
@@ -2471,28 +2471,28 @@ function Zr(e, t, n) {
|
|
|
2471
2471
|
}
|
|
2472
2472
|
return s = s.trim(), n ? s = n(t, i ? "" : s) : i && (s = "none"), s;
|
|
2473
2473
|
}
|
|
2474
|
-
function
|
|
2474
|
+
function Zn(e, t, n) {
|
|
2475
2475
|
const { style: s, vars: i, transformOrigin: r } = e;
|
|
2476
2476
|
let a = !1, o = !1;
|
|
2477
2477
|
for (const l in t) {
|
|
2478
2478
|
const c = t[l];
|
|
2479
|
-
if (
|
|
2479
|
+
if (ee.has(l)) {
|
|
2480
2480
|
a = !0;
|
|
2481
2481
|
continue;
|
|
2482
|
-
} else if (
|
|
2482
|
+
} else if (gn(l)) {
|
|
2483
2483
|
i[l] = c;
|
|
2484
2484
|
continue;
|
|
2485
2485
|
} else {
|
|
2486
|
-
const u =
|
|
2486
|
+
const u = _n(c, ct[l]);
|
|
2487
2487
|
l.startsWith("origin") ? (o = !0, r[l] = u) : s[l] = u;
|
|
2488
2488
|
}
|
|
2489
2489
|
}
|
|
2490
|
-
if (t.transform || (a || n ? s.transform =
|
|
2490
|
+
if (t.transform || (a || n ? s.transform = Qr(t, e.transform, n) : s.transform && (s.transform = "none")), o) {
|
|
2491
2491
|
const { originX: l = "50%", originY: c = "50%", originZ: u = 0 } = r;
|
|
2492
2492
|
s.transformOrigin = `${l} ${c} ${u}`;
|
|
2493
2493
|
}
|
|
2494
2494
|
}
|
|
2495
|
-
function
|
|
2495
|
+
function Jn(e, { style: t, vars: n }, s, i) {
|
|
2496
2496
|
const r = e.style;
|
|
2497
2497
|
let a;
|
|
2498
2498
|
for (a in t)
|
|
@@ -2501,50 +2501,90 @@ function Hn(e, { style: t, vars: n }, s, i) {
|
|
|
2501
2501
|
for (a in n)
|
|
2502
2502
|
r.setProperty(a, n[a]);
|
|
2503
2503
|
}
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
return Q.has(e) || e.startsWith("origin") || (t || n !== void 0) && (!!Jr[e] || e === "opacity");
|
|
2504
|
+
function zt(e, t) {
|
|
2505
|
+
return t.max === t.min ? 0 : e / (t.max - t.min) * 100;
|
|
2507
2506
|
}
|
|
2508
|
-
|
|
2507
|
+
const re = {
|
|
2508
|
+
correct: (e, t) => {
|
|
2509
|
+
if (!t.target)
|
|
2510
|
+
return e;
|
|
2511
|
+
if (typeof e == "string")
|
|
2512
|
+
if (d.test(e))
|
|
2513
|
+
e = parseFloat(e);
|
|
2514
|
+
else
|
|
2515
|
+
return e;
|
|
2516
|
+
const n = zt(e, t.target.x), s = zt(e, t.target.y);
|
|
2517
|
+
return `${n}% ${s}%`;
|
|
2518
|
+
}
|
|
2519
|
+
}, ea = {
|
|
2520
|
+
correct: (e, { treeScale: t, projectionDelta: n }) => {
|
|
2521
|
+
const s = e, i = W.parse(e);
|
|
2522
|
+
if (i.length > 5)
|
|
2523
|
+
return s;
|
|
2524
|
+
const r = W.createTransformer(e), a = typeof i[0] != "number" ? 1 : 0, o = n.x.scale * t.x, l = n.y.scale * t.y;
|
|
2525
|
+
i[0 + a] /= o, i[1 + a] /= l;
|
|
2526
|
+
const c = J(o, l, 0.5);
|
|
2527
|
+
return typeof i[2 + a] == "number" && (i[2 + a] /= c), typeof i[3 + a] == "number" && (i[3 + a] /= c), r(i);
|
|
2528
|
+
}
|
|
2529
|
+
}, ta = {
|
|
2530
|
+
borderRadius: {
|
|
2531
|
+
...re,
|
|
2532
|
+
applyTo: [
|
|
2533
|
+
"borderTopLeftRadius",
|
|
2534
|
+
"borderTopRightRadius",
|
|
2535
|
+
"borderBottomLeftRadius",
|
|
2536
|
+
"borderBottomRightRadius"
|
|
2537
|
+
]
|
|
2538
|
+
},
|
|
2539
|
+
borderTopLeftRadius: re,
|
|
2540
|
+
borderTopRightRadius: re,
|
|
2541
|
+
borderBottomLeftRadius: re,
|
|
2542
|
+
borderBottomRightRadius: re,
|
|
2543
|
+
boxShadow: ea
|
|
2544
|
+
};
|
|
2545
|
+
function na(e, { layout: t, layoutId: n }) {
|
|
2546
|
+
return ee.has(e) || e.startsWith("origin") || (t || n !== void 0) && (!!ta[e] || e === "opacity");
|
|
2547
|
+
}
|
|
2548
|
+
function Qn(e, t, n) {
|
|
2509
2549
|
const { style: s } = e, i = {};
|
|
2510
2550
|
for (const r in s)
|
|
2511
|
-
(
|
|
2551
|
+
(D(s[r]) || t.style && D(t.style[r]) || na(r, e) || n?.getValue(r)?.liveStyle !== void 0) && (i[r] = s[r]);
|
|
2512
2552
|
return i;
|
|
2513
2553
|
}
|
|
2514
|
-
function
|
|
2554
|
+
function sa(e) {
|
|
2515
2555
|
return window.getComputedStyle(e);
|
|
2516
2556
|
}
|
|
2517
|
-
class
|
|
2557
|
+
class ia extends Hn {
|
|
2518
2558
|
constructor() {
|
|
2519
|
-
super(...arguments), this.type = "html", this.renderInstance =
|
|
2559
|
+
super(...arguments), this.type = "html", this.renderInstance = Jn;
|
|
2520
2560
|
}
|
|
2521
2561
|
readValueFromInstance(t, n) {
|
|
2522
|
-
if (
|
|
2523
|
-
return this.projection?.isProjecting ? $e(n) :
|
|
2562
|
+
if (ee.has(n))
|
|
2563
|
+
return this.projection?.isProjecting ? $e(n) : gi(t, n);
|
|
2524
2564
|
{
|
|
2525
|
-
const s =
|
|
2565
|
+
const s = sa(t), i = (gn(n) ? s.getPropertyValue(n) : s[n]) || 0;
|
|
2526
2566
|
return typeof i == "string" ? i.trim() : i;
|
|
2527
2567
|
}
|
|
2528
2568
|
}
|
|
2529
2569
|
measureInstanceViewportBox(t, { transformPagePoint: n }) {
|
|
2530
|
-
return
|
|
2570
|
+
return _r(t, n);
|
|
2531
2571
|
}
|
|
2532
2572
|
build(t, n, s) {
|
|
2533
|
-
|
|
2573
|
+
Zn(t, n, s.transformTemplate);
|
|
2534
2574
|
}
|
|
2535
2575
|
scrapeMotionValuesFromProps(t, n, s) {
|
|
2536
|
-
return
|
|
2576
|
+
return Qn(t, n, s);
|
|
2537
2577
|
}
|
|
2538
2578
|
}
|
|
2539
|
-
function
|
|
2579
|
+
function ra(e, t) {
|
|
2540
2580
|
return e in t;
|
|
2541
2581
|
}
|
|
2542
|
-
class
|
|
2582
|
+
class aa extends qn {
|
|
2543
2583
|
constructor() {
|
|
2544
2584
|
super(...arguments), this.type = "object";
|
|
2545
2585
|
}
|
|
2546
2586
|
readValueFromInstance(t, n) {
|
|
2547
|
-
if (
|
|
2587
|
+
if (ra(n, t)) {
|
|
2548
2588
|
const s = t[n];
|
|
2549
2589
|
if (typeof s == "string" || typeof s == "number")
|
|
2550
2590
|
return s;
|
|
@@ -2556,7 +2596,7 @@ class sa extends zn {
|
|
|
2556
2596
|
delete n.output[t];
|
|
2557
2597
|
}
|
|
2558
2598
|
measureInstanceViewportBox() {
|
|
2559
|
-
return
|
|
2599
|
+
return dt();
|
|
2560
2600
|
}
|
|
2561
2601
|
build(t, n) {
|
|
2562
2602
|
Object.assign(t.output, n);
|
|
@@ -2568,21 +2608,21 @@ class sa extends zn {
|
|
|
2568
2608
|
return 0;
|
|
2569
2609
|
}
|
|
2570
2610
|
}
|
|
2571
|
-
const
|
|
2611
|
+
const oa = {
|
|
2572
2612
|
offset: "stroke-dashoffset",
|
|
2573
2613
|
array: "stroke-dasharray"
|
|
2574
|
-
},
|
|
2614
|
+
}, la = {
|
|
2575
2615
|
offset: "strokeDashoffset",
|
|
2576
2616
|
array: "strokeDasharray"
|
|
2577
2617
|
};
|
|
2578
|
-
function
|
|
2618
|
+
function ua(e, t, n = 1, s = 0, i = !0) {
|
|
2579
2619
|
e.pathLength = 1;
|
|
2580
|
-
const r = i ?
|
|
2620
|
+
const r = i ? oa : la;
|
|
2581
2621
|
e[r.offset] = d.transform(-s);
|
|
2582
2622
|
const a = d.transform(t), o = d.transform(n);
|
|
2583
2623
|
e[r.array] = `${a} ${o}`;
|
|
2584
2624
|
}
|
|
2585
|
-
function
|
|
2625
|
+
function ca(e, {
|
|
2586
2626
|
attrX: t,
|
|
2587
2627
|
attrY: n,
|
|
2588
2628
|
attrScale: s,
|
|
@@ -2592,15 +2632,15 @@ function oa(e, {
|
|
|
2592
2632
|
// This is object creation, which we try to avoid per-frame.
|
|
2593
2633
|
...o
|
|
2594
2634
|
}, l, c, u) {
|
|
2595
|
-
if (
|
|
2635
|
+
if (Zn(e, o, c), l) {
|
|
2596
2636
|
e.style.viewBox && (e.attrs.viewBox = e.style.viewBox);
|
|
2597
2637
|
return;
|
|
2598
2638
|
}
|
|
2599
2639
|
e.attrs = e.style, e.style = {};
|
|
2600
2640
|
const { attrs: f, style: h } = e;
|
|
2601
|
-
f.transform && (h.transform = f.transform, delete f.transform), (h.transform || f.transformOrigin) && (h.transformOrigin = f.transformOrigin ?? "50% 50%", delete f.transformOrigin), h.transform && (h.transformBox = u?.transformBox ?? "fill-box", delete f.transformBox), t !== void 0 && (f.x = t), n !== void 0 && (f.y = n), s !== void 0 && (f.scale = s), i !== void 0 &&
|
|
2641
|
+
f.transform && (h.transform = f.transform, delete f.transform), (h.transform || f.transformOrigin) && (h.transformOrigin = f.transformOrigin ?? "50% 50%", delete f.transformOrigin), h.transform && (h.transformBox = u?.transformBox ?? "fill-box", delete f.transformBox), t !== void 0 && (f.x = t), n !== void 0 && (f.y = n), s !== void 0 && (f.scale = s), i !== void 0 && ua(f, i, r, a, !1);
|
|
2602
2642
|
}
|
|
2603
|
-
const
|
|
2643
|
+
const es = /* @__PURE__ */ new Set([
|
|
2604
2644
|
"baseFrequency",
|
|
2605
2645
|
"diffuseConstant",
|
|
2606
2646
|
"kernelMatrix",
|
|
@@ -2624,49 +2664,49 @@ const Jn = /* @__PURE__ */ new Set([
|
|
|
2624
2664
|
"startOffset",
|
|
2625
2665
|
"textLength",
|
|
2626
2666
|
"lengthAdjust"
|
|
2627
|
-
]),
|
|
2628
|
-
function
|
|
2629
|
-
|
|
2667
|
+
]), fa = (e) => typeof e == "string" && e.toLowerCase() === "svg";
|
|
2668
|
+
function ha(e, t, n, s) {
|
|
2669
|
+
Jn(e, t, void 0, s);
|
|
2630
2670
|
for (const i in t.attrs)
|
|
2631
|
-
e.setAttribute(
|
|
2671
|
+
e.setAttribute(es.has(i) ? i : ht(i), t.attrs[i]);
|
|
2632
2672
|
}
|
|
2633
|
-
function
|
|
2634
|
-
const s =
|
|
2673
|
+
function da(e, t, n) {
|
|
2674
|
+
const s = Qn(e, t, n);
|
|
2635
2675
|
for (const i in e)
|
|
2636
|
-
if (
|
|
2637
|
-
const r =
|
|
2676
|
+
if (D(e[i]) || D(t[i])) {
|
|
2677
|
+
const r = Q.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
|
|
2638
2678
|
s[r] = e[i];
|
|
2639
2679
|
}
|
|
2640
2680
|
return s;
|
|
2641
2681
|
}
|
|
2642
|
-
class
|
|
2682
|
+
class pa extends Hn {
|
|
2643
2683
|
constructor() {
|
|
2644
|
-
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox =
|
|
2684
|
+
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = dt;
|
|
2645
2685
|
}
|
|
2646
2686
|
getBaseTargetFromProps(t, n) {
|
|
2647
2687
|
return t[n];
|
|
2648
2688
|
}
|
|
2649
2689
|
readValueFromInstance(t, n) {
|
|
2650
|
-
if (
|
|
2651
|
-
const s =
|
|
2690
|
+
if (ee.has(n)) {
|
|
2691
|
+
const s = $n(n);
|
|
2652
2692
|
return s && s.default || 0;
|
|
2653
2693
|
}
|
|
2654
|
-
return n =
|
|
2694
|
+
return n = es.has(n) ? n : ht(n), t.getAttribute(n);
|
|
2655
2695
|
}
|
|
2656
2696
|
scrapeMotionValuesFromProps(t, n, s) {
|
|
2657
|
-
return
|
|
2697
|
+
return da(t, n, s);
|
|
2658
2698
|
}
|
|
2659
2699
|
build(t, n, s) {
|
|
2660
|
-
|
|
2700
|
+
ca(t, n, this.isSVGTag, s.transformTemplate, s.style);
|
|
2661
2701
|
}
|
|
2662
2702
|
renderInstance(t, n, s, i) {
|
|
2663
|
-
|
|
2703
|
+
ha(t, n, s, i);
|
|
2664
2704
|
}
|
|
2665
2705
|
mount(t) {
|
|
2666
|
-
this.isSVGTag =
|
|
2706
|
+
this.isSVGTag = fa(t.tagName), super.mount(t);
|
|
2667
2707
|
}
|
|
2668
2708
|
}
|
|
2669
|
-
function
|
|
2709
|
+
function ma(e) {
|
|
2670
2710
|
const t = {
|
|
2671
2711
|
presenceContext: null,
|
|
2672
2712
|
props: {},
|
|
@@ -2680,10 +2720,10 @@ function ha(e) {
|
|
|
2680
2720
|
},
|
|
2681
2721
|
latestValues: {}
|
|
2682
2722
|
}
|
|
2683
|
-
}, n =
|
|
2684
|
-
n.mount(e),
|
|
2723
|
+
}, n = Un(e) && !rr(e) ? new pa(t) : new ia(t);
|
|
2724
|
+
n.mount(e), he.set(e, n);
|
|
2685
2725
|
}
|
|
2686
|
-
function
|
|
2726
|
+
function ga(e) {
|
|
2687
2727
|
const t = {
|
|
2688
2728
|
presenceContext: null,
|
|
2689
2729
|
props: {},
|
|
@@ -2693,68 +2733,68 @@ function da(e) {
|
|
|
2693
2733
|
},
|
|
2694
2734
|
latestValues: {}
|
|
2695
2735
|
}
|
|
2696
|
-
}, n = new
|
|
2697
|
-
n.mount(e),
|
|
2736
|
+
}, n = new aa(t);
|
|
2737
|
+
n.mount(e), he.set(e, n);
|
|
2698
2738
|
}
|
|
2699
|
-
function
|
|
2700
|
-
const s =
|
|
2701
|
-
return s.start(
|
|
2739
|
+
function ya(e, t, n) {
|
|
2740
|
+
const s = D(e) ? e : fe(e);
|
|
2741
|
+
return s.start(Yn("", s, t, n)), s.animation;
|
|
2702
2742
|
}
|
|
2703
|
-
function
|
|
2704
|
-
return
|
|
2743
|
+
function ba(e, t) {
|
|
2744
|
+
return D(e) || typeof e == "number" || typeof e == "string" && !ft(t);
|
|
2705
2745
|
}
|
|
2706
|
-
function
|
|
2746
|
+
function ts(e, t, n, s) {
|
|
2707
2747
|
const i = [];
|
|
2708
|
-
if (
|
|
2709
|
-
i.push(
|
|
2748
|
+
if (ba(e, t))
|
|
2749
|
+
i.push(ya(e, ft(t) && t.default || t, n && (n.default || n)));
|
|
2710
2750
|
else {
|
|
2711
|
-
const r =
|
|
2751
|
+
const r = jn(e, t, s), a = r.length;
|
|
2712
2752
|
k(!!a, "No valid elements provided.", "no-valid-elements");
|
|
2713
2753
|
for (let o = 0; o < a; o++) {
|
|
2714
2754
|
const l = r[o];
|
|
2715
2755
|
k(l !== null, "You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.", "animate-null");
|
|
2716
|
-
const c = l instanceof Element ?
|
|
2717
|
-
|
|
2718
|
-
const u =
|
|
2719
|
-
"delay" in f && typeof f.delay == "function" && (f.delay = f.delay(o, a)), i.push(...
|
|
2756
|
+
const c = l instanceof Element ? ma : ga;
|
|
2757
|
+
he.has(l) || c(l);
|
|
2758
|
+
const u = he.get(l), f = { ...n };
|
|
2759
|
+
"delay" in f && typeof f.delay == "function" && (f.delay = f.delay(o, a)), i.push(...Lr(u, { ...t, transition: f }, {}));
|
|
2720
2760
|
}
|
|
2721
2761
|
}
|
|
2722
2762
|
return i;
|
|
2723
2763
|
}
|
|
2724
|
-
function
|
|
2764
|
+
function Ta(e, t, n) {
|
|
2725
2765
|
const s = [];
|
|
2726
|
-
return
|
|
2727
|
-
s.push(...
|
|
2766
|
+
return mr(e, t, n, { spring: ce }).forEach(({ keyframes: r, transition: a }, o) => {
|
|
2767
|
+
s.push(...ts(o, r, a));
|
|
2728
2768
|
}), s;
|
|
2729
2769
|
}
|
|
2730
|
-
function
|
|
2770
|
+
function va(e) {
|
|
2731
2771
|
return Array.isArray(e) && e.some(Array.isArray);
|
|
2732
2772
|
}
|
|
2733
|
-
function
|
|
2773
|
+
function Va(e) {
|
|
2734
2774
|
function t(n, s, i) {
|
|
2735
2775
|
let r = [], a;
|
|
2736
|
-
if (
|
|
2737
|
-
r =
|
|
2776
|
+
if (va(n))
|
|
2777
|
+
r = Ta(n, s, e);
|
|
2738
2778
|
else {
|
|
2739
2779
|
const { onComplete: l, ...c } = i || {};
|
|
2740
|
-
typeof l == "function" && (a = l), r =
|
|
2780
|
+
typeof l == "function" && (a = l), r = ts(n, s, c, e);
|
|
2741
2781
|
}
|
|
2742
|
-
const o = new
|
|
2782
|
+
const o = new Wi(r);
|
|
2743
2783
|
return a && o.finished.then(a), o;
|
|
2744
2784
|
}
|
|
2745
2785
|
return t;
|
|
2746
2786
|
}
|
|
2747
|
-
const
|
|
2748
|
-
function
|
|
2749
|
-
const [n, s] =
|
|
2750
|
-
return a !== e && (o(e), r(e.startsWith(a) ? n : 0)),
|
|
2787
|
+
const Sa = Va(), Re = "";
|
|
2788
|
+
function wa(e, t = !0) {
|
|
2789
|
+
const [n, s] = Me(0), [i, r] = Me(0), [a, o] = Me(e);
|
|
2790
|
+
return a !== e && (o(e), r(e.startsWith(a) ? n : 0)), qt(() => {
|
|
2751
2791
|
if (!t)
|
|
2752
2792
|
return;
|
|
2753
|
-
const l =
|
|
2793
|
+
const l = Sa(
|
|
2754
2794
|
// The starting value for the animation (current cursor position).
|
|
2755
2795
|
i,
|
|
2756
2796
|
// The target value: total number of characters.
|
|
2757
|
-
e.split(
|
|
2797
|
+
e.split(Re).length,
|
|
2758
2798
|
{
|
|
2759
2799
|
// Total animation duration in seconds.
|
|
2760
2800
|
duration: 2,
|
|
@@ -2767,13 +2807,13 @@ function va(e, t = !0) {
|
|
|
2767
2807
|
}
|
|
2768
2808
|
);
|
|
2769
2809
|
return () => l.stop();
|
|
2770
|
-
}, [i, e, t]), t ? e.split(
|
|
2810
|
+
}, [i, e, t]), t ? e.split(Re).slice(0, n).join(Re) : e;
|
|
2771
2811
|
}
|
|
2772
|
-
const
|
|
2812
|
+
const ve = {
|
|
2773
2813
|
MODEL: "Model",
|
|
2774
2814
|
PLUGIN: "Plugin",
|
|
2775
2815
|
USAGE: "Session usage"
|
|
2776
|
-
},
|
|
2816
|
+
}, xa = Xt("max-w-[99cqw]", "mt-3"), Na = hs.memo(
|
|
2777
2817
|
({
|
|
2778
2818
|
content: e,
|
|
2779
2819
|
annotations: t,
|
|
@@ -2781,32 +2821,32 @@ const Te = {
|
|
|
2781
2821
|
smooth: s = !1,
|
|
2782
2822
|
isLastAssistantMessage: i = !1
|
|
2783
2823
|
}) => {
|
|
2784
|
-
const r =
|
|
2824
|
+
const r = wa(e, s), {
|
|
2785
2825
|
state: { streaming: a, restoredModel: o, tokenUsage: l }
|
|
2786
|
-
} =
|
|
2826
|
+
} = vt(is), {
|
|
2787
2827
|
state: { fullScreen: c }
|
|
2788
|
-
} =
|
|
2828
|
+
} = vt(rs), u = t?.model || o, f = l, [h, m] = ds(), { user: b, getAccessToken: y } = as(), { data: v } = os({
|
|
2789
2829
|
user: b?.username,
|
|
2790
2830
|
getAccessToken: y
|
|
2791
|
-
}), T = v?.showDetails || !1,
|
|
2831
|
+
}), T = v?.showDetails || !1, A = Xt("prose-li:ps-3", {
|
|
2792
2832
|
"max-w-xs sm:max-w-3xl": !c
|
|
2793
2833
|
});
|
|
2794
2834
|
let V;
|
|
2795
2835
|
return T && (V = {
|
|
2796
|
-
[
|
|
2797
|
-
[
|
|
2798
|
-
}, f && (i ? V[
|
|
2836
|
+
[ve.MODEL]: u || null,
|
|
2837
|
+
[ve.PLUGIN]: n ? ls(n) : null
|
|
2838
|
+
}, f && (i ? V[ve.USAGE] = `${us.format(f)} ${cs("token", f)}` : V[ve.USAGE] = fs)), qt(() => {
|
|
2799
2839
|
r && m(r);
|
|
2800
|
-
}, [r, m]), /* @__PURE__ */
|
|
2801
|
-
|
|
2840
|
+
}, [r, m]), /* @__PURE__ */ ss(
|
|
2841
|
+
ps,
|
|
2802
2842
|
{
|
|
2803
2843
|
tail: !0,
|
|
2804
|
-
copyToClipboardMode: "
|
|
2844
|
+
copyToClipboardMode: "light",
|
|
2805
2845
|
copyToClipboardFocusMode: "light",
|
|
2806
2846
|
copyToClipboard: a ? "loading..." : e,
|
|
2807
2847
|
footer: V,
|
|
2808
|
-
className:
|
|
2809
|
-
contentClassName:
|
|
2848
|
+
className: xa,
|
|
2849
|
+
contentClassName: A,
|
|
2810
2850
|
noMaxWidth: !0,
|
|
2811
2851
|
children: h
|
|
2812
2852
|
}
|
|
@@ -2814,5 +2854,5 @@ const Te = {
|
|
|
2814
2854
|
}
|
|
2815
2855
|
);
|
|
2816
2856
|
export {
|
|
2817
|
-
|
|
2857
|
+
Na as default
|
|
2818
2858
|
};
|