@fest-lib/image 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/image.js +1008 -1769
- package/package.json +1 -1
- package/dist/index.js +0 -3401
package/dist/image.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { getCorrectOrientation as Gr, makeRAFCycle as Jr, orientationNumberMap as Kr, whenAnyScreenChanges as Vr } from "@fest-lib/dom";
|
|
2
|
+
var wo = "electronBridge", xo = { fast: {
|
|
2
3
|
divisor: 4,
|
|
3
4
|
filter: "blur(4px)",
|
|
4
5
|
sampling: 128
|
|
5
|
-
} },
|
|
6
|
+
} }, ur = (e, t) => {
|
|
6
7
|
if (typeof e == "number") {
|
|
7
8
|
if (t === 3) return {
|
|
8
9
|
mode: "rgb",
|
|
@@ -31,7 +32,7 @@ var Wo = "electronBridge", qo = { fast: {
|
|
|
31
32
|
alpha: (e & 255) / 255
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
|
-
},
|
|
35
|
+
}, Qr = {
|
|
35
36
|
aliceblue: 15792383,
|
|
36
37
|
antiquewhite: 16444375,
|
|
37
38
|
aqua: 65535,
|
|
@@ -180,36 +181,36 @@ var Wo = "electronBridge", qo = { fast: {
|
|
|
180
181
|
whitesmoke: 16119285,
|
|
181
182
|
yellow: 16776960,
|
|
182
183
|
yellowgreen: 10145074
|
|
183
|
-
},
|
|
184
|
+
}, ea = (e) => ur(Qr[e.toLowerCase()], 6), ta = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i, ra = (e) => {
|
|
184
185
|
let t;
|
|
185
|
-
return (t = e.match(
|
|
186
|
-
}, P = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",
|
|
186
|
+
return (t = e.match(ta)) ? ur(parseInt(t[1], 16), t[1].length) : void 0;
|
|
187
|
+
}, P = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)", ko = `(?:${P}|none)`, te = `${P}%`, _o = `(?:${P}%|none)`, yt = `(?:${P}%|${P})`, aa = `(?:${P}%|${P}|none)`, ia = `(?:${P}(deg|grad|rad|turn)|${P})`, $o = `(?:${P}(deg|grad|rad|turn)|${P}|none)`, j = "\\s*,\\s*", zo = new RegExp("^" + aa + "$"), oa = new RegExp(`^rgba?\\(\\s*${P}${j}${P}${j}${P}\\s*(?:,\\s*${yt}\\s*)?\\)$`), na = new RegExp(`^rgba?\\(\\s*${te}${j}${te}${j}${te}\\s*(?:,\\s*${yt}\\s*)?\\)$`), la = (e) => {
|
|
187
188
|
let t = { mode: "rgb" }, r;
|
|
188
|
-
if (r = e.match(
|
|
189
|
+
if (r = e.match(oa))
|
|
189
190
|
r[1] !== void 0 && (t.r = r[1] / 255), r[2] !== void 0 && (t.g = r[2] / 255), r[3] !== void 0 && (t.b = r[3] / 255);
|
|
190
|
-
else if (r = e.match(
|
|
191
|
+
else if (r = e.match(na))
|
|
191
192
|
r[1] !== void 0 && (t.r = r[1] / 100), r[2] !== void 0 && (t.g = r[2] / 100), r[3] !== void 0 && (t.b = r[3] / 100);
|
|
192
193
|
else return;
|
|
193
194
|
return r[4] !== void 0 ? t.alpha = Math.max(0, Math.min(1, r[4] / 100)) : r[5] !== void 0 && (t.alpha = Math.max(0, Math.min(1, +r[5]))), t;
|
|
194
|
-
},
|
|
195
|
+
}, sa = (e, t) => e === void 0 ? void 0 : typeof e != "object" ? ga(e) : e.mode !== void 0 ? e : t ? {
|
|
195
196
|
...e,
|
|
196
197
|
mode: t
|
|
197
|
-
} : void 0,
|
|
198
|
-
...
|
|
198
|
+
} : void 0, Mt = (e = "rgb") => (t) => (t = sa(t, e)) !== void 0 ? t.mode === e ? t : S[t.mode][e] ? S[t.mode][e](t) : e === "rgb" ? S[t.mode].rgb(t) : S.rgb[e](S[t.mode].rgb(t)) : void 0, S = {}, fr = {}, ue = [], pr = {}, ha = (e) => e, m = (e) => (S[e.mode] = {
|
|
199
|
+
...S[e.mode],
|
|
199
200
|
...e.toMode
|
|
200
201
|
}, Object.keys(e.fromMode || {}).forEach((t) => {
|
|
201
|
-
|
|
202
|
+
S[t] || (S[t] = {}), S[t][e.mode] = e.fromMode[t];
|
|
202
203
|
}), e.ranges || (e.ranges = {}), e.difference || (e.difference = {}), e.channels.forEach((t) => {
|
|
203
204
|
if (e.ranges[t] === void 0 && (e.ranges[t] = [0, 1]), !e.interpolate[t]) throw new Error(`Missing interpolator for: ${t}`);
|
|
204
|
-
typeof e.interpolate[t] == "function" && (e.interpolate[t] = { use: e.interpolate[t] }), e.interpolate[t].fixup || (e.interpolate[t].fixup =
|
|
205
|
-
}),
|
|
206
|
-
|
|
207
|
-
}),
|
|
205
|
+
typeof e.interpolate[t] == "function" && (e.interpolate[t] = { use: e.interpolate[t] }), e.interpolate[t].fixup || (e.interpolate[t].fixup = ha);
|
|
206
|
+
}), fr[e.mode] = e, (e.parse || []).forEach((t) => {
|
|
207
|
+
ca(t, e.mode);
|
|
208
|
+
}), Mt(e.mode)), da = (e) => fr[e], ca = (e, t) => {
|
|
208
209
|
if (typeof e == "string") {
|
|
209
210
|
if (!t) throw new Error("'mode' required when 'parser' is a string");
|
|
210
|
-
|
|
211
|
-
} else typeof e == "function" &&
|
|
212
|
-
},
|
|
211
|
+
pr[e] = t;
|
|
212
|
+
} else typeof e == "function" && ue.indexOf(e) < 0 && ue.push(e);
|
|
213
|
+
}, lt = /[^\x00-\x7F]|[a-zA-Z_]/, va = /[^\x00-\x7F]|[-\w]/, s = {
|
|
213
214
|
Function: "function",
|
|
214
215
|
Ident: "ident",
|
|
215
216
|
Number: "number",
|
|
@@ -218,126 +219,126 @@ var Wo = "electronBridge", qo = { fast: {
|
|
|
218
219
|
None: "none",
|
|
219
220
|
Hue: "hue",
|
|
220
221
|
Alpha: "alpha"
|
|
221
|
-
},
|
|
222
|
-
function
|
|
223
|
-
let t = e[
|
|
224
|
-
return t === "-" || t === "+" ? /\d/.test(r) || r === "." && /\d/.test(e[
|
|
222
|
+
}, u = 0;
|
|
223
|
+
function le(e) {
|
|
224
|
+
let t = e[u], r = e[u + 1];
|
|
225
|
+
return t === "-" || t === "+" ? /\d/.test(r) || r === "." && /\d/.test(e[u + 2]) : t === "." ? /\d/.test(r) : /\d/.test(t);
|
|
225
226
|
}
|
|
226
|
-
function
|
|
227
|
-
if (
|
|
228
|
-
let t = e[
|
|
229
|
-
if (
|
|
227
|
+
function st(e) {
|
|
228
|
+
if (u >= e.length) return !1;
|
|
229
|
+
let t = e[u];
|
|
230
|
+
if (lt.test(t)) return !0;
|
|
230
231
|
if (t === "-") {
|
|
231
|
-
if (e.length -
|
|
232
|
-
let r = e[
|
|
233
|
-
return !!(r === "-" ||
|
|
232
|
+
if (e.length - u < 2) return !1;
|
|
233
|
+
let r = e[u + 1];
|
|
234
|
+
return !!(r === "-" || lt.test(r));
|
|
234
235
|
}
|
|
235
236
|
return !1;
|
|
236
237
|
}
|
|
237
|
-
var
|
|
238
|
+
var ua = {
|
|
238
239
|
deg: 1,
|
|
239
240
|
rad: 180 / Math.PI,
|
|
240
241
|
grad: 9 / 10,
|
|
241
242
|
turn: 360
|
|
242
243
|
};
|
|
243
|
-
function
|
|
244
|
+
function ee(e) {
|
|
244
245
|
let t = "";
|
|
245
|
-
if ((e[
|
|
246
|
-
let r =
|
|
246
|
+
if ((e[u] === "-" || e[u] === "+") && (t += e[u++]), t += se(e), e[u] === "." && /\d/.test(e[u + 1]) && (t += e[u++] + se(e)), (e[u] === "e" || e[u] === "E") && ((e[u + 1] === "-" || e[u + 1] === "+") && /\d/.test(e[u + 2]) ? t += e[u++] + e[u++] + se(e) : /\d/.test(e[u + 1]) && (t += e[u++] + se(e))), st(e)) {
|
|
247
|
+
let r = fe(e);
|
|
247
248
|
return r === "deg" || r === "rad" || r === "turn" || r === "grad" ? {
|
|
248
|
-
type:
|
|
249
|
-
value: t *
|
|
249
|
+
type: s.Hue,
|
|
250
|
+
value: t * ua[r]
|
|
250
251
|
} : void 0;
|
|
251
252
|
}
|
|
252
|
-
return e[
|
|
253
|
-
type:
|
|
253
|
+
return e[u] === "%" ? (u++, {
|
|
254
|
+
type: s.Percentage,
|
|
254
255
|
value: +t
|
|
255
256
|
}) : {
|
|
256
|
-
type:
|
|
257
|
+
type: s.Number,
|
|
257
258
|
value: +t
|
|
258
259
|
};
|
|
259
260
|
}
|
|
260
|
-
function
|
|
261
|
+
function se(e) {
|
|
261
262
|
let t = "";
|
|
262
|
-
for (; /\d/.test(e[
|
|
263
|
+
for (; /\d/.test(e[u]); ) t += e[u++];
|
|
263
264
|
return t;
|
|
264
265
|
}
|
|
265
|
-
function
|
|
266
|
+
function fe(e) {
|
|
266
267
|
let t = "";
|
|
267
|
-
for (;
|
|
268
|
+
for (; u < e.length && va.test(e[u]); ) t += e[u++];
|
|
268
269
|
return t;
|
|
269
270
|
}
|
|
270
|
-
function
|
|
271
|
-
let t =
|
|
272
|
-
return e[
|
|
273
|
-
type:
|
|
271
|
+
function fa(e) {
|
|
272
|
+
let t = fe(e);
|
|
273
|
+
return e[u] === "(" ? (u++, {
|
|
274
|
+
type: s.Function,
|
|
274
275
|
value: t
|
|
275
276
|
}) : t === "none" ? {
|
|
276
|
-
type:
|
|
277
|
+
type: s.None,
|
|
277
278
|
value: void 0
|
|
278
279
|
} : {
|
|
279
|
-
type:
|
|
280
|
+
type: s.Ident,
|
|
280
281
|
value: t
|
|
281
282
|
};
|
|
282
283
|
}
|
|
283
|
-
function
|
|
284
|
+
function pa(e = "") {
|
|
284
285
|
let t = e.trim(), r = [], a;
|
|
285
|
-
for (
|
|
286
|
-
if (a = t[
|
|
286
|
+
for (u = 0; u < t.length; ) {
|
|
287
|
+
if (a = t[u++], a === `
|
|
287
288
|
` || a === " " || a === " ") {
|
|
288
|
-
for (;
|
|
289
|
-
` || t[
|
|
289
|
+
for (; u < t.length && (t[u] === `
|
|
290
|
+
` || t[u] === " " || t[u] === " "); ) u++;
|
|
290
291
|
continue;
|
|
291
292
|
}
|
|
292
293
|
if (a === ",") return;
|
|
293
294
|
if (a === ")") {
|
|
294
|
-
r.push({ type:
|
|
295
|
+
r.push({ type: s.ParenClose });
|
|
295
296
|
continue;
|
|
296
297
|
}
|
|
297
298
|
if (a === "+") {
|
|
298
|
-
if (
|
|
299
|
-
r.push(
|
|
299
|
+
if (u--, le(t)) {
|
|
300
|
+
r.push(ee(t));
|
|
300
301
|
continue;
|
|
301
302
|
}
|
|
302
303
|
return;
|
|
303
304
|
}
|
|
304
305
|
if (a === "-") {
|
|
305
|
-
if (
|
|
306
|
-
r.push(
|
|
306
|
+
if (u--, le(t)) {
|
|
307
|
+
r.push(ee(t));
|
|
307
308
|
continue;
|
|
308
309
|
}
|
|
309
|
-
if (
|
|
310
|
+
if (st(t)) {
|
|
310
311
|
r.push({
|
|
311
|
-
type:
|
|
312
|
-
value:
|
|
312
|
+
type: s.Ident,
|
|
313
|
+
value: fe(t)
|
|
313
314
|
});
|
|
314
315
|
continue;
|
|
315
316
|
}
|
|
316
317
|
return;
|
|
317
318
|
}
|
|
318
319
|
if (a === ".") {
|
|
319
|
-
if (
|
|
320
|
-
r.push(
|
|
320
|
+
if (u--, le(t)) {
|
|
321
|
+
r.push(ee(t));
|
|
321
322
|
continue;
|
|
322
323
|
}
|
|
323
324
|
return;
|
|
324
325
|
}
|
|
325
326
|
if (a === "/") {
|
|
326
|
-
for (;
|
|
327
|
-
` || t[
|
|
328
|
-
let
|
|
329
|
-
if (
|
|
327
|
+
for (; u < t.length && (t[u] === `
|
|
328
|
+
` || t[u] === " " || t[u] === " "); ) u++;
|
|
329
|
+
let i;
|
|
330
|
+
if (le(t) && (i = ee(t), i.type !== s.Hue)) {
|
|
330
331
|
r.push({
|
|
331
|
-
type:
|
|
332
|
-
value:
|
|
332
|
+
type: s.Alpha,
|
|
333
|
+
value: i
|
|
333
334
|
});
|
|
334
335
|
continue;
|
|
335
336
|
}
|
|
336
|
-
if (
|
|
337
|
+
if (st(t) && fe(t) === "none") {
|
|
337
338
|
r.push({
|
|
338
|
-
type:
|
|
339
|
+
type: s.Alpha,
|
|
339
340
|
value: {
|
|
340
|
-
type:
|
|
341
|
+
type: s.None,
|
|
341
342
|
value: void 0
|
|
342
343
|
}
|
|
343
344
|
});
|
|
@@ -346,39 +347,39 @@ function Ba(e = "") {
|
|
|
346
347
|
return;
|
|
347
348
|
}
|
|
348
349
|
if (/\d/.test(a)) {
|
|
349
|
-
|
|
350
|
+
u--, r.push(ee(t));
|
|
350
351
|
continue;
|
|
351
352
|
}
|
|
352
|
-
if (
|
|
353
|
-
|
|
353
|
+
if (lt.test(a)) {
|
|
354
|
+
u--, r.push(fa(t));
|
|
354
355
|
continue;
|
|
355
356
|
}
|
|
356
357
|
return;
|
|
357
358
|
}
|
|
358
359
|
return r;
|
|
359
360
|
}
|
|
360
|
-
function
|
|
361
|
+
function ma(e) {
|
|
361
362
|
e._i = 0;
|
|
362
363
|
let t = e[e._i++];
|
|
363
|
-
if (!t || t.type !==
|
|
364
|
-
const r =
|
|
364
|
+
if (!t || t.type !== s.Function || t.value !== "color" || (t = e[e._i++], t.type !== s.Ident)) return;
|
|
365
|
+
const r = pr[t.value];
|
|
365
366
|
if (!r) return;
|
|
366
|
-
const a = { mode: r },
|
|
367
|
-
if (!
|
|
368
|
-
const
|
|
369
|
-
for (let
|
|
370
|
-
|
|
367
|
+
const a = { mode: r }, i = mr(e, !1);
|
|
368
|
+
if (!i) return;
|
|
369
|
+
const o = da(r).channels;
|
|
370
|
+
for (let n = 0, l, d; n < o.length; n++)
|
|
371
|
+
l = i[n], d = o[n], l.type !== s.None && (a[d] = l.type === s.Number ? l.value : l.value / 100, d === "alpha" && (a[d] = Math.max(0, Math.min(1, a[d]))));
|
|
371
372
|
return a;
|
|
372
373
|
}
|
|
373
|
-
function
|
|
374
|
+
function mr(e, t) {
|
|
374
375
|
const r = [];
|
|
375
376
|
let a;
|
|
376
377
|
for (; e._i < e.length; ) {
|
|
377
|
-
if (a = e[e._i++], a.type ===
|
|
378
|
+
if (a = e[e._i++], a.type === s.None || a.type === s.Number || a.type === s.Alpha || a.type === s.Percentage || t && a.type === s.Hue) {
|
|
378
379
|
r.push(a);
|
|
379
380
|
continue;
|
|
380
381
|
}
|
|
381
|
-
if (a.type ===
|
|
382
|
+
if (a.type === s.ParenClose) {
|
|
382
383
|
if (e._i < e.length) return;
|
|
383
384
|
continue;
|
|
384
385
|
}
|
|
@@ -386,59 +387,59 @@ function Dr(e, t) {
|
|
|
386
387
|
}
|
|
387
388
|
if (!(r.length < 3 || r.length > 4)) {
|
|
388
389
|
if (r.length === 4) {
|
|
389
|
-
if (r[3].type !==
|
|
390
|
+
if (r[3].type !== s.Alpha) return;
|
|
390
391
|
r[3] = r[3].value;
|
|
391
392
|
}
|
|
392
393
|
return r.length === 3 && r.push({
|
|
393
|
-
type:
|
|
394
|
+
type: s.None,
|
|
394
395
|
value: void 0
|
|
395
|
-
}), r.every((
|
|
396
|
+
}), r.every((i) => i.type !== s.Alpha) ? r : void 0;
|
|
396
397
|
}
|
|
397
398
|
}
|
|
398
|
-
function
|
|
399
|
+
function ba(e, t) {
|
|
399
400
|
e._i = 0;
|
|
400
401
|
let r = e[e._i++];
|
|
401
|
-
if (!r || r.type !==
|
|
402
|
-
let a =
|
|
402
|
+
if (!r || r.type !== s.Function) return;
|
|
403
|
+
let a = mr(e, t);
|
|
403
404
|
if (a)
|
|
404
405
|
return a.unshift(r.value), a;
|
|
405
406
|
}
|
|
406
|
-
var
|
|
407
|
+
var ga = (e) => {
|
|
407
408
|
if (typeof e != "string") return;
|
|
408
|
-
const t =
|
|
409
|
-
let a,
|
|
410
|
-
for (;
|
|
411
|
-
return t ?
|
|
409
|
+
const t = pa(e), r = t ? ba(t, !0) : void 0;
|
|
410
|
+
let a, i = 0, o = ue.length;
|
|
411
|
+
for (; i < o; ) if ((a = ue[i++](e, r)) !== void 0) return a;
|
|
412
|
+
return t ? ma(t) : void 0;
|
|
412
413
|
};
|
|
413
|
-
function
|
|
414
|
+
function ya(e, t) {
|
|
414
415
|
if (!t || t[0] !== "rgb" && t[0] !== "rgba") return;
|
|
415
|
-
const r = { mode: "rgb" }, [, a,
|
|
416
|
-
if (!(a.type ===
|
|
417
|
-
return a.type !==
|
|
416
|
+
const r = { mode: "rgb" }, [, a, i, o, n] = t;
|
|
417
|
+
if (!(a.type === s.Hue || i.type === s.Hue || o.type === s.Hue))
|
|
418
|
+
return a.type !== s.None && (r.r = a.type === s.Number ? a.value / 255 : a.value / 100), i.type !== s.None && (r.g = i.type === s.Number ? i.value / 255 : i.value / 100), o.type !== s.None && (r.b = o.type === s.Number ? o.value / 255 : o.value / 100), n.type !== s.None && (r.alpha = Math.min(1, Math.max(0, n.type === s.Number ? n.value : n.value / 100))), r;
|
|
418
419
|
}
|
|
419
|
-
var
|
|
420
|
+
var Ma = (e) => e === "transparent" ? {
|
|
420
421
|
mode: "rgb",
|
|
421
422
|
r: 0,
|
|
422
423
|
g: 0,
|
|
423
424
|
b: 0,
|
|
424
425
|
alpha: 0
|
|
425
|
-
} : void 0,
|
|
426
|
+
} : void 0, wa = (e, t, r) => e + r * (t - e), xa = (e) => {
|
|
426
427
|
let t = [];
|
|
427
428
|
for (let r = 0; r < e.length - 1; r++) {
|
|
428
|
-
let a = e[r],
|
|
429
|
-
a === void 0 &&
|
|
429
|
+
let a = e[r], i = e[r + 1];
|
|
430
|
+
a === void 0 && i === void 0 ? t.push(void 0) : a !== void 0 && i !== void 0 ? t.push([a, i]) : t.push(a !== void 0 ? [a, a] : [i, i]);
|
|
430
431
|
}
|
|
431
432
|
return t;
|
|
432
|
-
},
|
|
433
|
-
let r =
|
|
433
|
+
}, ka = (e) => (t) => {
|
|
434
|
+
let r = xa(t);
|
|
434
435
|
return (a) => {
|
|
435
|
-
let
|
|
436
|
-
return
|
|
436
|
+
let i = a * r.length, o = a >= 1 ? r.length - 1 : Math.max(Math.floor(i), 0), n = r[o];
|
|
437
|
+
return n === void 0 ? void 0 : e(n[0], n[1], i - o);
|
|
437
438
|
};
|
|
438
|
-
}, h =
|
|
439
|
+
}, h = ka(wa), M = (e) => {
|
|
439
440
|
let t = !1, r = e.map((a) => a !== void 0 ? (t = !0, a) : 1);
|
|
440
441
|
return t ? r : e;
|
|
441
|
-
},
|
|
442
|
+
}, B = {
|
|
442
443
|
mode: "rgb",
|
|
443
444
|
channels: [
|
|
444
445
|
"r",
|
|
@@ -447,11 +448,11 @@ var Ja = (e) => e === "transparent" ? {
|
|
|
447
448
|
"alpha"
|
|
448
449
|
],
|
|
449
450
|
parse: [
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
451
|
+
ya,
|
|
452
|
+
ra,
|
|
453
|
+
la,
|
|
454
|
+
ea,
|
|
455
|
+
Ma,
|
|
455
456
|
"srgb"
|
|
456
457
|
],
|
|
457
458
|
serialize: "srgb",
|
|
@@ -461,7 +462,7 @@ var Ja = (e) => e === "transparent" ? {
|
|
|
461
462
|
b: h,
|
|
462
463
|
alpha: {
|
|
463
464
|
use: h,
|
|
464
|
-
fixup:
|
|
465
|
+
fixup: M
|
|
465
466
|
}
|
|
466
467
|
},
|
|
467
468
|
gamut: !0,
|
|
@@ -475,115 +476,115 @@ var Ja = (e) => e === "transparent" ? {
|
|
|
475
476
|
g: 0,
|
|
476
477
|
b: 0
|
|
477
478
|
}
|
|
478
|
-
},
|
|
479
|
-
let t =
|
|
479
|
+
}, qe = (e = 0) => Math.pow(Math.abs(e), 563 / 256) * Math.sign(e), Ot = (e) => {
|
|
480
|
+
let t = qe(e.r), r = qe(e.g), a = qe(e.b), i = {
|
|
480
481
|
mode: "xyz65",
|
|
481
482
|
x: 0.5766690429101305 * t + 0.1855582379065463 * r + 0.1882286462349947 * a,
|
|
482
483
|
y: 0.297344975250536 * t + 0.6273635662554661 * r + 0.0752914584939979 * a,
|
|
483
484
|
z: 0.0270313613864123 * t + 0.0706888525358272 * r + 0.9913375368376386 * a
|
|
484
485
|
};
|
|
485
|
-
return e.alpha !== void 0 && (
|
|
486
|
-
},
|
|
486
|
+
return e.alpha !== void 0 && (i.alpha = e.alpha), i;
|
|
487
|
+
}, Oe = (e) => Math.pow(Math.abs(e), 256 / 563) * Math.sign(e), Wt = ({ x: e, y: t, z: r, alpha: a }) => {
|
|
487
488
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
488
|
-
let
|
|
489
|
+
let i = {
|
|
489
490
|
mode: "a98",
|
|
490
|
-
r:
|
|
491
|
-
g:
|
|
492
|
-
b:
|
|
491
|
+
r: Oe(e * 2.0415879038107465 - t * 0.5650069742788597 - 0.3447313507783297 * r),
|
|
492
|
+
g: Oe(e * -0.9692436362808798 + t * 1.8759675015077206 + 0.0415550574071756 * r),
|
|
493
|
+
b: Oe(e * 0.0134442806320312 - t * 0.1183623922310184 + 1.0151749943912058 * r)
|
|
493
494
|
};
|
|
494
|
-
return a !== void 0 && (
|
|
495
|
-
},
|
|
495
|
+
return a !== void 0 && (i.alpha = a), i;
|
|
496
|
+
}, We = (e = 0) => {
|
|
496
497
|
const t = Math.abs(e);
|
|
497
498
|
return t <= 0.04045 ? e / 12.92 : (Math.sign(e) || 1) * Math.pow((t + 0.055) / 1.055, 2.4);
|
|
498
|
-
},
|
|
499
|
-
let
|
|
499
|
+
}, F = ({ r: e, g: t, b: r, alpha: a }) => {
|
|
500
|
+
let i = {
|
|
500
501
|
mode: "lrgb",
|
|
501
|
-
r:
|
|
502
|
-
g:
|
|
503
|
-
b:
|
|
502
|
+
r: We(e),
|
|
503
|
+
g: We(t),
|
|
504
|
+
b: We(r)
|
|
504
505
|
};
|
|
505
|
-
return a !== void 0 && (
|
|
506
|
-
},
|
|
507
|
-
let { r: t, g: r, b: a, alpha:
|
|
506
|
+
return a !== void 0 && (i.alpha = a), i;
|
|
507
|
+
}, O = (e) => {
|
|
508
|
+
let { r: t, g: r, b: a, alpha: i } = F(e), o = {
|
|
508
509
|
mode: "xyz65",
|
|
509
510
|
x: 0.4123907992659593 * t + 0.357584339383878 * r + 0.1804807884018343 * a,
|
|
510
511
|
y: 0.2126390058715102 * t + 0.715168678767756 * r + 0.0721923153607337 * a,
|
|
511
512
|
z: 0.0193308187155918 * t + 0.119194779794626 * r + 0.9505321522496607 * a
|
|
512
513
|
};
|
|
513
|
-
return
|
|
514
|
-
},
|
|
514
|
+
return i !== void 0 && (o.alpha = i), o;
|
|
515
|
+
}, De = (e = 0) => {
|
|
515
516
|
const t = Math.abs(e);
|
|
516
517
|
return t > 31308e-7 ? (Math.sign(e) || 1) * (1.055 * Math.pow(t, 1 / 2.4) - 0.055) : e * 12.92;
|
|
517
|
-
},
|
|
518
|
-
let
|
|
519
|
-
mode:
|
|
520
|
-
r:
|
|
521
|
-
g:
|
|
522
|
-
b:
|
|
518
|
+
}, Y = ({ r: e, g: t, b: r, alpha: a }, i = "rgb") => {
|
|
519
|
+
let o = {
|
|
520
|
+
mode: i,
|
|
521
|
+
r: De(e),
|
|
522
|
+
g: De(t),
|
|
523
|
+
b: De(r)
|
|
523
524
|
};
|
|
524
|
-
return a !== void 0 && (
|
|
525
|
-
},
|
|
525
|
+
return a !== void 0 && (o.alpha = a), o;
|
|
526
|
+
}, W = ({ x: e, y: t, z: r, alpha: a }) => {
|
|
526
527
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
527
|
-
let
|
|
528
|
+
let i = Y({
|
|
528
529
|
r: e * 3.2409699419045226 - t * 1.537383177570094 - 0.4986107602930034 * r,
|
|
529
530
|
g: e * -0.9692436362808796 + t * 1.8759675015077204 + 0.0415550574071756 * r,
|
|
530
531
|
b: e * 0.0556300796969936 - t * 0.2039769588889765 + 1.0569715142428784 * r
|
|
531
532
|
});
|
|
532
|
-
return a !== void 0 && (
|
|
533
|
-
},
|
|
534
|
-
...
|
|
533
|
+
return a !== void 0 && (i.alpha = a), i;
|
|
534
|
+
}, _a = {
|
|
535
|
+
...B,
|
|
535
536
|
mode: "a98",
|
|
536
537
|
parse: ["a98-rgb"],
|
|
537
538
|
serialize: "a98-rgb",
|
|
538
539
|
fromMode: {
|
|
539
|
-
rgb: (e) =>
|
|
540
|
-
xyz65:
|
|
540
|
+
rgb: (e) => Wt(O(e)),
|
|
541
|
+
xyz65: Wt
|
|
541
542
|
},
|
|
542
543
|
toMode: {
|
|
543
|
-
rgb: (e) =>
|
|
544
|
-
xyz65:
|
|
544
|
+
rgb: (e) => W(Ot(e)),
|
|
545
|
+
xyz65: Ot
|
|
545
546
|
}
|
|
546
|
-
},
|
|
547
|
+
}, _ = (e) => (e = e % 360) < 0 ? e + 360 : e, $a = (e, t) => e.map((r, a, i) => {
|
|
547
548
|
if (r === void 0) return r;
|
|
548
|
-
let
|
|
549
|
-
return a === 0 || e[a - 1] === void 0 ?
|
|
550
|
-
}).reduce((r, a) => !r.length || a === void 0 || r[r.length - 1] === void 0 ? (r.push(a), r) : (r.push(a + r[r.length - 1]), r), []), A = (e) =>
|
|
549
|
+
let o = _(r);
|
|
550
|
+
return a === 0 || e[a - 1] === void 0 ? o : t(o - _(i[a - 1]));
|
|
551
|
+
}).reduce((r, a) => !r.length || a === void 0 || r[r.length - 1] === void 0 ? (r.push(a), r) : (r.push(a + r[r.length - 1]), r), []), A = (e) => $a(e, (t) => Math.abs(t) <= 180 ? t : t - 360 * Math.sign(t)), x = [
|
|
551
552
|
-0.14861,
|
|
552
553
|
1.78277,
|
|
553
554
|
-0.29227,
|
|
554
555
|
-0.90649,
|
|
555
556
|
1.97294,
|
|
556
557
|
0
|
|
557
|
-
],
|
|
558
|
+
], za = Math.PI / 180, Pa = 180 / Math.PI, Dt = x[3] * x[4], Xt = x[1] * x[4], jt = x[1] * x[2] - x[0] * x[3], Ta = ({ r: e, g: t, b: r, alpha: a }) => {
|
|
558
559
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
559
|
-
let
|
|
560
|
+
let i = (jt * r + e * Dt - t * Xt) / (jt + Dt - Xt), o = r - i, n = (x[4] * (t - i) - x[2] * o) / x[3], l = {
|
|
560
561
|
mode: "cubehelix",
|
|
561
|
-
l:
|
|
562
|
-
s:
|
|
562
|
+
l: i,
|
|
563
|
+
s: i === 0 || i === 1 ? void 0 : Math.sqrt(o * o + n * n) / (x[4] * i * (1 - i))
|
|
563
564
|
};
|
|
564
|
-
return
|
|
565
|
-
},
|
|
566
|
-
let
|
|
567
|
-
e = (e === void 0 ? 0 : e + 120) *
|
|
568
|
-
let
|
|
569
|
-
return
|
|
570
|
-
},
|
|
565
|
+
return l.s && (l.h = Math.atan2(n, o) * Pa - 120), a !== void 0 && (l.alpha = a), l;
|
|
566
|
+
}, Sa = ({ h: e, s: t, l: r, alpha: a }) => {
|
|
567
|
+
let i = { mode: "rgb" };
|
|
568
|
+
e = (e === void 0 ? 0 : e + 120) * za, r === void 0 && (r = 0);
|
|
569
|
+
let o = t === void 0 ? 0 : t * r * (1 - r), n = Math.cos(e), l = Math.sin(e);
|
|
570
|
+
return i.r = r + o * (x[0] * n + x[1] * l), i.g = r + o * (x[2] * n + x[3] * l), i.b = r + o * (x[4] * n + x[5] * l), a !== void 0 && (i.alpha = a), i;
|
|
571
|
+
}, we = (e, t) => {
|
|
571
572
|
if (e.h === void 0 || t.h === void 0 || !e.s || !t.s) return 0;
|
|
572
|
-
let r =
|
|
573
|
-
return 2 * Math.sqrt(e.s * t.s) *
|
|
574
|
-
},
|
|
573
|
+
let r = _(e.h), a = _(t.h), i = Math.sin((a - r + 360) / 2 * Math.PI / 180);
|
|
574
|
+
return 2 * Math.sqrt(e.s * t.s) * i;
|
|
575
|
+
}, Aa = (e, t) => {
|
|
575
576
|
if (e.h === void 0 || t.h === void 0) return 0;
|
|
576
|
-
let r =
|
|
577
|
+
let r = _(e.h), a = _(t.h);
|
|
577
578
|
return Math.abs(a - r) > 180 ? r - (a - 360 * Math.sign(a - r)) : a - r;
|
|
578
|
-
},
|
|
579
|
+
}, xe = (e, t) => {
|
|
579
580
|
if (e.h === void 0 || t.h === void 0 || !e.c || !t.c) return 0;
|
|
580
|
-
let r =
|
|
581
|
-
return 2 * Math.sqrt(e.c * t.c) *
|
|
582
|
-
},
|
|
583
|
-
let t = e.reduce((a,
|
|
584
|
-
if (
|
|
585
|
-
let
|
|
586
|
-
a.sin += Math.sin(
|
|
581
|
+
let r = _(e.h), a = _(t.h), i = Math.sin((a - r + 360) / 2 * Math.PI / 180);
|
|
582
|
+
return 2 * Math.sqrt(e.c * t.c) * i;
|
|
583
|
+
}, C = (e) => {
|
|
584
|
+
let t = e.reduce((a, i) => {
|
|
585
|
+
if (i !== void 0) {
|
|
586
|
+
let o = i * Math.PI / 180;
|
|
587
|
+
a.sin += Math.sin(o), a.cos += Math.cos(o);
|
|
587
588
|
}
|
|
588
589
|
return a;
|
|
589
590
|
}, {
|
|
@@ -591,7 +592,7 @@ var Ja = (e) => e === "transparent" ? {
|
|
|
591
592
|
cos: 0
|
|
592
593
|
}), r = Math.atan2(t.sin, t.cos) * 180 / Math.PI;
|
|
593
594
|
return r < 0 ? 360 + r : r;
|
|
594
|
-
},
|
|
595
|
+
}, Ca = {
|
|
595
596
|
mode: "cubehelix",
|
|
596
597
|
channels: [
|
|
597
598
|
"h",
|
|
@@ -606,8 +607,8 @@ var Ja = (e) => e === "transparent" ? {
|
|
|
606
607
|
s: [0, 4.614],
|
|
607
608
|
l: [0, 1]
|
|
608
609
|
},
|
|
609
|
-
fromMode: { rgb:
|
|
610
|
-
toMode: { rgb:
|
|
610
|
+
fromMode: { rgb: Ta },
|
|
611
|
+
toMode: { rgb: Sa },
|
|
611
612
|
interpolate: {
|
|
612
613
|
h: {
|
|
613
614
|
use: h,
|
|
@@ -617,83 +618,83 @@ var Ja = (e) => e === "transparent" ? {
|
|
|
617
618
|
l: h,
|
|
618
619
|
alpha: {
|
|
619
620
|
use: h,
|
|
620
|
-
fixup:
|
|
621
|
+
fixup: M
|
|
621
622
|
}
|
|
622
623
|
},
|
|
623
|
-
difference: { h:
|
|
624
|
-
average: { h:
|
|
625
|
-
},
|
|
624
|
+
difference: { h: we },
|
|
625
|
+
average: { h: C }
|
|
626
|
+
}, E = ({ l: e, a: t, b: r, alpha: a }, i = "lch") => {
|
|
626
627
|
t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
627
|
-
let
|
|
628
|
-
mode:
|
|
628
|
+
let o = Math.sqrt(t * t + r * r), n = {
|
|
629
|
+
mode: i,
|
|
629
630
|
l: e,
|
|
630
|
-
c:
|
|
631
|
+
c: o
|
|
631
632
|
};
|
|
632
|
-
return
|
|
633
|
-
},
|
|
633
|
+
return o && (n.h = _(Math.atan2(r, t) * 180 / Math.PI)), a !== void 0 && (n.alpha = a), n;
|
|
634
|
+
}, R = ({ l: e, c: t, h: r, alpha: a }, i = "lab") => {
|
|
634
635
|
r === void 0 && (r = 0);
|
|
635
|
-
let
|
|
636
|
-
mode:
|
|
636
|
+
let o = {
|
|
637
|
+
mode: i,
|
|
637
638
|
l: e,
|
|
638
639
|
a: t ? t * Math.cos(r / 180 * Math.PI) : 0,
|
|
639
640
|
b: t ? t * Math.sin(r / 180 * Math.PI) : 0
|
|
640
641
|
};
|
|
641
|
-
return a !== void 0 && (
|
|
642
|
-
},
|
|
642
|
+
return a !== void 0 && (o.alpha = a), o;
|
|
643
|
+
}, br = Math.pow(29, 3) / Math.pow(3, 3), gr = Math.pow(6, 3) / Math.pow(29, 3), g = {
|
|
643
644
|
X: 0.3457 / 0.3585,
|
|
644
645
|
Y: 1,
|
|
645
646
|
Z: 0.2958 / 0.3585
|
|
646
|
-
},
|
|
647
|
+
}, X = {
|
|
647
648
|
X: 0.3127 / 0.329,
|
|
648
649
|
Y: 1,
|
|
649
650
|
Z: 0.3583 / 0.329
|
|
650
|
-
},
|
|
651
|
+
}, Po = Math.pow(29, 3) / Math.pow(3, 3), To = Math.pow(6, 3) / Math.pow(29, 3), Xe = (e) => Math.pow(e, 3) > gr ? Math.pow(e, 3) : (116 * e - 16) / br, yr = ({ l: e, a: t, b: r, alpha: a }) => {
|
|
651
652
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
652
|
-
let
|
|
653
|
+
let i = (e + 16) / 116, o = t / 500 + i, n = i - r / 200, l = {
|
|
653
654
|
mode: "xyz65",
|
|
654
|
-
x:
|
|
655
|
-
y:
|
|
656
|
-
z:
|
|
655
|
+
x: Xe(o) * X.X,
|
|
656
|
+
y: Xe(i) * X.Y,
|
|
657
|
+
z: Xe(n) * X.Z
|
|
657
658
|
};
|
|
658
|
-
return a !== void 0 && (
|
|
659
|
-
},
|
|
659
|
+
return a !== void 0 && (l.alpha = a), l;
|
|
660
|
+
}, ke = (e) => W(yr(e)), je = (e) => e > gr ? Math.cbrt(e) : (br * e + 16) / 116, Mr = ({ x: e, y: t, z: r, alpha: a }) => {
|
|
660
661
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
661
|
-
let
|
|
662
|
+
let i = je(e / X.X), o = je(t / X.Y), n = je(r / X.Z), l = {
|
|
662
663
|
mode: "lab65",
|
|
663
|
-
l: 116 *
|
|
664
|
-
a: 500 * (
|
|
665
|
-
b: 200 * (
|
|
664
|
+
l: 116 * o - 16,
|
|
665
|
+
a: 500 * (i - o),
|
|
666
|
+
b: 200 * (o - n)
|
|
666
667
|
};
|
|
667
|
-
return a !== void 0 && (
|
|
668
|
-
},
|
|
669
|
-
let t =
|
|
668
|
+
return a !== void 0 && (l.alpha = a), l;
|
|
669
|
+
}, _e = (e) => {
|
|
670
|
+
let t = Mr(O(e));
|
|
670
671
|
return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
|
|
671
|
-
},
|
|
672
|
+
}, re = 26 / 180 * Math.PI, pe = Math.cos(re), me = Math.sin(re), wr = 100 / Math.log(139 / 100), ht = ({ l: e, c: t, h: r, alpha: a }) => {
|
|
672
673
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
673
|
-
let
|
|
674
|
+
let i = {
|
|
674
675
|
mode: "lab65",
|
|
675
|
-
l: (Math.exp(e * 1 /
|
|
676
|
-
},
|
|
677
|
-
return
|
|
678
|
-
},
|
|
676
|
+
l: (Math.exp(e * 1 / wr) - 1) / 39e-4
|
|
677
|
+
}, o = (Math.exp(0.0435 * t * 1 * 1) - 1) / 0.075, n = o * Math.cos(r / 180 * Math.PI - re), l = o * Math.sin(r / 180 * Math.PI - re);
|
|
678
|
+
return i.a = n * pe - l / 0.83 * me, i.b = n * me + l / 0.83 * pe, a !== void 0 && (i.alpha = a), i;
|
|
679
|
+
}, dt = ({ l: e, a: t, b: r, alpha: a }) => {
|
|
679
680
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
680
|
-
let
|
|
681
|
+
let i = t * pe + r * me, o = 0.83 * (r * pe - t * me), n = Math.sqrt(i * i + o * o), l = {
|
|
681
682
|
mode: "dlch",
|
|
682
|
-
l:
|
|
683
|
-
c: Math.log(1 + 0.075 *
|
|
683
|
+
l: wr / 1 * Math.log(1 + 39e-4 * e),
|
|
684
|
+
c: Math.log(1 + 0.075 * n) / (0.0435 * 1 * 1)
|
|
684
685
|
};
|
|
685
|
-
return
|
|
686
|
-
},
|
|
686
|
+
return l.c && (l.h = _((Math.atan2(o, i) + re) / Math.PI * 180)), a !== void 0 && (l.alpha = a), l;
|
|
687
|
+
}, Bt = (e) => ht(E(e, "dlch")), Ft = (e) => R(dt(e), "dlab"), Ia = {
|
|
687
688
|
mode: "dlab",
|
|
688
689
|
parse: ["--din99o-lab"],
|
|
689
690
|
serialize: "--din99o-lab",
|
|
690
691
|
toMode: {
|
|
691
|
-
lab65:
|
|
692
|
-
rgb: (e) =>
|
|
692
|
+
lab65: Bt,
|
|
693
|
+
rgb: (e) => ke(Bt(e))
|
|
693
694
|
},
|
|
694
695
|
fromMode: {
|
|
695
|
-
lab65:
|
|
696
|
-
rgb: (e) =>
|
|
696
|
+
lab65: Ft,
|
|
697
|
+
rgb: (e) => Ft(_e(e))
|
|
697
698
|
},
|
|
698
699
|
channels: [
|
|
699
700
|
"l",
|
|
@@ -712,22 +713,22 @@ var Ja = (e) => e === "transparent" ? {
|
|
|
712
713
|
b: h,
|
|
713
714
|
alpha: {
|
|
714
715
|
use: h,
|
|
715
|
-
fixup:
|
|
716
|
+
fixup: M
|
|
716
717
|
}
|
|
717
718
|
}
|
|
718
|
-
},
|
|
719
|
+
}, Ea = {
|
|
719
720
|
mode: "dlch",
|
|
720
721
|
parse: ["--din99o-lch"],
|
|
721
722
|
serialize: "--din99o-lch",
|
|
722
723
|
toMode: {
|
|
723
|
-
lab65:
|
|
724
|
-
dlab: (e) =>
|
|
725
|
-
rgb: (e) =>
|
|
724
|
+
lab65: ht,
|
|
725
|
+
dlab: (e) => R(e, "dlab"),
|
|
726
|
+
rgb: (e) => ke(ht(e))
|
|
726
727
|
},
|
|
727
728
|
fromMode: {
|
|
728
|
-
lab65:
|
|
729
|
-
dlab: (e) =>
|
|
730
|
-
rgb: (e) =>
|
|
729
|
+
lab65: dt,
|
|
730
|
+
dlab: (e) => E(e, "dlch"),
|
|
731
|
+
rgb: (e) => dt(_e(e))
|
|
731
732
|
},
|
|
732
733
|
channels: [
|
|
733
734
|
"l",
|
|
@@ -749,82 +750,82 @@ var Ja = (e) => e === "transparent" ? {
|
|
|
749
750
|
},
|
|
750
751
|
alpha: {
|
|
751
752
|
use: h,
|
|
752
|
-
fixup:
|
|
753
|
+
fixup: M
|
|
753
754
|
}
|
|
754
755
|
},
|
|
755
|
-
difference: { h:
|
|
756
|
-
average: { h:
|
|
756
|
+
difference: { h: xe },
|
|
757
|
+
average: { h: C }
|
|
757
758
|
};
|
|
758
|
-
function
|
|
759
|
-
e =
|
|
760
|
-
let
|
|
759
|
+
function Ra({ h: e, s: t, i: r, alpha: a }) {
|
|
760
|
+
e = _(e !== void 0 ? e : 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
761
|
+
let i = Math.abs(e / 60 % 2 - 1), o;
|
|
761
762
|
switch (Math.floor(e / 60)) {
|
|
762
763
|
case 0:
|
|
763
|
-
|
|
764
|
-
r: r * (1 + t * (3 / (2 -
|
|
765
|
-
g: r * (1 + t * (3 * (1 -
|
|
764
|
+
o = {
|
|
765
|
+
r: r * (1 + t * (3 / (2 - i) - 1)),
|
|
766
|
+
g: r * (1 + t * (3 * (1 - i) / (2 - i) - 1)),
|
|
766
767
|
b: r * (1 - t)
|
|
767
768
|
};
|
|
768
769
|
break;
|
|
769
770
|
case 1:
|
|
770
|
-
|
|
771
|
-
r: r * (1 + t * (3 * (1 -
|
|
772
|
-
g: r * (1 + t * (3 / (2 -
|
|
771
|
+
o = {
|
|
772
|
+
r: r * (1 + t * (3 * (1 - i) / (2 - i) - 1)),
|
|
773
|
+
g: r * (1 + t * (3 / (2 - i) - 1)),
|
|
773
774
|
b: r * (1 - t)
|
|
774
775
|
};
|
|
775
776
|
break;
|
|
776
777
|
case 2:
|
|
777
|
-
|
|
778
|
+
o = {
|
|
778
779
|
r: r * (1 - t),
|
|
779
|
-
g: r * (1 + t * (3 / (2 -
|
|
780
|
-
b: r * (1 + t * (3 * (1 -
|
|
780
|
+
g: r * (1 + t * (3 / (2 - i) - 1)),
|
|
781
|
+
b: r * (1 + t * (3 * (1 - i) / (2 - i) - 1))
|
|
781
782
|
};
|
|
782
783
|
break;
|
|
783
784
|
case 3:
|
|
784
|
-
|
|
785
|
+
o = {
|
|
785
786
|
r: r * (1 - t),
|
|
786
|
-
g: r * (1 + t * (3 * (1 -
|
|
787
|
-
b: r * (1 + t * (3 / (2 -
|
|
787
|
+
g: r * (1 + t * (3 * (1 - i) / (2 - i) - 1)),
|
|
788
|
+
b: r * (1 + t * (3 / (2 - i) - 1))
|
|
788
789
|
};
|
|
789
790
|
break;
|
|
790
791
|
case 4:
|
|
791
|
-
|
|
792
|
-
r: r * (1 + t * (3 * (1 -
|
|
792
|
+
o = {
|
|
793
|
+
r: r * (1 + t * (3 * (1 - i) / (2 - i) - 1)),
|
|
793
794
|
g: r * (1 - t),
|
|
794
|
-
b: r * (1 + t * (3 / (2 -
|
|
795
|
+
b: r * (1 + t * (3 / (2 - i) - 1))
|
|
795
796
|
};
|
|
796
797
|
break;
|
|
797
798
|
case 5:
|
|
798
|
-
|
|
799
|
-
r: r * (1 + t * (3 / (2 -
|
|
799
|
+
o = {
|
|
800
|
+
r: r * (1 + t * (3 / (2 - i) - 1)),
|
|
800
801
|
g: r * (1 - t),
|
|
801
|
-
b: r * (1 + t * (3 * (1 -
|
|
802
|
+
b: r * (1 + t * (3 * (1 - i) / (2 - i) - 1))
|
|
802
803
|
};
|
|
803
804
|
break;
|
|
804
805
|
default:
|
|
805
|
-
|
|
806
|
+
o = {
|
|
806
807
|
r: r * (1 - t),
|
|
807
808
|
g: r * (1 - t),
|
|
808
809
|
b: r * (1 - t)
|
|
809
810
|
};
|
|
810
811
|
}
|
|
811
|
-
return
|
|
812
|
+
return o.mode = "rgb", a !== void 0 && (o.alpha = a), o;
|
|
812
813
|
}
|
|
813
|
-
function
|
|
814
|
+
function Na({ r: e, g: t, b: r, alpha: a }) {
|
|
814
815
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
815
|
-
let
|
|
816
|
+
let i = Math.max(e, t, r), o = Math.min(e, t, r), n = {
|
|
816
817
|
mode: "hsi",
|
|
817
|
-
s: e + t + r === 0 ? 0 : 1 - 3 *
|
|
818
|
+
s: e + t + r === 0 ? 0 : 1 - 3 * o / (e + t + r),
|
|
818
819
|
i: (e + t + r) / 3
|
|
819
820
|
};
|
|
820
|
-
return
|
|
821
|
+
return i - o !== 0 && (n.h = (i === e ? (t - r) / (i - o) + (t < r) * 6 : i === t ? (r - e) / (i - o) + 2 : (e - t) / (i - o) + 4) * 60), a !== void 0 && (n.alpha = a), n;
|
|
821
822
|
}
|
|
822
|
-
var
|
|
823
|
+
var La = {
|
|
823
824
|
mode: "hsi",
|
|
824
|
-
toMode: { rgb:
|
|
825
|
+
toMode: { rgb: Ra },
|
|
825
826
|
parse: ["--hsi"],
|
|
826
827
|
serialize: "--hsi",
|
|
827
|
-
fromMode: { rgb:
|
|
828
|
+
fromMode: { rgb: Na },
|
|
828
829
|
channels: [
|
|
829
830
|
"h",
|
|
830
831
|
"s",
|
|
@@ -842,77 +843,77 @@ var pn = {
|
|
|
842
843
|
i: h,
|
|
843
844
|
alpha: {
|
|
844
845
|
use: h,
|
|
845
|
-
fixup:
|
|
846
|
+
fixup: M
|
|
846
847
|
}
|
|
847
848
|
},
|
|
848
|
-
difference: { h:
|
|
849
|
-
average: { h:
|
|
849
|
+
difference: { h: we },
|
|
850
|
+
average: { h: C }
|
|
850
851
|
};
|
|
851
|
-
function
|
|
852
|
-
e =
|
|
853
|
-
let
|
|
852
|
+
function Ha({ h: e, s: t, l: r, alpha: a }) {
|
|
853
|
+
e = _(e !== void 0 ? e : 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
854
|
+
let i = r + t * (r < 0.5 ? r : 1 - r), o = i - (i - r) * 2 * Math.abs(e / 60 % 2 - 1), n;
|
|
854
855
|
switch (Math.floor(e / 60)) {
|
|
855
856
|
case 0:
|
|
856
|
-
|
|
857
|
-
r:
|
|
858
|
-
g:
|
|
859
|
-
b: 2 * r -
|
|
857
|
+
n = {
|
|
858
|
+
r: i,
|
|
859
|
+
g: o,
|
|
860
|
+
b: 2 * r - i
|
|
860
861
|
};
|
|
861
862
|
break;
|
|
862
863
|
case 1:
|
|
863
|
-
|
|
864
|
-
r:
|
|
865
|
-
g:
|
|
866
|
-
b: 2 * r -
|
|
864
|
+
n = {
|
|
865
|
+
r: o,
|
|
866
|
+
g: i,
|
|
867
|
+
b: 2 * r - i
|
|
867
868
|
};
|
|
868
869
|
break;
|
|
869
870
|
case 2:
|
|
870
|
-
|
|
871
|
-
r: 2 * r -
|
|
872
|
-
g:
|
|
873
|
-
b:
|
|
871
|
+
n = {
|
|
872
|
+
r: 2 * r - i,
|
|
873
|
+
g: i,
|
|
874
|
+
b: o
|
|
874
875
|
};
|
|
875
876
|
break;
|
|
876
877
|
case 3:
|
|
877
|
-
|
|
878
|
-
r: 2 * r -
|
|
879
|
-
g:
|
|
880
|
-
b:
|
|
878
|
+
n = {
|
|
879
|
+
r: 2 * r - i,
|
|
880
|
+
g: o,
|
|
881
|
+
b: i
|
|
881
882
|
};
|
|
882
883
|
break;
|
|
883
884
|
case 4:
|
|
884
|
-
|
|
885
|
-
r:
|
|
886
|
-
g: 2 * r -
|
|
887
|
-
b:
|
|
885
|
+
n = {
|
|
886
|
+
r: o,
|
|
887
|
+
g: 2 * r - i,
|
|
888
|
+
b: i
|
|
888
889
|
};
|
|
889
890
|
break;
|
|
890
891
|
case 5:
|
|
891
|
-
|
|
892
|
-
r:
|
|
893
|
-
g: 2 * r -
|
|
894
|
-
b:
|
|
892
|
+
n = {
|
|
893
|
+
r: i,
|
|
894
|
+
g: 2 * r - i,
|
|
895
|
+
b: o
|
|
895
896
|
};
|
|
896
897
|
break;
|
|
897
898
|
default:
|
|
898
|
-
|
|
899
|
-
r: 2 * r -
|
|
900
|
-
g: 2 * r -
|
|
901
|
-
b: 2 * r -
|
|
899
|
+
n = {
|
|
900
|
+
r: 2 * r - i,
|
|
901
|
+
g: 2 * r - i,
|
|
902
|
+
b: 2 * r - i
|
|
902
903
|
};
|
|
903
904
|
}
|
|
904
|
-
return
|
|
905
|
+
return n.mode = "rgb", a !== void 0 && (n.alpha = a), n;
|
|
905
906
|
}
|
|
906
|
-
function
|
|
907
|
+
function qa({ r: e, g: t, b: r, alpha: a }) {
|
|
907
908
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
908
|
-
let
|
|
909
|
+
let i = Math.max(e, t, r), o = Math.min(e, t, r), n = {
|
|
909
910
|
mode: "hsl",
|
|
910
|
-
s:
|
|
911
|
-
l: 0.5 * (
|
|
911
|
+
s: i === o ? 0 : (i - o) / (1 - Math.abs(i + o - 1)),
|
|
912
|
+
l: 0.5 * (i + o)
|
|
912
913
|
};
|
|
913
|
-
return
|
|
914
|
+
return i - o !== 0 && (n.h = (i === e ? (t - r) / (i - o) + (t < r) * 6 : i === t ? (r - e) / (i - o) + 2 : (e - t) / (i - o) + 4) * 60), a !== void 0 && (n.alpha = a), n;
|
|
914
915
|
}
|
|
915
|
-
var
|
|
916
|
+
var Oa = (e, t) => {
|
|
916
917
|
switch (t) {
|
|
917
918
|
case "deg":
|
|
918
919
|
return +e;
|
|
@@ -923,33 +924,33 @@ var mn = (e, t) => {
|
|
|
923
924
|
case "turn":
|
|
924
925
|
return e * 360;
|
|
925
926
|
}
|
|
926
|
-
},
|
|
927
|
-
let t = e.match(
|
|
927
|
+
}, Wa = new RegExp(`^hsla?\\(\\s*${ia}${j}${te}${j}${te}\\s*(?:,\\s*${yt}\\s*)?\\)$`), Da = (e) => {
|
|
928
|
+
let t = e.match(Wa);
|
|
928
929
|
if (!t) return;
|
|
929
930
|
let r = { mode: "hsl" };
|
|
930
|
-
return t[3] !== void 0 ? r.h = +t[3] : t[1] !== void 0 && t[2] !== void 0 && (r.h =
|
|
931
|
+
return t[3] !== void 0 ? r.h = +t[3] : t[1] !== void 0 && t[2] !== void 0 && (r.h = Oa(t[1], t[2])), t[4] !== void 0 && (r.s = Math.min(Math.max(0, t[4] / 100), 1)), t[5] !== void 0 && (r.l = Math.min(Math.max(0, t[5] / 100), 1)), t[6] !== void 0 ? r.alpha = Math.max(0, Math.min(1, t[6] / 100)) : t[7] !== void 0 && (r.alpha = Math.max(0, Math.min(1, +t[7]))), r;
|
|
931
932
|
};
|
|
932
|
-
function
|
|
933
|
+
function Xa(e, t) {
|
|
933
934
|
if (!t || t[0] !== "hsl" && t[0] !== "hsla") return;
|
|
934
|
-
const r = { mode: "hsl" }, [, a,
|
|
935
|
-
if (a.type !==
|
|
936
|
-
if (a.type ===
|
|
935
|
+
const r = { mode: "hsl" }, [, a, i, o, n] = t;
|
|
936
|
+
if (a.type !== s.None) {
|
|
937
|
+
if (a.type === s.Percentage) return;
|
|
937
938
|
r.h = a.value;
|
|
938
939
|
}
|
|
939
|
-
if (
|
|
940
|
-
if (
|
|
941
|
-
r.s =
|
|
940
|
+
if (i.type !== s.None) {
|
|
941
|
+
if (i.type === s.Hue) return;
|
|
942
|
+
r.s = i.value / 100;
|
|
942
943
|
}
|
|
943
|
-
if (
|
|
944
|
-
if (
|
|
945
|
-
r.l =
|
|
944
|
+
if (o.type !== s.None) {
|
|
945
|
+
if (o.type === s.Hue) return;
|
|
946
|
+
r.l = o.value / 100;
|
|
946
947
|
}
|
|
947
|
-
return
|
|
948
|
+
return n.type !== s.None && (r.alpha = Math.min(1, Math.max(0, n.type === s.Number ? n.value : n.value / 100))), r;
|
|
948
949
|
}
|
|
949
|
-
var
|
|
950
|
+
var xr = {
|
|
950
951
|
mode: "hsl",
|
|
951
|
-
toMode: { rgb:
|
|
952
|
-
fromMode: { rgb:
|
|
952
|
+
toMode: { rgb: Ha },
|
|
953
|
+
fromMode: { rgb: qa },
|
|
953
954
|
channels: [
|
|
954
955
|
"h",
|
|
955
956
|
"s",
|
|
@@ -958,7 +959,7 @@ var Zr = {
|
|
|
958
959
|
],
|
|
959
960
|
ranges: { h: [0, 360] },
|
|
960
961
|
gamut: "rgb",
|
|
961
|
-
parse: [
|
|
962
|
+
parse: [Xa, Da],
|
|
962
963
|
serialize: (e) => `hsl(${e.h !== void 0 ? e.h : "none"} ${e.s !== void 0 ? e.s * 100 + "%" : "none"} ${e.l !== void 0 ? e.l * 100 + "%" : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
963
964
|
interpolate: {
|
|
964
965
|
h: {
|
|
@@ -969,82 +970,82 @@ var Zr = {
|
|
|
969
970
|
l: h,
|
|
970
971
|
alpha: {
|
|
971
972
|
use: h,
|
|
972
|
-
fixup:
|
|
973
|
+
fixup: M
|
|
973
974
|
}
|
|
974
975
|
},
|
|
975
|
-
difference: { h:
|
|
976
|
-
average: { h:
|
|
976
|
+
difference: { h: we },
|
|
977
|
+
average: { h: C }
|
|
977
978
|
};
|
|
978
|
-
function
|
|
979
|
-
e =
|
|
980
|
-
let
|
|
979
|
+
function kr({ h: e, s: t, v: r, alpha: a }) {
|
|
980
|
+
e = _(e !== void 0 ? e : 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
981
|
+
let i = Math.abs(e / 60 % 2 - 1), o;
|
|
981
982
|
switch (Math.floor(e / 60)) {
|
|
982
983
|
case 0:
|
|
983
|
-
|
|
984
|
+
o = {
|
|
984
985
|
r,
|
|
985
|
-
g: r * (1 - t *
|
|
986
|
+
g: r * (1 - t * i),
|
|
986
987
|
b: r * (1 - t)
|
|
987
988
|
};
|
|
988
989
|
break;
|
|
989
990
|
case 1:
|
|
990
|
-
|
|
991
|
-
r: r * (1 - t *
|
|
991
|
+
o = {
|
|
992
|
+
r: r * (1 - t * i),
|
|
992
993
|
g: r,
|
|
993
994
|
b: r * (1 - t)
|
|
994
995
|
};
|
|
995
996
|
break;
|
|
996
997
|
case 2:
|
|
997
|
-
|
|
998
|
+
o = {
|
|
998
999
|
r: r * (1 - t),
|
|
999
1000
|
g: r,
|
|
1000
|
-
b: r * (1 - t *
|
|
1001
|
+
b: r * (1 - t * i)
|
|
1001
1002
|
};
|
|
1002
1003
|
break;
|
|
1003
1004
|
case 3:
|
|
1004
|
-
|
|
1005
|
+
o = {
|
|
1005
1006
|
r: r * (1 - t),
|
|
1006
|
-
g: r * (1 - t *
|
|
1007
|
+
g: r * (1 - t * i),
|
|
1007
1008
|
b: r
|
|
1008
1009
|
};
|
|
1009
1010
|
break;
|
|
1010
1011
|
case 4:
|
|
1011
|
-
|
|
1012
|
-
r: r * (1 - t *
|
|
1012
|
+
o = {
|
|
1013
|
+
r: r * (1 - t * i),
|
|
1013
1014
|
g: r * (1 - t),
|
|
1014
1015
|
b: r
|
|
1015
1016
|
};
|
|
1016
1017
|
break;
|
|
1017
1018
|
case 5:
|
|
1018
|
-
|
|
1019
|
+
o = {
|
|
1019
1020
|
r,
|
|
1020
1021
|
g: r * (1 - t),
|
|
1021
|
-
b: r * (1 - t *
|
|
1022
|
+
b: r * (1 - t * i)
|
|
1022
1023
|
};
|
|
1023
1024
|
break;
|
|
1024
1025
|
default:
|
|
1025
|
-
|
|
1026
|
+
o = {
|
|
1026
1027
|
r: r * (1 - t),
|
|
1027
1028
|
g: r * (1 - t),
|
|
1028
1029
|
b: r * (1 - t)
|
|
1029
1030
|
};
|
|
1030
1031
|
}
|
|
1031
|
-
return
|
|
1032
|
+
return o.mode = "rgb", a !== void 0 && (o.alpha = a), o;
|
|
1032
1033
|
}
|
|
1033
|
-
function
|
|
1034
|
+
function _r({ r: e, g: t, b: r, alpha: a }) {
|
|
1034
1035
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1035
|
-
let
|
|
1036
|
+
let i = Math.max(e, t, r), o = Math.min(e, t, r), n = {
|
|
1036
1037
|
mode: "hsv",
|
|
1037
|
-
s:
|
|
1038
|
-
v:
|
|
1038
|
+
s: i === 0 ? 0 : 1 - o / i,
|
|
1039
|
+
v: i
|
|
1039
1040
|
};
|
|
1040
|
-
return
|
|
1041
|
+
return i - o !== 0 && (n.h = (i === e ? (t - r) / (i - o) + (t < r) * 6 : i === t ? (r - e) / (i - o) + 2 : (e - t) / (i - o) + 4) * 60), a !== void 0 && (n.alpha = a), n;
|
|
1041
1042
|
}
|
|
1042
|
-
var
|
|
1043
|
+
var $r = {
|
|
1043
1044
|
mode: "hsv",
|
|
1044
|
-
toMode: { rgb:
|
|
1045
|
+
toMode: { rgb: kr },
|
|
1045
1046
|
parse: ["--hsv"],
|
|
1046
1047
|
serialize: "--hsv",
|
|
1047
|
-
fromMode: { rgb:
|
|
1048
|
+
fromMode: { rgb: _r },
|
|
1048
1049
|
channels: [
|
|
1049
1050
|
"h",
|
|
1050
1051
|
"s",
|
|
@@ -1062,55 +1063,55 @@ var Kr = {
|
|
|
1062
1063
|
v: h,
|
|
1063
1064
|
alpha: {
|
|
1064
1065
|
use: h,
|
|
1065
|
-
fixup:
|
|
1066
|
+
fixup: M
|
|
1066
1067
|
}
|
|
1067
1068
|
},
|
|
1068
|
-
difference: { h:
|
|
1069
|
-
average: { h:
|
|
1069
|
+
difference: { h: we },
|
|
1070
|
+
average: { h: C }
|
|
1070
1071
|
};
|
|
1071
|
-
function
|
|
1072
|
+
function ja({ h: e, w: t, b: r, alpha: a }) {
|
|
1072
1073
|
if (t === void 0 && (t = 0), r === void 0 && (r = 0), t + r > 1) {
|
|
1073
|
-
let
|
|
1074
|
-
t /=
|
|
1074
|
+
let i = t + r;
|
|
1075
|
+
t /= i, r /= i;
|
|
1075
1076
|
}
|
|
1076
|
-
return
|
|
1077
|
+
return kr({
|
|
1077
1078
|
h: e,
|
|
1078
1079
|
s: r === 1 ? 1 : 1 - t / (1 - r),
|
|
1079
1080
|
v: 1 - r,
|
|
1080
1081
|
alpha: a
|
|
1081
1082
|
});
|
|
1082
1083
|
}
|
|
1083
|
-
function
|
|
1084
|
-
let t =
|
|
1084
|
+
function Ba(e) {
|
|
1085
|
+
let t = _r(e);
|
|
1085
1086
|
if (t === void 0) return;
|
|
1086
|
-
let r = t.s !== void 0 ? t.s : 0, a = t.v !== void 0 ? t.v : 0,
|
|
1087
|
+
let r = t.s !== void 0 ? t.s : 0, a = t.v !== void 0 ? t.v : 0, i = {
|
|
1087
1088
|
mode: "hwb",
|
|
1088
1089
|
w: (1 - r) * a,
|
|
1089
1090
|
b: 1 - a
|
|
1090
1091
|
};
|
|
1091
|
-
return t.h !== void 0 && (
|
|
1092
|
+
return t.h !== void 0 && (i.h = t.h), t.alpha !== void 0 && (i.alpha = t.alpha), i;
|
|
1092
1093
|
}
|
|
1093
|
-
function
|
|
1094
|
+
function Fa(e, t) {
|
|
1094
1095
|
if (!t || t[0] !== "hwb") return;
|
|
1095
|
-
const r = { mode: "hwb" }, [, a,
|
|
1096
|
-
if (a.type !==
|
|
1097
|
-
if (a.type ===
|
|
1096
|
+
const r = { mode: "hwb" }, [, a, i, o, n] = t;
|
|
1097
|
+
if (a.type !== s.None) {
|
|
1098
|
+
if (a.type === s.Percentage) return;
|
|
1098
1099
|
r.h = a.value;
|
|
1099
1100
|
}
|
|
1100
|
-
if (
|
|
1101
|
-
if (
|
|
1102
|
-
r.w =
|
|
1101
|
+
if (i.type !== s.None) {
|
|
1102
|
+
if (i.type === s.Hue) return;
|
|
1103
|
+
r.w = i.value / 100;
|
|
1103
1104
|
}
|
|
1104
|
-
if (
|
|
1105
|
-
if (
|
|
1106
|
-
r.b =
|
|
1105
|
+
if (o.type !== s.None) {
|
|
1106
|
+
if (o.type === s.Hue) return;
|
|
1107
|
+
r.b = o.value / 100;
|
|
1107
1108
|
}
|
|
1108
|
-
return
|
|
1109
|
+
return n.type !== s.None && (r.alpha = Math.min(1, Math.max(0, n.type === s.Number ? n.value : n.value / 100))), r;
|
|
1109
1110
|
}
|
|
1110
|
-
var
|
|
1111
|
+
var Ya = {
|
|
1111
1112
|
mode: "hwb",
|
|
1112
|
-
toMode: { rgb:
|
|
1113
|
-
fromMode: { rgb:
|
|
1113
|
+
toMode: { rgb: ja },
|
|
1114
|
+
fromMode: { rgb: Ba },
|
|
1114
1115
|
channels: [
|
|
1115
1116
|
"h",
|
|
1116
1117
|
"w",
|
|
@@ -1119,7 +1120,7 @@ var Sn = {
|
|
|
1119
1120
|
],
|
|
1120
1121
|
ranges: { h: [0, 360] },
|
|
1121
1122
|
gamut: "rgb",
|
|
1122
|
-
parse: [
|
|
1123
|
+
parse: [Fa],
|
|
1123
1124
|
serialize: (e) => `hwb(${e.h !== void 0 ? e.h : "none"} ${e.w !== void 0 ? e.w * 100 + "%" : "none"} ${e.b !== void 0 ? e.b * 100 + "%" : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1124
1125
|
interpolate: {
|
|
1125
1126
|
h: {
|
|
@@ -1130,40 +1131,40 @@ var Sn = {
|
|
|
1130
1131
|
b: h,
|
|
1131
1132
|
alpha: {
|
|
1132
1133
|
use: h,
|
|
1133
|
-
fixup:
|
|
1134
|
+
fixup: M
|
|
1134
1135
|
}
|
|
1135
1136
|
},
|
|
1136
|
-
difference: { h:
|
|
1137
|
-
average: { h:
|
|
1138
|
-
},
|
|
1139
|
-
function
|
|
1137
|
+
difference: { h: Aa },
|
|
1138
|
+
average: { h: C }
|
|
1139
|
+
}, $e = 0.1593017578125, zr = 78.84375, ze = 0.8359375, Pe = 18.8515625, Te = 18.6875;
|
|
1140
|
+
function Be(e) {
|
|
1140
1141
|
if (e < 0) return 0;
|
|
1141
|
-
const t = Math.pow(e, 1 /
|
|
1142
|
-
return 1e4 * Math.pow(Math.max(0, t -
|
|
1142
|
+
const t = Math.pow(e, 1 / zr);
|
|
1143
|
+
return 1e4 * Math.pow(Math.max(0, t - ze) / (Pe - Te * t), 1 / $e);
|
|
1143
1144
|
}
|
|
1144
|
-
function
|
|
1145
|
+
function Fe(e) {
|
|
1145
1146
|
if (e < 0) return 0;
|
|
1146
|
-
const t = Math.pow(e / 1e4,
|
|
1147
|
-
return Math.pow((
|
|
1147
|
+
const t = Math.pow(e / 1e4, $e);
|
|
1148
|
+
return Math.pow((ze + Pe * t) / (1 + Te * t), zr);
|
|
1148
1149
|
}
|
|
1149
|
-
var
|
|
1150
|
+
var Ye = (e) => Math.max(e / 203, 0), Yt = ({ i: e, t, p: r, alpha: a }) => {
|
|
1150
1151
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1151
|
-
const
|
|
1152
|
+
const i = Be(e + 0.008609037037932761 * t + 0.11102962500302593 * r), o = Be(e - 0.00860903703793275 * t - 0.11102962500302599 * r), n = Be(e + 0.5600313357106791 * t - 0.32062717498731885 * r), l = {
|
|
1152
1153
|
mode: "xyz65",
|
|
1153
|
-
x:
|
|
1154
|
-
y:
|
|
1155
|
-
z:
|
|
1154
|
+
x: Ye(2.070152218389422 * i - 1.3263473389671556 * o + 0.2066510476294051 * n),
|
|
1155
|
+
y: Ye(0.3647385209748074 * i + 0.680566024947227 * o - 0.0453045459220346 * n),
|
|
1156
|
+
z: Ye(-0.049747207535812 * i - 0.0492609666966138 * o + 1.1880659249923042 * n)
|
|
1156
1157
|
};
|
|
1157
|
-
return a !== void 0 && (
|
|
1158
|
-
},
|
|
1159
|
-
const
|
|
1158
|
+
return a !== void 0 && (l.alpha = a), l;
|
|
1159
|
+
}, Ze = (e = 0) => Math.max(e * 203, 0), Zt = ({ x: e, y: t, z: r, alpha: a }) => {
|
|
1160
|
+
const i = Ze(e), o = Ze(t), n = Ze(r), l = Fe(0.3592832590121217 * i + 0.6976051147779502 * o - 0.0358915932320289 * n), d = Fe(-0.1920808463704995 * i + 1.1004767970374323 * o + 0.0753748658519118 * n), c = Fe(0.0070797844607477 * i + 0.0748396662186366 * o + 0.8433265453898765 * n), v = {
|
|
1160
1161
|
mode: "itp",
|
|
1161
|
-
i: 0.5 *
|
|
1162
|
-
t: 1.61376953125 *
|
|
1163
|
-
p: 4.378173828125 *
|
|
1162
|
+
i: 0.5 * l + 0.5 * d,
|
|
1163
|
+
t: 1.61376953125 * l - 3.323486328125 * d + 1.709716796875 * c,
|
|
1164
|
+
p: 4.378173828125 * l - 4.24560546875 * d - 0.132568359375 * c
|
|
1164
1165
|
};
|
|
1165
|
-
return a !== void 0 && (
|
|
1166
|
-
},
|
|
1166
|
+
return a !== void 0 && (v.alpha = a), v;
|
|
1167
|
+
}, Za = {
|
|
1167
1168
|
mode: "itp",
|
|
1168
1169
|
channels: [
|
|
1169
1170
|
"i",
|
|
@@ -1174,12 +1175,12 @@ var st = (e) => Math.max(e / 203, 0), gr = ({ i: e, t, p: r, alpha: a }) => {
|
|
|
1174
1175
|
parse: ["--ictcp"],
|
|
1175
1176
|
serialize: "--ictcp",
|
|
1176
1177
|
toMode: {
|
|
1177
|
-
xyz65:
|
|
1178
|
-
rgb: (e) =>
|
|
1178
|
+
xyz65: Yt,
|
|
1179
|
+
rgb: (e) => W(Yt(e))
|
|
1179
1180
|
},
|
|
1180
1181
|
fromMode: {
|
|
1181
|
-
xyz65:
|
|
1182
|
-
rgb: (e) =>
|
|
1182
|
+
xyz65: Zt,
|
|
1183
|
+
rgb: (e) => Zt(O(e))
|
|
1183
1184
|
},
|
|
1184
1185
|
ranges: {
|
|
1185
1186
|
i: [0, 0.581],
|
|
@@ -1192,39 +1193,39 @@ var st = (e) => Math.max(e / 203, 0), gr = ({ i: e, t, p: r, alpha: a }) => {
|
|
|
1192
1193
|
p: h,
|
|
1193
1194
|
alpha: {
|
|
1194
1195
|
use: h,
|
|
1195
|
-
fixup:
|
|
1196
|
+
fixup: M
|
|
1196
1197
|
}
|
|
1197
1198
|
}
|
|
1198
|
-
},
|
|
1199
|
+
}, Ua = 134.03437499999998, Ga = 16295499532821565e-27, Ue = (e) => {
|
|
1199
1200
|
if (e < 0) return 0;
|
|
1200
|
-
let t = Math.pow(e / 1e4,
|
|
1201
|
-
return Math.pow((
|
|
1202
|
-
},
|
|
1203
|
-
e =
|
|
1204
|
-
let
|
|
1201
|
+
let t = Math.pow(e / 1e4, $e);
|
|
1202
|
+
return Math.pow((ze + Pe * t) / (1 + Te * t), Ua);
|
|
1203
|
+
}, Ge = (e = 0) => Math.max(e * 203, 0), Pr = ({ x: e, y: t, z: r, alpha: a }) => {
|
|
1204
|
+
e = Ge(e), t = Ge(t), r = Ge(r);
|
|
1205
|
+
let i = 1.15 * e - 0.15 * r, o = 0.66 * t + 0.34 * e, n = Ue(0.41478972 * i + 0.579999 * o + 0.014648 * r), l = Ue(-0.20151 * i + 1.120649 * o + 0.0531008 * r), d = Ue(-0.0166008 * i + 0.2648 * o + 0.6684799 * r), c = (n + l) / 2, v = {
|
|
1205
1206
|
mode: "jab",
|
|
1206
|
-
j: 0.44 *
|
|
1207
|
-
a: 3.524 *
|
|
1208
|
-
b: 0.199076 *
|
|
1207
|
+
j: 0.44 * c / (1 - 0.56 * c) - Ga,
|
|
1208
|
+
a: 3.524 * n - 4.066708 * l + 0.542708 * d,
|
|
1209
|
+
b: 0.199076 * n + 1.096799 * l - 1.295875 * d
|
|
1209
1210
|
};
|
|
1210
|
-
return a !== void 0 && (
|
|
1211
|
-
},
|
|
1211
|
+
return a !== void 0 && (v.alpha = a), v;
|
|
1212
|
+
}, Ja = 134.03437499999998, Ut = 16295499532821565e-27, Je = (e) => {
|
|
1212
1213
|
if (e < 0) return 0;
|
|
1213
|
-
let t = Math.pow(e, 1 /
|
|
1214
|
-
return 1e4 * Math.pow((
|
|
1215
|
-
},
|
|
1214
|
+
let t = Math.pow(e, 1 / Ja);
|
|
1215
|
+
return 1e4 * Math.pow((ze - t) / (Te * t - Pe), 1 / $e);
|
|
1216
|
+
}, Ke = (e) => e / 203, Tr = ({ j: e, a: t, b: r, alpha: a }) => {
|
|
1216
1217
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1217
|
-
let
|
|
1218
|
+
let i = (e + Ut) / (0.44 + 0.56 * (e + Ut)), o = Je(i + 0.13860504 * t + 0.058047316 * r), n = Je(i - 0.13860504 * t - 0.058047316 * r), l = Je(i - 0.096019242 * t - 0.8118919 * r), d = {
|
|
1218
1219
|
mode: "xyz65",
|
|
1219
|
-
x:
|
|
1220
|
-
y:
|
|
1221
|
-
z:
|
|
1220
|
+
x: Ke(1.661373024652174 * o - 0.914523081304348 * n + 0.23136208173913045 * l),
|
|
1221
|
+
y: Ke(-0.3250758611844533 * o + 1.571847026732543 * n - 0.21825383453227928 * l),
|
|
1222
|
+
z: Ke(-0.090982811 * o - 0.31272829 * n + 1.5227666 * l)
|
|
1222
1223
|
};
|
|
1223
|
-
return a !== void 0 && (
|
|
1224
|
-
},
|
|
1225
|
-
let t =
|
|
1224
|
+
return a !== void 0 && (d.alpha = a), d;
|
|
1225
|
+
}, Sr = (e) => {
|
|
1226
|
+
let t = Pr(O(e));
|
|
1226
1227
|
return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
|
|
1227
|
-
},
|
|
1228
|
+
}, Ar = (e) => W(Tr(e)), Ka = {
|
|
1228
1229
|
mode: "jab",
|
|
1229
1230
|
channels: [
|
|
1230
1231
|
"j",
|
|
@@ -1235,12 +1236,12 @@ var st = (e) => Math.max(e / 203, 0), gr = ({ i: e, t, p: r, alpha: a }) => {
|
|
|
1235
1236
|
parse: ["--jzazbz"],
|
|
1236
1237
|
serialize: "--jzazbz",
|
|
1237
1238
|
fromMode: {
|
|
1238
|
-
rgb:
|
|
1239
|
-
xyz65:
|
|
1239
|
+
rgb: Sr,
|
|
1240
|
+
xyz65: Pr
|
|
1240
1241
|
},
|
|
1241
1242
|
toMode: {
|
|
1242
|
-
rgb:
|
|
1243
|
-
xyz65:
|
|
1243
|
+
rgb: Ar,
|
|
1244
|
+
xyz65: Tr
|
|
1244
1245
|
},
|
|
1245
1246
|
ranges: {
|
|
1246
1247
|
j: [0, 0.222],
|
|
@@ -1253,37 +1254,37 @@ var st = (e) => Math.max(e / 203, 0), gr = ({ i: e, t, p: r, alpha: a }) => {
|
|
|
1253
1254
|
b: h,
|
|
1254
1255
|
alpha: {
|
|
1255
1256
|
use: h,
|
|
1256
|
-
fixup:
|
|
1257
|
+
fixup: M
|
|
1257
1258
|
}
|
|
1258
1259
|
}
|
|
1259
|
-
},
|
|
1260
|
+
}, Gt = ({ j: e, a: t, b: r, alpha: a }) => {
|
|
1260
1261
|
t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1261
|
-
let
|
|
1262
|
+
let i = Math.sqrt(t * t + r * r), o = {
|
|
1262
1263
|
mode: "jch",
|
|
1263
1264
|
j: e,
|
|
1264
|
-
c:
|
|
1265
|
+
c: i
|
|
1265
1266
|
};
|
|
1266
|
-
return
|
|
1267
|
-
},
|
|
1267
|
+
return i && (o.h = _(Math.atan2(r, t) * 180 / Math.PI)), a !== void 0 && (o.alpha = a), o;
|
|
1268
|
+
}, Jt = ({ j: e, c: t, h: r, alpha: a }) => {
|
|
1268
1269
|
r === void 0 && (r = 0);
|
|
1269
|
-
let
|
|
1270
|
+
let i = {
|
|
1270
1271
|
mode: "jab",
|
|
1271
1272
|
j: e,
|
|
1272
1273
|
a: t ? t * Math.cos(r / 180 * Math.PI) : 0,
|
|
1273
1274
|
b: t ? t * Math.sin(r / 180 * Math.PI) : 0
|
|
1274
1275
|
};
|
|
1275
|
-
return a !== void 0 && (
|
|
1276
|
-
},
|
|
1276
|
+
return a !== void 0 && (i.alpha = a), i;
|
|
1277
|
+
}, Va = {
|
|
1277
1278
|
mode: "jch",
|
|
1278
1279
|
parse: ["--jzczhz"],
|
|
1279
1280
|
serialize: "--jzczhz",
|
|
1280
1281
|
toMode: {
|
|
1281
|
-
jab:
|
|
1282
|
-
rgb: (e) =>
|
|
1282
|
+
jab: Jt,
|
|
1283
|
+
rgb: (e) => Ar(Jt(e))
|
|
1283
1284
|
},
|
|
1284
1285
|
fromMode: {
|
|
1285
|
-
rgb: (e) =>
|
|
1286
|
-
jab:
|
|
1286
|
+
rgb: (e) => Gt(Sr(e)),
|
|
1287
|
+
jab: Gt
|
|
1287
1288
|
},
|
|
1288
1289
|
channels: [
|
|
1289
1290
|
"j",
|
|
@@ -1305,64 +1306,64 @@ var st = (e) => Math.max(e / 203, 0), gr = ({ i: e, t, p: r, alpha: a }) => {
|
|
|
1305
1306
|
j: h,
|
|
1306
1307
|
alpha: {
|
|
1307
1308
|
use: h,
|
|
1308
|
-
fixup:
|
|
1309
|
+
fixup: M
|
|
1309
1310
|
}
|
|
1310
1311
|
},
|
|
1311
|
-
difference: { h:
|
|
1312
|
-
average: { h:
|
|
1313
|
-
},
|
|
1312
|
+
difference: { h: xe },
|
|
1313
|
+
average: { h: C }
|
|
1314
|
+
}, Se = Math.pow(29, 3) / Math.pow(3, 3), wt = Math.pow(6, 3) / Math.pow(29, 3), Ve = (e) => Math.pow(e, 3) > wt ? Math.pow(e, 3) : (116 * e - 16) / Se, xt = ({ l: e, a: t, b: r, alpha: a }) => {
|
|
1314
1315
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1315
|
-
let
|
|
1316
|
+
let i = (e + 16) / 116, o = t / 500 + i, n = i - r / 200, l = {
|
|
1316
1317
|
mode: "xyz50",
|
|
1317
|
-
x:
|
|
1318
|
-
y:
|
|
1319
|
-
z:
|
|
1318
|
+
x: Ve(o) * g.X,
|
|
1319
|
+
y: Ve(i) * g.Y,
|
|
1320
|
+
z: Ve(n) * g.Z
|
|
1320
1321
|
};
|
|
1321
|
-
return a !== void 0 && (
|
|
1322
|
-
},
|
|
1322
|
+
return a !== void 0 && (l.alpha = a), l;
|
|
1323
|
+
}, ie = ({ x: e, y: t, z: r, alpha: a }) => {
|
|
1323
1324
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1324
|
-
let
|
|
1325
|
+
let i = Y({
|
|
1325
1326
|
r: e * 3.1341359569958707 - t * 1.6173863321612538 - 0.4906619460083532 * r,
|
|
1326
1327
|
g: e * -0.978795502912089 + t * 1.916254567259524 + 0.03344273116131949 * r,
|
|
1327
1328
|
b: e * 0.07195537988411677 - t * 0.2289768264158322 + 1.405386058324125 * r
|
|
1328
1329
|
});
|
|
1329
|
-
return a !== void 0 && (
|
|
1330
|
-
},
|
|
1331
|
-
let { r: t, g: r, b: a, alpha:
|
|
1330
|
+
return a !== void 0 && (i.alpha = a), i;
|
|
1331
|
+
}, Cr = (e) => ie(xt(e)), oe = (e) => {
|
|
1332
|
+
let { r: t, g: r, b: a, alpha: i } = F(e), o = {
|
|
1332
1333
|
mode: "xyz50",
|
|
1333
1334
|
x: 0.436065742824811 * t + 0.3851514688337912 * r + 0.14307845442264197 * a,
|
|
1334
1335
|
y: 0.22249319175623702 * t + 0.7168870538238823 * r + 0.06061979053616537 * a,
|
|
1335
1336
|
z: 0.013923904500943465 * t + 0.09708128566574634 * r + 0.7140993584005155 * a
|
|
1336
1337
|
};
|
|
1337
|
-
return
|
|
1338
|
-
},
|
|
1338
|
+
return i !== void 0 && (o.alpha = i), o;
|
|
1339
|
+
}, Qe = (e) => e > wt ? Math.cbrt(e) : (Se * e + 16) / 116, kt = ({ x: e, y: t, z: r, alpha: a }) => {
|
|
1339
1340
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1340
|
-
let
|
|
1341
|
+
let i = Qe(e / g.X), o = Qe(t / g.Y), n = Qe(r / g.Z), l = {
|
|
1341
1342
|
mode: "lab",
|
|
1342
|
-
l: 116 *
|
|
1343
|
-
a: 500 * (
|
|
1344
|
-
b: 200 * (
|
|
1343
|
+
l: 116 * o - 16,
|
|
1344
|
+
a: 500 * (i - o),
|
|
1345
|
+
b: 200 * (o - n)
|
|
1345
1346
|
};
|
|
1346
|
-
return a !== void 0 && (
|
|
1347
|
-
},
|
|
1348
|
-
let t =
|
|
1347
|
+
return a !== void 0 && (l.alpha = a), l;
|
|
1348
|
+
}, Ir = (e) => {
|
|
1349
|
+
let t = kt(oe(e));
|
|
1349
1350
|
return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
|
|
1350
1351
|
};
|
|
1351
|
-
function
|
|
1352
|
+
function Qa(e, t) {
|
|
1352
1353
|
if (!t || t[0] !== "lab") return;
|
|
1353
|
-
const r = { mode: "lab" }, [, a,
|
|
1354
|
-
if (!(a.type ===
|
|
1355
|
-
return a.type !==
|
|
1354
|
+
const r = { mode: "lab" }, [, a, i, o, n] = t;
|
|
1355
|
+
if (!(a.type === s.Hue || i.type === s.Hue || o.type === s.Hue))
|
|
1356
|
+
return a.type !== s.None && (r.l = Math.min(Math.max(0, a.value), 100)), i.type !== s.None && (r.a = i.type === s.Number ? i.value : i.value * 125 / 100), o.type !== s.None && (r.b = o.type === s.Number ? o.value : o.value * 125 / 100), n.type !== s.None && (r.alpha = Math.min(1, Math.max(0, n.type === s.Number ? n.value : n.value / 100))), r;
|
|
1356
1357
|
}
|
|
1357
|
-
var
|
|
1358
|
+
var _t = {
|
|
1358
1359
|
mode: "lab",
|
|
1359
1360
|
toMode: {
|
|
1360
|
-
xyz50:
|
|
1361
|
-
rgb:
|
|
1361
|
+
xyz50: xt,
|
|
1362
|
+
rgb: Cr
|
|
1362
1363
|
},
|
|
1363
1364
|
fromMode: {
|
|
1364
|
-
xyz50:
|
|
1365
|
-
rgb:
|
|
1365
|
+
xyz50: kt,
|
|
1366
|
+
rgb: Ir
|
|
1366
1367
|
},
|
|
1367
1368
|
channels: [
|
|
1368
1369
|
"l",
|
|
@@ -1375,7 +1376,7 @@ var Yt = {
|
|
|
1375
1376
|
a: [-125, 125],
|
|
1376
1377
|
b: [-125, 125]
|
|
1377
1378
|
},
|
|
1378
|
-
parse: [
|
|
1379
|
+
parse: [Qa],
|
|
1379
1380
|
serialize: (e) => `lab(${e.l !== void 0 ? e.l : "none"} ${e.a !== void 0 ? e.a : "none"} ${e.b !== void 0 ? e.b : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1380
1381
|
interpolate: {
|
|
1381
1382
|
l: h,
|
|
@@ -1383,21 +1384,21 @@ var Yt = {
|
|
|
1383
1384
|
b: h,
|
|
1384
1385
|
alpha: {
|
|
1385
1386
|
use: h,
|
|
1386
|
-
fixup:
|
|
1387
|
+
fixup: M
|
|
1387
1388
|
}
|
|
1388
1389
|
}
|
|
1389
|
-
},
|
|
1390
|
-
...
|
|
1390
|
+
}, ei = {
|
|
1391
|
+
..._t,
|
|
1391
1392
|
mode: "lab65",
|
|
1392
1393
|
parse: ["--lab-d65"],
|
|
1393
1394
|
serialize: "--lab-d65",
|
|
1394
1395
|
toMode: {
|
|
1395
|
-
xyz65:
|
|
1396
|
-
rgb:
|
|
1396
|
+
xyz65: yr,
|
|
1397
|
+
rgb: ke
|
|
1397
1398
|
},
|
|
1398
1399
|
fromMode: {
|
|
1399
|
-
xyz65:
|
|
1400
|
-
rgb:
|
|
1400
|
+
xyz65: Mr,
|
|
1401
|
+
rgb: _e
|
|
1401
1402
|
},
|
|
1402
1403
|
ranges: {
|
|
1403
1404
|
l: [0, 100],
|
|
@@ -1405,28 +1406,28 @@ var Yt = {
|
|
|
1405
1406
|
b: [-125, 125]
|
|
1406
1407
|
}
|
|
1407
1408
|
};
|
|
1408
|
-
function
|
|
1409
|
+
function ti(e, t) {
|
|
1409
1410
|
if (!t || t[0] !== "lch") return;
|
|
1410
|
-
const r = { mode: "lch" }, [, a,
|
|
1411
|
-
if (a.type !==
|
|
1412
|
-
if (a.type ===
|
|
1411
|
+
const r = { mode: "lch" }, [, a, i, o, n] = t;
|
|
1412
|
+
if (a.type !== s.None) {
|
|
1413
|
+
if (a.type === s.Hue) return;
|
|
1413
1414
|
r.l = Math.min(Math.max(0, a.value), 100);
|
|
1414
1415
|
}
|
|
1415
|
-
if (
|
|
1416
|
-
if (
|
|
1417
|
-
r.h =
|
|
1416
|
+
if (i.type !== s.None && (r.c = Math.max(0, i.type === s.Number ? i.value : i.value * 150 / 100)), o.type !== s.None) {
|
|
1417
|
+
if (o.type === s.Percentage) return;
|
|
1418
|
+
r.h = o.value;
|
|
1418
1419
|
}
|
|
1419
|
-
return
|
|
1420
|
+
return n.type !== s.None && (r.alpha = Math.min(1, Math.max(0, n.type === s.Number ? n.value : n.value / 100))), r;
|
|
1420
1421
|
}
|
|
1421
|
-
var
|
|
1422
|
+
var $t = {
|
|
1422
1423
|
mode: "lch",
|
|
1423
1424
|
toMode: {
|
|
1424
|
-
lab:
|
|
1425
|
-
rgb: (e) =>
|
|
1425
|
+
lab: R,
|
|
1426
|
+
rgb: (e) => Cr(R(e))
|
|
1426
1427
|
},
|
|
1427
1428
|
fromMode: {
|
|
1428
|
-
rgb: (e) =>
|
|
1429
|
-
lab:
|
|
1429
|
+
rgb: (e) => E(Ir(e)),
|
|
1430
|
+
lab: E
|
|
1430
1431
|
},
|
|
1431
1432
|
channels: [
|
|
1432
1433
|
"l",
|
|
@@ -1439,7 +1440,7 @@ var Ut = {
|
|
|
1439
1440
|
c: [0, 150],
|
|
1440
1441
|
h: [0, 360]
|
|
1441
1442
|
},
|
|
1442
|
-
parse: [
|
|
1443
|
+
parse: [ti],
|
|
1443
1444
|
serialize: (e) => `lch(${e.l !== void 0 ? e.l : "none"} ${e.c !== void 0 ? e.c : "none"} ${e.h !== void 0 ? e.h : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1444
1445
|
interpolate: {
|
|
1445
1446
|
h: {
|
|
@@ -1450,58 +1451,58 @@ var Ut = {
|
|
|
1450
1451
|
l: h,
|
|
1451
1452
|
alpha: {
|
|
1452
1453
|
use: h,
|
|
1453
|
-
fixup:
|
|
1454
|
+
fixup: M
|
|
1454
1455
|
}
|
|
1455
1456
|
},
|
|
1456
|
-
difference: { h:
|
|
1457
|
-
average: { h:
|
|
1458
|
-
},
|
|
1459
|
-
|
|
1457
|
+
difference: { h: xe },
|
|
1458
|
+
average: { h: C }
|
|
1459
|
+
}, ri = {
|
|
1460
|
+
...$t,
|
|
1460
1461
|
mode: "lch65",
|
|
1461
1462
|
parse: ["--lch-d65"],
|
|
1462
1463
|
serialize: "--lch-d65",
|
|
1463
1464
|
toMode: {
|
|
1464
|
-
lab65: (e) =>
|
|
1465
|
-
rgb: (e) =>
|
|
1465
|
+
lab65: (e) => R(e, "lab65"),
|
|
1466
|
+
rgb: (e) => ke(R(e, "lab65"))
|
|
1466
1467
|
},
|
|
1467
1468
|
fromMode: {
|
|
1468
|
-
rgb: (e) =>
|
|
1469
|
-
lab65: (e) =>
|
|
1469
|
+
rgb: (e) => E(_e(e), "lch65"),
|
|
1470
|
+
lab65: (e) => E(e, "lch65")
|
|
1470
1471
|
},
|
|
1471
1472
|
ranges: {
|
|
1472
1473
|
l: [0, 100],
|
|
1473
1474
|
c: [0, 150],
|
|
1474
1475
|
h: [0, 360]
|
|
1475
1476
|
}
|
|
1476
|
-
},
|
|
1477
|
+
}, Er = ({ l: e, u: t, v: r, alpha: a }) => {
|
|
1477
1478
|
t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1478
|
-
let
|
|
1479
|
+
let i = Math.sqrt(t * t + r * r), o = {
|
|
1479
1480
|
mode: "lchuv",
|
|
1480
1481
|
l: e,
|
|
1481
|
-
c:
|
|
1482
|
+
c: i
|
|
1482
1483
|
};
|
|
1483
|
-
return
|
|
1484
|
-
},
|
|
1484
|
+
return i && (o.h = _(Math.atan2(r, t) * 180 / Math.PI)), a !== void 0 && (o.alpha = a), o;
|
|
1485
|
+
}, Rr = ({ l: e, c: t, h: r, alpha: a }) => {
|
|
1485
1486
|
r === void 0 && (r = 0);
|
|
1486
|
-
let
|
|
1487
|
+
let i = {
|
|
1487
1488
|
mode: "luv",
|
|
1488
1489
|
l: e,
|
|
1489
1490
|
u: t ? t * Math.cos(r / 180 * Math.PI) : 0,
|
|
1490
1491
|
v: t ? t * Math.sin(r / 180 * Math.PI) : 0
|
|
1491
1492
|
};
|
|
1492
|
-
return a !== void 0 && (
|
|
1493
|
-
},
|
|
1493
|
+
return a !== void 0 && (i.alpha = a), i;
|
|
1494
|
+
}, Nr = (e, t, r) => 4 * e / (e + 15 * t + 3 * r), Lr = (e, t, r) => 9 * t / (e + 15 * t + 3 * r), ai = Nr(g.X, g.Y, g.Z), ii = Lr(g.X, g.Y, g.Z), oi = (e) => e <= wt ? Se * e : 116 * Math.cbrt(e) - 16, ct = ({ x: e, y: t, z: r, alpha: a }) => {
|
|
1494
1495
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1495
|
-
let
|
|
1496
|
-
!isFinite(
|
|
1497
|
-
let
|
|
1496
|
+
let i = oi(t / g.Y), o = Nr(e, t, r), n = Lr(e, t, r);
|
|
1497
|
+
!isFinite(o) || !isFinite(n) ? i = o = n = 0 : (o = 13 * i * (o - ai), n = 13 * i * (n - ii));
|
|
1498
|
+
let l = {
|
|
1498
1499
|
mode: "luv",
|
|
1499
|
-
l:
|
|
1500
|
-
u:
|
|
1501
|
-
v:
|
|
1500
|
+
l: i,
|
|
1501
|
+
u: o,
|
|
1502
|
+
v: n
|
|
1502
1503
|
};
|
|
1503
|
-
return a !== void 0 && (
|
|
1504
|
-
},
|
|
1504
|
+
return a !== void 0 && (l.alpha = a), l;
|
|
1505
|
+
}, ni = (e, t, r) => 4 * e / (e + 15 * t + 3 * r), li = (e, t, r) => 9 * t / (e + 15 * t + 3 * r), si = ni(g.X, g.Y, g.Z), hi = li(g.X, g.Y, g.Z), vt = ({ l: e, u: t, v: r, alpha: a }) => {
|
|
1505
1506
|
if (e === void 0 && (e = 0), e === 0) return {
|
|
1506
1507
|
mode: "xyz50",
|
|
1507
1508
|
x: 0,
|
|
@@ -1509,22 +1510,22 @@ var Ut = {
|
|
|
1509
1510
|
z: 0
|
|
1510
1511
|
};
|
|
1511
1512
|
t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1512
|
-
let
|
|
1513
|
+
let i = t / (13 * e) + si, o = r / (13 * e) + hi, n = g.Y * (e <= 8 ? e / Se : Math.pow((e + 16) / 116, 3)), l = {
|
|
1513
1514
|
mode: "xyz50",
|
|
1514
|
-
x:
|
|
1515
|
-
y:
|
|
1516
|
-
z:
|
|
1515
|
+
x: n * (9 * i) / (4 * o),
|
|
1516
|
+
y: n,
|
|
1517
|
+
z: n * (12 - 3 * i - 20 * o) / (4 * o)
|
|
1517
1518
|
};
|
|
1518
|
-
return a !== void 0 && (
|
|
1519
|
-
},
|
|
1519
|
+
return a !== void 0 && (l.alpha = a), l;
|
|
1520
|
+
}, di = (e) => Er(ct(oe(e))), ci = (e) => ie(vt(Rr(e))), vi = {
|
|
1520
1521
|
mode: "lchuv",
|
|
1521
1522
|
toMode: {
|
|
1522
|
-
luv:
|
|
1523
|
-
rgb:
|
|
1523
|
+
luv: Rr,
|
|
1524
|
+
rgb: ci
|
|
1524
1525
|
},
|
|
1525
1526
|
fromMode: {
|
|
1526
|
-
rgb:
|
|
1527
|
-
luv:
|
|
1527
|
+
rgb: di,
|
|
1528
|
+
luv: Er
|
|
1528
1529
|
},
|
|
1529
1530
|
channels: [
|
|
1530
1531
|
"l",
|
|
@@ -1548,27 +1549,27 @@ var Ut = {
|
|
|
1548
1549
|
l: h,
|
|
1549
1550
|
alpha: {
|
|
1550
1551
|
use: h,
|
|
1551
|
-
fixup:
|
|
1552
|
+
fixup: M
|
|
1552
1553
|
}
|
|
1553
1554
|
},
|
|
1554
|
-
difference: { h:
|
|
1555
|
-
average: { h:
|
|
1556
|
-
},
|
|
1557
|
-
...
|
|
1555
|
+
difference: { h: xe },
|
|
1556
|
+
average: { h: C }
|
|
1557
|
+
}, ui = {
|
|
1558
|
+
...B,
|
|
1558
1559
|
mode: "lrgb",
|
|
1559
|
-
toMode: { rgb:
|
|
1560
|
-
fromMode: { rgb:
|
|
1560
|
+
toMode: { rgb: Y },
|
|
1561
|
+
fromMode: { rgb: F },
|
|
1561
1562
|
parse: ["srgb-linear"],
|
|
1562
1563
|
serialize: "srgb-linear"
|
|
1563
|
-
},
|
|
1564
|
+
}, fi = {
|
|
1564
1565
|
mode: "luv",
|
|
1565
1566
|
toMode: {
|
|
1566
|
-
xyz50:
|
|
1567
|
-
rgb: (e) =>
|
|
1567
|
+
xyz50: vt,
|
|
1568
|
+
rgb: (e) => ie(vt(e))
|
|
1568
1569
|
},
|
|
1569
1570
|
fromMode: {
|
|
1570
|
-
xyz50:
|
|
1571
|
-
rgb: (e) =>
|
|
1571
|
+
xyz50: ct,
|
|
1572
|
+
rgb: (e) => ct(oe(e))
|
|
1572
1573
|
},
|
|
1573
1574
|
channels: [
|
|
1574
1575
|
"l",
|
|
@@ -1589,119 +1590,119 @@ var Ut = {
|
|
|
1589
1590
|
v: h,
|
|
1590
1591
|
alpha: {
|
|
1591
1592
|
use: h,
|
|
1592
|
-
fixup:
|
|
1593
|
+
fixup: M
|
|
1593
1594
|
}
|
|
1594
1595
|
}
|
|
1595
|
-
},
|
|
1596
|
+
}, Hr = ({ r: e, g: t, b: r, alpha: a }) => {
|
|
1596
1597
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1597
|
-
let
|
|
1598
|
+
let i = Math.cbrt(0.412221469470763 * e + 0.5363325372617348 * t + 0.0514459932675022 * r), o = Math.cbrt(0.2119034958178252 * e + 0.6806995506452344 * t + 0.1073969535369406 * r), n = Math.cbrt(0.0883024591900564 * e + 0.2817188391361215 * t + 0.6299787016738222 * r), l = {
|
|
1598
1599
|
mode: "oklab",
|
|
1599
|
-
l: 0.210454268309314 *
|
|
1600
|
-
a: 1.9779985324311684 *
|
|
1601
|
-
b: 0.0259040424655478 *
|
|
1600
|
+
l: 0.210454268309314 * i + 0.7936177747023054 * o - 0.0040720430116193 * n,
|
|
1601
|
+
a: 1.9779985324311684 * i - 2.42859224204858 * o + 0.450593709617411 * n,
|
|
1602
|
+
b: 0.0259040424655478 * i + 0.7827717124575296 * o - 0.8086757549230774 * n
|
|
1602
1603
|
};
|
|
1603
|
-
return a !== void 0 && (
|
|
1604
|
-
},
|
|
1605
|
-
let t =
|
|
1604
|
+
return a !== void 0 && (l.alpha = a), l;
|
|
1605
|
+
}, Ae = (e) => {
|
|
1606
|
+
let t = Hr(F(e));
|
|
1606
1607
|
return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
|
|
1607
|
-
},
|
|
1608
|
+
}, ne = ({ l: e, a: t, b: r, alpha: a }) => {
|
|
1608
1609
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1609
|
-
let
|
|
1610
|
+
let i = Math.pow(e + 0.3963377773761749 * t + 0.2158037573099136 * r, 3), o = Math.pow(e - 0.1055613458156586 * t - 0.0638541728258133 * r, 3), n = Math.pow(e - 0.0894841775298119 * t - 1.2914855480194092 * r, 3), l = {
|
|
1610
1611
|
mode: "lrgb",
|
|
1611
|
-
r: 4.076741636075957 *
|
|
1612
|
-
g: -1.2684379732850317 *
|
|
1613
|
-
b: -0.0041960761386756 *
|
|
1612
|
+
r: 4.076741636075957 * i - 3.3077115392580616 * o + 0.2309699031821044 * n,
|
|
1613
|
+
g: -1.2684379732850317 * i + 2.6097573492876887 * o - 0.3413193760026573 * n,
|
|
1614
|
+
b: -0.0041960761386756 * i - 0.7034186179359362 * o + 1.7076146940746117 * n
|
|
1614
1615
|
};
|
|
1615
|
-
return a !== void 0 && (
|
|
1616
|
-
},
|
|
1617
|
-
function
|
|
1616
|
+
return a !== void 0 && (l.alpha = a), l;
|
|
1617
|
+
}, Ce = (e) => Y(ne(e));
|
|
1618
|
+
function ut(e) {
|
|
1618
1619
|
const a = 1.170873786407767;
|
|
1619
1620
|
return 0.5 * (a * e - 0.206 + Math.sqrt((a * e - 0.206) * (a * e - 0.206) + 4 * 0.03 * a * e));
|
|
1620
1621
|
}
|
|
1621
|
-
function
|
|
1622
|
+
function be(e) {
|
|
1622
1623
|
return (e * e + 0.206 * e) / (1.206 / 1.03 * (e + 0.03));
|
|
1623
1624
|
}
|
|
1624
|
-
function
|
|
1625
|
-
let r, a,
|
|
1626
|
-
-1.88170328 * e - 0.80936493 * t > 1 ? (r = 1.19086277, a = 1.76576728,
|
|
1627
|
-
let
|
|
1625
|
+
function pi(e, t) {
|
|
1626
|
+
let r, a, i, o, n, l, d, c;
|
|
1627
|
+
-1.88170328 * e - 0.80936493 * t > 1 ? (r = 1.19086277, a = 1.76576728, i = 0.59662641, o = 0.75515197, n = 0.56771245, l = 4.0767416621, d = -3.3077115913, c = 0.2309699292) : 1.81444104 * e - 1.19445276 * t > 1 ? (r = 0.73956515, a = -0.45954404, i = 0.08285427, o = 0.1254107, n = 0.14503204, l = -1.2684380046, d = 2.6097574011, c = -0.3413193965) : (r = 1.35733652, a = -915799e-8, i = -1.1513021, o = -0.50559606, n = 692167e-8, l = -0.0041960863, d = -0.7034186147, c = 1.707614701);
|
|
1628
|
+
let v = r + a * e + i * t + o * e * e + n * e * t, f = 0.3963377774 * e + 0.2158037573 * t, p = -0.1055613458 * e - 0.0638541728 * t, b = -0.0894841775 * e - 1.291485548 * t;
|
|
1628
1629
|
{
|
|
1629
|
-
let
|
|
1630
|
-
|
|
1630
|
+
let y = 1 + v * f, k = 1 + v * p, w = 1 + v * b, z = y * y * y, $ = k * k * k, I = w * w * w, Z = 3 * f * y * y, U = 3 * p * k * k, G = 3 * b * w * w, J = 6 * f * f * y, K = 6 * p * p * k, V = 6 * b * b * w, D = l * z + d * $ + c * I, H = l * Z + d * U + c * G, Q = l * J + d * K + c * V;
|
|
1631
|
+
v = v - D * H / (H * H - 0.5 * D * Q);
|
|
1631
1632
|
}
|
|
1632
|
-
return
|
|
1633
|
+
return v;
|
|
1633
1634
|
}
|
|
1634
|
-
function
|
|
1635
|
-
let r =
|
|
1635
|
+
function zt(e, t) {
|
|
1636
|
+
let r = pi(e, t), a = ne({
|
|
1636
1637
|
l: 1,
|
|
1637
1638
|
a: r * e,
|
|
1638
1639
|
b: r * t
|
|
1639
|
-
}),
|
|
1640
|
-
return [
|
|
1640
|
+
}), i = Math.cbrt(1 / Math.max(a.r, a.g, a.b));
|
|
1641
|
+
return [i, i * r];
|
|
1641
1642
|
}
|
|
1642
|
-
function
|
|
1643
|
-
|
|
1644
|
-
let
|
|
1645
|
-
if ((r -
|
|
1643
|
+
function mi(e, t, r, a, i, o = null) {
|
|
1644
|
+
o || (o = zt(e, t));
|
|
1645
|
+
let n;
|
|
1646
|
+
if ((r - i) * o[1] - (o[0] - i) * a <= 0) n = o[1] * i / (a * o[0] + o[1] * (i - r));
|
|
1646
1647
|
else {
|
|
1647
|
-
|
|
1648
|
+
n = o[1] * (i - 1) / (a * (o[0] - 1) + o[1] * (i - r));
|
|
1648
1649
|
{
|
|
1649
|
-
let
|
|
1650
|
+
let l = r - i, d = a, c = 0.3963377774 * e + 0.2158037573 * t, v = -0.1055613458 * e - 0.0638541728 * t, f = -0.0894841775 * e - 1.291485548 * t, p = l + d * c, b = l + d * v, y = l + d * f;
|
|
1650
1651
|
{
|
|
1651
|
-
let
|
|
1652
|
-
|
|
1652
|
+
let k = i * (1 - n) + n * r, w = n * a, z = k + w * c, $ = k + w * v, I = k + w * f, Z = z * z * z, U = $ * $ * $, G = I * I * I, J = 3 * p * z * z, K = 3 * b * $ * $, V = 3 * y * I * I, D = 6 * p * p * z, H = 6 * b * b * $, Q = 6 * y * y * I, Et = 4.0767416621 * Z - 3.3077115913 * U + 0.2309699292 * G - 1, Ie = 4.0767416621 * J - 3.3077115913 * K + 0.2309699292 * V, Yr = 4.0767416621 * D - 3.3077115913 * H + 0.2309699292 * Q, Rt = Ie / (Ie * Ie - 0.5 * Et * Yr), Ee = -Et * Rt, Nt = -1.2684380046 * Z + 2.6097574011 * U - 0.3413193965 * G - 1, Re = -1.2684380046 * J + 2.6097574011 * K - 0.3413193965 * V, Zr = -1.2684380046 * D + 2.6097574011 * H - 0.3413193965 * Q, Lt = Re / (Re * Re - 0.5 * Nt * Zr), Ne = -Nt * Lt, Ht = -0.0041960863 * Z - 0.7034186147 * U + 1.707614701 * G - 1, Le = -0.0041960863 * J - 0.7034186147 * K + 1.707614701 * V, Ur = -0.0041960863 * D - 0.7034186147 * H + 1.707614701 * Q, qt = Le / (Le * Le - 0.5 * Ht * Ur), He = -Ht * qt;
|
|
1653
|
+
Ee = Rt >= 0 ? Ee : 1e6, Ne = Lt >= 0 ? Ne : 1e6, He = qt >= 0 ? He : 1e6, n += Math.min(Ee, Math.min(Ne, He));
|
|
1653
1654
|
}
|
|
1654
1655
|
}
|
|
1655
1656
|
}
|
|
1656
|
-
return
|
|
1657
|
+
return n;
|
|
1657
1658
|
}
|
|
1658
|
-
function
|
|
1659
|
-
r || (r =
|
|
1660
|
-
let a = r[0],
|
|
1661
|
-
return [
|
|
1659
|
+
function Pt(e, t, r = null) {
|
|
1660
|
+
r || (r = zt(e, t));
|
|
1661
|
+
let a = r[0], i = r[1];
|
|
1662
|
+
return [i / a, i / (1 - a)];
|
|
1662
1663
|
}
|
|
1663
|
-
function
|
|
1664
|
-
let a =
|
|
1665
|
-
return
|
|
1666
|
-
Math.sqrt(1 / (1 / (
|
|
1667
|
-
|
|
1668
|
-
|
|
1664
|
+
function qr(e, t, r) {
|
|
1665
|
+
let a = zt(t, r), i = mi(t, r, e, 1, e, a), o = Pt(t, r, a), n = 0.11516993 + 1 / (7.4477897 + 4.1590124 * r + t * (-2.19557347 + 1.75198401 * r + t * (-2.13704948 - 10.02301043 * r + t * (-4.24894561 + 5.38770819 * r + 4.69891013 * t)))), l = 0.11239642 + 1 / (1.6132032 - 0.68124379 * r + t * (0.40370612 + 0.90148123 * r + t * (-0.27087943 + 0.6122399 * r + t * (299215e-8 - 0.45399568 * r - 0.14661872 * t)))), d = i / Math.min(e * o[0], (1 - e) * o[1]), c = e * n, v = (1 - e) * l, f = 0.9 * d * Math.sqrt(Math.sqrt(1 / (1 / (c * c * c * c) + 1 / (v * v * v * v))));
|
|
1666
|
+
return c = e * 0.4, v = (1 - e) * 0.8, [
|
|
1667
|
+
Math.sqrt(1 / (1 / (c * c) + 1 / (v * v))),
|
|
1668
|
+
f,
|
|
1669
|
+
i
|
|
1669
1670
|
];
|
|
1670
1671
|
}
|
|
1671
|
-
function
|
|
1672
|
-
const t = e.l !== void 0 ? e.l : 0, r = e.a !== void 0 ? e.a : 0, a = e.b !== void 0 ? e.b : 0,
|
|
1672
|
+
function Kt(e) {
|
|
1673
|
+
const t = e.l !== void 0 ? e.l : 0, r = e.a !== void 0 ? e.a : 0, a = e.b !== void 0 ? e.b : 0, i = {
|
|
1673
1674
|
mode: "okhsl",
|
|
1674
|
-
l:
|
|
1675
|
+
l: ut(t)
|
|
1675
1676
|
};
|
|
1676
|
-
e.alpha !== void 0 && (
|
|
1677
|
-
let
|
|
1678
|
-
if (!
|
|
1679
|
-
return
|
|
1680
|
-
let [
|
|
1681
|
-
if (
|
|
1682
|
-
let
|
|
1683
|
-
|
|
1677
|
+
e.alpha !== void 0 && (i.alpha = e.alpha);
|
|
1678
|
+
let o = Math.sqrt(r * r + a * a);
|
|
1679
|
+
if (!o)
|
|
1680
|
+
return i.s = 0, i;
|
|
1681
|
+
let [n, l, d] = qr(t, r / o, a / o), c;
|
|
1682
|
+
if (o < l) {
|
|
1683
|
+
let v = 0, f = 0.8 * n, p = 1 - f / l;
|
|
1684
|
+
c = (o - v) / (f + p * (o - v)) * 0.8;
|
|
1684
1685
|
} else {
|
|
1685
|
-
let
|
|
1686
|
-
|
|
1686
|
+
let v = l, f = 0.2 * l * l * 1.25 * 1.25 / n, p = 1 - f / (d - l);
|
|
1687
|
+
c = 0.8 + 0.2 * ((o - v) / (f + p * (o - v)));
|
|
1687
1688
|
}
|
|
1688
|
-
return
|
|
1689
|
+
return c && (i.s = c, i.h = _(Math.atan2(a, r) * 180 / Math.PI)), i;
|
|
1689
1690
|
}
|
|
1690
|
-
function
|
|
1691
|
+
function Vt(e) {
|
|
1691
1692
|
let t = e.h !== void 0 ? e.h : 0, r = e.s !== void 0 ? e.s : 0, a = e.l !== void 0 ? e.l : 0;
|
|
1692
|
-
const
|
|
1693
|
+
const i = {
|
|
1693
1694
|
mode: "oklab",
|
|
1694
|
-
l:
|
|
1695
|
+
l: be(a)
|
|
1695
1696
|
};
|
|
1696
|
-
if (e.alpha !== void 0 && (
|
|
1697
|
-
return
|
|
1698
|
-
let
|
|
1699
|
-
r < 0.8 ? (
|
|
1700
|
-
let
|
|
1701
|
-
return
|
|
1697
|
+
if (e.alpha !== void 0 && (i.alpha = e.alpha), !r || a === 1)
|
|
1698
|
+
return i.a = i.b = 0, i;
|
|
1699
|
+
let o = Math.cos(t / 180 * Math.PI), n = Math.sin(t / 180 * Math.PI), [l, d, c] = qr(i.l, o, n), v, f, p, b;
|
|
1700
|
+
r < 0.8 ? (v = 1.25 * r, f = 0, p = 0.8 * l, b = 1 - p / d) : (v = 5 * (r - 0.8), f = d, p = 0.2 * d * d * 1.25 * 1.25 / l, b = 1 - p / (c - d));
|
|
1701
|
+
let y = f + v * p / (1 - b * v);
|
|
1702
|
+
return i.a = y * o, i.b = y * n, i;
|
|
1702
1703
|
}
|
|
1703
|
-
var
|
|
1704
|
-
...
|
|
1704
|
+
var bi = {
|
|
1705
|
+
...xr,
|
|
1705
1706
|
mode: "okhsl",
|
|
1706
1707
|
channels: [
|
|
1707
1708
|
"h",
|
|
@@ -1712,40 +1713,40 @@ var Un = {
|
|
|
1712
1713
|
parse: ["--okhsl"],
|
|
1713
1714
|
serialize: "--okhsl",
|
|
1714
1715
|
fromMode: {
|
|
1715
|
-
oklab:
|
|
1716
|
-
rgb: (e) =>
|
|
1716
|
+
oklab: Kt,
|
|
1717
|
+
rgb: (e) => Kt(Ae(e))
|
|
1717
1718
|
},
|
|
1718
1719
|
toMode: {
|
|
1719
|
-
oklab:
|
|
1720
|
-
rgb: (e) =>
|
|
1720
|
+
oklab: Vt,
|
|
1721
|
+
rgb: (e) => Ce(Vt(e))
|
|
1721
1722
|
}
|
|
1722
1723
|
};
|
|
1723
|
-
function
|
|
1724
|
-
let t = e.l !== void 0 ? e.l : 0, r = e.a !== void 0 ? e.a : 0, a = e.b !== void 0 ? e.b : 0,
|
|
1725
|
-
l:
|
|
1726
|
-
a:
|
|
1727
|
-
b:
|
|
1728
|
-
}), z = Math.cbrt(1 / Math.max(
|
|
1729
|
-
t = t / z,
|
|
1730
|
-
const
|
|
1724
|
+
function Qt(e) {
|
|
1725
|
+
let t = e.l !== void 0 ? e.l : 0, r = e.a !== void 0 ? e.a : 0, a = e.b !== void 0 ? e.b : 0, i = Math.sqrt(r * r + a * a), o = i ? r / i : 1, n = i ? a / i : 1, [l, d] = Pt(o, n), c = 0.5, v = 1 - c / l, f = d / (i + t * d), p = f * t, b = f * i, y = be(p), k = b * y / p, w = ne({
|
|
1726
|
+
l: y,
|
|
1727
|
+
a: o * k,
|
|
1728
|
+
b: n * k
|
|
1729
|
+
}), z = Math.cbrt(1 / Math.max(w.r, w.g, w.b, 0));
|
|
1730
|
+
t = t / z, i = i / z * ut(t) / t, t = ut(t);
|
|
1731
|
+
const $ = {
|
|
1731
1732
|
mode: "okhsv",
|
|
1732
|
-
s:
|
|
1733
|
-
v: t ? t /
|
|
1733
|
+
s: i ? (c + d) * b / (d * c + d * v * b) : 0,
|
|
1734
|
+
v: t ? t / p : 0
|
|
1734
1735
|
};
|
|
1735
|
-
return
|
|
1736
|
+
return $.s && ($.h = _(Math.atan2(a, r) * 180 / Math.PI)), e.alpha !== void 0 && ($.alpha = e.alpha), $;
|
|
1736
1737
|
}
|
|
1737
|
-
function
|
|
1738
|
+
function er(e) {
|
|
1738
1739
|
const t = { mode: "oklab" };
|
|
1739
1740
|
e.alpha !== void 0 && (t.alpha = e.alpha);
|
|
1740
|
-
const r = e.h !== void 0 ? e.h : 0, a = e.s !== void 0 ? e.s : 0,
|
|
1741
|
-
l:
|
|
1742
|
-
a:
|
|
1743
|
-
b:
|
|
1744
|
-
}),
|
|
1745
|
-
return t.l = z *
|
|
1741
|
+
const r = e.h !== void 0 ? e.h : 0, a = e.s !== void 0 ? e.s : 0, i = e.v !== void 0 ? e.v : 0, o = Math.cos(r / 180 * Math.PI), n = Math.sin(r / 180 * Math.PI), [l, d] = Pt(o, n), c = 0.5, v = 1 - c / l, f = 1 - a * c / (c + d - d * v * a), p = a * d * c / (c + d - d * v * a), b = be(f), y = p * b / f, k = ne({
|
|
1742
|
+
l: b,
|
|
1743
|
+
a: o * y,
|
|
1744
|
+
b: n * y
|
|
1745
|
+
}), w = Math.cbrt(1 / Math.max(k.r, k.g, k.b, 0)), z = be(i * f), $ = p * z / f;
|
|
1746
|
+
return t.l = z * w, t.a = $ * o * w, t.b = $ * n * w, t;
|
|
1746
1747
|
}
|
|
1747
|
-
var
|
|
1748
|
-
|
|
1748
|
+
var gi = {
|
|
1749
|
+
...$r,
|
|
1749
1750
|
mode: "okhsv",
|
|
1750
1751
|
channels: [
|
|
1751
1752
|
"h",
|
|
@@ -1756,188 +1757,188 @@ var Zn = {
|
|
|
1756
1757
|
parse: ["--okhsv"],
|
|
1757
1758
|
serialize: "--okhsv",
|
|
1758
1759
|
fromMode: {
|
|
1759
|
-
oklab:
|
|
1760
|
-
rgb: (e) =>
|
|
1760
|
+
oklab: Qt,
|
|
1761
|
+
rgb: (e) => Qt(Ae(e))
|
|
1761
1762
|
},
|
|
1762
1763
|
toMode: {
|
|
1763
|
-
oklab:
|
|
1764
|
-
rgb: (e) =>
|
|
1764
|
+
oklab: er,
|
|
1765
|
+
rgb: (e) => Ce(er(e))
|
|
1765
1766
|
}
|
|
1766
1767
|
};
|
|
1767
|
-
function
|
|
1768
|
+
function yi(e, t) {
|
|
1768
1769
|
if (!t || t[0] !== "oklab") return;
|
|
1769
|
-
const r = { mode: "oklab" }, [, a,
|
|
1770
|
-
if (!(a.type ===
|
|
1771
|
-
return a.type !==
|
|
1770
|
+
const r = { mode: "oklab" }, [, a, i, o, n] = t;
|
|
1771
|
+
if (!(a.type === s.Hue || i.type === s.Hue || o.type === s.Hue))
|
|
1772
|
+
return a.type !== s.None && (r.l = Math.min(Math.max(0, a.type === s.Number ? a.value : a.value / 100), 1)), i.type !== s.None && (r.a = i.type === s.Number ? i.value : i.value * 0.4 / 100), o.type !== s.None && (r.b = o.type === s.Number ? o.value : o.value * 0.4 / 100), n.type !== s.None && (r.alpha = Math.min(1, Math.max(0, n.type === s.Number ? n.value : n.value / 100))), r;
|
|
1772
1773
|
}
|
|
1773
|
-
var
|
|
1774
|
-
...
|
|
1774
|
+
var Mi = {
|
|
1775
|
+
..._t,
|
|
1775
1776
|
mode: "oklab",
|
|
1776
1777
|
toMode: {
|
|
1777
|
-
lrgb:
|
|
1778
|
-
rgb:
|
|
1778
|
+
lrgb: ne,
|
|
1779
|
+
rgb: Ce
|
|
1779
1780
|
},
|
|
1780
1781
|
fromMode: {
|
|
1781
|
-
lrgb:
|
|
1782
|
-
rgb:
|
|
1782
|
+
lrgb: Hr,
|
|
1783
|
+
rgb: Ae
|
|
1783
1784
|
},
|
|
1784
1785
|
ranges: {
|
|
1785
1786
|
l: [0, 1],
|
|
1786
1787
|
a: [-0.4, 0.4],
|
|
1787
1788
|
b: [-0.4, 0.4]
|
|
1788
1789
|
},
|
|
1789
|
-
parse: [
|
|
1790
|
+
parse: [yi],
|
|
1790
1791
|
serialize: (e) => `oklab(${e.l !== void 0 ? e.l : "none"} ${e.a !== void 0 ? e.a : "none"} ${e.b !== void 0 ? e.b : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`
|
|
1791
1792
|
};
|
|
1792
|
-
function
|
|
1793
|
+
function wi(e, t) {
|
|
1793
1794
|
if (!t || t[0] !== "oklch") return;
|
|
1794
|
-
const r = { mode: "oklch" }, [, a,
|
|
1795
|
-
if (a.type !==
|
|
1796
|
-
if (a.type ===
|
|
1797
|
-
r.l = Math.min(Math.max(0, a.type ===
|
|
1795
|
+
const r = { mode: "oklch" }, [, a, i, o, n] = t;
|
|
1796
|
+
if (a.type !== s.None) {
|
|
1797
|
+
if (a.type === s.Hue) return;
|
|
1798
|
+
r.l = Math.min(Math.max(0, a.type === s.Number ? a.value : a.value / 100), 1);
|
|
1798
1799
|
}
|
|
1799
|
-
if (
|
|
1800
|
-
if (
|
|
1801
|
-
r.h =
|
|
1800
|
+
if (i.type !== s.None && (r.c = Math.max(0, i.type === s.Number ? i.value : i.value * 0.4 / 100)), o.type !== s.None) {
|
|
1801
|
+
if (o.type === s.Percentage) return;
|
|
1802
|
+
r.h = o.value;
|
|
1802
1803
|
}
|
|
1803
|
-
return
|
|
1804
|
+
return n.type !== s.None && (r.alpha = Math.min(1, Math.max(0, n.type === s.Number ? n.value : n.value / 100))), r;
|
|
1804
1805
|
}
|
|
1805
|
-
var
|
|
1806
|
-
|
|
1806
|
+
var xi = {
|
|
1807
|
+
...$t,
|
|
1807
1808
|
mode: "oklch",
|
|
1808
1809
|
toMode: {
|
|
1809
|
-
oklab: (e) =>
|
|
1810
|
-
rgb: (e) =>
|
|
1810
|
+
oklab: (e) => R(e, "oklab"),
|
|
1811
|
+
rgb: (e) => Ce(R(e, "oklab"))
|
|
1811
1812
|
},
|
|
1812
1813
|
fromMode: {
|
|
1813
|
-
rgb: (e) =>
|
|
1814
|
-
oklab: (e) =>
|
|
1814
|
+
rgb: (e) => E(Ae(e), "oklch"),
|
|
1815
|
+
oklab: (e) => E(e, "oklch")
|
|
1815
1816
|
},
|
|
1816
|
-
parse: [
|
|
1817
|
+
parse: [wi],
|
|
1817
1818
|
serialize: (e) => `oklch(${e.l !== void 0 ? e.l : "none"} ${e.c !== void 0 ? e.c : "none"} ${e.h !== void 0 ? e.h : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1818
1819
|
ranges: {
|
|
1819
1820
|
l: [0, 1],
|
|
1820
1821
|
c: [0, 0.4],
|
|
1821
1822
|
h: [0, 360]
|
|
1822
1823
|
}
|
|
1823
|
-
},
|
|
1824
|
-
let { r: t, g: r, b: a, alpha:
|
|
1824
|
+
}, tr = (e) => {
|
|
1825
|
+
let { r: t, g: r, b: a, alpha: i } = F(e), o = {
|
|
1825
1826
|
mode: "xyz65",
|
|
1826
1827
|
x: 0.486570948648216 * t + 0.265667693169093 * r + 0.1982172852343625 * a,
|
|
1827
1828
|
y: 0.2289745640697487 * t + 0.6917385218365062 * r + 0.079286914093745 * a,
|
|
1828
1829
|
z: 0 * t + 0.0451133818589026 * r + 1.043944368900976 * a
|
|
1829
1830
|
};
|
|
1830
|
-
return
|
|
1831
|
-
},
|
|
1831
|
+
return i !== void 0 && (o.alpha = i), o;
|
|
1832
|
+
}, rr = ({ x: e, y: t, z: r, alpha: a }) => {
|
|
1832
1833
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1833
|
-
let
|
|
1834
|
+
let i = Y({
|
|
1834
1835
|
r: e * 2.4934969119414263 - t * 0.9313836179191242 - 0.402710784450717 * r,
|
|
1835
1836
|
g: e * -0.8294889695615749 + t * 1.7626640603183465 + 0.0236246858419436 * r,
|
|
1836
1837
|
b: e * 0.0358458302437845 - t * 0.0761723892680418 + 0.9568845240076871 * r
|
|
1837
1838
|
}, "p3");
|
|
1838
|
-
return a !== void 0 && (
|
|
1839
|
-
},
|
|
1840
|
-
...
|
|
1839
|
+
return a !== void 0 && (i.alpha = a), i;
|
|
1840
|
+
}, ki = {
|
|
1841
|
+
...B,
|
|
1841
1842
|
mode: "p3",
|
|
1842
1843
|
parse: ["display-p3"],
|
|
1843
1844
|
serialize: "display-p3",
|
|
1844
1845
|
fromMode: {
|
|
1845
|
-
rgb: (e) =>
|
|
1846
|
-
xyz65:
|
|
1846
|
+
rgb: (e) => rr(O(e)),
|
|
1847
|
+
xyz65: rr
|
|
1847
1848
|
},
|
|
1848
1849
|
toMode: {
|
|
1849
|
-
rgb: (e) =>
|
|
1850
|
-
xyz65:
|
|
1850
|
+
rgb: (e) => W(tr(e)),
|
|
1851
|
+
xyz65: tr
|
|
1851
1852
|
}
|
|
1852
|
-
},
|
|
1853
|
+
}, et = (e) => {
|
|
1853
1854
|
let t = Math.abs(e);
|
|
1854
1855
|
return t >= 1 / 512 ? Math.sign(e) * Math.pow(t, 1 / 1.8) : 16 * e;
|
|
1855
|
-
},
|
|
1856
|
+
}, ar = ({ x: e, y: t, z: r, alpha: a }) => {
|
|
1856
1857
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1857
|
-
let
|
|
1858
|
+
let i = {
|
|
1858
1859
|
mode: "prophoto",
|
|
1859
|
-
r:
|
|
1860
|
-
g:
|
|
1861
|
-
b:
|
|
1860
|
+
r: et(e * 1.3457868816471585 - t * 0.2555720873797946 - 0.0511018649755453 * r),
|
|
1861
|
+
g: et(e * -0.5446307051249019 + t * 1.5082477428451466 + 0.0205274474364214 * r),
|
|
1862
|
+
b: et(e * 0 + t * 0 + 1.2119675456389452 * r)
|
|
1862
1863
|
};
|
|
1863
|
-
return a !== void 0 && (
|
|
1864
|
-
},
|
|
1864
|
+
return a !== void 0 && (i.alpha = a), i;
|
|
1865
|
+
}, tt = (e = 0) => {
|
|
1865
1866
|
let t = Math.abs(e);
|
|
1866
1867
|
return t >= 16 / 512 ? Math.sign(e) * Math.pow(t, 1.8) : e / 16;
|
|
1867
|
-
},
|
|
1868
|
-
let t =
|
|
1868
|
+
}, ir = (e) => {
|
|
1869
|
+
let t = tt(e.r), r = tt(e.g), a = tt(e.b), i = {
|
|
1869
1870
|
mode: "xyz50",
|
|
1870
1871
|
x: 0.7977666449006423 * t + 0.1351812974005331 * r + 0.0313477341283922 * a,
|
|
1871
1872
|
y: 0.2880748288194013 * t + 0.7118352342418731 * r + 899369387256e-16 * a,
|
|
1872
1873
|
z: 0 * t + 0 * r + 0.8251046025104602 * a
|
|
1873
1874
|
};
|
|
1874
|
-
return e.alpha !== void 0 && (
|
|
1875
|
-
},
|
|
1876
|
-
...
|
|
1875
|
+
return e.alpha !== void 0 && (i.alpha = e.alpha), i;
|
|
1876
|
+
}, _i = {
|
|
1877
|
+
...B,
|
|
1877
1878
|
mode: "prophoto",
|
|
1878
1879
|
parse: ["prophoto-rgb"],
|
|
1879
1880
|
serialize: "prophoto-rgb",
|
|
1880
1881
|
fromMode: {
|
|
1881
|
-
xyz50:
|
|
1882
|
-
rgb: (e) =>
|
|
1882
|
+
xyz50: ar,
|
|
1883
|
+
rgb: (e) => ar(oe(e))
|
|
1883
1884
|
},
|
|
1884
1885
|
toMode: {
|
|
1885
|
-
xyz50:
|
|
1886
|
-
rgb: (e) =>
|
|
1886
|
+
xyz50: ir,
|
|
1887
|
+
rgb: (e) => ie(ir(e))
|
|
1887
1888
|
}
|
|
1888
|
-
}, $
|
|
1889
|
+
}, $i = 1.09929682680944, zi = 0.018053968510807, rt = (e) => {
|
|
1889
1890
|
const t = Math.abs(e);
|
|
1890
|
-
return t >
|
|
1891
|
-
},
|
|
1891
|
+
return t > zi ? (Math.sign(e) || 1) * ($i * Math.pow(t, 0.45) - 0.09929682680944008) : 4.5 * e;
|
|
1892
|
+
}, or = ({ x: e, y: t, z: r, alpha: a }) => {
|
|
1892
1893
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1893
|
-
let
|
|
1894
|
+
let i = {
|
|
1894
1895
|
mode: "rec2020",
|
|
1895
|
-
r:
|
|
1896
|
-
g:
|
|
1897
|
-
b:
|
|
1896
|
+
r: rt(e * 1.7166511879712683 - t * 0.3556707837763925 - 0.2533662813736599 * r),
|
|
1897
|
+
g: rt(e * -0.6666843518324893 + t * 1.6164812366349395 + 0.0157685458139111 * r),
|
|
1898
|
+
b: rt(e * 0.0176398574453108 - t * 0.0427706132578085 + 0.9421031212354739 * r)
|
|
1898
1899
|
};
|
|
1899
|
-
return a !== void 0 && (
|
|
1900
|
-
},
|
|
1900
|
+
return a !== void 0 && (i.alpha = a), i;
|
|
1901
|
+
}, nr = 1.09929682680944, Pi = 0.018053968510807, at = (e = 0) => {
|
|
1901
1902
|
let t = Math.abs(e);
|
|
1902
|
-
return t <
|
|
1903
|
-
},
|
|
1904
|
-
let t =
|
|
1903
|
+
return t < Pi * 4.5 ? e / 4.5 : (Math.sign(e) || 1) * Math.pow((t + nr - 1) / nr, 1 / 0.45);
|
|
1904
|
+
}, lr = (e) => {
|
|
1905
|
+
let t = at(e.r), r = at(e.g), a = at(e.b), i = {
|
|
1905
1906
|
mode: "xyz65",
|
|
1906
1907
|
x: 0.6369580483012911 * t + 0.1446169035862083 * r + 0.1688809751641721 * a,
|
|
1907
1908
|
y: 0.262700212011267 * t + 0.6779980715188708 * r + 0.059301716469862 * a,
|
|
1908
1909
|
z: 0 * t + 0.0280726930490874 * r + 1.0609850577107909 * a
|
|
1909
1910
|
};
|
|
1910
|
-
return e.alpha !== void 0 && (
|
|
1911
|
-
},
|
|
1912
|
-
...
|
|
1911
|
+
return e.alpha !== void 0 && (i.alpha = e.alpha), i;
|
|
1912
|
+
}, Ti = {
|
|
1913
|
+
...B,
|
|
1913
1914
|
mode: "rec2020",
|
|
1914
1915
|
fromMode: {
|
|
1915
|
-
xyz65:
|
|
1916
|
-
rgb: (e) =>
|
|
1916
|
+
xyz65: or,
|
|
1917
|
+
rgb: (e) => or(O(e))
|
|
1917
1918
|
},
|
|
1918
1919
|
toMode: {
|
|
1919
|
-
xyz65:
|
|
1920
|
-
rgb: (e) =>
|
|
1920
|
+
xyz65: lr,
|
|
1921
|
+
rgb: (e) => W(lr(e))
|
|
1921
1922
|
},
|
|
1922
1923
|
parse: ["rec2020"],
|
|
1923
1924
|
serialize: "rec2020"
|
|
1924
|
-
}, q = 0.0037930732552754493,
|
|
1925
|
-
const { r: t, g: r, b: a, alpha:
|
|
1925
|
+
}, q = 0.0037930732552754493, Or = Math.cbrt(q), it = (e) => Math.cbrt(e) - Or, Si = (e) => {
|
|
1926
|
+
const { r: t, g: r, b: a, alpha: i } = F(e), o = it(0.3 * t + 0.622 * r + 0.078 * a + q), n = it(0.23 * t + 0.692 * r + 0.078 * a + q), l = it(0.2434226892454782 * t + 0.2047674442449682 * r + 0.5518098665095535 * a + q), d = {
|
|
1926
1927
|
mode: "xyb",
|
|
1927
|
-
x: (
|
|
1928
|
-
y: (
|
|
1929
|
-
b:
|
|
1928
|
+
x: (o - n) / 2,
|
|
1929
|
+
y: (o + n) / 2,
|
|
1930
|
+
b: l - (o + n) / 2
|
|
1930
1931
|
};
|
|
1931
|
-
return
|
|
1932
|
-
},
|
|
1932
|
+
return i !== void 0 && (d.alpha = i), d;
|
|
1933
|
+
}, ot = (e) => Math.pow(e + Or, 3), Ai = ({ x: e, y: t, b: r, alpha: a }) => {
|
|
1933
1934
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
1934
|
-
const
|
|
1935
|
-
r: 11.031566904639861 *
|
|
1936
|
-
g: -3.2541473810744237 *
|
|
1937
|
-
b: -3.6588512867136815 *
|
|
1935
|
+
const i = ot(e + t) - q, o = ot(t - e) - q, n = ot(r + t) - q, l = Y({
|
|
1936
|
+
r: 11.031566904639861 * i - 9.866943908131562 * o - 0.16462299650829934 * n,
|
|
1937
|
+
g: -3.2541473810744237 * i + 4.418770377582723 * o - 0.16462299650829934 * n,
|
|
1938
|
+
b: -3.6588512867136815 * i + 2.7129230459360922 * o + 1.9459282407775895 * n
|
|
1938
1939
|
});
|
|
1939
|
-
return a !== void 0 && (
|
|
1940
|
-
},
|
|
1940
|
+
return a !== void 0 && (l.alpha = a), l;
|
|
1941
|
+
}, Ci = {
|
|
1941
1942
|
mode: "xyb",
|
|
1942
1943
|
channels: [
|
|
1943
1944
|
"x",
|
|
@@ -1947,8 +1948,8 @@ var Qn = {
|
|
|
1947
1948
|
],
|
|
1948
1949
|
parse: ["--xyb"],
|
|
1949
1950
|
serialize: "--xyb",
|
|
1950
|
-
toMode: { rgb:
|
|
1951
|
-
fromMode: { rgb:
|
|
1951
|
+
toMode: { rgb: Ai },
|
|
1952
|
+
fromMode: { rgb: Si },
|
|
1952
1953
|
ranges: {
|
|
1953
1954
|
x: [-0.0154, 0.0281],
|
|
1954
1955
|
y: [0, 0.8453],
|
|
@@ -1960,20 +1961,20 @@ var Qn = {
|
|
|
1960
1961
|
b: h,
|
|
1961
1962
|
alpha: {
|
|
1962
1963
|
use: h,
|
|
1963
|
-
fixup:
|
|
1964
|
+
fixup: M
|
|
1964
1965
|
}
|
|
1965
1966
|
}
|
|
1966
|
-
},
|
|
1967
|
+
}, Ii = {
|
|
1967
1968
|
mode: "xyz50",
|
|
1968
1969
|
parse: ["xyz-d50"],
|
|
1969
1970
|
serialize: "xyz-d50",
|
|
1970
1971
|
toMode: {
|
|
1971
|
-
rgb:
|
|
1972
|
-
lab:
|
|
1972
|
+
rgb: ie,
|
|
1973
|
+
lab: kt
|
|
1973
1974
|
},
|
|
1974
1975
|
fromMode: {
|
|
1975
|
-
rgb:
|
|
1976
|
-
lab:
|
|
1976
|
+
rgb: oe,
|
|
1977
|
+
lab: xt
|
|
1977
1978
|
},
|
|
1978
1979
|
channels: [
|
|
1979
1980
|
"x",
|
|
@@ -1992,38 +1993,38 @@ var Qn = {
|
|
|
1992
1993
|
z: h,
|
|
1993
1994
|
alpha: {
|
|
1994
1995
|
use: h,
|
|
1995
|
-
fixup:
|
|
1996
|
+
fixup: M
|
|
1996
1997
|
}
|
|
1997
1998
|
}
|
|
1998
|
-
},
|
|
1999
|
-
let { x: t, y: r, z: a, alpha:
|
|
1999
|
+
}, Ei = (e) => {
|
|
2000
|
+
let { x: t, y: r, z: a, alpha: i } = e;
|
|
2000
2001
|
t === void 0 && (t = 0), r === void 0 && (r = 0), a === void 0 && (a = 0);
|
|
2001
|
-
let
|
|
2002
|
+
let o = {
|
|
2002
2003
|
mode: "xyz50",
|
|
2003
2004
|
x: 1.0479298208405488 * t + 0.0229467933410191 * r - 0.0501922295431356 * a,
|
|
2004
2005
|
y: 0.0296278156881593 * t + 0.990434484573249 * r - 0.0170738250293851 * a,
|
|
2005
2006
|
z: -0.0092430581525912 * t + 0.0150551448965779 * r + 0.7518742899580008 * a
|
|
2006
2007
|
};
|
|
2007
|
-
return
|
|
2008
|
-
},
|
|
2009
|
-
let { x: t, y: r, z: a, alpha:
|
|
2008
|
+
return i !== void 0 && (o.alpha = i), o;
|
|
2009
|
+
}, Ri = (e) => {
|
|
2010
|
+
let { x: t, y: r, z: a, alpha: i } = e;
|
|
2010
2011
|
t === void 0 && (t = 0), r === void 0 && (r = 0), a === void 0 && (a = 0);
|
|
2011
|
-
let
|
|
2012
|
+
let o = {
|
|
2012
2013
|
mode: "xyz65",
|
|
2013
2014
|
x: 0.9554734527042182 * t - 0.0230985368742614 * r + 0.0632593086610217 * a,
|
|
2014
2015
|
y: -0.0283697069632081 * t + 1.0099954580058226 * r + 0.021041398966943 * a,
|
|
2015
2016
|
z: 0.0123140016883199 * t - 0.0205076964334779 * r + 1.3303659366080753 * a
|
|
2016
2017
|
};
|
|
2017
|
-
return
|
|
2018
|
-
},
|
|
2018
|
+
return i !== void 0 && (o.alpha = i), o;
|
|
2019
|
+
}, Ni = {
|
|
2019
2020
|
mode: "xyz65",
|
|
2020
2021
|
toMode: {
|
|
2021
|
-
rgb:
|
|
2022
|
-
xyz50:
|
|
2022
|
+
rgb: W,
|
|
2023
|
+
xyz50: Ei
|
|
2023
2024
|
},
|
|
2024
2025
|
fromMode: {
|
|
2025
|
-
rgb:
|
|
2026
|
-
xyz50:
|
|
2026
|
+
rgb: O,
|
|
2027
|
+
xyz50: Ri
|
|
2027
2028
|
},
|
|
2028
2029
|
ranges: {
|
|
2029
2030
|
x: [0, 0.95],
|
|
@@ -2044,31 +2045,31 @@ var Qn = {
|
|
|
2044
2045
|
z: h,
|
|
2045
2046
|
alpha: {
|
|
2046
2047
|
use: h,
|
|
2047
|
-
fixup:
|
|
2048
|
+
fixup: M
|
|
2048
2049
|
}
|
|
2049
2050
|
}
|
|
2050
|
-
},
|
|
2051
|
+
}, Li = ({ r: e, g: t, b: r, alpha: a }) => {
|
|
2051
2052
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
2052
|
-
const
|
|
2053
|
+
const i = {
|
|
2053
2054
|
mode: "yiq",
|
|
2054
2055
|
y: 0.29889531 * e + 0.58662247 * t + 0.11448223 * r,
|
|
2055
2056
|
i: 0.59597799 * e - 0.2741761 * t - 0.32180189 * r,
|
|
2056
2057
|
q: 0.21147017 * e - 0.52261711 * t + 0.31114694 * r
|
|
2057
2058
|
};
|
|
2058
|
-
return a !== void 0 && (
|
|
2059
|
-
},
|
|
2059
|
+
return a !== void 0 && (i.alpha = a), i;
|
|
2060
|
+
}, Hi = ({ y: e, i: t, q: r, alpha: a }) => {
|
|
2060
2061
|
e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
|
|
2061
|
-
const
|
|
2062
|
+
const i = {
|
|
2062
2063
|
mode: "rgb",
|
|
2063
2064
|
r: e + 0.95608445 * t + 0.6208885 * r,
|
|
2064
2065
|
g: e - 0.27137664 * t - 0.6486059 * r,
|
|
2065
2066
|
b: e - 1.10561724 * t + 1.70250126 * r
|
|
2066
2067
|
};
|
|
2067
|
-
return a !== void 0 && (
|
|
2068
|
-
},
|
|
2068
|
+
return a !== void 0 && (i.alpha = a), i;
|
|
2069
|
+
}, qi = {
|
|
2069
2070
|
mode: "yiq",
|
|
2070
|
-
toMode: { rgb:
|
|
2071
|
-
fromMode: { rgb:
|
|
2071
|
+
toMode: { rgb: Hi },
|
|
2072
|
+
fromMode: { rgb: Li },
|
|
2072
2073
|
channels: [
|
|
2073
2074
|
"y",
|
|
2074
2075
|
"i",
|
|
@@ -2087,36 +2088,36 @@ var Qn = {
|
|
|
2087
2088
|
q: h,
|
|
2088
2089
|
alpha: {
|
|
2089
2090
|
use: h,
|
|
2090
|
-
fixup:
|
|
2091
|
+
fixup: M
|
|
2091
2092
|
}
|
|
2092
2093
|
}
|
|
2093
|
-
},
|
|
2094
|
+
}, Oi = (e, t) => Math.round(e * (t = Math.pow(10, t))) / t, Wi = (e = 4) => (t) => typeof t == "number" ? Oi(t, e) : t, So = Wi(2), Di = (e) => Math.max(0, Math.min(1, e || 0)), nt = (e) => Math.round(Di(e) * 255), Xi = Mt("rgb"), Ao = Mt("hsl"), ji = (e) => {
|
|
2094
2095
|
if (e === void 0) return;
|
|
2095
|
-
let t =
|
|
2096
|
+
let t = nt(e.r), r = nt(e.g), a = nt(e.b);
|
|
2096
2097
|
return "#" + (1 << 24 | t << 16 | r << 8 | a).toString(16).slice(1);
|
|
2097
|
-
},
|
|
2098
|
+
}, Wr = (e) => ji(Xi(e)), Co = m(_a), Io = m(Ca), Eo = m(Ia), Ro = m(Ea), No = m(La), Lo = m(xr), Ho = m($r), qo = m(Ya), Oo = m(Za), Wo = m(Ka), Do = m(Va), Xo = m(_t), jo = m(ei), Bo = m($t), Fo = m(ri), Yo = m(vi), Zo = m(ui), Uo = m(fi), Go = m(bi), Jo = m(gi), Ko = m(Mi), ft = m(xi), Vo = m(ki), Qo = m(_i), en = m(Ti), tn = m(B), rn = m(Ci), an = m(Ii), on = m(Ni), nn = m(qi), Dr = (e, t = "l") => e.sort((r, a) => Math.sign(ft({
|
|
2098
2099
|
mode: "rgb",
|
|
2099
2100
|
r: r[0],
|
|
2100
2101
|
g: r[1],
|
|
2101
2102
|
b: r[2]
|
|
2102
|
-
})?.[t] -
|
|
2103
|
+
})?.[t] - ft({
|
|
2103
2104
|
mode: "rgb",
|
|
2104
2105
|
r: a[0],
|
|
2105
2106
|
g: a[1],
|
|
2106
2107
|
b: a[2]
|
|
2107
|
-
})?.[t]) || 0),
|
|
2108
|
+
})?.[t]) || 0), Tt = (e, t) => Math.hypot(e[0] - t[0], e[1] - t[1], e[2] - t[2]), Bi = (e, t) => {
|
|
2108
2109
|
let r = Array.from({ length: t.length }, () => ({
|
|
2109
2110
|
points: [],
|
|
2110
2111
|
mean: null
|
|
2111
2112
|
}));
|
|
2112
2113
|
return e.forEach((a) => {
|
|
2113
|
-
let
|
|
2114
|
-
t.forEach((
|
|
2115
|
-
const
|
|
2116
|
-
(typeof
|
|
2117
|
-
}), r[
|
|
2114
|
+
let i = 1e4, o = 0;
|
|
2115
|
+
t.forEach((n, l) => {
|
|
2116
|
+
const d = Tt(a, n);
|
|
2117
|
+
(typeof i > "u" || i > d) && (i = d, o = l);
|
|
2118
|
+
}), r[o].points.push(a);
|
|
2118
2119
|
}), r;
|
|
2119
|
-
},
|
|
2120
|
+
}, Fi = (e) => e?.length > 0 ? e.reduce((t, r) => [
|
|
2120
2121
|
r[0] + t[0],
|
|
2121
2122
|
r[1] + t[1],
|
|
2122
2123
|
r[2] + t[2]
|
|
@@ -2128,56 +2129,56 @@ var Qn = {
|
|
|
2128
2129
|
0,
|
|
2129
2130
|
0,
|
|
2130
2131
|
0
|
|
2131
|
-
],
|
|
2132
|
-
let r =
|
|
2132
|
+
], Yi = (e, t) => {
|
|
2133
|
+
let r = Dr(Zi(e, t));
|
|
2133
2134
|
const a = 10;
|
|
2134
|
-
for (let
|
|
2135
|
-
const
|
|
2136
|
-
if (
|
|
2137
|
-
r =
|
|
2135
|
+
for (let i = 0; i < a; i++) {
|
|
2136
|
+
const o = Bi(e, r).map((n) => n.points.length > 0 ? Fi(n.points) : null);
|
|
2137
|
+
if (o.every((n, l) => n && Tt(n, r[l]) < 1e-3)) break;
|
|
2138
|
+
r = o;
|
|
2138
2139
|
}
|
|
2139
2140
|
return r;
|
|
2140
|
-
},
|
|
2141
|
+
}, Zi = (e, t) => {
|
|
2141
2142
|
const r = [e[Math.floor(Math.random() * e.length)]];
|
|
2142
2143
|
for (; r.length < t; ) {
|
|
2143
|
-
const a = e.map((
|
|
2144
|
-
let
|
|
2145
|
-
const
|
|
2146
|
-
for (let
|
|
2147
|
-
if (
|
|
2148
|
-
r.push(e[
|
|
2144
|
+
const a = e.map((d) => Math.min(...r.map((c) => Tt(d, c)))), i = a.reduce((d, c) => d + c, 0), o = a.map((d) => d / i);
|
|
2145
|
+
let n = 0;
|
|
2146
|
+
const l = Math.random();
|
|
2147
|
+
for (let d = 0; d < o.length; d++)
|
|
2148
|
+
if (n += o[d], l < n) {
|
|
2149
|
+
r.push(e[d]);
|
|
2149
2150
|
break;
|
|
2150
2151
|
}
|
|
2151
2152
|
}
|
|
2152
2153
|
return r;
|
|
2153
|
-
},
|
|
2154
|
-
const t = e instanceof Blob || e instanceof File ? e : await fetch(e)?.then?.((
|
|
2155
|
-
return
|
|
2156
|
-
},
|
|
2157
|
-
const t = await
|
|
2154
|
+
}, Ui = async (e) => {
|
|
2155
|
+
const t = e instanceof Blob || e instanceof File ? e : await fetch(e)?.then?.((o) => o?.blob?.()), r = await createImageBitmap(t), a = new OffscreenCanvas(r.width, r.height), i = a.getContext("2d");
|
|
2156
|
+
return i.filter = "blur(16px)", i?.drawImage?.(r, 0, 0, a.width, a.height), a;
|
|
2157
|
+
}, Gi = async (e) => {
|
|
2158
|
+
const t = await Ui(e), r = new OffscreenCanvas(t.width * 0.125, t.height * 0.125), a = r.getContext("2d");
|
|
2158
2159
|
a?.drawImage?.(t, 0, 0, r.width, r.height);
|
|
2159
|
-
const
|
|
2160
|
+
const i = (a?.getImageData?.(0, 0, r.width, r.height, {
|
|
2160
2161
|
storageFormat: "float32",
|
|
2161
2162
|
pixelFormat: "rgba-float32",
|
|
2162
2163
|
colorSpace: "srgb"
|
|
2163
|
-
})).data,
|
|
2164
|
-
for (let
|
|
2165
|
-
const
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2164
|
+
})).data, o = r.width * r.height || 0, n = 1 / 255, l = [];
|
|
2165
|
+
for (let d = 0; d < o; d++) {
|
|
2166
|
+
const c = d * 4;
|
|
2167
|
+
l.push(i instanceof Float32Array || i instanceof Float16Array ? [
|
|
2168
|
+
i?.[c + 0] || 0,
|
|
2169
|
+
i?.[c + 1] || 0,
|
|
2170
|
+
i?.[c + 2] || 0
|
|
2170
2171
|
] : [
|
|
2171
|
-
(
|
|
2172
|
-
(
|
|
2173
|
-
(
|
|
2172
|
+
(i?.[c + 0] || 0) * n,
|
|
2173
|
+
(i?.[c + 1] || 0) * n,
|
|
2174
|
+
(i?.[c + 2] || 0) * n
|
|
2174
2175
|
]);
|
|
2175
2176
|
}
|
|
2176
|
-
return
|
|
2177
|
-
},
|
|
2178
|
-
const t = await
|
|
2179
|
-
return
|
|
2180
|
-
},
|
|
2177
|
+
return l;
|
|
2178
|
+
}, Ji = async (e) => {
|
|
2179
|
+
const t = await Gi(e);
|
|
2180
|
+
return Dr(Yi(t, 4), "h");
|
|
2181
|
+
}, Ki = "rs-wallpaper-theme", Vi = "rs-wallpaper-primary", Qi = "rs-wallpaper-theme-src", Xr = Ki, eo = Vi, sr = Qi, to = [
|
|
2181
2182
|
["--color-primary", "primary"],
|
|
2182
2183
|
["--color-secondary", "secondary"],
|
|
2183
2184
|
["--color-tertiary", "tertiary"],
|
|
@@ -2187,21 +2188,21 @@ var Qn = {
|
|
|
2187
2188
|
["--primary", "primary"],
|
|
2188
2189
|
["--secondary", "secondary"],
|
|
2189
2190
|
["--tertiary", "tertiary"]
|
|
2190
|
-
],
|
|
2191
|
+
], ro = (e) => {
|
|
2191
2192
|
const [t, r, a] = e;
|
|
2192
2193
|
if (![
|
|
2193
2194
|
t,
|
|
2194
2195
|
r,
|
|
2195
2196
|
a
|
|
2196
|
-
].every((
|
|
2197
|
-
const
|
|
2197
|
+
].every((n) => Number.isFinite(n))) return null;
|
|
2198
|
+
const i = Wr({
|
|
2198
2199
|
mode: "rgb",
|
|
2199
2200
|
r: t,
|
|
2200
2201
|
g: r,
|
|
2201
2202
|
b: a
|
|
2202
2203
|
});
|
|
2203
|
-
if (!
|
|
2204
|
-
const
|
|
2204
|
+
if (!i) return null;
|
|
2205
|
+
const o = ft({
|
|
2205
2206
|
mode: "rgb",
|
|
2206
2207
|
r: t,
|
|
2207
2208
|
g: r,
|
|
@@ -2209,864 +2210,94 @@ var Qn = {
|
|
|
2209
2210
|
});
|
|
2210
2211
|
return {
|
|
2211
2212
|
rgb: e,
|
|
2212
|
-
hex:
|
|
2213
|
-
l:
|
|
2214
|
-
c:
|
|
2215
|
-
h:
|
|
2213
|
+
hex: i,
|
|
2214
|
+
l: o?.l ?? 0.5,
|
|
2215
|
+
c: o?.c ?? 0,
|
|
2216
|
+
h: o?.h ?? 0
|
|
2216
2217
|
};
|
|
2217
|
-
},
|
|
2218
|
-
const t = e.map(
|
|
2218
|
+
}, ao = (e) => {
|
|
2219
|
+
const t = e.map(ro).filter(Boolean);
|
|
2219
2220
|
if (!t.length) return null;
|
|
2220
|
-
const r = t.filter((
|
|
2221
|
-
if (!
|
|
2222
|
-
const
|
|
2223
|
-
const
|
|
2224
|
-
return
|
|
2225
|
-
},
|
|
2226
|
-
const
|
|
2227
|
-
if (!
|
|
2228
|
-
const
|
|
2221
|
+
const r = t.filter((c) => c.l >= 0.18 && c.l <= 0.88 && c.c >= 0.02).sort((c, v) => v.c - c.c || Math.abs(v.l - 0.55) - Math.abs(c.l - 0.55)), a = r.length ? r : [...t].sort((c, v) => v.c - c.c), i = a[0];
|
|
2222
|
+
if (!i) return null;
|
|
2223
|
+
const o = (c, v) => {
|
|
2224
|
+
const f = Math.abs(c - v) % 360;
|
|
2225
|
+
return f > 180 ? 360 - f : f;
|
|
2226
|
+
}, n = (c) => {
|
|
2227
|
+
const v = a.filter((f) => !c.includes(f));
|
|
2228
|
+
if (!v.length) {
|
|
2229
|
+
const f = c[c.length - 1] ?? i, p = Wr({
|
|
2229
2230
|
mode: "oklch",
|
|
2230
|
-
l: Math.min(0.85, Math.max(0.2,
|
|
2231
|
-
c: Math.max(0.04,
|
|
2232
|
-
h:
|
|
2231
|
+
l: Math.min(0.85, Math.max(0.2, f.l + (c.length === 1 ? -0.12 : 0.1))),
|
|
2232
|
+
c: Math.max(0.04, f.c * 0.85),
|
|
2233
|
+
h: f.h
|
|
2233
2234
|
});
|
|
2234
2235
|
return {
|
|
2235
|
-
...
|
|
2236
|
-
hex:
|
|
2237
|
-
l:
|
|
2236
|
+
...f,
|
|
2237
|
+
hex: p || f.hex,
|
|
2238
|
+
l: f.l
|
|
2238
2239
|
};
|
|
2239
2240
|
}
|
|
2240
|
-
return [...
|
|
2241
|
-
},
|
|
2241
|
+
return [...v].sort((f, p) => Math.min(...c.map((b) => o(p.h, b.h))) - Math.min(...c.map((b) => o(f.h, b.h))) || p.c - f.c)[0] ?? v[0];
|
|
2242
|
+
}, l = n([i]), d = n([i, l]);
|
|
2242
2243
|
return {
|
|
2243
|
-
primary:
|
|
2244
|
-
secondary:
|
|
2245
|
-
tertiary:
|
|
2244
|
+
primary: i.hex,
|
|
2245
|
+
secondary: l.hex,
|
|
2246
|
+
tertiary: d.hex
|
|
2246
2247
|
};
|
|
2247
|
-
},
|
|
2248
|
+
}, io = () => {
|
|
2248
2249
|
const e = /* @__PURE__ */ new Set();
|
|
2249
2250
|
return e.add(document.documentElement), document.querySelectorAll(".env-shell-root, .wf-demo-root, ui-window").forEach((t) => e.add(t)), [...e];
|
|
2250
|
-
},
|
|
2251
|
-
for (const t of
|
|
2251
|
+
}, de = (e) => {
|
|
2252
|
+
for (const t of io()) for (const [r, a] of to) t.style.setProperty(r, e[a]);
|
|
2252
2253
|
document.querySelectorAll(".view-explorer, [data-view='explorer'], .view-viewer, [data-view='viewer'], .view-settings, [data-view='settings']").forEach((t) => {
|
|
2253
2254
|
t.style.setProperty("--color-primary", e.primary), t.style.setProperty("--base-color", e.primary), t.style.setProperty("--color-secondary", e.secondary), t.style.setProperty("--color-tertiary", e.tertiary);
|
|
2254
2255
|
});
|
|
2255
2256
|
try {
|
|
2256
|
-
localStorage.setItem(
|
|
2257
|
+
localStorage.setItem(Xr, JSON.stringify(e)), localStorage.setItem(eo, e.primary);
|
|
2257
2258
|
} catch {
|
|
2258
2259
|
}
|
|
2259
2260
|
document.dispatchEvent(new CustomEvent("u2-theme-change", { detail: {
|
|
2260
2261
|
source: "wallpaper",
|
|
2261
2262
|
seeds: e
|
|
2262
2263
|
} }));
|
|
2263
|
-
},
|
|
2264
|
+
}, pt = () => {
|
|
2264
2265
|
try {
|
|
2265
|
-
const e = localStorage.getItem(
|
|
2266
|
+
const e = localStorage.getItem(Xr);
|
|
2266
2267
|
if (!e) return null;
|
|
2267
2268
|
const t = JSON.parse(e);
|
|
2268
2269
|
return !t?.primary || !t?.secondary || !t?.tertiary ? null : t;
|
|
2269
2270
|
} catch {
|
|
2270
2271
|
return null;
|
|
2271
2272
|
}
|
|
2272
|
-
},
|
|
2273
|
+
}, ge = async (e, t) => {
|
|
2273
2274
|
const r = typeof e == "string" ? e.slice(0, 2048) : `blob:${e.name || "wallpaper"}:${e.size}`;
|
|
2274
2275
|
if (!t?.force) try {
|
|
2275
|
-
if (localStorage.getItem(
|
|
2276
|
-
const a =
|
|
2276
|
+
if (localStorage.getItem(sr) === r) {
|
|
2277
|
+
const a = pt();
|
|
2277
2278
|
if (a)
|
|
2278
|
-
return
|
|
2279
|
+
return de(a), a;
|
|
2279
2280
|
}
|
|
2280
2281
|
} catch {
|
|
2281
2282
|
}
|
|
2282
2283
|
try {
|
|
2283
|
-
const a = await
|
|
2284
|
-
if (!
|
|
2285
|
-
|
|
2284
|
+
const a = await Ji(e), i = ao(a);
|
|
2285
|
+
if (!i) return null;
|
|
2286
|
+
de(i);
|
|
2286
2287
|
try {
|
|
2287
|
-
localStorage.setItem(
|
|
2288
|
+
localStorage.setItem(sr, r);
|
|
2288
2289
|
} catch {
|
|
2289
2290
|
}
|
|
2290
|
-
return
|
|
2291
|
+
return i;
|
|
2291
2292
|
} catch (a) {
|
|
2292
2293
|
console.warn("[fest/image] applyThemeFromWallpaper failed", a);
|
|
2293
|
-
const
|
|
2294
|
-
return
|
|
2295
|
-
}
|
|
2296
|
-
}, Ri = () => {
|
|
2297
|
-
const e = Rt();
|
|
2298
|
-
return e && Me(e), e;
|
|
2299
|
-
}, Ii = /* @__PURE__ */ Symbol.for("dom.ts@__registeredCssProperties"), Rr = globalThis[Ii] ??= /* @__PURE__ */ new Set();
|
|
2300
|
-
[
|
|
2301
|
-
{
|
|
2302
|
-
name: "--screen-width",
|
|
2303
|
-
syntax: "<length-percentage>",
|
|
2304
|
-
inherits: !0,
|
|
2305
|
-
initialValue: "0px"
|
|
2306
|
-
},
|
|
2307
|
-
{
|
|
2308
|
-
name: "--screen-height",
|
|
2309
|
-
syntax: "<length-percentage>",
|
|
2310
|
-
inherits: !0,
|
|
2311
|
-
initialValue: "0px"
|
|
2312
|
-
},
|
|
2313
|
-
{
|
|
2314
|
-
name: "--visual-width",
|
|
2315
|
-
syntax: "<length-percentage>",
|
|
2316
|
-
inherits: !0,
|
|
2317
|
-
initialValue: "0px"
|
|
2318
|
-
},
|
|
2319
|
-
{
|
|
2320
|
-
name: "--visual-height",
|
|
2321
|
-
syntax: "<length-percentage>",
|
|
2322
|
-
inherits: !0,
|
|
2323
|
-
initialValue: "0px"
|
|
2324
|
-
},
|
|
2325
|
-
{
|
|
2326
|
-
name: "--clip-ampl",
|
|
2327
|
-
syntax: "<number>",
|
|
2328
|
-
inherits: !0,
|
|
2329
|
-
initialValue: "0"
|
|
2330
|
-
},
|
|
2331
|
-
{
|
|
2332
|
-
name: "--clip-freq",
|
|
2333
|
-
syntax: "<number>",
|
|
2334
|
-
inherits: !0,
|
|
2335
|
-
initialValue: "0"
|
|
2336
|
-
},
|
|
2337
|
-
{
|
|
2338
|
-
name: "--avail-width",
|
|
2339
|
-
syntax: "<length-percentage>",
|
|
2340
|
-
inherits: !0,
|
|
2341
|
-
initialValue: "0px"
|
|
2342
|
-
},
|
|
2343
|
-
{
|
|
2344
|
-
name: "--avail-height",
|
|
2345
|
-
syntax: "<length-percentage>",
|
|
2346
|
-
inherits: !0,
|
|
2347
|
-
initialValue: "0px"
|
|
2348
|
-
},
|
|
2349
|
-
{
|
|
2350
|
-
name: "--pixel-ratio",
|
|
2351
|
-
syntax: "<number>",
|
|
2352
|
-
inherits: !0,
|
|
2353
|
-
initialValue: "1"
|
|
2354
|
-
},
|
|
2355
|
-
{
|
|
2356
|
-
name: "--percent",
|
|
2357
|
-
syntax: "<number>",
|
|
2358
|
-
inherits: !0,
|
|
2359
|
-
initialValue: "0"
|
|
2360
|
-
},
|
|
2361
|
-
{
|
|
2362
|
-
name: "--percent-x",
|
|
2363
|
-
syntax: "<number>",
|
|
2364
|
-
inherits: !0,
|
|
2365
|
-
initialValue: "0"
|
|
2366
|
-
},
|
|
2367
|
-
{
|
|
2368
|
-
name: "--percent-y",
|
|
2369
|
-
syntax: "<number>",
|
|
2370
|
-
inherits: !0,
|
|
2371
|
-
initialValue: "0"
|
|
2372
|
-
},
|
|
2373
|
-
{
|
|
2374
|
-
name: "--scroll-left",
|
|
2375
|
-
syntax: "<number>",
|
|
2376
|
-
inherits: !0,
|
|
2377
|
-
initialValue: "0"
|
|
2378
|
-
},
|
|
2379
|
-
{
|
|
2380
|
-
name: "--scroll-top",
|
|
2381
|
-
syntax: "<number>",
|
|
2382
|
-
inherits: !0,
|
|
2383
|
-
initialValue: "0"
|
|
2384
|
-
},
|
|
2385
|
-
{
|
|
2386
|
-
name: "--drag-x",
|
|
2387
|
-
syntax: "<length>",
|
|
2388
|
-
inherits: !1,
|
|
2389
|
-
initialValue: "0px"
|
|
2390
|
-
},
|
|
2391
|
-
{
|
|
2392
|
-
name: "--drag-y",
|
|
2393
|
-
syntax: "<length>",
|
|
2394
|
-
inherits: !1,
|
|
2395
|
-
initialValue: "0px"
|
|
2396
|
-
},
|
|
2397
|
-
{
|
|
2398
|
-
name: "--grid-r",
|
|
2399
|
-
syntax: "<number>",
|
|
2400
|
-
inherits: !1,
|
|
2401
|
-
initialValue: "0"
|
|
2402
|
-
},
|
|
2403
|
-
{
|
|
2404
|
-
name: "--grid-c",
|
|
2405
|
-
syntax: "<number>",
|
|
2406
|
-
inherits: !1,
|
|
2407
|
-
initialValue: "0"
|
|
2408
|
-
},
|
|
2409
|
-
{
|
|
2410
|
-
name: "--resize-x",
|
|
2411
|
-
syntax: "<length>",
|
|
2412
|
-
inherits: !1,
|
|
2413
|
-
initialValue: "0px"
|
|
2414
|
-
},
|
|
2415
|
-
{
|
|
2416
|
-
name: "--resize-y",
|
|
2417
|
-
syntax: "<length>",
|
|
2418
|
-
inherits: !1,
|
|
2419
|
-
initialValue: "0px"
|
|
2420
|
-
},
|
|
2421
|
-
{
|
|
2422
|
-
name: "--shift-x",
|
|
2423
|
-
syntax: "<length>",
|
|
2424
|
-
inherits: !1,
|
|
2425
|
-
initialValue: "0px"
|
|
2426
|
-
},
|
|
2427
|
-
{
|
|
2428
|
-
name: "--shift-y",
|
|
2429
|
-
syntax: "<length>",
|
|
2430
|
-
inherits: !1,
|
|
2431
|
-
initialValue: "0px"
|
|
2432
|
-
},
|
|
2433
|
-
{
|
|
2434
|
-
name: "--cs-grid-r",
|
|
2435
|
-
syntax: "<number>",
|
|
2436
|
-
inherits: !1,
|
|
2437
|
-
initialValue: "0"
|
|
2438
|
-
},
|
|
2439
|
-
{
|
|
2440
|
-
name: "--cs-grid-c",
|
|
2441
|
-
syntax: "<number>",
|
|
2442
|
-
inherits: !1,
|
|
2443
|
-
initialValue: "0"
|
|
2444
|
-
},
|
|
2445
|
-
{
|
|
2446
|
-
name: "--cs-p-grid-r",
|
|
2447
|
-
syntax: "<number>",
|
|
2448
|
-
inherits: !1,
|
|
2449
|
-
initialValue: "0"
|
|
2450
|
-
},
|
|
2451
|
-
{
|
|
2452
|
-
name: "--cs-p-grid-c",
|
|
2453
|
-
syntax: "<number>",
|
|
2454
|
-
inherits: !1,
|
|
2455
|
-
initialValue: "0"
|
|
2456
|
-
},
|
|
2457
|
-
{
|
|
2458
|
-
name: "--os-grid-r",
|
|
2459
|
-
syntax: "<number>",
|
|
2460
|
-
inherits: !1,
|
|
2461
|
-
initialValue: "0"
|
|
2462
|
-
},
|
|
2463
|
-
{
|
|
2464
|
-
name: "--os-grid-c",
|
|
2465
|
-
syntax: "<number>",
|
|
2466
|
-
inherits: !1,
|
|
2467
|
-
initialValue: "0"
|
|
2468
|
-
},
|
|
2469
|
-
{
|
|
2470
|
-
name: "--rv-grid-r",
|
|
2471
|
-
syntax: "<number>",
|
|
2472
|
-
inherits: !1,
|
|
2473
|
-
initialValue: "0"
|
|
2474
|
-
},
|
|
2475
|
-
{
|
|
2476
|
-
name: "--rv-grid-c",
|
|
2477
|
-
syntax: "<number>",
|
|
2478
|
-
inherits: !1,
|
|
2479
|
-
initialValue: "0"
|
|
2480
|
-
},
|
|
2481
|
-
{
|
|
2482
|
-
name: "--cell-x",
|
|
2483
|
-
syntax: "<integer>",
|
|
2484
|
-
inherits: !1,
|
|
2485
|
-
initialValue: "0"
|
|
2486
|
-
},
|
|
2487
|
-
{
|
|
2488
|
-
name: "--cell-y",
|
|
2489
|
-
syntax: "<integer>",
|
|
2490
|
-
inherits: !1,
|
|
2491
|
-
initialValue: "0"
|
|
2492
|
-
}
|
|
2493
|
-
].forEach((e) => {
|
|
2494
|
-
if (typeof CSS > "u" || typeof CSS?.registerProperty != "function") return;
|
|
2495
|
-
const t = String(e?.name || "").trim();
|
|
2496
|
-
if (!(!t || Rr.has(t)))
|
|
2497
|
-
try {
|
|
2498
|
-
CSS.registerProperty(e);
|
|
2499
|
-
} catch (r) {
|
|
2500
|
-
String(r?.name || "").toLowerCase() !== "invalidmodificationerror" && console.warn(r);
|
|
2501
|
-
} finally {
|
|
2502
|
-
Rr.add(t);
|
|
2503
|
-
}
|
|
2504
|
-
});
|
|
2505
|
-
function ji() {
|
|
2506
|
-
const e = globalThis;
|
|
2507
|
-
if (typeof e.HTMLElement == "function") return;
|
|
2508
|
-
const t = class {
|
|
2509
|
-
}, r = (a) => {
|
|
2510
|
-
typeof e[a] != "function" && (e[a] = t);
|
|
2511
|
-
};
|
|
2512
|
-
r("EventTarget"), r("Node"), r("Element"), r("HTMLElement"), r("SVGElement"), r("Text"), r("Comment"), r("DocumentFragment"), r("ShadowRoot"), r("HTMLDocument"), r("Document"), r("HTMLBodyElement"), r("HTMLHeadElement"), r("HTMLCanvasElement"), r("HTMLInputElement"), r("HTMLLinkElement"), r("HTMLStyleElement"), r("HTMLPreElement"), r("HTMLDivElement"), r("CSSStyleRule"), r("CSSLayerBlockRule");
|
|
2513
|
-
}
|
|
2514
|
-
var Hi = (e, t = "value") => (typeof e == "object" || typeof e == "function") && e != null && (t in e || e?.[t] != null), ma = (e) => Hi(e, "value"), ga = (e) => e && e?.replace?.(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), ba = (e) => {
|
|
2515
|
-
if (typeof e != "string") return null;
|
|
2516
|
-
const t = [...e?.matchAll?.(/^\d+(\.\d+)?$/g)];
|
|
2517
|
-
if (t?.length != 1) return null;
|
|
2518
|
-
const r = parseFloat(t[0][0]);
|
|
2519
|
-
return !Number.isNaN(r) && Number.isFinite(r) ? r : null;
|
|
2520
|
-
};
|
|
2521
|
-
ji();
|
|
2522
|
-
var Oi = () => {
|
|
2523
|
-
const e = {
|
|
2524
|
-
canceled: !1,
|
|
2525
|
-
rAFs: /* @__PURE__ */ new Set(),
|
|
2526
|
-
last: null,
|
|
2527
|
-
cancel() {
|
|
2528
|
-
return this.canceled = !0, cancelAnimationFrame(this.last), this;
|
|
2529
|
-
},
|
|
2530
|
-
shedule(t) {
|
|
2531
|
-
return this.rAFs.add(t), this;
|
|
2532
|
-
}
|
|
2533
|
-
};
|
|
2534
|
-
return (async () => {
|
|
2535
|
-
for (; !e?.canceled; )
|
|
2536
|
-
await Promise.all((e?.rAFs?.values?.() ?? [])?.map?.((t) => Promise.try(t)?.catch?.(console.warn.bind(console)))), e.rAFs?.clear?.(), typeof requestAnimationFrame < "u" ? await new Promise((t) => {
|
|
2537
|
-
e.last = requestAnimationFrame(t);
|
|
2538
|
-
}) : await new Promise((t) => {
|
|
2539
|
-
setTimeout(t, 16);
|
|
2540
|
-
});
|
|
2541
|
-
})(), e;
|
|
2542
|
-
}, Es = typeof document < "u" ? document?.documentElement : null, Wi = /* @__PURE__ */ new Map();
|
|
2543
|
-
typeof requestAnimationFrame < "u" && requestAnimationFrame(async () => {
|
|
2544
|
-
for (; ; )
|
|
2545
|
-
Wi.forEach((e) => e?.()), await new Promise((e) => requestAnimationFrame(e));
|
|
2546
|
-
});
|
|
2547
|
-
var qi = {};
|
|
2548
|
-
function w(e, t, r, a = qi) {
|
|
2549
|
-
e?.addEventListener?.(t, r, a);
|
|
2550
|
-
const n = typeof e == "object" || typeof e == "function" && !e?.deref ? new WeakRef(e) : e;
|
|
2551
|
-
return () => n?.deref?.()?.removeEventListener?.(t, r, a);
|
|
2552
|
-
}
|
|
2553
|
-
var Vi = /* @__PURE__ */ Symbol.for("dom.ts@zoomValues"), Ts = globalThis[Vi] ??= /* @__PURE__ */ new WeakMap(), Di = (e, t = 100) => typeof globalThis.requestIdleCallback == "function" ? globalThis.requestIdleCallback(e, { timeout: t }) : setTimeout(() => e({
|
|
2554
|
-
didTimeout: !1,
|
|
2555
|
-
timeRemaining: () => 0
|
|
2556
|
-
}), 0), ya = () => {
|
|
2557
|
-
const e = typeof matchMedia < "u" ? matchMedia("(orientation: landscape)")?.matches : !1, t = typeof window < "u" ? window.visualViewport : null, r = t ? {
|
|
2558
|
-
"--vv-width": `${t.width}px`,
|
|
2559
|
-
"--vv-height": `${t.height}px`,
|
|
2560
|
-
"--vv-offset-left": `${t.offsetLeft}px`,
|
|
2561
|
-
"--vv-offset-top": `${t.offsetTop}px`,
|
|
2562
|
-
"--vv-scale": String(t.scale ?? 1)
|
|
2563
|
-
} : {
|
|
2564
|
-
"--vv-width": typeof window < "u" ? `${window.innerWidth}px` : "0px",
|
|
2565
|
-
"--vv-height": typeof window < "u" ? `${window.innerHeight}px` : "0px",
|
|
2566
|
-
"--vv-offset-left": "0px",
|
|
2567
|
-
"--vv-offset-top": "0px",
|
|
2568
|
-
"--vv-scale": "1"
|
|
2569
|
-
};
|
|
2570
|
-
if (typeof screen < "u") {
|
|
2571
|
-
const a = screen?.availWidth + "px", n = screen?.availHeight + "px";
|
|
2572
|
-
return {
|
|
2573
|
-
"--screen-width": Math.min(screen?.width, screen?.availWidth) + "px",
|
|
2574
|
-
"--screen-height": Math.min(screen?.height, screen?.availHeight) + "px",
|
|
2575
|
-
"--avail-width": e ? n : a,
|
|
2576
|
-
"--avail-height": e ? a : n,
|
|
2577
|
-
"--view-height": Math.min(screen?.availHeight, window?.innerHeight) + "px",
|
|
2578
|
-
"--pixel-ratio": String(devicePixelRatio || 1),
|
|
2579
|
-
...r
|
|
2580
|
-
};
|
|
2294
|
+
const i = pt();
|
|
2295
|
+
return i ? (de(i), i) : null;
|
|
2581
2296
|
}
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
"--avail-height": "0px",
|
|
2587
|
-
"--view-height": "0px",
|
|
2588
|
-
"--pixel-ratio": "1",
|
|
2589
|
-
...r
|
|
2590
|
-
};
|
|
2591
|
-
}, Ir = ya(), Fi = {
|
|
2592
|
-
"portrait-primary": 0,
|
|
2593
|
-
"landscape-primary": 1,
|
|
2594
|
-
"portrait-secondary": 2,
|
|
2595
|
-
"landscape-secondary": 3
|
|
2596
|
-
}, Bi = (e) => {
|
|
2597
|
-
const t = document.documentElement;
|
|
2598
|
-
Object.assign(Ir, ya()), Object.entries(Ir).forEach(([r, a]) => {
|
|
2599
|
-
const n = t?.style?.getPropertyValue(r);
|
|
2600
|
-
(!n || n != a) && t?.style?.setProperty?.(r, a || "", "");
|
|
2601
|
-
}), document.documentElement.style.setProperty("--orientation-secondary", screen?.orientation?.type?.endsWith?.("secondary") ? "1" : "0");
|
|
2602
|
-
}, Xi = () => {
|
|
2603
|
-
let e = screen?.orientation?.type || "portrait-primary";
|
|
2604
|
-
return globalThis.matchMedia("((display-mode: fullscreen) or (display-mode: standalone) or (display-mode: window-controls-overlay))").matches || (matchMedia("(orientation: portrait)").matches ? e = e.replace("landscape", "portrait") : matchMedia("(orientation: landscape)").matches && (e = e.replace("portrait", "landscape"))), e;
|
|
2605
|
-
}, xt = { passive: !0 }, Yi = (e) => {
|
|
2606
|
-
let t = !1;
|
|
2607
|
-
const r = () => {
|
|
2608
|
-
t || (requestAnimationFrame(() => {
|
|
2609
|
-
Bi(), e(), t = !1;
|
|
2610
|
-
}), t = !0);
|
|
2611
|
-
}, a = [];
|
|
2612
|
-
return a.push(w(navigator?.virtualKeyboard, "geometrychange", r, xt)), a.push(w(window?.visualViewport, "scroll", r, xt)), a.push(w(window?.visualViewport, "resize", r, xt)), a.push(w(screen?.orientation, "change", r)), a.push(w(window, "resize", r)), a.push(w(document?.documentElement, "fullscreenchange", r)), a.push(w(document, "DOMContentLoaded", r)), a.push(w(matchMedia("(orientation: portrait)"), "change", r)), a.push(w(matchMedia("(orientation: landscape)"), "change", r)), r(), Di(() => r(), 100), () => a.forEach((n) => n());
|
|
2613
|
-
}, zs = new OffscreenCanvas(1, 1).getContext("2d"), Ui = /* @__PURE__ */ Symbol.for("dom.ts@onBorderObserve"), _s = globalThis[Ui] ??= /* @__PURE__ */ new WeakMap(), Zi = /* @__PURE__ */ Symbol.for("dom.ts@onContentObserve"), Ps = globalThis[Zi] ??= /* @__PURE__ */ new WeakMap(), Ma = (e) => (typeof e?.current == "object" && (e = e?.element ?? e?.current ?? (typeof e?.self == "object" ? e?.self : null) ?? e), e), Ji = (e, t, r, a) => {
|
|
2614
|
-
const n = new Set([...r.split(",") || [r]].map((o) => o.trim())), i = new MutationObserver((o, s) => {
|
|
2615
|
-
for (const l of o) if (l.type == "childList") {
|
|
2616
|
-
const d = Array.from(l.addedNodes) || [], p = Array.from(l.removedNodes) || [];
|
|
2617
|
-
d.push(...Array.from(l.addedNodes || []).flatMap((v) => Array.from(v?.querySelectorAll?.(t) || []))), p.push(...Array.from(l.removedNodes || []).flatMap((v) => Array.from(v?.querySelectorAll?.(t) || []))), [...new Set(d)].filter((v) => v?.matches?.(t))?.map?.((v) => {
|
|
2618
|
-
n.forEach((c) => {
|
|
2619
|
-
a({
|
|
2620
|
-
target: v,
|
|
2621
|
-
type: "attributes",
|
|
2622
|
-
attributeName: c,
|
|
2623
|
-
oldValue: v?.getAttribute?.(c)
|
|
2624
|
-
}, s);
|
|
2625
|
-
});
|
|
2626
|
-
});
|
|
2627
|
-
} else l.target?.matches?.(t) && l.attributeName && n.has(l.attributeName) && a(l, s);
|
|
2628
|
-
});
|
|
2629
|
-
return i.observe(e = Ma(e), {
|
|
2630
|
-
attributeOldValue: !0,
|
|
2631
|
-
attributes: !0,
|
|
2632
|
-
attributeFilter: [...n],
|
|
2633
|
-
childList: !0,
|
|
2634
|
-
subtree: !0,
|
|
2635
|
-
characterData: !0
|
|
2636
|
-
}), [...e.querySelectorAll(t)].map((o) => n.forEach((s) => a({
|
|
2637
|
-
target: o,
|
|
2638
|
-
type: "attributes",
|
|
2639
|
-
attributeName: s,
|
|
2640
|
-
oldValue: o?.getAttribute?.(s)
|
|
2641
|
-
}, i))), i;
|
|
2642
|
-
}, Gi = (e, t = "*", r = (a, n) => {
|
|
2643
|
-
}) => {
|
|
2644
|
-
const a = (c) => {
|
|
2645
|
-
const m = Array.from(c || []) || [];
|
|
2646
|
-
return m.push(...Array.from(c || []).flatMap((f) => Array.from(f?.querySelectorAll?.(t) || []))), [...Array.from(new Set(m).values())].filter((f) => f?.matches?.(t));
|
|
2647
|
-
}, n = (c) => {
|
|
2648
|
-
const m = p?.deref?.(), f = a(c.addedNodes), b = a(c.removedNodes);
|
|
2649
|
-
(f.length > 0 || b.length > 0) && r?.({
|
|
2650
|
-
type: c.type,
|
|
2651
|
-
target: c.target,
|
|
2652
|
-
attributeName: c.attributeName,
|
|
2653
|
-
attributeNamespace: c.attributeNamespace,
|
|
2654
|
-
nextSibling: c.nextSibling,
|
|
2655
|
-
oldValue: c.oldValue,
|
|
2656
|
-
previousSibling: c.previousSibling,
|
|
2657
|
-
addedNodes: f,
|
|
2658
|
-
removedNodes: b
|
|
2659
|
-
}, m);
|
|
2660
|
-
}, i = (c) => {
|
|
2661
|
-
n({
|
|
2662
|
-
addedNodes: [c?.target].filter((m) => !!m),
|
|
2663
|
-
removedNodes: [c?.relatedTarget].filter((m) => !!m),
|
|
2664
|
-
type: "childList",
|
|
2665
|
-
target: c?.currentTarget
|
|
2666
|
-
});
|
|
2667
|
-
}, o = (c) => {
|
|
2668
|
-
n({
|
|
2669
|
-
addedNodes: [c?.relatedTarget].filter((m) => !!m),
|
|
2670
|
-
removedNodes: [c?.target].filter((m) => !!m),
|
|
2671
|
-
type: "childList",
|
|
2672
|
-
target: c?.currentTarget
|
|
2673
|
-
});
|
|
2674
|
-
}, s = (c) => {
|
|
2675
|
-
n({
|
|
2676
|
-
addedNodes: [c?.target].filter((m) => !!m),
|
|
2677
|
-
removedNodes: [c?.relatedTarget || document?.activeElement].filter((m) => !!m),
|
|
2678
|
-
type: "childList",
|
|
2679
|
-
target: c?.currentTarget
|
|
2680
|
-
});
|
|
2681
|
-
}, l = {
|
|
2682
|
-
passive: !0,
|
|
2683
|
-
capture: !1
|
|
2684
|
-
};
|
|
2685
|
-
if (t?.includes?.(":hover") && t?.includes?.(":active"))
|
|
2686
|
-
return e.addEventListener("pointerover", i, l), e.addEventListener("pointerout", o, l), e.addEventListener("pointerdown", i, l), e.addEventListener("pointerup", o, l), e.addEventListener("pointercancel", o, l), { disconnect: () => {
|
|
2687
|
-
e.removeEventListener("pointerover", i, l), e.removeEventListener("pointerout", o, l), e.removeEventListener("pointerdown", i, l), e.removeEventListener("pointerup", o, l), e.removeEventListener("pointercancel", o, l);
|
|
2688
|
-
} };
|
|
2689
|
-
if (t?.includes?.(":hover"))
|
|
2690
|
-
return e.addEventListener("pointerover", i, l), e.addEventListener("pointerout", o, l), { disconnect: () => {
|
|
2691
|
-
e.removeEventListener("pointerover", i, l), e.removeEventListener("pointerout", o, l);
|
|
2692
|
-
} };
|
|
2693
|
-
if (t?.includes?.(":active"))
|
|
2694
|
-
return e.addEventListener("pointerdown", i, l), e.addEventListener("pointerup", o, l), e.addEventListener("pointercancel", o, l), { disconnect: () => {
|
|
2695
|
-
e.removeEventListener("pointerdown", i, l), e.removeEventListener("pointerup", o, l), e.removeEventListener("pointercancel", o, l);
|
|
2696
|
-
} };
|
|
2697
|
-
if (t?.includes?.(":focus") && t?.includes?.(":focus-within") && t?.includes?.(":focus-visible"))
|
|
2698
|
-
return e.addEventListener("focusin", i, l), e.addEventListener("focusout", o, l), e.addEventListener("click", s, l), { disconnect: () => {
|
|
2699
|
-
e.removeEventListener("focusin", i, l), e.removeEventListener("focusout", o, l), e.removeEventListener("click", s, l);
|
|
2700
|
-
} };
|
|
2701
|
-
const d = new MutationObserver((c, m) => {
|
|
2702
|
-
for (const f of c) f.type == "childList" && n(f);
|
|
2703
|
-
}), p = new WeakRef(d);
|
|
2704
|
-
(e?.element ?? e) instanceof Node && d.observe(e = Ma(e), {
|
|
2705
|
-
childList: !0,
|
|
2706
|
-
subtree: !0
|
|
2707
|
-
});
|
|
2708
|
-
const v = Array.from(e.querySelectorAll(t));
|
|
2709
|
-
return v.length > 0 && r?.({
|
|
2710
|
-
addedNodes: v,
|
|
2711
|
-
removedNodes: []
|
|
2712
|
-
}, d), d;
|
|
2713
|
-
}, Ki = "DOM", St = typeof document < "u" ? document.createElement("style") : null;
|
|
2714
|
-
St && (typeof document < "u" && document.querySelector("head")?.appendChild?.(St), St.dataset.owner = Ki);
|
|
2715
|
-
var Xe = typeof CSSStyleValue < "u" && typeof CSSUnitValue < "u", U = (e) => Xe && e instanceof CSSStyleValue, X = (e) => Xe && e instanceof CSSUnitValue, R = (e, t, r, a = "") => {
|
|
2716
|
-
if (!(!e || !t)) {
|
|
2717
|
-
if (r == null) {
|
|
2718
|
-
e.getPropertyValue(t) !== "" && e.removeProperty(t);
|
|
2719
|
-
return;
|
|
2720
|
-
}
|
|
2721
|
-
e.getPropertyValue(t) !== r && e.setProperty(t, r, a);
|
|
2722
|
-
}
|
|
2723
|
-
}, Qi = (e, t, r, a = "") => {
|
|
2724
|
-
if (!e || !t) return e;
|
|
2725
|
-
const n = ga(t), i = e.style, o = e.attributeStyleMap ?? e.styleMap;
|
|
2726
|
-
if (!Xe || !o) return wa(e, t, r, a);
|
|
2727
|
-
let s = ma(r) && !(U(r) || X(r)) ? r?.value : r;
|
|
2728
|
-
if (s == null)
|
|
2729
|
-
return o.delete?.(n), i && R(i, n, null, a), e;
|
|
2730
|
-
if (U(s)) {
|
|
2731
|
-
const l = o.get(n);
|
|
2732
|
-
if (X(s) && X(l)) {
|
|
2733
|
-
if (l.value === s.value && l.unit === s.unit) return e;
|
|
2734
|
-
} else if (l === s) return e;
|
|
2735
|
-
return o.set(n, s), e;
|
|
2736
|
-
}
|
|
2737
|
-
if (typeof s == "number") if (CSS?.number && !n.startsWith("--")) {
|
|
2738
|
-
const l = CSS.number(s), d = o.get(n);
|
|
2739
|
-
return X(d) && d.value === l.value && d.unit === l.unit || o.set(n, l), e;
|
|
2740
|
-
} else
|
|
2741
|
-
return R(i, n, String(s), a), e;
|
|
2742
|
-
if (typeof s == "string" && !U(s)) {
|
|
2743
|
-
const l = ba(s);
|
|
2744
|
-
if (typeof l == "number" && CSS?.number && !n.startsWith("--")) {
|
|
2745
|
-
const d = CSS.number(l), p = o.get(n);
|
|
2746
|
-
return X(p) && p.value === d.value && p.unit === d.unit || o.set(n, d), e;
|
|
2747
|
-
} else
|
|
2748
|
-
return R(i, n, s, a), e;
|
|
2749
|
-
}
|
|
2750
|
-
return R(i, n, String(s), a), e;
|
|
2751
|
-
}, wa = (e, t, r, a = "") => {
|
|
2752
|
-
if (!e || !t) return e;
|
|
2753
|
-
const n = ga(t), i = e.style;
|
|
2754
|
-
if (!i) return e;
|
|
2755
|
-
let o = ma(r) && !(U(r) || X(r)) ? r?.value : r;
|
|
2756
|
-
return typeof o == "string" && !U(o) && (o = ba(o) ?? o), o == null ? (R(i, n, null, a), e) : (U(o) || typeof o == "number", R(i, n, String(o), a), e);
|
|
2757
|
-
}, eo = /* @__PURE__ */ Symbol.for("dom.ts@blobURLMap"), $s = globalThis[eo] ??= /* @__PURE__ */ new WeakMap(), to = /* @__PURE__ */ Symbol.for("dom.ts@cacheMap"), Cs = globalThis[to] ??= /* @__PURE__ */ new Map(), ro = /* @__PURE__ */ Symbol.for("dom.ts@adoptedSelectorMap"), As = globalThis[ro] ??= /* @__PURE__ */ new Map(), ao = /* @__PURE__ */ Symbol.for("dom.ts@adoptedShadowSelectorMap"), Ls = globalThis[ao] ??= /* @__PURE__ */ new WeakMap(), no = /* @__PURE__ */ Symbol.for("dom.ts@adoptedLayerMap"), Ns = globalThis[no] ??= /* @__PURE__ */ new Map(), io = /* @__PURE__ */ Symbol.for("dom.ts@adoptedShadowLayerMap"), Rs = globalThis[io] ??= /* @__PURE__ */ new WeakMap(), ge = (e, t, r, a = "") => Xe ? Qi(e, t, r, a) : wa(e, t, r, a), oo = /* @__PURE__ */ Symbol.for("dom.ts@adoptedMap"), Is = globalThis[oo] ??= /* @__PURE__ */ new Map(), so = /* @__PURE__ */ Symbol.for("dom.ts@adoptedBlobMap"), js = globalThis[so] ??= /* @__PURE__ */ new WeakMap(), lo = /* @__PURE__ */ Symbol.for("dom.ts@layerCounter"), Hs = globalThis[lo] ??= 0, uo = /* @__PURE__ */ new WeakMap(), co = /* @__PURE__ */ Symbol.for("dom.ts@namedStoreMaps"), It = globalThis[co] ??= /* @__PURE__ */ new Map(), ho = (e, t) => {
|
|
2758
|
-
const r = [...e.entries() || []];
|
|
2759
|
-
return new Map(r?.map?.(([a, n]) => [a, n?.get?.(t)])?.filter?.(([a, n]) => !!n) || []);
|
|
2760
|
-
}, we = (e) => ({
|
|
2761
|
-
storeSet: ho(It, e),
|
|
2762
|
-
mixinSet: xe?.get?.(e),
|
|
2763
|
-
behaviorSet: uo?.get?.(e)
|
|
2764
|
-
}), po = /* @__PURE__ */ Symbol.for("dom.ts@boundMixinSet"), xe = globalThis[po] ??= /* @__PURE__ */ new WeakMap(), vo = /* @__PURE__ */ Symbol.for("dom.ts@mixinElements"), se = globalThis[vo] ??= /* @__PURE__ */ new WeakMap(), fo = /* @__PURE__ */ Symbol.for("dom.ts@mixinRegistry"), ue = globalThis[fo] ??= /* @__PURE__ */ new Map(), mo = /* @__PURE__ */ Symbol.for("dom.ts@mixinNamespace"), Ce = globalThis[mo] ??= /* @__PURE__ */ new WeakMap(), xa = (e, t) => {
|
|
2765
|
-
typeof t == "string" && (t = ue?.get?.(t));
|
|
2766
|
-
const r = /* @__PURE__ */ new Set([...e?.getAttribute?.("data-mixin")?.split?.(" ") || []]), a = new Set([...r].map((o) => ue?.get?.(o)).filter((o) => !!o)), n = xe?.get?.(e) ?? /* @__PURE__ */ new WeakSet();
|
|
2767
|
-
se?.has?.(t) || se?.set?.(t, /* @__PURE__ */ new WeakSet()), xe?.has?.(e) || xe?.set?.(e, n);
|
|
2768
|
-
const i = new WeakRef(e);
|
|
2769
|
-
n?.has?.(t) || (a.has(t) || t?.disconnect?.(i, t, we(e)), (a.has(t) || !se?.get?.(t)?.has?.(e)) && (t?.connect?.(i, t, we(e)), r.add(Ce?.get?.(t)), n?.add?.(t), e?.setAttribute?.("data-mixin", [...r].filter((o) => !!o).join(" "))), se?.get?.(t)?.add?.(e)), n?.has?.(t) && (a.has(t) || (n?.delete?.(t), t?.disconnect?.(i, t, we(e))));
|
|
2770
|
-
}, jt = /* @__PURE__ */ new Set(), go = (e = typeof document < "u" ? document : null) => {
|
|
2771
|
-
if (e)
|
|
2772
|
-
return jt?.has?.(e) || (jt?.add?.(e), Ji(e, "*", "data-mixin", (t) => Ht(t.target)), Gi(e, "[data-mixin]", (t) => {
|
|
2773
|
-
for (const r of t.addedNodes) r instanceof HTMLElement && Ht(r);
|
|
2774
|
-
})), e;
|
|
2775
|
-
}, Ht = (e) => {
|
|
2776
|
-
const t = /* @__PURE__ */ new Set([...e?.getAttribute?.("data-mixin")?.split?.(" ") || []]);
|
|
2777
|
-
[...new Set([...t].map((r) => ue?.get?.(r)).filter((r) => !!r))].map?.((r) => xa(e, r));
|
|
2778
|
-
}, bo = (e, t) => {
|
|
2779
|
-
e.forEach((r) => t ? xa(r, t) : Ht(r));
|
|
2780
|
-
}, yo = (e) => {
|
|
2781
|
-
for (const t of jt) bo(t?.querySelectorAll?.("[data-mixin]"), e);
|
|
2782
|
-
}, Mo = new FinalizationRegistry((e) => {
|
|
2783
|
-
ue?.delete?.(e);
|
|
2784
|
-
}), wo = (e, t) => {
|
|
2785
|
-
if (!Ce?.has?.(t)) {
|
|
2786
|
-
const r = e?.trim?.();
|
|
2787
|
-
r && (Ce?.set?.(t, r), ue?.set?.(r, t), Mo?.register?.(t, r), yo(t));
|
|
2788
|
-
}
|
|
2789
|
-
};
|
|
2790
|
-
go(typeof document < "u" ? document : null);
|
|
2791
|
-
var Kt = class {
|
|
2792
|
-
constructor(e = null) {
|
|
2793
|
-
e && wo(e, this);
|
|
2794
|
-
}
|
|
2795
|
-
connect(e, t, r) {
|
|
2796
|
-
return this;
|
|
2797
|
-
}
|
|
2798
|
-
disconnect(e, t, r) {
|
|
2799
|
-
return this;
|
|
2800
|
-
}
|
|
2801
|
-
storeForElement(e) {
|
|
2802
|
-
return It.get(this.name || "")?.get?.(e);
|
|
2803
|
-
}
|
|
2804
|
-
relatedForElement(e) {
|
|
2805
|
-
return we(e);
|
|
2806
|
-
}
|
|
2807
|
-
get elements() {
|
|
2808
|
-
return se?.get?.(this);
|
|
2809
|
-
}
|
|
2810
|
-
get storage() {
|
|
2811
|
-
return It?.get?.(this.name || "");
|
|
2812
|
-
}
|
|
2813
|
-
get name() {
|
|
2814
|
-
return Ce?.get?.(this);
|
|
2815
|
-
}
|
|
2816
|
-
};
|
|
2817
|
-
function kt(e, t) {
|
|
2818
|
-
const r = Math.min(e.x, t.x), a = Math.min(e.y, t.y), n = Math.max(e.x, t.x), i = Math.max(e.y, t.y);
|
|
2819
|
-
return {
|
|
2820
|
-
left: r,
|
|
2821
|
-
top: a,
|
|
2822
|
-
right: n,
|
|
2823
|
-
bottom: i,
|
|
2824
|
-
width: n - r,
|
|
2825
|
-
height: i - a
|
|
2826
|
-
};
|
|
2827
|
-
}
|
|
2828
|
-
var be = {
|
|
2829
|
-
start: "junction-select:start",
|
|
2830
|
-
move: "junction-select:move",
|
|
2831
|
-
end: "junction-select:end",
|
|
2832
|
-
cancel: "junction-select:cancel"
|
|
2833
|
-
}, Et = {
|
|
2834
|
-
start: "junction-drag:start",
|
|
2835
|
-
move: "junction-drag:move",
|
|
2836
|
-
end: "junction-drag:end"
|
|
2837
|
-
}, Tt = {
|
|
2838
|
-
start: "junction-resize:start",
|
|
2839
|
-
move: "junction-resize:move",
|
|
2840
|
-
end: "junction-resize:end"
|
|
2841
|
-
}, xo = /* @__PURE__ */ Symbol.for("dom.ts@mixinDisposers"), Ae = globalThis[xo] ??= /* @__PURE__ */ new WeakMap(), _ = (e, t, r) => {
|
|
2842
|
-
const a = Ae.get(e) ?? /* @__PURE__ */ new Map(), n = a.get(t) ?? [];
|
|
2843
|
-
n.push(r), a.set(t, n), Ae.set(e, a);
|
|
2844
|
-
}, Qt = (e, t) => {
|
|
2845
|
-
const r = Ae.get(e), a = r?.get(t);
|
|
2846
|
-
if (a) {
|
|
2847
|
-
for (const n of a) try {
|
|
2848
|
-
n();
|
|
2849
|
-
} catch {
|
|
2850
|
-
}
|
|
2851
|
-
r.delete(t), r.size === 0 && Ae.delete(e);
|
|
2852
|
-
}
|
|
2853
|
-
}, B = (e, t) => {
|
|
2854
|
-
const r = globalThis.getComputedStyle?.(e)?.getPropertyValue?.(t)?.trim?.() ?? "", a = parseFloat(r);
|
|
2855
|
-
return Number.isFinite(a) ? a : 0;
|
|
2856
|
-
}, Sa = (e, t, r) => {
|
|
2857
|
-
const a = e.getAttribute(t)?.trim();
|
|
2858
|
-
if (!a) return r;
|
|
2859
|
-
const n = e.querySelector(a);
|
|
2860
|
-
return n instanceof HTMLElement ? n : r;
|
|
2861
|
-
}, So = class extends Kt {
|
|
2862
|
-
constructor() {
|
|
2863
|
-
super("ui-junction-select");
|
|
2864
|
-
}
|
|
2865
|
-
connect(e) {
|
|
2866
|
-
const t = e?.deref?.();
|
|
2867
|
-
if (!t) return this;
|
|
2868
|
-
const r = document.createElement("div");
|
|
2869
|
-
r.className = "ui-junction-select-overlay", r.setAttribute("data-junction-overlay", ""), r.style.cssText = "position:absolute;pointer-events:none;z-index:9999;box-sizing:border-box;border:1px dashed color-mix(in oklab, #3794ff 70%, transparent);background:color-mix(in oklab, #3794ff 14%, transparent);display:none;inset:auto;min-width:0;min-height:0;", globalThis.getComputedStyle?.(t)?.position === "static" && (t.style.position = "relative"), t.appendChild(r);
|
|
2870
|
-
let n = !1, i = {
|
|
2871
|
-
x: 0,
|
|
2872
|
-
y: 0
|
|
2873
|
-
}, o = {
|
|
2874
|
-
x: 0,
|
|
2875
|
-
y: 0
|
|
2876
|
-
};
|
|
2877
|
-
const s = (f) => {
|
|
2878
|
-
const b = t.getBoundingClientRect();
|
|
2879
|
-
return {
|
|
2880
|
-
x: f.clientX - b.left,
|
|
2881
|
-
y: f.clientY - b.top
|
|
2882
|
-
};
|
|
2883
|
-
}, l = () => {
|
|
2884
|
-
const f = kt(i, o);
|
|
2885
|
-
if (f.width < 1 && f.height < 1) {
|
|
2886
|
-
r.style.display = "none";
|
|
2887
|
-
return;
|
|
2888
|
-
}
|
|
2889
|
-
r.style.display = "block", r.style.left = `${f.left}px`, r.style.top = `${f.top}px`, r.style.width = `${f.width}px`, r.style.height = `${f.height}px`;
|
|
2890
|
-
}, d = (f) => {
|
|
2891
|
-
f.button === 0 && (f.target?.closest?.("[data-junction-ignore-select], [data-junction-drag-handle], [data-junction-resize-handle], button, a, input, textarea, select") || (f.target === t || t.contains(f.target)) && (n = !0, i = s(f), o = { ...i }, t.setPointerCapture(f.pointerId), t.dispatchEvent(new CustomEvent(be.start, {
|
|
2892
|
-
bubbles: !0,
|
|
2893
|
-
detail: {
|
|
2894
|
-
a: { ...i },
|
|
2895
|
-
b: { ...o },
|
|
2896
|
-
host: t
|
|
2897
|
-
}
|
|
2898
|
-
})), l()));
|
|
2899
|
-
}, p = (f) => {
|
|
2900
|
-
if (!n) return;
|
|
2901
|
-
o = s(f), l();
|
|
2902
|
-
const b = kt(i, o);
|
|
2903
|
-
t.dispatchEvent(new CustomEvent(be.move, {
|
|
2904
|
-
bubbles: !0,
|
|
2905
|
-
detail: {
|
|
2906
|
-
a: { ...i },
|
|
2907
|
-
b: { ...o },
|
|
2908
|
-
box: b,
|
|
2909
|
-
host: t
|
|
2910
|
-
}
|
|
2911
|
-
}));
|
|
2912
|
-
}, v = (f) => {
|
|
2913
|
-
if (!n) return;
|
|
2914
|
-
n = !1;
|
|
2915
|
-
try {
|
|
2916
|
-
t.releasePointerCapture(f.pointerId);
|
|
2917
|
-
} catch {
|
|
2918
|
-
}
|
|
2919
|
-
const b = kt(i, o);
|
|
2920
|
-
t.dispatchEvent(new CustomEvent(be.end, {
|
|
2921
|
-
bubbles: !0,
|
|
2922
|
-
detail: {
|
|
2923
|
-
a: { ...i },
|
|
2924
|
-
b: { ...o },
|
|
2925
|
-
box: b,
|
|
2926
|
-
host: t
|
|
2927
|
-
}
|
|
2928
|
-
}));
|
|
2929
|
-
}, c = (f) => {
|
|
2930
|
-
n && v(f);
|
|
2931
|
-
}, m = (f) => {
|
|
2932
|
-
if (n) {
|
|
2933
|
-
n = !1, r.style.display = "none";
|
|
2934
|
-
try {
|
|
2935
|
-
t.releasePointerCapture(f.pointerId);
|
|
2936
|
-
} catch {
|
|
2937
|
-
}
|
|
2938
|
-
t.dispatchEvent(new CustomEvent(be.cancel, {
|
|
2939
|
-
bubbles: !0,
|
|
2940
|
-
detail: { host: t }
|
|
2941
|
-
}));
|
|
2942
|
-
}
|
|
2943
|
-
};
|
|
2944
|
-
return _(t, "ui-junction-select", () => {
|
|
2945
|
-
r.remove();
|
|
2946
|
-
}), _(t, "ui-junction-select", w(t, "pointerdown", d)), _(t, "ui-junction-select", w(t, "pointermove", p)), _(t, "ui-junction-select", w(t, "pointerup", c)), _(t, "ui-junction-select", w(t, "pointercancel", m)), this;
|
|
2947
|
-
}
|
|
2948
|
-
disconnect(e) {
|
|
2949
|
-
const t = e?.deref?.();
|
|
2950
|
-
return t && Qt(t, "ui-junction-select"), this;
|
|
2951
|
-
}
|
|
2952
|
-
}, ko = class extends Kt {
|
|
2953
|
-
constructor() {
|
|
2954
|
-
super("ui-junction-drag");
|
|
2955
|
-
}
|
|
2956
|
-
connect(e) {
|
|
2957
|
-
const t = e?.deref?.();
|
|
2958
|
-
if (!t) return this;
|
|
2959
|
-
ge(t, "--jx-drag-x", B(t, "--jx-drag-x")), ge(t, "--jx-drag-y", B(t, "--jx-drag-y"));
|
|
2960
|
-
const r = t.style.transform;
|
|
2961
|
-
(!t.style.transform || t.style.transform === "none") && (t.style.transform = "translate3d(calc(var(--jx-drag-x, 0) * 1px), calc(var(--jx-drag-y, 0) * 1px), 0)");
|
|
2962
|
-
const a = Sa(t, "data-junction-drag-handle", t);
|
|
2963
|
-
let n = !1, i = 0, o = 0, s = 0, l = 0;
|
|
2964
|
-
const d = (c) => {
|
|
2965
|
-
c.button === 0 && (c.target !== a && !a.contains(c.target) || (n = !0, i = c.clientX, o = c.clientY, s = B(t, "--jx-drag-x"), l = B(t, "--jx-drag-y"), a.setPointerCapture(c.pointerId), t.dispatchEvent(new CustomEvent(Et.start, {
|
|
2966
|
-
bubbles: !0,
|
|
2967
|
-
detail: {
|
|
2968
|
-
host: t,
|
|
2969
|
-
clientX: c.clientX,
|
|
2970
|
-
clientY: c.clientY,
|
|
2971
|
-
baseX: s,
|
|
2972
|
-
baseY: l
|
|
2973
|
-
}
|
|
2974
|
-
}))));
|
|
2975
|
-
}, p = (c) => {
|
|
2976
|
-
if (!n) return;
|
|
2977
|
-
const m = c.clientX - i, f = c.clientY - o, b = s + m, M = l + f;
|
|
2978
|
-
ge(t, "--jx-drag-x", b), ge(t, "--jx-drag-y", M), t.dispatchEvent(new CustomEvent(Et.move, {
|
|
2979
|
-
bubbles: !0,
|
|
2980
|
-
detail: {
|
|
2981
|
-
host: t,
|
|
2982
|
-
dx: m,
|
|
2983
|
-
dy: f,
|
|
2984
|
-
x: b,
|
|
2985
|
-
y: M
|
|
2986
|
-
}
|
|
2987
|
-
}));
|
|
2988
|
-
}, v = (c) => {
|
|
2989
|
-
if (n) {
|
|
2990
|
-
n = !1;
|
|
2991
|
-
try {
|
|
2992
|
-
a.releasePointerCapture(c.pointerId);
|
|
2993
|
-
} catch {
|
|
2994
|
-
}
|
|
2995
|
-
t.dispatchEvent(new CustomEvent(Et.end, {
|
|
2996
|
-
bubbles: !0,
|
|
2997
|
-
detail: {
|
|
2998
|
-
host: t,
|
|
2999
|
-
x: B(t, "--jx-drag-x"),
|
|
3000
|
-
y: B(t, "--jx-drag-y")
|
|
3001
|
-
}
|
|
3002
|
-
}));
|
|
3003
|
-
}
|
|
3004
|
-
};
|
|
3005
|
-
return _(t, "ui-junction-drag", () => {
|
|
3006
|
-
t.style.transform = r;
|
|
3007
|
-
}), _(t, "ui-junction-drag", w(a, "pointerdown", d)), _(t, "ui-junction-drag", w(a, "pointermove", p)), _(t, "ui-junction-drag", w(a, "pointerup", v)), _(t, "ui-junction-drag", w(a, "pointercancel", v)), this;
|
|
3008
|
-
}
|
|
3009
|
-
disconnect(e) {
|
|
3010
|
-
const t = e?.deref?.();
|
|
3011
|
-
return t && Qt(t, "ui-junction-drag"), this;
|
|
3012
|
-
}
|
|
3013
|
-
}, Eo = class extends Kt {
|
|
3014
|
-
constructor() {
|
|
3015
|
-
super("ui-junction-resize");
|
|
3016
|
-
}
|
|
3017
|
-
connect(e) {
|
|
3018
|
-
const t = e?.deref?.();
|
|
3019
|
-
if (!t) return this;
|
|
3020
|
-
const r = Sa(t, "data-junction-resize-handle", t);
|
|
3021
|
-
let a = !1, n = 0, i = 0, o = 0, s = 0;
|
|
3022
|
-
const l = Math.max(120, parseFloat(t.getAttribute("data-junction-resize-min-w") || "") || 120), d = Math.max(80, parseFloat(t.getAttribute("data-junction-resize-min-h") || "") || 80), p = (m) => {
|
|
3023
|
-
m.button === 0 && (m.target !== r && !r.contains(m.target) || (a = !0, n = m.clientX, i = m.clientY, o = t.offsetWidth, s = t.offsetHeight, r.setPointerCapture(m.pointerId), t.dispatchEvent(new CustomEvent(Tt.start, {
|
|
3024
|
-
bubbles: !0,
|
|
3025
|
-
detail: {
|
|
3026
|
-
host: t,
|
|
3027
|
-
width: o,
|
|
3028
|
-
height: s
|
|
3029
|
-
}
|
|
3030
|
-
}))));
|
|
3031
|
-
}, v = (m) => {
|
|
3032
|
-
if (!a) return;
|
|
3033
|
-
const f = Math.max(l, o + (m.clientX - n)), b = Math.max(d, s + (m.clientY - i));
|
|
3034
|
-
t.style.width = `${f}px`, t.style.height = `${b}px`, t.dispatchEvent(new CustomEvent(Tt.move, {
|
|
3035
|
-
bubbles: !0,
|
|
3036
|
-
detail: {
|
|
3037
|
-
host: t,
|
|
3038
|
-
width: f,
|
|
3039
|
-
height: b
|
|
3040
|
-
}
|
|
3041
|
-
}));
|
|
3042
|
-
}, c = (m) => {
|
|
3043
|
-
if (a) {
|
|
3044
|
-
a = !1;
|
|
3045
|
-
try {
|
|
3046
|
-
r.releasePointerCapture(m.pointerId);
|
|
3047
|
-
} catch {
|
|
3048
|
-
}
|
|
3049
|
-
t.dispatchEvent(new CustomEvent(Tt.end, {
|
|
3050
|
-
bubbles: !0,
|
|
3051
|
-
detail: {
|
|
3052
|
-
host: t,
|
|
3053
|
-
width: t.offsetWidth,
|
|
3054
|
-
height: t.offsetHeight
|
|
3055
|
-
}
|
|
3056
|
-
}));
|
|
3057
|
-
}
|
|
3058
|
-
};
|
|
3059
|
-
return _(t, "ui-junction-resize", w(r, "pointerdown", p)), _(t, "ui-junction-resize", w(r, "pointermove", v)), _(t, "ui-junction-resize", w(r, "pointerup", c)), _(t, "ui-junction-resize", w(r, "pointercancel", c)), this;
|
|
3060
|
-
}
|
|
3061
|
-
disconnect(e) {
|
|
3062
|
-
const t = e?.deref?.();
|
|
3063
|
-
return t && Qt(t, "ui-junction-resize"), this;
|
|
3064
|
-
}
|
|
3065
|
-
};
|
|
3066
|
-
new So();
|
|
3067
|
-
new ko();
|
|
3068
|
-
new Eo();
|
|
3069
|
-
var ye = /* @__PURE__ */ new WeakMap(), To = /* @__PURE__ */ new Map([]), jr = Oi(), Se = (e) => e?.naturalWidth || e?.width || 1, ke = (e) => e?.naturalHeight || e?.height || 1, zo = (e) => {
|
|
2297
|
+
}, oo = () => {
|
|
2298
|
+
const e = pt();
|
|
2299
|
+
return e && de(e), e;
|
|
2300
|
+
}, he = /* @__PURE__ */ new WeakMap(), no = /* @__PURE__ */ new Map([]), hr = Jr(), ce = (e) => e?.naturalWidth || e?.width || 1, ve = (e) => e?.naturalHeight || e?.height || 1, lo = (e) => {
|
|
3070
2301
|
const t = {
|
|
3071
2302
|
alpha: !0,
|
|
3072
2303
|
desynchronized: !0,
|
|
@@ -3090,21 +2321,28 @@ var ye = /* @__PURE__ */ new WeakMap(), To = /* @__PURE__ */ new Map([]), jr = O
|
|
|
3090
2321
|
} catch {
|
|
3091
2322
|
return e.getContext("2d");
|
|
3092
2323
|
}
|
|
3093
|
-
},
|
|
3094
|
-
|
|
3095
|
-
},
|
|
3096
|
-
const
|
|
3097
|
-
e.translate(
|
|
3098
|
-
},
|
|
3099
|
-
if (!
|
|
2324
|
+
}, ln = (e, t) => {
|
|
2325
|
+
no.set(e, t);
|
|
2326
|
+
}, so = (e, t, r = 1, a, i = 0) => {
|
|
2327
|
+
const o = e.canvas;
|
|
2328
|
+
e.translate(o.width / 2, o.height / 2), e.rotate((-i || 0) * (Math.PI * 0.5)), e.rotate((1 - a) * (Math.PI / 2)), e.translate(-(ce(t) / 2) * r, -(ve(t) / 2) * r);
|
|
2329
|
+
}, ho = (e) => {
|
|
2330
|
+
if (!he.has(e) && (e instanceof Blob || e instanceof File || e instanceof OffscreenCanvas || e instanceof ImageBitmap || e instanceof Image)) {
|
|
3100
2331
|
const t = createImageBitmap(e).catch((r) => {
|
|
3101
|
-
throw
|
|
2332
|
+
throw he.delete(e), r;
|
|
3102
2333
|
});
|
|
3103
|
-
|
|
3104
|
-
}
|
|
3105
|
-
return
|
|
3106
|
-
},
|
|
3107
|
-
|
|
2334
|
+
he.set(e, t);
|
|
2335
|
+
}
|
|
2336
|
+
return he.get(e);
|
|
2337
|
+
}, jr = /* @__PURE__ */ Symbol.for("image.canvas.bindCache");
|
|
2338
|
+
globalThis[jr] ??= /* @__PURE__ */ new WeakMap();
|
|
2339
|
+
var dr = globalThis[jr], co = (e, t) => {
|
|
2340
|
+
const r = dr.get(e);
|
|
2341
|
+
if (typeof r == "function") return r;
|
|
2342
|
+
const a = e.bind(t);
|
|
2343
|
+
return dr.set(e, a), a;
|
|
2344
|
+
}, mt = null;
|
|
2345
|
+
typeof HTMLCanvasElement < "u" ? mt = class extends HTMLCanvasElement {
|
|
3108
2346
|
static observedAttributes = [
|
|
3109
2347
|
"data-src",
|
|
3110
2348
|
"data-orient",
|
|
@@ -3115,58 +2353,58 @@ typeof HTMLCanvasElement < "u" ? Ot = class extends HTMLCanvasElement {
|
|
|
3115
2353
|
#e = [1, 1];
|
|
3116
2354
|
#t = "";
|
|
3117
2355
|
#r = "";
|
|
3118
|
-
get #
|
|
2356
|
+
get #i() {
|
|
3119
2357
|
const t = this.getAttribute("data-orient") ?? this.getAttribute("orient") ?? "0", r = Number.parseInt(t, 10);
|
|
3120
2358
|
return Number.isFinite(r) ? r : 0;
|
|
3121
2359
|
}
|
|
3122
|
-
set #
|
|
2360
|
+
set #i(t) {
|
|
3123
2361
|
const r = String(t);
|
|
3124
2362
|
this.setAttribute("data-orient", r), this.setAttribute("orient", r);
|
|
3125
2363
|
}
|
|
3126
2364
|
attributeChangedCallback(t, r, a) {
|
|
3127
|
-
t == "data-src" && this.#
|
|
2365
|
+
t == "data-src" && this.#o(a), (t == "data-orient" || t == "orient") && this.#a(this.#r);
|
|
3128
2366
|
}
|
|
3129
2367
|
connectedCallback() {
|
|
3130
2368
|
const t = this.parentNode;
|
|
3131
|
-
this.style.setProperty("max-inline-size", "min(100%, min(100cqi, 100dvi))"), this.style.setProperty("max-block-size", "min(100%, min(100cqb, 100dvb))"), this.#e = [Math.min(Math.min(Math.max(this.clientWidth || t?.clientWidth || 1, 1), t?.clientWidth || 1) * (this.currentCSSZoom || 1), screen?.width || 1) * (devicePixelRatio || 1), Math.min(Math.min(Math.max(this.clientHeight || t?.clientHeight || 1, 1), t?.clientHeight || 1) * (this.currentCSSZoom || 1), screen?.height || 1) * (devicePixelRatio || 1)], this.#
|
|
2369
|
+
this.style.setProperty("max-inline-size", "min(100%, min(100cqi, 100dvi))"), this.style.setProperty("max-block-size", "min(100%, min(100cqb, 100dvb))"), this.#e = [Math.min(Math.min(Math.max(this.clientWidth || t?.clientWidth || 1, 1), t?.clientWidth || 1) * (this.currentCSSZoom || 1), screen?.width || 1) * (devicePixelRatio || 1), Math.min(Math.min(Math.max(this.clientHeight || t?.clientHeight || 1, 1), t?.clientHeight || 1) * (this.currentCSSZoom || 1), screen?.height || 1) * (devicePixelRatio || 1)], this.#o(this.#t = this.dataset.src || this.#t), this.image && this.#a(this.#r);
|
|
3132
2370
|
}
|
|
3133
2371
|
constructor() {
|
|
3134
2372
|
super();
|
|
3135
2373
|
const t = this, r = this.parentNode, a = () => {
|
|
3136
|
-
const
|
|
3137
|
-
this.#e = [Math.min(Math.min(Math.max(this.clientWidth || r?.clientWidth || 1, 1), r?.clientWidth || 1) * (this.currentCSSZoom || 1), screen?.width || 1) * (devicePixelRatio || 1), Math.min(Math.min(Math.max(this.clientHeight || r?.clientHeight || 1, 1), r?.clientHeight || 1) * (this.currentCSSZoom || 1), screen?.height || 1) * (devicePixelRatio || 1)], (
|
|
2374
|
+
const i = this.#e;
|
|
2375
|
+
this.#e = [Math.min(Math.min(Math.max(this.clientWidth || r?.clientWidth || 1, 1), r?.clientWidth || 1) * (this.currentCSSZoom || 1), screen?.width || 1) * (devicePixelRatio || 1), Math.min(Math.min(Math.max(this.clientHeight || r?.clientHeight || 1, 1), r?.clientHeight || 1) * (this.currentCSSZoom || 1), screen?.height || 1) * (devicePixelRatio || 1)], (i?.[0] != this.#e[0] || i?.[1] != this.#e[1]) && this.#a(this.#r);
|
|
3138
2376
|
};
|
|
3139
|
-
|
|
3140
|
-
this.ctx =
|
|
2377
|
+
hr?.shedule?.(() => {
|
|
2378
|
+
this.ctx = lo(t);
|
|
3141
2379
|
try {
|
|
3142
2380
|
this.ctx?.configureHighDynamicRange?.({ mode: "extended" }), t?.configureHighDynamicRange?.({ mode: "extended" });
|
|
3143
2381
|
} catch {
|
|
3144
2382
|
}
|
|
3145
|
-
this.inert = !0, this.style.objectFit = "cover", this.style.objectPosition = "center", this.classList.add("u-canvas"), this.classList.add("u2-canvas"), this.classList.add("ui-canvas"), this.style.setProperty("max-inline-size", "min(100%, min(100cqi, 100dvi))"), this.style.setProperty("max-block-size", "min(100%, min(100cqb, 100dvb))"), this.style.setProperty("dynamic-range-limit", "no-limit"), this.style.setProperty("color-space", "display-p3"), this.style.setProperty("background-color", "black", "important"), this.style.setProperty("opacity", "1", "important"), a(), new ResizeObserver((
|
|
3146
|
-
for (const
|
|
3147
|
-
const
|
|
3148
|
-
if (
|
|
3149
|
-
const
|
|
3150
|
-
this.#e = [Math.max(
|
|
2383
|
+
this.inert = !0, this.style.objectFit = "cover", this.style.objectPosition = "center", this.classList.add("u-canvas"), this.classList.add("u2-canvas"), this.classList.add("ui-canvas"), this.style.setProperty("max-inline-size", "min(100%, min(100cqi, 100dvi))"), this.style.setProperty("max-block-size", "min(100%, min(100cqb, 100dvb))"), this.style.setProperty("dynamic-range-limit", "no-limit"), this.style.setProperty("color-space", "display-p3"), this.style.setProperty("background-color", "black", "important"), this.style.setProperty("opacity", "1", "important"), a(), new ResizeObserver((i) => {
|
|
2384
|
+
for (const o of i) {
|
|
2385
|
+
const n = o?.devicePixelContentBoxSize?.[0];
|
|
2386
|
+
if (n) {
|
|
2387
|
+
const l = this.#e;
|
|
2388
|
+
this.#e = [Math.max(n.inlineSize || this.width, 1), Math.max(n.blockSize || this.height, 1)], (l?.[0] != this.#e[0] || l?.[1] != this.#e[1]) && this.#a(this.#r);
|
|
3151
2389
|
}
|
|
3152
2390
|
}
|
|
3153
|
-
}).observe(this, { box: "device-pixel-content-box" }), this.#
|
|
2391
|
+
}).observe(this, { box: "device-pixel-content-box" }), this.#o(this.#t = this.dataset.src || this.#t), this.image && this.#a(this.#r || this.#t);
|
|
3154
2392
|
});
|
|
3155
2393
|
}
|
|
3156
2394
|
async $useImageAsSource(t, r) {
|
|
3157
2395
|
r ||= this.#t;
|
|
3158
|
-
const a = t instanceof ImageBitmap ? t : await
|
|
2396
|
+
const a = t instanceof ImageBitmap ? t : await ho(t).catch(console.warn.bind(console));
|
|
3159
2397
|
return a && r == this.#t && (this.image = a, this.#a(r)), t;
|
|
3160
2398
|
}
|
|
3161
2399
|
$renderPass(t) {
|
|
3162
|
-
const r = this, a = this.ctx,
|
|
3163
|
-
if (
|
|
2400
|
+
const r = this, a = this.ctx, i = this.image;
|
|
2401
|
+
if (i && a && (t == this.#t || !t)) {
|
|
3164
2402
|
t && (this.#r = t), this.width != this.#e[0] && (this.width = this.#e[0]), this.height != this.#e[1] && (this.height = this.#e[1]), this.style.aspectRatio = `${this.width || 1} / ${this.height || 1}`;
|
|
3165
|
-
const
|
|
3166
|
-
a.save(), a.clearRect(0, 0, r.width, r.height),
|
|
2403
|
+
const o = this.#i % 2 || 0, n = ce(i) <= ve(i) ? 1 : 0, l = Math.max(r[["height", "width"][o]] / (n ? ve(i) : ce(i)), r[["width", "height"][o]] / (n ? ce(i) : ve(i)));
|
|
2404
|
+
a.save(), a.clearRect(0, 0, r.width, r.height), so(a, i, l, n, this.#i), a.drawImage(i, 0, 0, i.width * l, i.height * l), a.restore();
|
|
3167
2405
|
}
|
|
3168
2406
|
}
|
|
3169
|
-
#
|
|
2407
|
+
#o(t) {
|
|
3170
2408
|
const r = t || this.#t;
|
|
3171
2409
|
return this.#t = r, fetch(t, {
|
|
3172
2410
|
cache: "force-cache",
|
|
@@ -3176,9 +2414,9 @@ typeof HTMLCanvasElement < "u" ? Ot = class extends HTMLCanvasElement {
|
|
|
3176
2414
|
}
|
|
3177
2415
|
#a(t) {
|
|
3178
2416
|
const r = this.ctx;
|
|
3179
|
-
this.image && r && (t == this.#t || !t) &&
|
|
2417
|
+
this.image && r && (t == this.#t || !t) && hr?.shedule?.(co(this.$renderPass, this));
|
|
3180
2418
|
}
|
|
3181
|
-
} :
|
|
2419
|
+
} : mt = class {
|
|
3182
2420
|
constructor() {
|
|
3183
2421
|
}
|
|
3184
2422
|
$renderPass(t) {
|
|
@@ -3192,178 +2430,178 @@ typeof HTMLCanvasElement < "u" ? Ot = class extends HTMLCanvasElement {
|
|
|
3192
2430
|
#t(t) {
|
|
3193
2431
|
}
|
|
3194
2432
|
#r = 0;
|
|
3195
|
-
#n = "";
|
|
3196
2433
|
#i = "";
|
|
2434
|
+
#o = "";
|
|
3197
2435
|
#a = [1, 1];
|
|
3198
2436
|
ctx = null;
|
|
3199
2437
|
image = null;
|
|
3200
2438
|
};
|
|
3201
2439
|
try {
|
|
3202
|
-
customElements.define("ui-canvas",
|
|
2440
|
+
customElements.define("ui-canvas", mt, { extends: "canvas" });
|
|
3203
2441
|
} catch {
|
|
3204
2442
|
}
|
|
3205
|
-
var
|
|
3206
|
-
if (
|
|
3207
|
-
URL.revokeObjectURL(
|
|
2443
|
+
var Br = "rs-wallpaper-image", N = "/assets/wallpaper.jpg", bt = "idb:rs-wallpaper", vo = "cwsp-wallpaper-v1", L = "blobs", St = "current", Fr = 512e3, T = null, At = () => Kr?.[Gr()] ?? 0, ye = () => {
|
|
2444
|
+
if (T && T.startsWith("blob:")) try {
|
|
2445
|
+
URL.revokeObjectURL(T);
|
|
3208
2446
|
} catch {
|
|
3209
2447
|
}
|
|
3210
|
-
|
|
3211
|
-
},
|
|
2448
|
+
T = null;
|
|
2449
|
+
}, Ct = () => new Promise((e, t) => {
|
|
3212
2450
|
if (typeof indexedDB > "u") {
|
|
3213
2451
|
t(/* @__PURE__ */ new Error("indexedDB unavailable"));
|
|
3214
2452
|
return;
|
|
3215
2453
|
}
|
|
3216
|
-
const r = indexedDB.open(
|
|
2454
|
+
const r = indexedDB.open(vo, 1);
|
|
3217
2455
|
r.onupgradeneeded = () => {
|
|
3218
2456
|
const a = r.result;
|
|
3219
|
-
a.objectStoreNames.contains(
|
|
2457
|
+
a.objectStoreNames.contains(L) || a.createObjectStore(L);
|
|
3220
2458
|
}, r.onsuccess = () => e(r.result), r.onerror = () => t(r.error || /* @__PURE__ */ new Error("IDB open failed"));
|
|
3221
|
-
}),
|
|
3222
|
-
const t = await
|
|
2459
|
+
}), uo = async (e) => {
|
|
2460
|
+
const t = await Ct();
|
|
3223
2461
|
try {
|
|
3224
2462
|
await new Promise((r, a) => {
|
|
3225
|
-
const
|
|
3226
|
-
|
|
2463
|
+
const i = t.transaction(L, "readwrite");
|
|
2464
|
+
i.objectStore(L).put(e, St), i.oncomplete = () => r(), i.onerror = () => a(i.error || /* @__PURE__ */ new Error("IDB put failed"));
|
|
3227
2465
|
});
|
|
3228
2466
|
} finally {
|
|
3229
2467
|
t.close();
|
|
3230
2468
|
}
|
|
3231
|
-
},
|
|
3232
|
-
const e = await
|
|
2469
|
+
}, cr = async () => {
|
|
2470
|
+
const e = await Ct();
|
|
3233
2471
|
try {
|
|
3234
2472
|
return await new Promise((t, r) => {
|
|
3235
|
-
const a = e.transaction(
|
|
2473
|
+
const a = e.transaction(L, "readonly").objectStore(L).get(St);
|
|
3236
2474
|
a.onsuccess = () => {
|
|
3237
|
-
const
|
|
3238
|
-
t(
|
|
2475
|
+
const i = a.result;
|
|
2476
|
+
t(i instanceof Blob ? i : null);
|
|
3239
2477
|
}, a.onerror = () => r(a.error || /* @__PURE__ */ new Error("IDB get failed"));
|
|
3240
2478
|
});
|
|
3241
2479
|
} finally {
|
|
3242
2480
|
e.close();
|
|
3243
2481
|
}
|
|
3244
|
-
},
|
|
2482
|
+
}, fo = async () => {
|
|
3245
2483
|
try {
|
|
3246
|
-
const e = await
|
|
2484
|
+
const e = await Ct();
|
|
3247
2485
|
try {
|
|
3248
2486
|
await new Promise((t, r) => {
|
|
3249
|
-
const a = e.transaction(
|
|
3250
|
-
a.objectStore(
|
|
2487
|
+
const a = e.transaction(L, "readwrite");
|
|
2488
|
+
a.objectStore(L).delete(St), a.oncomplete = () => t(), a.onerror = () => r(a.error || /* @__PURE__ */ new Error("IDB delete failed"));
|
|
3251
2489
|
});
|
|
3252
2490
|
} finally {
|
|
3253
2491
|
e.close();
|
|
3254
2492
|
}
|
|
3255
2493
|
} catch {
|
|
3256
2494
|
}
|
|
3257
|
-
},
|
|
2495
|
+
}, It = () => {
|
|
3258
2496
|
try {
|
|
3259
|
-
const e = localStorage.getItem(
|
|
3260
|
-
return e && e.trim() ? e.trim() :
|
|
2497
|
+
const e = localStorage.getItem(Br);
|
|
2498
|
+
return e && e.trim() ? e.trim() : N;
|
|
3261
2499
|
} catch {
|
|
3262
|
-
return
|
|
2500
|
+
return N;
|
|
3263
2501
|
}
|
|
3264
|
-
},
|
|
2502
|
+
}, Me = (e) => {
|
|
3265
2503
|
try {
|
|
3266
|
-
return localStorage.setItem(
|
|
2504
|
+
return localStorage.setItem(Br, e), !0;
|
|
3267
2505
|
} catch {
|
|
3268
2506
|
return !1;
|
|
3269
2507
|
}
|
|
3270
|
-
},
|
|
3271
|
-
const e =
|
|
2508
|
+
}, po = (e) => e.startsWith("data:") || e.startsWith("blob:"), mo = async () => {
|
|
2509
|
+
const e = It();
|
|
3272
2510
|
if (e === "idb:rs-wallpaper" || e.startsWith("idb:")) {
|
|
3273
2511
|
try {
|
|
3274
|
-
const t = await
|
|
2512
|
+
const t = await cr();
|
|
3275
2513
|
if (t)
|
|
3276
|
-
return
|
|
2514
|
+
return ye(), T = URL.createObjectURL(t), T;
|
|
3277
2515
|
} catch (t) {
|
|
3278
2516
|
console.warn("[fest/image] wallpaper IDB restore failed", t);
|
|
3279
2517
|
}
|
|
3280
|
-
return
|
|
2518
|
+
return N;
|
|
3281
2519
|
}
|
|
3282
|
-
if (e.startsWith("data:") && e.length >
|
|
3283
|
-
const t = await
|
|
2520
|
+
if (e.startsWith("data:") && e.length > Fr) try {
|
|
2521
|
+
const t = await cr();
|
|
3284
2522
|
if (t)
|
|
3285
|
-
return
|
|
2523
|
+
return ye(), T = URL.createObjectURL(t), Me(bt), T;
|
|
3286
2524
|
} catch {
|
|
3287
2525
|
}
|
|
3288
|
-
return e ||
|
|
3289
|
-
},
|
|
2526
|
+
return e || N;
|
|
2527
|
+
}, dn = () => It(), vr = (e) => {
|
|
3290
2528
|
const t = () => {
|
|
3291
|
-
const r =
|
|
2529
|
+
const r = At(), a = String(r);
|
|
3292
2530
|
e.getAttribute("data-orient") !== a && e.setAttribute("data-orient", a), e.getAttribute("orient") !== a && e.setAttribute("orient", a), e.style.setProperty("--orient", a), e.orient = r;
|
|
3293
2531
|
};
|
|
3294
|
-
return t(),
|
|
3295
|
-
},
|
|
2532
|
+
return t(), Vr(t);
|
|
2533
|
+
}, cn = () => {
|
|
3296
2534
|
document.querySelectorAll('[data-app-layer="canvas"] canvas[is="ui-canvas"], [data-app-layer="canvas"] canvas.ui-canvas').forEach((e) => {
|
|
3297
|
-
const t =
|
|
2535
|
+
const t = At(), r = String(t);
|
|
3298
2536
|
e.setAttribute("data-orient", r), e.setAttribute("orient", r), e.style.setProperty("--orient", r);
|
|
3299
2537
|
});
|
|
3300
|
-
},
|
|
2538
|
+
}, ae = (e) => {
|
|
3301
2539
|
const t = getComputedStyle(document.documentElement).getPropertyValue("--color-primary").trim() || "#5b86eb";
|
|
3302
2540
|
e.style.background = `radial-gradient(circle at 15% 20%, color-mix(in oklab, ${t} 45%, transparent) 0%, transparent 40%), radial-gradient(circle at 75% 72%, color-mix(in oklab, ${t} 35%, transparent) 0%, transparent 43%)`;
|
|
3303
|
-
},
|
|
3304
|
-
const t = document.querySelectorAll('[data-app-layer="canvas"] canvas[is="ui-canvas"], [data-app-layer="canvas"] canvas.ui-canvas'), r = String(
|
|
2541
|
+
}, gt = (e) => {
|
|
2542
|
+
const t = document.querySelectorAll('[data-app-layer="canvas"] canvas[is="ui-canvas"], [data-app-layer="canvas"] canvas.ui-canvas'), r = String(At());
|
|
3305
2543
|
t.forEach((a) => {
|
|
3306
2544
|
a.setAttribute("data-src", e), a.setAttribute("data-orient", r), a.setAttribute("orient", r), a.style.setProperty("--orient", r);
|
|
3307
2545
|
});
|
|
3308
|
-
},
|
|
2546
|
+
}, bo = async (e) => (await fetch(e)).blob(), go = async (e) => {
|
|
3309
2547
|
if (!(e instanceof Blob) || e.size <= 0)
|
|
3310
|
-
return
|
|
3311
|
-
|
|
3312
|
-
document.querySelectorAll(".app-canvas__glow").forEach(
|
|
2548
|
+
return yo(N), N;
|
|
2549
|
+
ye(), T = URL.createObjectURL(e), gt(T), ge(T, { force: !0 }).then(() => {
|
|
2550
|
+
document.querySelectorAll(".app-canvas__glow").forEach(ae);
|
|
3313
2551
|
});
|
|
3314
2552
|
try {
|
|
3315
|
-
await
|
|
2553
|
+
await uo(e), Me(bt);
|
|
3316
2554
|
} catch (t) {
|
|
3317
2555
|
console.warn("[fest/image] wallpaper IDB persist failed", t);
|
|
3318
2556
|
try {
|
|
3319
|
-
const r = new FileReader(), a = await new Promise((
|
|
3320
|
-
r.onload = () =>
|
|
2557
|
+
const r = new FileReader(), a = await new Promise((i, o) => {
|
|
2558
|
+
r.onload = () => i(String(r.result || "")), r.onerror = () => o(r.error || /* @__PURE__ */ new Error("read failed")), r.readAsDataURL(e);
|
|
3321
2559
|
});
|
|
3322
|
-
a && !
|
|
2560
|
+
a && !Me(a) && console.warn("[fest/image] wallpaper localStorage persist also failed (quota?)");
|
|
3323
2561
|
} catch {
|
|
3324
2562
|
}
|
|
3325
2563
|
}
|
|
3326
2564
|
try {
|
|
3327
2565
|
globalThis.dispatchEvent?.(new CustomEvent("cwsp-wallpaper-change", { detail: {
|
|
3328
|
-
pointer:
|
|
3329
|
-
url:
|
|
2566
|
+
pointer: bt,
|
|
2567
|
+
url: T
|
|
3330
2568
|
} }));
|
|
3331
2569
|
} catch {
|
|
3332
2570
|
}
|
|
3333
|
-
return
|
|
3334
|
-
},
|
|
2571
|
+
return T;
|
|
2572
|
+
}, vn = (e) => {
|
|
3335
2573
|
const t = e;
|
|
3336
2574
|
t.replaceChildren(), t.dataset.appLayer = "canvas", t.style.position = "absolute", t.style.inset = "0", t.style.overflow = "hidden", t.style.background = "radial-gradient(circle at 18% 12%, #1b2a45 0%, #0f1728 42%, #060910 100%)";
|
|
3337
2575
|
const r = document.createElement("div");
|
|
3338
2576
|
r.className = "app-canvas__glow", r.style.position = "absolute", r.style.inset = "-20%", r.style.pointerEvents = "none", r.style.opacity = "0.7", r.style.background = "radial-gradient(circle at 15% 20%, rgba(145,185,255,0.45) 0%, transparent 40%), radial-gradient(circle at 75% 72%, rgba(91,134,235,0.35) 0%, transparent 43%)";
|
|
3339
2577
|
const a = document.createElement("canvas", { is: "ui-canvas" });
|
|
3340
2578
|
a.className = "app-canvas__image ui-canvas", a.style.position = "absolute", a.style.inset = "0", a.style.pointerEvents = "none", a.style.inlineSize = "100%", a.style.blockSize = "100%", a.style.maxInlineSize = "100%", a.style.maxBlockSize = "100%", a.style.opacity = "1", a.style.mixBlendMode = "normal", a.setAttribute("is", "ui-canvas"), a.style.setProperty("dynamic-range-limit", "no-limit"), a.style.setProperty("color-space", "display-p3"), a.style.setProperty("background-color", "black", "important"), a.style.setProperty("opacity", "1", "important"), t.append(r, a);
|
|
3341
|
-
const
|
|
3342
|
-
a.setAttribute("data-src",
|
|
3343
|
-
const
|
|
3344
|
-
return
|
|
2579
|
+
const i = It(), o = i === "idb:rs-wallpaper" || i.startsWith("idb:") || i.startsWith("data:") ? N : i;
|
|
2580
|
+
a.setAttribute("data-src", o);
|
|
2581
|
+
const n = vr(a);
|
|
2582
|
+
return oo(), ae(r), mo().then((l) => (a.setAttribute("data-src", l), vr(a), ge(l).then(() => ae(r)))), {
|
|
3345
2583
|
root: t,
|
|
3346
2584
|
canvas: a,
|
|
3347
2585
|
glow: r,
|
|
3348
|
-
disposeOrient:
|
|
2586
|
+
disposeOrient: n
|
|
3349
2587
|
};
|
|
3350
|
-
},
|
|
3351
|
-
const t = String(e || "").trim() ||
|
|
3352
|
-
if (
|
|
2588
|
+
}, yo = (e) => {
|
|
2589
|
+
const t = String(e || "").trim() || N;
|
|
2590
|
+
if (po(t) || t.length > Fr) {
|
|
3353
2591
|
(async () => {
|
|
3354
2592
|
try {
|
|
3355
|
-
const r = t.startsWith("blob:") ? await (await fetch(t)).blob() : await
|
|
3356
|
-
await
|
|
2593
|
+
const r = t.startsWith("blob:") ? await (await fetch(t)).blob() : await bo(t);
|
|
2594
|
+
await go(r);
|
|
3357
2595
|
} catch (r) {
|
|
3358
|
-
console.warn("[fest/image] setAppWallpaper inline persist failed", r),
|
|
3359
|
-
document.querySelectorAll(".app-canvas__glow").forEach(
|
|
2596
|
+
console.warn("[fest/image] setAppWallpaper inline persist failed", r), gt(t), ge(t, { force: !0 }).then(() => {
|
|
2597
|
+
document.querySelectorAll(".app-canvas__glow").forEach(ae);
|
|
3360
2598
|
});
|
|
3361
2599
|
}
|
|
3362
2600
|
})();
|
|
3363
2601
|
return;
|
|
3364
2602
|
}
|
|
3365
|
-
|
|
3366
|
-
document.querySelectorAll(".app-canvas__glow").forEach(
|
|
2603
|
+
fo(), ye(), Me(t) || console.warn("[fest/image] wallpaper pointer write failed"), gt(t), ge(t, { force: !0 }).then(() => {
|
|
2604
|
+
document.querySelectorAll(".app-canvas__glow").forEach(ae);
|
|
3367
2605
|
});
|
|
3368
2606
|
try {
|
|
3369
2607
|
globalThis.dispatchEvent?.(new CustomEvent("cwsp-wallpaper-change", { detail: {
|
|
@@ -3374,28 +2612,29 @@ var ka = "rs-wallpaper-image", H = "/assets/wallpaper.jpg", Wt = "idb:rs-wallpap
|
|
|
3374
2612
|
}
|
|
3375
2613
|
};
|
|
3376
2614
|
export {
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
2615
|
+
mt as UICanvas,
|
|
2616
|
+
bt as WALLPAPER_IDB_MARKER,
|
|
2617
|
+
Vi as WALLPAPER_PRIMARY_STORAGE_KEY,
|
|
2618
|
+
Qi as WALLPAPER_THEME_SRC_STORAGE_KEY,
|
|
2619
|
+
Ki as WALLPAPER_THEME_STORAGE_KEY,
|
|
2620
|
+
ge as applyThemeFromWallpaper,
|
|
2621
|
+
de as applyWallpaperThemeSeeds,
|
|
2622
|
+
dr as bindCache,
|
|
2623
|
+
ln as callByFrame,
|
|
2624
|
+
so as cover,
|
|
2625
|
+
ho as createImageBitmapCache,
|
|
2626
|
+
wo as electronAPI,
|
|
2627
|
+
Ji as getDominantColors,
|
|
2628
|
+
dn as getWallpaperStoragePointer,
|
|
2629
|
+
vn as initializeAppCanvasLayer,
|
|
2630
|
+
pt as loadCachedWallpaperTheme,
|
|
2631
|
+
xo as qualityMode,
|
|
2632
|
+
ao as rankWallpaperSeeds,
|
|
2633
|
+
mo as resolveAppWallpaperUrl,
|
|
2634
|
+
oo as restoreWallpaperThemeCache,
|
|
2635
|
+
yo as setAppWallpaper,
|
|
2636
|
+
go as setAppWallpaperFromBlob,
|
|
2637
|
+
cn as syncAppWallpaperOrient,
|
|
2638
|
+
vr as syncCanvasOrient,
|
|
2639
|
+
io as themeHosts
|
|
3401
2640
|
};
|