@mkbabb/keyframes.js 6.1.0 → 6.2.0
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/README.md +1 -1
- package/dist/engine/index.d.ts +6 -0
- package/dist/engine/index.js +659 -614
- package/dist/keyframes.d.ts +8 -0
- package/package.json +2 -2
package/dist/engine/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { D as e, S as t, T as n, _ as r, c as i, f as a, g as o, i as s, m as c, n as l, o as u, p as d, r as f, s as p, t as m, u as h, v as g, x as _ } from "../sequence-BUgKKePR.js";
|
|
2
|
-
import { C as v, D as y, E as b, S as
|
|
3
|
-
import { clamp as
|
|
4
|
-
import { easeInOutCubic as
|
|
5
|
-
import { convertColor as
|
|
6
|
-
import { coerceToSyntax as
|
|
7
|
-
import { isLayoutTrackingUnit as
|
|
8
|
-
import { PathGeometry as
|
|
2
|
+
import { C as v, D as y, E as b, S as x, T as ee, _ as S, a as te, b as ne, c as re, d as ie, f as ae, g as oe, h as se, i as ce, l as le, m as ue, n as de, o as fe, p as pe, r as me, s as he, t as ge, u as _e, v as ve, w as ye, x as be, y as C } from "../registry-CPtiwlwX.js";
|
|
3
|
+
import { clamp as xe, lerp as w, lerpArray as Se, scale as Ce } from "@mkbabb/value.js/math";
|
|
4
|
+
import { easeInOutCubic as we } from "@mkbabb/value.js/easing";
|
|
5
|
+
import { convertColor as Te, mixColors as Ee, oklab as De } from "@mkbabb/value.js/color";
|
|
6
|
+
import { coerceToSyntax as Oe, serializeCssColor as ke } from "@mkbabb/value.js/css";
|
|
7
|
+
import { isLayoutTrackingUnit as T } from "@mkbabb/value.js/value";
|
|
8
|
+
import { PathGeometry as Ae } from "@mkbabb/value.js/transform";
|
|
9
9
|
//#region \0rolldown/runtime.js
|
|
10
|
-
var
|
|
10
|
+
var je = Object.defineProperty, Me = (e, t) => {
|
|
11
11
|
let n = {};
|
|
12
|
-
for (var r in e)
|
|
12
|
+
for (var r in e) je(n, r, {
|
|
13
13
|
get: e[r],
|
|
14
14
|
enumerable: !0
|
|
15
15
|
});
|
|
16
|
-
return t ||
|
|
17
|
-
},
|
|
16
|
+
return t || je(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
17
|
+
}, Ne = [
|
|
18
18
|
"normal",
|
|
19
19
|
"reverse",
|
|
20
20
|
"alternate",
|
|
21
21
|
"alternate-reverse"
|
|
22
|
-
],
|
|
22
|
+
], Pe = [
|
|
23
23
|
"none",
|
|
24
24
|
"forwards",
|
|
25
25
|
"backwards",
|
|
26
26
|
"both"
|
|
27
|
-
],
|
|
27
|
+
], Fe = [
|
|
28
28
|
"rgb",
|
|
29
29
|
"hsl",
|
|
30
30
|
"hsv",
|
|
@@ -42,29 +42,29 @@ var Ne = Object.defineProperty, Pe = (e, t) => {
|
|
|
42
42
|
"rec2020",
|
|
43
43
|
"ictcp",
|
|
44
44
|
"jzazbz"
|
|
45
|
-
],
|
|
45
|
+
], Ie = [
|
|
46
46
|
"shorter",
|
|
47
47
|
"longer",
|
|
48
48
|
"increasing",
|
|
49
49
|
"decreasing"
|
|
50
|
-
],
|
|
50
|
+
], E = () => {}, D = {
|
|
51
51
|
duration: 1e3,
|
|
52
52
|
delay: 0,
|
|
53
53
|
iterationCount: 1,
|
|
54
54
|
direction: "normal",
|
|
55
55
|
fillMode: "forwards",
|
|
56
|
-
timingFunction: { fn:
|
|
56
|
+
timingFunction: { fn: we },
|
|
57
57
|
useWAAPI: !0,
|
|
58
58
|
respectReducedMotion: !1,
|
|
59
59
|
colorSpace: "oklab"
|
|
60
|
-
},
|
|
60
|
+
}, Le = {
|
|
61
61
|
zIndex: 0,
|
|
62
62
|
weight: 1,
|
|
63
63
|
op: "replace",
|
|
64
64
|
enabled: !0
|
|
65
|
-
},
|
|
66
|
-
typeof window < "u" && window.addEventListener("resize", () => (
|
|
67
|
-
var
|
|
65
|
+
}, Re = 0, ze = /* @__PURE__ */ new WeakMap(), Be = () => Re;
|
|
66
|
+
typeof window < "u" && window.addEventListener("resize", () => (ze = /* @__PURE__ */ new WeakMap(), ++Re), { passive: !0 });
|
|
67
|
+
var Ve = (e, t) => {
|
|
68
68
|
switch (t) {
|
|
69
69
|
case "cm": return 96 / 2.54 * e;
|
|
70
70
|
case "mm": return 96 / 25.4 * e;
|
|
@@ -74,7 +74,7 @@ var Ue = (e, t) => {
|
|
|
74
74
|
case "pc": return e * 16;
|
|
75
75
|
default: return e;
|
|
76
76
|
}
|
|
77
|
-
},
|
|
77
|
+
}, He = (e, t) => {
|
|
78
78
|
if (typeof window > "u") return;
|
|
79
79
|
let n = /^(sv|lv|dv|v)?(w|h|i|b|min|max)$/.exec(e);
|
|
80
80
|
if (!n) return;
|
|
@@ -87,7 +87,7 @@ var Ue = (e, t) => {
|
|
|
87
87
|
case "min": return Math.min(o, s);
|
|
88
88
|
case "max": return Math.max(o, s);
|
|
89
89
|
}
|
|
90
|
-
},
|
|
90
|
+
}, Ue = (e) => {
|
|
91
91
|
let t = e.parentElement;
|
|
92
92
|
for (; t;) {
|
|
93
93
|
let e = getComputedStyle(t).containerType;
|
|
@@ -95,17 +95,17 @@ var Ue = (e, t) => {
|
|
|
95
95
|
t = t.parentElement;
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
function
|
|
98
|
+
function We(e, t, n, r) {
|
|
99
99
|
let i = t === "em" || t === "rem" || t === "ex" || t === "ch" || t === "cap" || t === "ic" || t === "lh" || t === "rlh";
|
|
100
|
-
if (!
|
|
100
|
+
if (!T(t) && !i) return Ve(e, t);
|
|
101
101
|
if (t === "%" && n?.parentElement && r) {
|
|
102
102
|
let t = Number.parseFloat(getComputedStyle(n.parentElement).getPropertyValue(r));
|
|
103
103
|
return e / 100 * t;
|
|
104
104
|
}
|
|
105
|
-
let a =
|
|
105
|
+
let a = He(t, n);
|
|
106
106
|
if (a !== void 0) return e * a / 100;
|
|
107
107
|
if (t.startsWith("cq") && n) {
|
|
108
|
-
let r =
|
|
108
|
+
let r = Ue(n);
|
|
109
109
|
if (!r) return e;
|
|
110
110
|
let i = r.clientWidth, a = r.clientHeight, o = getComputedStyle(r).writingMode, s = o.startsWith("vertical") || o.startsWith("sideways");
|
|
111
111
|
return e * (t === "cqw" ? i : t === "cqh" ? a : t === "cqi" ? s ? a : i : t === "cqb" ? s ? i : a : t === "cqmin" ? Math.min(i, a) : Math.max(i, a)) / 100;
|
|
@@ -125,10 +125,10 @@ function Ke(e, t, n, r) {
|
|
|
125
125
|
let t = Number.parseFloat(s.lineHeight);
|
|
126
126
|
return e * (Number.isFinite(t) ? t : c * 1.2);
|
|
127
127
|
}
|
|
128
|
-
default: return
|
|
128
|
+
default: return Ve(e, t);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
var
|
|
131
|
+
var Ge = class extends TypeError {
|
|
132
132
|
property;
|
|
133
133
|
authoredValue;
|
|
134
134
|
actual;
|
|
@@ -136,14 +136,14 @@ var qe = class extends TypeError {
|
|
|
136
136
|
constructor(e, t, n) {
|
|
137
137
|
super(`Could not resolve "${y(t)}" for "${e}" to a numeric CSS scalar${n === "" ? "" : ` (computed: "${n}")`}.`), this.property = e, this.authoredValue = t, this.actual = n, this.name = "BrowserScalarResolutionError";
|
|
138
138
|
}
|
|
139
|
-
},
|
|
140
|
-
let r = () => new
|
|
139
|
+
}, Ke = (e, t, n) => {
|
|
140
|
+
let r = () => new Ge(n, t, e), i = C(ue(e), r);
|
|
141
141
|
if (i.payload.type !== "number") throw r();
|
|
142
142
|
return Object.freeze({
|
|
143
143
|
value: i.payload.value,
|
|
144
144
|
unit: i.payload.unit
|
|
145
145
|
});
|
|
146
|
-
},
|
|
146
|
+
}, qe = (e) => {
|
|
147
147
|
if (e.kind !== "call" || e.name !== "var") return;
|
|
148
148
|
let t = e.args[0];
|
|
149
149
|
if (t?.kind === "scalar" && t.payload.type === "keyword") return t.payload.value;
|
|
@@ -151,10 +151,10 @@ var qe = class extends TypeError {
|
|
|
151
151
|
let e = t.items[0];
|
|
152
152
|
if (e?.kind === "scalar" && e.payload.type === "keyword") return e.payload.value;
|
|
153
153
|
}
|
|
154
|
-
},
|
|
154
|
+
}, Je = (e, t, n) => {
|
|
155
155
|
if (e.kind === "scalar" && e.payload.type === "number") {
|
|
156
156
|
let { value: r, unit: i } = e.payload;
|
|
157
|
-
return
|
|
157
|
+
return T(i) || [
|
|
158
158
|
"em",
|
|
159
159
|
"rem",
|
|
160
160
|
"ex",
|
|
@@ -164,17 +164,17 @@ var qe = class extends TypeError {
|
|
|
164
164
|
"lh",
|
|
165
165
|
"rlh"
|
|
166
166
|
].includes(i) ? Object.freeze({
|
|
167
|
-
value:
|
|
167
|
+
value: We(r, i, t, n),
|
|
168
168
|
unit: "px"
|
|
169
169
|
}) : Object.freeze({
|
|
170
170
|
value: r,
|
|
171
171
|
unit: i
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
-
let r =
|
|
174
|
+
let r = qe(e);
|
|
175
175
|
if (r !== void 0) {
|
|
176
176
|
let i = getComputedStyle(t).getPropertyValue(r).trim(), a = t.style.getPropertyValue(r).trim();
|
|
177
|
-
return
|
|
177
|
+
return Ke(i || a, e, n);
|
|
178
178
|
}
|
|
179
179
|
let i = n.split(".", 1)[0] ?? n, a = t.style.getPropertyValue(i), o = t.style.getPropertyPriority(i), s = y(e), c = "";
|
|
180
180
|
try {
|
|
@@ -182,37 +182,37 @@ var qe = class extends TypeError {
|
|
|
182
182
|
} finally {
|
|
183
183
|
a === "" ? t.style.removeProperty(i) : t.style.setProperty(i, a, o);
|
|
184
184
|
}
|
|
185
|
-
return
|
|
185
|
+
return Ke(c, e, n);
|
|
186
186
|
};
|
|
187
|
-
function
|
|
188
|
-
if (!t.isConnected) return
|
|
189
|
-
let r =
|
|
190
|
-
r === void 0 && (r = /* @__PURE__ */ new WeakMap(),
|
|
187
|
+
function Ye(e, t, n) {
|
|
188
|
+
if (!t.isConnected) return Je(e, t, n);
|
|
189
|
+
let r = ze.get(e);
|
|
190
|
+
r === void 0 && (r = /* @__PURE__ */ new WeakMap(), ze.set(e, r));
|
|
191
191
|
let i = r.get(t);
|
|
192
192
|
i === void 0 && (i = /* @__PURE__ */ new Map(), r.set(t, i));
|
|
193
193
|
let a = i.get(n);
|
|
194
|
-
if (a?.epoch ===
|
|
195
|
-
let o =
|
|
194
|
+
if (a?.epoch === Re) return a.result;
|
|
195
|
+
let o = Je(e, t, n), s = Object.freeze({
|
|
196
196
|
result: o,
|
|
197
|
-
epoch:
|
|
197
|
+
epoch: Re
|
|
198
198
|
});
|
|
199
199
|
return i.set(n, s), o;
|
|
200
200
|
}
|
|
201
201
|
//#endregion
|
|
202
202
|
//#region src/animation/compile/frame/interp-slot.ts
|
|
203
|
-
var
|
|
203
|
+
var Xe = {
|
|
204
204
|
deg: 1,
|
|
205
205
|
grad: .9,
|
|
206
206
|
rad: 180 / Math.PI,
|
|
207
207
|
turn: 360
|
|
208
|
-
},
|
|
208
|
+
}, Ze = {
|
|
209
209
|
ms: 1,
|
|
210
210
|
s: 1e3
|
|
211
|
-
},
|
|
211
|
+
}, Qe = {
|
|
212
212
|
dpi: 1,
|
|
213
213
|
dpcm: 2.54,
|
|
214
214
|
dppx: 96
|
|
215
|
-
},
|
|
215
|
+
}, $e = new Set(/* @__PURE__ */ "px.cm.mm.Q.in.pc.pt.em.ex.ch.cap.ic.rem.lh.rlh.vw.vh.vmin.vmax.vb.vi.svw.svh.svi.svb.svmin.svmax.lvw.lvh.lvi.lvb.lvmin.lvmax.dvw.dvh.dvi.dvb.dvmin.dvmax.cqw.cqh.cqi.cqb.cqmin.cqmax.%".split(".")), et = new Set([
|
|
216
216
|
"em",
|
|
217
217
|
"rem",
|
|
218
218
|
"ex",
|
|
@@ -221,16 +221,16 @@ var Qe = {
|
|
|
221
221
|
"ic",
|
|
222
222
|
"lh",
|
|
223
223
|
"rlh"
|
|
224
|
-
]),
|
|
225
|
-
let t =
|
|
224
|
+
]), tt = (e) => e.kind === "scalar" ? e.payload : void 0, nt = (e) => {
|
|
225
|
+
let t = tt(e);
|
|
226
226
|
return t?.type === "number" ? t : void 0;
|
|
227
|
-
},
|
|
228
|
-
let t =
|
|
227
|
+
}, rt = (e) => {
|
|
228
|
+
let t = tt(e);
|
|
229
229
|
return t?.type === "color" ? t.value : void 0;
|
|
230
|
-
},
|
|
230
|
+
}, it = (e) => e.kind === "call" && (e.name === "var" || e.name === "calc"), at = (e, t) => it(e) || it(t) || e.kind === "call" && t.kind === "call" && e.name !== t.name || e.kind !== t.kind && (e.kind === "call" || t.kind === "call"), ot = (e, t) => {
|
|
231
231
|
let n = e.unit, r = t.unit;
|
|
232
|
-
return e.value === 0 && n === "" && r !== "" && (n = r), t.value === 0 && r === "" && n !== "" && (r = n), n === r ||
|
|
233
|
-
},
|
|
232
|
+
return e.value === 0 && n === "" && r !== "" && (n = r), t.value === 0 && r === "" && n !== "" && (r = n), n === r || !$e.has(n) || !$e.has(r) ? !1 : T(n) || T(r) || et.has(n) || et.has(r);
|
|
233
|
+
}, st = (e, t, n) => ({
|
|
234
234
|
kind: "computed",
|
|
235
235
|
from: e,
|
|
236
236
|
to: t,
|
|
@@ -239,38 +239,38 @@ var Qe = {
|
|
|
239
239
|
property: n.property,
|
|
240
240
|
cache: void 0,
|
|
241
241
|
...n.target === void 0 ? {} : { target: n.target }
|
|
242
|
-
}),
|
|
242
|
+
}), ct = (e, t, n) => {
|
|
243
243
|
let r = e.unit, i = t.unit;
|
|
244
244
|
if (e.value === 0 && r === "" && i !== "" && (r = i), t.value === 0 && i === "" && r !== "" && (i = r), r === i) return [
|
|
245
245
|
e.value,
|
|
246
246
|
t.value,
|
|
247
247
|
r
|
|
248
248
|
];
|
|
249
|
-
let a =
|
|
249
|
+
let a = Xe[r], o = Xe[i];
|
|
250
250
|
if (a !== void 0 && o !== void 0) return [
|
|
251
251
|
e.value * a,
|
|
252
252
|
t.value * o,
|
|
253
253
|
"deg"
|
|
254
254
|
];
|
|
255
|
-
let s =
|
|
255
|
+
let s = Ze[r], c = Ze[i];
|
|
256
256
|
if (s !== void 0 && c !== void 0) return [
|
|
257
257
|
e.value * s,
|
|
258
258
|
t.value * c,
|
|
259
259
|
"ms"
|
|
260
260
|
];
|
|
261
|
-
let l =
|
|
261
|
+
let l = Qe[r], u = Qe[i];
|
|
262
262
|
if (l !== void 0 && u !== void 0) return [
|
|
263
263
|
e.value * l,
|
|
264
264
|
t.value * u,
|
|
265
265
|
"dpi"
|
|
266
266
|
];
|
|
267
|
-
if (
|
|
268
|
-
|
|
269
|
-
|
|
267
|
+
if ($e.has(r) && $e.has(i)) return [
|
|
268
|
+
We(e.value, r, n.target, n.property),
|
|
269
|
+
We(t.value, i, n.target, n.property),
|
|
270
270
|
"px"
|
|
271
271
|
];
|
|
272
272
|
throw TypeError(`Cannot interpolate incompatible CSS units "${r}" and "${i}" for "${n.property}".`);
|
|
273
|
-
},
|
|
273
|
+
}, lt = (e, t, n, r) => ct({
|
|
274
274
|
type: "number",
|
|
275
275
|
value: e.value,
|
|
276
276
|
unit: e.unit
|
|
@@ -283,14 +283,14 @@ var Qe = {
|
|
|
283
283
|
target: n,
|
|
284
284
|
property: r
|
|
285
285
|
});
|
|
286
|
-
function
|
|
287
|
-
let r =
|
|
286
|
+
function ut(e, t, n) {
|
|
287
|
+
let r = nt(e), i = nt(t);
|
|
288
288
|
if (r !== void 0 && i !== void 0) {
|
|
289
|
-
if (
|
|
289
|
+
if (ot(r, i)) {
|
|
290
290
|
if (r.unit === "%" || i.unit === "%") throw TypeError(`Cannot interpolate mixed percentage lengths for "${n.property}" without a property-specific percentage basis.`);
|
|
291
|
-
return
|
|
291
|
+
return st(e, t, n);
|
|
292
292
|
}
|
|
293
|
-
let [a, o, s] =
|
|
293
|
+
let [a, o, s] = ct(r, i, n);
|
|
294
294
|
return {
|
|
295
295
|
kind: "number",
|
|
296
296
|
from: a,
|
|
@@ -299,7 +299,7 @@ function dt(e, t, n) {
|
|
|
299
299
|
unit: s
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
|
-
let a =
|
|
302
|
+
let a = rt(e), o = rt(t);
|
|
303
303
|
if (a !== void 0 && o !== void 0) {
|
|
304
304
|
let e = {
|
|
305
305
|
kind: "color",
|
|
@@ -310,7 +310,7 @@ function dt(e, t, n) {
|
|
|
310
310
|
};
|
|
311
311
|
return n.hueMethod !== void 0 && (e.hue = n.hueMethod), e;
|
|
312
312
|
}
|
|
313
|
-
if (
|
|
313
|
+
if (at(e, t)) return st(e, t, n);
|
|
314
314
|
if (e.kind !== t.kind) throw TypeError(`Cannot interpolate unlike CSS value kinds "${e.kind}" and "${t.kind}" for "${n.property}".`);
|
|
315
315
|
return {
|
|
316
316
|
kind: "discrete",
|
|
@@ -319,13 +319,13 @@ function dt(e, t, n) {
|
|
|
319
319
|
current: e
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function dt(e, t, n) {
|
|
323
323
|
switch (e.kind) {
|
|
324
324
|
case "number":
|
|
325
|
-
e.current =
|
|
325
|
+
e.current = w(e.from, e.to, t);
|
|
326
326
|
return;
|
|
327
327
|
case "color": {
|
|
328
|
-
let n =
|
|
328
|
+
let n = Ee(e.from, e.to, t, {
|
|
329
329
|
space: e.space,
|
|
330
330
|
...e.hue === void 0 ? {} : { hue: e.hue }
|
|
331
331
|
});
|
|
@@ -334,12 +334,12 @@ function ft(e, t, n) {
|
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
336
|
case "computed": {
|
|
337
|
-
n !== void 0 &&
|
|
337
|
+
n !== void 0 && O(e, n);
|
|
338
338
|
let r = e.target;
|
|
339
339
|
if (r === void 0) throw TypeError(`Computed CSS interpolation for "${e.property}" requires a browser target at sample time.`);
|
|
340
|
-
let i =
|
|
340
|
+
let i = Be(), a = e.cache;
|
|
341
341
|
if (a === void 0 || a.epoch !== i || a.target !== r) {
|
|
342
|
-
let [t, n, o] =
|
|
342
|
+
let [t, n, o] = lt(Ye(e.from, r, e.property), Ye(e.to, r, e.property), r, e.property);
|
|
343
343
|
a = Object.freeze({
|
|
344
344
|
epoch: i,
|
|
345
345
|
target: r,
|
|
@@ -348,20 +348,20 @@ function ft(e, t, n) {
|
|
|
348
348
|
unit: o
|
|
349
349
|
}), e.cache = a;
|
|
350
350
|
}
|
|
351
|
-
e.current =
|
|
351
|
+
e.current = w(a.from, a.to, t), e.unit = a.unit;
|
|
352
352
|
return;
|
|
353
353
|
}
|
|
354
354
|
case "discrete": e.current = t < .5 ? e.from : e.to;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function O(e, t) {
|
|
358
358
|
e.kind !== "computed" || e.target === t || (t === void 0 ? delete e.target : e.target = t, e.cache = void 0);
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function ft(e) {
|
|
361
361
|
switch (e.kind) {
|
|
362
362
|
case "number": return `${e.current}${e.unit}`;
|
|
363
363
|
case "color": {
|
|
364
|
-
let t =
|
|
364
|
+
let t = ke(e.current);
|
|
365
365
|
if (!t.ok) throw TypeError(`Color serialization failed: ${t.error.code}.`);
|
|
366
366
|
return t.value;
|
|
367
367
|
}
|
|
@@ -371,46 +371,46 @@ function pt(e) {
|
|
|
371
371
|
}
|
|
372
372
|
//#endregion
|
|
373
373
|
//#region src/animation/internal/helpers.ts
|
|
374
|
-
var
|
|
375
|
-
function
|
|
374
|
+
var k = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), pt = (e) => new Promise((t) => setTimeout(t, e));
|
|
375
|
+
function mt(e, t, n) {
|
|
376
376
|
for (let r = e - 1; r >= 0; r--) if (n(t[r])) return r;
|
|
377
377
|
}
|
|
378
378
|
//#endregion
|
|
379
379
|
//#region src/animation/compile/value/compile.ts
|
|
380
|
-
var
|
|
380
|
+
var ht = (e) => {
|
|
381
381
|
if (typeof e != "object" || !e) return !1;
|
|
382
382
|
let t = e.kind;
|
|
383
383
|
return t === "scalar" || t === "call" || t === "list";
|
|
384
|
-
},
|
|
384
|
+
}, gt = (e) => ({
|
|
385
385
|
kind: "scalar",
|
|
386
386
|
payload: {
|
|
387
387
|
type: "number",
|
|
388
388
|
value: e,
|
|
389
389
|
unit: ""
|
|
390
390
|
}
|
|
391
|
-
}),
|
|
392
|
-
if (
|
|
393
|
-
if (typeof e == "number") return
|
|
394
|
-
if (typeof e == "string") return
|
|
391
|
+
}), _t = (e, t) => {
|
|
392
|
+
if (ht(e)) return e;
|
|
393
|
+
if (typeof e == "number") return gt(e);
|
|
394
|
+
if (typeof e == "string") return C(se(e), ([e]) => /* @__PURE__ */ TypeError(`Invalid CSS value for "${t}" at ${e.start}-${e.end}: expected ${e.expected.join(" or ")}.`));
|
|
395
395
|
if (Array.isArray(e)) return {
|
|
396
396
|
kind: "list",
|
|
397
397
|
separator: "space",
|
|
398
|
-
items: e.map((e) =>
|
|
398
|
+
items: e.map((e) => _t(e, t))
|
|
399
399
|
};
|
|
400
400
|
throw TypeError(`Unsupported authored value for "${t}".`);
|
|
401
401
|
};
|
|
402
|
-
function
|
|
402
|
+
function vt(e) {
|
|
403
403
|
let t = {}, n = (e, r) => {
|
|
404
|
-
if (typeof e == "object" && e && !Array.isArray(e) && !
|
|
404
|
+
if (typeof e == "object" && e && !Array.isArray(e) && !ht(e)) {
|
|
405
405
|
for (let [t, i] of Object.entries(e)) n(i, r === "" ? t : `${r}.${t}`);
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
408
|
if (r === "") throw TypeError("An animation value requires a property name.");
|
|
409
|
-
t[r] =
|
|
409
|
+
t[r] = _t(e, r);
|
|
410
410
|
};
|
|
411
411
|
return n(e, ""), t;
|
|
412
412
|
}
|
|
413
|
-
var
|
|
413
|
+
var yt = {
|
|
414
414
|
brightness: {
|
|
415
415
|
value: 1,
|
|
416
416
|
unit: ""
|
|
@@ -515,8 +515,8 @@ var bt = {
|
|
|
515
515
|
value: 0,
|
|
516
516
|
unit: "deg"
|
|
517
517
|
}
|
|
518
|
-
},
|
|
519
|
-
let t =
|
|
518
|
+
}, bt = (e) => {
|
|
519
|
+
let t = yt[e.name];
|
|
520
520
|
if (t === void 0) throw TypeError(`No interpolation identity is defined for CSS function "${e.name}".`);
|
|
521
521
|
return {
|
|
522
522
|
kind: "call",
|
|
@@ -530,11 +530,11 @@ var bt = {
|
|
|
530
530
|
}
|
|
531
531
|
}))
|
|
532
532
|
};
|
|
533
|
-
},
|
|
533
|
+
}, xt = (e) => e.every((e) => e.kind === "call") ? new Set(e.map((e) => e.name)).size === e.length : !1, St = (e, t) => {
|
|
534
534
|
let n = [...e.map((e) => e.name)];
|
|
535
535
|
for (let e of t) n.includes(e.name) || n.push(e.name);
|
|
536
536
|
let r = new Map(e.map((e) => [e.name, e])), i = new Map(t.map((e) => [e.name, e]));
|
|
537
|
-
return [n.map((e) => r.get(e) ??
|
|
537
|
+
return [n.map((e) => r.get(e) ?? bt(i.get(e))), n.map((e) => i.get(e) ?? bt(r.get(e)))];
|
|
538
538
|
}, Ct = (e) => e.kind === "call" && (e.name === "var" || e.name === "calc"), wt = (e) => e.kind === "list" && e.items.length === 1 ? e.items[0] : void 0, A = (e, t) => t.kind === "list" ? {
|
|
539
539
|
kind: "list",
|
|
540
540
|
separator: t.separator,
|
|
@@ -542,17 +542,17 @@ var bt = {
|
|
|
542
542
|
} : e;
|
|
543
543
|
function Tt(e, t, n) {
|
|
544
544
|
let r = [], i = (e, t) => {
|
|
545
|
-
let a = e, o = t, s = wt(a), c = wt(o), l = a.kind === "list" && o.kind === "list" &&
|
|
545
|
+
let a = e, o = t, s = wt(a), c = wt(o), l = a.kind === "list" && o.kind === "list" && xt(a.items) && xt(o.items);
|
|
546
546
|
if (s !== void 0 && o.kind !== "list" ? a = s : c !== void 0 && a.kind !== "list" ? o = c : a.kind === "scalar" && o.kind === "list" ? a = A(a, o) : o.kind === "scalar" && a.kind === "list" ? o = A(o, a) : !l && a.kind === "list" && s !== void 0 && o.kind === "list" && (a.separator !== o.separator || a.items.length !== o.items.length) ? a = A(s, o) : !l && o.kind === "list" && c !== void 0 && a.kind === "list" && (o.separator !== a.separator || o.items.length !== a.items.length) && (o = A(c, a)), Ct(a) || Ct(o) || a.kind === "call" && o.kind === "call" && a.name !== o.name || a.kind !== o.kind && (a.kind === "call" || o.kind === "call")) {
|
|
547
547
|
let e = r.length;
|
|
548
|
-
return r.push(
|
|
548
|
+
return r.push(ut(a, o, n)), {
|
|
549
549
|
kind: "slot",
|
|
550
550
|
index: e
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
553
|
if (a.kind === "scalar" && o.kind === "scalar") {
|
|
554
554
|
let e = r.length;
|
|
555
|
-
return r.push(
|
|
555
|
+
return r.push(ut(a, o, n)), {
|
|
556
556
|
kind: "slot",
|
|
557
557
|
index: e
|
|
558
558
|
};
|
|
@@ -569,7 +569,7 @@ function Tt(e, t, n) {
|
|
|
569
569
|
if (a.kind === "list" && o.kind === "list") {
|
|
570
570
|
if (a.separator !== o.separator) throw TypeError(`Cannot interpolate CSS lists with different separators for "${n.property}".`);
|
|
571
571
|
let e = a.items, t = o.items;
|
|
572
|
-
if (
|
|
572
|
+
if (xt(e) && xt(t)) [e, t] = St(e, t);
|
|
573
573
|
else if (e.length !== t.length) throw TypeError(`Cannot interpolate CSS lists with different lengths for "${n.property}".`);
|
|
574
574
|
return {
|
|
575
575
|
kind: "list",
|
|
@@ -587,7 +587,7 @@ function Tt(e, t, n) {
|
|
|
587
587
|
var Et = (e) => e === "comma" ? ", " : e === "slash" ? " / " : " ";
|
|
588
588
|
function Dt(e) {
|
|
589
589
|
let t = (n) => {
|
|
590
|
-
if (n.kind === "slot") return
|
|
590
|
+
if (n.kind === "slot") return ft(e.slots[n.index]);
|
|
591
591
|
if (n.kind === "list") return n.items.map(t).join(Et(n.separator));
|
|
592
592
|
let r = n.name === "calc" ? " " : ", ";
|
|
593
593
|
return `${n.name}(${n.args.map(t).join(r)})`;
|
|
@@ -679,7 +679,7 @@ var j = {
|
|
|
679
679
|
}
|
|
680
680
|
}, Ft = 1e6;
|
|
681
681
|
function It(e) {
|
|
682
|
-
return
|
|
682
|
+
return C(oe(e), (t) => new n("start", e, `invalid keyframe selector — ${t.map(_e).join("; ")}`, e.trim() === "" ? "EMPTY_PARSE" : void 0));
|
|
683
683
|
}
|
|
684
684
|
var Lt = (e) => {
|
|
685
685
|
if (e.kind !== "named") throw new n("start", e, "named phase resolution requires a parsed named keyframe selector", "NAMED_SELECTOR_NO_TIMELINE");
|
|
@@ -708,7 +708,7 @@ var Lt = (e) => {
|
|
|
708
708
|
if (typeof r != "string") throw new n(e, r, "a timing-function name or CSS timing-function literal must be a string");
|
|
709
709
|
let i;
|
|
710
710
|
try {
|
|
711
|
-
i =
|
|
711
|
+
i = ge(r);
|
|
712
712
|
} catch {
|
|
713
713
|
throw new n(e, r, "unknown timing function — pass a callable TimingFunction, a typed Easing, a registry name, or a cubic-bezier() literal", "UNKNOWN_TIMING_FN");
|
|
714
714
|
}
|
|
@@ -761,12 +761,12 @@ var Vt = class {
|
|
|
761
761
|
stop: t
|
|
762
762
|
}, a = Bt(n, r, this.options.duration), o = n.transform;
|
|
763
763
|
if (o == null) {
|
|
764
|
-
let t =
|
|
765
|
-
o = (t === void 0 ? void 0 : this.templateFrames[t].transform) ??
|
|
764
|
+
let t = mt(e, this.templateFrames, (e) => e.transform != null);
|
|
765
|
+
o = (t === void 0 ? void 0 : this.templateFrames[t].transform) ?? E;
|
|
766
766
|
}
|
|
767
767
|
let s = n.timingFunction;
|
|
768
768
|
if (s == null) {
|
|
769
|
-
let t =
|
|
769
|
+
let t = mt(e, this.templateFrames, (e) => e.timingFunction != null);
|
|
770
770
|
s = (t === void 0 ? void 0 : this.templateFrames[t].timingFunction) ?? this.options.timingFunction;
|
|
771
771
|
}
|
|
772
772
|
let c = e * Ft + t, l = r.composition;
|
|
@@ -806,7 +806,7 @@ var Vt = class {
|
|
|
806
806
|
}
|
|
807
807
|
}
|
|
808
808
|
parse(e) {
|
|
809
|
-
this._frames = [], this._targets = e, this.templateFrames.sort((e, t) => e.start.kind === "percent" && t.start.kind === "percent" ? e.start.value - t.start.value : 0), this.parsedVars = this.templateFrames.map((e) =>
|
|
809
|
+
this._frames = [], this._targets = e, this.templateFrames.sort((e, t) => e.start.kind === "percent" && t.start.kind === "percent" ? e.start.value - t.start.value : 0), this.parsedVars = this.templateFrames.map((e) => vt(e.vars));
|
|
810
810
|
for (let e = 0; e < this.templateFrames.length - 1; e++) this._frames.push(this.createFrame(e, e + 1));
|
|
811
811
|
let t = this.buildVarIndex();
|
|
812
812
|
this._frames.forEach((e, n) => this.reconcileVars(n, t)), this._frames.sort((e, t) => e.time.start === t.time.start ? e.time.stop - t.time.stop : e.time.start - t.time.start), this._frames = this._frames.filter((e) => e.interpVars != null && Object.keys(e.interpVars).length > 0), this._frames.forEach((e) => this.finalizeFrameVars(e));
|
|
@@ -905,7 +905,7 @@ var nn = new Set([
|
|
|
905
905
|
"ic",
|
|
906
906
|
"lh",
|
|
907
907
|
"rlh"
|
|
908
|
-
]), rn = (e) => typeof e == "string" && (
|
|
908
|
+
]), rn = (e) => typeof e == "string" && (T(e) || nn.has(e)), an = (e) => {
|
|
909
909
|
if (e.kind === "call") return e.name;
|
|
910
910
|
if (!(e.kind !== "scalar" || e.payload.type !== "number")) return e.payload.unit;
|
|
911
911
|
}, on = new Set(["offset-distance"]), sn = (e) => on.has(e) || on.has(e.split(".").pop() ?? e), cn = () => typeof globalThis.webkitConvertPointFromNodeToPage == "function";
|
|
@@ -1170,7 +1170,7 @@ async function On(e) {
|
|
|
1170
1170
|
//#region src/animation/engine/play-lifecycle/frame.ts
|
|
1171
1171
|
var kn = (e) => e.options.delay > 0 && e._playback.iteration === 0;
|
|
1172
1172
|
function An(e) {
|
|
1173
|
-
if (e._playback.reversed = !1, Gt(e.options.direction, e._playback.iteration) && Kt(e), (e.options.fillMode === "backwards" || e.options.fillMode === "both") && e.fillBackwards(), kn(e)) return e._playback.paused = !0,
|
|
1173
|
+
if (e._playback.reversed = !1, Gt(e.options.direction, e._playback.iteration) && Kt(e), (e.options.fillMode === "backwards" || e.options.fillMode === "both") && e.fillBackwards(), kn(e)) return e._playback.paused = !0, pt(e.options.delay).then(() => {
|
|
1174
1174
|
e._playback.paused = !1, e._playback.started = !0;
|
|
1175
1175
|
});
|
|
1176
1176
|
e._playback.started = !0;
|
|
@@ -1274,7 +1274,7 @@ function Un(e, t, n, r) {
|
|
|
1274
1274
|
if (o !== void 0) return o.slice(0, n);
|
|
1275
1275
|
let s = e.style.getPropertyValue(a) || e.style[a] || "";
|
|
1276
1276
|
if (!s) return i;
|
|
1277
|
-
let c =
|
|
1277
|
+
let c = be(() => se(s), (e) => Hn(e), []);
|
|
1278
1278
|
for (let e = 0; e < n && e < c.length; e++) {
|
|
1279
1279
|
let t = c[e];
|
|
1280
1280
|
Number.isFinite(t) && (i[e] = t);
|
|
@@ -1311,7 +1311,7 @@ function Yn(e, t, n = !1) {
|
|
|
1311
1311
|
Jn(e);
|
|
1312
1312
|
let r = e._playback.reversed;
|
|
1313
1313
|
e._playback.reversed = !1;
|
|
1314
|
-
let i = I(e,
|
|
1314
|
+
let i = I(e, xe(t, 0, 1) * e.options.duration, n);
|
|
1315
1315
|
return e._playback.reversed = r, i;
|
|
1316
1316
|
}
|
|
1317
1317
|
function I(e, t, n = !1, r) {
|
|
@@ -1344,13 +1344,13 @@ function Xn(e, t) {
|
|
|
1344
1344
|
for (let e = 0; e < n.length; e++) t[n[e]] = void 0;
|
|
1345
1345
|
}
|
|
1346
1346
|
function Zn(e, t, n, r) {
|
|
1347
|
-
let { start: i, stop: a } = t.time, o = i === a ? 1 :
|
|
1347
|
+
let { start: i, stop: a } = t.time, o = i === a ? 1 : Ce(n, i, a, 0, 1), s = t.timingFunction.fn(o), c = e.targets[0], l = t._numericPlan;
|
|
1348
1348
|
if (l !== void 0 && l.numeric.length > 0) {
|
|
1349
1349
|
let { numeric: e, from: t, to: n, out: r } = l;
|
|
1350
|
-
|
|
1350
|
+
Se(t, n, s, r);
|
|
1351
1351
|
for (let t = 0; t < e.length; t++) e[t].current = r[t];
|
|
1352
|
-
for (let e of l.residual)
|
|
1353
|
-
} else for (let e of t.allInterpVars)
|
|
1352
|
+
for (let e of l.residual) O(e, c), dt(e, s);
|
|
1353
|
+
} else for (let e of t.allInterpVars) O(e, c), dt(e, s);
|
|
1354
1354
|
r && e._hasComposition && t.composition != null && Qn(e, t), Pt(t._sink), r && (e.unflatten ? t.transform(t.vars, n) : t.transform(t.flatVars, n));
|
|
1355
1355
|
}
|
|
1356
1356
|
function Qn(e, t) {
|
|
@@ -1366,7 +1366,7 @@ function Qn(e, t) {
|
|
|
1366
1366
|
//#endregion
|
|
1367
1367
|
//#region src/animation/engine/options.ts
|
|
1368
1368
|
var $n = (e) => {
|
|
1369
|
-
let t =
|
|
1369
|
+
let t = ie(ue(e), void 0);
|
|
1370
1370
|
if (t?.payload.type !== "number") return;
|
|
1371
1371
|
let { value: n, unit: r } = t.payload;
|
|
1372
1372
|
if (Number.isFinite(n)) {
|
|
@@ -1375,10 +1375,10 @@ var $n = (e) => {
|
|
|
1375
1375
|
}
|
|
1376
1376
|
};
|
|
1377
1377
|
function er(e) {
|
|
1378
|
-
return e == null ?
|
|
1378
|
+
return e == null ? D.timingFunction : zt("timingFunction", e);
|
|
1379
1379
|
}
|
|
1380
1380
|
function tr(t) {
|
|
1381
|
-
return t == null ?
|
|
1381
|
+
return t == null ? D.iterationCount : t === "infinite" || t === "∞" || t === "Infinity" || t === Infinity ? Infinity : e("iterationCount", t, (e) => {
|
|
1382
1382
|
let t = typeof e == "string" ? Number.parseFloat(e.trim()) : e;
|
|
1383
1383
|
return typeof t == "number" && !Number.isNaN(t) && t >= 0 ? t : void 0;
|
|
1384
1384
|
}, "expected a non-negative count, \"infinite\", or Infinity");
|
|
@@ -1390,34 +1390,34 @@ function nr(t) {
|
|
|
1390
1390
|
}, "expected a positive duration in milliseconds or a CSS time string");
|
|
1391
1391
|
}
|
|
1392
1392
|
function rr(t) {
|
|
1393
|
-
return t == null ?
|
|
1393
|
+
return t == null ? D.delay : e("delay", t, (e) => {
|
|
1394
1394
|
let t = typeof e == "string" ? $n(e) : e;
|
|
1395
1395
|
return typeof t == "number" && isFinite(t) ? t : void 0;
|
|
1396
1396
|
}, "expected a delay in milliseconds or a CSS time string");
|
|
1397
1397
|
}
|
|
1398
1398
|
function ir(e) {
|
|
1399
|
-
if (e == null) return
|
|
1400
|
-
if (!
|
|
1399
|
+
if (e == null) return D.direction;
|
|
1400
|
+
if (!Ne.includes(e)) throw new n("direction", e, `expected one of: ${Ne.join(", ")}`);
|
|
1401
1401
|
return e;
|
|
1402
1402
|
}
|
|
1403
1403
|
function ar(e) {
|
|
1404
|
-
if (e == null) return
|
|
1405
|
-
if (!
|
|
1404
|
+
if (e == null) return D.fillMode;
|
|
1405
|
+
if (!Pe.includes(e)) throw new n("fillMode", e, `expected one of: ${Pe.join(", ")}`);
|
|
1406
1406
|
return e;
|
|
1407
1407
|
}
|
|
1408
1408
|
function or(e, t) {
|
|
1409
|
-
if (t == null) return
|
|
1409
|
+
if (t == null) return D[e];
|
|
1410
1410
|
if (typeof t != "boolean") throw new n(e, t, "expected a boolean");
|
|
1411
1411
|
return t;
|
|
1412
1412
|
}
|
|
1413
1413
|
function sr(e) {
|
|
1414
|
-
if (e == null) return
|
|
1415
|
-
if (!
|
|
1414
|
+
if (e == null) return D.colorSpace;
|
|
1415
|
+
if (!Fe.includes(e)) throw new n("colorSpace", e, `expected one of: ${Fe.join(", ")}`);
|
|
1416
1416
|
return e;
|
|
1417
1417
|
}
|
|
1418
1418
|
function cr(e) {
|
|
1419
1419
|
if (e != null) {
|
|
1420
|
-
if (!
|
|
1420
|
+
if (!Ie.includes(e)) throw new n("hueMethod", e, `expected one of: ${Ie.join(", ")}`);
|
|
1421
1421
|
return e;
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
@@ -1492,7 +1492,7 @@ function Tr(e) {
|
|
|
1492
1492
|
for (let n of e.frames) {
|
|
1493
1493
|
let r = n.transform;
|
|
1494
1494
|
if (e.usesDefaultRenderer(r)) t ??= r;
|
|
1495
|
-
else if (r !==
|
|
1495
|
+
else if (r !== E) return {
|
|
1496
1496
|
declared: r,
|
|
1497
1497
|
own: r
|
|
1498
1498
|
};
|
|
@@ -1512,7 +1512,7 @@ function Er(e, t) {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
(a === void 0 || n.declared === void 0) && (e.unflatten = t.unflatten);
|
|
1514
1514
|
let o = e.targets[0], s = e.frames;
|
|
1515
|
-
for (let e of s) for (let t of Object.values(e.interpVars)) for (let e of t.slots)
|
|
1515
|
+
for (let e of s) for (let t of Object.values(e.interpVars)) for (let e of t.slots) O(e, o);
|
|
1516
1516
|
wr(e), Cr(e);
|
|
1517
1517
|
}
|
|
1518
1518
|
//#endregion
|
|
@@ -1536,7 +1536,7 @@ var Dr = () => {
|
|
|
1536
1536
|
return n !== void 0 && (r.diagnostics = n), r;
|
|
1537
1537
|
}, L = Symbol("kf.resolve.drop"), kr = (e, t) => {
|
|
1538
1538
|
if (t.syntax === void 0) return e;
|
|
1539
|
-
let n =
|
|
1539
|
+
let n = Oe(y(e), t.syntax);
|
|
1540
1540
|
return n.ok ? n.value : t.default ?? L;
|
|
1541
1541
|
}, Ar = (e) => {
|
|
1542
1542
|
if (e.kind !== "call" || e.name !== "var") return;
|
|
@@ -1719,10 +1719,25 @@ var Dr = () => {
|
|
|
1719
1719
|
if (typeof e != "object" || !e || !("kind" in e)) return !1;
|
|
1720
1720
|
let t = e;
|
|
1721
1721
|
return t.kind === "scalar" ? !1 : t.kind === "list" ? t.items.some(B) : t.name === "sibling-index" || t.name === "sibling-count" || Hr(t) ? !0 : t.args.some(B);
|
|
1722
|
+
}, V = {
|
|
1723
|
+
mass: 1,
|
|
1724
|
+
stiffness: 100,
|
|
1725
|
+
damping: 10,
|
|
1726
|
+
velocity: 0
|
|
1727
|
+
}, Xr = (e) => {
|
|
1728
|
+
let t = (t, n) => {
|
|
1729
|
+
let r = e[t];
|
|
1730
|
+
return typeof r == "number" && Number.isFinite(r) ? r : n;
|
|
1731
|
+
}, n = t(0, V.mass), r = t(1, V.stiffness), i = t(2, V.damping), a = t(3, V.velocity);
|
|
1732
|
+
return n > 0 || (n = V.mass), r > 0 || (r = V.stiffness), i >= 0 || (i = V.damping), {
|
|
1733
|
+
response: 2 * Math.PI * Math.sqrt(n / r),
|
|
1734
|
+
dampingFraction: i / (2 * Math.sqrt(r * n)),
|
|
1735
|
+
initialVelocity: a
|
|
1736
|
+
};
|
|
1722
1737
|
};
|
|
1723
1738
|
//#endregion
|
|
1724
1739
|
//#region src/animation/resolve/element-resolve.ts
|
|
1725
|
-
function
|
|
1740
|
+
function Zr(e) {
|
|
1726
1741
|
let t = e.templateFrames, n = !1;
|
|
1727
1742
|
for (let e of t) {
|
|
1728
1743
|
let t = e.vars;
|
|
@@ -1733,14 +1748,14 @@ function Xr(e) {
|
|
|
1733
1748
|
if (n) break;
|
|
1734
1749
|
}
|
|
1735
1750
|
if (!n) return !1;
|
|
1736
|
-
let r =
|
|
1751
|
+
let r = ei(e);
|
|
1737
1752
|
if (r === void 0) return !1;
|
|
1738
1753
|
let i = Or(/* @__PURE__ */ new Map(), r), a = !1;
|
|
1739
1754
|
for (let e of t) {
|
|
1740
1755
|
let t = e.vars;
|
|
1741
1756
|
for (let e in t) {
|
|
1742
1757
|
let n = t[e];
|
|
1743
|
-
if (
|
|
1758
|
+
if (!$r(n) || !B(n)) continue;
|
|
1744
1759
|
let r = Jr(n, i);
|
|
1745
1760
|
if (r === L) {
|
|
1746
1761
|
delete t[e], a = !0;
|
|
@@ -1751,13 +1766,13 @@ function Xr(e) {
|
|
|
1751
1766
|
}
|
|
1752
1767
|
return a ? (e.parse(), !0) : !1;
|
|
1753
1768
|
}
|
|
1754
|
-
function
|
|
1755
|
-
if (
|
|
1769
|
+
function Qr(e) {
|
|
1770
|
+
if (Zr(e)) return;
|
|
1756
1771
|
let t = e.targets[0], n = e.frames;
|
|
1757
|
-
for (let e of n) for (let n of Object.values(e.interpVars)) for (let e of n.slots)
|
|
1772
|
+
for (let e of n) for (let n of Object.values(e.interpVars)) for (let e of n.slots) O(e, t);
|
|
1758
1773
|
}
|
|
1759
|
-
var
|
|
1760
|
-
function
|
|
1774
|
+
var $r = (e) => typeof e == "object" && !!e && "kind" in e && (e.kind === "scalar" || e.kind === "call" || e.kind === "list");
|
|
1775
|
+
function ei(e) {
|
|
1761
1776
|
let t = e.targets[0];
|
|
1762
1777
|
if (t == null) return;
|
|
1763
1778
|
let n = { customProps: (e) => {
|
|
@@ -1768,8 +1783,8 @@ function $r(e) {
|
|
|
1768
1783
|
}
|
|
1769
1784
|
//#endregion
|
|
1770
1785
|
//#region src/animation/internal/animation-id.ts
|
|
1771
|
-
var
|
|
1772
|
-
id =
|
|
1786
|
+
var H = (e) => typeof e == "string" ? e : e.name ?? String(e.id), ti = 0, ni = class {
|
|
1787
|
+
id = ti++;
|
|
1773
1788
|
name;
|
|
1774
1789
|
superKey;
|
|
1775
1790
|
targets;
|
|
@@ -1846,7 +1861,7 @@ var V = (e) => typeof e == "string" ? e : e.name ?? String(e.id), ei = 0, ti = c
|
|
|
1846
1861
|
}
|
|
1847
1862
|
constructor(e, t, n, r) {
|
|
1848
1863
|
this.options = {}, Ut(this, new Vt(this.options)), this._playback = new Rn(this._frame.bind(this)), this._ctorOptions = e ?? {}, this.setOptions({
|
|
1849
|
-
...
|
|
1864
|
+
...D,
|
|
1850
1865
|
...this._ctorOptions
|
|
1851
1866
|
}), this.targets = t == null ? [] : Array.isArray(t) ? t : [t], this.name = n, this.superKey = r;
|
|
1852
1867
|
}
|
|
@@ -1981,9 +1996,9 @@ var V = (e) => typeof e == "string" ? e : e.name ?? String(e.id), ei = 0, ti = c
|
|
|
1981
1996
|
return $t(this), this;
|
|
1982
1997
|
}
|
|
1983
1998
|
setTargets(...e) {
|
|
1984
|
-
return this.targets = e,
|
|
1999
|
+
return this.targets = e, Qr(this), this;
|
|
1985
2000
|
}
|
|
1986
|
-
},
|
|
2001
|
+
}, ri = (e, t) => {
|
|
1987
2002
|
let n = {};
|
|
1988
2003
|
for (let r of e.declarations) {
|
|
1989
2004
|
let e = r.value;
|
|
@@ -1995,24 +2010,24 @@ var V = (e) => typeof e == "string" ? e : e.name ?? String(e.id), ei = 0, ti = c
|
|
|
1995
2010
|
n[r.name] = e;
|
|
1996
2011
|
}
|
|
1997
2012
|
return n;
|
|
1998
|
-
},
|
|
2013
|
+
}, ii = (e) => {
|
|
1999
2014
|
let t = [];
|
|
2000
2015
|
for (let n of e.selectors) n.kind === "percent" ? t.push(`${n.value * 100}%`) : t.push(n.offset === void 0 ? n.name : `${n.name} ${n.offset * 100}%`);
|
|
2001
2016
|
return t;
|
|
2002
|
-
}, ii = (e) => {
|
|
2003
|
-
let t = me(e).filter((e) => e.path.length === 1), n = t[0]?.rule.name;
|
|
2004
|
-
return n === void 0 ? [] : t.filter((e) => e.rule.name === n).at(-1)?.rule.rules ?? [];
|
|
2005
2017
|
}, ai = (e) => {
|
|
2006
|
-
let t =
|
|
2018
|
+
let t = fe(e).filter((e) => e.path.length === 1), n = t[0]?.rule.name;
|
|
2019
|
+
return n === void 0 ? [] : t.filter((e) => e.rule.name === n).at(-1)?.rule.rules ?? [];
|
|
2020
|
+
}, oi = (e) => {
|
|
2021
|
+
let t = me(S(e), []);
|
|
2007
2022
|
return {
|
|
2008
2023
|
ast: t.value,
|
|
2009
2024
|
issues: t.issues
|
|
2010
2025
|
};
|
|
2011
|
-
},
|
|
2026
|
+
}, si = (e) => {
|
|
2012
2027
|
let t = /* @__PURE__ */ new Map();
|
|
2013
2028
|
for (let n of e) n.path.length === 1 && t.set(n.rule.name, n.rule.descriptor);
|
|
2014
2029
|
return t;
|
|
2015
|
-
},
|
|
2030
|
+
}, ci = (e) => re(e).filter((e) => e.path.length === 1).at(-1)?.rule.declarations ?? [], li = (e, t) => {
|
|
2016
2031
|
let n = [], r = (e, t) => {
|
|
2017
2032
|
n.push({
|
|
2018
2033
|
code: e,
|
|
@@ -2021,16 +2036,16 @@ var V = (e) => typeof e == "string" ? e : e.name ?? String(e.id), ei = 0, ti = c
|
|
|
2021
2036
|
});
|
|
2022
2037
|
}, i = [], a;
|
|
2023
2038
|
if (typeof e == "string") {
|
|
2024
|
-
let t =
|
|
2039
|
+
let t = oi(e);
|
|
2025
2040
|
a = t.ast, i = t.issues;
|
|
2026
2041
|
} else a = e;
|
|
2027
|
-
let o =
|
|
2042
|
+
let o = ai(a);
|
|
2028
2043
|
if (typeof e == "string" && o.length === 0 && e.trim()) {
|
|
2029
|
-
let t =
|
|
2030
|
-
|
|
2044
|
+
let t = oi(`@keyframes anonymous {\n${e.trim()}\n}`);
|
|
2045
|
+
ai(t.ast).length > 0 && (a = t.ast, i = t.issues, o = ai(a));
|
|
2031
2046
|
}
|
|
2032
2047
|
if (typeof e == "string") for (let t of i) r("PARSE_ERROR", {
|
|
2033
|
-
message:
|
|
2048
|
+
message: _e(t),
|
|
2034
2049
|
input: e,
|
|
2035
2050
|
start: t.start,
|
|
2036
2051
|
end: t.end,
|
|
@@ -2041,10 +2056,10 @@ var V = (e) => typeof e == "string" ? e : e.name ?? String(e.id), ei = 0, ti = c
|
|
|
2041
2056
|
message: "the input is non-empty but parsed to zero @keyframes rules (no animatable stops) — the resulting animation has no frames",
|
|
2042
2057
|
input: e
|
|
2043
2058
|
});
|
|
2044
|
-
let s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u =
|
|
2059
|
+
let s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = si(te(a)), d = Or(u, t, n);
|
|
2045
2060
|
for (let e of o) {
|
|
2046
|
-
let t =
|
|
2047
|
-
for (let n of
|
|
2061
|
+
let t = ri(e, d);
|
|
2062
|
+
for (let n of ii(e)) {
|
|
2048
2063
|
let r = s.get(n);
|
|
2049
2064
|
s.set(n, {
|
|
2050
2065
|
...r ?? {},
|
|
@@ -2058,22 +2073,22 @@ var V = (e) => typeof e == "string" ? e : e.name ?? String(e.id), ei = 0, ti = c
|
|
|
2058
2073
|
keyframes: s,
|
|
2059
2074
|
timingFunctions: c,
|
|
2060
2075
|
composition: l,
|
|
2061
|
-
properties:
|
|
2076
|
+
properties: si(he(a)),
|
|
2062
2077
|
functions: u,
|
|
2063
|
-
options:
|
|
2078
|
+
options: ce(ci(a)).at(0) ?? {},
|
|
2064
2079
|
diagnostics: n,
|
|
2065
2080
|
stylesheet: a
|
|
2066
2081
|
};
|
|
2067
|
-
},
|
|
2068
|
-
function
|
|
2082
|
+
}, ui = (e) => re(e).at(-1)?.rule.declarations ?? [];
|
|
2083
|
+
function di(e) {
|
|
2069
2084
|
let t = {};
|
|
2070
2085
|
return e.duration != null && (t.duration = e.duration * 1e3, e.durationUnit != null && (t.durationUnit = e.durationUnit)), e.timingFunction != null && (t.timingFunction = b(e.timingFunction)), e.iterationCount !== void 0 && (t.iterationCount = e.iterationCount === null ? Infinity : e.iterationCount), e.direction != null && (t.direction = e.direction), e.delay != null && (t.delay = e.delay * 1e3, e.delayUnit != null && (t.delayUnit = e.delayUnit)), e.fillMode != null && (t.fillMode = e.fillMode), e.composition != null && (t.composite = e.composition), t;
|
|
2071
2086
|
}
|
|
2072
|
-
function
|
|
2073
|
-
let t =
|
|
2087
|
+
function fi(e) {
|
|
2088
|
+
let t = le(ui(e));
|
|
2074
2089
|
return Object.keys(t).length > 0 ? t : void 0;
|
|
2075
2090
|
}
|
|
2076
|
-
function
|
|
2091
|
+
function pi(e, t) {
|
|
2077
2092
|
if (!(typeof CSS > "u" || typeof CSS.registerProperty != "function")) for (let [n, r] of e) {
|
|
2078
2093
|
if (r.syntax == null) continue;
|
|
2079
2094
|
let e = {
|
|
@@ -2096,7 +2111,7 @@ function fi(e, t) {
|
|
|
2096
2111
|
}
|
|
2097
2112
|
//#endregion
|
|
2098
2113
|
//#region src/animation/engine/css/animation.ts
|
|
2099
|
-
var
|
|
2114
|
+
var mi = (e) => typeof e != "object" || !e ? !1 : typeof e.clone == "function", U = class extends ni {
|
|
2100
2115
|
constructor(e, ...t) {
|
|
2101
2116
|
super(e, t), this.unflatten = !1;
|
|
2102
2117
|
}
|
|
@@ -2129,17 +2144,17 @@ var pi = (e) => typeof e != "object" || !e ? !1 : typeof e.clone == "function",
|
|
|
2129
2144
|
scrollOptions;
|
|
2130
2145
|
fromString(e, n) {
|
|
2131
2146
|
n = this.resolveTransform(n);
|
|
2132
|
-
let r =
|
|
2147
|
+
let r = li(e);
|
|
2133
2148
|
this.propertyRegistry = r.properties;
|
|
2134
|
-
let i =
|
|
2149
|
+
let i = fi(r.stylesheet);
|
|
2135
2150
|
i === void 0 ? delete this.scrollOptions : this.scrollOptions = i, this.diagnostics = [...r.diagnostics];
|
|
2136
|
-
let a =
|
|
2151
|
+
let a = di(r.options);
|
|
2137
2152
|
Object.keys(a).length > 0 && this.setOptions({
|
|
2138
2153
|
...a,
|
|
2139
2154
|
...this._ctorOptions
|
|
2140
2155
|
});
|
|
2141
2156
|
for (let [e, i] of r.keyframes.entries()) {
|
|
2142
|
-
let a = Object.fromEntries(Object.entries(i).map(([e, t]) => [e,
|
|
2157
|
+
let a = Object.fromEntries(Object.entries(i).map(([e, t]) => [e, mi(t) ? t.clone() : t])), o = r.timingFunctions.get(e), s = o ? ge(o) : void 0, c;
|
|
2143
2158
|
if (s) {
|
|
2144
2159
|
let e = o ? t(o) : void 0;
|
|
2145
2160
|
c = e ? {
|
|
@@ -2150,13 +2165,13 @@ var pi = (e) => typeof e != "object" || !e ? !1 : typeof e.clone == "function",
|
|
|
2150
2165
|
let l = r.composition.get(e);
|
|
2151
2166
|
this.addFrame(e, a, n, c, l);
|
|
2152
2167
|
}
|
|
2153
|
-
return this.parse(),
|
|
2168
|
+
return this.parse(), pi(this.propertyRegistry, this.diagnostics), this;
|
|
2154
2169
|
}
|
|
2155
|
-
},
|
|
2156
|
-
let r =
|
|
2170
|
+
}, hi = (e) => typeof e == "string" ? e : H(e), W = (e, t, n) => {
|
|
2171
|
+
let r = hi(t), i = e[r];
|
|
2157
2172
|
if (!i) throw Error(`AnimationGroup.${n}: no animation registered for key "${r}". Known keys: ${Object.keys(e).join(", ") || "(none)"}.`);
|
|
2158
2173
|
return i;
|
|
2159
|
-
},
|
|
2174
|
+
}, gi = (e) => {
|
|
2160
2175
|
let t = /* @__PURE__ */ new Set();
|
|
2161
2176
|
for (let n of e) {
|
|
2162
2177
|
if (!n.layer.enabled) continue;
|
|
@@ -2164,24 +2179,24 @@ var pi = (e) => typeof e != "object" || !e ? !1 : typeof e.clone == "function",
|
|
|
2164
2179
|
for (let r of n.animation.flatKeys) e && !e.has(r) || t.add(r);
|
|
2165
2180
|
}
|
|
2166
2181
|
return [...t];
|
|
2167
|
-
},
|
|
2182
|
+
}, _i = (e) => {
|
|
2168
2183
|
let t = !0;
|
|
2169
2184
|
for (let n of e) n.animation.interpFrames(n.animation.t, !0), t &&= n.animation.done;
|
|
2170
2185
|
return t;
|
|
2171
|
-
},
|
|
2186
|
+
}, vi = (e) => {
|
|
2172
2187
|
for (let t of e) {
|
|
2173
2188
|
let e = t.animation;
|
|
2174
2189
|
e.started = !0, e.t = e.options.duration, e.interpFrames(e.t, !0);
|
|
2175
2190
|
}
|
|
2176
|
-
},
|
|
2191
|
+
}, yi = (e, t) => {
|
|
2177
2192
|
for (let n of e) n.animation.paused = t;
|
|
2178
|
-
},
|
|
2193
|
+
}, G = (e) => e.op === "replace" && (e.weightSpring !== void 0 || e.weight !== 1), bi = (e) => {
|
|
2179
2194
|
let t = e.weightSpring?.value ?? e.weight;
|
|
2180
2195
|
return e.weightSpring ? t : Number.isFinite(t) ? Math.min(1, Math.max(0, t)) : 0;
|
|
2181
|
-
},
|
|
2196
|
+
}, xi = (e) => Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : 0;
|
|
2182
2197
|
//#endregion
|
|
2183
2198
|
//#region src/animation/group/waapi.ts
|
|
2184
|
-
function
|
|
2199
|
+
function Si(e) {
|
|
2185
2200
|
let t = e.getEntries();
|
|
2186
2201
|
if (!e.singleTarget || t.length === 0) return {
|
|
2187
2202
|
eligible: !1,
|
|
@@ -2201,7 +2216,7 @@ function xi(e) {
|
|
|
2201
2216
|
eligible: !1,
|
|
2202
2217
|
reason: "property-masked layer stays on rAF"
|
|
2203
2218
|
};
|
|
2204
|
-
if (
|
|
2219
|
+
if (G(e.layer) || e.layer.weightSpring) return {
|
|
2205
2220
|
eligible: !1,
|
|
2206
2221
|
reason: "weight-driven layer has no native composite equivalent"
|
|
2207
2222
|
};
|
|
@@ -2225,8 +2240,8 @@ function xi(e) {
|
|
|
2225
2240
|
entries: t
|
|
2226
2241
|
};
|
|
2227
2242
|
}
|
|
2228
|
-
function
|
|
2229
|
-
let t =
|
|
2243
|
+
function Ci(e) {
|
|
2244
|
+
let t = Si(e);
|
|
2230
2245
|
if (!t.eligible) return null;
|
|
2231
2246
|
let n = [];
|
|
2232
2247
|
try {
|
|
@@ -2247,40 +2262,40 @@ function Si(e) {
|
|
|
2247
2262
|
}
|
|
2248
2263
|
//#endregion
|
|
2249
2264
|
//#region src/animation/group/lifecycle.ts
|
|
2250
|
-
function
|
|
2265
|
+
function wi(e) {
|
|
2251
2266
|
for (let t of e._waAnimations) try {
|
|
2252
2267
|
t.cancel?.();
|
|
2253
2268
|
} catch {}
|
|
2254
2269
|
e._waAnimations.length = 0, e._waapiDelegated = !1;
|
|
2255
2270
|
}
|
|
2256
|
-
function
|
|
2271
|
+
function Ti(e) {
|
|
2257
2272
|
for (let t of e._waAnimations) try {
|
|
2258
2273
|
t.pause?.();
|
|
2259
2274
|
} catch {}
|
|
2260
2275
|
}
|
|
2261
|
-
function
|
|
2276
|
+
function Ei(e) {
|
|
2262
2277
|
for (let t of e._waAnimations) try {
|
|
2263
2278
|
t.play?.();
|
|
2264
2279
|
} catch {}
|
|
2265
2280
|
}
|
|
2266
|
-
function
|
|
2281
|
+
function Di(e) {
|
|
2267
2282
|
let t = e.resolvePromise;
|
|
2268
2283
|
e.resolvePromise = null, t?.();
|
|
2269
2284
|
}
|
|
2270
|
-
async function
|
|
2271
|
-
return e._playingPromise && e.resolvePromise && !e.started && !e.paused && !e.playback.running && e.playback.loop(e._boundFrame), l(e, () => o(e.respectReducedMotion, () =>
|
|
2272
|
-
let t =
|
|
2285
|
+
async function Oi(e) {
|
|
2286
|
+
return e._playingPromise && e.resolvePromise && !e.started && !e.paused && !e.playback.running && e.playback.loop(e._boundFrame), l(e, () => o(e.respectReducedMotion, () => ki(e), () => {
|
|
2287
|
+
let t = Ci(e);
|
|
2273
2288
|
return t && (e._waAnimations.push(...t), e._waapiDelegated = !0), new Promise((t) => {
|
|
2274
2289
|
e.resolvePromise = t, e.playback.loop(e._boundFrame);
|
|
2275
2290
|
});
|
|
2276
2291
|
}));
|
|
2277
2292
|
}
|
|
2278
|
-
function
|
|
2293
|
+
function ki(e) {
|
|
2279
2294
|
e.started = !0;
|
|
2280
2295
|
let t = e.lastTickTime;
|
|
2281
|
-
return
|
|
2296
|
+
return vi(e.getEntries()), e.singleTarget && e.render(t), e.settle(), Promise.resolve();
|
|
2282
2297
|
}
|
|
2283
|
-
function
|
|
2298
|
+
function Ai(e) {
|
|
2284
2299
|
if (!e.started || e.paused) return;
|
|
2285
2300
|
e.paused = !0;
|
|
2286
2301
|
let t = e.lastTickTime;
|
|
@@ -2288,56 +2303,56 @@ function ki(e) {
|
|
|
2288
2303
|
let e = n.animation;
|
|
2289
2304
|
e.pause(), e.pausedTime === 0 && (e.pausedTime = t);
|
|
2290
2305
|
}
|
|
2291
|
-
e.playback.stop(), e._waapiDelegated &&
|
|
2292
|
-
}
|
|
2293
|
-
function Ai(e) {
|
|
2294
|
-
!e.started || !e.paused || (e.paused = !1, vi(e.getEntries(), !1), e._waapiDelegated && Ti(e), e.playback.loop(e._boundFrame));
|
|
2306
|
+
e.playback.stop(), e._waapiDelegated && Ti(e), e.render();
|
|
2295
2307
|
}
|
|
2296
2308
|
function ji(e) {
|
|
2297
|
-
|
|
2309
|
+
!e.started || !e.paused || (e.paused = !1, yi(e.getEntries(), !1), e._waapiDelegated && Ei(e), e.playback.loop(e._boundFrame));
|
|
2298
2310
|
}
|
|
2299
2311
|
function Mi(e) {
|
|
2300
|
-
e
|
|
2312
|
+
s(e, () => Ai(e), () => ji(e));
|
|
2313
|
+
}
|
|
2314
|
+
function Ni(e) {
|
|
2315
|
+
e._waapiDelegated && wi(e);
|
|
2301
2316
|
for (let t of e.getEntries()) t.animation.managed = !1, t.animation.settle();
|
|
2302
2317
|
e.started = !1, e.done = !1, e.paused = !1, e.lastTickTime = 0;
|
|
2303
2318
|
}
|
|
2304
|
-
function
|
|
2319
|
+
function Pi(e) {
|
|
2305
2320
|
for (let t of e.getEntries()) {
|
|
2306
2321
|
let e = t.animation;
|
|
2307
2322
|
(e.started || e.t !== 0) && e.frames.length > 0 && e.interpFrames(0, !0);
|
|
2308
2323
|
}
|
|
2309
2324
|
e.settle();
|
|
2310
2325
|
}
|
|
2311
|
-
function Pi(e) {
|
|
2312
|
-
e.playback.stop(), e.reset(), Ei(e);
|
|
2313
|
-
}
|
|
2314
2326
|
function Fi(e) {
|
|
2327
|
+
e.playback.stop(), e.reset(), Di(e);
|
|
2328
|
+
}
|
|
2329
|
+
function Ii(e) {
|
|
2315
2330
|
return f(e);
|
|
2316
2331
|
}
|
|
2317
2332
|
//#endregion
|
|
2318
2333
|
//#region src/animation/group/frame.ts
|
|
2319
|
-
function Ii(e, t) {
|
|
2320
|
-
Ri(e.getEntries(), t);
|
|
2321
|
-
let n = e.advanceTo(t);
|
|
2322
|
-
return typeof n.then == "function" ? n.then(() => Li(e, t)) : Li(e, t);
|
|
2323
|
-
}
|
|
2324
2334
|
function Li(e, t) {
|
|
2325
|
-
|
|
2335
|
+
zi(e.getEntries(), t);
|
|
2336
|
+
let n = e.advanceTo(t);
|
|
2337
|
+
return typeof n.then == "function" ? n.then(() => Ri(e, t)) : Ri(e, t);
|
|
2326
2338
|
}
|
|
2327
2339
|
function Ri(e, t) {
|
|
2340
|
+
return e.paused ? !1 : (e.done = Bi(e.getEntries()), e.render(t), e.done ? (e.settle(), Di(e), !1) : !0);
|
|
2341
|
+
}
|
|
2342
|
+
function zi(e, t) {
|
|
2328
2343
|
for (let n = 0; n < e.length; n++) Pn(e[n].animation, t);
|
|
2329
2344
|
}
|
|
2330
|
-
function
|
|
2345
|
+
function Bi(e) {
|
|
2331
2346
|
for (let t = 0; t < e.length; t++) if (!e[t].animation.done) return !1;
|
|
2332
2347
|
return !0;
|
|
2333
2348
|
}
|
|
2334
2349
|
//#endregion
|
|
2335
2350
|
//#region src/animation/group/seek.ts
|
|
2336
|
-
function
|
|
2337
|
-
let n =
|
|
2351
|
+
function Vi(e, t) {
|
|
2352
|
+
let n = W(e.animations, t, "elapsedOf").animation, { delay: r, duration: i } = n.options;
|
|
2338
2353
|
return Math.max(0, r) + n.iteration * Math.max(0, i) + n.t;
|
|
2339
2354
|
}
|
|
2340
|
-
function
|
|
2355
|
+
function Hi(e, t) {
|
|
2341
2356
|
for (let { animation: n } of Object.values(e.animations)) {
|
|
2342
2357
|
let { delay: r, duration: i, iterationCount: a, direction: o } = n.options, s = Math.max(0, t - Math.max(0, r)), c = 0, l = 0;
|
|
2343
2358
|
i > 0 && (c = Math.floor(s / i), l = s - c * i, c >= a && (c = Math.max(0, Math.ceil(a) - 1), l = i)), c !== n.iteration && (n.iteration = c, n.reversed = Gt(o, c)), e.setChildTime(n, l);
|
|
@@ -2345,7 +2360,7 @@ function Vi(e, t) {
|
|
|
2345
2360
|
}
|
|
2346
2361
|
//#endregion
|
|
2347
2362
|
//#region src/animation/group/render-observers.ts
|
|
2348
|
-
var
|
|
2363
|
+
var Ui = class {
|
|
2349
2364
|
listeners = [];
|
|
2350
2365
|
subscribe(e) {
|
|
2351
2366
|
return this.listeners.push(e), () => {
|
|
@@ -2357,19 +2372,19 @@ var Hi = class {
|
|
|
2357
2372
|
let t = this.listeners;
|
|
2358
2373
|
for (let n = 0; n < t.length; n++) t[n](e);
|
|
2359
2374
|
}
|
|
2360
|
-
},
|
|
2375
|
+
}, Wi = null, Gi = () => typeof MessageChannel == "function" ? () => new Promise((e) => {
|
|
2361
2376
|
let t = new MessageChannel();
|
|
2362
2377
|
t.port1.onmessage = () => {
|
|
2363
2378
|
t.port1.close(), e();
|
|
2364
2379
|
}, t.port2.postMessage(void 0);
|
|
2365
2380
|
}) : () => new Promise((e) => setTimeout(e, 0));
|
|
2366
|
-
function
|
|
2381
|
+
function Ki() {
|
|
2367
2382
|
let e = globalThis.scheduler;
|
|
2368
|
-
return e && typeof e.yield == "function" ? e.yield() : (
|
|
2383
|
+
return e && typeof e.yield == "function" ? e.yield() : (Wi ??= Gi(), Wi());
|
|
2369
2384
|
}
|
|
2370
2385
|
//#endregion
|
|
2371
2386
|
//#region src/animation/group/yield-batch.ts
|
|
2372
|
-
var
|
|
2387
|
+
var qi = (e, t) => {
|
|
2373
2388
|
let n;
|
|
2374
2389
|
for (let r of e) {
|
|
2375
2390
|
let e = r.animation;
|
|
@@ -2378,22 +2393,22 @@ var Ki = (e, t) => {
|
|
|
2378
2393
|
typeof i != "number" && (n ??= []).push(i);
|
|
2379
2394
|
}
|
|
2380
2395
|
return n && Promise.all(n).then(() => void 0);
|
|
2381
|
-
},
|
|
2382
|
-
for (let r = 0; r < e.length; r += n) await
|
|
2383
|
-
},
|
|
2396
|
+
}, Ji = async (e, t, n) => {
|
|
2397
|
+
for (let r = 0; r < e.length; r += n) await qi(e.slice(r, r + n), t), r + n < e.length && await Ki();
|
|
2398
|
+
}, Yi = (e, t, n) => {
|
|
2384
2399
|
let r = new a({
|
|
2385
2400
|
...n,
|
|
2386
2401
|
initial: e
|
|
2387
2402
|
});
|
|
2388
2403
|
return r.target = t, r;
|
|
2389
|
-
},
|
|
2404
|
+
}, Xi = (e, t) => {
|
|
2390
2405
|
let n = !1;
|
|
2391
2406
|
for (let r of e) {
|
|
2392
2407
|
let e = r.layer.weightSpring;
|
|
2393
2408
|
e !== void 0 && (t > 0 && e.tickDt(t), e.settled ? (r.layer.weight = e.value, delete r.layer.weightSpring) : n = !0);
|
|
2394
2409
|
}
|
|
2395
2410
|
return n;
|
|
2396
|
-
},
|
|
2411
|
+
}, Zi = class {
|
|
2397
2412
|
values = {};
|
|
2398
2413
|
keys = [];
|
|
2399
2414
|
epochs = Object.create(null);
|
|
@@ -2415,8 +2430,8 @@ var Ki = (e, t) => {
|
|
|
2415
2430
|
pruneInactive() {
|
|
2416
2431
|
for (let e of this.keys) this.epochs[e] !== this.epoch && (this.values[e] = void 0);
|
|
2417
2432
|
}
|
|
2418
|
-
},
|
|
2419
|
-
let e = new
|
|
2433
|
+
}, Qi = () => {
|
|
2434
|
+
let e = new Zi();
|
|
2420
2435
|
return {
|
|
2421
2436
|
compositeState: e,
|
|
2422
2437
|
grouped: e.values,
|
|
@@ -2425,15 +2440,15 @@ var Ki = (e, t) => {
|
|
|
2425
2440
|
soaPlans: null,
|
|
2426
2441
|
compositeBuf: null
|
|
2427
2442
|
};
|
|
2428
|
-
},
|
|
2443
|
+
}, K = (e) => typeof e == "number", $i = (e, t) => {
|
|
2429
2444
|
let { carriers: n, incomingSlots: r } = t, i = n.length;
|
|
2430
2445
|
if (i !== 0) {
|
|
2431
2446
|
for (let t = 0; t < i; t++) e[t] = n[t].values[n[t].key];
|
|
2432
2447
|
if (t.weightBlend) {
|
|
2433
|
-
let n =
|
|
2448
|
+
let n = bi(t.layer);
|
|
2434
2449
|
for (let t = 0; t < i; t++) {
|
|
2435
2450
|
let i = r[t];
|
|
2436
|
-
e[t] =
|
|
2451
|
+
e[t] = w(e[t], i.values[i.key], n);
|
|
2437
2452
|
}
|
|
2438
2453
|
} else for (let t = 0; t < i; t++) {
|
|
2439
2454
|
let n = r[t];
|
|
@@ -2444,12 +2459,12 @@ var Ki = (e, t) => {
|
|
|
2444
2459
|
r.values[r.key] = e[t];
|
|
2445
2460
|
}
|
|
2446
2461
|
}
|
|
2447
|
-
},
|
|
2462
|
+
}, ea = (e, t, n) => {
|
|
2448
2463
|
let r = [], i = {}, a = 0;
|
|
2449
2464
|
for (let t of e) {
|
|
2450
2465
|
let { layer: e, values: o } = t;
|
|
2451
2466
|
if (!e.enabled) continue;
|
|
2452
|
-
let s = e.properties, c = e.op, l =
|
|
2467
|
+
let s = e.properties, c = e.op, l = G(e);
|
|
2453
2468
|
if (c === "replace" && !l) {
|
|
2454
2469
|
for (let e in o) s && !s.has(e) || o[e] !== void 0 && (i[e] = {
|
|
2455
2470
|
values: n,
|
|
@@ -2463,7 +2478,7 @@ var Ki = (e, t) => {
|
|
|
2463
2478
|
let t = o[e];
|
|
2464
2479
|
if (t === void 0) continue;
|
|
2465
2480
|
let r = i[e], a = r?.values[e];
|
|
2466
|
-
r !== void 0 &&
|
|
2481
|
+
r !== void 0 && K(a) && K(t) ? (u.push(r), d.push({
|
|
2467
2482
|
values: o,
|
|
2468
2483
|
key: e
|
|
2469
2484
|
})) : (f.add(e), i[e] = {
|
|
@@ -2484,10 +2499,10 @@ var Ki = (e, t) => {
|
|
|
2484
2499
|
plans: r,
|
|
2485
2500
|
compositeBuf: o
|
|
2486
2501
|
};
|
|
2487
|
-
},
|
|
2488
|
-
function
|
|
2502
|
+
}, ta = /* @__PURE__ */ new WeakMap();
|
|
2503
|
+
function na(e, t, n) {
|
|
2489
2504
|
let r = t.grouped;
|
|
2490
|
-
t.groupedKeysDirty && (t.groupedKeys =
|
|
2505
|
+
t.groupedKeysDirty && (t.groupedKeys = gi(e.getEntries()), t.compositeState.configure(t.groupedKeys), t.groupedKeysDirty = !1, t.soaPlans = null, ta.delete(e)), t.compositeState.clear();
|
|
2491
2506
|
let i = e.getEntries(), a = t.soaPlans !== null, o = 0, s = !0;
|
|
2492
2507
|
for (let e of i) {
|
|
2493
2508
|
let { animation: n, layer: i, values: c } = e;
|
|
@@ -2495,7 +2510,7 @@ function ta(e, t, n) {
|
|
|
2495
2510
|
n.interpFrames(n.t, !1, c);
|
|
2496
2511
|
let l = i.properties;
|
|
2497
2512
|
for (let e in c) l && !l.has(e) || c[e] !== void 0 && t.compositeState.mark(e);
|
|
2498
|
-
let u = i.op, d =
|
|
2513
|
+
let u = i.op, d = G(i);
|
|
2499
2514
|
if (u === "replace" && !d) {
|
|
2500
2515
|
for (let e in c) {
|
|
2501
2516
|
if (l && !l.has(e)) continue;
|
|
@@ -2506,14 +2521,14 @@ function ta(e, t, n) {
|
|
|
2506
2521
|
}
|
|
2507
2522
|
if (a) {
|
|
2508
2523
|
let e = t.soaPlans[o++];
|
|
2509
|
-
|
|
2510
|
-
} else
|
|
2524
|
+
$i(t.compositeBuf, e), e.residualKeys.size > 0 && ra(i, c, r, l, e.residualKeys, t.compositeState);
|
|
2525
|
+
} else ra(i, c, r, l, void 0, t.compositeState);
|
|
2511
2526
|
}
|
|
2512
2527
|
if (!a) {
|
|
2513
|
-
let { plans: e, compositeBuf: n } =
|
|
2528
|
+
let { plans: e, compositeBuf: n } = ea(i, t.compositeBuf, r);
|
|
2514
2529
|
t.soaPlans = e, t.compositeBuf = n;
|
|
2515
2530
|
}
|
|
2516
|
-
if (e.done = s, t.compositeState.pruneInactive(), e.transform ===
|
|
2531
|
+
if (e.done = s, t.compositeState.pruneInactive(), e.transform === E) for (let t of e.getEntries()) {
|
|
2517
2532
|
let n = t.animation.frames[0];
|
|
2518
2533
|
if (n != null && n.transform != null) {
|
|
2519
2534
|
e.transform = n.transform, e.unflatten = t.animation.unflatten;
|
|
@@ -2521,12 +2536,12 @@ function ta(e, t, n) {
|
|
|
2521
2536
|
}
|
|
2522
2537
|
}
|
|
2523
2538
|
if (e.unflatten) {
|
|
2524
|
-
let t =
|
|
2525
|
-
t === void 0 ? (t = Mt(r),
|
|
2539
|
+
let t = ta.get(e);
|
|
2540
|
+
t === void 0 ? (t = Mt(r), ta.set(e, t)) : Nt(t), e.transform(t.root, n);
|
|
2526
2541
|
} else e.transform(r, n);
|
|
2527
2542
|
return r;
|
|
2528
2543
|
}
|
|
2529
|
-
function
|
|
2544
|
+
function ra(e, t, n, r, i, a) {
|
|
2530
2545
|
let o = e.op;
|
|
2531
2546
|
if (o === "add" || o === "accumulate") {
|
|
2532
2547
|
for (let e in t) {
|
|
@@ -2534,53 +2549,53 @@ function na(e, t, n, r, i, a) {
|
|
|
2534
2549
|
let o = t[e];
|
|
2535
2550
|
if (o === void 0) continue;
|
|
2536
2551
|
let s = n[e];
|
|
2537
|
-
|
|
2552
|
+
K(s) && K(o) ? n[e] = s + o : a ? a.copy(e, o) : n[e] = o;
|
|
2538
2553
|
}
|
|
2539
2554
|
return;
|
|
2540
2555
|
}
|
|
2541
|
-
let s =
|
|
2556
|
+
let s = bi(e);
|
|
2542
2557
|
for (let e in t) {
|
|
2543
2558
|
if (i && !i.has(e) || r && !r.has(e)) continue;
|
|
2544
2559
|
let o = t[e];
|
|
2545
2560
|
if (o === void 0) continue;
|
|
2546
2561
|
let c = n[e];
|
|
2547
|
-
if (
|
|
2562
|
+
if (K(c) && K(o)) n[e] = w(c, o, s);
|
|
2548
2563
|
else if (a) {
|
|
2549
2564
|
let t = a.copy(e, o);
|
|
2550
|
-
|
|
2565
|
+
K(t) && (n[e] = w(0, t, s));
|
|
2551
2566
|
} else n[e] = o;
|
|
2552
2567
|
}
|
|
2553
2568
|
}
|
|
2554
2569
|
//#endregion
|
|
2555
2570
|
//#region src/animation/group/layer-api.ts
|
|
2556
|
-
function
|
|
2557
|
-
let r =
|
|
2571
|
+
function ia(e, t, n) {
|
|
2572
|
+
let r = W(e.animations, t, "setLayerConfig");
|
|
2558
2573
|
Object.assign(r.layer, n), e.invalidateEntries();
|
|
2559
2574
|
}
|
|
2560
|
-
function
|
|
2561
|
-
return e.animations[
|
|
2575
|
+
function aa(e, t) {
|
|
2576
|
+
return e.animations[hi(t)]?.layer;
|
|
2562
2577
|
}
|
|
2563
|
-
function
|
|
2564
|
-
let r =
|
|
2578
|
+
function oa(e, t, n) {
|
|
2579
|
+
let r = W(e.animations, t, "transitionLayer").layer, i = xi(n.weight);
|
|
2565
2580
|
r.op = "replace";
|
|
2566
2581
|
let o = r.weightSpring;
|
|
2567
|
-
o instanceof a ? o.target = i : r.weightSpring =
|
|
2582
|
+
o instanceof a ? o.target = i : r.weightSpring = Yi(xi(r.weight), i, n.spring), e._hasLayerSprings = !0, e.invalidateEntries();
|
|
2568
2583
|
}
|
|
2569
|
-
function
|
|
2584
|
+
function sa(e, t, n, r) {
|
|
2570
2585
|
let i = r?.spring;
|
|
2571
|
-
|
|
2586
|
+
oa(e, t, {
|
|
2572
2587
|
weight: 0,
|
|
2573
2588
|
...i ? { spring: i } : {}
|
|
2574
|
-
}),
|
|
2589
|
+
}), oa(e, n, {
|
|
2575
2590
|
weight: 1,
|
|
2576
2591
|
...i ? { spring: i } : {}
|
|
2577
2592
|
});
|
|
2578
2593
|
}
|
|
2579
2594
|
//#endregion
|
|
2580
2595
|
//#region src/animation/group/group.ts
|
|
2581
|
-
var
|
|
2596
|
+
var ca = class e {
|
|
2582
2597
|
animations = {};
|
|
2583
|
-
transform =
|
|
2598
|
+
transform = E;
|
|
2584
2599
|
superKey;
|
|
2585
2600
|
paused = !1;
|
|
2586
2601
|
started = !1;
|
|
@@ -2614,23 +2629,23 @@ var sa = class e {
|
|
|
2614
2629
|
resolvePromise = null;
|
|
2615
2630
|
_playingPromise = null;
|
|
2616
2631
|
_boundFrame;
|
|
2617
|
-
_renders = new
|
|
2632
|
+
_renders = new Ui();
|
|
2618
2633
|
_entries = [];
|
|
2619
2634
|
_entriesDirty = !0;
|
|
2620
|
-
_composite =
|
|
2635
|
+
_composite = Qi();
|
|
2621
2636
|
_hasLayerSprings = !1;
|
|
2622
2637
|
constructor(...e) {
|
|
2623
|
-
this._boundFrame = (e) =>
|
|
2638
|
+
this._boundFrame = (e) => Li(this, e);
|
|
2624
2639
|
let t = [];
|
|
2625
2640
|
for (let n of e) {
|
|
2626
2641
|
let e, r;
|
|
2627
|
-
n instanceof
|
|
2628
|
-
let i =
|
|
2642
|
+
n instanceof ni ? e = n : (e = n.animation, r = n.layer), this.transform === E && e.frames[0] != null && (this.transform = e.frames[0].transform, this.unflatten = e.unflatten);
|
|
2643
|
+
let i = H(e);
|
|
2629
2644
|
this.animations[i] = {
|
|
2630
2645
|
values: {},
|
|
2631
2646
|
animation: e,
|
|
2632
2647
|
layer: {
|
|
2633
|
-
...
|
|
2648
|
+
...Le,
|
|
2634
2649
|
...r
|
|
2635
2650
|
}
|
|
2636
2651
|
}, e.managed = !0, t.push(e);
|
|
@@ -2654,76 +2669,76 @@ var sa = class e {
|
|
|
2654
2669
|
return this._deriveSingleTarget(t.map((e) => e.animation.targets[0])), this;
|
|
2655
2670
|
}
|
|
2656
2671
|
transformFramesGrouped(e) {
|
|
2657
|
-
return
|
|
2672
|
+
return na(this, this._composite, e);
|
|
2658
2673
|
}
|
|
2659
2674
|
render(e = this.lastTickTime) {
|
|
2660
|
-
this.singleTarget ? (!this._waapiDelegated || this.done) && this.transformFramesGrouped(e) :
|
|
2675
|
+
this.singleTarget ? (!this._waapiDelegated || this.done) && this.transformFramesGrouped(e) : _i(this.getEntries()), this._renders.notify(e);
|
|
2661
2676
|
}
|
|
2662
2677
|
onRender(e) {
|
|
2663
2678
|
return this._renders.subscribe(e);
|
|
2664
2679
|
}
|
|
2665
2680
|
setChildTime(e, t) {
|
|
2666
|
-
let n =
|
|
2681
|
+
let n = W(this.animations, e, "setChildTime").animation;
|
|
2667
2682
|
return n.t = t, n.startTime !== void 0 && (n.pausedTime = n.startTime + t), this;
|
|
2668
2683
|
}
|
|
2669
2684
|
seek(e) {
|
|
2670
|
-
return
|
|
2685
|
+
return Hi(this, e), this;
|
|
2671
2686
|
}
|
|
2672
2687
|
elapsedOf(e) {
|
|
2673
|
-
return
|
|
2688
|
+
return Vi(this, e);
|
|
2674
2689
|
}
|
|
2675
2690
|
advanceTo(t) {
|
|
2676
2691
|
let n = this.lastTickTime === 0 ? 0 : t - this.lastTickTime;
|
|
2677
2692
|
this._hasLayerSprings && this.advanceLayerSprings(n), this.lastTickTime = t, this.started = !0;
|
|
2678
|
-
let r = this.getEntries(), i = e.YIELD_BATCH, a = r.length <= i ?
|
|
2693
|
+
let r = this.getEntries(), i = e.YIELD_BATCH, a = r.length <= i ? qi(r, t) : Ji(r, t, i);
|
|
2679
2694
|
return a ? a.then(() => this) : this;
|
|
2680
2695
|
}
|
|
2681
2696
|
get finished() {
|
|
2682
2697
|
return this._playingPromise ?? Promise.resolve();
|
|
2683
2698
|
}
|
|
2684
2699
|
async play() {
|
|
2685
|
-
return
|
|
2700
|
+
return Oi(this);
|
|
2686
2701
|
}
|
|
2687
2702
|
pause() {
|
|
2688
|
-
return
|
|
2703
|
+
return Ai(this), this;
|
|
2689
2704
|
}
|
|
2690
2705
|
resume() {
|
|
2691
|
-
return
|
|
2706
|
+
return ji(this), this;
|
|
2692
2707
|
}
|
|
2693
2708
|
toggle() {
|
|
2694
|
-
return
|
|
2709
|
+
return Mi(this);
|
|
2695
2710
|
}
|
|
2696
2711
|
settle() {
|
|
2697
|
-
return
|
|
2712
|
+
return Ni(this), this;
|
|
2698
2713
|
}
|
|
2699
2714
|
reset() {
|
|
2700
|
-
return
|
|
2715
|
+
return Pi(this), this._renders.notify(this.lastTickTime), this;
|
|
2701
2716
|
}
|
|
2702
2717
|
stop() {
|
|
2703
|
-
return
|
|
2718
|
+
return Fi(this), this;
|
|
2704
2719
|
}
|
|
2705
2720
|
playing() {
|
|
2706
|
-
return
|
|
2721
|
+
return Ii(this);
|
|
2707
2722
|
}
|
|
2708
2723
|
setLayerConfig(e, t) {
|
|
2709
|
-
return
|
|
2724
|
+
return ia(this, e, t), this;
|
|
2710
2725
|
}
|
|
2711
2726
|
setLayerEnabled(e, t) {
|
|
2712
2727
|
return this.setLayerConfig(e, { enabled: t });
|
|
2713
2728
|
}
|
|
2714
2729
|
getLayerConfig(e) {
|
|
2715
|
-
return
|
|
2730
|
+
return aa(this, e);
|
|
2716
2731
|
}
|
|
2717
2732
|
transitionLayer(e, t) {
|
|
2718
|
-
return
|
|
2733
|
+
return oa(this, e, t), this;
|
|
2719
2734
|
}
|
|
2720
2735
|
crossfade(e, t, n) {
|
|
2721
|
-
return
|
|
2736
|
+
return sa(this, e, t, n), this;
|
|
2722
2737
|
}
|
|
2723
2738
|
advanceLayerSprings(e) {
|
|
2724
|
-
this._hasLayerSprings =
|
|
2739
|
+
this._hasLayerSprings = Xi(this.getEntries(), e);
|
|
2725
2740
|
}
|
|
2726
|
-
},
|
|
2741
|
+
}, la = class {
|
|
2727
2742
|
animation;
|
|
2728
2743
|
constructor(e) {
|
|
2729
2744
|
this.animation = e;
|
|
@@ -2740,47 +2755,47 @@ var sa = class e {
|
|
|
2740
2755
|
get finished() {
|
|
2741
2756
|
return this.animation.finished;
|
|
2742
2757
|
}
|
|
2743
|
-
},
|
|
2744
|
-
function
|
|
2758
|
+
}, ua = (e) => typeof e == "number" ? `${e}%` : e;
|
|
2759
|
+
function da(e, t) {
|
|
2745
2760
|
let { path: n, from: r = "0%", to: i = "100%", rotate: a, autoPlay: o = !0, ...s } = t;
|
|
2746
2761
|
if (typeof n != "string" || n.length === 0) throw Error("fromMotionPath(): `path` is required — pass an offset-path value (a path()/ray()/url(#id) string).");
|
|
2747
2762
|
let c = Array.isArray(e) ? e : [e];
|
|
2748
2763
|
for (let e of c) e.style.offsetPath = n, a !== void 0 && (e.style.offsetRotate = a);
|
|
2749
2764
|
let l = {
|
|
2750
|
-
"0%": { "offset-distance":
|
|
2751
|
-
"100%": { "offset-distance":
|
|
2752
|
-
}, u = new
|
|
2765
|
+
"0%": { "offset-distance": ua(r) },
|
|
2766
|
+
"100%": { "offset-distance": ua(i) }
|
|
2767
|
+
}, u = new U(s).fromKeyframes(l);
|
|
2753
2768
|
return u.setTargets(...c), o && u.play(), u;
|
|
2754
2769
|
}
|
|
2755
|
-
var
|
|
2770
|
+
var fa = class extends la {
|
|
2756
2771
|
constructor(e, t) {
|
|
2757
|
-
super(
|
|
2772
|
+
super(da(e, t));
|
|
2758
2773
|
}
|
|
2759
|
-
},
|
|
2774
|
+
}, pa = (e) => {
|
|
2760
2775
|
if (typeof e == "number") {
|
|
2761
2776
|
if (!Number.isFinite(e) || e < 0 || e > 1) throw Error(`fromDrawSVG(): a numeric draw position is a 0..1 fraction, got ${JSON.stringify(e)} — pass a fraction in [0, 1] or a percent string ("0%".."100%").`);
|
|
2762
2777
|
return e;
|
|
2763
2778
|
}
|
|
2764
|
-
let t =
|
|
2779
|
+
let t = be(() => ue(e.trim()), ({ payload: e }) => e.type === "number" && e.unit === "%" && e.value >= 0 ? e.value / 100 : void 0, void 0);
|
|
2765
2780
|
if (t === void 0) throw Error(`fromDrawSVG(): invalid draw position ${JSON.stringify(e)} — pass a percent string ("0%".."100%") or a 0..1 number.`);
|
|
2766
2781
|
return t;
|
|
2767
2782
|
};
|
|
2768
|
-
function
|
|
2783
|
+
function ma(e, t = {}) {
|
|
2769
2784
|
let { from: n = "0%", to: r = "100%", autoPlay: i = !0, ...a } = t;
|
|
2770
2785
|
if (e == null || typeof e.getTotalLength != "function") throw Error("fromDrawSVG(): `target` must be an SVG geometry element exposing getTotalLength() (a <path>/<line>/<circle>/<rect>/<polygon>/…).");
|
|
2771
|
-
let o =
|
|
2786
|
+
let o = pa(n), s = pa(r), c = e.getTotalLength();
|
|
2772
2787
|
e.style.strokeDasharray = `${c}`;
|
|
2773
2788
|
let l = {
|
|
2774
2789
|
"0%": { "stroke-dashoffset": c * (1 - o) },
|
|
2775
2790
|
"100%": { "stroke-dashoffset": c * (1 - s) }
|
|
2776
|
-
}, u = new
|
|
2791
|
+
}, u = new U(a).fromKeyframes(l);
|
|
2777
2792
|
return u.setTargets(e), i && u.play(), u;
|
|
2778
2793
|
}
|
|
2779
|
-
var
|
|
2794
|
+
var ha = class extends la {
|
|
2780
2795
|
constructor(e, t = {}) {
|
|
2781
|
-
super(
|
|
2796
|
+
super(ma(e, t));
|
|
2782
2797
|
}
|
|
2783
|
-
},
|
|
2798
|
+
}, ga = (e) => `--morph-${e}-x`, _a = (e) => `--morph-${e}-y`, va = (e) => `--morph-${e}-angle`, ya = (e, t, n) => {
|
|
2784
2799
|
let r = Array(t + 1);
|
|
2785
2800
|
for (let i = 0; i <= t; i++) if (n) {
|
|
2786
2801
|
let n = e.sampleAtLength(e.totalLength * (i / t));
|
|
@@ -2791,12 +2806,12 @@ var ma = class extends ca {
|
|
|
2791
2806
|
};
|
|
2792
2807
|
} else r[i] = e.getPointAtT(i / t);
|
|
2793
2808
|
return r;
|
|
2794
|
-
},
|
|
2809
|
+
}, ba = (e) => Number.isInteger(e) ? `${e}` : e.toFixed(3), xa = (e) => {
|
|
2795
2810
|
if (e.length === 0) return "";
|
|
2796
|
-
let t = `M ${
|
|
2797
|
-
for (let n = 1; n < e.length; n++) t += ` L ${
|
|
2811
|
+
let t = `M ${ba(e[0].x)} ${ba(e[0].y)}`;
|
|
2812
|
+
for (let n = 1; n < e.length; n++) t += ` L ${ba(e[n].x)} ${ba(e[n].y)}`;
|
|
2798
2813
|
return t;
|
|
2799
|
-
},
|
|
2814
|
+
}, Sa = (e, t) => {
|
|
2800
2815
|
let n = Array(t + 1);
|
|
2801
2816
|
for (let e = 0; e <= t; e++) n[e] = {
|
|
2802
2817
|
x: 0,
|
|
@@ -2805,74 +2820,82 @@ var ma = class extends ca {
|
|
|
2805
2820
|
return (r) => {
|
|
2806
2821
|
let i = r;
|
|
2807
2822
|
for (let e = 0; e <= t; e++) {
|
|
2808
|
-
let t = n[e], r = i[
|
|
2823
|
+
let t = n[e], r = i[ga(e)], a = i[_a(e)];
|
|
2809
2824
|
if (typeof r != "number" || typeof a != "number") throw Error(`morph render: point ${e} lost its coordinate leaf (engine invariant violated — xKey/yKey seeded at construction)`);
|
|
2810
2825
|
t.x = r, t.y = a;
|
|
2811
2826
|
}
|
|
2812
|
-
let a =
|
|
2827
|
+
let a = xa(n);
|
|
2813
2828
|
e.style.setProperty("--morph-d", a), e.style.setProperty("d", `path("${a}")`);
|
|
2814
2829
|
};
|
|
2815
2830
|
};
|
|
2816
2831
|
//#endregion
|
|
2817
2832
|
//#region src/animation/svg/morph-svg.ts
|
|
2818
|
-
function
|
|
2833
|
+
function Ca(e, t, r = {}) {
|
|
2819
2834
|
let { samples: i = 64, target: a, orient: o = !1, autoPlay: s = !0, ...c } = r;
|
|
2820
2835
|
if (typeof e != "string" || e.length === 0) throw new n("from", e, "fromMorphSVG(): `from` must be a non-empty SVG path `d` string.");
|
|
2821
2836
|
if (typeof t != "string" || t.length === 0) throw new n("to", t, "fromMorphSVG(): `to` must be a non-empty SVG path `d` string.");
|
|
2822
2837
|
if (!Number.isInteger(i) || i < 2) throw new n("samples", i, "fromMorphSVG(): `samples` must be an integer >= 2 (a 1-sample morph is just the two endpoints, with no body to interpolate).");
|
|
2823
|
-
let l = new
|
|
2838
|
+
let l = new Ae(e), u = new Ae(t);
|
|
2824
2839
|
if (l.totalLength === 0) throw new n("from", e, "fromMorphSVG(): the `from` path has zero arc-length — a morph between a zero-length path and anything is malformed input, not an identity animation.");
|
|
2825
2840
|
if (u.totalLength === 0) throw new n("to", t, "fromMorphSVG(): the `to` path has zero arc-length — a morph between a zero-length path and anything is malformed input, not an identity animation.");
|
|
2826
|
-
let d =
|
|
2827
|
-
for (let e = 0; e <= i; e++) p[
|
|
2841
|
+
let d = ya(l, i, o), f = ya(u, i, o), p = {}, m = {};
|
|
2842
|
+
for (let e = 0; e <= i; e++) p[ga(e)] = d[e].x, p[_a(e)] = d[e].y, m[ga(e)] = f[e].x, m[_a(e)] = f[e].y, o && (p[va(e)] = d[e].angle ?? 0, m[va(e)] = f[e].angle ?? 0);
|
|
2828
2843
|
let h = {
|
|
2829
2844
|
"0%": p,
|
|
2830
2845
|
"100%": m
|
|
2831
|
-
}, g = a == null ? void 0 :
|
|
2846
|
+
}, g = a == null ? void 0 : Sa(a, i), _ = a;
|
|
2832
2847
|
a != null && typeof _.setAttribute == "function" && _.setAttribute("d", e);
|
|
2833
|
-
let v = new
|
|
2848
|
+
let v = new U(c).fromKeyframes(h, g);
|
|
2834
2849
|
return s && v.play(), v;
|
|
2835
2850
|
}
|
|
2836
|
-
var
|
|
2851
|
+
var wa = class extends la {
|
|
2837
2852
|
samples;
|
|
2838
2853
|
constructor(e, t, n = {}) {
|
|
2839
|
-
super(
|
|
2854
|
+
super(Ca(e, t, n)), this.samples = n.samples ?? 64;
|
|
2840
2855
|
}
|
|
2841
2856
|
sampleD(e) {
|
|
2842
2857
|
let t = (e < 0 ? 0 : e > 1 ? 1 : e) * this.animation.options.duration, n = this.animation.interpFrames(t, !1), r = Array(this.samples + 1);
|
|
2843
2858
|
for (let e = 0; e <= this.samples; e++) {
|
|
2844
|
-
let t = n[
|
|
2859
|
+
let t = n[ga(e)], i = n[_a(e)];
|
|
2845
2860
|
r[e] = {
|
|
2846
2861
|
x: (typeof t == "number" ? t : void 0) ?? 0,
|
|
2847
2862
|
y: (typeof i == "number" ? i : void 0) ?? 0
|
|
2848
2863
|
};
|
|
2849
2864
|
}
|
|
2850
|
-
return
|
|
2865
|
+
return xa(r);
|
|
2851
2866
|
}
|
|
2852
|
-
},
|
|
2867
|
+
}, Ta = "\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n", Ea = "\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n", Da = "\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.05);\n }\n", Oa = "\n8%,\n41% {\n transform: translateX(-10px);\n}\n25%,\n58% {\n transform: translateX(10px);\n}\n75% {\n transform: translateX(-5px);\n}\n92% {\n transform: translateX(5px);\n}\n0%,\n100% {\n transform: translateX(0);\n}\n", ka = "\n 0%, 20%, 50%, 80%, 100% {\n transform: translateY(0);\n }\n 40% {\n transform: translateY(-30px);\n }\n 60% {\n transform: translateY(-15px);\n }\n", Aa = "\n 0% {\n transform: perspective(400px) rotateY(0);\n animation-timing-function: ease-out;\n }\n 40% {\n transform: perspective(400px) translateZ(150px) rotateY(170deg);\n animation-timing-function: ease-out;\n }\n 50% {\n transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);\n animation-timing-function: ease-in;\n }\n 80% {\n transform: perspective(400px) rotateY(360deg) scale(.95);\n animation-timing-function: ease-in;\n }\n 100% {\n transform: perspective(400px) scale(1);\n animation-timing-function: ease-in;\n }\n", ja = "\n 0% {\n transform-origin: center;\n transform: rotate3d(0, 0, 1, -200deg);\n opacity: 0;\n }\n 100% {\n transform-origin: center;\n transform: none;\n opacity: 1;\n }\n", Ma = "\n 0% {\n transform: translateY(1000px);\n opacity: 0;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n }\n", Na = "\n 0% {\n transform: scale(1);\n }\n 14% {\n transform: scale(1.3);\n }\n 28% {\n transform: scale(1);\n }\n 42% {\n transform: scale(1.3);\n }\n 70% {\n transform: scale(1);\n }\n", Pa = "\n 0%, 100% {\n box-shadow: 0 0 5px rgb(0 0 0 / 20%);\n }\n 50% {\n box-shadow: 0 0 20px rgb(0 0 0 / 80%);\n }\n", Fa = "\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n", Ia = "\n 0% {\n color: red;\n }\n 15% {\n color: orange;\n }\n 30% {\n color: yellow;\n }\n 45% {\n color: green;\n }\n 60% {\n color: blue;\n }\n 75% {\n color: indigo;\n }\n 90% {\n color: violet;\n }\n 100% {\n color: red;\n }\n", La = "@keyframes keyframeDelete {\n 0% {\n transform: translateX(0%) rotate(0deg);\n opacity: 1;\n }\n 25% {\n transform: translateX(0%) rotate(5deg);\n opacity: 1;\n }\n 50% {\n transform: translateX(25%) rotate(10deg);\n opacity: 0.5;\n }\n 75% {\n transform: translateX(0%) rotate(0deg);\n opacity: 0.25;\n }\n 100% {\n transform: translateX(-100%);\n opacity: 0;\n }\n}", Ra = "@keyframes keyframeDelete {\n 0% {\n transform: translateX(0%) rotate(0deg);\n opacity: 1;\n }\n 25% {\n transform: translateX(0%) rotate(-5deg);\n opacity: 1;\n }\n 50% {\n transform: translateX(-25%) rotate(-10deg);\n opacity: 0.5;\n }\n 100% {\n transform: translateX(100%);\n opacity: 0;\n }\n}", za = "\n0% {\n filter: blur(10px);\n opacity: 0;\n}\n100% {\n filter: blur(0px);\n opacity: 1;\n}\n", Ba = "\n0% {\n filter: blur(0px);\n opacity: 1;\n}\n100% {\n filter: blur(10px);\n opacity: 0;\n}\n", Va = "\n0% {\n filter: blur(0px);\n}\n50% {\n filter: blur(10px);\n}\n100% {\n filter: blur(0px);\n}\n", Ha = "\n0% {\n width: 0%;\n background-color: #ff9999;\n}\n25% {\n width: 25%;\n background-color: #ffcc99;\n}\n50% {\n width: 50%;\n background-color: #ffff99;\n}\n75% {\n width: 75%;\n background-color: #99ff99;\n}\n100% {\n width: 100%;\n background-color: #99ccff;\n}\n", Ua = "\n0% {\n background-position: -200% 0;\n}\n100% {\n background-position: 200% 0;\n}\n", Wa = "\n0%, 100% {\n filter: blur(0px);\n opacity: 1;\n}\n50% {\n filter: blur(4px);\n opacity: 0.5;\n}\n", Ga = "\n0% {\n background-position: 0% 50%;\n}\n50% {\n background-position: 100% 50%;\n}\n100% {\n background-position: 0% 50%;\n}\n", Ka = "\n0% {\n transform: rotate(0deg) scale(1);\n}\n25% {\n transform: rotate(90deg) scale(1.1);\n}\n50% {\n transform: rotate(180deg) scale(1);\n}\n75% {\n transform: rotate(270deg) scale(0.9);\n}\n100% {\n transform: rotate(360deg) scale(1);\n}\n", qa = "\n0%, 100% {\n border-right-color: transparent;\n}\n50% {\n border-right-color: black;\n}\n", Ja = "\n0% {\n max-height: 0;\n opacity: 0;\n}\n100% {\n max-height: 1000px;\n opacity: 1;\n}\n", Ya = "\n0%, 100% {\n transform: translateY(0);\n}\n25% {\n transform: translateY(-10px);\n}\n50% {\n transform: translateY(0);\n}\n75% {\n transform: translateY(-5px);\n}\n", Xa = "\n0% {\n transform: rotate(0deg);\n border-radius: 50%;\n}\n25% {\n transform: rotate(90deg);\n border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%;\n}\n50% {\n transform: rotate(180deg);\n border-radius: 50%;\n}\n75% {\n transform: rotate(270deg);\n border-radius: 60% 40% 40% 60% / 60% 60% 40% 40%;\n}\n100% {\n transform: rotate(360deg);\n border-radius: 50%;\n}\n", Za = "\n0% {\n background-position: 50% 0%;\n}\n100% {\n background-position: 50% 100%;\n}\n", Qa = "\n0% {\n transform: translateX(-100%);\n opacity: 0;\n}\n100% {\n transform: translateX(0);\n opacity: 1;\n}\n", $a = "\n0% {\n transform: translateX(0);\n opacity: 1;\n}\n100% {\n transform: translateX(-100%);\n opacity: 0;\n}\n", eo = "\n0% {\n transform: translateX(100%);\n opacity: 0;\n}\n100% {\n transform: translateX(0);\n opacity: 1;\n}\n", to = "\n0% {\n transform: translateX(0%);\n opacity: 1;\n\n}\n100% {\n transform: translateX(100%);\n opacity: 0;\n}\n", no = "\n0% {\n transform: translateY(0px);\n}\n50% {\n transform: translateY(5px);\n}\n100% {\n transform: translateY(0px);\n}\n", ro = "\n0% {\n transform: rotateZ(-2.5deg) translateY(0px);\n}\n25% {\n transform: rotateZ(0deg) translateY(3px);\n}\n50% {\n transform: rotateZ(2.5deg) translateY(0px);\n}\n75% {\n transform: rotateZ(0deg) translateY(3px);\n}\n100% {\n transform: rotateZ(-2.5deg) translateY(0px);\n}\n", io = "\n0% {\n transform: scale(0.2) rotate(-24deg);\n opacity: 0;\n}\n100% {\n transform: scale(1) rotate(0deg);\n opacity: 1;\n}\n", ao = "@keyframes keyframeShift {\n0% {\n transform: translateY(0%);\n opacity: 1;\n}\n\n50% {\n transform: translateY(-50%);\n opacity: 0.75;\n}\n\n100% {\n transform: translateY(-100%);\n opacity: 1;\n}\n}", oo = "@keyframes keyframeShift {\n0% {\n transform: translateY(0%);\n opacity: 1;\n}\n\n50% {\n transform: translateY(50%);\n opacity: 0.75;\n}\n\n100% {\n transform: translateY(100%);\n opacity: 1;\n}\n}", q = (e) => {
|
|
2853
2868
|
let t = e.trim();
|
|
2854
2869
|
if (!t.startsWith("@keyframes")) return e;
|
|
2855
2870
|
let n = t.indexOf("{"), r = t.lastIndexOf("}");
|
|
2856
2871
|
if (n === -1 || r <= n) return e;
|
|
2857
2872
|
let i = t.slice(10, n).trim();
|
|
2858
2873
|
return i === "" || i.includes("{") ? e : t.slice(n + 1, r);
|
|
2859
|
-
},
|
|
2874
|
+
}, so = {
|
|
2860
2875
|
response: .35,
|
|
2861
2876
|
dampingFraction: .78
|
|
2862
|
-
},
|
|
2877
|
+
}, co = {
|
|
2863
2878
|
response: .5,
|
|
2864
2879
|
dampingFraction: .5
|
|
2865
|
-
},
|
|
2880
|
+
}, lo = {
|
|
2866
2881
|
response: .7,
|
|
2867
2882
|
dampingFraction: .95
|
|
2868
|
-
},
|
|
2883
|
+
}, { response: uo, dampingFraction: fo } = Xr([
|
|
2884
|
+
1,
|
|
2885
|
+
120,
|
|
2886
|
+
12,
|
|
2887
|
+
0
|
|
2888
|
+
]), po = {
|
|
2889
|
+
response: uo,
|
|
2890
|
+
dampingFraction: fo
|
|
2891
|
+
}, mo = {
|
|
2869
2892
|
springScaleInKeyframes: "\n 0% {\n transform: scale(0.6);\n opacity: 0;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n",
|
|
2870
2893
|
springSlideInKeyframes: "\n 0% {\n transform: translateY(40px);\n opacity: 0;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n }\n",
|
|
2871
2894
|
springPopKeyframes: "\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.15);\n }\n",
|
|
2872
2895
|
springWobbleKeyframes: "\n 0%, 100% {\n transform: rotate(0deg);\n }\n 50% {\n transform: rotate(8deg);\n }\n"
|
|
2873
|
-
},
|
|
2896
|
+
}, ho = {
|
|
2874
2897
|
fadeIn: {
|
|
2875
|
-
css: q(
|
|
2898
|
+
css: q(Ta),
|
|
2876
2899
|
options: {
|
|
2877
2900
|
duration: 700,
|
|
2878
2901
|
timingFunction: "ease-in-out"
|
|
@@ -2880,7 +2903,7 @@ var Sa = class extends ca {
|
|
|
2880
2903
|
group: "enter"
|
|
2881
2904
|
},
|
|
2882
2905
|
fadeOut: {
|
|
2883
|
-
css: q(
|
|
2906
|
+
css: q(Ea),
|
|
2884
2907
|
options: {
|
|
2885
2908
|
duration: 700,
|
|
2886
2909
|
timingFunction: "ease-in-out"
|
|
@@ -2888,7 +2911,7 @@ var Sa = class extends ca {
|
|
|
2888
2911
|
group: "exit"
|
|
2889
2912
|
},
|
|
2890
2913
|
pulse: {
|
|
2891
|
-
css: q(
|
|
2914
|
+
css: q(Da),
|
|
2892
2915
|
options: {
|
|
2893
2916
|
duration: 1e3,
|
|
2894
2917
|
timingFunction: "ease-in-out",
|
|
@@ -2897,7 +2920,7 @@ var Sa = class extends ca {
|
|
|
2897
2920
|
group: "attention"
|
|
2898
2921
|
},
|
|
2899
2922
|
shake: {
|
|
2900
|
-
css: q(
|
|
2923
|
+
css: q(Oa),
|
|
2901
2924
|
options: {
|
|
2902
2925
|
duration: 820,
|
|
2903
2926
|
timingFunction: "ease-in-out"
|
|
@@ -2905,7 +2928,7 @@ var Sa = class extends ca {
|
|
|
2905
2928
|
group: "attention"
|
|
2906
2929
|
},
|
|
2907
2930
|
bounce: {
|
|
2908
|
-
css: q(
|
|
2931
|
+
css: q(ka),
|
|
2909
2932
|
options: {
|
|
2910
2933
|
duration: 1e3,
|
|
2911
2934
|
timingFunction: "cubic-bezier(0.28, 0.84, 0.42, 1)"
|
|
@@ -2913,7 +2936,7 @@ var Sa = class extends ca {
|
|
|
2913
2936
|
group: "attention"
|
|
2914
2937
|
},
|
|
2915
2938
|
flipPreset: {
|
|
2916
|
-
css: q(
|
|
2939
|
+
css: q(Aa),
|
|
2917
2940
|
options: {
|
|
2918
2941
|
duration: 1e3,
|
|
2919
2942
|
timingFunction: "ease-in-out"
|
|
@@ -2922,7 +2945,7 @@ var Sa = class extends ca {
|
|
|
2922
2945
|
taxonomyName: "flip"
|
|
2923
2946
|
},
|
|
2924
2947
|
rotateIn: {
|
|
2925
|
-
css: q(
|
|
2948
|
+
css: q(ja),
|
|
2926
2949
|
options: {
|
|
2927
2950
|
duration: 1e3,
|
|
2928
2951
|
timingFunction: "cubic-bezier(0.25, 0.46, 0.45, 0.94)"
|
|
@@ -2930,7 +2953,7 @@ var Sa = class extends ca {
|
|
|
2930
2953
|
group: "enter"
|
|
2931
2954
|
},
|
|
2932
2955
|
slideIn: {
|
|
2933
|
-
css: q(
|
|
2956
|
+
css: q(Ma),
|
|
2934
2957
|
options: {
|
|
2935
2958
|
duration: 1e3,
|
|
2936
2959
|
timingFunction: "cubic-bezier(0.25, 0.46, 0.45, 0.94)"
|
|
@@ -2938,7 +2961,7 @@ var Sa = class extends ca {
|
|
|
2938
2961
|
group: "enter"
|
|
2939
2962
|
},
|
|
2940
2963
|
heartbeat: {
|
|
2941
|
-
css: q(
|
|
2964
|
+
css: q(Na),
|
|
2942
2965
|
options: {
|
|
2943
2966
|
duration: 1500,
|
|
2944
2967
|
timingFunction: "ease-in-out",
|
|
@@ -2947,7 +2970,7 @@ var Sa = class extends ca {
|
|
|
2947
2970
|
group: "loop"
|
|
2948
2971
|
},
|
|
2949
2972
|
glow: {
|
|
2950
|
-
css: q(
|
|
2973
|
+
css: q(Pa),
|
|
2951
2974
|
options: {
|
|
2952
2975
|
duration: 2e3,
|
|
2953
2976
|
timingFunction: "ease-in-out",
|
|
@@ -2956,7 +2979,7 @@ var Sa = class extends ca {
|
|
|
2956
2979
|
group: "loop"
|
|
2957
2980
|
},
|
|
2958
2981
|
typewriter: {
|
|
2959
|
-
css: q(
|
|
2982
|
+
css: q(Fa),
|
|
2960
2983
|
options: {
|
|
2961
2984
|
duration: 3e3,
|
|
2962
2985
|
timingFunction: "steps(40, jump-end)",
|
|
@@ -2964,7 +2987,7 @@ var Sa = class extends ca {
|
|
|
2964
2987
|
}
|
|
2965
2988
|
},
|
|
2966
2989
|
rainbowText: {
|
|
2967
|
-
css: q(
|
|
2990
|
+
css: q(Ia),
|
|
2968
2991
|
options: {
|
|
2969
2992
|
duration: 5e3,
|
|
2970
2993
|
timingFunction: "linear",
|
|
@@ -2973,7 +2996,7 @@ var Sa = class extends ca {
|
|
|
2973
2996
|
group: "loop"
|
|
2974
2997
|
},
|
|
2975
2998
|
warpLeft: {
|
|
2976
|
-
css: q(
|
|
2999
|
+
css: q(La),
|
|
2977
3000
|
options: {
|
|
2978
3001
|
duration: 700,
|
|
2979
3002
|
timingFunction: "ease-in-bounce"
|
|
@@ -2981,7 +3004,7 @@ var Sa = class extends ca {
|
|
|
2981
3004
|
group: "exit"
|
|
2982
3005
|
},
|
|
2983
3006
|
warpRight: {
|
|
2984
|
-
css: q(
|
|
3007
|
+
css: q(Ra),
|
|
2985
3008
|
options: {
|
|
2986
3009
|
duration: 700,
|
|
2987
3010
|
timingFunction: "ease-in-bounce"
|
|
@@ -2989,7 +3012,7 @@ var Sa = class extends ca {
|
|
|
2989
3012
|
group: "exit"
|
|
2990
3013
|
},
|
|
2991
3014
|
blurIn: {
|
|
2992
|
-
css: q(
|
|
3015
|
+
css: q(za),
|
|
2993
3016
|
options: {
|
|
2994
3017
|
duration: 2e3,
|
|
2995
3018
|
timingFunction: "ease-in-out"
|
|
@@ -2997,7 +3020,7 @@ var Sa = class extends ca {
|
|
|
2997
3020
|
group: "enter"
|
|
2998
3021
|
},
|
|
2999
3022
|
blurOut: {
|
|
3000
|
-
css: q(
|
|
3023
|
+
css: q(Ba),
|
|
3001
3024
|
options: {
|
|
3002
3025
|
duration: 2e3,
|
|
3003
3026
|
timingFunction: "ease-in-out"
|
|
@@ -3005,14 +3028,14 @@ var Sa = class extends ca {
|
|
|
3005
3028
|
group: "exit"
|
|
3006
3029
|
},
|
|
3007
3030
|
blurInOut: {
|
|
3008
|
-
css: q(
|
|
3031
|
+
css: q(Va),
|
|
3009
3032
|
options: {
|
|
3010
3033
|
duration: 2e3,
|
|
3011
3034
|
timingFunction: "ease-in-out"
|
|
3012
3035
|
}
|
|
3013
3036
|
},
|
|
3014
3037
|
progressBar: {
|
|
3015
|
-
css: q(
|
|
3038
|
+
css: q(Ha),
|
|
3016
3039
|
options: {
|
|
3017
3040
|
duration: 3e3,
|
|
3018
3041
|
timingFunction: "linear",
|
|
@@ -3020,7 +3043,7 @@ var Sa = class extends ca {
|
|
|
3020
3043
|
}
|
|
3021
3044
|
},
|
|
3022
3045
|
skeletonLoading: {
|
|
3023
|
-
css: q(
|
|
3046
|
+
css: q(Ua),
|
|
3024
3047
|
options: {
|
|
3025
3048
|
duration: 1500,
|
|
3026
3049
|
timingFunction: "linear",
|
|
@@ -3029,14 +3052,14 @@ var Sa = class extends ca {
|
|
|
3029
3052
|
group: "loop"
|
|
3030
3053
|
},
|
|
3031
3054
|
textFocusBlur: {
|
|
3032
|
-
css: q(
|
|
3055
|
+
css: q(Wa),
|
|
3033
3056
|
options: {
|
|
3034
3057
|
duration: 2e3,
|
|
3035
3058
|
timingFunction: "ease-in-out"
|
|
3036
3059
|
}
|
|
3037
3060
|
},
|
|
3038
3061
|
gradientBackground: {
|
|
3039
|
-
css: q(
|
|
3062
|
+
css: q(Ga),
|
|
3040
3063
|
options: {
|
|
3041
3064
|
duration: 5e3,
|
|
3042
3065
|
timingFunction: "ease-in-out",
|
|
@@ -3045,14 +3068,14 @@ var Sa = class extends ca {
|
|
|
3045
3068
|
group: "loop"
|
|
3046
3069
|
},
|
|
3047
3070
|
rotateScale: {
|
|
3048
|
-
css: q(
|
|
3071
|
+
css: q(Ka),
|
|
3049
3072
|
options: {
|
|
3050
3073
|
duration: 2500,
|
|
3051
3074
|
timingFunction: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
|
|
3052
3075
|
}
|
|
3053
3076
|
},
|
|
3054
3077
|
typingCursor: {
|
|
3055
|
-
css: q(
|
|
3078
|
+
css: q(qa),
|
|
3056
3079
|
options: {
|
|
3057
3080
|
duration: 800,
|
|
3058
3081
|
timingFunction: "steps(2, jump-start)",
|
|
@@ -3061,7 +3084,7 @@ var Sa = class extends ca {
|
|
|
3061
3084
|
group: "loop"
|
|
3062
3085
|
},
|
|
3063
3086
|
accordionExpand: {
|
|
3064
|
-
css: q(
|
|
3087
|
+
css: q(Ja),
|
|
3065
3088
|
options: {
|
|
3066
3089
|
duration: 500,
|
|
3067
3090
|
timingFunction: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
|
@@ -3069,7 +3092,7 @@ var Sa = class extends ca {
|
|
|
3069
3092
|
}
|
|
3070
3093
|
},
|
|
3071
3094
|
notificationBounce: {
|
|
3072
|
-
css: q(
|
|
3095
|
+
css: q(Ya),
|
|
3073
3096
|
options: {
|
|
3074
3097
|
duration: 1e3,
|
|
3075
3098
|
timingFunction: "cubic-bezier(0.28, 0.84, 0.42, 1)"
|
|
@@ -3077,7 +3100,7 @@ var Sa = class extends ca {
|
|
|
3077
3100
|
group: "attention"
|
|
3078
3101
|
},
|
|
3079
3102
|
spinner: {
|
|
3080
|
-
css: q(
|
|
3103
|
+
css: q(Xa),
|
|
3081
3104
|
options: {
|
|
3082
3105
|
duration: 2e3,
|
|
3083
3106
|
timingFunction: "linear",
|
|
@@ -3086,7 +3109,7 @@ var Sa = class extends ca {
|
|
|
3086
3109
|
group: "loop"
|
|
3087
3110
|
},
|
|
3088
3111
|
parallaxScroll: {
|
|
3089
|
-
css: q(
|
|
3112
|
+
css: q(Za),
|
|
3090
3113
|
options: {
|
|
3091
3114
|
duration: 1e4,
|
|
3092
3115
|
timingFunction: "linear",
|
|
@@ -3095,7 +3118,7 @@ var Sa = class extends ca {
|
|
|
3095
3118
|
group: "loop"
|
|
3096
3119
|
},
|
|
3097
3120
|
slideInLeft: {
|
|
3098
|
-
css: q(
|
|
3121
|
+
css: q(Qa),
|
|
3099
3122
|
options: {
|
|
3100
3123
|
duration: 1e3,
|
|
3101
3124
|
timingFunction: "cubic-bezier(0.25, 0.46, 0.45, 0.94)"
|
|
@@ -3103,7 +3126,7 @@ var Sa = class extends ca {
|
|
|
3103
3126
|
group: "enter"
|
|
3104
3127
|
},
|
|
3105
3128
|
slideOutLeft: {
|
|
3106
|
-
css: q(
|
|
3129
|
+
css: q($a),
|
|
3107
3130
|
options: {
|
|
3108
3131
|
duration: 1e3,
|
|
3109
3132
|
timingFunction: "cubic-bezier(0.25, 0.46, 0.45, 0.94)"
|
|
@@ -3111,7 +3134,7 @@ var Sa = class extends ca {
|
|
|
3111
3134
|
group: "exit"
|
|
3112
3135
|
},
|
|
3113
3136
|
slideInRight: {
|
|
3114
|
-
css: q(
|
|
3137
|
+
css: q(eo),
|
|
3115
3138
|
options: {
|
|
3116
3139
|
duration: 1e3,
|
|
3117
3140
|
timingFunction: "cubic-bezier(0.25, 0.46, 0.45, 0.94)"
|
|
@@ -3119,7 +3142,7 @@ var Sa = class extends ca {
|
|
|
3119
3142
|
group: "enter"
|
|
3120
3143
|
},
|
|
3121
3144
|
slideOutRight: {
|
|
3122
|
-
css: q(
|
|
3145
|
+
css: q(to),
|
|
3123
3146
|
options: {
|
|
3124
3147
|
duration: 1e3,
|
|
3125
3148
|
timingFunction: "cubic-bezier(0.25, 0.46, 0.45, 0.94)"
|
|
@@ -3127,7 +3150,7 @@ var Sa = class extends ca {
|
|
|
3127
3150
|
group: "exit"
|
|
3128
3151
|
},
|
|
3129
3152
|
hover: {
|
|
3130
|
-
css: q(
|
|
3153
|
+
css: q(no),
|
|
3131
3154
|
options: {
|
|
3132
3155
|
duration: 3e3,
|
|
3133
3156
|
timingFunction: "ease-in-out",
|
|
@@ -3137,8 +3160,28 @@ var Sa = class extends ca {
|
|
|
3137
3160
|
},
|
|
3138
3161
|
group: "loop"
|
|
3139
3162
|
},
|
|
3163
|
+
garlandSway: {
|
|
3164
|
+
css: ro,
|
|
3165
|
+
options: {
|
|
3166
|
+
duration: 4200,
|
|
3167
|
+
timingFunction: "ease-in-out",
|
|
3168
|
+
iterationCount: Infinity,
|
|
3169
|
+
fillMode: "none",
|
|
3170
|
+
direction: "normal"
|
|
3171
|
+
},
|
|
3172
|
+
group: "loop"
|
|
3173
|
+
},
|
|
3174
|
+
unfurl: {
|
|
3175
|
+
css: io,
|
|
3176
|
+
options: {
|
|
3177
|
+
duration: 900,
|
|
3178
|
+
timingFunction: i(po),
|
|
3179
|
+
fillMode: "none"
|
|
3180
|
+
},
|
|
3181
|
+
group: "enter"
|
|
3182
|
+
},
|
|
3140
3183
|
jumpUp: {
|
|
3141
|
-
css: q(
|
|
3184
|
+
css: q(ao),
|
|
3142
3185
|
options: {
|
|
3143
3186
|
duration: 700,
|
|
3144
3187
|
timingFunction: "ease-in-bounce"
|
|
@@ -3146,7 +3189,7 @@ var Sa = class extends ca {
|
|
|
3146
3189
|
group: "enter"
|
|
3147
3190
|
},
|
|
3148
3191
|
jumpDown: {
|
|
3149
|
-
css: q(
|
|
3192
|
+
css: q(oo),
|
|
3150
3193
|
options: {
|
|
3151
3194
|
duration: 700,
|
|
3152
3195
|
timingFunction: "ease-in-bounce"
|
|
@@ -3154,141 +3197,143 @@ var Sa = class extends ca {
|
|
|
3154
3197
|
group: "exit"
|
|
3155
3198
|
},
|
|
3156
3199
|
springScaleIn: {
|
|
3157
|
-
css:
|
|
3200
|
+
css: mo.springScaleInKeyframes,
|
|
3158
3201
|
options: {
|
|
3159
3202
|
duration: 600,
|
|
3160
|
-
timingFunction: i(
|
|
3203
|
+
timingFunction: i(co)
|
|
3161
3204
|
},
|
|
3162
3205
|
group: "enter"
|
|
3163
3206
|
},
|
|
3164
3207
|
springSlideIn: {
|
|
3165
|
-
css:
|
|
3208
|
+
css: mo.springSlideInKeyframes,
|
|
3166
3209
|
options: {
|
|
3167
3210
|
duration: 600,
|
|
3168
|
-
timingFunction: i(
|
|
3211
|
+
timingFunction: i(so)
|
|
3169
3212
|
},
|
|
3170
3213
|
group: "enter"
|
|
3171
3214
|
},
|
|
3172
3215
|
springPop: {
|
|
3173
|
-
css:
|
|
3216
|
+
css: mo.springPopKeyframes,
|
|
3174
3217
|
options: {
|
|
3175
3218
|
duration: 700,
|
|
3176
|
-
timingFunction: i(
|
|
3219
|
+
timingFunction: i(co)
|
|
3177
3220
|
},
|
|
3178
3221
|
group: "attention"
|
|
3179
3222
|
},
|
|
3180
3223
|
springWobble: {
|
|
3181
|
-
css:
|
|
3224
|
+
css: mo.springWobbleKeyframes,
|
|
3182
3225
|
options: {
|
|
3183
3226
|
duration: 800,
|
|
3184
|
-
timingFunction: i(
|
|
3227
|
+
timingFunction: i(lo)
|
|
3185
3228
|
},
|
|
3186
3229
|
group: "attention"
|
|
3187
3230
|
}
|
|
3188
|
-
},
|
|
3231
|
+
}, go = (e) => (t) => new U({
|
|
3189
3232
|
...e.options,
|
|
3190
3233
|
...t ?? {}
|
|
3191
|
-
}).fromString(e.css),
|
|
3192
|
-
enter:
|
|
3193
|
-
exit:
|
|
3194
|
-
attention:
|
|
3195
|
-
loop:
|
|
3196
|
-
},
|
|
3197
|
-
accordionExpand: () =>
|
|
3198
|
-
attentionPresets: () =>
|
|
3199
|
-
blurIn: () =>
|
|
3200
|
-
blurInOut: () =>
|
|
3201
|
-
blurOut: () =>
|
|
3202
|
-
bounce: () =>
|
|
3203
|
-
enterPresets: () =>
|
|
3204
|
-
exitPresets: () =>
|
|
3205
|
-
fadeIn: () =>
|
|
3206
|
-
fadeOut: () =>
|
|
3207
|
-
flipPreset: () =>
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3234
|
+
}).fromString(e.css), _o = Object.fromEntries(Object.entries(ho).map(([e, t]) => [e, go(t)])), { fadeIn: vo, fadeOut: yo, pulse: bo, shake: xo, bounce: So, flipPreset: Co, rotateIn: wo, slideIn: To, heartbeat: Eo, glow: Do, typewriter: Oo, rainbowText: ko, warpLeft: Ao, warpRight: jo, blurIn: Mo, blurOut: No, blurInOut: Po, progressBar: Fo, skeletonLoading: Io, textFocusBlur: Lo, gradientBackground: Ro, rotateScale: zo, typingCursor: Bo, accordionExpand: Vo, notificationBounce: Ho, spinner: Uo, parallaxScroll: Wo, slideInLeft: Go, slideOutLeft: Ko, slideInRight: qo, slideOutRight: Jo, hover: Yo, garlandSway: Xo, unfurl: Zo, jumpUp: Qo, jumpDown: $o, springScaleIn: es, springSlideIn: ts, springPop: ns, springWobble: rs } = _o, is = (e) => Object.fromEntries(Object.entries(ho).filter(([, t]) => t.group === e).map(([e, t]) => [t.taxonomyName ?? e, _o[e]])), as = is("enter"), os = is("exit"), ss = is("attention"), cs = is("loop"), ls = {
|
|
3235
|
+
enter: as,
|
|
3236
|
+
exit: os,
|
|
3237
|
+
attention: ss,
|
|
3238
|
+
loop: cs
|
|
3239
|
+
}, us = /* @__PURE__ */ Me({
|
|
3240
|
+
accordionExpand: () => Vo,
|
|
3241
|
+
attentionPresets: () => ss,
|
|
3242
|
+
blurIn: () => Mo,
|
|
3243
|
+
blurInOut: () => Po,
|
|
3244
|
+
blurOut: () => No,
|
|
3245
|
+
bounce: () => So,
|
|
3246
|
+
enterPresets: () => as,
|
|
3247
|
+
exitPresets: () => os,
|
|
3248
|
+
fadeIn: () => vo,
|
|
3249
|
+
fadeOut: () => yo,
|
|
3250
|
+
flipPreset: () => Co,
|
|
3251
|
+
garlandSway: () => Xo,
|
|
3252
|
+
glow: () => Do,
|
|
3253
|
+
gradientBackground: () => Ro,
|
|
3254
|
+
heartbeat: () => Eo,
|
|
3255
|
+
hover: () => Yo,
|
|
3256
|
+
jumpDown: () => $o,
|
|
3257
|
+
jumpUp: () => Qo,
|
|
3258
|
+
loopPresets: () => cs,
|
|
3259
|
+
notificationBounce: () => Ho,
|
|
3260
|
+
parallaxScroll: () => Wo,
|
|
3261
|
+
presetTaxonomy: () => ls,
|
|
3262
|
+
progressBar: () => Fo,
|
|
3263
|
+
pulse: () => bo,
|
|
3264
|
+
rainbowText: () => ko,
|
|
3265
|
+
rotateIn: () => wo,
|
|
3266
|
+
rotateScale: () => zo,
|
|
3267
|
+
shake: () => xo,
|
|
3268
|
+
skeletonLoading: () => Io,
|
|
3269
|
+
slideIn: () => To,
|
|
3270
|
+
slideInLeft: () => Go,
|
|
3271
|
+
slideInRight: () => qo,
|
|
3272
|
+
slideOutLeft: () => Ko,
|
|
3273
|
+
slideOutRight: () => Jo,
|
|
3274
|
+
spinner: () => Uo,
|
|
3275
|
+
springPop: () => ns,
|
|
3276
|
+
springScaleIn: () => es,
|
|
3277
|
+
springSlideIn: () => ts,
|
|
3278
|
+
springWobble: () => rs,
|
|
3279
|
+
textFocusBlur: () => Lo,
|
|
3280
|
+
typewriter: () => Oo,
|
|
3281
|
+
typingCursor: () => Bo,
|
|
3282
|
+
unfurl: () => Zo,
|
|
3283
|
+
warpLeft: () => Ao,
|
|
3284
|
+
warpRight: () => jo
|
|
3285
|
+
}), ds = (e, t, n, r = {}) => {
|
|
3241
3286
|
e.push({
|
|
3242
3287
|
code: t,
|
|
3243
3288
|
message: n,
|
|
3244
3289
|
...r
|
|
3245
3290
|
});
|
|
3246
|
-
},
|
|
3291
|
+
}, fs = (e) => {
|
|
3247
3292
|
if (typeof CSSKeyframesRule < "u" && e instanceof CSSKeyframesRule) return !0;
|
|
3248
3293
|
let t = e;
|
|
3249
3294
|
return t.type === 7 && typeof t.name == "string" && typeof t.cssText == "string";
|
|
3250
|
-
},
|
|
3295
|
+
}, ps = 32, ms = (e) => {
|
|
3251
3296
|
let t = (t) => typeof e?.getPropertyValue == "function" ? String(e.getPropertyValue(t) ?? "") : "", n = `${t("animation-name")} ${t("animation")}`;
|
|
3252
3297
|
return new Set(n.split(/[\s,]+/).filter((e) => e !== ""));
|
|
3253
|
-
},
|
|
3298
|
+
}, hs = (e) => e.cssRules !== void 0 && !fs(e), gs = (e, t, n, r = 0) => {
|
|
3254
3299
|
let i = [];
|
|
3255
3300
|
for (let t = 0; t < e.length; t++) {
|
|
3256
3301
|
let n = e[t];
|
|
3257
3302
|
n?.type === 1 && typeof n.cssText == "string" && i.push({
|
|
3258
3303
|
cssText: n.cssText,
|
|
3259
|
-
names:
|
|
3304
|
+
names: ms(n.style)
|
|
3260
3305
|
});
|
|
3261
3306
|
}
|
|
3262
3307
|
for (let r = 0; r < e.length; r++) {
|
|
3263
3308
|
let a = e[r];
|
|
3264
|
-
if (a == null || !
|
|
3309
|
+
if (a == null || !fs(a)) continue;
|
|
3265
3310
|
let o = a.name;
|
|
3266
3311
|
if (n.animationName != null && o !== n.animationName) continue;
|
|
3267
|
-
let s = i.find((e) => e.names.has(o))?.cssText, c = [], l =
|
|
3312
|
+
let s = i.find((e) => e.names.has(o))?.cssText, c = [], l = _s(a.cssText, s, n.options, c);
|
|
3268
3313
|
l != null && t.set(o, {
|
|
3269
3314
|
name: o,
|
|
3270
3315
|
animation: l,
|
|
3271
3316
|
diagnostics: c
|
|
3272
3317
|
});
|
|
3273
3318
|
}
|
|
3274
|
-
if (r <
|
|
3319
|
+
if (r < ps) for (let i = 0; i < e.length; i++) {
|
|
3275
3320
|
let a = e[i];
|
|
3276
|
-
a == null || !
|
|
3321
|
+
a == null || !hs(a) || gs(a.cssRules, t, n, r + 1);
|
|
3277
3322
|
}
|
|
3278
|
-
},
|
|
3323
|
+
}, _s = (e, t, n, r) => {
|
|
3279
3324
|
try {
|
|
3280
|
-
let i = new
|
|
3325
|
+
let i = new U(n ?? {}), a = t ? `${t}\n${e}` : e;
|
|
3281
3326
|
i.fromString(a);
|
|
3282
3327
|
for (let e of i.diagnostics) r.push(e);
|
|
3283
3328
|
return i;
|
|
3284
3329
|
} catch (t) {
|
|
3285
|
-
|
|
3330
|
+
ds(r, "PARSE_ERROR", `@keyframes rule could not be reconstructed: ${t instanceof Error ? t.message : String(t)} — the source CSS could not be parsed faithfully (refused, not approximated)`, { input: e });
|
|
3286
3331
|
return;
|
|
3287
3332
|
}
|
|
3288
|
-
},
|
|
3333
|
+
}, vs = (e, t = {}) => {
|
|
3289
3334
|
let n = /* @__PURE__ */ new Map(), r = [], i;
|
|
3290
3335
|
if (e == null) {
|
|
3291
|
-
if (typeof document > "u") return
|
|
3336
|
+
if (typeof document > "u") return ds(r, "CORS_SKIP", "no document in scope — resolveLiveKeyframes() needs a Document, a ShadowRoot, a CSSStyleSheet[], or a CSSStyleSheet (SSR has no live CSSOM)"), {
|
|
3292
3337
|
animations: n,
|
|
3293
3338
|
diagnostics: r
|
|
3294
3339
|
};
|
|
@@ -3300,18 +3345,18 @@ var Sa = class extends ca {
|
|
|
3300
3345
|
i = e.cssRules;
|
|
3301
3346
|
} catch (t) {
|
|
3302
3347
|
let n = e.href ?? "(inline)";
|
|
3303
|
-
|
|
3348
|
+
ds(r, "CORS_SKIP", `cross-origin stylesheet skipped: ${n} — its cssRules threw ${t instanceof Error ? t.name : "an error"} (no Access-Control-Allow-Origin + crossorigin). The sheet is REPORTED, not silently dropped.`, { input: n });
|
|
3304
3349
|
continue;
|
|
3305
3350
|
}
|
|
3306
|
-
i != null &&
|
|
3351
|
+
i != null && gs(i, n, t);
|
|
3307
3352
|
}
|
|
3308
3353
|
return {
|
|
3309
3354
|
animations: n,
|
|
3310
3355
|
diagnostics: r
|
|
3311
3356
|
};
|
|
3312
|
-
},
|
|
3357
|
+
}, ys = (e, t = {}) => vs(e, t), bs = (e, t = {}) => {
|
|
3313
3358
|
let n = /* @__PURE__ */ new Map(), r = [], i = e ?? (typeof document < "u" ? document : void 0);
|
|
3314
|
-
if (i == null || typeof i.getAnimations != "function") return
|
|
3359
|
+
if (i == null || typeof i.getAnimations != "function") return ds(r, "CORS_SKIP", "no getAnimations() in scope — fromLiveAnimations() needs a Document or Element with the Web Animations API (SSR has none)"), {
|
|
3315
3360
|
animations: n,
|
|
3316
3361
|
diagnostics: r
|
|
3317
3362
|
};
|
|
@@ -3322,7 +3367,7 @@ var Sa = class extends ca {
|
|
|
3322
3367
|
}
|
|
3323
3368
|
let o = (i instanceof Document ? i : i.ownerDocument ?? (typeof document < "u" ? document : void 0)) ?? void 0;
|
|
3324
3369
|
for (let e of a) {
|
|
3325
|
-
let i =
|
|
3370
|
+
let i = vs(o, {
|
|
3326
3371
|
...t,
|
|
3327
3372
|
animationName: e
|
|
3328
3373
|
});
|
|
@@ -3333,11 +3378,11 @@ var Sa = class extends ca {
|
|
|
3333
3378
|
animations: n,
|
|
3334
3379
|
diagnostics: r
|
|
3335
3380
|
};
|
|
3336
|
-
},
|
|
3381
|
+
}, xs = (e) => {
|
|
3337
3382
|
if (typeof e != "object" || !e) return !1;
|
|
3338
3383
|
let t = e;
|
|
3339
3384
|
return typeof t.value == "number" && typeof t.unit == "string";
|
|
3340
|
-
},
|
|
3385
|
+
}, Ss = async (e, t) => {
|
|
3341
3386
|
let n = [], { animationName: r, commit: i = !0 } = t;
|
|
3342
3387
|
if (typeof e.getAnimations != "function") return n.push({
|
|
3343
3388
|
code: "WAAPI_INELIGIBLE",
|
|
@@ -3358,7 +3403,7 @@ var Sa = class extends ca {
|
|
|
3358
3403
|
};
|
|
3359
3404
|
let o = a.currentTime, s = null, c = 0;
|
|
3360
3405
|
if (typeof o == "number" && Number.isFinite(o)) c = o;
|
|
3361
|
-
else if (
|
|
3406
|
+
else if (xs(o)) if (o.unit === "percent" && Number.isFinite(o.value)) s = o.value / 100;
|
|
3362
3407
|
else return n.push({
|
|
3363
3408
|
code: "ADOPT_REFUSE",
|
|
3364
3409
|
message: `the running animation "${r}" reports a currentTime in an unsupported unit "${String(o.unit)}" — adoptRunning() refuses (only a numeric ms playhead or a scroll-driven "percent" CSSUnitValue can seed the takeover faithfully)`
|
|
@@ -3367,7 +3412,7 @@ var Sa = class extends ca {
|
|
|
3367
3412
|
currentTime: 0,
|
|
3368
3413
|
diagnostics: n
|
|
3369
3414
|
};
|
|
3370
|
-
let l =
|
|
3415
|
+
let l = vs(e.ownerDocument ?? (typeof document < "u" ? document : void 0) ?? void 0, {
|
|
3371
3416
|
...t,
|
|
3372
3417
|
animationName: r
|
|
3373
3418
|
});
|
|
@@ -3389,14 +3434,14 @@ var Sa = class extends ca {
|
|
|
3389
3434
|
try {
|
|
3390
3435
|
a.cancel();
|
|
3391
3436
|
} catch {}
|
|
3392
|
-
return
|
|
3437
|
+
return Cs(d, f), {
|
|
3393
3438
|
animation: d,
|
|
3394
3439
|
currentTime: f,
|
|
3395
3440
|
diagnostics: n
|
|
3396
3441
|
};
|
|
3397
|
-
},
|
|
3442
|
+
}, Cs = (e, t) => {
|
|
3398
3443
|
e.setUseWAAPI(!1), e.setDelay(0), e.onStart(), e.started = !0, e.startTime = (typeof performance < "u" && performance.now ? performance.now() : Date.now()) - t, e.t = t, e.play();
|
|
3399
|
-
},
|
|
3444
|
+
}, ws = {
|
|
3400
3445
|
entry: j.entry,
|
|
3401
3446
|
cover: j.cover,
|
|
3402
3447
|
contain: j.contain,
|
|
@@ -3414,7 +3459,7 @@ var Sa = class extends ca {
|
|
|
3414
3459
|
end: 1
|
|
3415
3460
|
}
|
|
3416
3461
|
};
|
|
3417
|
-
function
|
|
3462
|
+
function Ts(e) {
|
|
3418
3463
|
if (e == null) return null;
|
|
3419
3464
|
let t = e.trim();
|
|
3420
3465
|
if (t.endsWith("%")) {
|
|
@@ -3423,24 +3468,24 @@ function gs(e) {
|
|
|
3423
3468
|
}
|
|
3424
3469
|
return null;
|
|
3425
3470
|
}
|
|
3426
|
-
function
|
|
3471
|
+
function Es(e, t) {
|
|
3427
3472
|
if (e == null) return t;
|
|
3428
|
-
let n =
|
|
3473
|
+
let n = Ts(e.offset);
|
|
3429
3474
|
if (n != null) {
|
|
3430
3475
|
if (e.phase != null && e.phase !== "normal") {
|
|
3431
|
-
let t =
|
|
3476
|
+
let t = ws[e.phase];
|
|
3432
3477
|
return t.start + n * (t.end - t.start);
|
|
3433
3478
|
}
|
|
3434
3479
|
return n;
|
|
3435
3480
|
}
|
|
3436
|
-
return e.phase == null ? t :
|
|
3481
|
+
return e.phase == null ? t : ws[e.phase].start;
|
|
3437
3482
|
}
|
|
3438
|
-
function
|
|
3483
|
+
function Ds(e) {
|
|
3439
3484
|
if (e == null) return {
|
|
3440
3485
|
start: 0,
|
|
3441
3486
|
end: 1
|
|
3442
3487
|
};
|
|
3443
|
-
let t =
|
|
3488
|
+
let t = Es(e.start, 0), n = Es(e.end, 1);
|
|
3444
3489
|
return n > t ? {
|
|
3445
3490
|
start: t,
|
|
3446
3491
|
end: n
|
|
@@ -3451,7 +3496,7 @@ function vs(e) {
|
|
|
3451
3496
|
}
|
|
3452
3497
|
//#endregion
|
|
3453
3498
|
//#region src/animation/scroll/scene.ts
|
|
3454
|
-
var
|
|
3499
|
+
var Os = class {
|
|
3455
3500
|
resolvedRange;
|
|
3456
3501
|
snapPoints;
|
|
3457
3502
|
snapSpring;
|
|
@@ -3462,7 +3507,7 @@ var ys = class {
|
|
|
3462
3507
|
wasInside = !1;
|
|
3463
3508
|
subscribers = new Map([["enter", /* @__PURE__ */ new Set()], ["leave", /* @__PURE__ */ new Set()]]);
|
|
3464
3509
|
constructor(e = {}) {
|
|
3465
|
-
if (this.resolvedRange =
|
|
3510
|
+
if (this.resolvedRange = Ds(e.range), this.scrubSeconds = e.scrub ?? 0, this.snapPoints = e.snap != null && e.snap.length > 0 ? e.snap : void 0, this.scrubSeconds > 0) {
|
|
3466
3511
|
let t = g(1 / (this.scrubSeconds * 60 + 1), .01, 1);
|
|
3467
3512
|
this.smoother = new d({
|
|
3468
3513
|
damping: t,
|
|
@@ -3512,12 +3557,12 @@ var ys = class {
|
|
|
3512
3557
|
for (let n of this.subscribers.get(e)) n(t);
|
|
3513
3558
|
}
|
|
3514
3559
|
};
|
|
3515
|
-
function
|
|
3516
|
-
return new
|
|
3560
|
+
function ks(e = {}) {
|
|
3561
|
+
return new Os(e);
|
|
3517
3562
|
}
|
|
3518
3563
|
//#endregion
|
|
3519
3564
|
//#region src/animation/scroll/dispatch.ts
|
|
3520
|
-
function
|
|
3565
|
+
function As(e) {
|
|
3521
3566
|
let { animation: t, nativeSpec: n, scrub: r, snap: i, velocity: a } = e;
|
|
3522
3567
|
if (r) return {
|
|
3523
3568
|
backend: "js",
|
|
@@ -3557,13 +3602,13 @@ function xs(e) {
|
|
|
3557
3602
|
reason: c.reason
|
|
3558
3603
|
};
|
|
3559
3604
|
}
|
|
3560
|
-
function
|
|
3605
|
+
function js(e) {
|
|
3561
3606
|
let t = ["position: sticky;"];
|
|
3562
3607
|
return e?.bottom == null ? t.push(`top: ${e?.top ?? 0}px;`) : t.push(`bottom: ${e.bottom}px;`), t.join(" ");
|
|
3563
3608
|
}
|
|
3564
3609
|
//#endregion
|
|
3565
3610
|
//#region src/animation/scroll/trigger.ts
|
|
3566
|
-
function
|
|
3611
|
+
function Ms() {
|
|
3567
3612
|
let e = globalThis.CSS;
|
|
3568
3613
|
if (e == null || typeof e.supports != "function") return !1;
|
|
3569
3614
|
try {
|
|
@@ -3572,7 +3617,7 @@ function Cs() {
|
|
|
3572
3617
|
return !1;
|
|
3573
3618
|
}
|
|
3574
3619
|
}
|
|
3575
|
-
var
|
|
3620
|
+
var Ns = class {
|
|
3576
3621
|
type;
|
|
3577
3622
|
triggerRange;
|
|
3578
3623
|
_state = "idle";
|
|
@@ -3582,7 +3627,7 @@ var ws = class {
|
|
|
3582
3627
|
wasInside = !1;
|
|
3583
3628
|
everEntered = !1;
|
|
3584
3629
|
constructor(e = {}) {
|
|
3585
|
-
this.type = e.type ?? "once", this.triggerRange =
|
|
3630
|
+
this.type = e.type ?? "once", this.triggerRange = Ds(e.range);
|
|
3586
3631
|
}
|
|
3587
3632
|
get state() {
|
|
3588
3633
|
return this._state;
|
|
@@ -3600,7 +3645,7 @@ var ws = class {
|
|
|
3600
3645
|
return this.triggerRange;
|
|
3601
3646
|
}
|
|
3602
3647
|
get usesNative() {
|
|
3603
|
-
return
|
|
3648
|
+
return Ms();
|
|
3604
3649
|
}
|
|
3605
3650
|
triggerProgress(e) {
|
|
3606
3651
|
let t = g(e, 0, 1), { start: n, end: r } = this.triggerRange, i = r - n, a = i > 0 ? g((t - n) / i, 0, 1) : 0, o = t >= n && t <= r, s = o && !this.wasInside, c = !o && this.wasInside, l = c && t > r;
|
|
@@ -3639,18 +3684,18 @@ var ws = class {
|
|
|
3639
3684
|
return this._direction === "forward" ? e : 1 - e;
|
|
3640
3685
|
}
|
|
3641
3686
|
};
|
|
3642
|
-
function
|
|
3643
|
-
return new
|
|
3687
|
+
function Ps(e = {}) {
|
|
3688
|
+
return new Ns("trigger" in e && e.trigger != null ? e.trigger : e);
|
|
3644
3689
|
}
|
|
3645
3690
|
//#endregion
|
|
3646
3691
|
//#region src/animation/scroll/drive.ts
|
|
3647
|
-
function
|
|
3692
|
+
function Fs(e) {
|
|
3648
3693
|
return typeof e == "object" && !!e && "targets" in e && "play" in e;
|
|
3649
3694
|
}
|
|
3650
|
-
function
|
|
3695
|
+
function Is(e) {
|
|
3651
3696
|
return typeof Element < "u" && e instanceof Element;
|
|
3652
3697
|
}
|
|
3653
|
-
function
|
|
3698
|
+
function Ls(e, t, n) {
|
|
3654
3699
|
if (n.nativeSpec != null) return n.nativeSpec;
|
|
3655
3700
|
let r = e.timeline;
|
|
3656
3701
|
if (r?.kind === "scroll") return {
|
|
@@ -3659,7 +3704,7 @@ function Os(e, t, n) {
|
|
|
3659
3704
|
...n.axis ?? r.axis ? { axis: n.axis ?? r.axis } : {}
|
|
3660
3705
|
};
|
|
3661
3706
|
if (r?.kind === "view") {
|
|
3662
|
-
let e = n.subject ?? (
|
|
3707
|
+
let e = n.subject ?? (Is(t) ? t : Fs(t) && Is(t.targets[0]) ? t.targets[0] : void 0);
|
|
3663
3708
|
return e == null ? void 0 : {
|
|
3664
3709
|
kind: "view",
|
|
3665
3710
|
subject: e,
|
|
@@ -3668,13 +3713,13 @@ function Os(e, t, n) {
|
|
|
3668
3713
|
};
|
|
3669
3714
|
}
|
|
3670
3715
|
}
|
|
3671
|
-
function
|
|
3672
|
-
let r =
|
|
3716
|
+
function Rs(e, t, n = {}) {
|
|
3717
|
+
let r = Fs(t) ? t : n.animation, { nativeSpec: i, animation: a, velocity: o, source: s, subject: c, axis: l, inset: u, ...d } = n, f = ks({
|
|
3673
3718
|
...d,
|
|
3674
3719
|
range: e.range
|
|
3675
|
-
}), p = e.trigger == null ? void 0 :
|
|
3720
|
+
}), p = e.trigger == null ? void 0 : Ps(e), m = As({
|
|
3676
3721
|
animation: r,
|
|
3677
|
-
nativeSpec:
|
|
3722
|
+
nativeSpec: Ls(e, t, n),
|
|
3678
3723
|
scrub: n.scrub != null && n.scrub > 0,
|
|
3679
3724
|
snap: n.snap != null && n.snap.length > 0,
|
|
3680
3725
|
velocity: n.velocity
|
|
@@ -3688,35 +3733,35 @@ function ks(e, t, n = {}) {
|
|
|
3688
3733
|
}
|
|
3689
3734
|
//#endregion
|
|
3690
3735
|
//#region src/animation/scroll/grammar.ts
|
|
3691
|
-
var
|
|
3692
|
-
function
|
|
3693
|
-
return
|
|
3736
|
+
var zs = (e) => ([t]) => /* @__PURE__ */ TypeError(`Invalid CSS value ${JSON.stringify(e)}: ${t.code} at ${t.start}-${t.end}.`);
|
|
3737
|
+
function Bs(e) {
|
|
3738
|
+
return C(pe(e), zs(e));
|
|
3694
3739
|
}
|
|
3695
|
-
function
|
|
3696
|
-
return
|
|
3740
|
+
function Vs(e) {
|
|
3741
|
+
return C(ae(e), zs(e));
|
|
3697
3742
|
}
|
|
3698
|
-
function
|
|
3699
|
-
return
|
|
3743
|
+
function Hs(e) {
|
|
3744
|
+
return le(re(typeof e == "string" ? C(S(e), zs(e)) : e).at(-1)?.rule.declarations ?? []);
|
|
3700
3745
|
}
|
|
3701
|
-
function
|
|
3702
|
-
return
|
|
3746
|
+
function Us(e) {
|
|
3747
|
+
return ne(e);
|
|
3703
3748
|
}
|
|
3704
|
-
function
|
|
3705
|
-
let t =
|
|
3749
|
+
function Ws(e) {
|
|
3750
|
+
let t = Hs(e);
|
|
3706
3751
|
return {
|
|
3707
3752
|
options: t,
|
|
3708
|
-
declarations:
|
|
3753
|
+
declarations: Us(t)
|
|
3709
3754
|
};
|
|
3710
3755
|
}
|
|
3711
3756
|
//#endregion
|
|
3712
3757
|
//#region src/animation/compile/emit/backward/walk.ts
|
|
3713
|
-
function
|
|
3758
|
+
function Gs(e) {
|
|
3714
3759
|
let t = [];
|
|
3715
3760
|
for (let n of Object.keys(e.animations)) {
|
|
3716
|
-
let r = e.animations[n], i = r.layer.op, a =
|
|
3761
|
+
let r = e.animations[n], i = r.layer.op, a = G(r.layer) && r.layer.weightSpring != null, o = G(r.layer) && r.layer.weightSpring == null, s = i === "add" || i === "accumulate" ? i : o ? "accumulate" : "replace";
|
|
3717
3762
|
t.push({
|
|
3718
3763
|
animation: r.animation,
|
|
3719
|
-
name: J(
|
|
3764
|
+
name: J(H(r.animation)),
|
|
3720
3765
|
composition: s,
|
|
3721
3766
|
weightBlend: a,
|
|
3722
3767
|
...o ? { staticWeight: r.layer.weight } : {},
|
|
@@ -3725,21 +3770,21 @@ function Is(e) {
|
|
|
3725
3770
|
}
|
|
3726
3771
|
return t;
|
|
3727
3772
|
}
|
|
3728
|
-
function
|
|
3773
|
+
function Ks(e) {
|
|
3729
3774
|
return e.entries.map((e) => ({
|
|
3730
3775
|
animation: e.animation,
|
|
3731
|
-
name: J(
|
|
3776
|
+
name: J(H(e.animation)),
|
|
3732
3777
|
composition: "replace",
|
|
3733
3778
|
weightBlend: !1,
|
|
3734
3779
|
delay: e.at
|
|
3735
3780
|
}));
|
|
3736
3781
|
}
|
|
3737
|
-
function
|
|
3782
|
+
function qs(e) {
|
|
3738
3783
|
return e.map((e, t) => {
|
|
3739
3784
|
let n = "animation" in e ? e.animation : e;
|
|
3740
3785
|
return {
|
|
3741
3786
|
animation: n,
|
|
3742
|
-
name: J(
|
|
3787
|
+
name: J(H(n) || `anim-${t}`),
|
|
3743
3788
|
composition: "replace",
|
|
3744
3789
|
weightBlend: !1,
|
|
3745
3790
|
delay: 0
|
|
@@ -3752,30 +3797,30 @@ function J(e) {
|
|
|
3752
3797
|
}
|
|
3753
3798
|
//#endregion
|
|
3754
3799
|
//#region src/animation/compile/emit/easing-serialize.ts
|
|
3755
|
-
var
|
|
3756
|
-
function
|
|
3800
|
+
var Js = /^(linear|ease|ease-in|ease-out|ease-in-out|step-start|step-end)$/;
|
|
3801
|
+
function Ys(e, t = 32) {
|
|
3757
3802
|
return h(Array.from({ length: t + 1 }, (n, r) => e(r / t)));
|
|
3758
3803
|
}
|
|
3759
3804
|
function Y(e) {
|
|
3760
3805
|
if (e.css !== void 0) return e.css;
|
|
3761
|
-
let t =
|
|
3806
|
+
let t = de.find(([t, n]) => n === e.fn)?.[0];
|
|
3762
3807
|
if (t === void 0) throw new n("timingFunction", e.fn, "a custom TimingFunction has no CSS animation-timing-function representation — attach a faithful Easing.css twin, or use a registry name / cubic-bezier() / linear() literal");
|
|
3763
|
-
let r =
|
|
3764
|
-
return
|
|
3808
|
+
let r = k(t);
|
|
3809
|
+
return Js.test(r) ? r : Ys(e.fn);
|
|
3765
3810
|
}
|
|
3766
3811
|
//#endregion
|
|
3767
3812
|
//#region src/animation/compile/emit/format/options.ts
|
|
3768
|
-
function
|
|
3813
|
+
function Xs(e, t = "animation") {
|
|
3769
3814
|
let n = "";
|
|
3770
3815
|
n += ` animation-name: ${t};\n`;
|
|
3771
3816
|
let r = v(e.duration, e.durationUnit);
|
|
3772
3817
|
n += ` animation-duration: ${r};\n`, n += ` animation-timing-function: ${Y(e.timingFunction)};\n`, n += ` animation-iteration-count: ${isFinite(e.iterationCount) ? e.iterationCount : "infinite"};\n`, n += ` animation-direction: ${e.direction};\n`, n += ` animation-fill-mode: ${e.fillMode};\n`, e.delay > 0 && (n += ` animation-delay: ${v(e.delay, e.delayUnit)};\n`);
|
|
3773
|
-
let i = e.composite == null ? void 0 :
|
|
3818
|
+
let i = e.composite == null ? void 0 : Qs(e.composite);
|
|
3774
3819
|
return i != null && (n += ` ${i}\n`), n = `.${t} {\n${n}}\n`, n;
|
|
3775
3820
|
}
|
|
3776
|
-
function
|
|
3777
|
-
let n = Y(e.timingFunction), r =
|
|
3778
|
-
return
|
|
3821
|
+
function Zs(e, t) {
|
|
3822
|
+
let n = Y(e.timingFunction), r = C(ve(n), () => /* @__PURE__ */ TypeError(`Cannot serialize timing function ${JSON.stringify(n)}.`));
|
|
3823
|
+
return x({
|
|
3779
3824
|
name: t,
|
|
3780
3825
|
duration: e.duration,
|
|
3781
3826
|
...e.durationUnit == null ? {} : { durationUnit: e.durationUnit },
|
|
@@ -3789,14 +3834,14 @@ function Hs(e, t) {
|
|
|
3789
3834
|
} : {}
|
|
3790
3835
|
});
|
|
3791
3836
|
}
|
|
3792
|
-
function
|
|
3837
|
+
function Qs(e) {
|
|
3793
3838
|
return e === "replace" ? void 0 : `animation-composition: ${e};`;
|
|
3794
3839
|
}
|
|
3795
|
-
function
|
|
3840
|
+
function $s(e) {
|
|
3796
3841
|
let t = e.propertyRegistry;
|
|
3797
3842
|
if (t == null || t.size === 0) return "";
|
|
3798
3843
|
let n = [];
|
|
3799
|
-
for (let [e, r] of t) n.push(
|
|
3844
|
+
for (let [e, r] of t) n.push(ee({
|
|
3800
3845
|
kind: "property",
|
|
3801
3846
|
name: e,
|
|
3802
3847
|
descriptor: r
|
|
@@ -3805,9 +3850,9 @@ function Ws(e) {
|
|
|
3805
3850
|
}
|
|
3806
3851
|
//#endregion
|
|
3807
3852
|
//#region src/animation/compile/emit/format/format.ts
|
|
3808
|
-
function
|
|
3853
|
+
function ec(e, t, n) {
|
|
3809
3854
|
let r = e.parsedVars[t] ?? {}, i = e.templateFrames[t], a = Object.entries(r).map(([e, t]) => ({
|
|
3810
|
-
prop:
|
|
3855
|
+
prop: k(e),
|
|
3811
3856
|
value: y(t),
|
|
3812
3857
|
declared: t
|
|
3813
3858
|
})), o = i.timingFunction ? Y(i.timingFunction) : n;
|
|
@@ -3821,7 +3866,7 @@ function Gs(e, t, n) {
|
|
|
3821
3866
|
value: s
|
|
3822
3867
|
}), a;
|
|
3823
3868
|
}
|
|
3824
|
-
var
|
|
3869
|
+
var tc = (e, t) => {
|
|
3825
3870
|
if (e.kind === "scalar") return e.payload.type === "number" ? {
|
|
3826
3871
|
kind: "scalar",
|
|
3827
3872
|
payload: {
|
|
@@ -3830,96 +3875,96 @@ var Ks = (e, t) => {
|
|
|
3830
3875
|
}
|
|
3831
3876
|
} : void 0;
|
|
3832
3877
|
if (e.kind === "call") {
|
|
3833
|
-
let n = e.args.map((e) =>
|
|
3878
|
+
let n = e.args.map((e) => tc(e, t));
|
|
3834
3879
|
return n.some((e) => e === void 0) ? void 0 : {
|
|
3835
3880
|
kind: "call",
|
|
3836
3881
|
name: e.name,
|
|
3837
3882
|
args: n
|
|
3838
3883
|
};
|
|
3839
3884
|
}
|
|
3840
|
-
let n = e.items.map((e) =>
|
|
3885
|
+
let n = e.items.map((e) => tc(e, t));
|
|
3841
3886
|
if (!n.some((e) => e === void 0)) return {
|
|
3842
3887
|
kind: "list",
|
|
3843
3888
|
separator: e.separator,
|
|
3844
3889
|
items: n
|
|
3845
3890
|
};
|
|
3846
3891
|
};
|
|
3847
|
-
function
|
|
3848
|
-
return `{\n${
|
|
3892
|
+
function nc(e, t, n) {
|
|
3893
|
+
return `{\n${ec(e, t, n).map(({ prop: e, value: t }) => ` ${e}: ${t};`).join("\n")}\n}`;
|
|
3849
3894
|
}
|
|
3850
|
-
var
|
|
3895
|
+
var rc = async (e) => {
|
|
3851
3896
|
let t = Y(e.options.timingFunction);
|
|
3852
|
-
return e.templateFrames.map((n, r) => `${
|
|
3897
|
+
return e.templateFrames.map((n, r) => `${ye(n.start)}\n${nc(e, r, t)}\n`);
|
|
3853
3898
|
};
|
|
3854
|
-
function
|
|
3899
|
+
function ic(e) {
|
|
3855
3900
|
let t = e.indexOf("{"), n = t === -1 ? e : e.slice(t + 1), r = n.lastIndexOf("}");
|
|
3856
3901
|
return (r !== -1 && n.slice(r + 1).trim() === "" ? n.slice(0, r) : n).split("\n").map((e) => e.startsWith(" ") ? e.slice(2) : e).join("\n").trim();
|
|
3857
3902
|
}
|
|
3858
|
-
function
|
|
3903
|
+
function ac(e, t, n) {
|
|
3859
3904
|
let r = Y(e.options.timingFunction), i = /* @__PURE__ */ new Map();
|
|
3860
3905
|
e.templateFrames.forEach((t, a) => {
|
|
3861
|
-
let o = n?.get(a) ??
|
|
3906
|
+
let o = n?.get(a) ?? nc(e, a, r), s = i.get(o), c = ye(t.start);
|
|
3862
3907
|
s ? s.push(c) : i.set(o, [c]);
|
|
3863
3908
|
});
|
|
3864
3909
|
let a = "";
|
|
3865
3910
|
for (let [e, t] of i) a += ` ${t.join(", ")} ${e.replace(/\n/g, "\n ")}\n`;
|
|
3866
3911
|
return `@keyframes ${t} {\n${a}}`;
|
|
3867
3912
|
}
|
|
3868
|
-
function
|
|
3913
|
+
function oc(e, t, n) {
|
|
3869
3914
|
let r = Y(e.options.timingFunction), i = /* @__PURE__ */ new Map();
|
|
3870
3915
|
for (let t = 0; t < e.templateFrames.length; t++) {
|
|
3871
3916
|
let a = e.templateFrames[t], o = e.parsedVars[t] ?? {}, s = {};
|
|
3872
3917
|
for (let [e, t] of Object.entries(o)) {
|
|
3873
|
-
let r =
|
|
3918
|
+
let r = tc(t, n);
|
|
3874
3919
|
if (r === void 0) return {
|
|
3875
3920
|
refused: !0,
|
|
3876
3921
|
key: e
|
|
3877
3922
|
};
|
|
3878
3923
|
s[e] = r;
|
|
3879
3924
|
}
|
|
3880
|
-
let c = Object.entries(s).map(([e, t]) => ` ${
|
|
3925
|
+
let c = Object.entries(s).map(([e, t]) => ` ${k(e)}: ${y(t)};`), l = a.timingFunction ? Y(a.timingFunction) : r;
|
|
3881
3926
|
l !== r && c.push(` animation-timing-function: ${l};`);
|
|
3882
3927
|
let u = a.composition;
|
|
3883
3928
|
u != null && u !== "replace" && c.push(` animation-composition: ${u};`);
|
|
3884
|
-
let d = `{\n${c.join("\n")}\n}`, f = i.get(d), p =
|
|
3929
|
+
let d = `{\n${c.join("\n")}\n}`, f = i.get(d), p = ye(a.start);
|
|
3885
3930
|
f ? f.push(p) : i.set(d, [p]);
|
|
3886
3931
|
}
|
|
3887
3932
|
let a = "";
|
|
3888
3933
|
for (let [e, t] of i) a += ` ${t.join(", ")} ${e.replace(/\n/g, "\n ")}\n`;
|
|
3889
3934
|
return { block: `@keyframes ${t} {\n${a}}` };
|
|
3890
3935
|
}
|
|
3891
|
-
async function
|
|
3936
|
+
async function sc(e, t = "animation") {
|
|
3892
3937
|
let n = e.options, r = /* @__PURE__ */ new Map(), i = Y(n.timingFunction);
|
|
3893
3938
|
e.templateFrames.forEach((t, n) => {
|
|
3894
|
-
let a =
|
|
3939
|
+
let a = ye(t.start), o = nc(e, n, i);
|
|
3895
3940
|
r.has(o) ? r.get(o).push(a) : r.set(o, [a]);
|
|
3896
3941
|
});
|
|
3897
3942
|
let a = "";
|
|
3898
3943
|
for (let [e, t] of r) a += ` ${t.join(", ")} ${e.replace(/\n/g, "\n ")}\n`;
|
|
3899
|
-
let o =
|
|
3944
|
+
let o = Xs(n, t), s = $s(e);
|
|
3900
3945
|
return `${`${s ? `${s}\n\n` : ""}${o}\n@keyframes ${t} {\n${a}}`.replace(/\(\s*\{/g, "{").replace(/\}\s*\)/g, "}")}\n`;
|
|
3901
3946
|
}
|
|
3902
3947
|
//#endregion
|
|
3903
3948
|
//#region src/animation/compile/emit/densify.ts
|
|
3904
|
-
var
|
|
3949
|
+
var cc = (e) => {
|
|
3905
3950
|
if (e.kind === "percent") return e.value * 100;
|
|
3906
3951
|
throw TypeError(`Cannot densify named keyframe selector "${e.name}" without a bound timeline.`);
|
|
3907
3952
|
};
|
|
3908
|
-
function
|
|
3909
|
-
let i = e.parsedVars[t] ?? {}, a = Object.fromEntries(Object.entries(i).filter(([e]) => !r.has(e))), o = Object.entries(a).map(([e, t]) => `${
|
|
3953
|
+
function lc(e, t, n, r) {
|
|
3954
|
+
let i = e.parsedVars[t] ?? {}, a = Object.fromEntries(Object.entries(i).filter(([e]) => !r.has(e))), o = Object.entries(a).map(([e, t]) => `${k(e)}: ${y(t)};`), s = e.templateFrames[t], c = s.timingFunction ? Y(s.timingFunction) : n;
|
|
3910
3955
|
c !== n && o.push(`animation-timing-function: ${c};`);
|
|
3911
3956
|
let l = s.composition;
|
|
3912
3957
|
return l != null && l !== "replace" && o.push(`animation-composition: ${l};`), o;
|
|
3913
3958
|
}
|
|
3914
|
-
function
|
|
3959
|
+
function uc(e, t, n) {
|
|
3915
3960
|
let r = Y(e.options.timingFunction), i = new Set(n.keys), a = /* @__PURE__ */ new Map(), o = [], s = (e) => {
|
|
3916
3961
|
let t = a.get(e);
|
|
3917
3962
|
return t || (t = [], a.set(e, t), o.push(e)), t;
|
|
3918
3963
|
};
|
|
3919
3964
|
for (let [e, t] of n.byPct) s(e).push(...t);
|
|
3920
3965
|
e.templateFrames.forEach((t, n) => {
|
|
3921
|
-
let a =
|
|
3922
|
-
a.length > 0 && s(
|
|
3966
|
+
let a = lc(e, n, r, i);
|
|
3967
|
+
a.length > 0 && s(cc(t.start)).push(...a);
|
|
3923
3968
|
}), o.sort((e, t) => e - t);
|
|
3924
3969
|
let c = "";
|
|
3925
3970
|
for (let e of o) c += ` ${e}% {\n ${a.get(e).join("\n ")}\n }\n`;
|
|
@@ -3927,23 +3972,23 @@ function tc(e, t, n) {
|
|
|
3927
3972
|
}
|
|
3928
3973
|
//#endregion
|
|
3929
3974
|
//#region src/animation/compile/emit/backward/color.ts
|
|
3930
|
-
var X = (e) => Math.round(e * 1e4) / 1e4,
|
|
3975
|
+
var X = (e) => Math.round(e * 1e4) / 1e4, dc = (e) => {
|
|
3931
3976
|
if (typeof e != "object" || !e) return !1;
|
|
3932
3977
|
let t = e.kind;
|
|
3933
3978
|
return t === "scalar" || t === "call" || t === "list";
|
|
3934
|
-
},
|
|
3979
|
+
}, fc = (e) => {
|
|
3935
3980
|
if (e.kind === "scalar") return e.payload.type === "color" ? e.payload.value : void 0;
|
|
3936
3981
|
let t = e.kind === "call" ? e.args : e.items;
|
|
3937
3982
|
for (let e of t) {
|
|
3938
|
-
let t =
|
|
3983
|
+
let t = fc(e);
|
|
3939
3984
|
if (t !== void 0) return t;
|
|
3940
3985
|
}
|
|
3941
|
-
},
|
|
3942
|
-
let t =
|
|
3986
|
+
}, pc = (e) => dc(e) && fc(e) !== void 0, mc = (e) => {
|
|
3987
|
+
let t = Te(e, "oklab");
|
|
3943
3988
|
if (!t.ok) throw TypeError(`Value 4 color conversion failed: ${t.error.code}.`);
|
|
3944
3989
|
return t.value;
|
|
3945
3990
|
}, Z = (e) => {
|
|
3946
|
-
let [t, n, r] =
|
|
3991
|
+
let [t, n, r] = mc(e).channels;
|
|
3947
3992
|
if (typeof t != "number" || typeof n != "number" || typeof r != "number") throw TypeError("OKLab densification requires numeric channels.");
|
|
3948
3993
|
return [
|
|
3949
3994
|
t,
|
|
@@ -3951,28 +3996,28 @@ var X = (e) => Math.round(e * 1e4) / 1e4, nc = (e) => {
|
|
|
3951
3996
|
r
|
|
3952
3997
|
];
|
|
3953
3998
|
}, Q = (e) => {
|
|
3954
|
-
let t =
|
|
3999
|
+
let t = mc(e), [n, r, i] = Z(t), a = t.alpha === 1 ? "" : ` / ${t.alpha}`;
|
|
3955
4000
|
return `oklab(${X(n)} ${X(r)} ${X(i)}${a})`;
|
|
3956
|
-
},
|
|
4001
|
+
}, hc = (e, t) => {
|
|
3957
4002
|
let [n, r, i] = Z(e), [a, o, s] = Z(t);
|
|
3958
4003
|
return Math.hypot(a - n, o - r, s - i);
|
|
3959
|
-
},
|
|
3960
|
-
let r =
|
|
4004
|
+
}, gc = (e, t, n) => {
|
|
4005
|
+
let r = De(e, t, n);
|
|
3961
4006
|
if (!r.ok) throw TypeError(`Value 4 OKLab construction failed: ${r.error.code}.`);
|
|
3962
4007
|
return r.value;
|
|
3963
|
-
},
|
|
4008
|
+
}, _c = (e, t) => {
|
|
3964
4009
|
let [n, r, i] = Z(e), [a, o, s] = Z(t);
|
|
3965
|
-
return
|
|
3966
|
-
},
|
|
4010
|
+
return gc((n + a) / 2, (r + o) / 2, (i + s) / 2);
|
|
4011
|
+
}, vc = (e) => {
|
|
3967
4012
|
if (e.kind === "percent") return e.value * 100;
|
|
3968
4013
|
throw TypeError(`Cannot densify named keyframe selector "${e.name}" without a bound timeline.`);
|
|
3969
4014
|
}, $ = (e, t, n) => {
|
|
3970
4015
|
let r = (e.parsedVars[t] ?? {})[n];
|
|
3971
|
-
return r === void 0 ? void 0 :
|
|
3972
|
-
},
|
|
4016
|
+
return r === void 0 ? void 0 : fc(r);
|
|
4017
|
+
}, yc = (e, t, n, r, i) => {
|
|
3973
4018
|
let a = [];
|
|
3974
4019
|
for (let o = 0; o < n; o++) {
|
|
3975
|
-
let s =
|
|
4020
|
+
let s = Ee(e, t, n === 1 ? 0 : o / (n - 1), {
|
|
3976
4021
|
space: r,
|
|
3977
4022
|
...i === void 0 ? {} : { hue: i }
|
|
3978
4023
|
});
|
|
@@ -3981,12 +4026,12 @@ var X = (e) => Math.round(e * 1e4) / 1e4, nc = (e) => {
|
|
|
3981
4026
|
}
|
|
3982
4027
|
return a;
|
|
3983
4028
|
};
|
|
3984
|
-
function
|
|
4029
|
+
function bc(e, t, n, r, i) {
|
|
3985
4030
|
let a = t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), o = [], s = 0;
|
|
3986
4031
|
for (let a = 0; a + 1 < e.templateFrames.length; a++) {
|
|
3987
4032
|
let c = $(e, a, t), l = $(e, a + 1, t);
|
|
3988
4033
|
if (!c || !l) continue;
|
|
3989
|
-
let u =
|
|
4034
|
+
let u = vc(e.templateFrames[a].start), d = vc(e.templateFrames[a + 1].start);
|
|
3990
4035
|
if (Q(c) === Q(l)) {
|
|
3991
4036
|
o.push({
|
|
3992
4037
|
pct: u,
|
|
@@ -3994,7 +4039,7 @@ function dc(e, t, n, r, i) {
|
|
|
3994
4039
|
});
|
|
3995
4040
|
continue;
|
|
3996
4041
|
}
|
|
3997
|
-
let f = c, p = l, m =
|
|
4042
|
+
let f = c, p = l, m = yc(f, p, n, r, i.hueMethod);
|
|
3998
4043
|
for (let e = 0; e < m.length; e++) {
|
|
3999
4044
|
let t = e / (m.length - 1), n = u + (d - u) * t;
|
|
4000
4045
|
o.push({
|
|
@@ -4002,15 +4047,15 @@ function dc(e, t, n, r, i) {
|
|
|
4002
4047
|
css: Q(m[e])
|
|
4003
4048
|
});
|
|
4004
4049
|
}
|
|
4005
|
-
let h =
|
|
4050
|
+
let h = yc(f, p, 1024, r, i.hueMethod);
|
|
4006
4051
|
for (let e = 0; e + 1 < m.length; e++) {
|
|
4007
|
-
let t = (e + .5) / (m.length - 1), n = h[Math.round(t * 1023)], r =
|
|
4008
|
-
s = Math.max(s,
|
|
4052
|
+
let t = (e + .5) / (m.length - 1), n = h[Math.round(t * 1023)], r = _c(m[e], m[e + 1]);
|
|
4053
|
+
s = Math.max(s, hc(r, n));
|
|
4009
4054
|
}
|
|
4010
4055
|
}
|
|
4011
4056
|
let c = e.templateFrames.length - 1, l = $(e, c, t);
|
|
4012
4057
|
if (l) {
|
|
4013
|
-
let t =
|
|
4058
|
+
let t = vc(e.templateFrames[c].start);
|
|
4014
4059
|
o[o.length - 1]?.pct !== t && o.push({
|
|
4015
4060
|
pct: t,
|
|
4016
4061
|
css: Q(l)
|
|
@@ -4022,12 +4067,12 @@ function dc(e, t, n, r, i) {
|
|
|
4022
4067
|
worstDelta: s
|
|
4023
4068
|
};
|
|
4024
4069
|
}
|
|
4025
|
-
function
|
|
4070
|
+
function xc(e, t, n) {
|
|
4026
4071
|
let r = [], i = /* @__PURE__ */ new Set();
|
|
4027
4072
|
for (let t = 0; t + 1 < e.templateFrames.length; t++) {
|
|
4028
4073
|
let n = e.parsedVars[t] ?? {};
|
|
4029
4074
|
for (let [a, o] of Object.entries(n)) {
|
|
4030
|
-
if (i.has(a) || !
|
|
4075
|
+
if (i.has(a) || !pc(o)) continue;
|
|
4031
4076
|
let n = $(e, t, a), s = $(e, t + 1, a);
|
|
4032
4077
|
n && s && Q(n) !== Q(s) && (r.push(a), i.add(a));
|
|
4033
4078
|
}
|
|
@@ -4035,7 +4080,7 @@ function fc(e, t, n) {
|
|
|
4035
4080
|
if (r.length === 0) return null;
|
|
4036
4081
|
let a = Math.max(3, t), o = e.options.colorSpace === "oklch" ? "oklch" : "oklab", s = e.options.hueMethod ? { hueMethod: e.options.hueMethod } : {}, c = 0, l = /* @__PURE__ */ new Map();
|
|
4037
4082
|
for (let t of r) {
|
|
4038
|
-
let n =
|
|
4083
|
+
let n = bc(e, t, a, o, s);
|
|
4039
4084
|
c = Math.max(c, n.worstDelta);
|
|
4040
4085
|
for (let { pct: e, css: t } of n.stops) {
|
|
4041
4086
|
let r = l.get(e);
|
|
@@ -4052,7 +4097,7 @@ function fc(e, t, n) {
|
|
|
4052
4097
|
}
|
|
4053
4098
|
//#endregion
|
|
4054
4099
|
//#region src/animation/compile/emit/refusal-probes.ts
|
|
4055
|
-
function
|
|
4100
|
+
function Sc(e) {
|
|
4056
4101
|
let { animation: t, name: n } = e;
|
|
4057
4102
|
if (e.weightBlend) return {
|
|
4058
4103
|
name: n,
|
|
@@ -4073,10 +4118,10 @@ function pc(e) {
|
|
|
4073
4118
|
};
|
|
4074
4119
|
}
|
|
4075
4120
|
}
|
|
4076
|
-
function
|
|
4077
|
-
let { animation: i, name: a } = e, o =
|
|
4121
|
+
function Cc(e, t, r) {
|
|
4122
|
+
let { animation: i, name: a } = e, o = Sc(e);
|
|
4078
4123
|
if (o) return r.push(o), null;
|
|
4079
|
-
let s =
|
|
4124
|
+
let s = xc(i, t.densifyStops ?? 16, t.deltaEEpsilon ?? .04);
|
|
4080
4125
|
if (s && "refused" in s) return r.push({
|
|
4081
4126
|
name: a,
|
|
4082
4127
|
reason: "perceptual-oklab",
|
|
@@ -4084,7 +4129,7 @@ function mc(e, t, r) {
|
|
|
4084
4129
|
}), null;
|
|
4085
4130
|
let c;
|
|
4086
4131
|
if (e.staticWeight != null) {
|
|
4087
|
-
let t =
|
|
4132
|
+
let t = oc(i, a, e.staticWeight);
|
|
4088
4133
|
if ("refused" in t) return r.push({
|
|
4089
4134
|
name: a,
|
|
4090
4135
|
reason: "weight-blend",
|
|
@@ -4094,7 +4139,7 @@ function mc(e, t, r) {
|
|
|
4094
4139
|
}
|
|
4095
4140
|
let l, u;
|
|
4096
4141
|
try {
|
|
4097
|
-
l = c ?? (s && "byPct" in s ?
|
|
4142
|
+
l = c ?? (s && "byPct" in s ? uc(i, a, s) : ac(i, a)), u = Zs(i.options, a);
|
|
4098
4143
|
} catch (e) {
|
|
4099
4144
|
if (!(e instanceof n) || e.option !== "timingFunction") throw e;
|
|
4100
4145
|
return r.push({
|
|
@@ -4103,18 +4148,18 @@ function mc(e, t, r) {
|
|
|
4103
4148
|
message: "easing has no faithful CSS timing-function twin (a custom closure cannot be CSS) — attach an Easing.css twin or use a registry name / cubic-bezier() / linear(); the JS playback is the only faithful path"
|
|
4104
4149
|
}), null;
|
|
4105
4150
|
}
|
|
4106
|
-
let d =
|
|
4151
|
+
let d = Qs(e.composition), f = d ? `\n ${d}` : "", p = e.delay > 0 ? `\n animation-delay: ${v(e.delay)};` : "", m = wc(i), h = `${t.selectorFor ? t.selectorFor(a) : `.${a}`} {\n animation: ${u};${f}${p}${m}\n}`;
|
|
4107
4152
|
return `${l}\n\n${h}`;
|
|
4108
4153
|
}
|
|
4109
|
-
function
|
|
4154
|
+
function wc(e) {
|
|
4110
4155
|
let t = e.scrollOptions;
|
|
4111
4156
|
if (t == null) return "";
|
|
4112
|
-
let n =
|
|
4157
|
+
let n = Us(t), r = "";
|
|
4113
4158
|
for (let [e, t] of Object.entries(n)) t != null && (r += `\n ${e}: ${t};`);
|
|
4114
4159
|
return r;
|
|
4115
4160
|
}
|
|
4116
|
-
async function
|
|
4117
|
-
let n = e instanceof
|
|
4161
|
+
async function Tc(e, t = {}) {
|
|
4162
|
+
let n = e instanceof ca ? Gs(e) : e instanceof m ? Ks(e) : qs(e), r = /* @__PURE__ */ new Map();
|
|
4118
4163
|
for (let e of n) {
|
|
4119
4164
|
let t = r.get(e.name) ?? 0;
|
|
4120
4165
|
r.set(e.name, t + 1), t > 0 && (e.name = `${e.name}-${t + 1}`);
|
|
@@ -4125,7 +4170,7 @@ async function gc(e, t = {}) {
|
|
|
4125
4170
|
});
|
|
4126
4171
|
let i = [], a = [];
|
|
4127
4172
|
for (let e of n) {
|
|
4128
|
-
let n =
|
|
4173
|
+
let n = Cc(e, t, i);
|
|
4129
4174
|
n && a.push(n);
|
|
4130
4175
|
}
|
|
4131
4176
|
let o = i.length === 0;
|
|
@@ -4141,14 +4186,14 @@ async function gc(e, t = {}) {
|
|
|
4141
4186
|
}
|
|
4142
4187
|
//#endregion
|
|
4143
4188
|
//#region src/animation/compile/emit/view-transition.ts
|
|
4144
|
-
var
|
|
4189
|
+
var Ec = new Set([
|
|
4145
4190
|
"transform",
|
|
4146
4191
|
"opacity",
|
|
4147
4192
|
"filter",
|
|
4148
4193
|
"backdrop-filter",
|
|
4149
4194
|
"mix-blend-mode",
|
|
4150
4195
|
"clip-path"
|
|
4151
|
-
]),
|
|
4196
|
+
]), Dc = new Set([
|
|
4152
4197
|
"cqw",
|
|
4153
4198
|
"cqh",
|
|
4154
4199
|
"cqi",
|
|
@@ -4156,31 +4201,31 @@ var _c = new Set([
|
|
|
4156
4201
|
"cqmin",
|
|
4157
4202
|
"cqmax"
|
|
4158
4203
|
]);
|
|
4159
|
-
function
|
|
4204
|
+
function Oc(e) {
|
|
4160
4205
|
let t = Y(e.options.timingFunction), n = [];
|
|
4161
|
-
for (let r = 0; r < e.templateFrames.length; r++) n.push(...
|
|
4206
|
+
for (let r = 0; r < e.templateFrames.length; r++) n.push(...ec(e, r, t));
|
|
4162
4207
|
return n;
|
|
4163
4208
|
}
|
|
4164
|
-
var
|
|
4209
|
+
var kc = (e) => {
|
|
4165
4210
|
if (e == null) return null;
|
|
4166
4211
|
if (e.kind === "call") {
|
|
4167
4212
|
if (e.name.toLowerCase() === "var") return "var";
|
|
4168
4213
|
for (let t of e.args) {
|
|
4169
|
-
let e =
|
|
4214
|
+
let e = kc(t);
|
|
4170
4215
|
if (e != null) return e;
|
|
4171
4216
|
}
|
|
4172
4217
|
return null;
|
|
4173
4218
|
}
|
|
4174
4219
|
if (e.kind === "list") {
|
|
4175
4220
|
for (let t of e.items) {
|
|
4176
|
-
let e =
|
|
4221
|
+
let e = kc(t);
|
|
4177
4222
|
if (e != null) return e;
|
|
4178
4223
|
}
|
|
4179
4224
|
return null;
|
|
4180
4225
|
}
|
|
4181
|
-
return e.payload.type === "number" &&
|
|
4182
|
-
},
|
|
4183
|
-
function
|
|
4226
|
+
return e.payload.type === "number" && Dc.has(e.payload.unit.toLowerCase()) ? "cq" : null;
|
|
4227
|
+
}, Ac = (e) => e.split(".")[0].replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
4228
|
+
function jc(e, t, n, r, i, a) {
|
|
4184
4229
|
let o = [], s = `${t}-${e}`;
|
|
4185
4230
|
if (r.scrollOptions != null) return o.push({
|
|
4186
4231
|
name: s,
|
|
@@ -4190,8 +4235,8 @@ function Sc(e, t, n, r, i, a) {
|
|
|
4190
4235
|
chunk: null,
|
|
4191
4236
|
refusals: o
|
|
4192
4237
|
};
|
|
4193
|
-
for (let { prop: t, declared: n } of
|
|
4194
|
-
let r =
|
|
4238
|
+
for (let { prop: t, declared: n } of Oc(r)) {
|
|
4239
|
+
let r = kc(n);
|
|
4195
4240
|
if (r != null) return o.push({
|
|
4196
4241
|
name: s,
|
|
4197
4242
|
reason: "vt-element-scoped-computed",
|
|
@@ -4200,7 +4245,7 @@ function Sc(e, t, n, r, i, a) {
|
|
|
4200
4245
|
chunk: null,
|
|
4201
4246
|
refusals: o
|
|
4202
4247
|
};
|
|
4203
|
-
if (!
|
|
4248
|
+
if (!Ec.has(Ac(t))) return o.push({
|
|
4204
4249
|
name: s,
|
|
4205
4250
|
reason: "vt-snapshot-inapplicable",
|
|
4206
4251
|
message: `"${t}" does not apply to a replaced-content ::view-transition-${e} snapshot (only transform/opacity/filter/mix-blend-mode animate there) — refused per property, never silently dropped`
|
|
@@ -4215,7 +4260,7 @@ function Sc(e, t, n, r, i, a) {
|
|
|
4215
4260
|
composition: "replace",
|
|
4216
4261
|
weightBlend: !1,
|
|
4217
4262
|
delay: 0
|
|
4218
|
-
}, u = [], d =
|
|
4263
|
+
}, u = [], d = Cc(l, {
|
|
4219
4264
|
...a.densifyStops == null ? {} : { densifyStops: a.densifyStops },
|
|
4220
4265
|
...a.deltaEEpsilon == null ? {} : { deltaEEpsilon: a.deltaEEpsilon },
|
|
4221
4266
|
selectorFor: () => c
|
|
@@ -4226,7 +4271,7 @@ function Sc(e, t, n, r, i, a) {
|
|
|
4226
4271
|
refusals: o
|
|
4227
4272
|
};
|
|
4228
4273
|
}
|
|
4229
|
-
function
|
|
4274
|
+
function Mc(e) {
|
|
4230
4275
|
let t = e.group;
|
|
4231
4276
|
if (t != null) return "options" in t && "templateFrames" in t ? {
|
|
4232
4277
|
duration: t.options.duration,
|
|
@@ -4243,7 +4288,7 @@ function Cc(e) {
|
|
|
4243
4288
|
easing: Y(n.options.timingFunction)
|
|
4244
4289
|
};
|
|
4245
4290
|
}
|
|
4246
|
-
async function
|
|
4291
|
+
async function Nc(e, t = {}) {
|
|
4247
4292
|
let n = [], r = [], i = [], a = t.types, o = a && a.length > 0 ? `:root:active-view-transition-type(${a.join(", ")})` : "", s = t.emitGroup ?? !0, c = /* @__PURE__ */ new Map();
|
|
4248
4293
|
for (let t of Object.keys(e)) {
|
|
4249
4294
|
let e = J(t), n = c.get(e);
|
|
@@ -4262,12 +4307,12 @@ async function wc(e, t = {}) {
|
|
|
4262
4307
|
for (let i of ["old", "new"]) {
|
|
4263
4308
|
let a = c[i];
|
|
4264
4309
|
if (a == null) continue;
|
|
4265
|
-
let { chunk: s, refusals: l } =
|
|
4310
|
+
let { chunk: s, refusals: l } = jc(i, e, u, a, o, t);
|
|
4266
4311
|
for (let e of l) n.push(e);
|
|
4267
4312
|
s && r.push(s);
|
|
4268
4313
|
}
|
|
4269
4314
|
if (s && (c.old != null || c.new != null || c.group != null)) {
|
|
4270
|
-
let e =
|
|
4315
|
+
let e = Mc(c);
|
|
4271
4316
|
e != null && r.push(`${o}::view-transition-group(${u}) {\n animation-duration: ${v(e.duration, e.durationUnit)};\n animation-timing-function: ${e.easing};\n}`);
|
|
4272
4317
|
}
|
|
4273
4318
|
}
|
|
@@ -4287,10 +4332,10 @@ async function wc(e, t = {}) {
|
|
|
4287
4332
|
}
|
|
4288
4333
|
//#endregion
|
|
4289
4334
|
//#region src/animation/compile/emit/entry.ts
|
|
4290
|
-
var
|
|
4335
|
+
var Pc = (e) => e.kind === "scalar" ? e.payload.type === "color" : (e.kind === "call" ? e.args : e.items).some(Pc), Fc = (e) => {
|
|
4291
4336
|
if (e.kind === "scalar") {
|
|
4292
4337
|
if (e.payload.type !== "color") return e;
|
|
4293
|
-
let t =
|
|
4338
|
+
let t = Te(e.payload.value, "oklab");
|
|
4294
4339
|
if (!t.ok) throw TypeError(`Value 4 color conversion failed: ${t.error.code}.`);
|
|
4295
4340
|
return {
|
|
4296
4341
|
kind: "scalar",
|
|
@@ -4303,42 +4348,42 @@ var Tc = (e) => e.kind === "scalar" ? e.payload.type === "color" : (e.kind === "
|
|
|
4303
4348
|
return e.kind === "call" ? {
|
|
4304
4349
|
kind: "call",
|
|
4305
4350
|
name: e.name,
|
|
4306
|
-
args: e.args.map(
|
|
4351
|
+
args: e.args.map(Fc)
|
|
4307
4352
|
} : {
|
|
4308
4353
|
kind: "list",
|
|
4309
4354
|
separator: e.separator,
|
|
4310
|
-
items: e.items.map(
|
|
4355
|
+
items: e.items.map(Fc)
|
|
4311
4356
|
};
|
|
4312
4357
|
};
|
|
4313
|
-
function
|
|
4358
|
+
function Ic(e, t) {
|
|
4314
4359
|
let n = e.parsedVars[t] ?? {}, r = [];
|
|
4315
4360
|
for (let [e, t] of Object.entries(n)) {
|
|
4316
|
-
let n =
|
|
4361
|
+
let n = k(e);
|
|
4317
4362
|
r.push({
|
|
4318
4363
|
prop: n,
|
|
4319
|
-
value: y(
|
|
4364
|
+
value: y(Fc(t))
|
|
4320
4365
|
});
|
|
4321
4366
|
}
|
|
4322
4367
|
return r;
|
|
4323
4368
|
}
|
|
4324
|
-
function
|
|
4369
|
+
function Lc(e) {
|
|
4325
4370
|
let t = e.templateFrames.length;
|
|
4326
4371
|
return e.options.direction === "reverse" ? [t - 1, 0] : [0, t - 1];
|
|
4327
4372
|
}
|
|
4328
|
-
function
|
|
4373
|
+
function Rc(e) {
|
|
4329
4374
|
for (let t = 0; t < e.templateFrames.length; t++) {
|
|
4330
4375
|
let n = e.parsedVars[t] ?? {};
|
|
4331
|
-
for (let e of Object.values(n)) if (
|
|
4376
|
+
for (let e of Object.values(n)) if (Pc(e)) return !0;
|
|
4332
4377
|
}
|
|
4333
4378
|
return !1;
|
|
4334
4379
|
}
|
|
4335
|
-
function
|
|
4380
|
+
function zc(e) {
|
|
4336
4381
|
for (let t = 0; t < e.templateFrames.length; t++) {
|
|
4337
4382
|
let n = e.parsedVars[t] ?? {};
|
|
4338
4383
|
for (let [e, t] of Object.entries(n)) if (t.kind === "list" && t.items.length === 0) return e;
|
|
4339
4384
|
}
|
|
4340
4385
|
}
|
|
4341
|
-
function
|
|
4386
|
+
function Bc(e) {
|
|
4342
4387
|
let t = e.options;
|
|
4343
4388
|
if (e.templateFrames.length > 2) return {
|
|
4344
4389
|
reason: "entry-multi-keyframe",
|
|
@@ -4357,11 +4402,11 @@ function jc(e) {
|
|
|
4357
4402
|
reason: "entry-scroll-grammar",
|
|
4358
4403
|
detail: "scroll grammar has no transition twin — the JS ScrollScene driver is the only faithful path"
|
|
4359
4404
|
};
|
|
4360
|
-
if ((t.colorSpace === "oklch" || t.hueMethod != null) &&
|
|
4405
|
+
if ((t.colorSpace === "oklch" || t.hueMethod != null) && Rc(e)) return {
|
|
4361
4406
|
reason: "entry-color-space",
|
|
4362
4407
|
detail: `colorSpace=${t.colorSpace}${t.hueMethod ? `, hueMethod=${t.hueMethod}` : ""} — transitions expose no interpolation-space control; native Oklab is the default feature (only non-default spaces refuse)`
|
|
4363
4408
|
};
|
|
4364
|
-
let i =
|
|
4409
|
+
let i = zc(e);
|
|
4365
4410
|
if (i != null) return {
|
|
4366
4411
|
reason: "computed-unit-drift",
|
|
4367
4412
|
detail: `"${i}" has an empty declared value — it cannot be re-emitted as a faithful transition endpoint`
|
|
@@ -4379,7 +4424,7 @@ function jc(e) {
|
|
|
4379
4424
|
};
|
|
4380
4425
|
}
|
|
4381
4426
|
}
|
|
4382
|
-
var
|
|
4427
|
+
var Vc = {
|
|
4383
4428
|
"custom-renderer": "custom renderer — the JS playback is the only faithful path",
|
|
4384
4429
|
"weight-blend": "layer weight has no transition twin",
|
|
4385
4430
|
"computed-unit-drift": "computed-unit drift — the endpoint cannot be re-emitted faithfully",
|
|
@@ -4390,42 +4435,42 @@ var Mc = {
|
|
|
4390
4435
|
"entry-color-space": "a non-default color space (oklch/hueMethod) — transitions expose no space control",
|
|
4391
4436
|
"entry-easing-twin": "the easing has no faithful CSS timing-function twin"
|
|
4392
4437
|
};
|
|
4393
|
-
function
|
|
4438
|
+
function Hc(e, t) {
|
|
4394
4439
|
let n = /* @__PURE__ */ new Set();
|
|
4395
4440
|
for (let t of e) n.add(t.prop);
|
|
4396
4441
|
for (let e of t) n.add(e.prop);
|
|
4397
4442
|
return [...n];
|
|
4398
4443
|
}
|
|
4399
|
-
function
|
|
4444
|
+
function Uc(e, t, n, r) {
|
|
4400
4445
|
let i = e.filter((e) => e !== "display" && e !== "overlay").map((e) => `${e} ${t} ${n}`);
|
|
4401
4446
|
return i.push(`display ${t} allow-discrete`), r && i.push(`overlay ${t} allow-discrete`), i.join(", ");
|
|
4402
4447
|
}
|
|
4403
|
-
var
|
|
4404
|
-
async function
|
|
4448
|
+
var Wc = (e, t) => [...e.map((e) => ` ${e.prop}: ${e.value};`), ...t].join("\n");
|
|
4449
|
+
async function Gc(e, t = {}) {
|
|
4405
4450
|
let n = t.openSelector ?? ".open", r = t.display ?? "block", i = t.overlay ?? !0, a = [], o = [];
|
|
4406
4451
|
for (let [t, s] of Object.entries(e)) {
|
|
4407
4452
|
let e = s.enter;
|
|
4408
4453
|
if (e == null) continue;
|
|
4409
4454
|
let c = s.exit ? [e, s.exit] : [e], l = !1;
|
|
4410
4455
|
for (let e of c) {
|
|
4411
|
-
let n =
|
|
4456
|
+
let n = Bc(e);
|
|
4412
4457
|
if (n) {
|
|
4413
4458
|
a.push({
|
|
4414
4459
|
name: t,
|
|
4415
4460
|
reason: n.reason,
|
|
4416
|
-
message: `${
|
|
4461
|
+
message: `${Vc[n.reason]} — ${n.detail}`
|
|
4417
4462
|
}), l = !0;
|
|
4418
4463
|
break;
|
|
4419
4464
|
}
|
|
4420
4465
|
}
|
|
4421
4466
|
if (l) continue;
|
|
4422
|
-
let [u, d] =
|
|
4467
|
+
let [u, d] = Lc(e), f = Ic(e, u), p = Ic(e, d), m = Hc(f, p), h = v(e.options.duration, e.options.durationUnit), g = Y(e.options.timingFunction), _, y, b, x;
|
|
4423
4468
|
if (s.exit) {
|
|
4424
|
-
let [, e] =
|
|
4425
|
-
_ =
|
|
4426
|
-
} else _ = f, y = m, b = h,
|
|
4427
|
-
let
|
|
4428
|
-
o.push(`${
|
|
4469
|
+
let [, e] = Lc(s.exit), t = Lc(s.exit)[0];
|
|
4470
|
+
_ = Ic(s.exit, e), y = Hc(Ic(s.exit, t), _), b = v(s.exit.options.duration, s.exit.options.durationUnit), x = Y(s.exit.options.timingFunction);
|
|
4471
|
+
} else _ = f, y = m, b = h, x = g;
|
|
4472
|
+
let ee = `${t}${n}`, S = `${t} {\n${Wc(_, [" display: none;", ` transition: ${Uc(y, b, x, i)};`])}\n}`, te = `${ee} {\n${Wc(p, [` display: ${r};`, ` transition: ${Uc(m, h, g, i)};`])}\n}`, ne = `@starting-style {\n ${ee} {\n${Wc(f, []).split("\n").map((e) => ` ${e}`).join("\n")}\n }\n}`;
|
|
4473
|
+
o.push(`${S}\n\n${te}\n\n${ne}`);
|
|
4429
4474
|
}
|
|
4430
4475
|
let s = a.length === 0;
|
|
4431
4476
|
return o.length === 0 ? {
|
|
@@ -4440,9 +4485,9 @@ async function Ic(e, t = {}) {
|
|
|
4440
4485
|
}
|
|
4441
4486
|
//#endregion
|
|
4442
4487
|
//#region src/animation/validate.ts
|
|
4443
|
-
var
|
|
4444
|
-
async function
|
|
4445
|
-
let n =
|
|
4488
|
+
var Kc = (e) => new U().fromString(e);
|
|
4489
|
+
async function qc(e, t = {}) {
|
|
4490
|
+
let n = Kc(e), r = [...n.diagnostics], i = r.some((e) => e.code === "EMPTY_PARSE"), a = e.trim().length > 0 && !i, o = await Tc([n], t.compile ?? {}), s = P(n);
|
|
4446
4491
|
return {
|
|
4447
4492
|
parseable: a,
|
|
4448
4493
|
eligible: o.eligible,
|
|
@@ -4451,9 +4496,9 @@ async function Rc(e, t = {}) {
|
|
|
4451
4496
|
waapi: s
|
|
4452
4497
|
};
|
|
4453
4498
|
}
|
|
4454
|
-
var
|
|
4455
|
-
async function
|
|
4456
|
-
let n = await
|
|
4499
|
+
var Jc = (e) => be(() => S(e), (e) => [...new Set(fe(e).map(({ rule: e }) => e.name))], []);
|
|
4500
|
+
async function Yc(e, t = {}) {
|
|
4501
|
+
let n = await qc(e, t), r = Jc(e), i = r.length > 0 ? r.join(", ") : "(no @keyframes block)", a = [];
|
|
4457
4502
|
a.push(`@keyframes ${i}:`), a.push(` parseable: ${n.parseable ? "yes" : "no"}`), a.push(` compile-eligible: ${n.eligible ? "yes" : "no"}`);
|
|
4458
4503
|
for (let e of n.refusals) a.push(` – ${e.reason}: ${e.message}`);
|
|
4459
4504
|
if (a.push(` waapi-eligible: ${n.waapi.eligible ? "yes" : "no"}`), n.waapi.eligible || a.push(` – ${n.waapi.reason}`), n.diagnostics.length > 0) {
|
|
@@ -4463,4 +4508,4 @@ async function Bc(e, t = {}) {
|
|
|
4463
4508
|
return a.join("\n");
|
|
4464
4509
|
}
|
|
4465
4510
|
//#endregion
|
|
4466
|
-
export {
|
|
4511
|
+
export { ca as AnimationGroup, U as CSSKeyframesAnimation, sc as CSSKeyframesToString, rc as CSSKeyframesToStrings, Ne as DIRECTIONS, ha as DrawSVG, Pe as FILL_MODES, ni as KeyframesAnimation, wa as MorphSVG, fa as MotionPath, Os as ScrollScene, Ns as TriggerScene, Ss as adoptRunning, Tc as compileToCSS, Gc as compileToEntry, Nc as compileToViewTransition, ks as createScrollScene, Ps as createTriggerScene, J as cssIdent, Le as defaultLayerConfig, D as defaultOptions, As as dispatchScrollBackend, Rs as driveScrollCSS, Yc as explain, ic as formatCSSKeyframeString, ma as fromDrawSVG, bs as fromLiveAnimations, Ca as fromMorphSVG, da as fromMotionPath, ys as fromStyleSheets, H as getAnimationId, Hs as parseScrollCSS, Vs as parseScrollRange, Bs as parseScrollTimeline, js as pinCSS, us as presets, li as resolveKeyframes, vs as resolveLiveKeyframes, Ds as resolveRange, ge as resolveTimingFunction, v as reverseCSSTime, Ws as roundTripScrollCSS, Us as serializeScrollOptions, b as serializeTimingFunction, Ms as supportsNativeTrigger, de as timingFunctionEntries, Ot as transformTargetsStyle, qc as validate, Ki as yieldToMain };
|