@fest-lib/image 0.1.2 → 0.1.4

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.
Files changed (3) hide show
  1. package/dist/image.js +248 -217
  2. package/dist/index.js +3401 -0
  3. package/package.json +10 -5
package/dist/image.js CHANGED
@@ -1,4 +1,4 @@
1
- var Oo = "electronBridge", Wo = { fast: {
1
+ var Wo = "electronBridge", qo = { fast: {
2
2
  divisor: 4,
3
3
  filter: "blur(4px)",
4
4
  sampling: 128
@@ -183,7 +183,7 @@ var Oo = "electronBridge", Wo = { fast: {
183
183
  }, $a = (e) => Wr(Pa[e.toLowerCase()], 6), Ca = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i, Aa = (e) => {
184
184
  let t;
185
185
  return (t = e.match(Ca)) ? Wr(parseInt(t[1], 16), t[1].length) : void 0;
186
- }, P = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)", qo = `(?:${P}|none)`, le = `${P}%`, Vo = `(?:${P}%|none)`, Vt = `(?:${P}%|${P})`, La = `(?:${P}%|${P}|none)`, Na = `(?:${P}(deg|grad|rad|turn)|${P})`, Do = `(?:${P}(deg|grad|rad|turn)|${P}|none)`, Z = "\\s*,\\s*", Fo = new RegExp("^" + La + "$"), Ra = new RegExp(`^rgba?\\(\\s*${P}${Z}${P}${Z}${P}\\s*(?:,\\s*${Vt}\\s*)?\\)$`), Ia = new RegExp(`^rgba?\\(\\s*${le}${Z}${le}${Z}${le}\\s*(?:,\\s*${Vt}\\s*)?\\)$`), ja = (e) => {
186
+ }, P = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)", Vo = `(?:${P}|none)`, le = `${P}%`, Do = `(?:${P}%|none)`, Vt = `(?:${P}%|${P})`, La = `(?:${P}%|${P}|none)`, Na = `(?:${P}(deg|grad|rad|turn)|${P})`, Fo = `(?:${P}(deg|grad|rad|turn)|${P}|none)`, Z = "\\s*,\\s*", Bo = new RegExp("^" + La + "$"), Ra = new RegExp(`^rgba?\\(\\s*${P}${Z}${P}${Z}${P}\\s*(?:,\\s*${Vt}\\s*)?\\)$`), Ia = new RegExp(`^rgba?\\(\\s*${le}${Z}${le}${Z}${le}\\s*(?:,\\s*${Vt}\\s*)?\\)$`), ja = (e) => {
187
187
  let t = { mode: "rgb" }, r;
188
188
  if (r = e.match(Ra))
189
189
  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);
@@ -194,7 +194,7 @@ var Oo = "electronBridge", Wo = { fast: {
194
194
  }, Ha = (e, t) => e === void 0 ? void 0 : typeof e != "object" ? Ua(e) : e.mode !== void 0 ? e : t ? {
195
195
  ...e,
196
196
  mode: t
197
- } : void 0, Dt = (e = "rgb") => (t) => (t = Ha(t, e)) !== void 0 ? t.mode === e ? t : C[t.mode][e] ? C[t.mode][e](t) : e === "rgb" ? C[t.mode].rgb(t) : C.rgb[e](C[t.mode].rgb(t)) : void 0, C = {}, qr = {}, ke = [], Vr = {}, Oa = (e) => e, y = (e) => (C[e.mode] = {
197
+ } : void 0, Dt = (e = "rgb") => (t) => (t = Ha(t, e)) !== void 0 ? t.mode === e ? t : C[t.mode][e] ? C[t.mode][e](t) : e === "rgb" ? C[t.mode].rgb(t) : C.rgb[e](C[t.mode].rgb(t)) : void 0, C = {}, qr = {}, Ee = [], Vr = {}, Oa = (e) => e, y = (e) => (C[e.mode] = {
198
198
  ...C[e.mode],
199
199
  ...e.toMode
200
200
  }, Object.keys(e.fromMode || {}).forEach((t) => {
@@ -208,7 +208,7 @@ var Oo = "electronBridge", Wo = { fast: {
208
208
  if (typeof e == "string") {
209
209
  if (!t) throw new Error("'mode' required when 'parser' is a string");
210
210
  Vr[e] = t;
211
- } else typeof e == "function" && ke.indexOf(e) < 0 && ke.push(e);
211
+ } else typeof e == "function" && Ee.indexOf(e) < 0 && Ee.push(e);
212
212
  }, zt = /[^\x00-\x7F]|[a-zA-Z_]/, Va = /[^\x00-\x7F]|[-\w]/, u = {
213
213
  Function: "function",
214
214
  Ident: "ident",
@@ -243,7 +243,7 @@ var Da = {
243
243
  function oe(e) {
244
244
  let t = "";
245
245
  if ((e[g] === "-" || e[g] === "+") && (t += e[g++]), t += me(e), e[g] === "." && /\d/.test(e[g + 1]) && (t += e[g++] + me(e)), (e[g] === "e" || e[g] === "E") && ((e[g + 1] === "-" || e[g + 1] === "+") && /\d/.test(e[g + 2]) ? t += e[g++] + e[g++] + me(e) : /\d/.test(e[g + 1]) && (t += e[g++] + me(e))), _t(e)) {
246
- let r = Ee(e);
246
+ let r = Te(e);
247
247
  return r === "deg" || r === "rad" || r === "turn" || r === "grad" ? {
248
248
  type: u.Hue,
249
249
  value: t * Da[r]
@@ -262,13 +262,13 @@ function me(e) {
262
262
  for (; /\d/.test(e[g]); ) t += e[g++];
263
263
  return t;
264
264
  }
265
- function Ee(e) {
265
+ function Te(e) {
266
266
  let t = "";
267
267
  for (; g < e.length && Va.test(e[g]); ) t += e[g++];
268
268
  return t;
269
269
  }
270
270
  function Fa(e) {
271
- let t = Ee(e);
271
+ let t = Te(e);
272
272
  return e[g] === "(" ? (g++, {
273
273
  type: u.Function,
274
274
  value: t
@@ -309,7 +309,7 @@ function Ba(e = "") {
309
309
  if (_t(t)) {
310
310
  r.push({
311
311
  type: u.Ident,
312
- value: Ee(t)
312
+ value: Te(t)
313
313
  });
314
314
  continue;
315
315
  }
@@ -333,7 +333,7 @@ function Ba(e = "") {
333
333
  });
334
334
  continue;
335
335
  }
336
- if (_t(t) && Ee(t) === "none") {
336
+ if (_t(t) && Te(t) === "none") {
337
337
  r.push({
338
338
  type: u.Alpha,
339
339
  value: {
@@ -406,8 +406,8 @@ function Ya(e, t) {
406
406
  var Ua = (e) => {
407
407
  if (typeof e != "string") return;
408
408
  const t = Ba(e), r = t ? Ya(t, !0) : void 0;
409
- let a, n = 0, i = ke.length;
410
- for (; n < i; ) if ((a = ke[n++](e, r)) !== void 0) return a;
409
+ let a, n = 0, i = Ee.length;
410
+ for (; n < i; ) if ((a = Ee[n++](e, r)) !== void 0) return a;
411
411
  return t ? Xa(t) : void 0;
412
412
  };
413
413
  function Za(e, t) {
@@ -475,32 +475,32 @@ var Ja = (e) => e === "transparent" ? {
475
475
  g: 0,
476
476
  b: 0
477
477
  }
478
- }, Ke = (e = 0) => Math.pow(Math.abs(e), 563 / 256) * Math.sign(e), ur = (e) => {
479
- let t = Ke(e.r), r = Ke(e.g), a = Ke(e.b), n = {
478
+ }, Qe = (e = 0) => Math.pow(Math.abs(e), 563 / 256) * Math.sign(e), ur = (e) => {
479
+ let t = Qe(e.r), r = Qe(e.g), a = Qe(e.b), n = {
480
480
  mode: "xyz65",
481
481
  x: 0.5766690429101305 * t + 0.1855582379065463 * r + 0.1882286462349947 * a,
482
482
  y: 0.297344975250536 * t + 0.6273635662554661 * r + 0.0752914584939979 * a,
483
483
  z: 0.0270313613864123 * t + 0.0706888525358272 * r + 0.9913375368376386 * a
484
484
  };
485
485
  return e.alpha !== void 0 && (n.alpha = e.alpha), n;
486
- }, Qe = (e) => Math.pow(Math.abs(e), 256 / 563) * Math.sign(e), cr = ({ x: e, y: t, z: r, alpha: a }) => {
486
+ }, et = (e) => Math.pow(Math.abs(e), 256 / 563) * Math.sign(e), cr = ({ x: e, y: t, z: r, alpha: a }) => {
487
487
  e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
488
488
  let n = {
489
489
  mode: "a98",
490
- r: Qe(e * 2.0415879038107465 - t * 0.5650069742788597 - 0.3447313507783297 * r),
491
- g: Qe(e * -0.9692436362808798 + t * 1.8759675015077206 + 0.0415550574071756 * r),
492
- b: Qe(e * 0.0134442806320312 - t * 0.1183623922310184 + 1.0151749943912058 * r)
490
+ r: et(e * 2.0415879038107465 - t * 0.5650069742788597 - 0.3447313507783297 * r),
491
+ g: et(e * -0.9692436362808798 + t * 1.8759675015077206 + 0.0415550574071756 * r),
492
+ b: et(e * 0.0134442806320312 - t * 0.1183623922310184 + 1.0151749943912058 * r)
493
493
  };
494
494
  return a !== void 0 && (n.alpha = a), n;
495
- }, et = (e = 0) => {
495
+ }, tt = (e = 0) => {
496
496
  const t = Math.abs(e);
497
497
  return t <= 0.04045 ? e / 12.92 : (Math.sign(e) || 1) * Math.pow((t + 0.055) / 1.055, 2.4);
498
498
  }, G = ({ r: e, g: t, b: r, alpha: a }) => {
499
499
  let n = {
500
500
  mode: "lrgb",
501
- r: et(e),
502
- g: et(t),
503
- b: et(r)
501
+ r: tt(e),
502
+ g: tt(t),
503
+ b: tt(r)
504
504
  };
505
505
  return a !== void 0 && (n.alpha = a), n;
506
506
  }, V = (e) => {
@@ -511,15 +511,15 @@ var Ja = (e) => e === "transparent" ? {
511
511
  z: 0.0193308187155918 * t + 0.119194779794626 * r + 0.9505321522496607 * a
512
512
  };
513
513
  return n !== void 0 && (i.alpha = n), i;
514
- }, tt = (e = 0) => {
514
+ }, rt = (e = 0) => {
515
515
  const t = Math.abs(e);
516
516
  return t > 31308e-7 ? (Math.sign(e) || 1) * (1.055 * Math.pow(t, 1 / 2.4) - 0.055) : e * 12.92;
517
517
  }, K = ({ r: e, g: t, b: r, alpha: a }, n = "rgb") => {
518
518
  let i = {
519
519
  mode: n,
520
- r: tt(e),
521
- g: tt(t),
522
- b: tt(r)
520
+ r: rt(e),
521
+ g: rt(t),
522
+ b: rt(r)
523
523
  };
524
524
  return a !== void 0 && (i.alpha = a), i;
525
525
  }, D = ({ x: e, y: t, z: r, alpha: a }) => {
@@ -567,7 +567,7 @@ var Ja = (e) => e === "transparent" ? {
567
567
  e = (e === void 0 ? 0 : e + 120) * rn, r === void 0 && (r = 0);
568
568
  let i = t === void 0 ? 0 : t * r * (1 - r), o = Math.cos(e), s = Math.sin(e);
569
569
  return n.r = r + i * (k[0] * o + k[1] * s), n.g = r + i * (k[2] * o + k[3] * s), n.b = r + i * (k[4] * o + k[5] * s), a !== void 0 && (n.alpha = a), n;
570
- }, Ne = (e, t) => {
570
+ }, Re = (e, t) => {
571
571
  if (e.h === void 0 || t.h === void 0 || !e.s || !t.s) return 0;
572
572
  let r = E(e.h), a = E(t.h), n = Math.sin((a - r + 360) / 2 * Math.PI / 180);
573
573
  return 2 * Math.sqrt(e.s * t.s) * n;
@@ -575,7 +575,7 @@ var Ja = (e) => e === "transparent" ? {
575
575
  if (e.h === void 0 || t.h === void 0) return 0;
576
576
  let r = E(e.h), a = E(t.h);
577
577
  return Math.abs(a - r) > 180 ? r - (a - 360 * Math.sign(a - r)) : a - r;
578
- }, Re = (e, t) => {
578
+ }, Ie = (e, t) => {
579
579
  if (e.h === void 0 || t.h === void 0 || !e.c || !t.c) return 0;
580
580
  let r = E(e.h), a = E(t.h), n = Math.sin((a - r + 360) / 2 * Math.PI / 180);
581
581
  return 2 * Math.sqrt(e.c * t.c) * n;
@@ -620,7 +620,7 @@ var Ja = (e) => e === "transparent" ? {
620
620
  fixup: S
621
621
  }
622
622
  },
623
- difference: { h: Ne },
623
+ difference: { h: Re },
624
624
  average: { h: L }
625
625
  }, I = ({ l: e, a: t, b: r, alpha: a }, n = "lch") => {
626
626
  t === void 0 && (t = 0), r === void 0 && (r = 0);
@@ -647,37 +647,37 @@ var Ja = (e) => e === "transparent" ? {
647
647
  X: 0.3127 / 0.329,
648
648
  Y: 1,
649
649
  Z: 0.3583 / 0.329
650
- }, Bo = Math.pow(29, 3) / Math.pow(3, 3), Xo = Math.pow(6, 3) / Math.pow(29, 3), rt = (e) => Math.pow(e, 3) > Br ? Math.pow(e, 3) : (116 * e - 16) / Fr, Xr = ({ l: e, a: t, b: r, alpha: a }) => {
650
+ }, Xo = Math.pow(29, 3) / Math.pow(3, 3), Yo = Math.pow(6, 3) / Math.pow(29, 3), at = (e) => Math.pow(e, 3) > Br ? Math.pow(e, 3) : (116 * e - 16) / Fr, Xr = ({ l: e, a: t, b: r, alpha: a }) => {
651
651
  e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
652
652
  let n = (e + 16) / 116, i = t / 500 + n, o = n - r / 200, s = {
653
653
  mode: "xyz65",
654
- x: rt(i) * Y.X,
655
- y: rt(n) * Y.Y,
656
- z: rt(o) * Y.Z
654
+ x: at(i) * Y.X,
655
+ y: at(n) * Y.Y,
656
+ z: at(o) * Y.Z
657
657
  };
658
658
  return a !== void 0 && (s.alpha = a), s;
659
- }, Ie = (e) => D(Xr(e)), at = (e) => e > Br ? Math.cbrt(e) : (Fr * e + 16) / 116, Yr = ({ x: e, y: t, z: r, alpha: a }) => {
659
+ }, je = (e) => D(Xr(e)), nt = (e) => e > Br ? Math.cbrt(e) : (Fr * e + 16) / 116, Yr = ({ x: e, y: t, z: r, alpha: a }) => {
660
660
  e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
661
- let n = at(e / Y.X), i = at(t / Y.Y), o = at(r / Y.Z), s = {
661
+ let n = nt(e / Y.X), i = nt(t / Y.Y), o = nt(r / Y.Z), s = {
662
662
  mode: "lab65",
663
663
  l: 116 * i - 16,
664
664
  a: 500 * (n - i),
665
665
  b: 200 * (i - o)
666
666
  };
667
667
  return a !== void 0 && (s.alpha = a), s;
668
- }, je = (e) => {
668
+ }, He = (e) => {
669
669
  let t = Yr(V(e));
670
670
  return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
671
- }, de = 26 / 180 * Math.PI, Te = Math.cos(de), ze = Math.sin(de), Ur = 100 / Math.log(139 / 100), Pt = ({ l: e, c: t, h: r, alpha: a }) => {
671
+ }, de = 26 / 180 * Math.PI, ze = Math.cos(de), _e = Math.sin(de), Ur = 100 / Math.log(139 / 100), Pt = ({ l: e, c: t, h: r, alpha: a }) => {
672
672
  e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
673
673
  let n = {
674
674
  mode: "lab65",
675
675
  l: (Math.exp(e * 1 / Ur) - 1) / 39e-4
676
676
  }, i = (Math.exp(0.0435 * t * 1 * 1) - 1) / 0.075, o = i * Math.cos(r / 180 * Math.PI - de), s = i * Math.sin(r / 180 * Math.PI - de);
677
- return n.a = o * Te - s / 0.83 * ze, n.b = o * ze + s / 0.83 * Te, a !== void 0 && (n.alpha = a), n;
677
+ return n.a = o * ze - s / 0.83 * _e, n.b = o * _e + s / 0.83 * ze, a !== void 0 && (n.alpha = a), n;
678
678
  }, $t = ({ l: e, a: t, b: r, alpha: a }) => {
679
679
  e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
680
- let n = t * Te + r * ze, i = 0.83 * (r * Te - t * ze), o = Math.sqrt(n * n + i * i), s = {
680
+ let n = t * ze + r * _e, i = 0.83 * (r * ze - t * _e), o = Math.sqrt(n * n + i * i), s = {
681
681
  mode: "dlch",
682
682
  l: Ur / 1 * Math.log(1 + 39e-4 * e),
683
683
  c: Math.log(1 + 0.075 * o) / (0.0435 * 1 * 1)
@@ -689,11 +689,11 @@ var Ja = (e) => e === "transparent" ? {
689
689
  serialize: "--din99o-lab",
690
690
  toMode: {
691
691
  lab65: fr,
692
- rgb: (e) => Ie(fr(e))
692
+ rgb: (e) => je(fr(e))
693
693
  },
694
694
  fromMode: {
695
695
  lab65: mr,
696
- rgb: (e) => mr(je(e))
696
+ rgb: (e) => mr(He(e))
697
697
  },
698
698
  channels: [
699
699
  "l",
@@ -722,12 +722,12 @@ var Ja = (e) => e === "transparent" ? {
722
722
  toMode: {
723
723
  lab65: Pt,
724
724
  dlab: (e) => j(e, "dlab"),
725
- rgb: (e) => Ie(Pt(e))
725
+ rgb: (e) => je(Pt(e))
726
726
  },
727
727
  fromMode: {
728
728
  lab65: $t,
729
729
  dlab: (e) => I(e, "dlch"),
730
- rgb: (e) => $t(je(e))
730
+ rgb: (e) => $t(He(e))
731
731
  },
732
732
  channels: [
733
733
  "l",
@@ -752,7 +752,7 @@ var Ja = (e) => e === "transparent" ? {
752
752
  fixup: S
753
753
  }
754
754
  },
755
- difference: { h: Re },
755
+ difference: { h: Ie },
756
756
  average: { h: L }
757
757
  };
758
758
  function cn({ h: e, s: t, i: r, alpha: a }) {
@@ -845,7 +845,7 @@ var pn = {
845
845
  fixup: S
846
846
  }
847
847
  },
848
- difference: { h: Ne },
848
+ difference: { h: Re },
849
849
  average: { h: L }
850
850
  };
851
851
  function vn({ h: e, s: t, l: r, alpha: a }) {
@@ -972,7 +972,7 @@ var Zr = {
972
972
  fixup: S
973
973
  }
974
974
  },
975
- difference: { h: Ne },
975
+ difference: { h: Re },
976
976
  average: { h: L }
977
977
  };
978
978
  function Jr({ h: e, s: t, v: r, alpha: a }) {
@@ -1065,7 +1065,7 @@ var Kr = {
1065
1065
  fixup: S
1066
1066
  }
1067
1067
  },
1068
- difference: { h: Ne },
1068
+ difference: { h: Re },
1069
1069
  average: { h: L }
1070
1070
  };
1071
1071
  function Mn({ h: e, w: t, b: r, alpha: a }) {
@@ -1135,28 +1135,28 @@ var Sn = {
1135
1135
  },
1136
1136
  difference: { h: sn },
1137
1137
  average: { h: L }
1138
- }, He = 0.1593017578125, Qr = 78.84375, Oe = 0.8359375, We = 18.8515625, qe = 18.6875;
1139
- function nt(e) {
1138
+ }, Oe = 0.1593017578125, Qr = 78.84375, We = 0.8359375, qe = 18.8515625, Ve = 18.6875;
1139
+ function it(e) {
1140
1140
  if (e < 0) return 0;
1141
1141
  const t = Math.pow(e, 1 / Qr);
1142
- return 1e4 * Math.pow(Math.max(0, t - Oe) / (We - qe * t), 1 / He);
1142
+ return 1e4 * Math.pow(Math.max(0, t - We) / (qe - Ve * t), 1 / Oe);
1143
1143
  }
1144
- function it(e) {
1144
+ function ot(e) {
1145
1145
  if (e < 0) return 0;
1146
- const t = Math.pow(e / 1e4, He);
1147
- return Math.pow((Oe + We * t) / (1 + qe * t), Qr);
1146
+ const t = Math.pow(e / 1e4, Oe);
1147
+ return Math.pow((We + qe * t) / (1 + Ve * t), Qr);
1148
1148
  }
1149
- var ot = (e) => Math.max(e / 203, 0), gr = ({ i: e, t, p: r, alpha: a }) => {
1149
+ var st = (e) => Math.max(e / 203, 0), gr = ({ i: e, t, p: r, alpha: a }) => {
1150
1150
  e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
1151
- const n = nt(e + 0.008609037037932761 * t + 0.11102962500302593 * r), i = nt(e - 0.00860903703793275 * t - 0.11102962500302599 * r), o = nt(e + 0.5600313357106791 * t - 0.32062717498731885 * r), s = {
1151
+ const n = it(e + 0.008609037037932761 * t + 0.11102962500302593 * r), i = it(e - 0.00860903703793275 * t - 0.11102962500302599 * r), o = it(e + 0.5600313357106791 * t - 0.32062717498731885 * r), s = {
1152
1152
  mode: "xyz65",
1153
- x: ot(2.070152218389422 * n - 1.3263473389671556 * i + 0.2066510476294051 * o),
1154
- y: ot(0.3647385209748074 * n + 0.680566024947227 * i - 0.0453045459220346 * o),
1155
- z: ot(-0.049747207535812 * n - 0.0492609666966138 * i + 1.1880659249923042 * o)
1153
+ x: st(2.070152218389422 * n - 1.3263473389671556 * i + 0.2066510476294051 * o),
1154
+ y: st(0.3647385209748074 * n + 0.680566024947227 * i - 0.0453045459220346 * o),
1155
+ z: st(-0.049747207535812 * n - 0.0492609666966138 * i + 1.1880659249923042 * o)
1156
1156
  };
1157
1157
  return a !== void 0 && (s.alpha = a), s;
1158
- }, st = (e = 0) => Math.max(e * 203, 0), br = ({ x: e, y: t, z: r, alpha: a }) => {
1159
- const n = st(e), i = st(t), o = st(r), s = it(0.3592832590121217 * n + 0.6976051147779502 * i - 0.0358915932320289 * o), l = it(-0.1920808463704995 * n + 1.1004767970374323 * i + 0.0753748658519118 * o), d = it(0.0070797844607477 * n + 0.0748396662186366 * i + 0.8433265453898765 * o), p = {
1158
+ }, lt = (e = 0) => Math.max(e * 203, 0), br = ({ x: e, y: t, z: r, alpha: a }) => {
1159
+ const n = lt(e), i = lt(t), o = lt(r), s = ot(0.3592832590121217 * n + 0.6976051147779502 * i - 0.0358915932320289 * o), l = ot(-0.1920808463704995 * n + 1.1004767970374323 * i + 0.0753748658519118 * o), d = ot(0.0070797844607477 * n + 0.0748396662186366 * i + 0.8433265453898765 * o), p = {
1160
1160
  mode: "itp",
1161
1161
  i: 0.5 * s + 0.5 * l,
1162
1162
  t: 1.61376953125 * s - 3.323486328125 * l + 1.709716796875 * d,
@@ -1195,30 +1195,30 @@ var ot = (e) => Math.max(e / 203, 0), gr = ({ i: e, t, p: r, alpha: a }) => {
1195
1195
  fixup: S
1196
1196
  }
1197
1197
  }
1198
- }, En = 134.03437499999998, Tn = 16295499532821565e-27, lt = (e) => {
1198
+ }, En = 134.03437499999998, Tn = 16295499532821565e-27, dt = (e) => {
1199
1199
  if (e < 0) return 0;
1200
- let t = Math.pow(e / 1e4, He);
1201
- return Math.pow((Oe + We * t) / (1 + qe * t), En);
1202
- }, dt = (e = 0) => Math.max(e * 203, 0), ea = ({ x: e, y: t, z: r, alpha: a }) => {
1203
- e = dt(e), t = dt(t), r = dt(r);
1204
- let n = 1.15 * e - 0.15 * r, i = 0.66 * t + 0.34 * e, o = lt(0.41478972 * n + 0.579999 * i + 0.014648 * r), s = lt(-0.20151 * n + 1.120649 * i + 0.0531008 * r), l = lt(-0.0166008 * n + 0.2648 * i + 0.6684799 * r), d = (o + s) / 2, p = {
1200
+ let t = Math.pow(e / 1e4, Oe);
1201
+ return Math.pow((We + qe * t) / (1 + Ve * t), En);
1202
+ }, ut = (e = 0) => Math.max(e * 203, 0), ea = ({ x: e, y: t, z: r, alpha: a }) => {
1203
+ e = ut(e), t = ut(t), r = ut(r);
1204
+ let n = 1.15 * e - 0.15 * r, i = 0.66 * t + 0.34 * e, o = dt(0.41478972 * n + 0.579999 * i + 0.014648 * r), s = dt(-0.20151 * n + 1.120649 * i + 0.0531008 * r), l = dt(-0.0166008 * n + 0.2648 * i + 0.6684799 * r), d = (o + s) / 2, p = {
1205
1205
  mode: "jab",
1206
1206
  j: 0.44 * d / (1 - 0.56 * d) - Tn,
1207
1207
  a: 3.524 * o - 4.066708 * s + 0.542708 * l,
1208
1208
  b: 0.199076 * o + 1.096799 * s - 1.295875 * l
1209
1209
  };
1210
1210
  return a !== void 0 && (p.alpha = a), p;
1211
- }, zn = 134.03437499999998, yr = 16295499532821565e-27, ut = (e) => {
1211
+ }, zn = 134.03437499999998, yr = 16295499532821565e-27, ct = (e) => {
1212
1212
  if (e < 0) return 0;
1213
1213
  let t = Math.pow(e, 1 / zn);
1214
- return 1e4 * Math.pow((Oe - t) / (qe * t - We), 1 / He);
1215
- }, ct = (e) => e / 203, ta = ({ j: e, a: t, b: r, alpha: a }) => {
1214
+ return 1e4 * Math.pow((We - t) / (Ve * t - qe), 1 / Oe);
1215
+ }, ht = (e) => e / 203, ta = ({ j: e, a: t, b: r, alpha: a }) => {
1216
1216
  e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
1217
- let n = (e + yr) / (0.44 + 0.56 * (e + yr)), i = ut(n + 0.13860504 * t + 0.058047316 * r), o = ut(n - 0.13860504 * t - 0.058047316 * r), s = ut(n - 0.096019242 * t - 0.8118919 * r), l = {
1217
+ let n = (e + yr) / (0.44 + 0.56 * (e + yr)), i = ct(n + 0.13860504 * t + 0.058047316 * r), o = ct(n - 0.13860504 * t - 0.058047316 * r), s = ct(n - 0.096019242 * t - 0.8118919 * r), l = {
1218
1218
  mode: "xyz65",
1219
- x: ct(1.661373024652174 * i - 0.914523081304348 * o + 0.23136208173913045 * s),
1220
- y: ct(-0.3250758611844533 * i + 1.571847026732543 * o - 0.21825383453227928 * s),
1221
- z: ct(-0.090982811 * i - 0.31272829 * o + 1.5227666 * s)
1219
+ x: ht(1.661373024652174 * i - 0.914523081304348 * o + 0.23136208173913045 * s),
1220
+ y: ht(-0.3250758611844533 * i + 1.571847026732543 * o - 0.21825383453227928 * s),
1221
+ z: ht(-0.090982811 * i - 0.31272829 * o + 1.5227666 * s)
1222
1222
  };
1223
1223
  return a !== void 0 && (l.alpha = a), l;
1224
1224
  }, ra = (e) => {
@@ -1308,15 +1308,15 @@ var ot = (e) => Math.max(e / 203, 0), gr = ({ i: e, t, p: r, alpha: a }) => {
1308
1308
  fixup: S
1309
1309
  }
1310
1310
  },
1311
- difference: { h: Re },
1311
+ difference: { h: Ie },
1312
1312
  average: { h: L }
1313
- }, Ve = Math.pow(29, 3) / Math.pow(3, 3), Ft = Math.pow(6, 3) / Math.pow(29, 3), ht = (e) => Math.pow(e, 3) > Ft ? Math.pow(e, 3) : (116 * e - 16) / Ve, Bt = ({ l: e, a: t, b: r, alpha: a }) => {
1313
+ }, De = Math.pow(29, 3) / Math.pow(3, 3), Ft = Math.pow(6, 3) / Math.pow(29, 3), pt = (e) => Math.pow(e, 3) > Ft ? Math.pow(e, 3) : (116 * e - 16) / De, Bt = ({ l: e, a: t, b: r, alpha: a }) => {
1314
1314
  e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
1315
1315
  let n = (e + 16) / 116, i = t / 500 + n, o = n - r / 200, s = {
1316
1316
  mode: "xyz50",
1317
- x: ht(i) * x.X,
1318
- y: ht(n) * x.Y,
1319
- z: ht(o) * x.Z
1317
+ x: pt(i) * x.X,
1318
+ y: pt(n) * x.Y,
1319
+ z: pt(o) * x.Z
1320
1320
  };
1321
1321
  return a !== void 0 && (s.alpha = a), s;
1322
1322
  }, he = ({ x: e, y: t, z: r, alpha: a }) => {
@@ -1335,9 +1335,9 @@ var ot = (e) => Math.max(e / 203, 0), gr = ({ i: e, t, p: r, alpha: a }) => {
1335
1335
  z: 0.013923904500943465 * t + 0.09708128566574634 * r + 0.7140993584005155 * a
1336
1336
  };
1337
1337
  return n !== void 0 && (i.alpha = n), i;
1338
- }, pt = (e) => e > Ft ? Math.cbrt(e) : (Ve * e + 16) / 116, Xt = ({ x: e, y: t, z: r, alpha: a }) => {
1338
+ }, vt = (e) => e > Ft ? Math.cbrt(e) : (De * e + 16) / 116, Xt = ({ x: e, y: t, z: r, alpha: a }) => {
1339
1339
  e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
1340
- let n = pt(e / x.X), i = pt(t / x.Y), o = pt(r / x.Z), s = {
1340
+ let n = vt(e / x.X), i = vt(t / x.Y), o = vt(r / x.Z), s = {
1341
1341
  mode: "lab",
1342
1342
  l: 116 * i - 16,
1343
1343
  a: 500 * (n - i),
@@ -1393,11 +1393,11 @@ var Yt = {
1393
1393
  serialize: "--lab-d65",
1394
1394
  toMode: {
1395
1395
  xyz65: Xr,
1396
- rgb: Ie
1396
+ rgb: je
1397
1397
  },
1398
1398
  fromMode: {
1399
1399
  xyz65: Yr,
1400
- rgb: je
1400
+ rgb: He
1401
1401
  },
1402
1402
  ranges: {
1403
1403
  l: [0, 100],
@@ -1453,7 +1453,7 @@ var Ut = {
1453
1453
  fixup: S
1454
1454
  }
1455
1455
  },
1456
- difference: { h: Re },
1456
+ difference: { h: Ie },
1457
1457
  average: { h: L }
1458
1458
  }, Ln = {
1459
1459
  ...Ut,
@@ -1462,10 +1462,10 @@ var Ut = {
1462
1462
  serialize: "--lch-d65",
1463
1463
  toMode: {
1464
1464
  lab65: (e) => j(e, "lab65"),
1465
- rgb: (e) => Ie(j(e, "lab65"))
1465
+ rgb: (e) => je(j(e, "lab65"))
1466
1466
  },
1467
1467
  fromMode: {
1468
- rgb: (e) => I(je(e), "lch65"),
1468
+ rgb: (e) => I(He(e), "lch65"),
1469
1469
  lab65: (e) => I(e, "lch65")
1470
1470
  },
1471
1471
  ranges: {
@@ -1490,7 +1490,7 @@ var Ut = {
1490
1490
  v: t ? t * Math.sin(r / 180 * Math.PI) : 0
1491
1491
  };
1492
1492
  return a !== void 0 && (n.alpha = a), n;
1493
- }, la = (e, t, r) => 4 * e / (e + 15 * t + 3 * r), da = (e, t, r) => 9 * t / (e + 15 * t + 3 * r), Nn = la(x.X, x.Y, x.Z), Rn = da(x.X, x.Y, x.Z), In = (e) => e <= Ft ? Ve * e : 116 * Math.cbrt(e) - 16, Ct = ({ x: e, y: t, z: r, alpha: a }) => {
1493
+ }, la = (e, t, r) => 4 * e / (e + 15 * t + 3 * r), da = (e, t, r) => 9 * t / (e + 15 * t + 3 * r), Nn = la(x.X, x.Y, x.Z), Rn = da(x.X, x.Y, x.Z), In = (e) => e <= Ft ? De * e : 116 * Math.cbrt(e) - 16, Ct = ({ x: e, y: t, z: r, alpha: a }) => {
1494
1494
  e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
1495
1495
  let n = In(t / x.Y), i = la(e, t, r), o = da(e, t, r);
1496
1496
  !isFinite(i) || !isFinite(o) ? n = i = o = 0 : (i = 13 * n * (i - Nn), o = 13 * n * (o - Rn));
@@ -1509,7 +1509,7 @@ var Ut = {
1509
1509
  z: 0
1510
1510
  };
1511
1511
  t === void 0 && (t = 0), r === void 0 && (r = 0);
1512
- let n = t / (13 * e) + On, i = r / (13 * e) + Wn, o = x.Y * (e <= 8 ? e / Ve : Math.pow((e + 16) / 116, 3)), s = {
1512
+ let n = t / (13 * e) + On, i = r / (13 * e) + Wn, o = x.Y * (e <= 8 ? e / De : Math.pow((e + 16) / 116, 3)), s = {
1513
1513
  mode: "xyz50",
1514
1514
  x: o * (9 * n) / (4 * i),
1515
1515
  y: o,
@@ -1551,7 +1551,7 @@ var Ut = {
1551
1551
  fixup: S
1552
1552
  }
1553
1553
  },
1554
- difference: { h: Re },
1554
+ difference: { h: Ie },
1555
1555
  average: { h: L }
1556
1556
  }, Fn = {
1557
1557
  ...J,
@@ -1601,7 +1601,7 @@ var Ut = {
1601
1601
  b: 0.0259040424655478 * n + 0.7827717124575296 * i - 0.8086757549230774 * o
1602
1602
  };
1603
1603
  return a !== void 0 && (s.alpha = a), s;
1604
- }, De = (e) => {
1604
+ }, Fe = (e) => {
1605
1605
  let t = ua(G(e));
1606
1606
  return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
1607
1607
  }, ve = ({ l: e, a: t, b: r, alpha: a }) => {
@@ -1613,12 +1613,12 @@ var Ut = {
1613
1613
  b: -0.0041960761386756 * n - 0.7034186179359362 * i + 1.7076146940746117 * o
1614
1614
  };
1615
1615
  return a !== void 0 && (s.alpha = a), s;
1616
- }, Fe = (e) => K(ve(e));
1616
+ }, Be = (e) => K(ve(e));
1617
1617
  function Lt(e) {
1618
1618
  const a = 1.170873786407767;
1619
1619
  return 0.5 * (a * e - 0.206 + Math.sqrt((a * e - 0.206) * (a * e - 0.206) + 4 * 0.03 * a * e));
1620
1620
  }
1621
- function _e(e) {
1621
+ function Pe(e) {
1622
1622
  return (e * e + 0.206 * e) / (1.206 / 1.03 * (e + 0.03));
1623
1623
  }
1624
1624
  function Xn(e, t) {
@@ -1648,8 +1648,8 @@ function Yn(e, t, r, a, n, i = null) {
1648
1648
  {
1649
1649
  let s = r - n, l = a, d = 0.3963377774 * e + 0.2158037573 * t, p = -0.1055613458 * e - 0.0638541728 * t, v = -0.0894841775 * e - 1.291485548 * t, c = s + l * d, m = s + l * p, f = s + l * v;
1650
1650
  {
1651
- let b = n * (1 - o) + o * r, M = o * a, z = b + M * d, T = b + M * p, N = b + M * v, Q = z * z * z, ee = T * T * T, te = N * N * N, re = 3 * c * z * z, ae = 3 * m * T * T, ne = 3 * f * N * N, F = 6 * c * c * z, W = 6 * m * m * T, ie = 6 * f * f * N, nr = 4.0767416621 * Q - 3.3077115913 * ee + 0.2309699292 * te - 1, Xe = 4.0767416621 * re - 3.3077115913 * ae + 0.2309699292 * ne, Ta = 4.0767416621 * F - 3.3077115913 * W + 0.2309699292 * ie, ir = Xe / (Xe * Xe - 0.5 * nr * Ta), Ye = -nr * ir, or = -1.2684380046 * Q + 2.6097574011 * ee - 0.3413193965 * te - 1, Ue = -1.2684380046 * re + 2.6097574011 * ae - 0.3413193965 * ne, za = -1.2684380046 * F + 2.6097574011 * W - 0.3413193965 * ie, sr = Ue / (Ue * Ue - 0.5 * or * za), Ze = -or * sr, lr = -0.0041960863 * Q - 0.7034186147 * ee + 1.707614701 * te - 1, Je = -0.0041960863 * re - 0.7034186147 * ae + 1.707614701 * ne, _a = -0.0041960863 * F - 0.7034186147 * W + 1.707614701 * ie, dr = Je / (Je * Je - 0.5 * lr * _a), Ge = -lr * dr;
1652
- Ye = ir >= 0 ? Ye : 1e6, Ze = sr >= 0 ? Ze : 1e6, Ge = dr >= 0 ? Ge : 1e6, o += Math.min(Ye, Math.min(Ze, Ge));
1651
+ let b = n * (1 - o) + o * r, M = o * a, z = b + M * d, T = b + M * p, N = b + M * v, Q = z * z * z, ee = T * T * T, te = N * N * N, re = 3 * c * z * z, ae = 3 * m * T * T, ne = 3 * f * N * N, F = 6 * c * c * z, W = 6 * m * m * T, ie = 6 * f * f * N, nr = 4.0767416621 * Q - 3.3077115913 * ee + 0.2309699292 * te - 1, Ye = 4.0767416621 * re - 3.3077115913 * ae + 0.2309699292 * ne, Ta = 4.0767416621 * F - 3.3077115913 * W + 0.2309699292 * ie, ir = Ye / (Ye * Ye - 0.5 * nr * Ta), Ue = -nr * ir, or = -1.2684380046 * Q + 2.6097574011 * ee - 0.3413193965 * te - 1, Ze = -1.2684380046 * re + 2.6097574011 * ae - 0.3413193965 * ne, za = -1.2684380046 * F + 2.6097574011 * W - 0.3413193965 * ie, sr = Ze / (Ze * Ze - 0.5 * or * za), Je = -or * sr, lr = -0.0041960863 * Q - 0.7034186147 * ee + 1.707614701 * te - 1, Ge = -0.0041960863 * re - 0.7034186147 * ae + 1.707614701 * ne, _a = -0.0041960863 * F - 0.7034186147 * W + 1.707614701 * ie, dr = Ge / (Ge * Ge - 0.5 * lr * _a), Ke = -lr * dr;
1652
+ Ue = ir >= 0 ? Ue : 1e6, Je = sr >= 0 ? Je : 1e6, Ke = dr >= 0 ? Ke : 1e6, o += Math.min(Ue, Math.min(Je, Ke));
1653
1653
  }
1654
1654
  }
1655
1655
  }
@@ -1691,7 +1691,7 @@ function Sr(e) {
1691
1691
  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
1692
  const n = {
1693
1693
  mode: "oklab",
1694
- l: _e(a)
1694
+ l: Pe(a)
1695
1695
  };
1696
1696
  if (e.alpha !== void 0 && (n.alpha = e.alpha), !r || a === 1)
1697
1697
  return n.a = n.b = 0, n;
@@ -1713,15 +1713,15 @@ var Un = {
1713
1713
  serialize: "--okhsl",
1714
1714
  fromMode: {
1715
1715
  oklab: xr,
1716
- rgb: (e) => xr(De(e))
1716
+ rgb: (e) => xr(Fe(e))
1717
1717
  },
1718
1718
  toMode: {
1719
1719
  oklab: Sr,
1720
- rgb: (e) => Fe(Sr(e))
1720
+ rgb: (e) => Be(Sr(e))
1721
1721
  }
1722
1722
  };
1723
1723
  function kr(e) {
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, n = Math.sqrt(r * r + a * a), i = n ? r / n : 1, o = n ? a / n : 1, [s, l] = Jt(i, o), d = 0.5, p = 1 - d / s, v = l / (n + t * l), c = v * t, m = v * n, f = _e(c), b = m * f / c, M = ve({
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, n = Math.sqrt(r * r + a * a), i = n ? r / n : 1, o = n ? a / n : 1, [s, l] = Jt(i, o), d = 0.5, p = 1 - d / s, v = l / (n + t * l), c = v * t, m = v * n, f = Pe(c), b = m * f / c, M = ve({
1725
1725
  l: f,
1726
1726
  a: i * b,
1727
1727
  b: o * b
@@ -1737,11 +1737,11 @@ function kr(e) {
1737
1737
  function Er(e) {
1738
1738
  const t = { mode: "oklab" };
1739
1739
  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, n = e.v !== void 0 ? e.v : 0, i = Math.cos(r / 180 * Math.PI), o = Math.sin(r / 180 * Math.PI), [s, l] = Jt(i, o), d = 0.5, p = 1 - d / s, v = 1 - a * d / (d + l - l * p * a), c = a * l * d / (d + l - l * p * a), m = _e(v), f = c * m / v, b = ve({
1740
+ const r = e.h !== void 0 ? e.h : 0, a = e.s !== void 0 ? e.s : 0, n = e.v !== void 0 ? e.v : 0, i = Math.cos(r / 180 * Math.PI), o = Math.sin(r / 180 * Math.PI), [s, l] = Jt(i, o), d = 0.5, p = 1 - d / s, v = 1 - a * d / (d + l - l * p * a), c = a * l * d / (d + l - l * p * a), m = Pe(v), f = c * m / v, b = ve({
1741
1741
  l: m,
1742
1742
  a: i * f,
1743
1743
  b: o * f
1744
- }), M = Math.cbrt(1 / Math.max(b.r, b.g, b.b, 0)), z = _e(n * v), T = c * z / v;
1744
+ }), M = Math.cbrt(1 / Math.max(b.r, b.g, b.b, 0)), z = Pe(n * v), T = c * z / v;
1745
1745
  return t.l = z * M, t.a = T * i * M, t.b = T * o * M, t;
1746
1746
  }
1747
1747
  var Zn = {
@@ -1757,11 +1757,11 @@ var Zn = {
1757
1757
  serialize: "--okhsv",
1758
1758
  fromMode: {
1759
1759
  oklab: kr,
1760
- rgb: (e) => kr(De(e))
1760
+ rgb: (e) => kr(Fe(e))
1761
1761
  },
1762
1762
  toMode: {
1763
1763
  oklab: Er,
1764
- rgb: (e) => Fe(Er(e))
1764
+ rgb: (e) => Be(Er(e))
1765
1765
  }
1766
1766
  };
1767
1767
  function Jn(e, t) {
@@ -1775,11 +1775,11 @@ var Gn = {
1775
1775
  mode: "oklab",
1776
1776
  toMode: {
1777
1777
  lrgb: ve,
1778
- rgb: Fe
1778
+ rgb: Be
1779
1779
  },
1780
1780
  fromMode: {
1781
1781
  lrgb: ua,
1782
- rgb: De
1782
+ rgb: Fe
1783
1783
  },
1784
1784
  ranges: {
1785
1785
  l: [0, 1],
@@ -1807,10 +1807,10 @@ var Qn = {
1807
1807
  mode: "oklch",
1808
1808
  toMode: {
1809
1809
  oklab: (e) => j(e, "oklab"),
1810
- rgb: (e) => Fe(j(e, "oklab"))
1810
+ rgb: (e) => Be(j(e, "oklab"))
1811
1811
  },
1812
1812
  fromMode: {
1813
- rgb: (e) => I(De(e), "oklch"),
1813
+ rgb: (e) => I(Fe(e), "oklch"),
1814
1814
  oklab: (e) => I(e, "oklch")
1815
1815
  },
1816
1816
  parse: [Kn],
@@ -1849,23 +1849,23 @@ var Qn = {
1849
1849
  rgb: (e) => D(Tr(e)),
1850
1850
  xyz65: Tr
1851
1851
  }
1852
- }, vt = (e) => {
1852
+ }, ft = (e) => {
1853
1853
  let t = Math.abs(e);
1854
1854
  return t >= 1 / 512 ? Math.sign(e) * Math.pow(t, 1 / 1.8) : 16 * e;
1855
1855
  }, _r = ({ x: e, y: t, z: r, alpha: a }) => {
1856
1856
  e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
1857
1857
  let n = {
1858
1858
  mode: "prophoto",
1859
- r: vt(e * 1.3457868816471585 - t * 0.2555720873797946 - 0.0511018649755453 * r),
1860
- g: vt(e * -0.5446307051249019 + t * 1.5082477428451466 + 0.0205274474364214 * r),
1861
- b: vt(e * 0 + t * 0 + 1.2119675456389452 * r)
1859
+ r: ft(e * 1.3457868816471585 - t * 0.2555720873797946 - 0.0511018649755453 * r),
1860
+ g: ft(e * -0.5446307051249019 + t * 1.5082477428451466 + 0.0205274474364214 * r),
1861
+ b: ft(e * 0 + t * 0 + 1.2119675456389452 * r)
1862
1862
  };
1863
1863
  return a !== void 0 && (n.alpha = a), n;
1864
- }, ft = (e = 0) => {
1864
+ }, mt = (e = 0) => {
1865
1865
  let t = Math.abs(e);
1866
1866
  return t >= 16 / 512 ? Math.sign(e) * Math.pow(t, 1.8) : e / 16;
1867
1867
  }, Pr = (e) => {
1868
- let t = ft(e.r), r = ft(e.g), a = ft(e.b), n = {
1868
+ let t = mt(e.r), r = mt(e.g), a = mt(e.b), n = {
1869
1869
  mode: "xyz50",
1870
1870
  x: 0.7977666449006423 * t + 0.1351812974005331 * r + 0.0313477341283922 * a,
1871
1871
  y: 0.2880748288194013 * t + 0.7118352342418731 * r + 899369387256e-16 * a,
@@ -1885,23 +1885,23 @@ var Qn = {
1885
1885
  xyz50: Pr,
1886
1886
  rgb: (e) => he(Pr(e))
1887
1887
  }
1888
- }, $r = 1.09929682680944, ri = 0.018053968510807, mt = (e) => {
1888
+ }, $r = 1.09929682680944, ri = 0.018053968510807, gt = (e) => {
1889
1889
  const t = Math.abs(e);
1890
1890
  return t > ri ? (Math.sign(e) || 1) * ($r * Math.pow(t, 0.45) - ($r - 1)) : 4.5 * e;
1891
1891
  }, Cr = ({ x: e, y: t, z: r, alpha: a }) => {
1892
1892
  e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
1893
1893
  let n = {
1894
1894
  mode: "rec2020",
1895
- r: mt(e * 1.7166511879712683 - t * 0.3556707837763925 - 0.2533662813736599 * r),
1896
- g: mt(e * -0.6666843518324893 + t * 1.6164812366349395 + 0.0157685458139111 * r),
1897
- b: mt(e * 0.0176398574453108 - t * 0.0427706132578085 + 0.9421031212354739 * r)
1895
+ r: gt(e * 1.7166511879712683 - t * 0.3556707837763925 - 0.2533662813736599 * r),
1896
+ g: gt(e * -0.6666843518324893 + t * 1.6164812366349395 + 0.0157685458139111 * r),
1897
+ b: gt(e * 0.0176398574453108 - t * 0.0427706132578085 + 0.9421031212354739 * r)
1898
1898
  };
1899
1899
  return a !== void 0 && (n.alpha = a), n;
1900
- }, Ar = 1.09929682680944, ai = 0.018053968510807, gt = (e = 0) => {
1900
+ }, Ar = 1.09929682680944, ai = 0.018053968510807, bt = (e = 0) => {
1901
1901
  let t = Math.abs(e);
1902
1902
  return t < ai * 4.5 ? e / 4.5 : (Math.sign(e) || 1) * Math.pow((t + Ar - 1) / Ar, 1 / 0.45);
1903
1903
  }, Lr = (e) => {
1904
- let t = gt(e.r), r = gt(e.g), a = gt(e.b), n = {
1904
+ let t = bt(e.r), r = bt(e.g), a = bt(e.b), n = {
1905
1905
  mode: "xyz65",
1906
1906
  x: 0.6369580483012911 * t + 0.1446169035862083 * r + 0.1688809751641721 * a,
1907
1907
  y: 0.262700212011267 * t + 0.6779980715188708 * r + 0.059301716469862 * a,
@@ -1921,17 +1921,17 @@ var Qn = {
1921
1921
  },
1922
1922
  parse: ["rec2020"],
1923
1923
  serialize: "rec2020"
1924
- }, q = 0.0037930732552754493, ha = Math.cbrt(q), bt = (e) => Math.cbrt(e) - ha, ii = (e) => {
1925
- const { r: t, g: r, b: a, alpha: n } = G(e), i = bt(0.3 * t + 0.622 * r + 0.078 * a + q), o = bt(0.23 * t + 0.692 * r + 0.078 * a + q), s = bt(0.2434226892454782 * t + 0.2047674442449682 * r + 0.5518098665095535 * a + q), l = {
1924
+ }, q = 0.0037930732552754493, ha = Math.cbrt(q), yt = (e) => Math.cbrt(e) - ha, ii = (e) => {
1925
+ const { r: t, g: r, b: a, alpha: n } = G(e), i = yt(0.3 * t + 0.622 * r + 0.078 * a + q), o = yt(0.23 * t + 0.692 * r + 0.078 * a + q), s = yt(0.2434226892454782 * t + 0.2047674442449682 * r + 0.5518098665095535 * a + q), l = {
1926
1926
  mode: "xyb",
1927
1927
  x: (i - o) / 2,
1928
1928
  y: (i + o) / 2,
1929
1929
  b: s - (i + o) / 2
1930
1930
  };
1931
1931
  return n !== void 0 && (l.alpha = n), l;
1932
- }, yt = (e) => Math.pow(e + ha, 3), oi = ({ x: e, y: t, b: r, alpha: a }) => {
1932
+ }, Mt = (e) => Math.pow(e + ha, 3), oi = ({ x: e, y: t, b: r, alpha: a }) => {
1933
1933
  e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = 0);
1934
- const n = yt(e + t) - q, i = yt(t - e) - q, o = yt(r + t) - q, s = K({
1934
+ const n = Mt(e + t) - q, i = Mt(t - e) - q, o = Mt(r + t) - q, s = K({
1935
1935
  r: 11.031566904639861 * n - 9.866943908131562 * i - 0.16462299650829934 * o,
1936
1936
  g: -3.2541473810744237 * n + 4.418770377582723 * i - 0.16462299650829934 * o,
1937
1937
  b: -3.6588512867136815 * n + 2.7129230459360922 * i + 1.9459282407775895 * o
@@ -2090,11 +2090,11 @@ var Qn = {
2090
2090
  fixup: S
2091
2091
  }
2092
2092
  }
2093
- }, fi = (e, t) => Math.round(e * (t = Math.pow(10, t))) / t, mi = (e = 4) => (t) => typeof t == "number" ? fi(t, e) : t, Yo = mi(2), gi = (e) => Math.max(0, Math.min(1, e || 0)), Mt = (e) => Math.round(gi(e) * 255), bi = Dt("rgb"), Uo = Dt("hsl"), yi = (e) => {
2093
+ }, fi = (e, t) => Math.round(e * (t = Math.pow(10, t))) / t, mi = (e = 4) => (t) => typeof t == "number" ? fi(t, e) : t, Uo = mi(2), gi = (e) => Math.max(0, Math.min(1, e || 0)), wt = (e) => Math.round(gi(e) * 255), bi = Dt("rgb"), Zo = Dt("hsl"), yi = (e) => {
2094
2094
  if (e === void 0) return;
2095
- let t = Mt(e.r), r = Mt(e.g), a = Mt(e.b);
2095
+ let t = wt(e.r), r = wt(e.g), a = wt(e.b);
2096
2096
  return "#" + (1 << 24 | t << 16 | r << 8 | a).toString(16).slice(1);
2097
- }, pa = (e) => yi(bi(e)), Zo = y(en), Jo = y(ln), Go = y(dn), Ko = y(un), Qo = y(pn), es = y(Zr), ts = y(Kr), rs = y(Sn), as = y(kn), ns = y(_n), is = y(Pn), os = y(Yt), ss = y(Cn), ls = y(Ut), ds = y(Ln), us = y(Dn), cs = y(Fn), hs = y(Bn), ps = y(Un), vs = y(Zn), fs = y(Gn), Nt = y(Qn), ms = y(ei), gs = y(ti), bs = y(ni), ys = y(J), Ms = y(si), ws = y(li), xs = y(ci), Ss = y(vi), va = (e, t = "l") => e.sort((r, a) => Math.sign(Nt({
2097
+ }, pa = (e) => yi(bi(e)), Jo = y(en), Go = y(ln), Ko = y(dn), Qo = y(un), es = y(pn), ts = y(Zr), rs = y(Kr), as = y(Sn), ns = y(kn), is = y(_n), os = y(Pn), ss = y(Yt), ls = y(Cn), ds = y(Ut), us = y(Ln), cs = y(Dn), hs = y(Fn), ps = y(Bn), vs = y(Un), fs = y(Zn), ms = y(Gn), Nt = y(Qn), gs = y(ei), bs = y(ti), ys = y(ni), Ms = y(J), ws = y(si), xs = y(li), Ss = y(ci), ks = y(vi), va = (e, t = "l") => e.sort((r, a) => Math.sign(Nt({
2098
2098
  mode: "rgb",
2099
2099
  r: r[0],
2100
2100
  g: r[1],
@@ -2247,7 +2247,7 @@ var Qn = {
2247
2247
  }, Ni = () => {
2248
2248
  const e = /* @__PURE__ */ new Set();
2249
2249
  return e.add(document.documentElement), document.querySelectorAll(".env-shell-root, .wf-demo-root, ui-window").forEach((t) => e.add(t)), [...e];
2250
- }, ye = (e) => {
2250
+ }, Me = (e) => {
2251
2251
  for (const t of Ni()) for (const [r, a] of Ci) t.style.setProperty(r, e[a]);
2252
2252
  document.querySelectorAll(".view-explorer, [data-view='explorer'], .view-viewer, [data-view='viewer'], .view-settings, [data-view='settings']").forEach((t) => {
2253
2253
  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);
@@ -2269,20 +2269,20 @@ var Qn = {
2269
2269
  } catch {
2270
2270
  return null;
2271
2271
  }
2272
- }, Pe = async (e, t) => {
2272
+ }, $e = async (e, t) => {
2273
2273
  const r = typeof e == "string" ? e.slice(0, 2048) : `blob:${e.name || "wallpaper"}:${e.size}`;
2274
2274
  if (!t?.force) try {
2275
2275
  if (localStorage.getItem(Nr) === r) {
2276
2276
  const a = Rt();
2277
2277
  if (a)
2278
- return ye(a), a;
2278
+ return Me(a), a;
2279
2279
  }
2280
2280
  } catch {
2281
2281
  }
2282
2282
  try {
2283
2283
  const a = await Ti(e), n = Li(a);
2284
2284
  if (!n) return null;
2285
- ye(n);
2285
+ Me(n);
2286
2286
  try {
2287
2287
  localStorage.setItem(Nr, r);
2288
2288
  } catch {
@@ -2291,11 +2291,11 @@ var Qn = {
2291
2291
  } catch (a) {
2292
2292
  console.warn("[fest/image] applyThemeFromWallpaper failed", a);
2293
2293
  const n = Rt();
2294
- return n ? (ye(n), n) : null;
2294
+ return n ? (Me(n), n) : null;
2295
2295
  }
2296
2296
  }, Ri = () => {
2297
2297
  const e = Rt();
2298
- return e && ye(e), e;
2298
+ return e && Me(e), e;
2299
2299
  }, Ii = /* @__PURE__ */ Symbol.for("dom.ts@__registeredCssProperties"), Rr = globalThis[Ii] ??= /* @__PURE__ */ new Set();
2300
2300
  [
2301
2301
  {
@@ -2539,7 +2539,7 @@ var Oi = () => {
2539
2539
  setTimeout(t, 16);
2540
2540
  });
2541
2541
  })(), e;
2542
- }, ks = typeof document < "u" ? document?.documentElement : null, Wi = /* @__PURE__ */ new Map();
2542
+ }, Es = typeof document < "u" ? document?.documentElement : null, Wi = /* @__PURE__ */ new Map();
2543
2543
  typeof requestAnimationFrame < "u" && requestAnimationFrame(async () => {
2544
2544
  for (; ; )
2545
2545
  Wi.forEach((e) => e?.()), await new Promise((e) => requestAnimationFrame(e));
@@ -2550,7 +2550,7 @@ function w(e, t, r, a = qi) {
2550
2550
  const n = typeof e == "object" || typeof e == "function" && !e?.deref ? new WeakRef(e) : e;
2551
2551
  return () => n?.deref?.()?.removeEventListener?.(t, r, a);
2552
2552
  }
2553
- var Vi = /* @__PURE__ */ Symbol.for("dom.ts@zoomValues"), Es = globalThis[Vi] ??= /* @__PURE__ */ new WeakMap(), Di = (e, t = 100) => typeof globalThis.requestIdleCallback == "function" ? globalThis.requestIdleCallback(e, { timeout: t }) : setTimeout(() => e({
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
2554
  didTimeout: !1,
2555
2555
  timeRemaining: () => 0
2556
2556
  }), 0), ya = () => {
@@ -2602,15 +2602,15 @@ var Vi = /* @__PURE__ */ Symbol.for("dom.ts@zoomValues"), Es = globalThis[Vi] ??
2602
2602
  }, Xi = () => {
2603
2603
  let e = screen?.orientation?.type || "portrait-primary";
2604
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
- }, wt = { passive: !0 }, Yi = (e) => {
2605
+ }, xt = { passive: !0 }, Yi = (e) => {
2606
2606
  let t = !1;
2607
2607
  const r = () => {
2608
2608
  t || (requestAnimationFrame(() => {
2609
2609
  Bi(), e(), t = !1;
2610
2610
  }), t = !0);
2611
2611
  }, a = [];
2612
- return a.push(w(navigator?.virtualKeyboard, "geometrychange", r, wt)), a.push(w(window?.visualViewport, "scroll", r, wt)), a.push(w(window?.visualViewport, "resize", r, wt)), 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
- }, Ts = new OffscreenCanvas(1, 1).getContext("2d"), Ui = /* @__PURE__ */ Symbol.for("dom.ts@onBorderObserve"), zs = globalThis[Ui] ??= /* @__PURE__ */ new WeakMap(), Zi = /* @__PURE__ */ Symbol.for("dom.ts@onContentObserve"), _s = 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) => {
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
2614
  const n = new Set([...r.split(",") || [r]].map((o) => o.trim())), i = new MutationObserver((o, s) => {
2615
2615
  for (const l of o) if (l.type == "childList") {
2616
2616
  const d = Array.from(l.addedNodes) || [], p = Array.from(l.removedNodes) || [];
@@ -2710,9 +2710,9 @@ var Vi = /* @__PURE__ */ Symbol.for("dom.ts@zoomValues"), Es = globalThis[Vi] ??
2710
2710
  addedNodes: v,
2711
2711
  removedNodes: []
2712
2712
  }, d), d;
2713
- }, Ki = "DOM", xt = typeof document < "u" ? document.createElement("style") : null;
2714
- xt && (typeof document < "u" && document.querySelector("head")?.appendChild?.(xt), xt.dataset.owner = Ki);
2715
- var Be = typeof CSSStyleValue < "u" && typeof CSSUnitValue < "u", U = (e) => Be && e instanceof CSSStyleValue, X = (e) => Be && e instanceof CSSUnitValue, R = (e, t, r, a = "") => {
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
2716
  if (!(!e || !t)) {
2717
2717
  if (r == null) {
2718
2718
  e.getPropertyValue(t) !== "" && e.removeProperty(t);
@@ -2723,7 +2723,7 @@ var Be = typeof CSSStyleValue < "u" && typeof CSSUnitValue < "u", U = (e) => Be
2723
2723
  }, Qi = (e, t, r, a = "") => {
2724
2724
  if (!e || !t) return e;
2725
2725
  const n = ga(t), i = e.style, o = e.attributeStyleMap ?? e.styleMap;
2726
- if (!Be || !o) return wa(e, t, r, a);
2726
+ if (!Xe || !o) return wa(e, t, r, a);
2727
2727
  let s = ma(r) && !(U(r) || X(r)) ? r?.value : r;
2728
2728
  if (s == null)
2729
2729
  return o.delete?.(n), i && R(i, n, null, a), e;
@@ -2754,19 +2754,19 @@ var Be = typeof CSSStyleValue < "u" && typeof CSSUnitValue < "u", U = (e) => Be
2754
2754
  if (!i) return e;
2755
2755
  let o = ma(r) && !(U(r) || X(r)) ? r?.value : r;
2756
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"), Ps = globalThis[eo] ??= /* @__PURE__ */ new WeakMap(), to = /* @__PURE__ */ Symbol.for("dom.ts@cacheMap"), $s = globalThis[to] ??= /* @__PURE__ */ new Map(), ro = /* @__PURE__ */ Symbol.for("dom.ts@adoptedSelectorMap"), Cs = globalThis[ro] ??= /* @__PURE__ */ new Map(), ao = /* @__PURE__ */ Symbol.for("dom.ts@adoptedShadowSelectorMap"), As = globalThis[ao] ??= /* @__PURE__ */ new WeakMap(), no = /* @__PURE__ */ Symbol.for("dom.ts@adoptedLayerMap"), Ls = globalThis[no] ??= /* @__PURE__ */ new Map(), io = /* @__PURE__ */ Symbol.for("dom.ts@adoptedShadowLayerMap"), Ns = globalThis[io] ??= /* @__PURE__ */ new WeakMap(), ge = (e, t, r, a = "") => Be ? Qi(e, t, r, a) : wa(e, t, r, a), oo = /* @__PURE__ */ Symbol.for("dom.ts@adoptedMap"), Rs = globalThis[oo] ??= /* @__PURE__ */ new Map(), so = /* @__PURE__ */ Symbol.for("dom.ts@adoptedBlobMap"), Is = globalThis[so] ??= /* @__PURE__ */ new WeakMap(), lo = /* @__PURE__ */ Symbol.for("dom.ts@layerCounter"), js = globalThis[lo] ??= 0, uo = /* @__PURE__ */ new WeakMap(), co = /* @__PURE__ */ Symbol.for("dom.ts@namedStoreMaps"), It = globalThis[co] ??= /* @__PURE__ */ new Map(), ho = (e, t) => {
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
2758
  const r = [...e.entries() || []];
2759
2759
  return new Map(r?.map?.(([a, n]) => [a, n?.get?.(t)])?.filter?.(([a, n]) => !!n) || []);
2760
- }, Me = (e) => ({
2760
+ }, we = (e) => ({
2761
2761
  storeSet: ho(It, e),
2762
- mixinSet: we?.get?.(e),
2762
+ mixinSet: xe?.get?.(e),
2763
2763
  behaviorSet: uo?.get?.(e)
2764
- }), po = /* @__PURE__ */ Symbol.for("dom.ts@boundMixinSet"), we = 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"), $e = globalThis[mo] ??= /* @__PURE__ */ new WeakMap(), xa = (e, t) => {
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
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 = we?.get?.(e) ?? /* @__PURE__ */ new WeakSet();
2767
- se?.has?.(t) || se?.set?.(t, /* @__PURE__ */ new WeakSet()), we?.has?.(e) || we?.set?.(e, n);
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
2768
  const i = new WeakRef(e);
2769
- n?.has?.(t) || (a.has(t) || t?.disconnect?.(i, t, Me(e)), (a.has(t) || !se?.get?.(t)?.has?.(e)) && (t?.connect?.(i, t, Me(e)), r.add($e?.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, Me(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
2770
  }, jt = /* @__PURE__ */ new Set(), go = (e = typeof document < "u" ? document : null) => {
2771
2771
  if (e)
2772
2772
  return jt?.has?.(e) || (jt?.add?.(e), Ji(e, "*", "data-mixin", (t) => Ht(t.target)), Gi(e, "[data-mixin]", (t) => {
@@ -2782,9 +2782,9 @@ var Be = typeof CSSStyleValue < "u" && typeof CSSUnitValue < "u", U = (e) => Be
2782
2782
  }, Mo = new FinalizationRegistry((e) => {
2783
2783
  ue?.delete?.(e);
2784
2784
  }), wo = (e, t) => {
2785
- if (!$e?.has?.(t)) {
2785
+ if (!Ce?.has?.(t)) {
2786
2786
  const r = e?.trim?.();
2787
- r && ($e?.set?.(t, r), ue?.set?.(r, t), Mo?.register?.(t, r), yo(t));
2787
+ r && (Ce?.set?.(t, r), ue?.set?.(r, t), Mo?.register?.(t, r), yo(t));
2788
2788
  }
2789
2789
  };
2790
2790
  go(typeof document < "u" ? document : null);
@@ -2802,7 +2802,7 @@ var Kt = class {
2802
2802
  return It.get(this.name || "")?.get?.(e);
2803
2803
  }
2804
2804
  relatedForElement(e) {
2805
- return Me(e);
2805
+ return we(e);
2806
2806
  }
2807
2807
  get elements() {
2808
2808
  return se?.get?.(this);
@@ -2811,10 +2811,10 @@ var Kt = class {
2811
2811
  return It?.get?.(this.name || "");
2812
2812
  }
2813
2813
  get name() {
2814
- return $e?.get?.(this);
2814
+ return Ce?.get?.(this);
2815
2815
  }
2816
2816
  };
2817
- function St(e, t) {
2817
+ function kt(e, t) {
2818
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
2819
  return {
2820
2820
  left: r,
@@ -2830,25 +2830,25 @@ var be = {
2830
2830
  move: "junction-select:move",
2831
2831
  end: "junction-select:end",
2832
2832
  cancel: "junction-select:cancel"
2833
- }, kt = {
2833
+ }, Et = {
2834
2834
  start: "junction-drag:start",
2835
2835
  move: "junction-drag:move",
2836
2836
  end: "junction-drag:end"
2837
- }, Et = {
2837
+ }, Tt = {
2838
2838
  start: "junction-resize:start",
2839
2839
  move: "junction-resize:move",
2840
2840
  end: "junction-resize:end"
2841
- }, xo = /* @__PURE__ */ Symbol.for("dom.ts@mixinDisposers"), Ce = globalThis[xo] ??= /* @__PURE__ */ new WeakMap(), _ = (e, t, r) => {
2842
- const a = Ce.get(e) ?? /* @__PURE__ */ new Map(), n = a.get(t) ?? [];
2843
- n.push(r), a.set(t, n), Ce.set(e, a);
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
2844
  }, Qt = (e, t) => {
2845
- const r = Ce.get(e), a = r?.get(t);
2845
+ const r = Ae.get(e), a = r?.get(t);
2846
2846
  if (a) {
2847
2847
  for (const n of a) try {
2848
2848
  n();
2849
2849
  } catch {
2850
2850
  }
2851
- r.delete(t), r.size === 0 && Ce.delete(e);
2851
+ r.delete(t), r.size === 0 && Ae.delete(e);
2852
2852
  }
2853
2853
  }, B = (e, t) => {
2854
2854
  const r = globalThis.getComputedStyle?.(e)?.getPropertyValue?.(t)?.trim?.() ?? "", a = parseFloat(r);
@@ -2881,7 +2881,7 @@ var be = {
2881
2881
  y: f.clientY - b.top
2882
2882
  };
2883
2883
  }, l = () => {
2884
- const f = St(i, o);
2884
+ const f = kt(i, o);
2885
2885
  if (f.width < 1 && f.height < 1) {
2886
2886
  r.style.display = "none";
2887
2887
  return;
@@ -2899,7 +2899,7 @@ var be = {
2899
2899
  }, p = (f) => {
2900
2900
  if (!n) return;
2901
2901
  o = s(f), l();
2902
- const b = St(i, o);
2902
+ const b = kt(i, o);
2903
2903
  t.dispatchEvent(new CustomEvent(be.move, {
2904
2904
  bubbles: !0,
2905
2905
  detail: {
@@ -2916,7 +2916,7 @@ var be = {
2916
2916
  t.releasePointerCapture(f.pointerId);
2917
2917
  } catch {
2918
2918
  }
2919
- const b = St(i, o);
2919
+ const b = kt(i, o);
2920
2920
  t.dispatchEvent(new CustomEvent(be.end, {
2921
2921
  bubbles: !0,
2922
2922
  detail: {
@@ -2962,7 +2962,7 @@ var be = {
2962
2962
  const a = Sa(t, "data-junction-drag-handle", t);
2963
2963
  let n = !1, i = 0, o = 0, s = 0, l = 0;
2964
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(kt.start, {
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
2966
  bubbles: !0,
2967
2967
  detail: {
2968
2968
  host: t,
@@ -2975,7 +2975,7 @@ var be = {
2975
2975
  }, p = (c) => {
2976
2976
  if (!n) return;
2977
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(kt.move, {
2978
+ ge(t, "--jx-drag-x", b), ge(t, "--jx-drag-y", M), t.dispatchEvent(new CustomEvent(Et.move, {
2979
2979
  bubbles: !0,
2980
2980
  detail: {
2981
2981
  host: t,
@@ -2992,7 +2992,7 @@ var be = {
2992
2992
  a.releasePointerCapture(c.pointerId);
2993
2993
  } catch {
2994
2994
  }
2995
- t.dispatchEvent(new CustomEvent(kt.end, {
2995
+ t.dispatchEvent(new CustomEvent(Et.end, {
2996
2996
  bubbles: !0,
2997
2997
  detail: {
2998
2998
  host: t,
@@ -3020,7 +3020,7 @@ var be = {
3020
3020
  const r = Sa(t, "data-junction-resize-handle", t);
3021
3021
  let a = !1, n = 0, i = 0, o = 0, s = 0;
3022
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(Et.start, {
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
3024
  bubbles: !0,
3025
3025
  detail: {
3026
3026
  host: t,
@@ -3031,7 +3031,7 @@ var be = {
3031
3031
  }, v = (m) => {
3032
3032
  if (!a) return;
3033
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(Et.move, {
3034
+ t.style.width = `${f}px`, t.style.height = `${b}px`, t.dispatchEvent(new CustomEvent(Tt.move, {
3035
3035
  bubbles: !0,
3036
3036
  detail: {
3037
3037
  host: t,
@@ -3046,7 +3046,7 @@ var be = {
3046
3046
  r.releasePointerCapture(m.pointerId);
3047
3047
  } catch {
3048
3048
  }
3049
- t.dispatchEvent(new CustomEvent(Et.end, {
3049
+ t.dispatchEvent(new CustomEvent(Tt.end, {
3050
3050
  bubbles: !0,
3051
3051
  detail: {
3052
3052
  host: t,
@@ -3066,12 +3066,44 @@ var be = {
3066
3066
  new So();
3067
3067
  new ko();
3068
3068
  new Eo();
3069
- var Tt = /* @__PURE__ */ new WeakMap(), To = /* @__PURE__ */ new Map([]), jr = Oi(), xe = (e) => e?.naturalWidth || e?.width || 1, Se = (e) => e?.naturalHeight || e?.height || 1, Hs = (e, t) => {
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) => {
3070
+ const t = {
3071
+ alpha: !0,
3072
+ desynchronized: !0,
3073
+ powerPreference: "high-performance",
3074
+ preserveDrawingBuffer: !0
3075
+ };
3076
+ for (const r of [
3077
+ "rec2100-hlg",
3078
+ "display-p3",
3079
+ "srgb"
3080
+ ]) try {
3081
+ const a = e.getContext("2d", {
3082
+ ...t,
3083
+ colorSpace: r
3084
+ });
3085
+ if (a) return a;
3086
+ } catch {
3087
+ }
3088
+ try {
3089
+ return e.getContext("2d", t);
3090
+ } catch {
3091
+ return e.getContext("2d");
3092
+ }
3093
+ }, Os = (e, t) => {
3070
3094
  To.set(e, t);
3071
- }, zo = (e, t, r = 1, a, n = 0) => {
3095
+ }, _o = (e, t, r = 1, a, n = 0) => {
3072
3096
  const i = e.canvas;
3073
- e.translate(i.width / 2, i.height / 2), e.rotate((-n || 0) * (Math.PI * 0.5)), e.rotate((1 - a) * (Math.PI / 2)), e.translate(-(xe(t) / 2) * r, -(Se(t) / 2) * r);
3074
- }, _o = (e) => (!Tt.has(e) && (e instanceof Blob || e instanceof File || e instanceof OffscreenCanvas || e instanceof ImageBitmap || e instanceof Image) && Tt.set(e, createImageBitmap(e)), Tt.get(e)), Po = /* @__PURE__ */ new WeakMap(), $o = (e, t) => Po?.getOrInsertComputed?.(e, () => e?.bind?.(t)), Ot = null;
3097
+ e.translate(i.width / 2, i.height / 2), e.rotate((-n || 0) * (Math.PI * 0.5)), e.rotate((1 - a) * (Math.PI / 2)), e.translate(-(Se(t) / 2) * r, -(ke(t) / 2) * r);
3098
+ }, Po = (e) => {
3099
+ if (!ye.has(e) && (e instanceof Blob || e instanceof File || e instanceof OffscreenCanvas || e instanceof ImageBitmap || e instanceof Image)) {
3100
+ const t = createImageBitmap(e).catch((r) => {
3101
+ throw ye.delete(e), r;
3102
+ });
3103
+ ye.set(e, t);
3104
+ }
3105
+ return ye.get(e);
3106
+ }, $o = /* @__PURE__ */ new WeakMap(), Co = (e, t) => $o?.getOrInsertComputed?.(e, () => e?.bind?.(t)), Ot = null;
3075
3107
  typeof HTMLCanvasElement < "u" ? Ot = class extends HTMLCanvasElement {
3076
3108
  static observedAttributes = [
3077
3109
  "data-src",
@@ -3105,13 +3137,12 @@ typeof HTMLCanvasElement < "u" ? Ot = class extends HTMLCanvasElement {
3105
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)], (n?.[0] != this.#e[0] || n?.[1] != this.#e[1]) && this.#a(this.#r);
3106
3138
  };
3107
3139
  jr?.shedule?.(() => {
3108
- this.ctx = t.getContext("2d", {
3109
- alpha: !0,
3110
- desynchronized: !0,
3111
- powerPreference: "high-performance",
3112
- preserveDrawingBuffer: !0,
3113
- colorSpace: "rec2100-hlg"
3114
- }), this.ctx?.configureHighDynamicRange?.({ mode: "extended" }), t?.configureHighDynamicRange?.({ mode: "extended" }), 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((n) => {
3140
+ this.ctx = zo(t);
3141
+ try {
3142
+ this.ctx?.configureHighDynamicRange?.({ mode: "extended" }), t?.configureHighDynamicRange?.({ mode: "extended" });
3143
+ } catch {
3144
+ }
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((n) => {
3115
3146
  for (const i of n) {
3116
3147
  const o = i?.devicePixelContentBoxSize?.[0];
3117
3148
  if (o) {
@@ -3124,15 +3155,15 @@ typeof HTMLCanvasElement < "u" ? Ot = class extends HTMLCanvasElement {
3124
3155
  }
3125
3156
  async $useImageAsSource(t, r) {
3126
3157
  r ||= this.#t;
3127
- const a = t instanceof ImageBitmap ? t : await _o(t).catch(console.warn.bind(console));
3158
+ const a = t instanceof ImageBitmap ? t : await Po(t).catch(console.warn.bind(console));
3128
3159
  return a && r == this.#t && (this.image = a, this.#a(r)), t;
3129
3160
  }
3130
3161
  $renderPass(t) {
3131
3162
  const r = this, a = this.ctx, n = this.image;
3132
3163
  if (n && a && (t == this.#t || !t)) {
3133
3164
  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}`;
3134
- const i = this.#n % 2 || 0, o = xe(n) <= Se(n) ? 1 : 0, s = Math.max(r[["height", "width"][i]] / (o ? Se(n) : xe(n)), r[["width", "height"][i]] / (o ? xe(n) : Se(n)));
3135
- a.save(), a.clearRect(0, 0, r.width, r.height), zo(a, n, s, o, this.#n), a.drawImage(n, 0, 0, n.width * s, n.height * s), a.restore();
3165
+ const i = this.#n % 2 || 0, o = Se(n) <= ke(n) ? 1 : 0, s = Math.max(r[["height", "width"][i]] / (o ? ke(n) : Se(n)), r[["width", "height"][i]] / (o ? Se(n) : ke(n)));
3166
+ a.save(), a.clearRect(0, 0, r.width, r.height), _o(a, n, s, o, this.#n), a.drawImage(n, 0, 0, n.width * s, n.height * s), a.restore();
3136
3167
  }
3137
3168
  }
3138
3169
  #i(t) {
@@ -3145,7 +3176,7 @@ typeof HTMLCanvasElement < "u" ? Ot = class extends HTMLCanvasElement {
3145
3176
  }
3146
3177
  #a(t) {
3147
3178
  const r = this.ctx;
3148
- this.image && r && (t == this.#t || !t) && jr?.shedule?.($o(this.$renderPass, this));
3179
+ this.image && r && (t == this.#t || !t) && jr?.shedule?.(Co(this.$renderPass, this));
3149
3180
  }
3150
3181
  } : Ot = class {
3151
3182
  constructor() {
@@ -3171,7 +3202,7 @@ try {
3171
3202
  customElements.define("ui-canvas", Ot, { extends: "canvas" });
3172
3203
  } catch {
3173
3204
  }
3174
- var ka = "rs-wallpaper-image", H = "/assets/wallpaper.jpg", Wt = "idb:rs-wallpaper", Co = "cwsp-wallpaper-v1", O = "blobs", er = "current", Ea = 512e3, $ = null, tr = () => Fi?.[Xi()] ?? 0, Ae = () => {
3205
+ var ka = "rs-wallpaper-image", H = "/assets/wallpaper.jpg", Wt = "idb:rs-wallpaper", Ao = "cwsp-wallpaper-v1", O = "blobs", er = "current", Ea = 512e3, $ = null, tr = () => Fi?.[Xi()] ?? 0, Le = () => {
3175
3206
  if ($ && $.startsWith("blob:")) try {
3176
3207
  URL.revokeObjectURL($);
3177
3208
  } catch {
@@ -3182,12 +3213,12 @@ var ka = "rs-wallpaper-image", H = "/assets/wallpaper.jpg", Wt = "idb:rs-wallpap
3182
3213
  t(/* @__PURE__ */ new Error("indexedDB unavailable"));
3183
3214
  return;
3184
3215
  }
3185
- const r = indexedDB.open(Co, 1);
3216
+ const r = indexedDB.open(Ao, 1);
3186
3217
  r.onupgradeneeded = () => {
3187
3218
  const a = r.result;
3188
3219
  a.objectStoreNames.contains(O) || a.createObjectStore(O);
3189
3220
  }, r.onsuccess = () => e(r.result), r.onerror = () => t(r.error || /* @__PURE__ */ new Error("IDB open failed"));
3190
- }), Ao = async (e) => {
3221
+ }), Lo = async (e) => {
3191
3222
  const t = await rr();
3192
3223
  try {
3193
3224
  await new Promise((r, a) => {
@@ -3210,7 +3241,7 @@ var ka = "rs-wallpaper-image", H = "/assets/wallpaper.jpg", Wt = "idb:rs-wallpap
3210
3241
  } finally {
3211
3242
  e.close();
3212
3243
  }
3213
- }, Lo = async () => {
3244
+ }, No = async () => {
3214
3245
  try {
3215
3246
  const e = await rr();
3216
3247
  try {
@@ -3230,19 +3261,19 @@ var ka = "rs-wallpaper-image", H = "/assets/wallpaper.jpg", Wt = "idb:rs-wallpap
3230
3261
  } catch {
3231
3262
  return H;
3232
3263
  }
3233
- }, Le = (e) => {
3264
+ }, Ne = (e) => {
3234
3265
  try {
3235
3266
  return localStorage.setItem(ka, e), !0;
3236
3267
  } catch {
3237
3268
  return !1;
3238
3269
  }
3239
- }, No = (e) => e.startsWith("data:") || e.startsWith("blob:"), Ro = async () => {
3270
+ }, Ro = (e) => e.startsWith("data:") || e.startsWith("blob:"), Io = async () => {
3240
3271
  const e = ar();
3241
3272
  if (e === "idb:rs-wallpaper" || e.startsWith("idb:")) {
3242
3273
  try {
3243
3274
  const t = await Hr();
3244
3275
  if (t)
3245
- return Ae(), $ = URL.createObjectURL(t), $;
3276
+ return Le(), $ = URL.createObjectURL(t), $;
3246
3277
  } catch (t) {
3247
3278
  console.warn("[fest/image] wallpaper IDB restore failed", t);
3248
3279
  }
@@ -3251,17 +3282,17 @@ var ka = "rs-wallpaper-image", H = "/assets/wallpaper.jpg", Wt = "idb:rs-wallpap
3251
3282
  if (e.startsWith("data:") && e.length > Ea) try {
3252
3283
  const t = await Hr();
3253
3284
  if (t)
3254
- return Ae(), $ = URL.createObjectURL(t), Le(Wt), $;
3285
+ return Le(), $ = URL.createObjectURL(t), Ne(Wt), $;
3255
3286
  } catch {
3256
3287
  }
3257
3288
  return e || H;
3258
- }, qs = () => ar(), Or = (e) => {
3289
+ }, Vs = () => ar(), Or = (e) => {
3259
3290
  const t = () => {
3260
3291
  const r = tr(), a = String(r);
3261
3292
  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;
3262
3293
  };
3263
3294
  return t(), Yi(t);
3264
- }, Vs = () => {
3295
+ }, Ds = () => {
3265
3296
  document.querySelectorAll('[data-app-layer="canvas"] canvas[is="ui-canvas"], [data-app-layer="canvas"] canvas.ui-canvas').forEach((e) => {
3266
3297
  const t = tr(), r = String(t);
3267
3298
  e.setAttribute("data-orient", r), e.setAttribute("orient", r), e.style.setProperty("--orient", r);
@@ -3274,21 +3305,21 @@ var ka = "rs-wallpaper-image", H = "/assets/wallpaper.jpg", Wt = "idb:rs-wallpap
3274
3305
  t.forEach((a) => {
3275
3306
  a.setAttribute("data-src", e), a.setAttribute("data-orient", r), a.setAttribute("orient", r), a.style.setProperty("--orient", r);
3276
3307
  });
3277
- }, Io = async (e) => (await fetch(e)).blob(), jo = async (e) => {
3308
+ }, jo = async (e) => (await fetch(e)).blob(), Ho = async (e) => {
3278
3309
  if (!(e instanceof Blob) || e.size <= 0)
3279
- return Ho(H), H;
3280
- Ae(), $ = URL.createObjectURL(e), qt($), Pe($, { force: !0 }).then(() => {
3310
+ return Oo(H), H;
3311
+ Le(), $ = URL.createObjectURL(e), qt($), $e($, { force: !0 }).then(() => {
3281
3312
  document.querySelectorAll(".app-canvas__glow").forEach(ce);
3282
3313
  });
3283
3314
  try {
3284
- await Ao(e), Le(Wt);
3315
+ await Lo(e), Ne(Wt);
3285
3316
  } catch (t) {
3286
3317
  console.warn("[fest/image] wallpaper IDB persist failed", t);
3287
3318
  try {
3288
3319
  const r = new FileReader(), a = await new Promise((n, i) => {
3289
3320
  r.onload = () => n(String(r.result || "")), r.onerror = () => i(r.error || /* @__PURE__ */ new Error("read failed")), r.readAsDataURL(e);
3290
3321
  });
3291
- a && !Le(a) && console.warn("[fest/image] wallpaper localStorage persist also failed (quota?)");
3322
+ a && !Ne(a) && console.warn("[fest/image] wallpaper localStorage persist also failed (quota?)");
3292
3323
  } catch {
3293
3324
  }
3294
3325
  }
@@ -3300,7 +3331,7 @@ var ka = "rs-wallpaper-image", H = "/assets/wallpaper.jpg", Wt = "idb:rs-wallpap
3300
3331
  } catch {
3301
3332
  }
3302
3333
  return $;
3303
- }, Ds = (e) => {
3334
+ }, Fs = (e) => {
3304
3335
  const t = e;
3305
3336
  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%)";
3306
3337
  const r = document.createElement("div");
@@ -3310,28 +3341,28 @@ var ka = "rs-wallpaper-image", H = "/assets/wallpaper.jpg", Wt = "idb:rs-wallpap
3310
3341
  const n = ar(), i = n === "idb:rs-wallpaper" || n.startsWith("idb:") || n.startsWith("data:") ? H : n;
3311
3342
  a.setAttribute("data-src", i);
3312
3343
  const o = Or(a);
3313
- return Ri(), ce(r), Ro().then((s) => (a.setAttribute("data-src", s), Or(a), Pe(s).then(() => ce(r)))), {
3344
+ return Ri(), ce(r), Io().then((s) => (a.setAttribute("data-src", s), Or(a), $e(s).then(() => ce(r)))), {
3314
3345
  root: t,
3315
3346
  canvas: a,
3316
3347
  glow: r,
3317
3348
  disposeOrient: o
3318
3349
  };
3319
- }, Ho = (e) => {
3350
+ }, Oo = (e) => {
3320
3351
  const t = String(e || "").trim() || H;
3321
- if (No(t) || t.length > Ea) {
3352
+ if (Ro(t) || t.length > Ea) {
3322
3353
  (async () => {
3323
3354
  try {
3324
- const r = t.startsWith("blob:") ? await (await fetch(t)).blob() : await Io(t);
3325
- await jo(r);
3355
+ const r = t.startsWith("blob:") ? await (await fetch(t)).blob() : await jo(t);
3356
+ await Ho(r);
3326
3357
  } catch (r) {
3327
- console.warn("[fest/image] setAppWallpaper inline persist failed", r), qt(t), Pe(t, { force: !0 }).then(() => {
3358
+ console.warn("[fest/image] setAppWallpaper inline persist failed", r), qt(t), $e(t, { force: !0 }).then(() => {
3328
3359
  document.querySelectorAll(".app-canvas__glow").forEach(ce);
3329
3360
  });
3330
3361
  }
3331
3362
  })();
3332
3363
  return;
3333
3364
  }
3334
- Lo(), Ae(), Le(t) || console.warn("[fest/image] wallpaper pointer write failed"), qt(t), Pe(t, { force: !0 }).then(() => {
3365
+ No(), Le(), Ne(t) || console.warn("[fest/image] wallpaper pointer write failed"), qt(t), $e(t, { force: !0 }).then(() => {
3335
3366
  document.querySelectorAll(".app-canvas__glow").forEach(ce);
3336
3367
  });
3337
3368
  try {
@@ -3348,23 +3379,23 @@ export {
3348
3379
  _i as WALLPAPER_PRIMARY_STORAGE_KEY,
3349
3380
  Pi as WALLPAPER_THEME_SRC_STORAGE_KEY,
3350
3381
  zi as WALLPAPER_THEME_STORAGE_KEY,
3351
- Pe as applyThemeFromWallpaper,
3352
- ye as applyWallpaperThemeSeeds,
3353
- Hs as callByFrame,
3354
- zo as cover,
3355
- _o as createImageBitmapCache,
3356
- Oo as electronAPI,
3382
+ $e as applyThemeFromWallpaper,
3383
+ Me as applyWallpaperThemeSeeds,
3384
+ Os as callByFrame,
3385
+ _o as cover,
3386
+ Po as createImageBitmapCache,
3387
+ Wo as electronAPI,
3357
3388
  Ti as getDominantColors,
3358
- qs as getWallpaperStoragePointer,
3359
- Ds as initializeAppCanvasLayer,
3389
+ Vs as getWallpaperStoragePointer,
3390
+ Fs as initializeAppCanvasLayer,
3360
3391
  Rt as loadCachedWallpaperTheme,
3361
- Wo as qualityMode,
3392
+ qo as qualityMode,
3362
3393
  Li as rankWallpaperSeeds,
3363
- Ro as resolveAppWallpaperUrl,
3394
+ Io as resolveAppWallpaperUrl,
3364
3395
  Ri as restoreWallpaperThemeCache,
3365
- Ho as setAppWallpaper,
3366
- jo as setAppWallpaperFromBlob,
3367
- Vs as syncAppWallpaperOrient,
3396
+ Oo as setAppWallpaper,
3397
+ Ho as setAppWallpaperFromBlob,
3398
+ Ds as syncAppWallpaperOrient,
3368
3399
  Or as syncCanvasOrient,
3369
3400
  Ni as themeHosts
3370
3401
  };