@mkbabb/value.js 0.10.0 → 0.11.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/LICENSE +1 -1
- package/README.md +9 -9
- package/dist/index.d.ts +4 -3
- package/dist/math.d.ts +16 -0
- package/dist/parsing/utils.d.ts +14 -0
- package/dist/units/color/dispatch.d.ts +0 -1
- package/dist/units/color/index.d.ts +2 -1
- package/dist/units/index.d.ts +32 -0
- package/dist/units/interpolate.d.ts +24 -1
- package/dist/units/normalize.d.ts +10 -0
- package/dist/value.js +1197 -1072
- package/package.json +5 -15
- package/scripts/migrate-keyframes-js-lerp.mjs +0 -257
package/dist/value.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { Parser as e, all as t, any as n,
|
|
2
|
-
var
|
|
3
|
-
function
|
|
4
|
-
return
|
|
1
|
+
import { Parser as e, all as t, any as n, dispatch as r, regex as i, string as a, whitespace as o } from "@mkbabb/parse-that";
|
|
2
|
+
var s = 1e3 / 60, c = (e) => !!e && e.constructor === Object;
|
|
3
|
+
function l(e) {
|
|
4
|
+
return c(e) ? Object.entries(e).map(([e, t]) => [e, l(t)]).reduce((e, [t, n]) => (e[t] = n, e), {}) : e != null && typeof e.clone == "function" ? e.clone() : Array.isArray(e) ? e.map(l) : e;
|
|
5
5
|
}
|
|
6
|
-
var
|
|
6
|
+
var u = (e, t) => {
|
|
7
7
|
if (!e || !t || e.length !== t.length) return !1;
|
|
8
8
|
for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
|
|
9
9
|
return !0;
|
|
10
10
|
};
|
|
11
|
-
async function
|
|
11
|
+
async function d(e) {
|
|
12
12
|
return await new Promise((t) => setTimeout(t, e));
|
|
13
13
|
}
|
|
14
|
-
async function
|
|
14
|
+
async function f(e, t = s) {
|
|
15
15
|
return await new Promise((n) => {
|
|
16
16
|
let r = setInterval(() => {
|
|
17
17
|
if (e()) return clearInterval(r), n();
|
|
18
18
|
}, t);
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function p(e, t = 100, n = !1) {
|
|
22
22
|
let r = null, i = function(...i) {
|
|
23
23
|
let a = this, o = function() {
|
|
24
24
|
r = null, n || e.apply(a, i);
|
|
@@ -29,46 +29,46 @@ function f(e, t = 100, n = !1) {
|
|
|
29
29
|
r &&= (clearTimeout(r), null);
|
|
30
30
|
}, i;
|
|
31
31
|
}
|
|
32
|
-
async function
|
|
32
|
+
async function m(e, t) {
|
|
33
33
|
let n = new TextEncoder().encode(t), r = await crypto.subtle.digest(e, n);
|
|
34
34
|
return Array.from(new Uint8Array(r)).map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
let n = /* @__PURE__ */ new Map(), { maxCacheSize: r = Infinity, ttl: i = Infinity, keyFn: a = JSON.stringify, shouldCache: o } = t, s = function(...t) {
|
|
38
|
-
let
|
|
39
|
-
if (n.has(
|
|
40
|
-
let e = n.get(
|
|
41
|
-
if (
|
|
42
|
-
n.delete(
|
|
36
|
+
function h(e, t = {}) {
|
|
37
|
+
let n = /* @__PURE__ */ new Map(), { maxCacheSize: r = Infinity, ttl: i = Infinity, keyFn: a = JSON.stringify, shouldCache: o } = t, s = i !== Infinity, c = function(...t) {
|
|
38
|
+
let c = a.apply(this, t);
|
|
39
|
+
if (n.has(c)) {
|
|
40
|
+
let e = n.get(c);
|
|
41
|
+
if (!s || Date.now() - e.timestamp <= i) return e.value;
|
|
42
|
+
n.delete(c);
|
|
43
43
|
}
|
|
44
44
|
let l = e.apply(this, t);
|
|
45
|
-
if ((!o || o(l, ...t)) && (n.set(
|
|
45
|
+
if ((!o || o(l, ...t)) && (n.set(c, {
|
|
46
46
|
value: l,
|
|
47
|
-
timestamp:
|
|
47
|
+
timestamp: s ? Date.now() : 0
|
|
48
48
|
}), n.size > r)) {
|
|
49
49
|
let e = n.keys().next().value;
|
|
50
50
|
n.delete(e);
|
|
51
51
|
}
|
|
52
52
|
return l;
|
|
53
53
|
};
|
|
54
|
-
return
|
|
54
|
+
return c.cache = n, c;
|
|
55
55
|
}
|
|
56
|
-
var
|
|
57
|
-
function
|
|
56
|
+
var g = (e) => e.replace(/([-_][a-z])/gi, (e) => e.toUpperCase().replace("-", "").replace("_", ""));
|
|
57
|
+
function _(e) {
|
|
58
58
|
return e.replace(/([A-Z])/g, (e) => `-${e[0].toLowerCase()}`);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function ee(e, t, n) {
|
|
61
61
|
for (let r = e - 1; r >= 0; r--) if (n(t[r])) return r;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function te(e) {
|
|
64
64
|
if (typeof window < "u" && window.requestAnimationFrame) return window.requestAnimationFrame(e);
|
|
65
|
-
let t =
|
|
65
|
+
let t = s, n = Date.now();
|
|
66
66
|
return setTimeout(() => {
|
|
67
67
|
let r = Date.now(), i = r - n;
|
|
68
|
-
n = r, t = Math.max(0,
|
|
68
|
+
n = r, t = Math.max(0, s - i), e(r);
|
|
69
69
|
}, t);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function ne(e) {
|
|
72
72
|
if (typeof window < "u" && window.cancelAnimationFrame) return window.cancelAnimationFrame(e);
|
|
73
73
|
clearTimeout(e);
|
|
74
74
|
}
|
|
@@ -83,41 +83,46 @@ function y(e, t, n, r = 0, i = 1) {
|
|
|
83
83
|
function b(e, t, n) {
|
|
84
84
|
return (1 - n) * e + n * t;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function re(e, t, n, r) {
|
|
87
|
+
let i = e.length, a = 1 - n;
|
|
88
|
+
for (let o = 0; o < i; o++) r[o] = a * e[o] + n * t[o];
|
|
89
|
+
return r;
|
|
90
|
+
}
|
|
91
|
+
function ie(e, t, n) {
|
|
87
92
|
return t = t === 0 ? 1e-9 : t, t * (n / t) ** +e;
|
|
88
93
|
}
|
|
89
|
-
function
|
|
94
|
+
function ae(e, t) {
|
|
90
95
|
let n = t.length - 1, r = [...t];
|
|
91
96
|
for (let t = 1; t <= n; t++) for (let i = 0; i <= n - t; i++) r[i] = b(r[i], r[i + 1], e);
|
|
92
97
|
return r[0];
|
|
93
98
|
}
|
|
94
|
-
function
|
|
95
|
-
return [
|
|
99
|
+
function oe(e, t, n, r, i) {
|
|
100
|
+
return [ae(e, [
|
|
96
101
|
0,
|
|
97
102
|
t,
|
|
98
103
|
r,
|
|
99
104
|
1
|
|
100
|
-
]),
|
|
105
|
+
]), ae(e, [
|
|
101
106
|
0,
|
|
102
107
|
n,
|
|
103
108
|
i,
|
|
104
109
|
1
|
|
105
110
|
])];
|
|
106
111
|
}
|
|
107
|
-
function
|
|
112
|
+
function se(e, t) {
|
|
108
113
|
let n = t.map((e) => e[0]), r = t.map((e) => e[1]);
|
|
109
|
-
return [
|
|
114
|
+
return [ae(e, n), ae(e, r)];
|
|
110
115
|
}
|
|
111
|
-
function
|
|
116
|
+
function ce(e, t, n, r) {
|
|
112
117
|
let i = "M0 0";
|
|
113
118
|
`${e}${t}${n}${r}`;
|
|
114
119
|
for (let a = 0; a <= 1; a += .001) {
|
|
115
|
-
let [o, s] =
|
|
120
|
+
let [o, s] = oe(a, e, t, n, r);
|
|
116
121
|
i += ` L${o} ${s}`;
|
|
117
122
|
}
|
|
118
123
|
return `<path d="${i}"/>`;
|
|
119
124
|
}
|
|
120
|
-
function
|
|
125
|
+
function le(e, t, n, r) {
|
|
121
126
|
let i = (e) => e.toFixed(2);
|
|
122
127
|
return `cubic-bezier(${i(e)}, ${i(t)}, ${i(n)}, ${i(r)})`;
|
|
123
128
|
}
|
|
@@ -129,7 +134,7 @@ function x(e, t) {
|
|
|
129
134
|
t[6] * n + t[7] * r + t[8] * i
|
|
130
135
|
];
|
|
131
136
|
}
|
|
132
|
-
function
|
|
137
|
+
function ue(e) {
|
|
133
138
|
return [
|
|
134
139
|
e[0],
|
|
135
140
|
e[3],
|
|
@@ -142,7 +147,7 @@ function ce(e) {
|
|
|
142
147
|
e[8]
|
|
143
148
|
];
|
|
144
149
|
}
|
|
145
|
-
function
|
|
150
|
+
function de(e, t) {
|
|
146
151
|
return [
|
|
147
152
|
e[0] * t[0] + e[1] * t[3] + e[2] * t[6],
|
|
148
153
|
e[0] * t[1] + e[1] * t[4] + e[2] * t[7],
|
|
@@ -169,7 +174,7 @@ function S(e) {
|
|
|
169
174
|
(t * a - n * i) * p
|
|
170
175
|
];
|
|
171
176
|
}
|
|
172
|
-
var
|
|
177
|
+
var fe = 255, C = {
|
|
173
178
|
"%": {
|
|
174
179
|
min: 0,
|
|
175
180
|
max: 100
|
|
@@ -178,7 +183,7 @@ var ue = 255, C = {
|
|
|
178
183
|
min: 0,
|
|
179
184
|
max: 1
|
|
180
185
|
}
|
|
181
|
-
},
|
|
186
|
+
}, pe = {
|
|
182
187
|
"%": C["%"],
|
|
183
188
|
number: {
|
|
184
189
|
min: 0,
|
|
@@ -187,7 +192,7 @@ var ue = 255, C = {
|
|
|
187
192
|
}, w = {
|
|
188
193
|
"%": C["%"],
|
|
189
194
|
number: C.number
|
|
190
|
-
},
|
|
195
|
+
}, me = {
|
|
191
196
|
deg: {
|
|
192
197
|
min: 0,
|
|
193
198
|
max: 360
|
|
@@ -197,15 +202,15 @@ var ue = 255, C = {
|
|
|
197
202
|
max: 360
|
|
198
203
|
},
|
|
199
204
|
"%": C["%"]
|
|
200
|
-
},
|
|
205
|
+
}, T = {
|
|
201
206
|
rgb: {
|
|
202
|
-
r:
|
|
203
|
-
g:
|
|
204
|
-
b:
|
|
207
|
+
r: pe,
|
|
208
|
+
g: pe,
|
|
209
|
+
b: pe,
|
|
205
210
|
alpha: C
|
|
206
211
|
},
|
|
207
212
|
hsl: {
|
|
208
|
-
h:
|
|
213
|
+
h: me,
|
|
209
214
|
s: {
|
|
210
215
|
"%": C["%"],
|
|
211
216
|
number: C.number
|
|
@@ -217,7 +222,7 @@ var ue = 255, C = {
|
|
|
217
222
|
alpha: C
|
|
218
223
|
},
|
|
219
224
|
hsv: {
|
|
220
|
-
h:
|
|
225
|
+
h: me,
|
|
221
226
|
s: {
|
|
222
227
|
"%": C["%"],
|
|
223
228
|
number: C.number
|
|
@@ -229,7 +234,7 @@ var ue = 255, C = {
|
|
|
229
234
|
alpha: C
|
|
230
235
|
},
|
|
231
236
|
hwb: {
|
|
232
|
-
h:
|
|
237
|
+
h: me,
|
|
233
238
|
w: {
|
|
234
239
|
"%": C["%"],
|
|
235
240
|
number: C.number
|
|
@@ -279,7 +284,7 @@ var ue = 255, C = {
|
|
|
279
284
|
},
|
|
280
285
|
"%": C["%"]
|
|
281
286
|
},
|
|
282
|
-
h:
|
|
287
|
+
h: me,
|
|
283
288
|
alpha: C
|
|
284
289
|
},
|
|
285
290
|
oklab: {
|
|
@@ -321,7 +326,7 @@ var ue = 255, C = {
|
|
|
321
326
|
},
|
|
322
327
|
"%": C["%"]
|
|
323
328
|
},
|
|
324
|
-
h:
|
|
329
|
+
h: me,
|
|
325
330
|
alpha: C
|
|
326
331
|
},
|
|
327
332
|
xyz: {
|
|
@@ -376,7 +381,7 @@ var ue = 255, C = {
|
|
|
376
381
|
b: w,
|
|
377
382
|
alpha: C
|
|
378
383
|
}
|
|
379
|
-
},
|
|
384
|
+
}, he = "%", ge = {
|
|
380
385
|
rgb: {
|
|
381
386
|
r: "",
|
|
382
387
|
g: "",
|
|
@@ -465,10 +470,10 @@ var ue = 255, C = {
|
|
|
465
470
|
b: "",
|
|
466
471
|
alpha: "%"
|
|
467
472
|
}
|
|
468
|
-
},
|
|
469
|
-
let r =
|
|
473
|
+
}, _e = (e, t, n) => {
|
|
474
|
+
let r = T[e][t] ?? {};
|
|
470
475
|
return r[n] ?? r.number;
|
|
471
|
-
},
|
|
476
|
+
}, ve = (e, t) => ge[e][t] ?? "", ye = {
|
|
472
477
|
rgb: "RGB",
|
|
473
478
|
hsl: "HSL",
|
|
474
479
|
hsv: "HSV",
|
|
@@ -484,15 +489,15 @@ var ue = 255, C = {
|
|
|
484
489
|
"a98-rgb": "Adobe RGB",
|
|
485
490
|
"prophoto-rgb": "ProPhoto RGB",
|
|
486
491
|
rec2020: "Rec. 2020"
|
|
487
|
-
},
|
|
492
|
+
}, be = [
|
|
488
493
|
.3127 / .329,
|
|
489
494
|
1,
|
|
490
495
|
.3583 / .329
|
|
491
|
-
],
|
|
496
|
+
], xe = [
|
|
492
497
|
.3457 / .3585,
|
|
493
498
|
1,
|
|
494
499
|
.2958 / .3585
|
|
495
|
-
],
|
|
500
|
+
], Se = [
|
|
496
501
|
1.0479297925449969,
|
|
497
502
|
.022946870601609652,
|
|
498
503
|
-.05019226628920524,
|
|
@@ -502,10 +507,10 @@ var ue = 255, C = {
|
|
|
502
507
|
-.009243040646204504,
|
|
503
508
|
.015055191490298152,
|
|
504
509
|
.7518742814281371
|
|
505
|
-
],
|
|
506
|
-
D65:
|
|
507
|
-
D50:
|
|
508
|
-
},
|
|
510
|
+
], Ce = S(Se), we = {
|
|
511
|
+
D65: be,
|
|
512
|
+
D50: xe
|
|
513
|
+
}, Te = [
|
|
509
514
|
.819022437996703,
|
|
510
515
|
.3619062600528904,
|
|
511
516
|
-.1288737815209879,
|
|
@@ -515,7 +520,7 @@ var ue = 255, C = {
|
|
|
515
520
|
.0481771893596242,
|
|
516
521
|
.2642395317527308,
|
|
517
522
|
.6335478284694309
|
|
518
|
-
],
|
|
523
|
+
], Ee = S(Te), E = [
|
|
519
524
|
.210454268309314,
|
|
520
525
|
.7936177747023054,
|
|
521
526
|
-.0040720430116193,
|
|
@@ -525,7 +530,7 @@ var ue = 255, C = {
|
|
|
525
530
|
.0259040424655478,
|
|
526
531
|
.7827717124575296,
|
|
527
532
|
-.8086757549230774
|
|
528
|
-
],
|
|
533
|
+
], De = S(E), D = [
|
|
529
534
|
4.0767416621,
|
|
530
535
|
-3.3077115913,
|
|
531
536
|
.2309699292,
|
|
@@ -535,7 +540,7 @@ var ue = 255, C = {
|
|
|
535
540
|
-.0041960863,
|
|
536
541
|
-.7034186147,
|
|
537
542
|
1.707614701
|
|
538
|
-
],
|
|
543
|
+
], O = [
|
|
539
544
|
.4122214708,
|
|
540
545
|
.5363325363,
|
|
541
546
|
.0514459929,
|
|
@@ -545,7 +550,7 @@ var ue = 255, C = {
|
|
|
545
550
|
.0883024619,
|
|
546
551
|
.2817188376,
|
|
547
552
|
.6299787005
|
|
548
|
-
],
|
|
553
|
+
], k = {
|
|
549
554
|
l: [
|
|
550
555
|
1,
|
|
551
556
|
.3963377774,
|
|
@@ -561,7 +566,7 @@ var ue = 255, C = {
|
|
|
561
566
|
-.0894841775,
|
|
562
567
|
-1.291485548
|
|
563
568
|
]
|
|
564
|
-
},
|
|
569
|
+
}, Oe = [
|
|
565
570
|
{
|
|
566
571
|
test: (e, t) => -1.88170328 * e - .80936493 * t > 1,
|
|
567
572
|
k0: 1.19086277,
|
|
@@ -595,7 +600,7 @@ var ue = 255, C = {
|
|
|
595
600
|
wm: -.7034186147,
|
|
596
601
|
ws: 1.707614701
|
|
597
602
|
}
|
|
598
|
-
],
|
|
603
|
+
], ke = {
|
|
599
604
|
aliceblue: "#f0f8ff",
|
|
600
605
|
antiquewhite: "#faebd7",
|
|
601
606
|
aqua: "#00ffff",
|
|
@@ -752,99 +757,99 @@ var ue = 255, C = {
|
|
|
752
757
|
patriarchalplum: "oklch(31.20% 0.11 19.80deg / 100%)",
|
|
753
758
|
winterwind: "oklch(21.80% 0.28 210.96deg / 82.70%)",
|
|
754
759
|
blackwellberry: "oklch(53.60% 0.35 267.12deg / 100%)"
|
|
755
|
-
},
|
|
756
|
-
function
|
|
760
|
+
}, Ae = 2.4, je = .055, Me = 12.92, Ne = .04045 / Me;
|
|
761
|
+
function Pe(e) {
|
|
757
762
|
let t = e < 0 ? -1 : 1, n = e * t;
|
|
758
|
-
return n <=
|
|
763
|
+
return n <= Ne ? e / Me : t * ((n + je) / (1 + je)) ** Ae;
|
|
759
764
|
}
|
|
760
|
-
function
|
|
765
|
+
function Fe(e) {
|
|
761
766
|
let t = e < 0 ? -1 : 1, n = e * t;
|
|
762
|
-
return n <=
|
|
767
|
+
return n <= Ne ? e * Me : t * ((1 + je) * n ** (1 / Ae) - je);
|
|
763
768
|
}
|
|
764
|
-
function
|
|
769
|
+
function Ie(e, t, n) {
|
|
765
770
|
return Math.min(Math.max(e, t), n);
|
|
766
771
|
}
|
|
767
|
-
var
|
|
768
|
-
function
|
|
772
|
+
var Le = .02;
|
|
773
|
+
function Re(e, t, n, r, i, a) {
|
|
769
774
|
let o = e - r, s = t - i, c = n - a;
|
|
770
775
|
return Math.sqrt(o * o + s * s + c * c);
|
|
771
776
|
}
|
|
772
|
-
function
|
|
773
|
-
let r = e +
|
|
777
|
+
function ze(e, t, n) {
|
|
778
|
+
let r = e + k.l[1] * t + k.l[2] * n, i = e + k.m[1] * t + k.m[2] * n, a = e + k.s[1] * t + k.s[2] * n, o = r * r * r, s = i * i * i, c = a * a * a;
|
|
774
779
|
return [
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
780
|
+
D[0] * o + D[1] * s + D[2] * c,
|
|
781
|
+
D[3] * o + D[4] * s + D[5] * c,
|
|
782
|
+
D[6] * o + D[7] * s + D[8] * c
|
|
778
783
|
];
|
|
779
784
|
}
|
|
780
|
-
function
|
|
785
|
+
function Be(e, t, n) {
|
|
781
786
|
return e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1;
|
|
782
787
|
}
|
|
783
|
-
function
|
|
784
|
-
let { k0: n, k1: r, k2: i, k3: a, k4: o, wl: s, wm: c, ws: l } =
|
|
788
|
+
function Ve(e, t) {
|
|
789
|
+
let { k0: n, k1: r, k2: i, k3: a, k4: o, wl: s, wm: c, ws: l } = Oe.find((n) => n.test(e, t)), u = n + r * e + i * t + a * e * e + o * e * t, d = k.l[1] * e + k.l[2] * t, f = k.m[1] * e + k.m[2] * t, p = k.s[1] * e + k.s[2] * t;
|
|
785
790
|
{
|
|
786
|
-
let e = 1 + u * d, t = 1 + u * f, n = 1 + u * p, r = e * e * e, i = t * t * t, a = n * n * n, o = 3 * d * e * e, m = 3 * f * t * t, h = 3 * p * n * n, g = 6 * d * d * e, _ = 6 * f * f * t, ee = 6 * p * p * n, te = s * r + c * i + l * a,
|
|
787
|
-
u -= te *
|
|
791
|
+
let e = 1 + u * d, t = 1 + u * f, n = 1 + u * p, r = e * e * e, i = t * t * t, a = n * n * n, o = 3 * d * e * e, m = 3 * f * t * t, h = 3 * p * n * n, g = 6 * d * d * e, _ = 6 * f * f * t, ee = 6 * p * p * n, te = s * r + c * i + l * a, ne = s * o + c * m + l * h, v = s * g + c * _ + l * ee;
|
|
792
|
+
u -= te * ne / (ne * ne - .5 * te * v);
|
|
788
793
|
}
|
|
789
794
|
return u;
|
|
790
795
|
}
|
|
791
|
-
function
|
|
792
|
-
let n =
|
|
796
|
+
function He(e, t) {
|
|
797
|
+
let n = Ve(e, t), [r, i, a] = ze(1, n * e, n * t), o = Math.cbrt(1 / Math.max(r, i, a));
|
|
793
798
|
return {
|
|
794
799
|
L: o,
|
|
795
800
|
C: o * n
|
|
796
801
|
};
|
|
797
802
|
}
|
|
798
|
-
function
|
|
803
|
+
function Ue(e, t, n, r, i, a) {
|
|
799
804
|
let o;
|
|
800
805
|
if ((n - i) * a.C - (a.L - i) * r <= 0) o = a.C * i / (r * a.L + a.C * (i - n));
|
|
801
806
|
else {
|
|
802
807
|
o = a.C * (i - 1) / (r * (a.L - 1) + a.C * (i - n));
|
|
803
|
-
let s = n - i, c = r, l =
|
|
808
|
+
let s = n - i, c = r, l = k.l[1] * e + k.l[2] * t, u = k.m[1] * e + k.m[2] * t, d = k.s[1] * e + k.s[2] * t, f = s + c * l, p = s + c * u, m = s + c * d;
|
|
804
809
|
{
|
|
805
|
-
let e = i * (1 - o) + o * n, t = o * r, a = e + t * l, s = e + t * u, c = e + t * d, h = a * a * a, g = s * s * s, _ = c * c * c, ee = 3 * f * a * a, te = 3 * p * s * s,
|
|
806
|
-
se = oe >= 0 ? se : Infinity,
|
|
810
|
+
let e = i * (1 - o) + o * n, t = o * r, a = e + t * l, s = e + t * u, c = e + t * d, h = a * a * a, g = s * s * s, _ = c * c * c, ee = 3 * f * a * a, te = 3 * p * s * s, ne = 3 * m * c * c, v = 6 * f * f * a, y = 6 * p * p * s, b = 6 * m * m * c, re = D[0] * h + D[1] * g + D[2] * _ - 1, ie = D[0] * ee + D[1] * te + D[2] * ne, ae = D[0] * v + D[1] * y + D[2] * b, oe = ie / (ie * ie - .5 * re * ae), se = -re * oe, ce = D[3] * h + D[4] * g + D[5] * _ - 1, le = D[3] * ee + D[4] * te + D[5] * ne, x = D[3] * v + D[4] * y + D[5] * b, ue = le / (le * le - .5 * ce * x), de = -ce * ue, S = D[6] * h + D[7] * g + D[8] * _ - 1, fe = D[6] * ee + D[7] * te + D[8] * ne, C = D[6] * v + D[7] * y + D[8] * b, pe = fe / (fe * fe - .5 * S * C), w = -S * pe;
|
|
811
|
+
se = oe >= 0 ? se : Infinity, de = ue >= 0 ? de : Infinity, w = pe >= 0 ? w : Infinity, o += Math.min(se, de, w);
|
|
807
812
|
}
|
|
808
813
|
}
|
|
809
814
|
return o;
|
|
810
815
|
}
|
|
811
|
-
var
|
|
812
|
-
function
|
|
813
|
-
let [r, i, a] =
|
|
814
|
-
if (
|
|
816
|
+
var We = 1e-5, Ge = .05;
|
|
817
|
+
function Ke(e, t, n) {
|
|
818
|
+
let [r, i, a] = ze(e, t, n);
|
|
819
|
+
if (Be(r, i, a)) return [
|
|
815
820
|
e,
|
|
816
821
|
t,
|
|
817
822
|
n
|
|
818
823
|
];
|
|
819
|
-
let o = Math.max(
|
|
824
|
+
let o = Math.max(We, Math.sqrt(t * t + n * n)), s = t / o, c = n / o, l = He(s, c), u = e - .5, d = .5 + Math.abs(u) + Ge * o, f = .5 * (1 + Math.sign(u) * (d - Math.sqrt(d * d - 2 * Math.abs(u)))), p = Ue(s, c, e, o, f, l), m = f * (1 - p) + p * e, h = p * o;
|
|
820
825
|
return [
|
|
821
826
|
m,
|
|
822
827
|
h * s,
|
|
823
828
|
h * c
|
|
824
829
|
];
|
|
825
830
|
}
|
|
826
|
-
function
|
|
827
|
-
let r =
|
|
831
|
+
function qe(e, t, n) {
|
|
832
|
+
let r = Pe(e), i = Pe(t), a = Pe(n), o = Math.cbrt(O[0] * r + O[1] * i + O[2] * a), s = Math.cbrt(O[3] * r + O[4] * i + O[5] * a), c = Math.cbrt(O[6] * r + O[7] * i + O[8] * a);
|
|
828
833
|
return [
|
|
829
834
|
.2104542553 * o + .793617785 * s - .0040720468 * c,
|
|
830
835
|
1.9779984951 * o - 2.428592205 * s + .4505937099 * c,
|
|
831
836
|
.0259040371 * o + .7827717662 * s - .808675766 * c
|
|
832
837
|
];
|
|
833
838
|
}
|
|
834
|
-
function
|
|
839
|
+
function Je(e, t, n) {
|
|
835
840
|
if (e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1) return [
|
|
836
841
|
e,
|
|
837
842
|
t,
|
|
838
843
|
n
|
|
839
844
|
];
|
|
840
|
-
let [r, i, a] =
|
|
845
|
+
let [r, i, a] = qe(e, t, n), [o, s, c] = Ke(r, i, a), [l, u, d] = ze(o, s, c);
|
|
841
846
|
return [
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
847
|
+
Ie(Fe(l), 0, 1),
|
|
848
|
+
Ie(Fe(u), 0, 1),
|
|
849
|
+
Ie(Fe(d), 0, 1)
|
|
845
850
|
];
|
|
846
851
|
}
|
|
847
|
-
function
|
|
852
|
+
function Ye(e, t, n) {
|
|
848
853
|
let r = Math.sqrt(t * t + n * n), i = 180 / Math.PI * Math.atan2(n, t);
|
|
849
854
|
return i < 0 && (i += 360), [
|
|
850
855
|
e,
|
|
@@ -852,7 +857,7 @@ function Ke(e, t, n) {
|
|
|
852
857
|
i
|
|
853
858
|
];
|
|
854
859
|
}
|
|
855
|
-
function
|
|
860
|
+
function Xe(e, t, n) {
|
|
856
861
|
let r = n * Math.PI / 180;
|
|
857
862
|
return [
|
|
858
863
|
e,
|
|
@@ -860,49 +865,49 @@ function qe(e, t, n) {
|
|
|
860
865
|
t * Math.sin(r)
|
|
861
866
|
];
|
|
862
867
|
}
|
|
863
|
-
function
|
|
864
|
-
let [r, i, a] =
|
|
868
|
+
function Ze(e, t, n) {
|
|
869
|
+
let [r, i, a] = ze(e, t, n);
|
|
865
870
|
return [
|
|
866
|
-
Math.round(
|
|
867
|
-
Math.round(
|
|
868
|
-
Math.round(
|
|
871
|
+
Math.round(Ie(Fe(r), 0, 1) * 255),
|
|
872
|
+
Math.round(Ie(Fe(i), 0, 1) * 255),
|
|
873
|
+
Math.round(Ie(Fe(a), 0, 1) * 255)
|
|
869
874
|
];
|
|
870
875
|
}
|
|
871
|
-
var
|
|
876
|
+
var A = 16, Qe = (e) => (e = e.slice(1), e.length <= 4 ? new L(parseInt(e[0] + e[0], A), parseInt(e[1] + e[1], A), parseInt(e[2] + e[2], A), e[3] ? parseInt(e[3] + e[3], A) / 255 : 1) : new L(parseInt(e.slice(0, 2), A), parseInt(e.slice(2, 4), A), parseInt(e.slice(4, 6), A), e.length === 8 ? parseInt(e.slice(6, 8), A) / 255 : 1)), $e = 2.4, et = .055, tt = 12.92, nt = .04045 / tt;
|
|
872
877
|
function j(e) {
|
|
873
878
|
let t = e < 0 ? -1 : 1, n = e * t;
|
|
874
|
-
return n <=
|
|
879
|
+
return n <= nt ? e / tt : t * ((n + et) / (1 + et)) ** $e;
|
|
875
880
|
}
|
|
876
881
|
function M(e) {
|
|
877
882
|
let t = e < 0 ? -1 : 1, n = e * t;
|
|
878
|
-
return n <=
|
|
883
|
+
return n <= nt ? e * tt : t * ((1 + et) * n ** (1 / $e) - et);
|
|
879
884
|
}
|
|
880
|
-
var
|
|
881
|
-
function
|
|
882
|
-
return (e < 0 ? -1 : 1) * Math.abs(e) **
|
|
885
|
+
var rt = (e) => e, it = 563 / 256;
|
|
886
|
+
function at(e) {
|
|
887
|
+
return (e < 0 ? -1 : 1) * Math.abs(e) ** it;
|
|
883
888
|
}
|
|
884
|
-
function
|
|
885
|
-
return (e < 0 ? -1 : 1) * Math.abs(e) ** (1 /
|
|
889
|
+
function ot(e) {
|
|
890
|
+
return (e < 0 ? -1 : 1) * Math.abs(e) ** (1 / it);
|
|
886
891
|
}
|
|
887
|
-
var
|
|
888
|
-
function
|
|
892
|
+
var st = 1 / 512, ct = 1.8;
|
|
893
|
+
function lt(e) {
|
|
889
894
|
let t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
890
|
-
return t * (n <=
|
|
895
|
+
return t * (n <= st * 16 ? n / 16 : n ** ct);
|
|
891
896
|
}
|
|
892
|
-
function
|
|
897
|
+
function ut(e) {
|
|
893
898
|
let t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
894
|
-
return t * (n >=
|
|
899
|
+
return t * (n >= st ? n ** (1 / ct) : n * 16);
|
|
895
900
|
}
|
|
896
|
-
var
|
|
897
|
-
function
|
|
901
|
+
var dt = 1.09929682680944, ft = .018053968510807;
|
|
902
|
+
function pt(e) {
|
|
898
903
|
let t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
899
|
-
return n <
|
|
904
|
+
return n < ft * 4.5 ? t * n / 4.5 : t * ((n + dt - 1) / dt) ** (1 / .45);
|
|
900
905
|
}
|
|
901
|
-
function
|
|
906
|
+
function mt(e) {
|
|
902
907
|
let t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
903
|
-
return n >=
|
|
908
|
+
return n >= ft ? t * (dt * n ** .45 - (dt - 1)) : t * 4.5 * n;
|
|
904
909
|
}
|
|
905
|
-
var
|
|
910
|
+
var ht = [
|
|
906
911
|
.41239079926595934,
|
|
907
912
|
.357584339383878,
|
|
908
913
|
.1804807884018343,
|
|
@@ -912,26 +917,26 @@ var pt = [
|
|
|
912
917
|
.01933081871559182,
|
|
913
918
|
.11919477979462598,
|
|
914
919
|
.9505321522496607
|
|
915
|
-
],
|
|
916
|
-
function
|
|
920
|
+
], gt = S(ht);
|
|
921
|
+
function _t({ r: e, g: t, b: n, alpha: r }) {
|
|
917
922
|
let [i, a, o] = x([
|
|
918
923
|
j(e),
|
|
919
924
|
j(t),
|
|
920
925
|
j(n)
|
|
921
|
-
],
|
|
922
|
-
return new
|
|
926
|
+
], ht);
|
|
927
|
+
return new R(i, a, o, r);
|
|
923
928
|
}
|
|
924
|
-
var
|
|
929
|
+
var vt = ({ x: e, y: t, z: n, alpha: r }, i = !0) => {
|
|
925
930
|
let a = x([
|
|
926
931
|
e,
|
|
927
932
|
t,
|
|
928
933
|
n
|
|
929
|
-
],
|
|
934
|
+
], gt), o = M(a[0]), s = M(a[1]), c = M(a[2]);
|
|
930
935
|
if (i) {
|
|
931
|
-
let e =
|
|
932
|
-
return new
|
|
933
|
-
} else return new
|
|
934
|
-
},
|
|
936
|
+
let e = Bn(new L(o, s, c, r));
|
|
937
|
+
return new L(e.r, e.g, e.b, r);
|
|
938
|
+
} else return new L(o, s, c, r);
|
|
939
|
+
}, yt = [
|
|
935
940
|
.4865709486482162,
|
|
936
941
|
.26566769316909306,
|
|
937
942
|
.1982172852343625,
|
|
@@ -941,7 +946,7 @@ var gt = ({ x: e, y: t, z: n, alpha: r }, i = !0) => {
|
|
|
941
946
|
0,
|
|
942
947
|
.04511338185890264,
|
|
943
948
|
1.043944368900976
|
|
944
|
-
],
|
|
949
|
+
], bt = S(yt), xt = [
|
|
945
950
|
.5766690429101305,
|
|
946
951
|
.1855582379065463,
|
|
947
952
|
.1882286462349947,
|
|
@@ -951,7 +956,7 @@ var gt = ({ x: e, y: t, z: n, alpha: r }, i = !0) => {
|
|
|
951
956
|
.02703136138641234,
|
|
952
957
|
.07068885253582723,
|
|
953
958
|
.9913375368376388
|
|
954
|
-
],
|
|
959
|
+
], St = S(xt), Ct = [
|
|
955
960
|
.7977604896723027,
|
|
956
961
|
.13518583717574031,
|
|
957
962
|
.0313493495815248,
|
|
@@ -961,7 +966,7 @@ var gt = ({ x: e, y: t, z: n, alpha: r }, i = !0) => {
|
|
|
961
966
|
0,
|
|
962
967
|
0,
|
|
963
968
|
.8251046025104602
|
|
964
|
-
],
|
|
969
|
+
], wt = S(Ct), Tt = [
|
|
965
970
|
.6369580483012914,
|
|
966
971
|
.14461690358620832,
|
|
967
972
|
.1688809751641721,
|
|
@@ -971,16 +976,16 @@ var gt = ({ x: e, y: t, z: n, alpha: r }, i = !0) => {
|
|
|
971
976
|
0,
|
|
972
977
|
.028072693049087428,
|
|
973
978
|
1.0609850577107909
|
|
974
|
-
],
|
|
975
|
-
function
|
|
979
|
+
], Et = S(Tt);
|
|
980
|
+
function Dt({ r: e, g: t, b: n, alpha: r }, i, a) {
|
|
976
981
|
let [o, s, c] = x([
|
|
977
982
|
i(e),
|
|
978
983
|
i(t),
|
|
979
984
|
i(n)
|
|
980
985
|
], a);
|
|
981
|
-
return new
|
|
986
|
+
return new R(o, s, c, r);
|
|
982
987
|
}
|
|
983
|
-
function
|
|
988
|
+
function Ot({ x: e, y: t, z: n, alpha: r }, i, a, o) {
|
|
984
989
|
let s = x([
|
|
985
990
|
e,
|
|
986
991
|
t,
|
|
@@ -988,51 +993,51 @@ function Et({ x: e, y: t, z: n, alpha: r }, i, a, o) {
|
|
|
988
993
|
], i);
|
|
989
994
|
return o(a(s[0]), a(s[1]), a(s[2]), r);
|
|
990
995
|
}
|
|
991
|
-
function Dt(e) {
|
|
992
|
-
return Tt(e, tt, pt);
|
|
993
|
-
}
|
|
994
|
-
function Ot(e) {
|
|
995
|
-
return Et(e, mt, tt, (e, t, n, r) => new Sr(e, t, n, r));
|
|
996
|
-
}
|
|
997
996
|
function kt(e) {
|
|
998
|
-
return
|
|
997
|
+
return Dt(e, rt, ht);
|
|
999
998
|
}
|
|
1000
999
|
function At(e) {
|
|
1001
|
-
return
|
|
1000
|
+
return Ot(e, gt, rt, (e, t, n, r) => new Cr(e, t, n, r));
|
|
1002
1001
|
}
|
|
1003
1002
|
function jt(e) {
|
|
1004
|
-
return
|
|
1003
|
+
return Dt(e, j, yt);
|
|
1005
1004
|
}
|
|
1006
1005
|
function Mt(e) {
|
|
1007
|
-
return
|
|
1006
|
+
return Ot(e, bt, M, (e, t, n, r) => new wr(e, t, n, r));
|
|
1007
|
+
}
|
|
1008
|
+
function Nt(e) {
|
|
1009
|
+
return Dt(e, at, xt);
|
|
1008
1010
|
}
|
|
1009
|
-
function
|
|
1011
|
+
function Pt(e) {
|
|
1012
|
+
return Ot(e, St, ot, (e, t, n, r) => new Tr(e, t, n, r));
|
|
1013
|
+
}
|
|
1014
|
+
function Ft({ r: e, g: t, b: n, alpha: r }) {
|
|
1010
1015
|
let [i, a, o] = x(x([
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
],
|
|
1015
|
-
return new
|
|
1016
|
+
lt(e),
|
|
1017
|
+
lt(t),
|
|
1018
|
+
lt(n)
|
|
1019
|
+
], Ct), Ce);
|
|
1020
|
+
return new R(i, a, o, r);
|
|
1016
1021
|
}
|
|
1017
|
-
function
|
|
1022
|
+
function It({ x: e, y: t, z: n, alpha: r }) {
|
|
1018
1023
|
let i = x(x([
|
|
1019
1024
|
e,
|
|
1020
1025
|
t,
|
|
1021
1026
|
n
|
|
1022
|
-
],
|
|
1023
|
-
return new
|
|
1027
|
+
], Se), wt);
|
|
1028
|
+
return new Er(ut(i[0]), ut(i[1]), ut(i[2]), r);
|
|
1024
1029
|
}
|
|
1025
|
-
function
|
|
1026
|
-
return
|
|
1030
|
+
function Lt(e) {
|
|
1031
|
+
return Dt(e, pt, Tt);
|
|
1027
1032
|
}
|
|
1028
|
-
function
|
|
1029
|
-
return
|
|
1033
|
+
function Rt(e) {
|
|
1034
|
+
return Ot(e, Et, mt, (e, t, n, r) => new Dr(e, t, n, r));
|
|
1030
1035
|
}
|
|
1031
|
-
var
|
|
1032
|
-
e = P(v(e,
|
|
1036
|
+
var zt = 1e3, Bt = 4e4, Vt = 100, Ht = ({ kelvin: e, alpha: t }) => {
|
|
1037
|
+
e = P(v(e, zt, Bt) / Vt);
|
|
1033
1038
|
let n, r, i;
|
|
1034
|
-
return e <= 66 ? n = 255 : (n = e - 60, n = 329.698727446 * n ** -.1332047592), n = v(n, 0, 255) / 255, e <= 66 ? (r = e, r = 99.4708025861 * Math.log(r) - 161.1195681661) : (r = e - 60, r = 288.1221695283 * r ** -.0755148492), r = v(r, 0, 255) / 255, e >= 66 ? i = 255 : e <= 19 ? i = 0 : (i = e - 10, i = 138.5177312231 * Math.log(i) - 305.0447927307), i = v(i, 0, 255) / 255, new
|
|
1035
|
-
},
|
|
1039
|
+
return e <= 66 ? n = 255 : (n = e - 60, n = 329.698727446 * n ** -.1332047592), n = v(n, 0, 255) / 255, e <= 66 ? (r = e, r = 99.4708025861 * Math.log(r) - 161.1195681661) : (r = e - 60, r = 288.1221695283 * r ** -.0755148492), r = v(r, 0, 255) / 255, e >= 66 ? i = 255 : e <= 19 ? i = 0 : (i = e - 10, i = 138.5177312231 * Math.log(i) - 305.0447927307), i = v(i, 0, 255) / 255, new L(n, r, i, t);
|
|
1040
|
+
}, Ut = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
1036
1041
|
e = P(v(e * 255, 0, 255)), t = P(v(t * 255, 0, 255)), n = P(v(n * 255, 0, 255));
|
|
1037
1042
|
let i;
|
|
1038
1043
|
if (i = n === 255 ? 6600 : n === 0 ? 1900 : Math.exp((n + 305.0447927307) / 138.5177312231) + 10, e < 255) {
|
|
@@ -1040,33 +1045,33 @@ var Lt = 1e3, Rt = 4e4, zt = 100, Bt = ({ kelvin: e, alpha: t }) => {
|
|
|
1040
1045
|
i = Math.max(i, t);
|
|
1041
1046
|
}
|
|
1042
1047
|
let a = i <= 6600 ? Math.exp((t + 161.1195681661) / 99.4708025861) : (288.1221695283 / t) ** (1 / -.0755148492) + 60;
|
|
1043
|
-
return i = (i + a) / 2, i = v(Math.round(i *
|
|
1048
|
+
return i = (i + a) / 2, i = v(Math.round(i * Vt), zt, Bt), new Sr(i, r);
|
|
1044
1049
|
};
|
|
1045
|
-
function
|
|
1046
|
-
return
|
|
1050
|
+
function Wt(e) {
|
|
1051
|
+
return _t(Ht(e));
|
|
1047
1052
|
}
|
|
1048
|
-
function
|
|
1049
|
-
return
|
|
1053
|
+
function Gt(e) {
|
|
1054
|
+
return Ut(vt(e));
|
|
1050
1055
|
}
|
|
1051
|
-
var
|
|
1056
|
+
var Kt = ({ h: e, s: t, v: n, alpha: r }) => {
|
|
1052
1057
|
let i = n - n * t / 2, a;
|
|
1053
|
-
return a = i === 0 || i === 1 ? 0 : (n - i) / Math.min(i, 1 - i), new
|
|
1054
|
-
},
|
|
1058
|
+
return a = i === 0 || i === 1 ? 0 : (n - i) / Math.min(i, 1 - i), new hr(e, a, i, r);
|
|
1059
|
+
}, qt = ({ h: e, s: t, l: n, alpha: r }) => {
|
|
1055
1060
|
let i = n + t * Math.min(n, 1 - n), a;
|
|
1056
|
-
return a = i === 0 ? 0 : 2 * (1 - n / i), new
|
|
1057
|
-
},
|
|
1061
|
+
return a = i === 0 ? 0 : 2 * (1 - n / i), new gr(e, a, i, r);
|
|
1062
|
+
}, Jt = ({ h: e, w: t, b: n, alpha: r }) => {
|
|
1058
1063
|
let i, a, o = t + n;
|
|
1059
|
-
return o >= 1 ? (a = t / o, i = 0) : (a = 1 - n, i = a === 0 ? 0 : 1 - t / a),
|
|
1060
|
-
},
|
|
1061
|
-
let { h: i, s: a, v: o } =
|
|
1062
|
-
return new
|
|
1063
|
-
},
|
|
1064
|
+
return o >= 1 ? (a = t / o, i = 0) : (a = 1 - n, i = a === 0 ? 0 : 1 - t / a), Kt(new gr(e, i, a, r));
|
|
1065
|
+
}, Yt = ({ h: e, s: t, l: n, alpha: r }) => {
|
|
1066
|
+
let { h: i, s: a, v: o } = qt(new hr(e, t, n, r));
|
|
1067
|
+
return new _r(i, o * (1 - a), 1 - o, r);
|
|
1068
|
+
}, Xt = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
1064
1069
|
let i = Math.max(e, t, n), a = Math.min(e, t, n), [o, s, c] = [
|
|
1065
1070
|
0,
|
|
1066
1071
|
0,
|
|
1067
1072
|
(i + a) / 2
|
|
1068
1073
|
], l = i - a;
|
|
1069
|
-
if (l === 0) return new
|
|
1074
|
+
if (l === 0) return new hr(0, 0, c, r);
|
|
1070
1075
|
switch (s = l / (1 - Math.abs(2 * c - 1)), i) {
|
|
1071
1076
|
case e:
|
|
1072
1077
|
o = (t - n) / l + (t < n ? 6 : 0);
|
|
@@ -1078,9 +1083,9 @@ var Wt = ({ h: e, s: t, v: n, alpha: r }) => {
|
|
|
1078
1083
|
o = (e - t) / l + 4;
|
|
1079
1084
|
break;
|
|
1080
1085
|
}
|
|
1081
|
-
return o /= 6, s < 0 && (o = (o + .5) % 1, s = Math.abs(s) % 1), o >= 1 && --o, new
|
|
1086
|
+
return o /= 6, s < 0 && (o = (o + .5) % 1, s = Math.abs(s) % 1), o >= 1 && --o, new hr(o, s, c, r);
|
|
1082
1087
|
};
|
|
1083
|
-
function
|
|
1088
|
+
function Zt({ h: e, s: t, l: n, alpha: r }) {
|
|
1084
1089
|
let i = (1 - Math.abs(2 * n - 1)) * t, a = i * (1 - Math.abs(e * 6 % 2 - 1)), o = n - i / 2, s, c, l;
|
|
1085
1090
|
return e < 1 / 6 ? [s, c, l] = [
|
|
1086
1091
|
i,
|
|
@@ -1106,27 +1111,27 @@ function Yt({ h: e, s: t, l: n, alpha: r }) {
|
|
|
1106
1111
|
i,
|
|
1107
1112
|
0,
|
|
1108
1113
|
a
|
|
1109
|
-
], new
|
|
1110
|
-
}
|
|
1111
|
-
function Xt(e) {
|
|
1112
|
-
return ht(Yt(e));
|
|
1113
|
-
}
|
|
1114
|
-
function Zt(e) {
|
|
1115
|
-
return Jt(gt(e));
|
|
1114
|
+
], new L(s + o, c + o, l + o, r);
|
|
1116
1115
|
}
|
|
1117
1116
|
function Qt(e) {
|
|
1118
|
-
return
|
|
1117
|
+
return _t(Zt(e));
|
|
1119
1118
|
}
|
|
1120
1119
|
function $t(e) {
|
|
1121
|
-
return
|
|
1120
|
+
return Xt(vt(e));
|
|
1122
1121
|
}
|
|
1123
1122
|
function en(e) {
|
|
1124
|
-
return
|
|
1123
|
+
return Qt(Kt(e));
|
|
1125
1124
|
}
|
|
1126
1125
|
function tn(e) {
|
|
1127
|
-
return qt(
|
|
1126
|
+
return qt($t(e));
|
|
1128
1127
|
}
|
|
1129
1128
|
function nn(e) {
|
|
1129
|
+
return Qt(Jt(e));
|
|
1130
|
+
}
|
|
1131
|
+
function rn(e) {
|
|
1132
|
+
return Yt($t(e));
|
|
1133
|
+
}
|
|
1134
|
+
function an(e) {
|
|
1130
1135
|
if (e.whitePoint === "D50") return [
|
|
1131
1136
|
e.x,
|
|
1132
1137
|
e.y,
|
|
@@ -1136,10 +1141,10 @@ function nn(e) {
|
|
|
1136
1141
|
e.x,
|
|
1137
1142
|
e.y,
|
|
1138
1143
|
e.z
|
|
1139
|
-
],
|
|
1144
|
+
], Se);
|
|
1140
1145
|
throw Error(`Unsupported white point: ${e.whitePoint}`);
|
|
1141
1146
|
}
|
|
1142
|
-
function
|
|
1147
|
+
function on(e) {
|
|
1143
1148
|
if (e.whitePoint === "D65") return [
|
|
1144
1149
|
e.x,
|
|
1145
1150
|
e.y,
|
|
@@ -1149,235 +1154,208 @@ function rn(e) {
|
|
|
1149
1154
|
e.x,
|
|
1150
1155
|
e.y,
|
|
1151
1156
|
e.z
|
|
1152
|
-
],
|
|
1157
|
+
], Ce);
|
|
1153
1158
|
throw Error(`Unsupported white point: ${e.whitePoint}`);
|
|
1154
1159
|
}
|
|
1155
|
-
var
|
|
1156
|
-
function
|
|
1157
|
-
let n = (e) => e >
|
|
1160
|
+
var sn = 216 / 24389, cn = 24 / 116, ln = 24389 / 27, un = 8, dn = 16, fn = 116, pn = 500, mn = 200;
|
|
1161
|
+
function hn(e, t = "D50") {
|
|
1162
|
+
let n = (e) => e > sn ? Math.cbrt(e) : (ln * e + dn) / fn, r = we[t], [i, a, o] = an(e), s = i / r[0], c = a / r[1], l = o / r[2], u = n(s), d = n(c), f = n(l), p = fn * d - dn, m = pn * (u - d), h = mn * (d - f), g = new vr(y(p, T.lab.l.number.min, T.lab.l.number.max), y(m, T.lab.a.number.min, T.lab.a.number.max), y(h, T.lab.b.number.min, T.lab.b.number.max), e.alpha);
|
|
1158
1163
|
return g.whitePoint = t, g;
|
|
1159
1164
|
}
|
|
1160
|
-
function
|
|
1161
|
-
let t = (e) => e >
|
|
1162
|
-
i = P(y(i, 0, 1,
|
|
1163
|
-
let c = (i +
|
|
1165
|
+
function gn(e) {
|
|
1166
|
+
let t = (e) => e > cn ? e ** 3 : (fn * e - dn) / ln, n = (e) => e > un ? ((e + dn) / fn) ** 3 : e / ln, r = we[e.whitePoint], { l: i, a, b: o, alpha: s } = e;
|
|
1167
|
+
i = P(y(i, 0, 1, T.lab.l.number.min, T.lab.l.number.max)), a = P(y(a, 0, 1, T.lab.a.number.min, T.lab.a.number.max)), o = P(y(o, 0, 1, T.lab.b.number.min, T.lab.b.number.max));
|
|
1168
|
+
let c = (i + dn) / fn, l = a / pn + c, u = c - o / mn, [d, f, p] = [
|
|
1164
1169
|
t(l),
|
|
1165
1170
|
n(i),
|
|
1166
1171
|
t(u)
|
|
1167
|
-
], m = d * r[0], h = f * r[1], g = p * r[2], _ = new
|
|
1168
|
-
return _.whitePoint = e.whitePoint, [m, h, g] =
|
|
1172
|
+
], m = d * r[0], h = f * r[1], g = p * r[2], _ = new R(m, h, g, s);
|
|
1173
|
+
return _.whitePoint = e.whitePoint, [m, h, g] = on(_), _.whitePoint = "D65", _.x = P(m), _.y = P(h), _.z = P(g), _;
|
|
1169
1174
|
}
|
|
1170
|
-
function
|
|
1171
|
-
t = P(y(t, 0, 1,
|
|
1175
|
+
function _n({ l: e, c: t, h: n, alpha: r }) {
|
|
1176
|
+
t = P(y(t, 0, 1, T.lch.c.number.min, T.lch.c.number.max));
|
|
1172
1177
|
let i = n * 2 * Math.PI, a = Math.cos(i) * t, o = Math.sin(i) * t;
|
|
1173
|
-
return new
|
|
1178
|
+
return new vr(e, y(a, T.lab.a.number.min, T.lab.a.number.max), y(o, T.lab.b.number.min, T.lab.b.number.max), r);
|
|
1174
1179
|
}
|
|
1175
|
-
function
|
|
1176
|
-
t = P(y(t, 0, 1,
|
|
1180
|
+
function vn({ l: e, a: t, b: n, alpha: r }) {
|
|
1181
|
+
t = P(y(t, 0, 1, T.lab.a.number.min, T.lab.a.number.max)), n = P(y(n, 0, 1, T.lab.b.number.min, T.lab.b.number.max));
|
|
1177
1182
|
let i = Math.hypot(t, n), a = Math.atan2(n, t) / (2 * Math.PI);
|
|
1178
|
-
return a < 0 && (a += 1), new
|
|
1183
|
+
return a < 0 && (a += 1), new yr(e, y(i, T.lch.c.number.min, T.lch.c.number.max), a, r);
|
|
1179
1184
|
}
|
|
1180
|
-
function
|
|
1181
|
-
return
|
|
1185
|
+
function yn(e) {
|
|
1186
|
+
return gn(_n(e));
|
|
1182
1187
|
}
|
|
1183
|
-
function
|
|
1184
|
-
return
|
|
1188
|
+
function bn(e) {
|
|
1189
|
+
return vn(hn(e));
|
|
1185
1190
|
}
|
|
1186
|
-
function
|
|
1187
|
-
t = P(y(t, 0, 1,
|
|
1191
|
+
function xn({ l: e, a: t, b: n, alpha: r }) {
|
|
1192
|
+
t = P(y(t, 0, 1, T.oklab.a.number.min, T.oklab.a.number.max)), n = P(y(n, 0, 1, T.oklab.b.number.min, T.oklab.b.number.max));
|
|
1188
1193
|
let i = x([
|
|
1189
1194
|
e,
|
|
1190
1195
|
t,
|
|
1191
1196
|
n
|
|
1192
|
-
],
|
|
1197
|
+
], De), [a, o, s] = x([
|
|
1193
1198
|
i[0] * i[0] * i[0],
|
|
1194
1199
|
i[1] * i[1] * i[1],
|
|
1195
1200
|
i[2] * i[2] * i[2]
|
|
1196
|
-
],
|
|
1197
|
-
return new
|
|
1201
|
+
], Ee);
|
|
1202
|
+
return new R(a, o, s, r);
|
|
1198
1203
|
}
|
|
1199
|
-
function
|
|
1204
|
+
function Sn(e) {
|
|
1200
1205
|
let { x: t, y: n, z: r } = e, i = x([
|
|
1201
1206
|
t,
|
|
1202
1207
|
n,
|
|
1203
1208
|
r
|
|
1204
|
-
],
|
|
1209
|
+
], Te), [a, o, s] = x([
|
|
1205
1210
|
Math.cbrt(i[0]),
|
|
1206
1211
|
Math.cbrt(i[1]),
|
|
1207
1212
|
Math.cbrt(i[2])
|
|
1208
|
-
],
|
|
1209
|
-
return new
|
|
1213
|
+
], E);
|
|
1214
|
+
return new br(a, y(o, T.oklab.a.number.min, T.oklab.a.number.max), y(s, T.oklab.b.number.min, T.oklab.b.number.max), e.alpha);
|
|
1210
1215
|
}
|
|
1211
|
-
function
|
|
1212
|
-
t = P(y(t, 0, 1,
|
|
1216
|
+
function Cn({ l: e, a: t, b: n, alpha: r }) {
|
|
1217
|
+
t = P(y(t, 0, 1, T.oklab.a.number.min, T.oklab.a.number.max)), n = P(y(n, 0, 1, T.oklab.b.number.min, T.oklab.b.number.max));
|
|
1213
1218
|
let i = Math.hypot(t, n), a = Math.atan2(n, t) / (2 * Math.PI);
|
|
1214
|
-
return a < 0 && (a += 1), new
|
|
1219
|
+
return a < 0 && (a += 1), new xr(e, y(i, T.oklch.c.number.min, T.oklch.c.number.max), a, r);
|
|
1215
1220
|
}
|
|
1216
|
-
function
|
|
1217
|
-
t = P(y(t, 0, 1,
|
|
1221
|
+
function wn({ l: e, c: t, h: n, alpha: r }) {
|
|
1222
|
+
t = P(y(t, 0, 1, T.oklch.c.number.min, T.oklch.c.number.max));
|
|
1218
1223
|
let i = n * 2 * Math.PI, a = Math.cos(i) * t, o = Math.sin(i) * t;
|
|
1219
|
-
return new
|
|
1220
|
-
}
|
|
1221
|
-
function Cn(e) {
|
|
1222
|
-
return yn(Sn(e));
|
|
1223
|
-
}
|
|
1224
|
-
function wn(e) {
|
|
1225
|
-
return xn(bn(e));
|
|
1224
|
+
return new br(e, y(a, T.oklab.a.number.min, T.oklab.a.number.max), y(o, T.oklab.b.number.min, T.oklab.b.number.max), r);
|
|
1226
1225
|
}
|
|
1227
1226
|
function Tn(e) {
|
|
1228
|
-
|
|
1229
|
-
return new I(p.r, p.g, p.b, e.alpha);
|
|
1227
|
+
return xn(wn(e));
|
|
1230
1228
|
}
|
|
1231
1229
|
function En(e) {
|
|
1232
|
-
|
|
1233
|
-
return new yr(s, y(c, E.oklab.a.number.min, E.oklab.a.number.max), y(l, E.oklab.b.number.min, E.oklab.b.number.max), e.alpha);
|
|
1230
|
+
return Cn(Sn(e));
|
|
1234
1231
|
}
|
|
1235
1232
|
function Dn(e) {
|
|
1236
|
-
let t = y(e.
|
|
1237
|
-
return new
|
|
1233
|
+
let t = y(e.a, 0, 1, T.oklab.a.number.min, T.oklab.a.number.max), n = y(e.b, 0, 1, T.oklab.b.number.min, T.oklab.b.number.max), r = e.l, i = r + k.l[1] * t + k.l[2] * n, a = r + k.m[1] * t + k.m[2] * n, o = r + k.s[1] * t + k.s[2] * n, s = i * i * i, c = a * a * a, l = o * o * o, u = D[0] * s + D[1] * c + D[2] * l, d = D[3] * s + D[4] * c + D[5] * l, f = D[6] * s + D[7] * c + D[8] * l, p = Bn(new L(M(u), M(d), M(f), e.alpha));
|
|
1234
|
+
return new L(p.r, p.g, p.b, e.alpha);
|
|
1238
1235
|
}
|
|
1239
1236
|
function On(e) {
|
|
1240
|
-
let t = j(e.r), n = j(e.g), r = j(e.b), i = Math.cbrt(
|
|
1241
|
-
return
|
|
1237
|
+
let t = j(e.r), n = j(e.g), r = j(e.b), i = Math.cbrt(O[0] * t + O[1] * n + O[2] * r), a = Math.cbrt(O[3] * t + O[4] * n + O[5] * r), o = Math.cbrt(O[6] * t + O[7] * n + O[8] * r), s = E[0] * i + E[1] * a + E[2] * o, c = E[3] * i + E[4] * a + E[5] * o, l = E[6] * i + E[7] * a + E[8] * o;
|
|
1238
|
+
return new br(s, y(c, T.oklab.a.number.min, T.oklab.a.number.max), y(l, T.oklab.b.number.min, T.oklab.b.number.max), e.alpha);
|
|
1242
1239
|
}
|
|
1243
1240
|
function kn(e) {
|
|
1244
|
-
|
|
1241
|
+
let t = y(e.c, 0, 1, T.oklch.c.number.min, T.oklch.c.number.max), n = e.h * 2 * Math.PI, r = Math.cos(n) * t, i = Math.sin(n) * t, a = e.l, o = a + k.l[1] * r + k.l[2] * i, s = a + k.m[1] * r + k.m[2] * i, c = a + k.s[1] * r + k.s[2] * i, l = o * o * o, u = s * s * s, d = c * c * c, f = D[0] * l + D[1] * u + D[2] * d, p = D[3] * l + D[4] * u + D[5] * d, m = D[6] * l + D[7] * u + D[8] * d, h = Bn(new L(M(f), M(p), M(m), e.alpha));
|
|
1242
|
+
return new L(h.r, h.g, h.b, e.alpha);
|
|
1245
1243
|
}
|
|
1246
1244
|
function An(e) {
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
let s = t * (1 - .5 * Math.max(0, Math.abs(o - .5) - .3));
|
|
1266
|
-
return {
|
|
1267
|
-
L: o,
|
|
1268
|
-
C: s,
|
|
1269
|
-
H: n
|
|
1270
|
-
};
|
|
1271
|
-
}
|
|
1272
|
-
function Fn(e) {
|
|
1273
|
-
return (e.colorSpace === "oklch" ? e : N(e, "oklch")).l;
|
|
1274
|
-
}
|
|
1275
|
-
function In(e, t, n = Nn) {
|
|
1276
|
-
let r = Fn(e);
|
|
1277
|
-
return Math.abs(r - t) < n;
|
|
1278
|
-
}
|
|
1279
|
-
function Ln(e, t, n = Nn) {
|
|
1280
|
-
let r = e.colorSpace === "oklch" ? e.clone() : N(e, "oklch"), i = r.l, a = r.c, o = r.h, s = Pn(i, a, o, t, n);
|
|
1281
|
-
return r.l = P(s.L), r.c = P(s.C), r.h = P(s.H), r;
|
|
1282
|
-
}
|
|
1283
|
-
var Rn = (e) => {
|
|
1284
|
-
let t = E[e], n = {};
|
|
1245
|
+
let t = j(e.r), n = j(e.g), r = j(e.b), i = Math.cbrt(O[0] * t + O[1] * n + O[2] * r), a = Math.cbrt(O[3] * t + O[4] * n + O[5] * r), o = Math.cbrt(O[6] * t + O[7] * n + O[8] * r), s = E[0] * i + E[1] * a + E[2] * o, c = E[3] * i + E[4] * a + E[5] * o, l = E[6] * i + E[7] * a + E[8] * o, u = Math.hypot(c, l), d = Math.atan2(l, c) / (2 * Math.PI);
|
|
1246
|
+
return d < 0 && (d += 1), new xr(s, y(u, T.oklch.c.number.min, T.oklch.c.number.max), d, e.alpha);
|
|
1247
|
+
}
|
|
1248
|
+
function jn(e) {
|
|
1249
|
+
return Bn(Zt(e));
|
|
1250
|
+
}
|
|
1251
|
+
function Mn(e) {
|
|
1252
|
+
return Xt(e);
|
|
1253
|
+
}
|
|
1254
|
+
var Nn = {
|
|
1255
|
+
"oklab->rgb": Dn,
|
|
1256
|
+
"rgb->oklab": On,
|
|
1257
|
+
"oklch->rgb": kn,
|
|
1258
|
+
"rgb->oklch": An,
|
|
1259
|
+
"hsl->rgb": jn,
|
|
1260
|
+
"rgb->hsl": Mn
|
|
1261
|
+
}, Pn = (e, t) => Nn[`${e}->${t}`], Fn = (e) => {
|
|
1262
|
+
let t = T[e], n = {};
|
|
1285
1263
|
for (let r of Object.keys(t)) {
|
|
1286
|
-
let t =
|
|
1264
|
+
let t = ve(e, r), { min: i, max: a } = _e(e, r, t);
|
|
1287
1265
|
n[r] = {
|
|
1288
1266
|
min: `${i}${t}`,
|
|
1289
1267
|
max: `${a}${t}`
|
|
1290
1268
|
};
|
|
1291
1269
|
}
|
|
1292
1270
|
return n;
|
|
1293
|
-
},
|
|
1271
|
+
}, In = {
|
|
1294
1272
|
rgb: {
|
|
1295
|
-
to:
|
|
1296
|
-
from:
|
|
1273
|
+
to: _t,
|
|
1274
|
+
from: vt
|
|
1297
1275
|
},
|
|
1298
1276
|
hsl: {
|
|
1299
|
-
to: Xt,
|
|
1300
|
-
from: Zt
|
|
1301
|
-
},
|
|
1302
|
-
hsv: {
|
|
1303
1277
|
to: Qt,
|
|
1304
1278
|
from: $t
|
|
1305
1279
|
},
|
|
1306
|
-
|
|
1280
|
+
hsv: {
|
|
1307
1281
|
to: en,
|
|
1308
1282
|
from: tn
|
|
1309
1283
|
},
|
|
1284
|
+
hwb: {
|
|
1285
|
+
to: nn,
|
|
1286
|
+
from: rn
|
|
1287
|
+
},
|
|
1310
1288
|
lab: {
|
|
1311
|
-
to:
|
|
1312
|
-
from:
|
|
1289
|
+
to: gn,
|
|
1290
|
+
from: hn
|
|
1313
1291
|
},
|
|
1314
1292
|
lch: {
|
|
1315
|
-
to: _n,
|
|
1316
|
-
from: vn
|
|
1317
|
-
},
|
|
1318
|
-
oklab: {
|
|
1319
1293
|
to: yn,
|
|
1320
1294
|
from: bn
|
|
1321
1295
|
},
|
|
1296
|
+
oklab: {
|
|
1297
|
+
to: xn,
|
|
1298
|
+
from: Sn
|
|
1299
|
+
},
|
|
1322
1300
|
oklch: {
|
|
1323
|
-
to:
|
|
1324
|
-
from:
|
|
1301
|
+
to: Tn,
|
|
1302
|
+
from: En
|
|
1325
1303
|
},
|
|
1326
1304
|
kelvin: {
|
|
1327
|
-
to:
|
|
1328
|
-
from:
|
|
1305
|
+
to: Wt,
|
|
1306
|
+
from: Gt
|
|
1329
1307
|
},
|
|
1330
1308
|
xyz: {
|
|
1331
1309
|
to: (e) => e,
|
|
1332
1310
|
from: (e) => e
|
|
1333
1311
|
},
|
|
1334
1312
|
"srgb-linear": {
|
|
1335
|
-
to: Dt,
|
|
1336
|
-
from: Ot
|
|
1337
|
-
},
|
|
1338
|
-
"display-p3": {
|
|
1339
1313
|
to: kt,
|
|
1340
1314
|
from: At
|
|
1341
1315
|
},
|
|
1342
|
-
"
|
|
1316
|
+
"display-p3": {
|
|
1343
1317
|
to: jt,
|
|
1344
1318
|
from: Mt
|
|
1345
1319
|
},
|
|
1346
|
-
"
|
|
1320
|
+
"a98-rgb": {
|
|
1347
1321
|
to: Nt,
|
|
1348
1322
|
from: Pt
|
|
1349
1323
|
},
|
|
1350
|
-
|
|
1324
|
+
"prophoto-rgb": {
|
|
1351
1325
|
to: Ft,
|
|
1352
1326
|
from: It
|
|
1327
|
+
},
|
|
1328
|
+
rec2020: {
|
|
1329
|
+
to: Lt,
|
|
1330
|
+
from: Rt
|
|
1353
1331
|
}
|
|
1354
|
-
},
|
|
1332
|
+
}, Ln = (e) => In[e]?.to, Rn = (e) => In[e]?.from;
|
|
1355
1333
|
function N(e, t) {
|
|
1356
1334
|
if (e.colorSpace === t) return e;
|
|
1357
|
-
let n =
|
|
1335
|
+
let n = Pn(e.colorSpace, t);
|
|
1358
1336
|
if (n) return n(e);
|
|
1359
|
-
let r =
|
|
1337
|
+
let r = Ln(e.colorSpace);
|
|
1360
1338
|
if (!r) throw Error(`Unknown source color space: "${e.colorSpace}"`);
|
|
1361
|
-
let i = r(e), a =
|
|
1339
|
+
let i = r(e), a = Rn(t);
|
|
1362
1340
|
if (!a) throw Error(`Unknown target color space: "${t}"`);
|
|
1363
1341
|
return a(i);
|
|
1364
1342
|
}
|
|
1365
|
-
var
|
|
1366
|
-
function
|
|
1343
|
+
var zn = 1e-6;
|
|
1344
|
+
function Bn(e) {
|
|
1367
1345
|
let t = N(e, "rgb"), n = Number.isNaN(t.r) ? 0 : t.r, r = Number.isNaN(t.g) ? 0 : t.g, i = Number.isNaN(t.b) ? 0 : t.b;
|
|
1368
1346
|
if (n >= 0 && n <= 1 && r >= 0 && r <= 1 && i >= 0 && i <= 1) return e;
|
|
1369
|
-
if (n >= -
|
|
1370
|
-
let [a, o, s] =
|
|
1371
|
-
return N(new
|
|
1347
|
+
if (n >= -zn && n <= 1 + zn && r >= -zn && r <= 1 + zn && i >= -zn && i <= 1 + zn) return N(new L(v(n, 0, 1), v(r, 0, 1), v(i, 0, 1), e.alpha), e.colorSpace);
|
|
1348
|
+
let [a, o, s] = Je(n, r, i);
|
|
1349
|
+
return N(new L(a, o, s, e.alpha), e.colorSpace);
|
|
1372
1350
|
}
|
|
1373
|
-
var
|
|
1351
|
+
var Vn = {
|
|
1374
1352
|
hsl: "h",
|
|
1375
1353
|
hsv: "h",
|
|
1376
1354
|
hwb: "h",
|
|
1377
1355
|
lch: "h",
|
|
1378
1356
|
oklch: "h"
|
|
1379
1357
|
};
|
|
1380
|
-
function
|
|
1358
|
+
function Hn(e, t, n, r = "shorter") {
|
|
1381
1359
|
if (Number.isNaN(e) && Number.isNaN(t)) return 0;
|
|
1382
1360
|
if (Number.isNaN(e)) return t;
|
|
1383
1361
|
if (Number.isNaN(t)) return e;
|
|
@@ -1399,19 +1377,19 @@ function Gn(e, t, n, r = "shorter") {
|
|
|
1399
1377
|
let a = e + n * (t - e);
|
|
1400
1378
|
return a = (a % 1 + 1) % 1, a;
|
|
1401
1379
|
}
|
|
1402
|
-
function
|
|
1380
|
+
function Un(e, t, n, r, i = "oklab", a = "shorter") {
|
|
1403
1381
|
let o = N(e, i), s = N(t, i);
|
|
1404
1382
|
n < 0 && (n = 0), r < 0 && (r = 0);
|
|
1405
1383
|
let c = n + r;
|
|
1406
1384
|
c === 0 ? (n = .5, r = .5) : c !== 1 && (n /= c, r /= c);
|
|
1407
|
-
let l = Math.min(c, 1), u =
|
|
1385
|
+
let l = Math.min(c, 1), u = Vn[i], d = o.keys().filter((e) => e !== "alpha"), f = Number.isNaN(o.alpha) ? s.alpha : o.alpha, p = Number.isNaN(s.alpha) ? o.alpha : s.alpha, m = b(f, p, r) * l, h = [];
|
|
1408
1386
|
for (let e of d) {
|
|
1409
1387
|
let t = o[e], n = s[e];
|
|
1410
1388
|
if (Number.isNaN(t) && Number.isNaN(n)) {
|
|
1411
1389
|
h.push(0);
|
|
1412
1390
|
continue;
|
|
1413
1391
|
}
|
|
1414
|
-
if (Number.isNaN(t) && (t = n), Number.isNaN(n) && (n = t), e === u) h.push(
|
|
1392
|
+
if (Number.isNaN(t) && (t = n), Number.isNaN(n) && (n = t), e === u) h.push(Hn(t, n, r, a));
|
|
1415
1393
|
else {
|
|
1416
1394
|
let e = b(t * f, n * p, r);
|
|
1417
1395
|
h.push(m > 0 ? e / m : 0);
|
|
@@ -1420,9 +1398,36 @@ function Kn(e, t, n, r, i = "oklab", a = "shorter") {
|
|
|
1420
1398
|
let g = o.constructor;
|
|
1421
1399
|
return new g(...h, m);
|
|
1422
1400
|
}
|
|
1423
|
-
var
|
|
1401
|
+
var Wn = .35;
|
|
1402
|
+
function Gn(e, t, n, r, i = Wn) {
|
|
1403
|
+
if (Math.abs(e - r) >= i) return {
|
|
1404
|
+
L: e,
|
|
1405
|
+
C: t,
|
|
1406
|
+
H: n
|
|
1407
|
+
};
|
|
1408
|
+
let a = r < .5, o = a ? r + i : r - i;
|
|
1409
|
+
o = v(o, .05, .95), Math.abs(o - r) < i * .8 && (o = v(a ? r - i : r + i, .05, .95));
|
|
1410
|
+
let s = t * (1 - .5 * Math.max(0, Math.abs(o - .5) - .3));
|
|
1411
|
+
return {
|
|
1412
|
+
L: o,
|
|
1413
|
+
C: s,
|
|
1414
|
+
H: n
|
|
1415
|
+
};
|
|
1416
|
+
}
|
|
1417
|
+
function Kn(e) {
|
|
1418
|
+
return (e.colorSpace === "oklch" ? e : N(e, "oklch")).l;
|
|
1419
|
+
}
|
|
1420
|
+
function qn(e, t, n = Wn) {
|
|
1421
|
+
let r = Kn(e);
|
|
1422
|
+
return Math.abs(r - t) < n;
|
|
1423
|
+
}
|
|
1424
|
+
function Jn(e, t, n = Wn) {
|
|
1425
|
+
let r = e.colorSpace === "oklch" ? e.clone() : N(e, "oklch"), i = r.l, a = r.c, o = r.h, s = Gn(i, a, o, t, n);
|
|
1426
|
+
return r.l = P(s.L), r.c = P(s.C), r.h = P(s.H), r;
|
|
1427
|
+
}
|
|
1428
|
+
var Yn = (e) => e != null && typeof e.toFixed == "function", Xn = (e, t = 2) => typeof e == "number" && !Number.isFinite(e) ? "none" : (Yn(e) ? e.toFixed(t) : String(e)).trim().replace(/\.0+$/, ""), Zn = (e, t, n) => Number(n) === 1 ? `${e}(${t.join(" ")})` : `${e}(${t.join(" ")} / ${n})`, P = (e) => e, F = (e, t) => e[t], Qn = (e, t, n) => {
|
|
1424
1429
|
e[t] = n;
|
|
1425
|
-
},
|
|
1430
|
+
}, I = class e {
|
|
1426
1431
|
colorSpace;
|
|
1427
1432
|
alpha;
|
|
1428
1433
|
whitePoint = "D65";
|
|
@@ -1438,11 +1443,11 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1438
1443
|
static CLONE_DEPTH_LIMIT = 16;
|
|
1439
1444
|
toString() {
|
|
1440
1445
|
let e = this.values().slice(0, -1).map((e) => typeof e == "number" && Number.isNaN(e) ? "none" : e), t = typeof this.alpha == "number" && Number.isNaN(this.alpha) ? "none" : this.alpha;
|
|
1441
|
-
return
|
|
1446
|
+
return Zn(this.colorSpace, e, t);
|
|
1442
1447
|
}
|
|
1443
1448
|
toFormattedString(e = 2) {
|
|
1444
|
-
let t = this.values().slice(0, -1).map((t) =>
|
|
1445
|
-
return
|
|
1449
|
+
let t = this.values().slice(0, -1).map((t) => Xn(t, e)), n = Xn(this.alpha, e);
|
|
1450
|
+
return Zn(this.colorSpace, t, n);
|
|
1446
1451
|
}
|
|
1447
1452
|
valueOf() {
|
|
1448
1453
|
return [...this.values(), this.alpha];
|
|
@@ -1456,8 +1461,8 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1456
1461
|
if (++e._cloneDepth > e.CLONE_DEPTH_LIMIT) throw e._cloneDepth = 0, Error(`Color.clone() exceeded depth ${e.CLONE_DEPTH_LIMIT}. This is the iOS Safari stack-overflow precursor. Inspect the structure for ValueUnit/Color self-nesting.`);
|
|
1457
1462
|
try {
|
|
1458
1463
|
let e = this.constructor, t = new e();
|
|
1459
|
-
t.alpha =
|
|
1460
|
-
for (let e of this.channels)
|
|
1464
|
+
t.alpha = l(this.alpha);
|
|
1465
|
+
for (let e of this.channels) Qn(t, e, l(F(this, e)));
|
|
1461
1466
|
return t;
|
|
1462
1467
|
} finally {
|
|
1463
1468
|
e._cloneDepth--;
|
|
@@ -1468,200 +1473,200 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1468
1473
|
}
|
|
1469
1474
|
values() {
|
|
1470
1475
|
let e = [], t = this.channels;
|
|
1471
|
-
for (let n = 0; n < t.length; n++) e.push(
|
|
1476
|
+
for (let n = 0; n < t.length; n++) e.push(F(this, t[n]));
|
|
1472
1477
|
return e.push(this.alpha), e;
|
|
1473
1478
|
}
|
|
1474
1479
|
entries() {
|
|
1475
1480
|
let e = [], t = this.channels;
|
|
1476
|
-
for (let n = 0; n < t.length; n++) e.push([t[n],
|
|
1481
|
+
for (let n = 0; n < t.length; n++) e.push([t[n], F(this, t[n])]);
|
|
1477
1482
|
return e.push(["alpha", this.alpha]), e;
|
|
1478
1483
|
}
|
|
1479
|
-
},
|
|
1484
|
+
}, $n = [
|
|
1480
1485
|
"r",
|
|
1481
1486
|
"g",
|
|
1482
1487
|
"b"
|
|
1483
|
-
],
|
|
1488
|
+
], er = [
|
|
1484
1489
|
"h",
|
|
1485
1490
|
"s",
|
|
1486
1491
|
"l"
|
|
1487
|
-
],
|
|
1492
|
+
], tr = [
|
|
1488
1493
|
"h",
|
|
1489
1494
|
"s",
|
|
1490
1495
|
"v"
|
|
1491
|
-
],
|
|
1496
|
+
], nr = [
|
|
1492
1497
|
"h",
|
|
1493
1498
|
"w",
|
|
1494
1499
|
"b"
|
|
1495
|
-
],
|
|
1500
|
+
], rr = [
|
|
1496
1501
|
"l",
|
|
1497
1502
|
"a",
|
|
1498
1503
|
"b"
|
|
1499
|
-
],
|
|
1504
|
+
], ir = [
|
|
1500
1505
|
"l",
|
|
1501
1506
|
"c",
|
|
1502
1507
|
"h"
|
|
1503
|
-
],
|
|
1508
|
+
], ar = [
|
|
1504
1509
|
"x",
|
|
1505
1510
|
"y",
|
|
1506
1511
|
"z"
|
|
1507
|
-
],
|
|
1512
|
+
], or = ["kelvin"], sr = [
|
|
1508
1513
|
"r",
|
|
1509
1514
|
"g",
|
|
1510
1515
|
"b",
|
|
1511
1516
|
"alpha"
|
|
1512
|
-
],
|
|
1517
|
+
], cr = [
|
|
1513
1518
|
"h",
|
|
1514
1519
|
"s",
|
|
1515
1520
|
"l",
|
|
1516
1521
|
"alpha"
|
|
1517
|
-
],
|
|
1522
|
+
], lr = [
|
|
1518
1523
|
"h",
|
|
1519
1524
|
"s",
|
|
1520
1525
|
"v",
|
|
1521
1526
|
"alpha"
|
|
1522
|
-
],
|
|
1527
|
+
], ur = [
|
|
1523
1528
|
"h",
|
|
1524
1529
|
"w",
|
|
1525
1530
|
"b",
|
|
1526
1531
|
"alpha"
|
|
1527
|
-
],
|
|
1532
|
+
], dr = [
|
|
1528
1533
|
"l",
|
|
1529
1534
|
"a",
|
|
1530
1535
|
"b",
|
|
1531
1536
|
"alpha"
|
|
1532
|
-
],
|
|
1537
|
+
], fr = [
|
|
1533
1538
|
"l",
|
|
1534
1539
|
"c",
|
|
1535
1540
|
"h",
|
|
1536
1541
|
"alpha"
|
|
1537
|
-
],
|
|
1542
|
+
], pr = [
|
|
1538
1543
|
"x",
|
|
1539
1544
|
"y",
|
|
1540
1545
|
"z",
|
|
1541
1546
|
"alpha"
|
|
1542
|
-
],
|
|
1543
|
-
static channelKeysWithAlpha = or;
|
|
1544
|
-
get channels() {
|
|
1545
|
-
return Qn;
|
|
1546
|
-
}
|
|
1547
|
-
constructor(e, t, n, r) {
|
|
1548
|
-
super("rgb", r), this.r = e, this.g = t, this.b = n;
|
|
1549
|
-
}
|
|
1550
|
-
}, mr = class extends F {
|
|
1547
|
+
], mr = ["kelvin", "alpha"], L = class extends I {
|
|
1551
1548
|
static channelKeysWithAlpha = sr;
|
|
1552
1549
|
get channels() {
|
|
1553
1550
|
return $n;
|
|
1554
1551
|
}
|
|
1555
1552
|
constructor(e, t, n, r) {
|
|
1556
|
-
super("
|
|
1553
|
+
super("rgb", r), this.r = e, this.g = t, this.b = n;
|
|
1557
1554
|
}
|
|
1558
|
-
}, hr = class extends
|
|
1555
|
+
}, hr = class extends I {
|
|
1559
1556
|
static channelKeysWithAlpha = cr;
|
|
1560
1557
|
get channels() {
|
|
1561
1558
|
return er;
|
|
1562
1559
|
}
|
|
1563
1560
|
constructor(e, t, n, r) {
|
|
1564
|
-
super("
|
|
1561
|
+
super("hsl", r), this.h = e, this.s = t, this.l = n;
|
|
1565
1562
|
}
|
|
1566
|
-
}, gr = class extends
|
|
1563
|
+
}, gr = class extends I {
|
|
1567
1564
|
static channelKeysWithAlpha = lr;
|
|
1568
1565
|
get channels() {
|
|
1569
1566
|
return tr;
|
|
1570
1567
|
}
|
|
1571
1568
|
constructor(e, t, n, r) {
|
|
1572
|
-
super("
|
|
1569
|
+
super("hsv", r), this.h = e, this.s = t, this.v = n;
|
|
1573
1570
|
}
|
|
1574
|
-
}, _r = class extends
|
|
1571
|
+
}, _r = class extends I {
|
|
1575
1572
|
static channelKeysWithAlpha = ur;
|
|
1576
1573
|
get channels() {
|
|
1577
1574
|
return nr;
|
|
1578
1575
|
}
|
|
1579
1576
|
constructor(e, t, n, r) {
|
|
1580
|
-
super("
|
|
1577
|
+
super("hwb", r), this.h = e, this.w = t, this.b = n;
|
|
1581
1578
|
}
|
|
1582
|
-
}, vr = class extends
|
|
1579
|
+
}, vr = class extends I {
|
|
1583
1580
|
static channelKeysWithAlpha = dr;
|
|
1584
1581
|
get channels() {
|
|
1585
1582
|
return rr;
|
|
1586
1583
|
}
|
|
1587
1584
|
constructor(e, t, n, r) {
|
|
1588
|
-
super("
|
|
1585
|
+
super("lab", r), this.whitePoint = "D50", this.l = e, this.a = t, this.b = n;
|
|
1589
1586
|
}
|
|
1590
|
-
}, yr = class extends
|
|
1591
|
-
static channelKeysWithAlpha =
|
|
1587
|
+
}, yr = class extends I {
|
|
1588
|
+
static channelKeysWithAlpha = fr;
|
|
1592
1589
|
get channels() {
|
|
1593
|
-
return
|
|
1590
|
+
return ir;
|
|
1594
1591
|
}
|
|
1595
1592
|
constructor(e, t, n, r) {
|
|
1596
|
-
super("
|
|
1593
|
+
super("lch", r), this.l = e, this.c = t, this.h = n;
|
|
1597
1594
|
}
|
|
1598
|
-
}, br = class extends
|
|
1595
|
+
}, br = class extends I {
|
|
1599
1596
|
static channelKeysWithAlpha = dr;
|
|
1600
1597
|
get channels() {
|
|
1601
1598
|
return rr;
|
|
1602
1599
|
}
|
|
1603
1600
|
constructor(e, t, n, r) {
|
|
1604
|
-
super("
|
|
1601
|
+
super("oklab", r), this.whitePoint = "D50", this.l = e, this.a = t, this.b = n;
|
|
1605
1602
|
}
|
|
1606
|
-
},
|
|
1603
|
+
}, xr = class extends I {
|
|
1607
1604
|
static channelKeysWithAlpha = fr;
|
|
1608
1605
|
get channels() {
|
|
1609
1606
|
return ir;
|
|
1610
1607
|
}
|
|
1611
1608
|
constructor(e, t, n, r) {
|
|
1612
|
-
super("
|
|
1609
|
+
super("oklch", r), this.l = e, this.c = t, this.h = n;
|
|
1613
1610
|
}
|
|
1614
|
-
},
|
|
1611
|
+
}, R = class extends I {
|
|
1615
1612
|
static channelKeysWithAlpha = pr;
|
|
1616
1613
|
get channels() {
|
|
1617
1614
|
return ar;
|
|
1618
1615
|
}
|
|
1616
|
+
constructor(e, t, n, r) {
|
|
1617
|
+
super("xyz", r), this.x = e, this.y = t, this.z = n;
|
|
1618
|
+
}
|
|
1619
|
+
}, Sr = class extends I {
|
|
1620
|
+
static channelKeysWithAlpha = mr;
|
|
1621
|
+
get channels() {
|
|
1622
|
+
return or;
|
|
1623
|
+
}
|
|
1619
1624
|
constructor(e, t) {
|
|
1620
1625
|
super("kelvin", t), this.kelvin = e;
|
|
1621
1626
|
}
|
|
1622
|
-
},
|
|
1623
|
-
static channelKeysWithAlpha =
|
|
1627
|
+
}, Cr = class extends I {
|
|
1628
|
+
static channelKeysWithAlpha = sr;
|
|
1624
1629
|
get channels() {
|
|
1625
|
-
return
|
|
1630
|
+
return $n;
|
|
1626
1631
|
}
|
|
1627
1632
|
constructor(e, t, n, r) {
|
|
1628
1633
|
super("srgb-linear", r), this.r = e, this.g = t, this.b = n;
|
|
1629
1634
|
}
|
|
1630
|
-
},
|
|
1631
|
-
static channelKeysWithAlpha =
|
|
1635
|
+
}, wr = class extends I {
|
|
1636
|
+
static channelKeysWithAlpha = sr;
|
|
1632
1637
|
get channels() {
|
|
1633
|
-
return
|
|
1638
|
+
return $n;
|
|
1634
1639
|
}
|
|
1635
1640
|
constructor(e, t, n, r) {
|
|
1636
1641
|
super("display-p3", r), this.r = e, this.g = t, this.b = n;
|
|
1637
1642
|
}
|
|
1638
|
-
},
|
|
1639
|
-
static channelKeysWithAlpha =
|
|
1643
|
+
}, Tr = class extends I {
|
|
1644
|
+
static channelKeysWithAlpha = sr;
|
|
1640
1645
|
get channels() {
|
|
1641
|
-
return
|
|
1646
|
+
return $n;
|
|
1642
1647
|
}
|
|
1643
1648
|
constructor(e, t, n, r) {
|
|
1644
1649
|
super("a98-rgb", r), this.r = e, this.g = t, this.b = n;
|
|
1645
1650
|
}
|
|
1646
|
-
},
|
|
1647
|
-
static channelKeysWithAlpha =
|
|
1651
|
+
}, Er = class extends I {
|
|
1652
|
+
static channelKeysWithAlpha = sr;
|
|
1648
1653
|
get channels() {
|
|
1649
|
-
return
|
|
1654
|
+
return $n;
|
|
1650
1655
|
}
|
|
1651
1656
|
constructor(e, t, n, r) {
|
|
1652
1657
|
super("prophoto-rgb", r), this.r = e, this.g = t, this.b = n;
|
|
1653
1658
|
}
|
|
1654
|
-
},
|
|
1655
|
-
static channelKeysWithAlpha =
|
|
1659
|
+
}, Dr = class extends I {
|
|
1660
|
+
static channelKeysWithAlpha = sr;
|
|
1656
1661
|
get channels() {
|
|
1657
|
-
return
|
|
1662
|
+
return $n;
|
|
1658
1663
|
}
|
|
1659
1664
|
constructor(e, t, n, r) {
|
|
1660
1665
|
super("rec2020", r), this.r = e, this.g = t, this.b = n;
|
|
1661
1666
|
}
|
|
1662
|
-
},
|
|
1663
|
-
t = i ?
|
|
1664
|
-
let { min: a, max: o } =
|
|
1667
|
+
}, Or = (e, t, n, r, i = !1) => {
|
|
1668
|
+
t = i ? ve(n, r) : t;
|
|
1669
|
+
let { min: a, max: o } = _e(n, r, t ?? ""), [s, c, l, u] = i ? [
|
|
1665
1670
|
a,
|
|
1666
1671
|
o,
|
|
1667
1672
|
0,
|
|
@@ -1672,27 +1677,27 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1672
1677
|
a,
|
|
1673
1678
|
o
|
|
1674
1679
|
];
|
|
1675
|
-
return new
|
|
1676
|
-
},
|
|
1680
|
+
return new Y(y(e, l, u, s, c), i ? t : "");
|
|
1681
|
+
}, kr = (e, t = !1) => {
|
|
1677
1682
|
let n = e.colorSpace;
|
|
1678
1683
|
return e.keys().forEach((r) => {
|
|
1679
1684
|
let i = e[r];
|
|
1680
|
-
e[r] =
|
|
1685
|
+
e[r] = Or(Y.unwrapDeep(i), i instanceof Y ? i.unit : void 0, n, r, t);
|
|
1681
1686
|
}), e;
|
|
1682
|
-
},
|
|
1687
|
+
}, Ar = (e, t = !1, n = !1) => {
|
|
1683
1688
|
e = n ? e : e.clone();
|
|
1684
|
-
let r =
|
|
1685
|
-
return n ? e : new
|
|
1686
|
-
},
|
|
1687
|
-
let a = n ? i ? e : e.clone() :
|
|
1689
|
+
let r = kr(e.value, t);
|
|
1690
|
+
return n ? e : new Y(r).coalesce(e, !0);
|
|
1691
|
+
}, jr = (e, t = "oklab", n = !1, r = !1, i = !1) => {
|
|
1692
|
+
let a = n ? i ? e : e.clone() : Ar(e, !1, i), o = N(a.toJSON(), t);
|
|
1688
1693
|
return o.entries().forEach(([e, t]) => {
|
|
1689
|
-
o[e] = new
|
|
1690
|
-
}), a.value = o, a.superType[1] = t, r ?
|
|
1691
|
-
},
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
+
o[e] = new Y(Y.unwrapDeep(t));
|
|
1695
|
+
}), a.value = o, a.superType[1] = t, r ? Ar(a, !0, !0) : a;
|
|
1696
|
+
}, Mr = (e, t, n = "oklab", r = !1, i = !1, a = !1, o) => [
|
|
1697
|
+
jr(e, n, r, i, a),
|
|
1698
|
+
jr(t, n, r, i, a),
|
|
1694
1699
|
o
|
|
1695
|
-
],
|
|
1700
|
+
], Nr = [
|
|
1696
1701
|
"px",
|
|
1697
1702
|
"cm",
|
|
1698
1703
|
"mm",
|
|
@@ -1700,17 +1705,16 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1700
1705
|
"in",
|
|
1701
1706
|
"pc",
|
|
1702
1707
|
"pt"
|
|
1703
|
-
],
|
|
1708
|
+
], Pr = /* @__PURE__ */ "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("."), Fr = [...Nr, ...Pr], Ir = ["s", "ms"], Lr = [
|
|
1704
1709
|
"deg",
|
|
1705
1710
|
"rad",
|
|
1706
1711
|
"grad",
|
|
1707
1712
|
"turn"
|
|
1708
|
-
],
|
|
1713
|
+
], Rr = ["%"], zr = ["Hz", "kHz"], Br = [
|
|
1709
1714
|
"dpi",
|
|
1710
1715
|
"dpcm",
|
|
1711
1716
|
"dppx"
|
|
1712
|
-
],
|
|
1713
|
-
...Pr,
|
|
1717
|
+
], Vr = ["fr"], Hr = ["var", "calc"], Ur = ["string"], Wr = ["color"], Gr = [
|
|
1714
1718
|
...Fr,
|
|
1715
1719
|
...Ir,
|
|
1716
1720
|
...Lr,
|
|
@@ -1720,39 +1724,40 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1720
1724
|
...Vr,
|
|
1721
1725
|
...Hr,
|
|
1722
1726
|
...Ur,
|
|
1727
|
+
...Wr,
|
|
1723
1728
|
"",
|
|
1724
1729
|
void 0
|
|
1725
|
-
],
|
|
1730
|
+
], Kr = [
|
|
1726
1731
|
"string",
|
|
1727
1732
|
"var",
|
|
1728
1733
|
"calc"
|
|
1729
|
-
],
|
|
1730
|
-
function
|
|
1734
|
+
], qr = /* @__PURE__ */ "accentColor.additiveSymbols.alignContent.alignItems.alignSelf.alignmentBaseline.all.anchorName.animation.animationComposition.animationDelay.animationDirection.animationDuration.animationFillMode.animationIterationCount.animationName.animationPlayState.animationRange.animationRangeEnd.animationRangeStart.animationTimeline.animationTimingFunction.appRegion.appearance.ascentOverride.aspectRatio.backdropFilter.backfaceVisibility.background.backgroundAttachment.backgroundBlendMode.backgroundClip.backgroundColor.backgroundImage.backgroundOrigin.backgroundPosition.backgroundPositionX.backgroundPositionY.backgroundRepeat.backgroundSize.basePalette.baselineShift.baselineSource.blockSize.border.borderBlock.borderBlockColor.borderBlockEnd.borderBlockEndColor.borderBlockEndStyle.borderBlockEndWidth.borderBlockStart.borderBlockStartColor.borderBlockStartStyle.borderBlockStartWidth.borderBlockStyle.borderBlockWidth.borderBottom.borderBottomColor.borderBottomLeftRadius.borderBottomRightRadius.borderBottomStyle.borderBottomWidth.borderCollapse.borderColor.borderEndEndRadius.borderEndStartRadius.borderImage.borderImageOutset.borderImageRepeat.borderImageSlice.borderImageSource.borderImageWidth.borderInline.borderInlineColor.borderInlineEnd.borderInlineEndColor.borderInlineEndStyle.borderInlineEndWidth.borderInlineStart.borderInlineStartColor.borderInlineStartStyle.borderInlineStartWidth.borderInlineStyle.borderInlineWidth.borderLeft.borderLeftColor.borderLeftStyle.borderLeftWidth.borderRadius.borderRight.borderRightColor.borderRightStyle.borderRightWidth.borderSpacing.borderStartEndRadius.borderStartStartRadius.borderStyle.borderTop.borderTopColor.borderTopLeftRadius.borderTopRightRadius.borderTopStyle.borderTopWidth.borderWidth.bottom.boxShadow.boxSizing.breakAfter.breakBefore.breakInside.bufferedRendering.captionSide.caretColor.clear.clip.clipPath.clipRule.color.colorInterpolation.colorInterpolationFilters.colorRendering.colorScheme.columnCount.columnFill.columnGap.columnRule.columnRuleColor.columnRuleStyle.columnRuleWidth.columnSpan.columnWidth.columns.contain.containIntrinsicBlockSize.containIntrinsicHeight.containIntrinsicInlineSize.containIntrinsicSize.containIntrinsicWidth.container.containerName.containerType.content.contentVisibility.counterIncrement.counterReset.counterSet.cursor.cx.cy.d.descentOverride.direction.display.dominantBaseline.emptyCells.fallback.fieldSizing.fill.fillOpacity.fillRule.filter.flex.flexBasis.flexDirection.flexFlow.flexGrow.flexShrink.flexWrap.float.floodColor.floodOpacity.font.fontDisplay.fontFamily.fontFeatureSettings.fontKerning.fontOpticalSizing.fontPalette.fontSize.fontStretch.fontStyle.fontSynthesis.fontSynthesisSmallCaps.fontSynthesisStyle.fontSynthesisWeight.fontVariant.fontVariantAlternates.fontVariantCaps.fontVariantEastAsian.fontVariantLigatures.fontVariantNumeric.fontVariantPosition.fontVariationSettings.fontWeight.forcedColorAdjust.gap.grid.gridArea.gridAutoColumns.gridAutoFlow.gridAutoRows.gridColumn.gridColumnEnd.gridColumnGap.gridColumnStart.gridGap.gridRow.gridRowEnd.gridRowGap.gridRowStart.gridTemplate.gridTemplateAreas.gridTemplateColumns.gridTemplateRows.height.hyphenateCharacter.hyphenateLimitChars.hyphens.imageOrientation.imageRendering.inherits.initialLetter.initialValue.inlineSize.inset.insetArea.insetBlock.insetBlockEnd.insetBlockStart.insetInline.insetInlineEnd.insetInlineStart.isolation.justifyContent.justifyItems.justifySelf.left.letterSpacing.lightingColor.lineBreak.lineGapOverride.lineHeight.listStyle.listStyleImage.listStylePosition.listStyleType.margin.marginBlock.marginBlockEnd.marginBlockStart.marginBottom.marginInline.marginInlineEnd.marginInlineStart.marginLeft.marginRight.marginTop.marker.markerEnd.markerMid.markerStart.mask.maskClip.maskComposite.maskImage.maskMode.maskOrigin.maskPosition.maskRepeat.maskSize.maskType.mathDepth.mathShift.mathStyle.maxBlockSize.maxHeight.maxInlineSize.maxWidth.minBlockSize.minHeight.minInlineSize.minWidth.mixBlendMode.navigation.negative.objectFit.objectPosition.objectViewBox.offset.offsetAnchor.offsetDistance.offsetPath.offsetPosition.offsetRotate.opacity.order.orphans.outline.outlineColor.outlineOffset.outlineStyle.outlineWidth.overflow.overflowAnchor.overflowClipMargin.overflowWrap.overflowX.overflowY.overlay.overrideColors.overscrollBehavior.overscrollBehaviorBlock.overscrollBehaviorInline.overscrollBehaviorX.overscrollBehaviorY.pad.padding.paddingBlock.paddingBlockEnd.paddingBlockStart.paddingBottom.paddingInline.paddingInlineEnd.paddingInlineStart.paddingLeft.paddingRight.paddingTop.page.pageBreakAfter.pageBreakBefore.pageBreakInside.pageOrientation.paintOrder.perspective.perspectiveOrigin.placeContent.placeItems.placeSelf.pointerEvents.position.positionAnchor.positionTry.positionTryOptions.positionTryOrder.positionVisibility.prefix.quotes.r.range.resize.right.rotate.rowGap.rubyPosition.rx.ry.scale.scrollBehavior.scrollMargin.scrollMarginBlock.scrollMarginBlockEnd.scrollMarginBlockStart.scrollMarginBottom.scrollMarginInline.scrollMarginInlineEnd.scrollMarginInlineStart.scrollMarginLeft.scrollMarginRight.scrollMarginTop.scrollPadding.scrollPaddingBlock.scrollPaddingBlockEnd.scrollPaddingBlockStart.scrollPaddingBottom.scrollPaddingInline.scrollPaddingInlineEnd.scrollPaddingInlineStart.scrollPaddingLeft.scrollPaddingRight.scrollPaddingTop.scrollSnapAlign.scrollSnapStop.scrollSnapType.scrollTimeline.scrollTimelineAxis.scrollTimelineName.scrollbarColor.scrollbarGutter.scrollbarWidth.shapeImageThreshold.shapeMargin.shapeOutside.shapeRendering.size.sizeAdjust.speak.speakAs.src.stopColor.stopOpacity.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.suffix.symbols.syntax.system.tabSize.tableLayout.textAlign.textAlignLast.textAnchor.textCombineUpright.textDecoration.textDecorationColor.textDecorationLine.textDecorationSkipInk.textDecorationStyle.textDecorationThickness.textEmphasis.textEmphasisColor.textEmphasisPosition.textEmphasisStyle.textIndent.textOrientation.textOverflow.textRendering.textShadow.textSizeAdjust.textSpacingTrim.textTransform.textUnderlineOffset.textUnderlinePosition.textWrap.timelineScope.top.touchAction.transform.transformBox.transformOrigin.transformStyle.transition.transitionBehavior.transitionDelay.transitionDuration.transitionProperty.transitionTimingFunction.translate.types.unicodeBidi.unicodeRange.userSelect.vectorEffect.verticalAlign.viewTimeline.viewTimelineAxis.viewTimelineInset.viewTimelineName.viewTransitionClass.viewTransitionName.visibility.webkitAlignContent.webkitAlignItems.webkitAlignSelf.webkitAnimation.webkitAnimationDelay.webkitAnimationDirection.webkitAnimationDuration.webkitAnimationFillMode.webkitAnimationIterationCount.webkitAnimationName.webkitAnimationPlayState.webkitAnimationTimingFunction.webkitAppRegion.webkitAppearance.webkitBackfaceVisibility.webkitBackgroundClip.webkitBackgroundOrigin.webkitBackgroundSize.webkitBorderAfter.webkitBorderAfterColor.webkitBorderAfterStyle.webkitBorderAfterWidth.webkitBorderBefore.webkitBorderBeforeColor.webkitBorderBeforeStyle.webkitBorderBeforeWidth.webkitBorderBottomLeftRadius.webkitBorderBottomRightRadius.webkitBorderEnd.webkitBorderEndColor.webkitBorderEndStyle.webkitBorderEndWidth.webkitBorderHorizontalSpacing.webkitBorderImage.webkitBorderRadius.webkitBorderStart.webkitBorderStartColor.webkitBorderStartStyle.webkitBorderStartWidth.webkitBorderTopLeftRadius.webkitBorderTopRightRadius.webkitBorderVerticalSpacing.webkitBoxAlign.webkitBoxDecorationBreak.webkitBoxDirection.webkitBoxFlex.webkitBoxOrdinalGroup.webkitBoxOrient.webkitBoxPack.webkitBoxReflect.webkitBoxShadow.webkitBoxSizing.webkitClipPath.webkitColumnBreakAfter.webkitColumnBreakBefore.webkitColumnBreakInside.webkitColumnCount.webkitColumnGap.webkitColumnRule.webkitColumnRuleColor.webkitColumnRuleStyle.webkitColumnRuleWidth.webkitColumnSpan.webkitColumnWidth.webkitColumns.webkitFilter.webkitFlex.webkitFlexBasis.webkitFlexDirection.webkitFlexFlow.webkitFlexGrow.webkitFlexShrink.webkitFlexWrap.webkitFontFeatureSettings.webkitFontSmoothing.webkitHyphenateCharacter.webkitJustifyContent.webkitLineBreak.webkitLineClamp.webkitLocale.webkitLogicalHeight.webkitLogicalWidth.webkitMarginAfter.webkitMarginBefore.webkitMarginEnd.webkitMarginStart.webkitMask.webkitMaskBoxImage.webkitMaskBoxImageOutset.webkitMaskBoxImageRepeat.webkitMaskBoxImageSlice.webkitMaskBoxImageSource.webkitMaskBoxImageWidth.webkitMaskClip.webkitMaskComposite.webkitMaskImage.webkitMaskOrigin.webkitMaskPosition.webkitMaskPositionX.webkitMaskPositionY.webkitMaskRepeat.webkitMaskSize.webkitMaxLogicalHeight.webkitMaxLogicalWidth.webkitMinLogicalHeight.webkitMinLogicalWidth.webkitOpacity.webkitOrder.webkitPaddingAfter.webkitPaddingBefore.webkitPaddingEnd.webkitPaddingStart.webkitPerspective.webkitPerspectiveOrigin.webkitPerspectiveOriginX.webkitPerspectiveOriginY.webkitPrintColorAdjust.webkitRtlOrdering.webkitRubyPosition.webkitShapeImageThreshold.webkitShapeMargin.webkitShapeOutside.webkitTapHighlightColor.webkitTextCombine.webkitTextDecorationsInEffect.webkitTextEmphasis.webkitTextEmphasisColor.webkitTextEmphasisPosition.webkitTextEmphasisStyle.webkitTextFillColor.webkitTextOrientation.webkitTextSecurity.webkitTextSizeAdjust.webkitTextStroke.webkitTextStrokeColor.webkitTextStrokeWidth.webkitTransform.webkitTransformOrigin.webkitTransformOriginX.webkitTransformOriginY.webkitTransformOriginZ.webkitTransformStyle.webkitTransition.webkitTransitionDelay.webkitTransitionDuration.webkitTransitionProperty.webkitTransitionTimingFunction.webkitUserDrag.webkitUserModify.webkitUserSelect.webkitWritingMode.whiteSpace.whiteSpaceCollapse.widows.width.willChange.wordBreak.wordSpacing.wordWrap.writingMode.x.y.zIndex.zoom".split(".");
|
|
1735
|
+
function Jr(e) {
|
|
1731
1736
|
return e.unit === "color";
|
|
1732
1737
|
}
|
|
1733
|
-
var
|
|
1738
|
+
var Yr = (e) => {
|
|
1734
1739
|
let t = {}, n = (e, r = void 0) => {
|
|
1735
1740
|
if (Array.isArray(e)) {
|
|
1736
1741
|
e.forEach((e, t) => n(e, r));
|
|
1737
1742
|
return;
|
|
1738
|
-
} else if (e instanceof
|
|
1743
|
+
} else if (e instanceof X) {
|
|
1739
1744
|
if (e.name === "calc") {
|
|
1740
|
-
let n = new
|
|
1741
|
-
t[i] ?? (t[i] = new
|
|
1745
|
+
let n = new Y(e.values.map((e) => e.toString()).join(", "), "calc"), i = r ?? "calc";
|
|
1746
|
+
t[i] ?? (t[i] = new Wa()), t[i].push(n), t[i] = t[i].flat();
|
|
1742
1747
|
return;
|
|
1743
1748
|
}
|
|
1744
1749
|
let i = e.name;
|
|
1745
1750
|
r && (i = r.endsWith(e.name) ? r : `${r}.${e.name}`), e.values.forEach((e, t) => n(e, i));
|
|
1746
1751
|
return;
|
|
1747
|
-
} else if (
|
|
1752
|
+
} else if (c(e)) {
|
|
1748
1753
|
for (let [t, i] of Object.entries(e)) n(i, r ? `${r}.${t}` : t);
|
|
1749
1754
|
return;
|
|
1750
1755
|
}
|
|
1751
1756
|
let i = r;
|
|
1752
|
-
t[i] ?? (t[i] = new
|
|
1757
|
+
t[i] ?? (t[i] = new Wa()), t[i].push(e), t[i] = t[i].flat();
|
|
1753
1758
|
};
|
|
1754
1759
|
return n(e), t;
|
|
1755
|
-
},
|
|
1760
|
+
}, Xr = (e) => {
|
|
1756
1761
|
let t = {};
|
|
1757
1762
|
for (let [n, r] of Object.entries(e)) {
|
|
1758
1763
|
let e = n.split("."), i = t;
|
|
@@ -1762,7 +1767,7 @@ var Jr = (e) => {
|
|
|
1762
1767
|
}
|
|
1763
1768
|
}
|
|
1764
1769
|
return t;
|
|
1765
|
-
},
|
|
1770
|
+
}, Zr = (e) => {
|
|
1766
1771
|
let t = {};
|
|
1767
1772
|
for (let [n, r] of Object.entries(e)) {
|
|
1768
1773
|
let e = n.split("."), i = e[0], a = t[i] ?? "", o = "", s = "";
|
|
@@ -1771,11 +1776,11 @@ var Jr = (e) => {
|
|
|
1771
1776
|
c = e.length > 1 && Array.isArray(r) ? r.join(", ") : r.toString(), a += ` ${o}${c}${s}`, t[i] = a.trim();
|
|
1772
1777
|
}
|
|
1773
1778
|
return t;
|
|
1774
|
-
},
|
|
1775
|
-
function
|
|
1776
|
-
return
|
|
1779
|
+
}, Qr = new Set(qr);
|
|
1780
|
+
function $r(e) {
|
|
1781
|
+
return Qr.has(e);
|
|
1777
1782
|
}
|
|
1778
|
-
var
|
|
1783
|
+
var ei = (e) => {
|
|
1779
1784
|
let t = e.name, n = e.valueOf();
|
|
1780
1785
|
if (!e.name.startsWith("matrix")) throw Error("Input must be a matrix or matrix3d value");
|
|
1781
1786
|
let r = {
|
|
@@ -1837,7 +1842,7 @@ var $r = (e) => {
|
|
|
1837
1842
|
}
|
|
1838
1843
|
throw Error("Unsupported matrix type or invalid number of values");
|
|
1839
1844
|
};
|
|
1840
|
-
function
|
|
1845
|
+
function ti(e) {
|
|
1841
1846
|
let t = e.parentElement;
|
|
1842
1847
|
for (; t;) {
|
|
1843
1848
|
let e = getComputedStyle(t).containerType;
|
|
@@ -1846,15 +1851,62 @@ function ei(e) {
|
|
|
1846
1851
|
}
|
|
1847
1852
|
return null;
|
|
1848
1853
|
}
|
|
1849
|
-
function
|
|
1854
|
+
function ni(e) {
|
|
1850
1855
|
let t = getComputedStyle(e).writingMode;
|
|
1851
1856
|
return t?.startsWith("vertical") || t?.startsWith("sideways") || !1;
|
|
1852
1857
|
}
|
|
1853
|
-
|
|
1858
|
+
var ri = new Set(/* @__PURE__ */ "em.rem.ch.ex.cap.ic.lh.rlh.vw.vh.vmin.vmax.vi.vb.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("."));
|
|
1859
|
+
function ii(e, t, n) {
|
|
1860
|
+
let r = /^(sv|lv|dv|v)(w|h|i|b|min|max)$/.exec(t);
|
|
1861
|
+
if (!r) return null;
|
|
1862
|
+
let i = r[1], a = r[2], o, s;
|
|
1863
|
+
if (i === "sv") {
|
|
1864
|
+
let e = typeof window < "u" ? window.visualViewport : void 0;
|
|
1865
|
+
o = e?.width ?? window.innerWidth, s = e?.height ?? window.innerHeight;
|
|
1866
|
+
} else o = window.innerWidth, s = window.innerHeight;
|
|
1867
|
+
let c = n ? ni(n) : !1, l;
|
|
1868
|
+
switch (a) {
|
|
1869
|
+
case "w":
|
|
1870
|
+
l = o;
|
|
1871
|
+
break;
|
|
1872
|
+
case "h":
|
|
1873
|
+
l = s;
|
|
1874
|
+
break;
|
|
1875
|
+
case "i":
|
|
1876
|
+
l = c ? s : o;
|
|
1877
|
+
break;
|
|
1878
|
+
case "b":
|
|
1879
|
+
l = c ? o : s;
|
|
1880
|
+
break;
|
|
1881
|
+
case "min":
|
|
1882
|
+
l = Math.min(o, s);
|
|
1883
|
+
break;
|
|
1884
|
+
default:
|
|
1885
|
+
l = Math.max(o, s);
|
|
1886
|
+
break;
|
|
1887
|
+
}
|
|
1888
|
+
return l / 100 * e;
|
|
1889
|
+
}
|
|
1890
|
+
function ai(e, t, n) {
|
|
1891
|
+
let r = t === "rlh" ? typeof document < "u" ? document.documentElement : void 0 : n;
|
|
1892
|
+
if (!r) return null;
|
|
1893
|
+
let i = getComputedStyle(r), a = parseFloat(i.fontSize) || 16;
|
|
1894
|
+
switch (t) {
|
|
1895
|
+
case "lh":
|
|
1896
|
+
case "rlh": {
|
|
1897
|
+
let t = parseFloat(i.lineHeight);
|
|
1898
|
+
return e * (Number.isFinite(t) ? t : a * 1.2);
|
|
1899
|
+
}
|
|
1900
|
+
case "cap": return e * a * .7;
|
|
1901
|
+
case "ic": return e * a;
|
|
1902
|
+
default: return null;
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
function oi(e, t) {
|
|
1854
1906
|
let n = e;
|
|
1855
1907
|
return t === "cm" ? n *= 96 / 2.54 : t === "mm" ? n *= 96 / 25.4 : t === "Q" ? n *= 96 / (25.4 * 4) : t === "in" ? n *= 96 : t === "pt" ? n *= 4 / 3 : t === "pc" && (n *= 16), n;
|
|
1856
1908
|
}
|
|
1857
|
-
function
|
|
1909
|
+
function si(e, t, n, r) {
|
|
1858
1910
|
if (t === "em" && n) e *= parseFloat(getComputedStyle(n).fontSize);
|
|
1859
1911
|
else if (t === "rem") e *= parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
1860
1912
|
else if (t === "vh") e *= window.innerHeight / 100;
|
|
@@ -1879,58 +1931,71 @@ function ri(e, t, n, r) {
|
|
|
1879
1931
|
let t = parseFloat(getComputedStyle(n).fontSize) || 16;
|
|
1880
1932
|
e *= t * .5;
|
|
1881
1933
|
} else if ((t === "cqw" || t === "cqh" || t === "cqi" || t === "cqb" || t === "cqmin" || t === "cqmax") && n) {
|
|
1882
|
-
let r =
|
|
1934
|
+
let r = ti(n);
|
|
1883
1935
|
if (r) {
|
|
1884
|
-
let n = r.clientWidth, i = r.clientHeight, a =
|
|
1936
|
+
let n = r.clientWidth, i = r.clientHeight, a = ni(r);
|
|
1885
1937
|
t === "cqw" ? e *= n / 100 : t === "cqh" ? e *= i / 100 : t === "cqi" ? e *= (a ? i : n) / 100 : t === "cqb" ? e *= (a ? n : i) / 100 : t === "cqmin" ? e *= Math.min(n, i) / 100 : e *= Math.max(n, i) / 100;
|
|
1886
1938
|
}
|
|
1887
|
-
} else
|
|
1939
|
+
} else {
|
|
1940
|
+
let r = typeof window < "u" ? ii(e, t, n) : null, i = r === null ? ai(e, t, n) : null;
|
|
1941
|
+
if (r !== null) e = r;
|
|
1942
|
+
else if (i !== null) e = i;
|
|
1943
|
+
else if (Pr.includes(t) && !ri.has(t)) throw Error(`convertToPixels: relative length unit "${t}" has no resolution branch. Add one in src/units/utils.ts (C5 fail-loud guard).`);
|
|
1944
|
+
else e = oi(e, t);
|
|
1945
|
+
}
|
|
1888
1946
|
return e;
|
|
1889
1947
|
}
|
|
1890
|
-
function
|
|
1948
|
+
function ci(e, t) {
|
|
1891
1949
|
return t === "s" && (e *= 1e3), e;
|
|
1892
1950
|
}
|
|
1893
|
-
function
|
|
1951
|
+
function li(e, t) {
|
|
1894
1952
|
return t === "grad" ? e *= .9 : t === "rad" ? e *= 180 / Math.PI : t === "turn" && (e *= 360), e;
|
|
1895
1953
|
}
|
|
1896
|
-
function
|
|
1954
|
+
function ui(e, t) {
|
|
1897
1955
|
return t === "kHz" && (e *= 1e3), e;
|
|
1898
1956
|
}
|
|
1899
|
-
function
|
|
1957
|
+
function di(e, t) {
|
|
1900
1958
|
return t === "dpcm" ? e *= 2.54 : t === "dppx" && (e *= 96), e;
|
|
1901
1959
|
}
|
|
1902
|
-
var
|
|
1903
|
-
length:
|
|
1904
|
-
time:
|
|
1905
|
-
angle:
|
|
1906
|
-
frequency:
|
|
1907
|
-
resolution:
|
|
1908
|
-
},
|
|
1909
|
-
[
|
|
1910
|
-
[
|
|
1911
|
-
[
|
|
1912
|
-
[
|
|
1913
|
-
[
|
|
1960
|
+
var fi = {
|
|
1961
|
+
length: si,
|
|
1962
|
+
time: ci,
|
|
1963
|
+
angle: li,
|
|
1964
|
+
frequency: ui,
|
|
1965
|
+
resolution: di
|
|
1966
|
+
}, pi = [
|
|
1967
|
+
[Fr, "length"],
|
|
1968
|
+
[Ir, "time"],
|
|
1969
|
+
[Lr, "angle"],
|
|
1970
|
+
[zr, "frequency"],
|
|
1971
|
+
[Br, "resolution"]
|
|
1914
1972
|
];
|
|
1915
|
-
function
|
|
1973
|
+
function mi(e) {
|
|
1916
1974
|
if (typeof e != "string" || e === "") return null;
|
|
1917
|
-
for (let t of
|
|
1975
|
+
for (let t of pi) if (t[0].includes(e)) return t;
|
|
1918
1976
|
return null;
|
|
1919
1977
|
}
|
|
1920
|
-
function
|
|
1921
|
-
let i =
|
|
1978
|
+
function hi(e, t, n, r) {
|
|
1979
|
+
let i = mi(t), a = mi(n);
|
|
1922
1980
|
if (!i || !a || i[1] !== a[1]) throw Error(`Incompatible units: ${t} and ${n}`);
|
|
1923
|
-
let [, o] = i, s =
|
|
1981
|
+
let [, o] = i, s = fi[o];
|
|
1924
1982
|
return s(e, t, r) / s(1, n, r);
|
|
1925
1983
|
}
|
|
1926
|
-
var
|
|
1927
|
-
|
|
1984
|
+
var z = (e) => i(new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "i")), gi = i(/[a-zA-Z]+/), _i = (e) => {
|
|
1985
|
+
let t = /* @__PURE__ */ new Map();
|
|
1986
|
+
for (let n of e) t.set(n.toLowerCase(), n);
|
|
1987
|
+
return gi.chain((e) => {
|
|
1988
|
+
let n = t.get(e.toLowerCase());
|
|
1989
|
+
return n == null ? Si(`unit:${e}`) : xi(n);
|
|
1990
|
+
});
|
|
1991
|
+
}, vi = i(/-?[a-zA-Z][a-zA-Z0-9-]*/), yi = z("none"), bi = i(/-?\d+/).map(Number), B = i(/-?(?:(0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?/).map(Number);
|
|
1992
|
+
function xi(t) {
|
|
1928
1993
|
return new e((e) => e.ok(t, 0));
|
|
1929
1994
|
}
|
|
1930
|
-
function
|
|
1995
|
+
function Si(t) {
|
|
1931
1996
|
return new e((e) => e.err(void 0, 0));
|
|
1932
1997
|
}
|
|
1933
|
-
function
|
|
1998
|
+
function V(e, t) {
|
|
1934
1999
|
let n = e.parseState(t);
|
|
1935
2000
|
if (n.isError) {
|
|
1936
2001
|
let e = n.offset, r = Math.max(0, e - 8), i = Math.min(t.length, e + 8), a = t.slice(r, i);
|
|
@@ -1938,108 +2003,108 @@ function B(e, t) {
|
|
|
1938
2003
|
}
|
|
1939
2004
|
return n.value;
|
|
1940
2005
|
}
|
|
1941
|
-
function
|
|
2006
|
+
function Ci(e, t) {
|
|
1942
2007
|
let n = e.parseState(t);
|
|
1943
2008
|
return {
|
|
1944
2009
|
status: !n.isError,
|
|
1945
2010
|
value: n.value
|
|
1946
2011
|
};
|
|
1947
2012
|
}
|
|
1948
|
-
var
|
|
2013
|
+
var wi = _i(Fr), Ti = _i(Lr), Ei = _i(Ir), Di = _i(zr), Oi = _i(Br), ki = _i(Vr), Ai = n(...Rr.map(z)), ji = n(a(","), a(" ")).trim(o), Mi = t(B, wi).map(([e, t]) => {
|
|
1949
2014
|
let n = ["length"];
|
|
1950
|
-
return
|
|
1951
|
-
}),
|
|
1952
|
-
Length:
|
|
1953
|
-
Angle:
|
|
1954
|
-
Time:
|
|
1955
|
-
TimePercentage:
|
|
1956
|
-
Frequency:
|
|
1957
|
-
Resolution:
|
|
1958
|
-
Flex:
|
|
1959
|
-
Percentage:
|
|
1960
|
-
Color:
|
|
1961
|
-
Slash:
|
|
1962
|
-
Value:
|
|
1963
|
-
sep:
|
|
1964
|
-
},
|
|
1965
|
-
function
|
|
2015
|
+
return Pr.includes(t) ? n.push("relative") : Nr.includes(t) && n.push("absolute"), new Y(e, t, n);
|
|
2016
|
+
}), Ni = t(B, Ti).map(([e, t]) => new Y(e, t, ["angle"])), Pi = t(B, Ei).map(([e, t]) => new Y(e, t, ["time"])), Fi = e.lazy(() => n(zi, Pi)), Ii = t(B, Di).map(([e, t]) => new Y(e, t, ["frequency"])), Li = t(B, Oi).map(([e, t]) => new Y(e, t, ["resolution"])), Ri = t(B, ki).map(([e, t]) => new Y(e, t, ["flex"])), zi = n(t(B, Ai), z("from").map(() => [0, "%"]), z("to").map(() => [100, "%"])).map(([e, t]) => new Y(e, t, ["percentage"])), Bi = e.lazy(() => Ra.Value), Vi = a("/").trim(o).map(() => new Y("/", "string")), Hi = n(Mi, Ni, Pi, Ii, Li, Ri, zi, Bi, Vi, B.map((e) => new Y(e)), yi.map(() => new Y(NaN))).trim(o), H = {
|
|
2017
|
+
Length: Mi,
|
|
2018
|
+
Angle: Ni,
|
|
2019
|
+
Time: Pi,
|
|
2020
|
+
TimePercentage: Fi,
|
|
2021
|
+
Frequency: Ii,
|
|
2022
|
+
Resolution: Li,
|
|
2023
|
+
Flex: Ri,
|
|
2024
|
+
Percentage: zi,
|
|
2025
|
+
Color: Bi,
|
|
2026
|
+
Slash: Vi,
|
|
2027
|
+
Value: Hi,
|
|
2028
|
+
sep: ji
|
|
2029
|
+
}, Ui = h((e) => V(Hi, e), { keyFn: (e) => e });
|
|
2030
|
+
function Wi(e) {
|
|
1966
2031
|
return e >= 5e3 ? `${e / 1e3}s` : `${e}ms`;
|
|
1967
2032
|
}
|
|
1968
|
-
function
|
|
2033
|
+
function Gi(e) {
|
|
1969
2034
|
return e === Infinity ? "infinite" : String(e);
|
|
1970
2035
|
}
|
|
1971
|
-
var
|
|
1972
|
-
function
|
|
1973
|
-
let s = e.lazy(() => n(f.trim(
|
|
2036
|
+
var U = a("("), W = a(")"), Ki = a(",");
|
|
2037
|
+
function qi(r, i) {
|
|
2038
|
+
let s = e.lazy(() => n(f.trim(o).wrap(U, W), i, r).trim(o)), c = e.lazy(() => n(t(a("-").trim(o), s).map(([, e]) => new X("*", [new Y(-1), e])), t(a("+").trim(o), s).map(([, e]) => e), s)), l = n(a("*"), a("/")).trim(o), u = n(a("+"), a("-")).trim(o), d = t(c, t(l, c).many()).map(([e, t]) => {
|
|
1974
2039
|
let n = e;
|
|
1975
|
-
for (let [e, r] of t) n = new
|
|
2040
|
+
for (let [e, r] of t) n = new X(e, [n, r]);
|
|
1976
2041
|
return n;
|
|
1977
2042
|
}), f = t(d, t(u, d).many()).map(([e, t]) => {
|
|
1978
2043
|
let n = e;
|
|
1979
|
-
for (let [e, r] of t) n = new
|
|
2044
|
+
for (let [e, r] of t) n = new X(e, [n, r]);
|
|
1980
2045
|
return n;
|
|
1981
2046
|
});
|
|
1982
2047
|
return f;
|
|
1983
2048
|
}
|
|
1984
|
-
function
|
|
1985
|
-
let
|
|
2049
|
+
function Ji(r) {
|
|
2050
|
+
let a = qi(r, e.lazy(() => b)), s = z("calc").next(a.trim(o).wrap(U, W)).map((e) => new X("calc", [e])), c = a.trim(o), l = c.sepBy(Ki.trim(o)), u = z("min").next(l.wrap(U, W)).map((e) => new X("min", e)), d = z("max").next(l.wrap(U, W)).map((e) => new X("max", e)), f = z("clamp").next(l.wrap(U, W)).map((e) => {
|
|
1986
2051
|
if (e.length !== 3) throw Error("clamp() requires exactly 3 arguments");
|
|
1987
|
-
return new
|
|
1988
|
-
}), p = n(
|
|
2052
|
+
return new X("clamp", e);
|
|
2053
|
+
}), p = n(z("nearest"), z("up"), z("down"), z("to-zero")).trim(o), m = z("round").next(t(p.skip(Ki.trim(o)).opt(), l).wrap(U, W)).map(([e, t]) => new X("round", [new Y(e ?? "nearest", "string"), ...t])), h = (e) => z(e).next(l.wrap(U, W)).map((t) => {
|
|
1989
2054
|
if (t.length !== 2) throw Error(`${e}() requires exactly 2 arguments`);
|
|
1990
|
-
return new
|
|
1991
|
-
}), g = (e) =>
|
|
2055
|
+
return new X(e, t);
|
|
2056
|
+
}), g = (e) => z(e).next(c.trim(o).wrap(U, W)).map((t) => new X(e, [t])), _ = h("pow"), ee = h("atan2"), te = z("hypot").next(l.wrap(U, W)).map((e) => new X("hypot", e)), ne = z("log").next(l.wrap(U, W)).map((e) => {
|
|
1992
2057
|
if (e.length < 1 || e.length > 2) throw Error("log() requires 1 or 2 arguments");
|
|
1993
|
-
return new
|
|
1994
|
-
}),
|
|
2058
|
+
return new X("log", e);
|
|
2059
|
+
}), v = i(/[a-zA-Z0-9_-]/), y = n(z("infinity").not(v).map(() => new Y(Infinity)), z("-infinity").not(v).map(() => new Y(-Infinity)), z("NaN").not(v).map(() => new Y(NaN)), z("pi").not(v).map(() => new Y(Math.PI)), z("e").not(v).map(() => new Y(Math.E))), b = n(s, u, d, f, m, h("mod"), h("rem"), g("abs"), g("sign"), g("sin"), g("cos"), g("tan"), g("asin"), g("acos"), g("atan"), ee, _, g("sqrt"), te, ne, g("exp"), y);
|
|
1995
2060
|
return {
|
|
1996
2061
|
calcFn: s,
|
|
1997
|
-
mathFunction:
|
|
1998
|
-
calcSum:
|
|
2062
|
+
mathFunction: b,
|
|
2063
|
+
calcSum: a
|
|
1999
2064
|
};
|
|
2000
2065
|
}
|
|
2001
|
-
function
|
|
2002
|
-
return e instanceof
|
|
2066
|
+
function G(e) {
|
|
2067
|
+
return e instanceof Y ? e.unit === "var" || e.unit === "calc" ? null : typeof e.value == "number" ? e.value : null : e instanceof X ? Xi(e) : typeof e == "number" ? e : null;
|
|
2003
2068
|
}
|
|
2004
|
-
function
|
|
2005
|
-
return e instanceof
|
|
2069
|
+
function Yi(e) {
|
|
2070
|
+
return e instanceof Y ? typeof e.value == "number" ? e.unit && e.superType?.[0] === "angle" ? li(e.value, e.unit) * Math.PI / 180 : e.value : null : e instanceof X ? Xi(e) : null;
|
|
2006
2071
|
}
|
|
2007
|
-
function
|
|
2072
|
+
function Xi(e) {
|
|
2008
2073
|
let t = e.name, n = e.values;
|
|
2009
2074
|
switch (t) {
|
|
2010
2075
|
case "+": {
|
|
2011
|
-
let e =
|
|
2076
|
+
let e = G(n[0]), t = G(n[1]);
|
|
2012
2077
|
return e == null || t == null ? null : e + t;
|
|
2013
2078
|
}
|
|
2014
2079
|
case "-": {
|
|
2015
|
-
let e =
|
|
2080
|
+
let e = G(n[0]), t = G(n[1]);
|
|
2016
2081
|
return e == null || t == null ? null : e - t;
|
|
2017
2082
|
}
|
|
2018
2083
|
case "*": {
|
|
2019
|
-
let e =
|
|
2084
|
+
let e = G(n[0]), t = G(n[1]);
|
|
2020
2085
|
return e == null || t == null ? null : e * t;
|
|
2021
2086
|
}
|
|
2022
2087
|
case "/": {
|
|
2023
|
-
let e =
|
|
2088
|
+
let e = G(n[0]), t = G(n[1]);
|
|
2024
2089
|
return e == null || t == null || t === 0 ? null : e / t;
|
|
2025
2090
|
}
|
|
2026
|
-
case "calc": return
|
|
2091
|
+
case "calc": return G(n[0]);
|
|
2027
2092
|
case "min": {
|
|
2028
|
-
let e = n.map(
|
|
2093
|
+
let e = n.map(G);
|
|
2029
2094
|
return e.some((e) => e == null) ? null : Math.min(...e);
|
|
2030
2095
|
}
|
|
2031
2096
|
case "max": {
|
|
2032
|
-
let e = n.map(
|
|
2097
|
+
let e = n.map(G);
|
|
2033
2098
|
return e.some((e) => e == null) ? null : Math.max(...e);
|
|
2034
2099
|
}
|
|
2035
2100
|
case "clamp": {
|
|
2036
2101
|
if (n.length !== 3) return null;
|
|
2037
|
-
let [e, t, r] = n.map(
|
|
2102
|
+
let [e, t, r] = n.map(G);
|
|
2038
2103
|
return e == null || t == null || r == null ? null : Math.max(e, Math.min(t, r));
|
|
2039
2104
|
}
|
|
2040
2105
|
case "round": {
|
|
2041
2106
|
if (n.length < 3) return null;
|
|
2042
|
-
let e = n[0] instanceof
|
|
2107
|
+
let e = n[0] instanceof Y ? String(n[0].value) : "nearest", t = G(n[1]), r = G(n[2]);
|
|
2043
2108
|
if (t == null || r == null || r === 0) return null;
|
|
2044
2109
|
switch (e) {
|
|
2045
2110
|
case "nearest": return Math.round(t / r) * r;
|
|
@@ -2050,92 +2115,92 @@ function Wi(e) {
|
|
|
2050
2115
|
}
|
|
2051
2116
|
}
|
|
2052
2117
|
case "mod": {
|
|
2053
|
-
let e =
|
|
2118
|
+
let e = G(n[0]), t = G(n[1]);
|
|
2054
2119
|
return e == null || t == null || t === 0 ? null : (e % t + t) % t;
|
|
2055
2120
|
}
|
|
2056
2121
|
case "rem": {
|
|
2057
|
-
let e =
|
|
2122
|
+
let e = G(n[0]), t = G(n[1]);
|
|
2058
2123
|
return e == null || t == null || t === 0 ? null : e % t;
|
|
2059
2124
|
}
|
|
2060
2125
|
case "abs": {
|
|
2061
|
-
let e =
|
|
2126
|
+
let e = G(n[0]);
|
|
2062
2127
|
return e == null ? null : Math.abs(e);
|
|
2063
2128
|
}
|
|
2064
2129
|
case "sign": {
|
|
2065
|
-
let e =
|
|
2130
|
+
let e = G(n[0]);
|
|
2066
2131
|
return e == null ? null : Math.sign(e);
|
|
2067
2132
|
}
|
|
2068
2133
|
case "sin": {
|
|
2069
|
-
let e =
|
|
2134
|
+
let e = Yi(n[0]);
|
|
2070
2135
|
return e == null ? null : Math.sin(e);
|
|
2071
2136
|
}
|
|
2072
2137
|
case "cos": {
|
|
2073
|
-
let e =
|
|
2138
|
+
let e = Yi(n[0]);
|
|
2074
2139
|
return e == null ? null : Math.cos(e);
|
|
2075
2140
|
}
|
|
2076
2141
|
case "tan": {
|
|
2077
|
-
let e =
|
|
2142
|
+
let e = Yi(n[0]);
|
|
2078
2143
|
return e == null ? null : Math.tan(e);
|
|
2079
2144
|
}
|
|
2080
2145
|
case "asin": {
|
|
2081
|
-
let e =
|
|
2146
|
+
let e = G(n[0]);
|
|
2082
2147
|
return e == null ? null : Math.asin(e);
|
|
2083
2148
|
}
|
|
2084
2149
|
case "acos": {
|
|
2085
|
-
let e =
|
|
2150
|
+
let e = G(n[0]);
|
|
2086
2151
|
return e == null ? null : Math.acos(e);
|
|
2087
2152
|
}
|
|
2088
2153
|
case "atan": {
|
|
2089
|
-
let e =
|
|
2154
|
+
let e = G(n[0]);
|
|
2090
2155
|
return e == null ? null : Math.atan(e);
|
|
2091
2156
|
}
|
|
2092
2157
|
case "atan2": {
|
|
2093
|
-
let e =
|
|
2158
|
+
let e = G(n[0]), t = G(n[1]);
|
|
2094
2159
|
return e == null || t == null ? null : Math.atan2(e, t);
|
|
2095
2160
|
}
|
|
2096
2161
|
case "pow": {
|
|
2097
|
-
let e =
|
|
2162
|
+
let e = G(n[0]), t = G(n[1]);
|
|
2098
2163
|
return e == null || t == null ? null : e ** +t;
|
|
2099
2164
|
}
|
|
2100
2165
|
case "sqrt": {
|
|
2101
|
-
let e =
|
|
2166
|
+
let e = G(n[0]);
|
|
2102
2167
|
return e == null ? null : Math.sqrt(e);
|
|
2103
2168
|
}
|
|
2104
2169
|
case "hypot": {
|
|
2105
|
-
let e = n.map(
|
|
2170
|
+
let e = n.map(G);
|
|
2106
2171
|
return e.some((e) => e == null) ? null : Math.hypot(...e);
|
|
2107
2172
|
}
|
|
2108
2173
|
case "log": {
|
|
2109
|
-
let e =
|
|
2174
|
+
let e = G(n[0]);
|
|
2110
2175
|
if (e == null) return null;
|
|
2111
2176
|
if (n.length === 2) {
|
|
2112
|
-
let t =
|
|
2177
|
+
let t = G(n[1]);
|
|
2113
2178
|
return t == null ? null : Math.log(e) / Math.log(t);
|
|
2114
2179
|
}
|
|
2115
2180
|
return Math.log(e);
|
|
2116
2181
|
}
|
|
2117
2182
|
case "exp": {
|
|
2118
|
-
let e =
|
|
2183
|
+
let e = G(n[0]);
|
|
2119
2184
|
return e == null ? null : Math.exp(e);
|
|
2120
2185
|
}
|
|
2121
2186
|
default: return null;
|
|
2122
2187
|
}
|
|
2123
2188
|
}
|
|
2124
|
-
function
|
|
2125
|
-
let t =
|
|
2189
|
+
function Zi(e) {
|
|
2190
|
+
let t = Xi(e);
|
|
2126
2191
|
if (t == null) return null;
|
|
2127
|
-
let n =
|
|
2128
|
-
return new
|
|
2192
|
+
let n = Qi(e);
|
|
2193
|
+
return new Y(t, n?.unit, n?.superType);
|
|
2129
2194
|
}
|
|
2130
|
-
function
|
|
2131
|
-
if (e instanceof
|
|
2195
|
+
function Qi(e) {
|
|
2196
|
+
if (e instanceof Y) {
|
|
2132
2197
|
if (e.unit && e.unit !== "string" && typeof e.value == "number") {
|
|
2133
2198
|
let t = { unit: e.unit };
|
|
2134
2199
|
return e.superType && (t.superType = e.superType), t;
|
|
2135
2200
|
}
|
|
2136
2201
|
return;
|
|
2137
2202
|
}
|
|
2138
|
-
if (e instanceof
|
|
2203
|
+
if (e instanceof X) {
|
|
2139
2204
|
if ([
|
|
2140
2205
|
"asin",
|
|
2141
2206
|
"acos",
|
|
@@ -2146,34 +2211,34 @@ function Ki(e) {
|
|
|
2146
2211
|
superType: ["angle"]
|
|
2147
2212
|
};
|
|
2148
2213
|
for (let t of e.values) {
|
|
2149
|
-
let e =
|
|
2214
|
+
let e = Qi(t);
|
|
2150
2215
|
if (e) return e;
|
|
2151
2216
|
}
|
|
2152
2217
|
}
|
|
2153
2218
|
}
|
|
2154
|
-
var
|
|
2155
|
-
function
|
|
2156
|
-
let t =
|
|
2157
|
-
for (let e of t.keys())
|
|
2219
|
+
var K = (e) => new Y(e, "color", ["color", e.colorSpace], void 0, "color");
|
|
2220
|
+
function $i(e) {
|
|
2221
|
+
let t = Ar(e).value, n = t.clone();
|
|
2222
|
+
for (let e of t.keys()) Qn(n, e, P(Y.unwrapDeep(F(t, e))));
|
|
2158
2223
|
return n;
|
|
2159
2224
|
}
|
|
2160
|
-
var
|
|
2161
|
-
function
|
|
2162
|
-
if (
|
|
2163
|
-
let { mathFunction: e } =
|
|
2164
|
-
return
|
|
2165
|
-
}
|
|
2166
|
-
function
|
|
2167
|
-
let t =
|
|
2168
|
-
if (t instanceof
|
|
2169
|
-
if (t instanceof
|
|
2170
|
-
let n =
|
|
2225
|
+
var ea = null;
|
|
2226
|
+
function ta() {
|
|
2227
|
+
if (ea) return ea;
|
|
2228
|
+
let { mathFunction: e } = Ji(H.Value);
|
|
2229
|
+
return ea = qi(H.Value, e), ea;
|
|
2230
|
+
}
|
|
2231
|
+
function na(e) {
|
|
2232
|
+
let t = V(ta(), e);
|
|
2233
|
+
if (t instanceof Y) return t.value;
|
|
2234
|
+
if (t instanceof X) {
|
|
2235
|
+
let n = Zi(t);
|
|
2171
2236
|
if (n == null || typeof n.value != "number") throw Error(`Could not evaluate calc expression: ${e}`);
|
|
2172
2237
|
return n.value;
|
|
2173
2238
|
}
|
|
2174
2239
|
throw Error(`Could not evaluate calc expression: ${e}`);
|
|
2175
2240
|
}
|
|
2176
|
-
function
|
|
2241
|
+
function ra(e, t) {
|
|
2177
2242
|
switch (e.type) {
|
|
2178
2243
|
case "ref": return t[e.name] ?? 0;
|
|
2179
2244
|
case "literal": return e.value;
|
|
@@ -2181,31 +2246,31 @@ function Zi(e, t) {
|
|
|
2181
2246
|
case "calc": {
|
|
2182
2247
|
let n = e.expr, r = Object.keys(t).sort((e, t) => t.length - e.length);
|
|
2183
2248
|
for (let e of r) n = n.replace(RegExp(`\\b${e}\\b`, "g"), String(t[e]));
|
|
2184
|
-
return
|
|
2249
|
+
return na(n);
|
|
2185
2250
|
}
|
|
2186
2251
|
}
|
|
2187
2252
|
}
|
|
2188
|
-
function
|
|
2189
|
-
let i = N(
|
|
2253
|
+
function ia(e, t, n, r) {
|
|
2254
|
+
let i = N($i(e), t), a = {};
|
|
2190
2255
|
for (let [e, t] of i.entries()) a[e] = t;
|
|
2191
|
-
let o = n.map((e) =>
|
|
2192
|
-
return
|
|
2193
|
-
rgb:
|
|
2194
|
-
hsl:
|
|
2195
|
-
hwb:
|
|
2196
|
-
lab:
|
|
2197
|
-
lch:
|
|
2198
|
-
oklab:
|
|
2199
|
-
oklch:
|
|
2200
|
-
xyz:
|
|
2201
|
-
"srgb-linear":
|
|
2202
|
-
"display-p3":
|
|
2203
|
-
"a98-rgb":
|
|
2204
|
-
"prophoto-rgb":
|
|
2205
|
-
rec2020:
|
|
2206
|
-
}[t] ??
|
|
2207
|
-
}
|
|
2208
|
-
var
|
|
2256
|
+
let o = n.map((e) => ra(e, a)), s = r ? ra(r, a) : a.alpha ?? 1;
|
|
2257
|
+
return K(new ({
|
|
2258
|
+
rgb: L,
|
|
2259
|
+
hsl: hr,
|
|
2260
|
+
hwb: _r,
|
|
2261
|
+
lab: vr,
|
|
2262
|
+
lch: yr,
|
|
2263
|
+
oklab: br,
|
|
2264
|
+
oklch: xr,
|
|
2265
|
+
xyz: R,
|
|
2266
|
+
"srgb-linear": Cr,
|
|
2267
|
+
"display-p3": wr,
|
|
2268
|
+
"a98-rgb": Tr,
|
|
2269
|
+
"prophoto-rgb": Er,
|
|
2270
|
+
rec2020: Dr
|
|
2271
|
+
}[t] ?? L)(...o, s));
|
|
2272
|
+
}
|
|
2273
|
+
var aa = {
|
|
2209
2274
|
srgb: "rgb",
|
|
2210
2275
|
"srgb-linear": "srgb-linear",
|
|
2211
2276
|
"display-p3": "display-p3",
|
|
@@ -2221,118 +2286,138 @@ var $i = {
|
|
|
2221
2286
|
xyz: "xyz",
|
|
2222
2287
|
"xyz-d65": "xyz",
|
|
2223
2288
|
"xyz-d50": "xyz"
|
|
2224
|
-
},
|
|
2289
|
+
}, oa = {
|
|
2225
2290
|
srgb: {
|
|
2226
2291
|
space: "rgb",
|
|
2227
|
-
ctor:
|
|
2292
|
+
ctor: L
|
|
2228
2293
|
},
|
|
2229
2294
|
"srgb-linear": {
|
|
2230
2295
|
space: "srgb-linear",
|
|
2231
|
-
ctor:
|
|
2296
|
+
ctor: Cr
|
|
2232
2297
|
},
|
|
2233
2298
|
"display-p3": {
|
|
2234
2299
|
space: "display-p3",
|
|
2235
|
-
ctor:
|
|
2300
|
+
ctor: wr
|
|
2236
2301
|
},
|
|
2237
2302
|
"a98-rgb": {
|
|
2238
2303
|
space: "a98-rgb",
|
|
2239
|
-
ctor:
|
|
2304
|
+
ctor: Tr
|
|
2240
2305
|
},
|
|
2241
2306
|
"prophoto-rgb": {
|
|
2242
2307
|
space: "prophoto-rgb",
|
|
2243
|
-
ctor:
|
|
2308
|
+
ctor: Er
|
|
2244
2309
|
},
|
|
2245
2310
|
rec2020: {
|
|
2246
2311
|
space: "rec2020",
|
|
2247
|
-
ctor:
|
|
2312
|
+
ctor: Dr
|
|
2248
2313
|
},
|
|
2249
2314
|
xyz: {
|
|
2250
2315
|
space: "xyz",
|
|
2251
|
-
ctor:
|
|
2316
|
+
ctor: R
|
|
2252
2317
|
},
|
|
2253
2318
|
"xyz-d65": {
|
|
2254
2319
|
space: "xyz",
|
|
2255
|
-
ctor:
|
|
2320
|
+
ctor: R
|
|
2256
2321
|
},
|
|
2257
2322
|
"xyz-d50": {
|
|
2258
2323
|
space: "xyz",
|
|
2259
|
-
ctor:
|
|
2324
|
+
ctor: R
|
|
2260
2325
|
}
|
|
2261
|
-
},
|
|
2326
|
+
}, sa = a(","), ca = i(/\s+/), la = a("/"), ua = a("("), da = a(")"), fa = n(sa.trim(o), ca), pa = n(la.trim(o), fa), q = e.lazy(() => n(H.Percentage, H.Angle.map((e) => new Y(li(e.value, e.unit), "deg", ["angle"])), n(B, bi).map((e) => new Y(e)), yi.map(() => new Y(NaN)))), ma = n(z("calc").next(i(/\(([^)]+)\)/, (e) => e?.[1] ?? null)).map((e) => ({
|
|
2262
2327
|
type: "calc",
|
|
2263
2328
|
expr: e
|
|
2264
|
-
})),
|
|
2329
|
+
})), yi.map(() => ({ type: "none" })), i(/\b(alpha|r|g|b|h|s|l|c|w|a|x|y|z)\b/).map((e) => ({
|
|
2265
2330
|
type: "ref",
|
|
2266
2331
|
name: e
|
|
2267
|
-
})),
|
|
2332
|
+
})), q.map((e) => ({
|
|
2268
2333
|
type: "literal",
|
|
2269
2334
|
value: e.value
|
|
2270
|
-
}))),
|
|
2271
|
-
let r =
|
|
2272
|
-
return r.next(
|
|
2335
|
+
}))), J = (e) => {
|
|
2336
|
+
let r = z(e).skip(z("a").opt()), i = n(t(q.skip(pa), q), q.map((e) => [e])), a = t(q.skip(fa), q.skip(fa), i).trim(o).wrap(ua, da);
|
|
2337
|
+
return r.next(a).map(([e, t, [n, r]]) => [
|
|
2273
2338
|
e,
|
|
2274
2339
|
t,
|
|
2275
2340
|
n,
|
|
2276
|
-
r ?? new
|
|
2341
|
+
r ?? new Y(1)
|
|
2277
2342
|
]);
|
|
2278
2343
|
};
|
|
2279
|
-
function
|
|
2280
|
-
return
|
|
2344
|
+
function ha(n, r) {
|
|
2345
|
+
return z(n).skip(z("a").opt()).next(t(z("from").skip(o).next(e.lazy(() => Ra.Value)), o.next(ma), o.next(ma), o.next(ma), la.trim(o).next(ma).opt()).trim(o).wrap(ua, da)).map(([e, t, n, i, a]) => ia(e, r, [
|
|
2281
2346
|
t,
|
|
2282
2347
|
n,
|
|
2283
2348
|
i
|
|
2284
2349
|
], a));
|
|
2285
2350
|
}
|
|
2286
|
-
var
|
|
2287
|
-
let { r: t, g: n, b: r, alpha: i } =
|
|
2288
|
-
return
|
|
2289
|
-
}),
|
|
2290
|
-
let o =
|
|
2291
|
-
return c < 0 && l < 0 ? (c = .5, l = .5) : c < 0 ? c = 1 - l : l < 0 && (l = 1 - c),
|
|
2292
|
-
}),
|
|
2293
|
-
let a =
|
|
2351
|
+
var ga = i(/#[0-9a-fA-F]{3,8}/).map((e) => {
|
|
2352
|
+
let { r: t, g: n, b: r, alpha: i } = Qe(e);
|
|
2353
|
+
return K(new L(t, n, r, i));
|
|
2354
|
+
}), _a = B.skip(z("k")).map((e) => K(Ht(new Sr(e)))), va = n(ha("rgb", "rgb"), J("rgb").map(([e, t, n, r]) => K(new L(e, t, n, r)))), ya = n(ha("hsl", "hsl"), J("hsl").map(([e, t, n, r]) => K(new hr(e, t, n, r)))), ba = J("hsv").map(([e, t, n, r]) => K(new gr(e, t, n, r))), xa = n(ha("hwb", "hwb"), J("hwb").map(([e, t, n, r]) => K(new _r(e, t, n, r)))), Sa = n(ha("lab", "lab"), J("lab").map(([e, t, n, r]) => K(new vr(e, t, n, r)))), Ca = n(ha("lch", "lch"), J("lch").map(([e, t, n, r]) => K(new yr(e, t, n, r)))), wa = n(ha("oklab", "oklab"), J("oklab").map(([e, t, n, r]) => K(new br(e, t, n, r)))), Ta = n(ha("oklch", "oklch"), J("oklch").map(([e, t, n, r]) => K(new xr(e, t, n, r)))), Ea = n(ha("xyz", "xyz"), J("xyz").map(([e, t, n, r]) => K(new R(e, t, n, r)))), Da = n(z("srgb-linear").map(() => "srgb-linear"), z("srgb").map(() => "srgb"), z("display-p3").map(() => "display-p3"), z("a98-rgb").map(() => "a98-rgb"), z("prophoto-rgb").map(() => "prophoto-rgb"), z("rec2020").map(() => "rec2020"), z("oklab").map(() => "oklab"), z("oklch").map(() => "oklch"), z("lab").map(() => "lab"), z("lch").map(() => "lch"), z("hsl").map(() => "hsl"), z("hwb").map(() => "hwb"), z("xyz-d65").map(() => "xyz-d65"), z("xyz-d50").map(() => "xyz-d50"), z("xyz").map(() => "xyz")), Oa = n(z("shorter"), z("longer"), z("increasing"), z("decreasing")).skip(o).skip(z("hue")), ka = e.lazy(() => t(Ra.Value, o.next(H.Percentage).opt())), Aa = z("color-mix").next(t(z("in").skip(o).next(t(Da, o.next(Oa).opt())), a(",").trim(o).next(ka), a(",").trim(o).next(ka)).trim(o).wrap(ua, da)).map(([[e, t], [n, r], [i, a]]) => {
|
|
2355
|
+
let o = aa[e] ?? "oklab", s = t ?? "shorter", c = r == null ? -1 : r.value / 100, l = a == null ? -1 : a.value / 100;
|
|
2356
|
+
return c < 0 && l < 0 ? (c = .5, l = .5) : c < 0 ? c = 1 - l : l < 0 && (l = 1 - c), K(Un($i(n), $i(i), c, l, o, s));
|
|
2357
|
+
}), ja = n(z("srgb-linear").map(() => "srgb-linear"), z("srgb").map(() => "srgb"), z("display-p3").map(() => "display-p3"), z("a98-rgb").map(() => "a98-rgb"), z("prophoto-rgb").map(() => "prophoto-rgb"), z("rec2020").map(() => "rec2020"), z("xyz-d65").map(() => "xyz-d65"), z("xyz-d50").map(() => "xyz-d50"), z("xyz").map(() => "xyz")), Ma = z("color").next(t(ja.skip(o), q.skip(o), q.skip(o), n(t(q.skip(la.trim(o)), q), q.map((e) => [e, void 0]))).trim(o).wrap(ua, da)).map(([e, t, n, [r, i]]) => {
|
|
2358
|
+
let a = oa[e];
|
|
2294
2359
|
if (!a) throw Error(`Unknown color() space: ${e}`);
|
|
2295
|
-
let o = i ?? new
|
|
2360
|
+
let o = i ?? new Y(1);
|
|
2296
2361
|
if (e === "srgb") {
|
|
2297
2362
|
let e = (e) => e.value * 255;
|
|
2298
|
-
return
|
|
2363
|
+
return K(new L(e(t), e(n), e(r), o.value));
|
|
2299
2364
|
}
|
|
2300
2365
|
let s = new a.ctor(t, n, r, o);
|
|
2301
|
-
return e === "xyz-d50" && s instanceof
|
|
2302
|
-
}),
|
|
2366
|
+
return e === "xyz-d50" && s instanceof R && (s.whitePoint = "D50"), K(s);
|
|
2367
|
+
}), Na = new Set(Object.keys(ke)), Pa = i(/[a-zA-Z][a-zA-Z0-9-]*/).chain((e) => {
|
|
2303
2368
|
let t = e.toLowerCase();
|
|
2304
|
-
if (
|
|
2305
|
-
let e =
|
|
2369
|
+
if (Na.has(t)) {
|
|
2370
|
+
let e = ke[t];
|
|
2306
2371
|
if (e) {
|
|
2307
|
-
let t =
|
|
2308
|
-
if (t) return
|
|
2372
|
+
let t = Ui(e);
|
|
2373
|
+
if (t) return xi(t);
|
|
2309
2374
|
}
|
|
2310
2375
|
}
|
|
2311
|
-
return
|
|
2312
|
-
})
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
},
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
}
|
|
2330
|
-
var
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2376
|
+
return Si(`Invalid color name: ${e}`);
|
|
2377
|
+
}), Fa = {
|
|
2378
|
+
c: n(Aa, Ma, Pa),
|
|
2379
|
+
r: n(va, Pa),
|
|
2380
|
+
h: n(ya, ba, xa, Pa),
|
|
2381
|
+
l: n(Sa, Ca, Pa),
|
|
2382
|
+
o: n(wa, Ta, Pa),
|
|
2383
|
+
x: n(Ea, Pa)
|
|
2384
|
+
}, Ia = {
|
|
2385
|
+
"#": ga,
|
|
2386
|
+
"0-9": _a,
|
|
2387
|
+
"+": _a,
|
|
2388
|
+
"-": _a,
|
|
2389
|
+
".": _a
|
|
2390
|
+
};
|
|
2391
|
+
for (let e = 97; e <= 122; e++) {
|
|
2392
|
+
let t = String.fromCharCode(e), n = t.toUpperCase(), r = Fa[t] ?? Pa;
|
|
2393
|
+
Ia[t] = r, Ia[n] = r;
|
|
2394
|
+
}
|
|
2395
|
+
var La = r(Ia).trim(o), Ra = {
|
|
2396
|
+
Value: La,
|
|
2397
|
+
colorValue: q,
|
|
2398
|
+
componentExpr: ma,
|
|
2399
|
+
sep: fa,
|
|
2400
|
+
alphaSep: pa,
|
|
2401
|
+
div: la
|
|
2402
|
+
}, za = /* @__PURE__ */ new Map();
|
|
2403
|
+
function Ba(e) {
|
|
2404
|
+
for (let [t, n] of Object.entries(e)) za.set(t.trim().toLowerCase(), n);
|
|
2405
|
+
Ua.cache.clear();
|
|
2406
|
+
}
|
|
2407
|
+
function Va() {
|
|
2408
|
+
za.clear(), Ua.cache.clear();
|
|
2409
|
+
}
|
|
2410
|
+
function Ha() {
|
|
2411
|
+
return za;
|
|
2412
|
+
}
|
|
2413
|
+
var Ua = h((e) => {
|
|
2414
|
+
if (za.size > 0) {
|
|
2415
|
+
let t = e.trim().toLowerCase(), n = za.get(t);
|
|
2416
|
+
if (n) return V(La, n);
|
|
2417
|
+
}
|
|
2418
|
+
let t = Ci(La, e);
|
|
2419
|
+
return t.status ? t.value : V(La, e);
|
|
2420
|
+
}, { keyFn: (e) => e }), Y = class e {
|
|
2336
2421
|
value;
|
|
2337
2422
|
unit;
|
|
2338
2423
|
superType;
|
|
@@ -2372,14 +2457,14 @@ var Pa = m((e) => {
|
|
|
2372
2457
|
return new e(Number(this.value).toFixed(t).replace(/\.0+$/, "")).coalesce(this, !0).toString();
|
|
2373
2458
|
}
|
|
2374
2459
|
clone() {
|
|
2375
|
-
return new e(
|
|
2460
|
+
return new e(l(this.value), this.unit, l(this.superType), this.subProperty, this.property);
|
|
2376
2461
|
}
|
|
2377
2462
|
coalesce(t, n = !1) {
|
|
2378
2463
|
if (t == null) return this;
|
|
2379
|
-
let r =
|
|
2380
|
-
return this.unit != null && r.includes(this.unit) ? this : n ? (this.unit ??= t.unit, this.superType ??= t.superType, this.subProperty ??= t.subProperty, this.property ??= t.property, this.targets ??= t.targets, this) : new e(
|
|
2464
|
+
let r = Kr;
|
|
2465
|
+
return this.unit != null && r.includes(this.unit) ? this : n ? (this.unit ??= t.unit, this.superType ??= t.superType, this.subProperty ??= t.subProperty, this.property ??= t.property, this.targets ??= t.targets, this) : new e(l(this.value), this.unit ?? t.unit, l(this.superType ?? t.superType), this.subProperty ?? t.subProperty, this.property ?? t.property, this.targets ?? t.targets);
|
|
2381
2466
|
}
|
|
2382
|
-
},
|
|
2467
|
+
}, X = class e {
|
|
2383
2468
|
name;
|
|
2384
2469
|
values;
|
|
2385
2470
|
constructor(e, t) {
|
|
@@ -2411,7 +2496,7 @@ var Pa = m((e) => {
|
|
|
2411
2496
|
clone() {
|
|
2412
2497
|
return new e(this.name, this.values.map((e) => e.clone()));
|
|
2413
2498
|
}
|
|
2414
|
-
},
|
|
2499
|
+
}, Wa = class e extends Array {
|
|
2415
2500
|
constructor(...e) {
|
|
2416
2501
|
super(...e);
|
|
2417
2502
|
}
|
|
@@ -2439,22 +2524,22 @@ var Pa = m((e) => {
|
|
|
2439
2524
|
clone() {
|
|
2440
2525
|
return new e(...this.map((e) => e.clone()));
|
|
2441
2526
|
}
|
|
2442
|
-
},
|
|
2443
|
-
let t = e.lazy(() => n(
|
|
2444
|
-
return
|
|
2445
|
-
}, { mathFunction:
|
|
2527
|
+
}, Ga = a("("), Ka = a(")"), qa = a(","), Ja = e.lazy(() => po.sepBy(n(qa, o)).trim(o).map((e) => new Wa(...e))), Ya = (e) => t(e || vi, Ja.wrap(Ga, Ka)), Xa = () => {
|
|
2528
|
+
let t = e.lazy(() => n(i(/[^()]+/), t.many(1).wrap(Ga, Ka).map((e) => `(${e.flat().join("")})`)).many(1));
|
|
2529
|
+
return a("var").next(t.trim(o).wrap(Ga, Ka).map((e) => [e].flat(Infinity).join(""))).map((e) => new Y(e, "var"));
|
|
2530
|
+
}, { mathFunction: Za, calcFn: Qa } = Ji(H.Value), $a = [
|
|
2446
2531
|
"translate",
|
|
2447
2532
|
"scale",
|
|
2448
2533
|
"rotate",
|
|
2449
2534
|
"skew"
|
|
2450
|
-
],
|
|
2535
|
+
], eo = [
|
|
2451
2536
|
"x",
|
|
2452
2537
|
"y",
|
|
2453
2538
|
"z"
|
|
2454
|
-
],
|
|
2455
|
-
let e = t(n(...
|
|
2456
|
-
return
|
|
2457
|
-
let i = e.toLowerCase(), a = i === "skew" ?
|
|
2539
|
+
], to = eo.map(z), no = $a.map(z), ro = () => {
|
|
2540
|
+
let e = t(n(...no), n(...to, a(""))), r = (e, t) => e + t.toUpperCase();
|
|
2541
|
+
return Ya(e).map(([[e, t], n]) => {
|
|
2542
|
+
let i = e.toLowerCase(), a = i === "skew" ? eo.filter((e) => e !== "z") : eo, o = {};
|
|
2458
2543
|
if (t) {
|
|
2459
2544
|
let e = i + t.toUpperCase();
|
|
2460
2545
|
o[e] = n[0];
|
|
@@ -2465,14 +2550,14 @@ var Pa = m((e) => {
|
|
|
2465
2550
|
let n = r(i, a[t]);
|
|
2466
2551
|
o[n] = e;
|
|
2467
2552
|
});
|
|
2468
|
-
return new
|
|
2553
|
+
return new Wa(...Object.entries(o).map(([e, t]) => new X(e, [t])));
|
|
2469
2554
|
});
|
|
2470
|
-
},
|
|
2555
|
+
}, io = {
|
|
2471
2556
|
left: 270,
|
|
2472
2557
|
right: 90,
|
|
2473
2558
|
top: 0,
|
|
2474
2559
|
bottom: 180
|
|
2475
|
-
},
|
|
2560
|
+
}, ao = {
|
|
2476
2561
|
"top left": 315,
|
|
2477
2562
|
"left top": 315,
|
|
2478
2563
|
"top right": 45,
|
|
@@ -2481,7 +2566,7 @@ var Pa = m((e) => {
|
|
|
2481
2566
|
"right bottom": 135,
|
|
2482
2567
|
"bottom left": 225,
|
|
2483
2568
|
"left bottom": 225
|
|
2484
|
-
},
|
|
2569
|
+
}, oo = () => {
|
|
2485
2570
|
let e = n(...[
|
|
2486
2571
|
"linear-gradient",
|
|
2487
2572
|
"radial-gradient",
|
|
@@ -2489,37 +2574,37 @@ var Pa = m((e) => {
|
|
|
2489
2574
|
"repeating-linear-gradient",
|
|
2490
2575
|
"repeating-radial-gradient",
|
|
2491
2576
|
"repeating-conic-gradient"
|
|
2492
|
-
].map(
|
|
2577
|
+
].map(z)), r = n(...[
|
|
2493
2578
|
"left",
|
|
2494
2579
|
"right",
|
|
2495
2580
|
"top",
|
|
2496
2581
|
"bottom"
|
|
2497
|
-
].map(
|
|
2498
|
-
let n =
|
|
2582
|
+
].map(z)), i = n(t(a("to").skip(o), r.skip(o), r).map(([, e, t]) => {
|
|
2583
|
+
let n = ao[`${e.toLowerCase()} ${t.toLowerCase()}`];
|
|
2499
2584
|
if (n == null) throw Error(`Invalid gradient corner: to ${e} ${t}`);
|
|
2500
|
-
return new
|
|
2501
|
-
}), t(
|
|
2502
|
-
return t(e, t(n(s, c).skip(
|
|
2503
|
-
},
|
|
2585
|
+
return new Y(n, "deg");
|
|
2586
|
+
}), t(a("to").skip(o), r).map(([, e]) => new Y(io[e.toLowerCase()], "deg"))), s = t(z("from").skip(o), H.Angle).map(([, e]) => e), c = n(H.Angle, i), l = n(H.Length, H.Percentage), u = t(H.Color, l.sepBy(o)).map(([e, t]) => !t || t.length === 0 ? [e] : [e, ...t]), d = t(u, qa.trim(o).next(n(u, l)).many()).map(([e, t]) => [e, ...t]);
|
|
2587
|
+
return t(e, t(n(s, c).skip(qa).opt(), d).trim(o).wrap(Ga, Ka).map(([e, t]) => e ? [e, ...t].flat() : [t])).map(([e, t]) => new X(e, t));
|
|
2588
|
+
}, so = () => Ya(a("cubic-bezier")).map((e) => new X("cubic-bezier", e[1])), co = [
|
|
2504
2589
|
"inherit",
|
|
2505
2590
|
"initial",
|
|
2506
2591
|
"unset",
|
|
2507
2592
|
"revert",
|
|
2508
2593
|
"revert-layer"
|
|
2509
|
-
],
|
|
2510
|
-
Function:
|
|
2511
|
-
Value:
|
|
2512
|
-
FunctionArgs:
|
|
2513
|
-
},
|
|
2594
|
+
], lo = n(...co.map(z)).map((e) => new Y(e.toLowerCase(), "string", ["keyword"])), uo = i(/[^\(\)\{\}\s,;]+/).map((e) => new Y(e)), fo = n(ro(), Xa(), Za, oo(), so(), Ya().map(([e, t]) => new X(e, t))), po = n(lo, H.Value, fo, uo).trim(o), mo = {
|
|
2595
|
+
Function: fo,
|
|
2596
|
+
Value: po,
|
|
2597
|
+
FunctionArgs: Ja
|
|
2598
|
+
}, ho = t(a("{"), i(/[^{}]+/), a("}")).map((e) => {
|
|
2514
2599
|
let t = e.join("\n");
|
|
2515
|
-
return new
|
|
2516
|
-
}),
|
|
2517
|
-
Value:
|
|
2518
|
-
Values:
|
|
2519
|
-
},
|
|
2600
|
+
return new Y(JSON.parse(t), "json");
|
|
2601
|
+
}), go = n(lo, Za, H.Value, fo, ho, uo).trim(o), _o = {
|
|
2602
|
+
Value: go,
|
|
2603
|
+
Values: go.sepBy(o)
|
|
2604
|
+
}, vo = h((e) => V(go, e), { keyFn: (e) => e }), yo = h((e) => V(H.Percentage, String(e)).valueOf(), { keyFn: (e) => String(e) }), bo = h((e) => V(H.Time.map((e) => e.unit === "ms" ? e.value : e.unit === "s" ? e.value * 1e3 : e.value), e), { keyFn: (e) => e }), xo = (e) => typeof e == "string" && Fr.includes(e), So = (e) => typeof e == "string" && Lr.includes(e), Co = (e) => typeof e == "string" && Ir.includes(e), wo = (e) => typeof e == "string" && Br.includes(e), To = (e) => typeof e == "string" && Hr.includes(e), Eo = (e, t) => {
|
|
2520
2605
|
if (typeof e != "number" || !Number.isFinite(e)) throw TypeError(`Expected numeric ${t}, got ${String(e)}.`);
|
|
2521
2606
|
return e;
|
|
2522
|
-
},
|
|
2607
|
+
}, Do = new Set([
|
|
2523
2608
|
"scaleX",
|
|
2524
2609
|
"scaleY",
|
|
2525
2610
|
"scaleZ",
|
|
@@ -2536,58 +2621,63 @@ var Pa = m((e) => {
|
|
|
2536
2621
|
"perspectiveY",
|
|
2537
2622
|
"perspectiveZ",
|
|
2538
2623
|
"perspectiveW"
|
|
2539
|
-
]),
|
|
2540
|
-
let t =
|
|
2541
|
-
return t === void 0 && (t =
|
|
2542
|
-
},
|
|
2624
|
+
]), Oo = (e) => Do.has(e), ko = /* @__PURE__ */ new WeakMap(), Ao = 0, jo = (e) => {
|
|
2625
|
+
let t = ko.get(e);
|
|
2626
|
+
return t === void 0 && (t = Ao++, ko.set(e, t)), t;
|
|
2627
|
+
}, Mo = /* @__PURE__ */ new WeakMap(), No = 0, Po = (e) => {
|
|
2628
|
+
let t = Mo.get(e);
|
|
2629
|
+
return t === void 0 && (t = No++, Mo.set(e, t)), t;
|
|
2630
|
+
}, Fo = (e) => e, Io = 0, Lo = () => Io, Ro = () => (Io++, Bo.cache.clear(), Io), zo = !1;
|
|
2631
|
+
zo || typeof window > "u" || typeof window.addEventListener != "function" || (zo = !0, window.addEventListener("resize", () => Ro(), { passive: !0 }));
|
|
2632
|
+
var Bo = h((e, t) => (() => {
|
|
2543
2633
|
if (!t) return e;
|
|
2544
|
-
if (e.unit === "var") return
|
|
2634
|
+
if (e.unit === "var") return Ui(getComputedStyle(t).getPropertyValue(e.value));
|
|
2545
2635
|
if (e.unit === "calc" && e.property && e.subProperty && e.value) {
|
|
2546
|
-
let n = e.property, r =
|
|
2636
|
+
let n = e.property, r = Fo(t.style), i = r[n] ?? "";
|
|
2547
2637
|
r[n] = e.subProperty ? `${e.subProperty}(${e.toString()})` : e.toString();
|
|
2548
2638
|
let a = getComputedStyle(t).getPropertyValue(n);
|
|
2549
2639
|
r[n] = i;
|
|
2550
|
-
let o =
|
|
2551
|
-
if (o instanceof
|
|
2640
|
+
let o = vo(a);
|
|
2641
|
+
if (o instanceof Y) return o;
|
|
2552
2642
|
if (o.name.startsWith("matrix")) {
|
|
2553
|
-
let t =
|
|
2554
|
-
if (
|
|
2643
|
+
let t = ei(o);
|
|
2644
|
+
if (Oo(e.subProperty)) {
|
|
2555
2645
|
let n = t[e.subProperty];
|
|
2556
|
-
if (n != null) return new
|
|
2646
|
+
if (n != null) return new Y(n, "px", ["length", "absolute"]);
|
|
2557
2647
|
}
|
|
2558
2648
|
}
|
|
2559
2649
|
}
|
|
2560
2650
|
return e;
|
|
2561
2651
|
})().coalesce(e), {
|
|
2562
|
-
keyFn: (e, t) => `${e
|
|
2652
|
+
keyFn: (e, t) => `${Po(e)}-${t ? jo(t) : "null"}`,
|
|
2563
2653
|
shouldCache: (e, t, n) => !n || n.isConnected
|
|
2564
|
-
}),
|
|
2654
|
+
}), Vo = (e, t, n = !1) => {
|
|
2565
2655
|
if (e?.superType?.[0] !== t?.superType?.[0]) return n ? [e, t] : [e.clone(), t.clone()];
|
|
2566
2656
|
let r = (e) => {
|
|
2567
|
-
let t = e?.superType?.[0], n =
|
|
2657
|
+
let t = e?.superType?.[0], n = Eo(e.value, "ValueUnit");
|
|
2568
2658
|
switch (t) {
|
|
2569
2659
|
case "length":
|
|
2570
|
-
if (!
|
|
2660
|
+
if (!xo(e.unit)) throw TypeError(`Unsupported length unit: ${String(e.unit)}`);
|
|
2571
2661
|
return {
|
|
2572
|
-
value:
|
|
2662
|
+
value: si(n, e.unit, e.targets?.[0]),
|
|
2573
2663
|
unit: "px"
|
|
2574
2664
|
};
|
|
2575
2665
|
case "angle":
|
|
2576
|
-
if (!
|
|
2666
|
+
if (!So(e.unit)) throw TypeError(`Unsupported angle unit: ${String(e.unit)}`);
|
|
2577
2667
|
return {
|
|
2578
|
-
value:
|
|
2668
|
+
value: li(n, e.unit),
|
|
2579
2669
|
unit: "deg"
|
|
2580
2670
|
};
|
|
2581
2671
|
case "time":
|
|
2582
|
-
if (!
|
|
2672
|
+
if (!Co(e.unit)) throw TypeError(`Unsupported time unit: ${String(e.unit)}`);
|
|
2583
2673
|
return {
|
|
2584
|
-
value:
|
|
2674
|
+
value: ci(n, e.unit),
|
|
2585
2675
|
unit: "ms"
|
|
2586
2676
|
};
|
|
2587
2677
|
case "resolution":
|
|
2588
|
-
if (!
|
|
2678
|
+
if (!wo(e.unit)) throw TypeError(`Unsupported resolution unit: ${String(e.unit)}`);
|
|
2589
2679
|
return {
|
|
2590
|
-
value:
|
|
2680
|
+
value: di(n, e.unit),
|
|
2591
2681
|
unit: "dpi"
|
|
2592
2682
|
};
|
|
2593
2683
|
default: return {
|
|
@@ -2596,9 +2686,9 @@ var Pa = m((e) => {
|
|
|
2596
2686
|
};
|
|
2597
2687
|
}
|
|
2598
2688
|
}, [i, a] = [r(e), r(t)];
|
|
2599
|
-
return n ? (e.value = i.value, e.unit = i.unit, t.value = a.value, t.unit = a.unit, [e, t]) : [new
|
|
2600
|
-
},
|
|
2601
|
-
function
|
|
2689
|
+
return n ? (e.value = i.value, e.unit = i.unit, t.value = a.value, t.unit = a.unit, [e, t]) : [new Y(i.value, i.unit, e.superType, e.subProperty, e.property, e.targets), new Y(a.value, a.unit, t.superType, t.subProperty, t.property, t.targets)];
|
|
2690
|
+
}, Ho = (e) => e.unit === "color";
|
|
2691
|
+
function Uo(e, t, n = {}) {
|
|
2602
2692
|
let r = n.colorSpace ?? "oklab", i = n.hueMethod;
|
|
2603
2693
|
e = e.coalesce(t), t = t.coalesce(e);
|
|
2604
2694
|
let a = {
|
|
@@ -2607,43 +2697,78 @@ function Do(e, t, n = {}) {
|
|
|
2607
2697
|
value: e.clone(),
|
|
2608
2698
|
computed: !1
|
|
2609
2699
|
};
|
|
2610
|
-
if (
|
|
2611
|
-
let [n, o] =
|
|
2700
|
+
if (Ho(e) && Ho(t)) {
|
|
2701
|
+
let [n, o] = Mr(e, t, r, !1, !0, !1, i);
|
|
2612
2702
|
a.start = n, a.stop = o, a.value = n.clone(), a.colorSpace = r, i && (a.hueMethod = i);
|
|
2613
2703
|
}
|
|
2614
2704
|
if (e.unit !== t.unit) {
|
|
2615
|
-
let [n, r] =
|
|
2705
|
+
let [n, r] = Vo(e, t, !0);
|
|
2616
2706
|
a.start = n, a.stop = r, a.value = n.clone();
|
|
2617
2707
|
}
|
|
2618
|
-
return a.computed =
|
|
2619
|
-
}
|
|
2620
|
-
function
|
|
2621
|
-
let i = t.targets?.[0] ??
|
|
2622
|
-
if (!
|
|
2623
|
-
let
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
}
|
|
2708
|
+
return a.computed = To(e.unit) || To(t.unit), a;
|
|
2709
|
+
}
|
|
2710
|
+
function Wo(e, t) {
|
|
2711
|
+
let { start: n, stop: r, value: i } = t, a = n.targets?.[0] ?? r.targets?.[0];
|
|
2712
|
+
if (!a) throw Error("Cannot interpolate computed values without a target element.");
|
|
2713
|
+
let o = Lo(), s = t._computedCache;
|
|
2714
|
+
if (s === void 0 || s.target !== a || s.epoch !== o) {
|
|
2715
|
+
let e = Bo(n, a), c = Bo(r, a), l = Hr.includes(e.unit ?? "") ? c.unit : e.unit;
|
|
2716
|
+
s = {
|
|
2717
|
+
startN: e.value,
|
|
2718
|
+
stopN: c.value,
|
|
2719
|
+
unit: l,
|
|
2720
|
+
target: a,
|
|
2721
|
+
epoch: o
|
|
2722
|
+
}, t._computedCache = s, i.unit = s.unit;
|
|
2723
|
+
}
|
|
2724
|
+
return i.value = b(s.startN, s.stopN, e), i;
|
|
2725
|
+
}
|
|
2726
|
+
function Go(e, t) {
|
|
2727
|
+
let { value: n, _colorPlan: r, hueMethod: i } = t;
|
|
2728
|
+
if (r) {
|
|
2729
|
+
let { keys: t, startN: a, stopN: o, hueIndex: s, dstVU: c } = r, l = n.value;
|
|
2730
|
+
for (let n = 0; n < t.length; n++) {
|
|
2731
|
+
let r = a[n], u = o[n], d = n === s ? Hn(r, u, e, i) * 360 : b(r, u, e), f = c[n];
|
|
2732
|
+
f == null ? Qn(l, t[n], P(d)) : f.value = d;
|
|
2733
|
+
}
|
|
2734
|
+
return n;
|
|
2735
|
+
}
|
|
2736
|
+
let { start: a, stop: o, colorSpace: s } = t, c = s ? Vn[s] : void 0;
|
|
2737
|
+
return a.value.keys().forEach((t) => {
|
|
2738
|
+
let r = F(a.value, t), s = F(o.value, t), l = Y.unwrapDeep(r), u = Y.unwrapDeep(s), d;
|
|
2739
|
+
d = t === c ? Hn(l / 360, u / 360, e, i) * 360 : b(l, u, e);
|
|
2740
|
+
let f = F(n.value, t);
|
|
2741
|
+
f instanceof Y ? f.value = d : Qn(n.value, t, P(d));
|
|
2742
|
+
}), n;
|
|
2634
2743
|
}
|
|
2635
|
-
function
|
|
2744
|
+
function Ko(e, { start: t, stop: n, value: r }) {
|
|
2636
2745
|
return r.value = b(t.value, n.value, e), r;
|
|
2637
2746
|
}
|
|
2638
|
-
function
|
|
2747
|
+
function qo(e, t) {
|
|
2639
2748
|
if (t._lerp) return t._lerp(e, t);
|
|
2640
2749
|
let { start: n, stop: r, computed: i } = t;
|
|
2641
|
-
return typeof n.value == "number" && typeof r.value == "number" ? (t.value.value = b(n.value, r.value, e), t.value) : n.unit === "color" ?
|
|
2750
|
+
return typeof n.value == "number" && typeof r.value == "number" ? (t.value.value = b(n.value, r.value, e), t.value) : n.unit === "color" ? Go(e, t) : i ? Wo(e, t) : t.value;
|
|
2642
2751
|
}
|
|
2643
|
-
function
|
|
2644
|
-
return e._lerp = e.computed ?
|
|
2752
|
+
function Jo(e) {
|
|
2753
|
+
return e._lerp = e.computed ? Wo : e.start.unit === "color" ? Go : Ko, !e.computed && e.start.unit === "color" && (e._colorPlan = Yo(e)), e;
|
|
2645
2754
|
}
|
|
2646
|
-
function
|
|
2755
|
+
function Yo(e) {
|
|
2756
|
+
let { start: t, stop: n, value: r, colorSpace: i } = e, a = i ? Vn[i] : void 0, o = t.value.keys(), s = o.length, c = new Float64Array(s), l = new Float64Array(s), u = Array(s).fill(null), d = -1;
|
|
2757
|
+
for (let e = 0; e < s; e++) {
|
|
2758
|
+
let i = o[e], s = Y.unwrapDeep(F(t.value, i)), f = Y.unwrapDeep(F(n.value, i));
|
|
2759
|
+
i === a ? (d = e, c[e] = s / 360, l[e] = f / 360) : (c[e] = s, l[e] = f);
|
|
2760
|
+
let p = F(r.value, i);
|
|
2761
|
+
u[e] = p instanceof Y ? p : null;
|
|
2762
|
+
}
|
|
2763
|
+
return {
|
|
2764
|
+
keys: o,
|
|
2765
|
+
startN: c,
|
|
2766
|
+
stopN: l,
|
|
2767
|
+
hueIndex: d,
|
|
2768
|
+
dstVU: u
|
|
2769
|
+
};
|
|
2770
|
+
}
|
|
2771
|
+
function Xo(e, t, n = "oklab", r = "shorter") {
|
|
2647
2772
|
if (e.length === 0) throw Error("mixColorsN requires at least one color");
|
|
2648
2773
|
if (e.length === 1) return e[0];
|
|
2649
2774
|
let i = t ?? e.map(() => 1);
|
|
@@ -2658,89 +2783,89 @@ function No(e, t, n = "oklab", r = "shorter") {
|
|
|
2658
2783
|
let a = i[t], c = s + a;
|
|
2659
2784
|
if (c === 0) continue;
|
|
2660
2785
|
let l = s / c, u = a / c;
|
|
2661
|
-
o =
|
|
2786
|
+
o = Un(o, e[t], l, u, n, r), s = c;
|
|
2662
2787
|
}
|
|
2663
2788
|
return o;
|
|
2664
2789
|
}
|
|
2665
|
-
function
|
|
2790
|
+
function Zo(e) {
|
|
2666
2791
|
let t = (t, n = 1) => Math.round(e[t] * n);
|
|
2667
2792
|
return `invert(${t(0)}%) sepia(${t(1)}%) saturate(${t(2)}%) hue-rotate(${t(3, 3.6)}deg) brightness(${t(4)}%) contrast(${t(5)}%)`;
|
|
2668
2793
|
}
|
|
2669
|
-
var
|
|
2794
|
+
var Qo = (e) => [
|
|
2670
2795
|
e.r,
|
|
2671
2796
|
e.g,
|
|
2672
2797
|
e.b
|
|
2673
|
-
],
|
|
2674
|
-
let t =
|
|
2675
|
-
return
|
|
2676
|
-
},
|
|
2677
|
-
function
|
|
2798
|
+
], $o = (e, t, n) => new L(e, t, n), es = (e, t, n) => new hr(e, t, n), ts = (e) => {
|
|
2799
|
+
let t = Xt(e);
|
|
2800
|
+
return es(t.h, t.s, t.l);
|
|
2801
|
+
}, ns = 1, rs = 1 / 6, is = 5, as = 15, os = 100, ss = 7500, cs = 200, ls = 360, us = 50, ds = 20, fs = 3750, ps = 50, ms = 100, hs = 100, gs = .2126, _s = .7152, vs = .0722;
|
|
2802
|
+
function ys(e, t = 0) {
|
|
2678
2803
|
let n = Math.sin(t * Math.PI / 180), r = Math.cos(t * Math.PI / 180);
|
|
2679
|
-
return
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2804
|
+
return Ps(e, [
|
|
2805
|
+
gs + r * (1 - gs) - n * gs,
|
|
2806
|
+
_s - r * _s - n * _s,
|
|
2807
|
+
vs - r * vs + n * (1 - vs),
|
|
2808
|
+
gs - r * gs + n * .143,
|
|
2809
|
+
_s + r * (1 - _s) + n * .14,
|
|
2810
|
+
vs - r * vs - n * .283,
|
|
2811
|
+
gs - r * gs - n * (1 - gs),
|
|
2812
|
+
_s - r * _s + n * _s,
|
|
2813
|
+
vs + r * (1 - vs) + n * vs
|
|
2689
2814
|
]);
|
|
2690
2815
|
}
|
|
2691
|
-
var
|
|
2692
|
-
function
|
|
2693
|
-
return
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2816
|
+
var bs = .393, xs = .769, Ss = .189, Cs = .349, ws = .686, Ts = .168, Es = .272, Ds = .534, Os = .131;
|
|
2817
|
+
function ks(e, t = 1) {
|
|
2818
|
+
return Ps(e, [
|
|
2819
|
+
bs + (1 - bs) * (1 - t),
|
|
2820
|
+
xs - xs * (1 - t),
|
|
2821
|
+
Ss - Ss * (1 - t),
|
|
2822
|
+
Cs - Cs * (1 - t),
|
|
2823
|
+
ws + (1 - ws) * (1 - t),
|
|
2824
|
+
Ts - Ts * (1 - t),
|
|
2825
|
+
Es - Es * (1 - t),
|
|
2826
|
+
Ds - Ds * (1 - t),
|
|
2827
|
+
Os + (1 - Os) * (1 - t)
|
|
2703
2828
|
]);
|
|
2704
2829
|
}
|
|
2705
|
-
var
|
|
2706
|
-
function
|
|
2707
|
-
return
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2830
|
+
var As = .213, js = .715, Ms = .072;
|
|
2831
|
+
function Ns(e, t = 1) {
|
|
2832
|
+
return Ps(e, [
|
|
2833
|
+
As + (1 - As) * t,
|
|
2834
|
+
js - js * t,
|
|
2835
|
+
Ms - Ms * t,
|
|
2836
|
+
As - As * t,
|
|
2837
|
+
js + (1 - js) * t,
|
|
2838
|
+
Ms - Ms * t,
|
|
2839
|
+
As - As * t,
|
|
2840
|
+
js - js * t,
|
|
2841
|
+
Ms + (1 - Ms) * t
|
|
2717
2842
|
]);
|
|
2718
2843
|
}
|
|
2719
|
-
function
|
|
2720
|
-
let n = x(
|
|
2721
|
-
return
|
|
2844
|
+
function Ps(e, t) {
|
|
2845
|
+
let n = x(Qo(e), t);
|
|
2846
|
+
return $o(v(n[0], 0, 255), v(n[1], 0, 255), v(n[2], 0, 255));
|
|
2722
2847
|
}
|
|
2723
|
-
function
|
|
2724
|
-
return
|
|
2848
|
+
function Fs(e, t = 1) {
|
|
2849
|
+
return Ls(e, t);
|
|
2725
2850
|
}
|
|
2726
|
-
function
|
|
2727
|
-
return
|
|
2851
|
+
function Is(e, t = 1) {
|
|
2852
|
+
return Ls(e, t, -(.5 * t) + .5);
|
|
2728
2853
|
}
|
|
2729
|
-
function
|
|
2730
|
-
let r =
|
|
2731
|
-
return
|
|
2854
|
+
function Ls(e, t = 1, n = 0) {
|
|
2855
|
+
let r = Qo(e);
|
|
2856
|
+
return $o(v(r[0] * t + n * 255, 0, 255), v(r[1] * t + n * 255, 0, 255), v(r[2] * t + n * 255, 0, 255));
|
|
2732
2857
|
}
|
|
2733
|
-
function
|
|
2734
|
-
let n =
|
|
2735
|
-
return
|
|
2858
|
+
function Rs(e, t = 1) {
|
|
2859
|
+
let n = Qo(e);
|
|
2860
|
+
return $o(v((t + n[0] / 255 * (1 - 2 * t)) * 255, 0, 255), v((t + n[1] / 255 * (1 - 2 * t)) * 255, 0, 255), v((t + n[2] / 255 * (1 - 2 * t)) * 255, 0, 255));
|
|
2736
2861
|
}
|
|
2737
|
-
function
|
|
2738
|
-
let r =
|
|
2739
|
-
r =
|
|
2740
|
-
let i =
|
|
2862
|
+
function zs(e, t, n) {
|
|
2863
|
+
let r = $o(0, 0, 0);
|
|
2864
|
+
r = Rs(r, e[0] / 100), r = ks(r, e[1] / 100), r = Ns(r, e[2] / 100), r = ys(r, e[3] * 3.6), r = Fs(r, e[4] / 100), r = Is(r, e[5] / 100);
|
|
2865
|
+
let i = ts(r);
|
|
2741
2866
|
return Math.abs(r.r - t.r) + Math.abs(r.g - t.g) + Math.abs(r.b - t.b) + Math.abs(i.h - n.h) + Math.abs(i.s - n.s) + Math.abs(i.l - n.l);
|
|
2742
2867
|
}
|
|
2743
|
-
function
|
|
2868
|
+
function Bs(e, t, n, r, i, a, o) {
|
|
2744
2869
|
let s = null, c = Infinity, l = [
|
|
2745
2870
|
,
|
|
2746
2871
|
,
|
|
@@ -2764,14 +2889,14 @@ function Ss(e, t, n, r, i, a, o) {
|
|
|
2764
2889
|
,
|
|
2765
2890
|
];
|
|
2766
2891
|
for (let f = 0; f < i; f++) {
|
|
2767
|
-
let i = n / (f + 1) ** +
|
|
2892
|
+
let i = n / (f + 1) ** +rs;
|
|
2768
2893
|
for (let e = 0; e < 6; e++) l[e] = Math.random() > .5 ? 1 : -1, u[e] = r[e] + i * l[e], d[e] = r[e] - i * l[e];
|
|
2769
|
-
let p =
|
|
2894
|
+
let p = zs(u, a, o) - zs(d, a, o);
|
|
2770
2895
|
for (let n = 0; n < 6; n++) {
|
|
2771
|
-
let a = p / (2 * i) * l[n], o = t[n] / (e + f + 1) ** +
|
|
2772
|
-
r[n] =
|
|
2896
|
+
let a = p / (2 * i) * l[n], o = t[n] / (e + f + 1) ** +ns;
|
|
2897
|
+
r[n] = Vs(r[n] - o * a, n);
|
|
2773
2898
|
}
|
|
2774
|
-
let m =
|
|
2899
|
+
let m = zs(r, a, o);
|
|
2775
2900
|
m < c && (s = [...r], c = m);
|
|
2776
2901
|
}
|
|
2777
2902
|
return {
|
|
@@ -2779,13 +2904,13 @@ function Ss(e, t, n, r, i, a, o) {
|
|
|
2779
2904
|
loss: c
|
|
2780
2905
|
};
|
|
2781
2906
|
}
|
|
2782
|
-
function
|
|
2783
|
-
let n =
|
|
2784
|
-
return t === 2 ? n =
|
|
2907
|
+
function Vs(e, t) {
|
|
2908
|
+
let n = os;
|
|
2909
|
+
return t === 2 ? n = ss : (t === 4 || t === 5) && (n = cs), t === 3 ? (e % ls + ls) % ls : v(e, 0, n);
|
|
2785
2910
|
}
|
|
2786
|
-
function
|
|
2911
|
+
function Hs(e, t, n) {
|
|
2787
2912
|
let r = e.loss, i = r + 1;
|
|
2788
|
-
return
|
|
2913
|
+
return Bs(r, [
|
|
2789
2914
|
.25 * i,
|
|
2790
2915
|
.25 * i,
|
|
2791
2916
|
i,
|
|
@@ -2794,7 +2919,7 @@ function ws(e, t, n) {
|
|
|
2794
2919
|
.2 * i
|
|
2795
2920
|
], 2, e.values, 500, t, n);
|
|
2796
2921
|
}
|
|
2797
|
-
function
|
|
2922
|
+
function Us(e, t) {
|
|
2798
2923
|
let n = [
|
|
2799
2924
|
60,
|
|
2800
2925
|
180,
|
|
@@ -2807,34 +2932,34 @@ function Ts(e, t) {
|
|
|
2807
2932
|
values: []
|
|
2808
2933
|
};
|
|
2809
2934
|
for (let i = 0; i < 3; i++) if (r.loss > 25) {
|
|
2810
|
-
let i =
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2935
|
+
let i = Bs(is, n, as, [
|
|
2936
|
+
us,
|
|
2937
|
+
ds,
|
|
2938
|
+
fs,
|
|
2939
|
+
ps,
|
|
2940
|
+
ms,
|
|
2941
|
+
hs
|
|
2817
2942
|
], 1e3, e, t);
|
|
2818
2943
|
i.loss < r.loss && (r = i);
|
|
2819
2944
|
}
|
|
2820
2945
|
return r;
|
|
2821
2946
|
}
|
|
2822
|
-
function
|
|
2823
|
-
let t =
|
|
2947
|
+
function Ws(e) {
|
|
2948
|
+
let t = ts(e), n = Hs(Us(e, t), e, t);
|
|
2824
2949
|
return {
|
|
2825
2950
|
values: n.values,
|
|
2826
2951
|
loss: n.loss,
|
|
2827
|
-
filter:
|
|
2952
|
+
filter: Zo(n.values)
|
|
2828
2953
|
};
|
|
2829
2954
|
}
|
|
2830
|
-
function
|
|
2831
|
-
return
|
|
2955
|
+
function Gs(e) {
|
|
2956
|
+
return Ws(e);
|
|
2832
2957
|
}
|
|
2833
|
-
function
|
|
2958
|
+
function Ks(e) {
|
|
2834
2959
|
return e;
|
|
2835
2960
|
}
|
|
2836
|
-
function
|
|
2837
|
-
if (e.length === 0) return
|
|
2961
|
+
function qs(e) {
|
|
2962
|
+
if (e.length === 0) return Ks;
|
|
2838
2963
|
if (e.length === 1) return () => e[0].output;
|
|
2839
2964
|
let t = e.map((e) => ({
|
|
2840
2965
|
output: e.output,
|
|
@@ -2872,28 +2997,28 @@ function ks(e) {
|
|
|
2872
2997
|
return b(i.output, a.output, o);
|
|
2873
2998
|
};
|
|
2874
2999
|
}
|
|
2875
|
-
function
|
|
3000
|
+
function Js(e) {
|
|
2876
3001
|
return e * e;
|
|
2877
3002
|
}
|
|
2878
|
-
function
|
|
3003
|
+
function Ys(e) {
|
|
2879
3004
|
return -e * (e - 2);
|
|
2880
3005
|
}
|
|
2881
|
-
function
|
|
3006
|
+
function Xs(e) {
|
|
2882
3007
|
return (e /= .5) < 1 ? .5 * e * e : -.5 * (--e * (e - 2) - 1);
|
|
2883
3008
|
}
|
|
2884
|
-
function
|
|
3009
|
+
function Zs(e) {
|
|
2885
3010
|
return e * e * e;
|
|
2886
3011
|
}
|
|
2887
|
-
function
|
|
3012
|
+
function Qs(e) {
|
|
2888
3013
|
return --e * e * e + 1;
|
|
2889
3014
|
}
|
|
2890
|
-
function
|
|
3015
|
+
function $s(e) {
|
|
2891
3016
|
return (e /= .5) < 1 ? .5 * e * e * e : .5 * ((e -= 2) * e * e + 2);
|
|
2892
3017
|
}
|
|
2893
|
-
function
|
|
3018
|
+
function ec(e) {
|
|
2894
3019
|
return e * e * (3 - 2 * e);
|
|
2895
3020
|
}
|
|
2896
|
-
function
|
|
3021
|
+
function tc(e, t, n, r = 1e-6) {
|
|
2897
3022
|
let i = e;
|
|
2898
3023
|
for (let a = 0; a < 8; a++) {
|
|
2899
3024
|
let a = i * i, o = a * i, s = 1 - i, c = s * s, l = 3 * c * i * t + 3 * s * a * n + o - e;
|
|
@@ -2911,73 +3036,73 @@ function Ls(e, t, n, r = 1e-6) {
|
|
|
2911
3036
|
}
|
|
2912
3037
|
return i;
|
|
2913
3038
|
}
|
|
2914
|
-
var Z = (e, t, n, r) => (i) => i <= 0 ? 0 : i >= 1 ? 1 :
|
|
2915
|
-
function
|
|
3039
|
+
var Z = (e, t, n, r) => (i) => i <= 0 ? 0 : i >= 1 ? 1 : oe(tc(i, e, n), e, t, n, r)[1];
|
|
3040
|
+
function nc(e) {
|
|
2916
3041
|
return e = Z(.09, .91, .5, 1.5)(e), e;
|
|
2917
3042
|
}
|
|
2918
|
-
function
|
|
3043
|
+
function rc(e) {
|
|
2919
3044
|
return e = Z(.09, .91, .5, 1.5)(e), e;
|
|
2920
3045
|
}
|
|
2921
|
-
function
|
|
2922
|
-
return e =
|
|
3046
|
+
function ic(e) {
|
|
3047
|
+
return e = se(e, [
|
|
2923
3048
|
[0, 0],
|
|
2924
3049
|
[.026, 1.746],
|
|
2925
3050
|
[.633, 1.06],
|
|
2926
3051
|
[1, 0]
|
|
2927
3052
|
])[1], e;
|
|
2928
3053
|
}
|
|
2929
|
-
function
|
|
2930
|
-
return e =
|
|
3054
|
+
function ac(e) {
|
|
3055
|
+
return e = se(e, [
|
|
2931
3056
|
[0, 0],
|
|
2932
3057
|
[.367, .94],
|
|
2933
3058
|
[.974, .254],
|
|
2934
3059
|
[1, 0]
|
|
2935
3060
|
])[1], e;
|
|
2936
3061
|
}
|
|
2937
|
-
function
|
|
2938
|
-
return e =
|
|
3062
|
+
function oc(e) {
|
|
3063
|
+
return e = se(e, [
|
|
2939
3064
|
[0, 0],
|
|
2940
3065
|
[.026, 1.746],
|
|
2941
3066
|
[.633, 1.06],
|
|
2942
3067
|
[1, 0]
|
|
2943
3068
|
])[1], e;
|
|
2944
3069
|
}
|
|
2945
|
-
function
|
|
2946
|
-
return e =
|
|
3070
|
+
function sc(e) {
|
|
3071
|
+
return e = se(e, [
|
|
2947
3072
|
[0, 0],
|
|
2948
3073
|
[.026, 1.746],
|
|
2949
3074
|
[.633, 1.06],
|
|
2950
3075
|
[1, 0]
|
|
2951
3076
|
])[1], e;
|
|
2952
3077
|
}
|
|
2953
|
-
function
|
|
3078
|
+
function cc(e) {
|
|
2954
3079
|
return 1 - Math.cos(e * Math.PI / 2);
|
|
2955
3080
|
}
|
|
2956
|
-
function
|
|
3081
|
+
function lc(e) {
|
|
2957
3082
|
return Math.sin(e * Math.PI / 2);
|
|
2958
3083
|
}
|
|
2959
|
-
function
|
|
3084
|
+
function uc(e) {
|
|
2960
3085
|
return -(Math.cos(Math.PI * e) - 1) / 2;
|
|
2961
3086
|
}
|
|
2962
|
-
function
|
|
3087
|
+
function dc(e) {
|
|
2963
3088
|
return 1 - Math.sqrt(1 - e * e);
|
|
2964
3089
|
}
|
|
2965
|
-
function
|
|
3090
|
+
function fc(e) {
|
|
2966
3091
|
return Math.sqrt(1 - --e * e);
|
|
2967
3092
|
}
|
|
2968
|
-
function
|
|
3093
|
+
function pc(e) {
|
|
2969
3094
|
return (e /= .5) < 1 ? -(Math.sqrt(1 - e * e) - 1) / 2 : (Math.sqrt(1 - (e -= 2) * e) + 1) / 2;
|
|
2970
3095
|
}
|
|
2971
|
-
function
|
|
3096
|
+
function mc(e) {
|
|
2972
3097
|
return e === 0 ? 0 : 2 ** (10 * (e - 1));
|
|
2973
3098
|
}
|
|
2974
|
-
function
|
|
3099
|
+
function hc(e) {
|
|
2975
3100
|
return e === 1 ? 1 : 1 - 2 ** (-10 * e);
|
|
2976
3101
|
}
|
|
2977
|
-
function
|
|
3102
|
+
function gc(e) {
|
|
2978
3103
|
return e === 0 ? 0 : e === 1 ? 1 : (e /= .5) < 1 ? .5 * 2 ** (10 * (e - 1)) : .5 * (2 - 2 ** (-10 * --e));
|
|
2979
3104
|
}
|
|
2980
|
-
var
|
|
3105
|
+
var _c = [
|
|
2981
3106
|
"jump-start",
|
|
2982
3107
|
"jump-end",
|
|
2983
3108
|
"jump-none",
|
|
@@ -2986,36 +3111,36 @@ var $s = [
|
|
|
2986
3111
|
"end",
|
|
2987
3112
|
"both"
|
|
2988
3113
|
];
|
|
2989
|
-
function
|
|
3114
|
+
function vc(e, t) {
|
|
2990
3115
|
return Math.ceil(e * t) / t;
|
|
2991
3116
|
}
|
|
2992
|
-
function
|
|
3117
|
+
function yc(e, t) {
|
|
2993
3118
|
return Math.floor(e * t) / t;
|
|
2994
3119
|
}
|
|
2995
|
-
function
|
|
3120
|
+
function bc(e, t) {
|
|
2996
3121
|
return Math.floor(e * (t + 1)) / (t + 1);
|
|
2997
3122
|
}
|
|
2998
|
-
function
|
|
3123
|
+
function xc(e, t) {
|
|
2999
3124
|
return t <= 1 ? e : Math.floor(e * (t - 1)) / (t - 1);
|
|
3000
3125
|
}
|
|
3001
|
-
function
|
|
3126
|
+
function Sc(e, t = "jump-end") {
|
|
3002
3127
|
switch (t) {
|
|
3003
|
-
case "jump-none": return (t) =>
|
|
3128
|
+
case "jump-none": return (t) => xc(t, e);
|
|
3004
3129
|
case "jump-start":
|
|
3005
|
-
case "start": return (t) =>
|
|
3130
|
+
case "start": return (t) => vc(t, e);
|
|
3006
3131
|
case "jump-end":
|
|
3007
|
-
case "end": return (t) =>
|
|
3132
|
+
case "end": return (t) => yc(t, e);
|
|
3008
3133
|
case "jump-both":
|
|
3009
|
-
case "both": return (t) =>
|
|
3134
|
+
case "both": return (t) => bc(t, e);
|
|
3010
3135
|
}
|
|
3011
3136
|
}
|
|
3012
|
-
function
|
|
3013
|
-
return
|
|
3137
|
+
function Cc() {
|
|
3138
|
+
return Sc(1, "jump-start");
|
|
3014
3139
|
}
|
|
3015
|
-
function
|
|
3016
|
-
return
|
|
3140
|
+
function wc() {
|
|
3141
|
+
return Sc(1, "jump-end");
|
|
3017
3142
|
}
|
|
3018
|
-
var
|
|
3143
|
+
var Tc = {
|
|
3019
3144
|
linear: [
|
|
3020
3145
|
0,
|
|
3021
3146
|
0,
|
|
@@ -3154,7 +3279,7 @@ var sc = {
|
|
|
3154
3279
|
.265,
|
|
3155
3280
|
1.55
|
|
3156
3281
|
]
|
|
3157
|
-
},
|
|
3282
|
+
}, Ec = {
|
|
3158
3283
|
"cubic-bezier": "custom curve",
|
|
3159
3284
|
linear: "constant velocity",
|
|
3160
3285
|
ease: "gentle start & end",
|
|
@@ -3189,65 +3314,65 @@ var sc = {
|
|
|
3189
3314
|
steps: "discrete jumps",
|
|
3190
3315
|
"step-start": "jump at start",
|
|
3191
3316
|
"step-end": "jump at end"
|
|
3192
|
-
},
|
|
3193
|
-
linear:
|
|
3194
|
-
easeInQuad:
|
|
3195
|
-
"ease-in-quad":
|
|
3196
|
-
easeOutQuad:
|
|
3197
|
-
"ease-out-quad":
|
|
3198
|
-
easeInOutQuad:
|
|
3199
|
-
"ease-in-out-quad":
|
|
3200
|
-
easeInCubic:
|
|
3201
|
-
"ease-in-cubic":
|
|
3202
|
-
easeOutCubic:
|
|
3203
|
-
"ease-out-cubic":
|
|
3204
|
-
easeInOutCubic:
|
|
3205
|
-
"ease-in-out-cubic":
|
|
3206
|
-
easeInBounce:
|
|
3207
|
-
"ease-in-bounce":
|
|
3208
|
-
bounceInEase:
|
|
3209
|
-
"bounce-in-ease":
|
|
3210
|
-
bounceInEaseHalf:
|
|
3211
|
-
"bounce-in-ease-half":
|
|
3212
|
-
bounceOutEase:
|
|
3213
|
-
"bounce-out-ease":
|
|
3214
|
-
bounceOutEaseHalf:
|
|
3215
|
-
"bounce-out-ease-half":
|
|
3216
|
-
bounceInOutEase:
|
|
3217
|
-
"bounce-in-out-ease":
|
|
3218
|
-
easeInSine:
|
|
3219
|
-
"ease-in-sine":
|
|
3220
|
-
easeOutSine:
|
|
3221
|
-
"ease-out-sine":
|
|
3222
|
-
easeInOutSine:
|
|
3223
|
-
"ease-in-out-sine":
|
|
3224
|
-
easeInCirc:
|
|
3225
|
-
"ease-in-circ":
|
|
3226
|
-
easeOutCirc:
|
|
3227
|
-
"ease-out-circ":
|
|
3228
|
-
easeInOutCirc:
|
|
3229
|
-
"ease-in-out-circ":
|
|
3230
|
-
easeInExpo:
|
|
3231
|
-
"ease-in-expo":
|
|
3232
|
-
easeOutExpo:
|
|
3233
|
-
"ease-out-expo":
|
|
3234
|
-
easeInOutExpo:
|
|
3235
|
-
"ease-in-out-expo":
|
|
3236
|
-
smoothStep3:
|
|
3237
|
-
"smooth-step-3":
|
|
3238
|
-
ease: Z(...
|
|
3239
|
-
"ease-in": Z(...
|
|
3240
|
-
"ease-out": Z(...
|
|
3241
|
-
"ease-in-out": Z(...
|
|
3242
|
-
"ease-in-back": Z(...
|
|
3243
|
-
"ease-out-back": Z(...
|
|
3244
|
-
"ease-in-out-back": Z(...
|
|
3245
|
-
steps:
|
|
3246
|
-
"step-start":
|
|
3247
|
-
"step-end":
|
|
3248
|
-
}, Q =
|
|
3249
|
-
|
|
3250
|
-
var
|
|
3317
|
+
}, Dc = {
|
|
3318
|
+
linear: Ks,
|
|
3319
|
+
easeInQuad: Js,
|
|
3320
|
+
"ease-in-quad": Js,
|
|
3321
|
+
easeOutQuad: Ys,
|
|
3322
|
+
"ease-out-quad": Ys,
|
|
3323
|
+
easeInOutQuad: Xs,
|
|
3324
|
+
"ease-in-out-quad": Xs,
|
|
3325
|
+
easeInCubic: Zs,
|
|
3326
|
+
"ease-in-cubic": Zs,
|
|
3327
|
+
easeOutCubic: Qs,
|
|
3328
|
+
"ease-out-cubic": Qs,
|
|
3329
|
+
easeInOutCubic: $s,
|
|
3330
|
+
"ease-in-out-cubic": $s,
|
|
3331
|
+
easeInBounce: nc,
|
|
3332
|
+
"ease-in-bounce": nc,
|
|
3333
|
+
bounceInEase: rc,
|
|
3334
|
+
"bounce-in-ease": rc,
|
|
3335
|
+
bounceInEaseHalf: ic,
|
|
3336
|
+
"bounce-in-ease-half": ic,
|
|
3337
|
+
bounceOutEase: ac,
|
|
3338
|
+
"bounce-out-ease": ac,
|
|
3339
|
+
bounceOutEaseHalf: oc,
|
|
3340
|
+
"bounce-out-ease-half": oc,
|
|
3341
|
+
bounceInOutEase: sc,
|
|
3342
|
+
"bounce-in-out-ease": sc,
|
|
3343
|
+
easeInSine: cc,
|
|
3344
|
+
"ease-in-sine": cc,
|
|
3345
|
+
easeOutSine: lc,
|
|
3346
|
+
"ease-out-sine": lc,
|
|
3347
|
+
easeInOutSine: uc,
|
|
3348
|
+
"ease-in-out-sine": uc,
|
|
3349
|
+
easeInCirc: dc,
|
|
3350
|
+
"ease-in-circ": dc,
|
|
3351
|
+
easeOutCirc: fc,
|
|
3352
|
+
"ease-out-circ": fc,
|
|
3353
|
+
easeInOutCirc: pc,
|
|
3354
|
+
"ease-in-out-circ": pc,
|
|
3355
|
+
easeInExpo: mc,
|
|
3356
|
+
"ease-in-expo": mc,
|
|
3357
|
+
easeOutExpo: hc,
|
|
3358
|
+
"ease-out-expo": hc,
|
|
3359
|
+
easeInOutExpo: gc,
|
|
3360
|
+
"ease-in-out-expo": gc,
|
|
3361
|
+
smoothStep3: ec,
|
|
3362
|
+
"smooth-step-3": ec,
|
|
3363
|
+
ease: Z(...Tc.ease),
|
|
3364
|
+
"ease-in": Z(...Tc["ease-in"]),
|
|
3365
|
+
"ease-out": Z(...Tc["ease-out"]),
|
|
3366
|
+
"ease-in-out": Z(...Tc["ease-in-out"]),
|
|
3367
|
+
"ease-in-back": Z(...Tc["ease-in-back"]),
|
|
3368
|
+
"ease-out-back": Z(...Tc["ease-out-back"]),
|
|
3369
|
+
"ease-in-out-back": Z(...Tc["ease-in-out-back"]),
|
|
3370
|
+
steps: Sc,
|
|
3371
|
+
"step-start": Cc,
|
|
3372
|
+
"step-end": wc
|
|
3373
|
+
}, Q = o, Oc = a("{"), kc = a("}");
|
|
3374
|
+
a("("), a(")"), a("["), a("]");
|
|
3375
|
+
var Ac = a(";"), jc = a(":"), Mc = a(","), Nc = a("@"), Pc = i(/--[a-zA-Z_][a-zA-Z0-9_-]*/), Fc = n(Pc, vi), Ic = (e) => e.replace(/\/\*[\s\S]*?\*\//g, ""), Lc = (t) => new e((e) => {
|
|
3251
3376
|
let n = e.src, r = e.offset, i = r, a = 0, o = 0, s = 0, c = null;
|
|
3252
3377
|
for (; i < n.length;) {
|
|
3253
3378
|
let e = n[i];
|
|
@@ -3295,53 +3420,53 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3295
3420
|
}
|
|
3296
3421
|
let l = n.slice(r, i);
|
|
3297
3422
|
return e.ok(l, i - r);
|
|
3298
|
-
}),
|
|
3423
|
+
}), Rc = Lc((e, t) => {
|
|
3299
3424
|
let n = e[t];
|
|
3300
3425
|
return n === ";" || n === "}" ? !0 : n === "!" ? /^!important\b/i.test(e.slice(t)) : !1;
|
|
3301
|
-
}),
|
|
3426
|
+
}), zc = Lc((e, t) => e[t] === "{"), Bc = Lc((e, t) => e[t] === "}"), Vc = Lc((e, t) => {
|
|
3302
3427
|
let n = e[t];
|
|
3303
3428
|
return n === "{" || n === ";";
|
|
3304
|
-
}),
|
|
3429
|
+
}), Hc = a("!").skip(Q).next(z("important")).map(() => !0), Uc = (e) => {
|
|
3305
3430
|
let t = e.trim();
|
|
3306
|
-
if (t.length === 0) return new
|
|
3307
|
-
let n =
|
|
3431
|
+
if (t.length === 0) return new Wa();
|
|
3432
|
+
let n = Ci(_o.Values, t);
|
|
3308
3433
|
if (n.status && Array.isArray(n.value) && n.value.length > 0) {
|
|
3309
3434
|
let e = [];
|
|
3310
3435
|
for (let t of n.value) if (Array.isArray(t)) for (let n of t) e.push(n);
|
|
3311
3436
|
else e.push(t);
|
|
3312
|
-
return new
|
|
3437
|
+
return new Wa(...e);
|
|
3313
3438
|
}
|
|
3314
|
-
return new
|
|
3315
|
-
},
|
|
3316
|
-
let r =
|
|
3439
|
+
return new Wa(new Y(t, "string"));
|
|
3440
|
+
}, Wc = t(Fc.skip(jc.trim(Q)), Rc, Hc.opt()).skip(Ac.opt()).trim(Q).map(([e, t, n]) => {
|
|
3441
|
+
let r = Uc(t);
|
|
3317
3442
|
return r.setProperty(e), {
|
|
3318
3443
|
name: e,
|
|
3319
3444
|
value: r,
|
|
3320
3445
|
important: n === !0
|
|
3321
3446
|
};
|
|
3322
|
-
}).many(),
|
|
3447
|
+
}).many(), Gc = n(z("entry"), z("exit"), z("cover"), z("contain")).map((e) => ({
|
|
3323
3448
|
kind: "named",
|
|
3324
3449
|
name: e.toLowerCase()
|
|
3325
|
-
})),
|
|
3450
|
+
})), Kc = z("from").map(() => ({
|
|
3326
3451
|
kind: "percent",
|
|
3327
3452
|
value: 0
|
|
3328
|
-
})),
|
|
3453
|
+
})), qc = z("to").map(() => ({
|
|
3329
3454
|
kind: "percent",
|
|
3330
3455
|
value: 100
|
|
3331
|
-
})),
|
|
3456
|
+
})), Jc = n(H.Percentage.map((e) => ({
|
|
3332
3457
|
kind: "percent",
|
|
3333
3458
|
value: Number(e.valueOf())
|
|
3334
|
-
})),
|
|
3459
|
+
})), Kc, qc, Gc, B.map((e) => ({
|
|
3335
3460
|
kind: "percent",
|
|
3336
3461
|
value: e
|
|
3337
|
-
}))).trim(Q).sepBy(
|
|
3462
|
+
}))).trim(Q).sepBy(Mc.trim(Q)), Yc = "animation-timing-function", Xc = "animation-composition", Zc = (e) => {
|
|
3338
3463
|
let t = { declarations: [] };
|
|
3339
3464
|
for (let n of e) if (!n.important) {
|
|
3340
|
-
if (n.name ===
|
|
3465
|
+
if (n.name === Yc) {
|
|
3341
3466
|
t.timingFunction = n.value.toString().trim();
|
|
3342
3467
|
continue;
|
|
3343
3468
|
}
|
|
3344
|
-
if (n.name ===
|
|
3469
|
+
if (n.name === Xc) {
|
|
3345
3470
|
let e = n.value.toString().trim().toLowerCase();
|
|
3346
3471
|
(e === "replace" || e === "add" || e === "accumulate") && (t.composition = e);
|
|
3347
3472
|
continue;
|
|
@@ -3349,13 +3474,13 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3349
3474
|
t.declarations.push(n);
|
|
3350
3475
|
}
|
|
3351
3476
|
return t;
|
|
3352
|
-
},
|
|
3353
|
-
let n =
|
|
3477
|
+
}, Qc = t(Jc, Wc.trim(Q).wrap(Oc.trim(Q), kc.trim(Q))).trim(Q).map(([e, t]) => {
|
|
3478
|
+
let n = Zc(t), r = {
|
|
3354
3479
|
selectors: e,
|
|
3355
3480
|
declarations: n.declarations
|
|
3356
3481
|
};
|
|
3357
3482
|
return n.timingFunction != null && (r.timingFunction = n.timingFunction), n.composition != null && (r.composition = n.composition), r;
|
|
3358
|
-
}),
|
|
3483
|
+
}), $c = t(vi.trim(Q).opt(), Qc.many().trim(Q).wrap(Oc.trim(Q), kc.trim(Q))).map((e) => {
|
|
3359
3484
|
let t = e[e.length - 1], n = e.length === 2 ? e[0] : void 0;
|
|
3360
3485
|
return n == null ? {
|
|
3361
3486
|
kind: "keyframes",
|
|
@@ -3365,15 +3490,15 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3365
3490
|
name: n,
|
|
3366
3491
|
rules: t
|
|
3367
3492
|
};
|
|
3368
|
-
}),
|
|
3493
|
+
}), el = (e) => {
|
|
3369
3494
|
let t = {};
|
|
3370
3495
|
for (let n of e) n.name === "syntax" ? t.syntax = n.value.toString().trim().replace(/^["']|["']$/g, "") : n.name === "inherits" ? t.inherits = n.value.toString().trim().toLowerCase() === "true" : n.name === "initial-value" && (t.initialValue = n.value);
|
|
3371
3496
|
return t;
|
|
3372
|
-
},
|
|
3497
|
+
}, tl = t(Pc.trim(Q), Wc.trim(Q).wrap(Oc.trim(Q), kc.trim(Q))).map(([e, t]) => ({
|
|
3373
3498
|
kind: "property",
|
|
3374
3499
|
name: e,
|
|
3375
|
-
descriptor:
|
|
3376
|
-
})),
|
|
3500
|
+
descriptor: el(t)
|
|
3501
|
+
})), nl = (e) => {
|
|
3377
3502
|
let t = [], n = 0, r = null, i = "";
|
|
3378
3503
|
for (let a = 0; a < e.length; a++) {
|
|
3379
3504
|
let o = e[a];
|
|
@@ -3406,19 +3531,19 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3406
3531
|
}
|
|
3407
3532
|
let a = i.trim();
|
|
3408
3533
|
return a.length > 0 && t.push(a), t;
|
|
3409
|
-
},
|
|
3534
|
+
}, rl = t(zc, Wc.trim(Q).wrap(Oc.trim(Q), kc.trim(Q))).trim(Q).map(([e, t]) => ({
|
|
3410
3535
|
kind: "style",
|
|
3411
|
-
selectors:
|
|
3536
|
+
selectors: nl(e),
|
|
3412
3537
|
declarations: t
|
|
3413
|
-
})),
|
|
3538
|
+
})), il = (e) => t(Vc.map((e) => e.trim()), n(Ac.map(() => null), Bc.wrap(Oc.trim(Q), kc.trim(Q)))).map(([t, n]) => ({
|
|
3414
3539
|
kind: "unknown",
|
|
3415
3540
|
atName: e,
|
|
3416
3541
|
prelude: t,
|
|
3417
3542
|
body: n
|
|
3418
|
-
})),
|
|
3543
|
+
})), al = n(Nc.next(vi).chain((e) => {
|
|
3419
3544
|
let t = e.toLowerCase();
|
|
3420
|
-
return t === "keyframes" ?
|
|
3421
|
-
}),
|
|
3545
|
+
return t === "keyframes" ? $c : t === "property" ? tl : il(t);
|
|
3546
|
+
}), rl).trim(Q).many().trim(Q).skip(new e((e) => e.offset >= e.src.length ? e.ok(null, 0) : e.err(void 0, 0))), ol = h((e) => V(al, Ic(e)), { keyFn: (e) => e }), sl = (e) => {
|
|
3422
3547
|
let t = [], n = "", r = 0, i = null, a = () => {
|
|
3423
3548
|
let e = n.trim();
|
|
3424
3549
|
e.length > 0 && t.push(e), n = "";
|
|
@@ -3452,7 +3577,7 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3452
3577
|
n += o;
|
|
3453
3578
|
}
|
|
3454
3579
|
return a(), t;
|
|
3455
|
-
},
|
|
3580
|
+
}, cl = /^-?(?:\d+\.?\d*|\.\d+)(?:s|ms)$/i, ll = /^\d+\.?\d*$/, ul = new Set([
|
|
3456
3581
|
"linear",
|
|
3457
3582
|
"ease",
|
|
3458
3583
|
"ease-in",
|
|
@@ -3460,35 +3585,35 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3460
3585
|
"ease-in-out",
|
|
3461
3586
|
"step-start",
|
|
3462
3587
|
"step-end"
|
|
3463
|
-
]),
|
|
3588
|
+
]), dl = new Set([
|
|
3464
3589
|
"cubic-bezier",
|
|
3465
3590
|
"steps",
|
|
3466
3591
|
"linear"
|
|
3467
|
-
]),
|
|
3592
|
+
]), fl = new Set([
|
|
3468
3593
|
"normal",
|
|
3469
3594
|
"reverse",
|
|
3470
3595
|
"alternate",
|
|
3471
3596
|
"alternate-reverse"
|
|
3472
|
-
]),
|
|
3597
|
+
]), pl = new Set([
|
|
3473
3598
|
"none",
|
|
3474
3599
|
"forwards",
|
|
3475
3600
|
"backwards",
|
|
3476
3601
|
"both"
|
|
3477
|
-
]),
|
|
3602
|
+
]), ml = new Set([
|
|
3478
3603
|
"replace",
|
|
3479
3604
|
"add",
|
|
3480
3605
|
"accumulate"
|
|
3481
|
-
]),
|
|
3606
|
+
]), hl = new Set(["running", "paused"]), gl = (e) => {
|
|
3482
3607
|
let t = e.toLowerCase();
|
|
3483
|
-
if (
|
|
3608
|
+
if (ul.has(t)) return !0;
|
|
3484
3609
|
let n = t.split("(", 1)[0];
|
|
3485
|
-
return
|
|
3486
|
-
},
|
|
3487
|
-
let t = {}, n =
|
|
3610
|
+
return dl.has(n);
|
|
3611
|
+
}, _l = (e) => /^-?[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e), vl = (e) => {
|
|
3612
|
+
let t = {}, n = sl(e), r = 0, i = !1;
|
|
3488
3613
|
for (let e of n) {
|
|
3489
3614
|
let n = e.toLowerCase();
|
|
3490
|
-
if (
|
|
3491
|
-
let n =
|
|
3615
|
+
if (cl.test(e)) {
|
|
3616
|
+
let n = bo(e);
|
|
3492
3617
|
r === 0 ? t.duration = n : r === 1 && (t.delay = n), r++;
|
|
3493
3618
|
continue;
|
|
3494
3619
|
}
|
|
@@ -3496,42 +3621,42 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3496
3621
|
t.iterationCount = Infinity;
|
|
3497
3622
|
continue;
|
|
3498
3623
|
}
|
|
3499
|
-
if (
|
|
3624
|
+
if (ll.test(e)) {
|
|
3500
3625
|
let n = Number(e);
|
|
3501
3626
|
if (Number.isFinite(n) && n >= 0) {
|
|
3502
3627
|
t.iterationCount = n;
|
|
3503
3628
|
continue;
|
|
3504
3629
|
}
|
|
3505
3630
|
}
|
|
3506
|
-
if (
|
|
3631
|
+
if (fl.has(n)) {
|
|
3507
3632
|
t.direction = n;
|
|
3508
3633
|
continue;
|
|
3509
3634
|
}
|
|
3510
|
-
if (
|
|
3635
|
+
if (pl.has(n) && i) {
|
|
3511
3636
|
t.fillMode = n;
|
|
3512
3637
|
continue;
|
|
3513
3638
|
}
|
|
3514
|
-
if (
|
|
3639
|
+
if (pl.has(n) && n !== "none") {
|
|
3515
3640
|
t.fillMode = n;
|
|
3516
3641
|
continue;
|
|
3517
3642
|
}
|
|
3518
|
-
if (
|
|
3643
|
+
if (ml.has(n)) {
|
|
3519
3644
|
t.composition = n;
|
|
3520
3645
|
continue;
|
|
3521
3646
|
}
|
|
3522
|
-
if (!
|
|
3523
|
-
if (
|
|
3647
|
+
if (!hl.has(n)) {
|
|
3648
|
+
if (gl(e) && t.timingFunction == null) {
|
|
3524
3649
|
t.timingFunction = e;
|
|
3525
3650
|
continue;
|
|
3526
3651
|
}
|
|
3527
|
-
if (!i &&
|
|
3652
|
+
if (!i && _l(e)) {
|
|
3528
3653
|
t.name = e, i = !0;
|
|
3529
3654
|
continue;
|
|
3530
3655
|
}
|
|
3531
3656
|
}
|
|
3532
3657
|
}
|
|
3533
3658
|
return t;
|
|
3534
|
-
},
|
|
3659
|
+
}, yl = h((e) => bl(e).map((e) => vl(e)), { keyFn: (e) => e }), bl = (e) => {
|
|
3535
3660
|
let t = [], n = "", r = 0, i = null;
|
|
3536
3661
|
for (let a = 0; a < e.length; a++) {
|
|
3537
3662
|
let o = e[a];
|
|
@@ -3564,10 +3689,10 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3564
3689
|
}
|
|
3565
3690
|
let a = n.trim();
|
|
3566
3691
|
return a.length > 0 && t.push(a), t;
|
|
3567
|
-
},
|
|
3692
|
+
}, xl = (e) => {
|
|
3568
3693
|
let t = [];
|
|
3569
|
-
return e.duration != null && t.push(
|
|
3570
|
-
},
|
|
3694
|
+
return e.duration != null && t.push(Sl(e.duration)), e.timingFunction != null && t.push(e.timingFunction), e.delay != null && t.push(Sl(e.delay)), e.iterationCount != null && t.push(e.iterationCount === Infinity ? "infinite" : String(e.iterationCount)), e.direction != null && t.push(e.direction), e.fillMode != null && t.push(e.fillMode), e.composition != null && t.push(e.composition), e.name != null && t.push(e.name), t.join(" ");
|
|
3695
|
+
}, Sl = (e) => e >= 5e3 && e % 1e3 == 0 || e >= 1e3 && e % 1 == 0 && e < 5e3 ? `${e / 1e3}s` : `${e}ms`, Cl = (e) => {
|
|
3571
3696
|
let t = /* @__PURE__ */ new Map();
|
|
3572
3697
|
for (let n of e) {
|
|
3573
3698
|
if (n.kind !== "keyframes") continue;
|
|
@@ -3575,46 +3700,46 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3575
3700
|
r ? r.push(...n.rules) : t.set(e, [...n.rules]);
|
|
3576
3701
|
}
|
|
3577
3702
|
return t;
|
|
3578
|
-
},
|
|
3703
|
+
}, wl = (e) => {
|
|
3579
3704
|
let t = /* @__PURE__ */ new Map();
|
|
3580
3705
|
for (let n of e) n.kind === "property" && t.set(n.name, n.descriptor);
|
|
3581
3706
|
return t;
|
|
3582
|
-
},
|
|
3707
|
+
}, Tl = (e) => {
|
|
3583
3708
|
let t = [];
|
|
3584
3709
|
for (let n of e) n.kind === "style" && t.push({
|
|
3585
3710
|
selectors: n.selectors,
|
|
3586
3711
|
declarations: n.declarations
|
|
3587
3712
|
});
|
|
3588
3713
|
return t;
|
|
3589
|
-
},
|
|
3714
|
+
}, El = new Set([
|
|
3590
3715
|
"normal",
|
|
3591
3716
|
"reverse",
|
|
3592
3717
|
"alternate",
|
|
3593
3718
|
"alternate-reverse"
|
|
3594
|
-
]),
|
|
3719
|
+
]), Dl = new Set([
|
|
3595
3720
|
"none",
|
|
3596
3721
|
"forwards",
|
|
3597
3722
|
"backwards",
|
|
3598
3723
|
"both"
|
|
3599
|
-
]),
|
|
3724
|
+
]), Ol = new Set([
|
|
3600
3725
|
"replace",
|
|
3601
3726
|
"add",
|
|
3602
3727
|
"accumulate"
|
|
3603
|
-
]),
|
|
3728
|
+
]), kl = (e) => {
|
|
3604
3729
|
try {
|
|
3605
|
-
return
|
|
3730
|
+
return bo(e);
|
|
3606
3731
|
} catch {
|
|
3607
3732
|
return;
|
|
3608
3733
|
}
|
|
3609
|
-
},
|
|
3734
|
+
}, Al = (e) => {
|
|
3610
3735
|
let t = e.trim().toLowerCase();
|
|
3611
3736
|
if (t === "infinite") return Infinity;
|
|
3612
3737
|
let n = Number(t);
|
|
3613
3738
|
return Number.isFinite(n) && n >= 0 ? n : void 0;
|
|
3614
|
-
},
|
|
3739
|
+
}, jl = (e, t, n) => {
|
|
3615
3740
|
let r = n.trim();
|
|
3616
3741
|
if (t === "animation") {
|
|
3617
|
-
let t =
|
|
3742
|
+
let t = yl(r)[0];
|
|
3618
3743
|
t != null && Object.assign(e, t);
|
|
3619
3744
|
return;
|
|
3620
3745
|
}
|
|
@@ -3623,28 +3748,28 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3623
3748
|
e.name = r;
|
|
3624
3749
|
return;
|
|
3625
3750
|
case "animation-duration": {
|
|
3626
|
-
let t =
|
|
3751
|
+
let t = kl(r);
|
|
3627
3752
|
t != null && (e.duration = t);
|
|
3628
3753
|
return;
|
|
3629
3754
|
}
|
|
3630
3755
|
case "animation-delay": {
|
|
3631
|
-
let t =
|
|
3756
|
+
let t = kl(r);
|
|
3632
3757
|
t != null && (e.delay = t);
|
|
3633
3758
|
return;
|
|
3634
3759
|
}
|
|
3635
3760
|
case "animation-iteration-count": {
|
|
3636
|
-
let t =
|
|
3761
|
+
let t = Al(r);
|
|
3637
3762
|
t != null && (e.iterationCount = t);
|
|
3638
3763
|
return;
|
|
3639
3764
|
}
|
|
3640
3765
|
case "animation-direction": {
|
|
3641
3766
|
let t = r.toLowerCase();
|
|
3642
|
-
|
|
3767
|
+
El.has(t) && (e.direction = t);
|
|
3643
3768
|
return;
|
|
3644
3769
|
}
|
|
3645
3770
|
case "animation-fill-mode": {
|
|
3646
3771
|
let t = r.toLowerCase();
|
|
3647
|
-
|
|
3772
|
+
Dl.has(t) && (e.fillMode = t);
|
|
3648
3773
|
return;
|
|
3649
3774
|
}
|
|
3650
3775
|
case "animation-timing-function":
|
|
@@ -3652,35 +3777,35 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3652
3777
|
return;
|
|
3653
3778
|
case "animation-composition": {
|
|
3654
3779
|
let t = r.toLowerCase();
|
|
3655
|
-
|
|
3780
|
+
Ol.has(t) && (e.composition = t);
|
|
3656
3781
|
return;
|
|
3657
3782
|
}
|
|
3658
3783
|
}
|
|
3659
|
-
},
|
|
3784
|
+
}, Ml = (e) => {
|
|
3660
3785
|
let t = {};
|
|
3661
|
-
for (let n of e) if (n.kind === "style") for (let e of n.declarations)
|
|
3786
|
+
for (let n of e) if (n.kind === "style") for (let e of n.declarations) jl(t, e.name, e.value.toString());
|
|
3662
3787
|
return t;
|
|
3663
|
-
},
|
|
3788
|
+
}, Nl = (e) => e.kind === "percent" ? `${e.value}%` : e.name, Pl = (e) => {
|
|
3664
3789
|
let t = e.value.toString(), n = e.important ? " !important" : "";
|
|
3665
3790
|
return `${e.name}: ${t}${n}`;
|
|
3666
|
-
},
|
|
3667
|
-
let t = e.selectors.map(
|
|
3791
|
+
}, Fl = (e) => {
|
|
3792
|
+
let t = e.selectors.map(Nl).join(", "), n = e.declarations.map(Pl);
|
|
3668
3793
|
return e.timingFunction != null && n.push(`animation-timing-function: ${e.timingFunction}`), e.composition != null && n.push(`animation-composition: ${e.composition}`), ` ${t} {\n${n.map((e) => ` ${e};`).join("\n")}\n }`;
|
|
3669
|
-
},
|
|
3794
|
+
}, Il = (e) => `@keyframes${e.name == null ? "" : ` ${e.name}`} {\n${e.rules.map(Fl).join("\n")}\n}`, Ll = (e) => {
|
|
3670
3795
|
let t = [];
|
|
3671
3796
|
return e.descriptor.syntax !== void 0 && t.push(` syntax: "${e.descriptor.syntax}";`), e.descriptor.inherits !== void 0 && t.push(` inherits: ${e.descriptor.inherits};`), e.descriptor.initialValue !== void 0 && t.push(` initial-value: ${e.descriptor.initialValue.toString()};`), `@property ${e.name} {\n${t.join("\n")}\n}`;
|
|
3672
|
-
},
|
|
3797
|
+
}, Rl = (e) => `${e.selectors.join(", ")} {\n${e.declarations.map((e) => ` ${Pl(e)};`).join("\n")}\n}`, zl = (e) => {
|
|
3673
3798
|
let t = e.prelude.length > 0 ? ` ${e.prelude}` : "";
|
|
3674
3799
|
return e.body == null ? `@${e.atName}${t};` : `@${e.atName}${t} {\n${e.body.trim()}\n}`;
|
|
3675
|
-
},
|
|
3800
|
+
}, Bl = (e) => {
|
|
3676
3801
|
switch (e.kind) {
|
|
3677
|
-
case "keyframes": return
|
|
3678
|
-
case "property": return
|
|
3679
|
-
case "style": return
|
|
3680
|
-
case "unknown": return
|
|
3802
|
+
case "keyframes": return Il(e);
|
|
3803
|
+
case "property": return Ll(e);
|
|
3804
|
+
case "style": return Rl(e);
|
|
3805
|
+
case "unknown": return zl(e);
|
|
3681
3806
|
}
|
|
3682
|
-
},
|
|
3683
|
-
async function
|
|
3807
|
+
}, Vl = (e) => e.map(Bl).join("\n\n"), Hl = 80;
|
|
3808
|
+
async function Ul(e, t = Hl) {
|
|
3684
3809
|
let [n, r] = await Promise.all([import("./standalone-Ck3UyY5I.js"), import("./postcss-CRluLK2m.js")]), i = (e) => e.default ?? e, a = i(n), o = i(r);
|
|
3685
3810
|
return await a.format(e, {
|
|
3686
3811
|
parser: "scss",
|
|
@@ -3688,24 +3813,24 @@ async function Tl(e, t = wl) {
|
|
|
3688
3813
|
printWidth: t
|
|
3689
3814
|
});
|
|
3690
3815
|
}
|
|
3691
|
-
async function
|
|
3692
|
-
return
|
|
3816
|
+
async function Wl(e, t = Hl) {
|
|
3817
|
+
return Ul(Vl(e), t);
|
|
3693
3818
|
}
|
|
3694
|
-
var
|
|
3819
|
+
var Gl = {
|
|
3695
3820
|
k: 5,
|
|
3696
3821
|
maxIterations: 10,
|
|
3697
3822
|
targetPixels: 2e4,
|
|
3698
3823
|
chromaWeight: .5,
|
|
3699
|
-
dedupeThreshold:
|
|
3824
|
+
dedupeThreshold: Le
|
|
3700
3825
|
};
|
|
3701
|
-
function
|
|
3826
|
+
function Kl(e, t, n, r, i, a, o) {
|
|
3702
3827
|
let s = e - r, c = t - i, l = n - a, u = Math.sqrt(t * t + n * n);
|
|
3703
3828
|
return s * s + (1 + o * u) * (c * c + l * l);
|
|
3704
3829
|
}
|
|
3705
|
-
function
|
|
3830
|
+
function ql(e, t, n) {
|
|
3706
3831
|
return `oklch(${(e * 100).toFixed(2).replace(/\.?0+$/, "")}% ${t.toFixed(4).replace(/\.?0+$/, "")} ${n.toFixed(2).replace(/\.?0+$/, "")})`;
|
|
3707
3832
|
}
|
|
3708
|
-
function
|
|
3833
|
+
function Jl(e, t) {
|
|
3709
3834
|
let { pixels: n, count: r } = e, i = Infinity, a = -Infinity;
|
|
3710
3835
|
for (let e = 0; e < r; e++) {
|
|
3711
3836
|
let r = n[e * 3 + t];
|
|
@@ -3713,7 +3838,7 @@ function Al(e, t) {
|
|
|
3713
3838
|
}
|
|
3714
3839
|
return a - i;
|
|
3715
3840
|
}
|
|
3716
|
-
function
|
|
3841
|
+
function Yl(e) {
|
|
3717
3842
|
let { pixels: t, count: n } = e, r = 0, i = 0, a = 0;
|
|
3718
3843
|
for (let e = 0; e < n; e++) {
|
|
3719
3844
|
let n = e * 3;
|
|
@@ -3725,8 +3850,8 @@ function jl(e) {
|
|
|
3725
3850
|
a / n
|
|
3726
3851
|
];
|
|
3727
3852
|
}
|
|
3728
|
-
function
|
|
3729
|
-
let t =
|
|
3853
|
+
function Xl(e) {
|
|
3854
|
+
let t = Jl(e, 0), n = Jl(e, 1), r = Jl(e, 2), i = 0;
|
|
3730
3855
|
n >= t && n >= r ? i = 1 : r >= t && r >= n && (i = 2);
|
|
3731
3856
|
let { pixels: a, count: o } = e, s = new Uint32Array(o);
|
|
3732
3857
|
for (let e = 0; e < o; e++) s[e] = e;
|
|
@@ -3745,9 +3870,9 @@ function Ml(e) {
|
|
|
3745
3870
|
count: o - l
|
|
3746
3871
|
}];
|
|
3747
3872
|
}
|
|
3748
|
-
function
|
|
3873
|
+
function Zl(e, t, n) {
|
|
3749
3874
|
if (n <= 1 || t === 0) return [{
|
|
3750
|
-
centroid: t > 0 ?
|
|
3875
|
+
centroid: t > 0 ? Yl({
|
|
3751
3876
|
pixels: e,
|
|
3752
3877
|
count: t
|
|
3753
3878
|
}) : [
|
|
@@ -3766,19 +3891,19 @@ function Nl(e, t, n) {
|
|
|
3766
3891
|
for (let n = 0; n < r.length; n++) {
|
|
3767
3892
|
let i = r[n];
|
|
3768
3893
|
if (i.count < 2) continue;
|
|
3769
|
-
let a =
|
|
3894
|
+
let a = Jl(i, 0), o = Jl(i, 1), s = Jl(i, 2), c = Math.max(a, o, s);
|
|
3770
3895
|
c > t && (t = c, e = n);
|
|
3771
3896
|
}
|
|
3772
3897
|
if (t <= 0) break;
|
|
3773
|
-
let [n, i] =
|
|
3898
|
+
let [n, i] = Xl(r[e]);
|
|
3774
3899
|
r.splice(e, 1, n, i);
|
|
3775
3900
|
}
|
|
3776
3901
|
return r.map((e) => ({
|
|
3777
|
-
centroid:
|
|
3902
|
+
centroid: Yl(e),
|
|
3778
3903
|
population: e.count
|
|
3779
3904
|
}));
|
|
3780
3905
|
}
|
|
3781
|
-
function
|
|
3906
|
+
function Ql(e, t, n) {
|
|
3782
3907
|
let r = e.length;
|
|
3783
3908
|
if (r <= t) return e.map((e) => [...e.centroid]);
|
|
3784
3909
|
let i = [], a = new Float64Array(r).fill(Infinity), o = 0, s = 0;
|
|
@@ -3790,7 +3915,7 @@ function Pl(e, t, n) {
|
|
|
3790
3915
|
let c = i[0];
|
|
3791
3916
|
for (let t = 0; t < r; t++) {
|
|
3792
3917
|
let r = e[t].centroid;
|
|
3793
|
-
a[t] =
|
|
3918
|
+
a[t] = Kl(r[0], r[1], r[2], c[0], c[1], c[2], n);
|
|
3794
3919
|
}
|
|
3795
3920
|
for (let o = 1; o < t; o++) {
|
|
3796
3921
|
let t = 0;
|
|
@@ -3804,20 +3929,20 @@ function Pl(e, t, n) {
|
|
|
3804
3929
|
i.push([...e[c].centroid]);
|
|
3805
3930
|
let l = i[o];
|
|
3806
3931
|
for (let t = 0; t < r; t++) {
|
|
3807
|
-
let r = e[t].centroid, i =
|
|
3932
|
+
let r = e[t].centroid, i = Kl(r[0], r[1], r[2], l[0], l[1], l[2], n);
|
|
3808
3933
|
i < a[t] && (a[t] = i);
|
|
3809
3934
|
}
|
|
3810
3935
|
}
|
|
3811
3936
|
return i;
|
|
3812
3937
|
}
|
|
3813
|
-
function
|
|
3938
|
+
function $l(e, t, n, r, i) {
|
|
3814
3939
|
let a = n.length, o = n.map((e) => [...e]), s = new Float64Array(a), c = new Float64Array(a), l = new Float64Array(a), u = new Float64Array(a), d = new Float64Array(a);
|
|
3815
3940
|
for (let n = 0; n < r; n++) {
|
|
3816
3941
|
c.fill(0), l.fill(0), u.fill(0), d.fill(0);
|
|
3817
3942
|
for (let n = 0; n < t; n++) {
|
|
3818
3943
|
let t = n * 3, r = e[t], s = e[t + 1], f = e[t + 2], p = 0, m = Infinity;
|
|
3819
3944
|
for (let e = 0; e < a; e++) {
|
|
3820
|
-
let t = o[e], n =
|
|
3945
|
+
let t = o[e], n = Kl(r, s, f, t[0], t[1], t[2], i);
|
|
3821
3946
|
n < m && (m = n, p = e);
|
|
3822
3947
|
}
|
|
3823
3948
|
c[p] = c[p] + r, l[p] = l[p] + s, u[p] = u[p] + f, d[p] = d[p] + 1;
|
|
@@ -3827,7 +3952,7 @@ function Fl(e, t, n, r, i) {
|
|
|
3827
3952
|
let t = d[e];
|
|
3828
3953
|
if (t === 0) continue;
|
|
3829
3954
|
let r = c[e] / t, i = l[e] / t, a = u[e] / t, f = o[e];
|
|
3830
|
-
|
|
3955
|
+
Kl(f[0], f[1], f[2], r, i, a, 0) > 1e-10 && (n = !1), f[0] = r, f[1] = i, f[2] = a, s[e] = t;
|
|
3831
3956
|
}
|
|
3832
3957
|
if (n) break;
|
|
3833
3958
|
}
|
|
@@ -3837,7 +3962,7 @@ function Fl(e, t, n, r, i) {
|
|
|
3837
3962
|
populations: Array.from(s)
|
|
3838
3963
|
};
|
|
3839
3964
|
}
|
|
3840
|
-
function
|
|
3965
|
+
function eu(e, t, n) {
|
|
3841
3966
|
let r = e.length, i = Array(r).fill(!1), a = [], o = [];
|
|
3842
3967
|
for (let s = 0; s < r; s++) {
|
|
3843
3968
|
if (i[s]) continue;
|
|
@@ -3845,7 +3970,7 @@ function Il(e, t, n) {
|
|
|
3845
3970
|
for (let a = s + 1; a < r; a++) {
|
|
3846
3971
|
if (i[a]) continue;
|
|
3847
3972
|
let r = e[a], o = t[a];
|
|
3848
|
-
|
|
3973
|
+
Re(c[0], c[1], c[2], r[0], r[1], r[2]) < n && (i[a] = !0, d += r[0] * o, f += r[1] * o, p += r[2] * o, u += o);
|
|
3849
3974
|
}
|
|
3850
3975
|
u > 0 ? a.push([
|
|
3851
3976
|
d / u,
|
|
@@ -3862,15 +3987,15 @@ function Il(e, t, n) {
|
|
|
3862
3987
|
populations: o
|
|
3863
3988
|
};
|
|
3864
3989
|
}
|
|
3865
|
-
function
|
|
3990
|
+
function tu(e, t) {
|
|
3866
3991
|
let n = Math.abs(e - t);
|
|
3867
3992
|
return n > 180 ? 360 - n : n;
|
|
3868
3993
|
}
|
|
3869
|
-
function
|
|
3870
|
-
let n =
|
|
3994
|
+
function nu(e, t) {
|
|
3995
|
+
let n = tu(e.oklch[2], t.oklch[2]) / 180, r = Math.abs(e.oklch[0] - t.oklch[0]), i = Math.abs(e.oklch[1] - t.oklch[1]) / .4;
|
|
3871
3996
|
return 1.5 * n + 1 * r + .5 * i;
|
|
3872
3997
|
}
|
|
3873
|
-
function
|
|
3998
|
+
function ru(e) {
|
|
3874
3999
|
if (e.length <= 2) return e;
|
|
3875
4000
|
let t = 0;
|
|
3876
4001
|
for (let n = 1; n < e.length; n++) e[n].oklch[0] < e[t].oklch[0] && (t = n);
|
|
@@ -3879,16 +4004,16 @@ function zl(e) {
|
|
|
3879
4004
|
let i = n[t - 1], a = -1, o = Infinity;
|
|
3880
4005
|
for (let t = 0; t < e.length; t++) {
|
|
3881
4006
|
if (r.has(t)) continue;
|
|
3882
|
-
let n =
|
|
4007
|
+
let n = nu(i, e[t]);
|
|
3883
4008
|
n < o && (o = n, a = t);
|
|
3884
4009
|
}
|
|
3885
4010
|
n.push(e[a]), r.add(a);
|
|
3886
4011
|
}
|
|
3887
4012
|
return n;
|
|
3888
4013
|
}
|
|
3889
|
-
function
|
|
4014
|
+
function iu(e, t, n, r) {
|
|
3890
4015
|
let i = {
|
|
3891
|
-
...
|
|
4016
|
+
...Gl,
|
|
3892
4017
|
...r
|
|
3893
4018
|
}, a = Math.max(1, Math.min(16, i.k)), o = t * n;
|
|
3894
4019
|
if (o === 0) return [];
|
|
@@ -3896,14 +4021,14 @@ function Bl(e, t, n, r) {
|
|
|
3896
4021
|
for (let r = 0; r < n; r += s) for (let n = 0; n < t; n += s) {
|
|
3897
4022
|
let i = (r * t + n) * 4, a = e[i] / 255, o = e[i + 1] / 255, s = e[i + 2] / 255;
|
|
3898
4023
|
if (e[i + 3] < 10) continue;
|
|
3899
|
-
let [c, d, f] =
|
|
4024
|
+
let [c, d, f] = qe(a, o, s);
|
|
3900
4025
|
l[u * 3] = c, l[u * 3 + 1] = d, l[u * 3 + 2] = f, u++;
|
|
3901
4026
|
}
|
|
3902
4027
|
let d = u;
|
|
3903
4028
|
if (d === 0) return [];
|
|
3904
|
-
let f = Math.min(d, Math.max(a * 4, 64)), { centroids: p, populations: m } =
|
|
3905
|
-
return
|
|
3906
|
-
let [n, r, i] = e, a =
|
|
4029
|
+
let f = Math.min(d, Math.max(a * 4, 64)), { centroids: p, populations: m } = $l(l, d, Ql(Zl(l.slice(0, d * 3), d, f), a, i.chromaWeight), i.maxIterations, i.chromaWeight), h = eu(p, m, i.dedupeThreshold);
|
|
4030
|
+
return ru(h.centroids.map((e, t) => {
|
|
4031
|
+
let [n, r, i] = e, a = Ye(n, r, i), o = Ze(n, r, i);
|
|
3907
4032
|
return {
|
|
3908
4033
|
oklab: [
|
|
3909
4034
|
n,
|
|
@@ -3912,19 +4037,19 @@ function Bl(e, t, n, r) {
|
|
|
3912
4037
|
],
|
|
3913
4038
|
oklch: a,
|
|
3914
4039
|
rgb: o,
|
|
3915
|
-
css:
|
|
4040
|
+
css: ql(a[0], a[1], a[2]),
|
|
3916
4041
|
population: h.populations[t]
|
|
3917
4042
|
};
|
|
3918
4043
|
}));
|
|
3919
4044
|
}
|
|
3920
|
-
function
|
|
3921
|
-
let r =
|
|
4045
|
+
function au(e, t, n) {
|
|
4046
|
+
let r = iu(e, t, n, { k: 5 });
|
|
3922
4047
|
if (r.length === 0) return null;
|
|
3923
4048
|
let i = r[0];
|
|
3924
4049
|
for (let e = 1; e < r.length; e++) r[e].oklch[1] > i.oklch[1] && (i = r[e]);
|
|
3925
4050
|
return i;
|
|
3926
4051
|
}
|
|
3927
|
-
function
|
|
4052
|
+
function ou(e, t, n, r, i, a) {
|
|
3928
4053
|
let o = i, s = a, c = e, l = t, u = n, d = r, f = Math.sqrt(c * c + l * l);
|
|
3929
4054
|
f !== 0 && (c /= f, l /= f);
|
|
3930
4055
|
let p = c * u + l * d;
|
|
@@ -3939,7 +4064,7 @@ function Hl(e, t, n, r, i, a) {
|
|
|
3939
4064
|
skew: p
|
|
3940
4065
|
};
|
|
3941
4066
|
}
|
|
3942
|
-
function
|
|
4067
|
+
function su() {
|
|
3943
4068
|
return [
|
|
3944
4069
|
1,
|
|
3945
4070
|
0,
|
|
@@ -3959,56 +4084,56 @@ function Ul() {
|
|
|
3959
4084
|
1
|
|
3960
4085
|
];
|
|
3961
4086
|
}
|
|
3962
|
-
function
|
|
4087
|
+
function cu(e, t, n) {
|
|
3963
4088
|
return e[n * 4 + t];
|
|
3964
4089
|
}
|
|
3965
4090
|
function $(e, t, n, r) {
|
|
3966
4091
|
e[n * 4 + t] = r;
|
|
3967
4092
|
}
|
|
3968
|
-
function
|
|
4093
|
+
function lu(e, t) {
|
|
3969
4094
|
let n = Array(16).fill(0);
|
|
3970
4095
|
for (let r = 0; r < 4; r++) for (let i = 0; i < 4; i++) {
|
|
3971
4096
|
let a = 0;
|
|
3972
|
-
for (let n = 0; n < 4; n++) a +=
|
|
4097
|
+
for (let n = 0; n < 4; n++) a += cu(e, i, n) * cu(t, n, r);
|
|
3973
4098
|
$(n, i, r, a);
|
|
3974
4099
|
}
|
|
3975
4100
|
return n;
|
|
3976
4101
|
}
|
|
3977
|
-
function
|
|
4102
|
+
function uu(e) {
|
|
3978
4103
|
let t = Array(16).fill(0);
|
|
3979
|
-
for (let n = 0; n < 4; n++) for (let r = 0; r < 4; r++) $(t, r, n,
|
|
4104
|
+
for (let n = 0; n < 4; n++) for (let r = 0; r < 4; r++) $(t, r, n, cu(e, n, r));
|
|
3980
4105
|
return t;
|
|
3981
4106
|
}
|
|
3982
|
-
function
|
|
4107
|
+
function du(e) {
|
|
3983
4108
|
let t = e[0], n = e[4], r = e[8], i = e[12], a = e[1], o = e[5], s = e[9], c = e[13], l = e[2], u = e[6], d = e[10], f = e[14], p = e[3], m = e[7], h = e[11], g = e[15];
|
|
3984
4109
|
return t * (o * (d * g - f * h) - s * (u * g - f * m) + c * (u * h - d * m)) - n * (a * (d * g - f * h) - s * (l * g - f * p) + c * (l * h - d * p)) + r * (a * (u * g - f * m) - o * (l * g - f * p) + c * (l * m - u * p)) - i * (a * (u * h - d * m) - o * (l * h - d * p) + s * (l * m - u * p));
|
|
3985
4110
|
}
|
|
3986
|
-
function
|
|
3987
|
-
let t =
|
|
4111
|
+
function fu(e) {
|
|
4112
|
+
let t = du(e);
|
|
3988
4113
|
if (Math.abs(t) < 1e-12) return null;
|
|
3989
4114
|
let n = Array(16).fill(0);
|
|
3990
4115
|
for (let r = 0; r < 4; r++) for (let i = 0; i < 4; i++) {
|
|
3991
4116
|
let a = [];
|
|
3992
|
-
for (let t = 0; t < 4; t++) if (t !== r) for (let n = 0; n < 4; n++) n !== i && a.push(
|
|
4117
|
+
for (let t = 0; t < 4; t++) if (t !== r) for (let n = 0; n < 4; n++) n !== i && a.push(cu(e, n, t));
|
|
3993
4118
|
let o = a[0] * (a[4] * a[8] - a[5] * a[7]) - a[3] * (a[1] * a[8] - a[2] * a[7]) + a[6] * (a[1] * a[5] - a[2] * a[4]), s = i + r & 1 ? -1 : 1;
|
|
3994
4119
|
$(n, r, i, s * o / t);
|
|
3995
4120
|
}
|
|
3996
4121
|
return n;
|
|
3997
4122
|
}
|
|
3998
|
-
function
|
|
4123
|
+
function pu(e, t, n) {
|
|
3999
4124
|
return Math.sqrt(e * e + t * t + n * n);
|
|
4000
4125
|
}
|
|
4001
|
-
function
|
|
4126
|
+
function mu(e, t) {
|
|
4002
4127
|
return [
|
|
4003
4128
|
e[1] * t[2] - e[2] * t[1],
|
|
4004
4129
|
e[2] * t[0] - e[0] * t[2],
|
|
4005
4130
|
e[0] * t[1] - e[1] * t[0]
|
|
4006
4131
|
];
|
|
4007
4132
|
}
|
|
4008
|
-
function
|
|
4133
|
+
function hu(e, t) {
|
|
4009
4134
|
return e[0] * t[0] + e[1] * t[1] + e[2] * t[2];
|
|
4010
4135
|
}
|
|
4011
|
-
function
|
|
4136
|
+
function gu(e) {
|
|
4012
4137
|
if (e.length !== 16) return null;
|
|
4013
4138
|
let t = [...e], n = t[15];
|
|
4014
4139
|
if (Math.abs(n) < 1e-12) return null;
|
|
@@ -4022,9 +4147,9 @@ function Ql(e) {
|
|
|
4022
4147
|
if (Math.abs(t[3]) > 1e-12 || Math.abs(t[7]) > 1e-12 || Math.abs(t[11]) > 1e-12) {
|
|
4023
4148
|
let e = [...t];
|
|
4024
4149
|
e[3] = 0, e[7] = 0, e[11] = 0, e[15] = 1;
|
|
4025
|
-
let n =
|
|
4150
|
+
let n = fu(e);
|
|
4026
4151
|
if (!n) return null;
|
|
4027
|
-
let i =
|
|
4152
|
+
let i = uu(n);
|
|
4028
4153
|
r[0] = i[0] * t[3] + i[4] * t[7] + i[8] * t[11] + i[12] * t[15], r[1] = i[1] * t[3] + i[5] * t[7] + i[9] * t[11] + i[13] * t[15], r[2] = i[2] * t[3] + i[6] * t[7] + i[10] * t[11] + i[14] * t[15], r[3] = i[3] * t[3] + i[7] * t[7] + i[11] * t[11] + i[15] * t[15];
|
|
4029
4154
|
}
|
|
4030
4155
|
let i = [
|
|
@@ -4043,44 +4168,44 @@ function Ql(e) {
|
|
|
4043
4168
|
t[8],
|
|
4044
4169
|
t[9],
|
|
4045
4170
|
t[10]
|
|
4046
|
-
], c =
|
|
4171
|
+
], c = pu(...a);
|
|
4047
4172
|
a = [
|
|
4048
4173
|
a[0] / c,
|
|
4049
4174
|
a[1] / c,
|
|
4050
4175
|
a[2] / c
|
|
4051
4176
|
];
|
|
4052
|
-
let l =
|
|
4177
|
+
let l = hu(a, o);
|
|
4053
4178
|
o = [
|
|
4054
4179
|
o[0] - a[0] * l,
|
|
4055
4180
|
o[1] - a[1] * l,
|
|
4056
4181
|
o[2] - a[2] * l
|
|
4057
4182
|
];
|
|
4058
|
-
let u =
|
|
4183
|
+
let u = pu(...o);
|
|
4059
4184
|
o = [
|
|
4060
4185
|
o[0] / u,
|
|
4061
4186
|
o[1] / u,
|
|
4062
4187
|
o[2] / u
|
|
4063
4188
|
], l /= u;
|
|
4064
|
-
let d =
|
|
4189
|
+
let d = hu(a, s);
|
|
4065
4190
|
s = [
|
|
4066
4191
|
s[0] - a[0] * d,
|
|
4067
4192
|
s[1] - a[1] * d,
|
|
4068
4193
|
s[2] - a[2] * d
|
|
4069
4194
|
];
|
|
4070
|
-
let f =
|
|
4195
|
+
let f = hu(o, s);
|
|
4071
4196
|
s = [
|
|
4072
4197
|
s[0] - o[0] * f,
|
|
4073
4198
|
s[1] - o[1] * f,
|
|
4074
4199
|
s[2] - o[2] * f
|
|
4075
4200
|
];
|
|
4076
|
-
let p =
|
|
4201
|
+
let p = pu(...s);
|
|
4077
4202
|
s = [
|
|
4078
4203
|
s[0] / p,
|
|
4079
4204
|
s[1] / p,
|
|
4080
4205
|
s[2] / p
|
|
4081
4206
|
], d /= p, f /= p;
|
|
4082
|
-
let m =
|
|
4083
|
-
|
|
4207
|
+
let m = mu(o, s);
|
|
4208
|
+
hu(a, m) < 0 && (a = [
|
|
4084
4209
|
-a[0],
|
|
4085
4210
|
-a[1],
|
|
4086
4211
|
-a[2]
|
|
@@ -4093,7 +4218,7 @@ function Ql(e) {
|
|
|
4093
4218
|
-s[1],
|
|
4094
4219
|
-s[2]
|
|
4095
4220
|
]);
|
|
4096
|
-
let h =
|
|
4221
|
+
let h = _u(a[0], o[0], s[0], a[1], o[1], s[1], a[2], o[2], s[2]);
|
|
4097
4222
|
return {
|
|
4098
4223
|
translate: i,
|
|
4099
4224
|
scale: [
|
|
@@ -4110,7 +4235,7 @@ function Ql(e) {
|
|
|
4110
4235
|
perspective: r
|
|
4111
4236
|
};
|
|
4112
4237
|
}
|
|
4113
|
-
function
|
|
4238
|
+
function _u(e, t, n, r, i, a, o, s, c) {
|
|
4114
4239
|
let l = e + i + c, u, d, f, p;
|
|
4115
4240
|
if (l > 0) {
|
|
4116
4241
|
let e = .5 / Math.sqrt(l + 1);
|
|
@@ -4132,7 +4257,7 @@ function $l(e, t, n, r, i, a, o, s, c) {
|
|
|
4132
4257
|
p
|
|
4133
4258
|
];
|
|
4134
4259
|
}
|
|
4135
|
-
function
|
|
4260
|
+
function vu(e, t, n) {
|
|
4136
4261
|
let r = e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3];
|
|
4137
4262
|
if (r < 0 && (t = [
|
|
4138
4263
|
-t[0],
|
|
@@ -4161,33 +4286,33 @@ function eu(e, t, n) {
|
|
|
4161
4286
|
e[3] * o + t[3] * s
|
|
4162
4287
|
];
|
|
4163
4288
|
}
|
|
4164
|
-
function
|
|
4165
|
-
let t =
|
|
4289
|
+
function yu(e) {
|
|
4290
|
+
let t = su();
|
|
4166
4291
|
$(t, 0, 3, e.perspective[0]), $(t, 1, 3, e.perspective[1]), $(t, 2, 3, e.perspective[2]), $(t, 3, 3, e.perspective[3]), t[12] = t[12] + e.translate[0] * t[0] + e.translate[1] * t[4] + e.translate[2] * t[8], t[13] = t[13] + e.translate[0] * t[1] + e.translate[1] * t[5] + e.translate[2] * t[9], t[14] = t[14] + e.translate[0] * t[2] + e.translate[1] * t[6] + e.translate[2] * t[10], t[15] = t[15] + e.translate[0] * t[3] + e.translate[1] * t[7] + e.translate[2] * t[11];
|
|
4167
|
-
let n =
|
|
4292
|
+
let n = lu(t, bu(e.quaternion));
|
|
4168
4293
|
for (let e = 0; e < 16; e++) t[e] = n[e];
|
|
4169
4294
|
if (e.skew[2] !== 0) {
|
|
4170
|
-
let n =
|
|
4295
|
+
let n = su();
|
|
4171
4296
|
$(n, 1, 2, e.skew[2]);
|
|
4172
|
-
let r =
|
|
4297
|
+
let r = lu(t, n);
|
|
4173
4298
|
for (let e = 0; e < 16; e++) t[e] = r[e];
|
|
4174
4299
|
}
|
|
4175
4300
|
if (e.skew[1] !== 0) {
|
|
4176
|
-
let n =
|
|
4301
|
+
let n = su();
|
|
4177
4302
|
$(n, 0, 2, e.skew[1]);
|
|
4178
|
-
let r =
|
|
4303
|
+
let r = lu(t, n);
|
|
4179
4304
|
for (let e = 0; e < 16; e++) t[e] = r[e];
|
|
4180
4305
|
}
|
|
4181
4306
|
if (e.skew[0] !== 0) {
|
|
4182
|
-
let n =
|
|
4307
|
+
let n = su();
|
|
4183
4308
|
$(n, 0, 1, e.skew[0]);
|
|
4184
|
-
let r =
|
|
4309
|
+
let r = lu(t, n);
|
|
4185
4310
|
for (let e = 0; e < 16; e++) t[e] = r[e];
|
|
4186
4311
|
}
|
|
4187
4312
|
let [r, i, a] = e.scale;
|
|
4188
4313
|
return t[0] *= r, t[1] *= r, t[2] *= r, t[3] *= r, t[4] *= i, t[5] *= i, t[6] *= i, t[7] *= i, t[8] *= a, t[9] *= a, t[10] *= a, t[11] *= a, [...t];
|
|
4189
4314
|
}
|
|
4190
|
-
function
|
|
4315
|
+
function bu(e) {
|
|
4191
4316
|
let [t, n, r, i] = e, a = t * t, o = n * n, s = r * r, c = t * n, l = t * r, u = n * r, d = i * t, f = i * n, p = i * r;
|
|
4192
4317
|
return [
|
|
4193
4318
|
1 - 2 * (o + s),
|
|
@@ -4208,7 +4333,7 @@ function nu(e) {
|
|
|
4208
4333
|
1
|
|
4209
4334
|
];
|
|
4210
4335
|
}
|
|
4211
|
-
function
|
|
4336
|
+
function xu(e, t, n) {
|
|
4212
4337
|
let r = (e, t) => e + (t - e) * n;
|
|
4213
4338
|
return {
|
|
4214
4339
|
translate: [
|
|
@@ -4226,7 +4351,7 @@ function ru(e, t, n) {
|
|
|
4226
4351
|
r(e.skew[1], t.skew[1]),
|
|
4227
4352
|
r(e.skew[2], t.skew[2])
|
|
4228
4353
|
],
|
|
4229
|
-
quaternion:
|
|
4354
|
+
quaternion: vu(e.quaternion, t.quaternion, n),
|
|
4230
4355
|
perspective: [
|
|
4231
4356
|
r(e.perspective[0], t.perspective[0]),
|
|
4232
4357
|
r(e.perspective[1], t.perspective[1]),
|
|
@@ -4235,4 +4360,4 @@ function ru(e, t, n) {
|
|
|
4235
4360
|
]
|
|
4236
4361
|
};
|
|
4237
4362
|
}
|
|
4238
|
-
export {
|
|
4363
|
+
export { Nr as ABSOLUTE_LENGTH_UNITS, he as ALPHA_DENORM_UNIT, C as ALPHA_RANGE, Lr as ANGLE_UNITS, Tr as AdobeRGBColor, ke as COLOR_NAMES, ge as COLOR_SPACE_DENORM_UNITS, ye as COLOR_SPACE_NAMES, T as COLOR_SPACE_RANGES, Hr as COMPUTED_UNITS, Ra as CSSColor, Z as CSSCubicBezier, mo as CSSFunction, ho as CSSJSON, uo as CSSString, H as CSSValueUnit, _o as CSSValues, co as CSS_WIDE_KEYWORDS, Vn as CYLINDRICAL_HUE_COMPONENT, I as Color, Le as DELTA_E_OK_JND, wr as DisplayP3Color, Vr as FLEX_UNITS, s as FRAME_RATE, zr as FREQUENCY_UNITS, X as FunctionValue, Oe as GAMUT_SECTOR_COEFFICIENTS, hr as HSLColor, gr as HSVColor, me as HUE_RANGE, _r as HWBColor, Sr as KelvinColor, vr as LABColor, yr as LCHColor, Fr as LENGTH_UNITS, O as LINEAR_SRGB_TO_LMS, D as LMS_TO_LINEAR_SRGB, E as LMS_TO_OKLAB_MATRIX, Ee as LMS_TO_XYZ_MATRIX, Cr as LinearSRGBColor, br as OKLABColor, k as OKLAB_TO_LMS_COEFF, De as OKLAB_TO_LMS_MATRIX, xr as OKLCHColor, Rr as PERCENTAGE_UNITS, Er as ProPhotoRGBColor, Pr as RELATIVE_LENGTH_UNITS, Br as RESOLUTION_UNITS, fe as RGBA_MAX, L as RGBColor, pe as RGB_RANGE, Dr as Rec2020Color, qr as STYLE_NAMES, Ir as TIME_UNITS, Gr as UNITS, w as UNIT_RANGE, Wa as ValueArray, Y as ValueUnit, we as WHITE_POINTS, xe as WHITE_POINT_D50, Ce as WHITE_POINT_D50_D65, be as WHITE_POINT_D65, Se as WHITE_POINT_D65_D50, R as XYZColor, Te as XYZ_TO_LMS_MATRIX, u as arrayEquals, Tc as bezierPresets, rc as bounceInEase, ic as bounceInEaseHalf, sc as bounceInOutEase, ac as bounceOutEase, oc as bounceOutEaseHalf, Ro as bumpLayoutEpoch, _ as camelCaseToHyphen, ne as cancelAnimationFrame, v as clamp, Va as clearCustomColorNames, l as clone, N as color2, jr as colorUnit2, Ve as computeMaxSaturation, Gn as computeSafeAccent, hi as convert2, oi as convertAbsoluteUnitToPixels, di as convertToDPI, li as convertToDegrees, ui as convertToHz, ci as convertToMs, si as convertToPixels, m as createHash, Zo as cssFiltersToString, qs as cssLinear, oe as cubicBezier, ce as cubicBezierToSVG, le as cubicBezierToString, ae as deCasteljau, p as debounce, ou as decomposeMatrix2D, gu as decomposeMatrix3D, Re as deltaEOK, au as dominantColor, nc as easeInBounce, dc as easeInCirc, Zs as easeInCubic, mc as easeInExpo, pc as easeInOutCirc, $s as easeInOutCubic, gc as easeInOutExpo, Xs as easeInOutQuad, uc as easeInOutSine, Js as easeInQuad, cc as easeInSine, fc as easeOutCirc, Qs as easeOutCubic, hc as easeOutExpo, Ys as easeOutQuad, lc as easeOutSine, Zi as evaluateMathFunction, Ml as extractAnimationOptions, Cl as extractKeyframes, wl as extractProperties, Tl as extractStyleRules, Si as fail, He as findCusp, Ue as findGamutIntersection, Yr as flattenObject, Ul as formatCSS, Bn as gamutMap, Ke as gamutMapOKLab, Je as gamutMapSRGB, Bo as getComputedValue, Ha as getCustomColorNames, Fn as getFormattedColorSpaceRange, Lo as getLayoutEpoch, Kn as getOklchLightness, g as hyphenToCamelCase, vi as identifier, bi as integer, se as interpBezier, xu as interpolateDecomposed, Hn as interpolateHue, S as invertMat3, $r as isCSSStyleName, Jr as isColorUnit, Be as isInSRGBGamut, c as isObject, z as istring, _c as jumpTerms, b as lerp, re as lerpArray, Go as lerpColorValue, Wo as lerpComputedValue, Ko as lerpNumericValue, qo as lerpValue, Ks as linear, ie as logerp, h as memoize, Un as mixColors, Xo as mixColorsN, de as multiplyMat3, qn as needsContrastAdjustment, yi as none, kr as normalizeColor, Ar as normalizeColorUnit, Or as normalizeColorUnitComponent, Mr as normalizeColorUnits, Vo as normalizeNumericUnits, Uo as normalizeValueUnits, B as number, ze as oklabToLinearSRGB, Ze as oklabToRgb255, yl as parseAnimationShorthand, Ua as parseCSSColor, yo as parseCSSPercent, ol as parseCSSStylesheet, bo as parseCSSTime, vo as parseCSSValue, Ui as parseCSSValueUnit, Ci as parseResult, Jo as prepareInterpVar, iu as quantizePixels, Ye as rawOklabToOklch, Xe as rawOklchToOklab, yu as recomposeMatrix3D, Ba as registerColorNames, te as requestAnimationFrame, xl as reverseAnimationShorthand, Gi as reverseCSSIterationCount, Wi as reverseCSSTime, Gs as rgb2ColorFilter, Jn as safeAccentColor, y as scale, ee as seekPreviousValue, Pl as serializeDeclaration, Nl as serializeKeyframeSelector, Vl as serializeStylesheet, Bl as serializeStylesheetItem, d as sleep, vu as slerp, ec as smoothStep3, tc as solveCubicBezierX, qe as srgbToOKLab, wc as stepEnd, Cc as stepStart, Sc as steppedEase, Wl as stylesheetToString, xi as succeed, Ec as timingFunctionDescriptions, Dc as timingFunctions, x as transformMat3, ue as transposeMat3, V as tryParse, Xr as unflattenObject, Zr as unflattenObjectToString, ei as unpackMatrixValues, f as waitUntil };
|