@mkbabb/value.js 0.2.0 → 0.3.1

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/value.js CHANGED
@@ -1,8 +1,8 @@
1
- const ee = 16.666666666666668, sn = (e) => !!e && e.constructor === Object;
2
- function K(e) {
3
- return sn(e) ? Object.entries(e).map(([t, n]) => [t, K(n)]).reduce((t, [n, r]) => (t[n] = r, t), {}) : e != null && typeof e.clone == "function" ? e.clone() : Array.isArray(e) ? e.map(K) : e;
1
+ const he = 16.666666666666668, Jn = (e) => !!e && e.constructor === Object;
2
+ function tt(e) {
3
+ return Jn(e) ? Object.entries(e).map(([t, n]) => [t, tt(n)]).reduce((t, [n, r]) => (t[n] = r, t), {}) : e != null && typeof e.clone == "function" ? e.clone() : Array.isArray(e) ? e.map(tt) : e;
4
4
  }
5
- const vs = (e, t) => {
5
+ const Ji = (e, t) => {
6
6
  if (!e || !t || e.length !== t.length)
7
7
  return !1;
8
8
  for (let n = 0; n < e.length; n++)
@@ -10,10 +10,10 @@ const vs = (e, t) => {
10
10
  return !1;
11
11
  return !0;
12
12
  };
13
- async function Ms(e) {
13
+ async function Qi(e) {
14
14
  return await new Promise((t) => setTimeout(t, e));
15
15
  }
16
- async function Bs(e, t = ee) {
16
+ async function ta(e, t = he) {
17
17
  return await new Promise((n) => {
18
18
  const r = setInterval(() => {
19
19
  if (e())
@@ -21,7 +21,7 @@ async function Bs(e, t = ee) {
21
21
  }, t);
22
22
  });
23
23
  }
24
- function Es(e, t = 100, n = !1) {
24
+ function ea(e, t = 100, n = !1) {
25
25
  let r = null;
26
26
  const o = function(...s) {
27
27
  const i = this, a = function() {
@@ -33,11 +33,11 @@ function Es(e, t = 100, n = !1) {
33
33
  r && (clearTimeout(r), r = null);
34
34
  }, o;
35
35
  }
36
- async function As(e, t) {
36
+ async function na(e, t) {
37
37
  const n = new TextEncoder().encode(t), r = await crypto.subtle.digest(e, n);
38
38
  return Array.from(new Uint8Array(r)).map((s) => s.toString(16).padStart(2, "0")).join("");
39
39
  }
40
- function _t(e, t = {}) {
40
+ function Wt(e, t = {}) {
41
41
  const n = /* @__PURE__ */ new Map(), { maxCacheSize: r = 1 / 0, ttl: o = 1 / 0, keyFn: s = JSON.stringify } = t, i = function(...a) {
42
42
  const c = s.apply(this, a), l = Date.now();
43
43
  if (n.has(c)) {
@@ -46,42 +46,42 @@ function _t(e, t = {}) {
46
46
  return u.value;
47
47
  n.delete(c);
48
48
  }
49
- const m = e.apply(this, a);
50
- if (n.set(c, { value: m, timestamp: l }), n.size > r) {
49
+ const p = e.apply(this, a);
50
+ if (n.set(c, { value: p, timestamp: l }), n.size > r) {
51
51
  const u = n.keys().next().value;
52
52
  n.delete(u);
53
53
  }
54
- return m;
54
+ return p;
55
55
  };
56
56
  return i.cache = n, i;
57
57
  }
58
- const Is = (e) => e.replace(
58
+ const ra = (e) => e.replace(
59
59
  /([-_][a-z])/gi,
60
60
  (t) => t.toUpperCase().replace("-", "").replace("_", "")
61
61
  );
62
- function Rs(e) {
62
+ function oa(e) {
63
63
  return e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`);
64
64
  }
65
- function Ps(e, t, n) {
65
+ function sa(e, t, n) {
66
66
  for (let r = e - 1; r >= 0; r--)
67
67
  if (n(t[r]))
68
68
  return r;
69
69
  }
70
- function Os(e) {
70
+ function ia(e) {
71
71
  if (typeof window < "u" && window.requestAnimationFrame)
72
72
  return window.requestAnimationFrame(e);
73
- let t = ee, n = Date.now();
73
+ let t = he, n = Date.now();
74
74
  return setTimeout(() => {
75
75
  let r = Date.now(), o = r - n;
76
- n = r, t = Math.max(0, ee - o), e(r);
76
+ n = r, t = Math.max(0, he - o), e(r);
77
77
  }, t);
78
78
  }
79
- function Ns(e) {
79
+ function aa(e) {
80
80
  if (typeof window < "u" && window.cancelAnimationFrame)
81
81
  return window.cancelAnimationFrame(e);
82
82
  clearTimeout(e);
83
83
  }
84
- const an = ["px", "cm", "mm", "Q", "in", "pc", "pt"], cn = [
84
+ const Qn = ["px", "cm", "mm", "Q", "in", "pc", "pt"], tr = [
85
85
  "em",
86
86
  "ex",
87
87
  "ch",
@@ -100,21 +100,21 @@ const an = ["px", "cm", "mm", "Q", "in", "pc", "pt"], cn = [
100
100
  "lvh",
101
101
  "dvw",
102
102
  "dvh"
103
- ], Mt = [
104
- ...an,
105
- ...cn
106
- ], Bt = ["s", "ms"], Et = ["deg", "rad", "grad", "turn"], ln = ["%"], At = ["dpi", "dpcm", "dppx", "cqw"], ne = ["var", "calc"], ir = ["string"], ar = ["color"], zs = [
107
- ...Mt,
108
- ...Bt,
109
- ...Et,
110
- ...ln,
111
- ...At,
112
- ...ne,
113
- ...ir,
114
- ...ar,
103
+ ], Pt = [
104
+ ...Qn,
105
+ ...tr
106
+ ], Ot = ["s", "ms"], Lt = ["deg", "rad", "grad", "turn"], er = ["%"], zt = ["dpi", "dpcm", "dppx", "cqw"], fe = ["var", "calc"], oo = ["string"], so = ["color"], ca = [
107
+ ...Pt,
108
+ ...Ot,
109
+ ...Lt,
110
+ ...er,
111
+ ...zt,
112
+ ...fe,
113
+ ...oo,
114
+ ...so,
115
115
  "",
116
116
  void 0
117
- ], cr = ["string", "var", "calc"], lr = [
117
+ ], io = ["string", "var", "calc"], ao = [
118
118
  "accentColor",
119
119
  "additiveSymbols",
120
120
  "alignContent",
@@ -746,8 +746,8 @@ const an = ["px", "cm", "mm", "Q", "in", "pc", "pt"], cn = [
746
746
  "y",
747
747
  "zIndex",
748
748
  "zoom"
749
- ], Ye = (e, t = 2) => typeof e == "number" && Number.isNaN(e) ? "none" : String(e?.toFixed?.(t) ?? e).trim().replace(/\.0+$/, ""), je = (e, t, n) => `${e}(${t.join(" ")} / ${n})`;
750
- let U = class {
749
+ ], ln = (e, t = 2) => typeof e == "number" && Number.isNaN(e) ? "none" : String(e?.toFixed?.(t) ?? e).trim().replace(/\.0+$/, ""), un = (e, t, n) => `${e}(${t.join(" ")} / ${n})`;
750
+ let V = class {
751
751
  constructor(t, n = 1) {
752
752
  this.colorSpace = t, this.alpha = n, this.components = /* @__PURE__ */ new Map();
753
753
  }
@@ -756,13 +756,13 @@ let U = class {
756
756
  const t = Array.from(this.components.values()).map(
757
757
  (r) => typeof r == "number" && Number.isNaN(r) ? "none" : r
758
758
  ), n = typeof this.alpha == "number" && Number.isNaN(this.alpha) ? "none" : this.alpha;
759
- return je(this.colorSpace, t, n);
759
+ return un(this.colorSpace, t, n);
760
760
  }
761
761
  toFormattedString(t = 2) {
762
762
  const n = Array.from(this.components.values()).map(
763
- (o) => Ye(o, t)
764
- ), r = Ye(this.alpha, t);
765
- return je(this.colorSpace, n, r);
763
+ (o) => ln(o, t)
764
+ ), r = ln(this.alpha, t);
765
+ return un(this.colorSpace, n, r);
766
766
  }
767
767
  valueOf() {
768
768
  return [...this.values(), this.alpha];
@@ -775,8 +775,8 @@ let U = class {
775
775
  }
776
776
  clone() {
777
777
  const t = this.constructor, n = new t();
778
- return n.alpha = K(this.alpha), this.components.forEach((r, o) => {
779
- n.components.set(o, K(r));
778
+ return n.alpha = tt(this.alpha), this.components.forEach((r, o) => {
779
+ n.components.set(o, tt(r));
780
780
  }), n;
781
781
  }
782
782
  keys() {
@@ -795,12 +795,12 @@ let U = class {
795
795
  this.components.set(t, n);
796
796
  }
797
797
  };
798
- class me extends U {
798
+ class xe extends V {
799
799
  constructor(t, n, r) {
800
800
  super(t, n), this.whitePoint = r;
801
801
  }
802
802
  }
803
- class $ extends U {
803
+ class O extends V {
804
804
  constructor(t, n, r, o) {
805
805
  super("rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
806
806
  }
@@ -823,7 +823,7 @@ class $ extends U {
823
823
  this.setComponent("b", t);
824
824
  }
825
825
  }
826
- class St extends U {
826
+ class yt extends V {
827
827
  constructor(t, n, r, o) {
828
828
  super("hsl", o), this.components.set("h", t), this.components.set("s", n), this.components.set("l", r);
829
829
  }
@@ -846,7 +846,7 @@ class St extends U {
846
846
  this.setComponent("l", t);
847
847
  }
848
848
  }
849
- class pe extends U {
849
+ class Ee extends V {
850
850
  constructor(t, n, r, o) {
851
851
  super("hsv", o), this.components.set("h", t), this.components.set("s", n), this.components.set("v", r);
852
852
  }
@@ -869,7 +869,7 @@ class pe extends U {
869
869
  this.setComponent("v", t);
870
870
  }
871
871
  }
872
- class he extends U {
872
+ class Te extends V {
873
873
  constructor(t, n, r, o) {
874
874
  super("hwb", o), this.components.set("h", t), this.components.set("w", n), this.components.set("b", r);
875
875
  }
@@ -892,7 +892,7 @@ class he extends U {
892
892
  this.setComponent("b", t);
893
893
  }
894
894
  }
895
- class Lt extends me {
895
+ class Xt extends xe {
896
896
  constructor(t, n, r, o) {
897
897
  super("lab", o, "D50"), this.components.set("l", t), this.components.set("a", n), this.components.set("b", r);
898
898
  }
@@ -915,7 +915,7 @@ class Lt extends me {
915
915
  this.setComponent("b", t);
916
916
  }
917
917
  }
918
- class fe extends U {
918
+ class Ae extends V {
919
919
  constructor(t, n, r, o) {
920
920
  super("lch", o), this.components.set("l", t), this.components.set("c", n), this.components.set("h", r);
921
921
  }
@@ -938,7 +938,7 @@ class fe extends U {
938
938
  this.setComponent("h", t);
939
939
  }
940
940
  }
941
- class $t extends me {
941
+ class Ht extends xe {
942
942
  constructor(t, n, r, o) {
943
943
  super("oklab", o, "D50"), this.components.set("l", t), this.components.set("a", n), this.components.set("b", r);
944
944
  }
@@ -961,7 +961,7 @@ class $t extends me {
961
961
  this.setComponent("b", t);
962
962
  }
963
963
  }
964
- class be extends U {
964
+ class Me extends V {
965
965
  constructor(t, n, r, o) {
966
966
  super("oklch", o), this.components.set("l", t), this.components.set("c", n), this.components.set("h", r);
967
967
  }
@@ -984,7 +984,7 @@ class be extends U {
984
984
  this.setComponent("h", t);
985
985
  }
986
986
  }
987
- class D extends me {
987
+ class U extends xe {
988
988
  constructor(t, n, r, o) {
989
989
  super("xyz", o, "D65"), this.components.set("x", t), this.components.set("y", n), this.components.set("z", r);
990
990
  }
@@ -1007,7 +1007,7 @@ class D extends me {
1007
1007
  this.setComponent("z", t);
1008
1008
  }
1009
1009
  }
1010
- class un extends U {
1010
+ class nr extends V {
1011
1011
  constructor(t, n) {
1012
1012
  super("kelvin", n), this.components.set("kelvin", t);
1013
1013
  }
@@ -1018,7 +1018,7 @@ class un extends U {
1018
1018
  this.setComponent("kelvin", t);
1019
1019
  }
1020
1020
  }
1021
- class de extends U {
1021
+ class Ie extends V {
1022
1022
  constructor(t, n, r, o) {
1023
1023
  super("srgb-linear", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
1024
1024
  }
@@ -1041,7 +1041,7 @@ class de extends U {
1041
1041
  this.setComponent("b", t);
1042
1042
  }
1043
1043
  }
1044
- class ge extends U {
1044
+ class Re extends V {
1045
1045
  constructor(t, n, r, o) {
1046
1046
  super("display-p3", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
1047
1047
  }
@@ -1064,7 +1064,7 @@ class ge extends U {
1064
1064
  this.setComponent("b", t);
1065
1065
  }
1066
1066
  }
1067
- class we extends U {
1067
+ class ve extends V {
1068
1068
  constructor(t, n, r, o) {
1069
1069
  super("a98-rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
1070
1070
  }
@@ -1087,7 +1087,7 @@ class we extends U {
1087
1087
  this.setComponent("b", t);
1088
1088
  }
1089
1089
  }
1090
- class ke extends U {
1090
+ class Be extends V {
1091
1091
  constructor(t, n, r, o) {
1092
1092
  super("prophoto-rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
1093
1093
  }
@@ -1110,7 +1110,7 @@ class ke extends U {
1110
1110
  this.setComponent("b", t);
1111
1111
  }
1112
1112
  }
1113
- class ye extends U {
1113
+ class Ne extends V {
1114
1114
  constructor(t, n, r, o) {
1115
1115
  super("rec2020", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
1116
1116
  }
@@ -1133,19 +1133,19 @@ class ye extends U {
1133
1133
  this.setComponent("b", t);
1134
1134
  }
1135
1135
  }
1136
- function re(e) {
1136
+ function be(e) {
1137
1137
  return e.unit === "color";
1138
1138
  }
1139
- const Ls = (e) => {
1139
+ const ua = (e) => {
1140
1140
  const t = {}, n = (r, o = void 0) => {
1141
1141
  if (Array.isArray(r)) {
1142
1142
  r.forEach((i, a) => n(i, o));
1143
1143
  return;
1144
- } else if (r instanceof at) {
1144
+ } else if (r instanceof mt) {
1145
1145
  let i = r.name;
1146
1146
  o && (o.endsWith(r.name) ? i = o : i = `${o}.${r.name}`), r.values.forEach((a, c) => n(a, i));
1147
1147
  return;
1148
- } else if (sn(r)) {
1148
+ } else if (Jn(r)) {
1149
1149
  for (const [i, a] of Object.entries(r)) {
1150
1150
  const c = o ? `${o}.${i}` : i;
1151
1151
  n(a, c);
@@ -1153,10 +1153,10 @@ const Ls = (e) => {
1153
1153
  return;
1154
1154
  }
1155
1155
  const s = o;
1156
- t[s] == null && (t[s] = new xt()), t[s].push(r), t[s] = t[s].flat();
1156
+ t[s] == null && (t[s] = new vt()), t[s].push(r), t[s] = t[s].flat();
1157
1157
  };
1158
1158
  return n(e), t;
1159
- }, $s = (e) => {
1159
+ }, pa = (e) => {
1160
1160
  const t = {};
1161
1161
  for (const [n, r] of Object.entries(e)) {
1162
1162
  const o = n.split(".");
@@ -1167,22 +1167,22 @@ const Ls = (e) => {
1167
1167
  }
1168
1168
  }
1169
1169
  return t;
1170
- }, Fs = (e) => {
1170
+ }, ma = (e) => {
1171
1171
  const t = {};
1172
1172
  for (const [n, r] of Object.entries(e)) {
1173
1173
  const o = n.split("."), s = o[0];
1174
1174
  let i = t[s] ?? "", a = "", c = "";
1175
- for (let m = 1; m < o.length; m++)
1176
- a += `${o[m]}(`, c += ")";
1175
+ for (let p = 1; p < o.length; p++)
1176
+ a += `${o[p]}(`, c += ")";
1177
1177
  let l = "";
1178
1178
  o.length > 1 && Array.isArray(r) ? l = r.join(", ") : l = r.toString(), i += ` ${a}${l}${c}`, t[s] = i.trim();
1179
1179
  }
1180
1180
  return t;
1181
- }, ur = new Set(lr);
1182
- function Ds(e) {
1183
- return ur.has(e);
1181
+ }, co = new Set(ao);
1182
+ function ha(e) {
1183
+ return co.has(e);
1184
1184
  }
1185
- const mr = (e) => {
1185
+ const lo = (e) => {
1186
1186
  const t = e.name, n = e.valueOf();
1187
1187
  if (!e.name.startsWith("matrix"))
1188
1188
  throw new Error("Input must be a matrix or matrix3d value");
@@ -1253,11 +1253,11 @@ const mr = (e) => {
1253
1253
  }
1254
1254
  throw new Error("Unsupported matrix type or invalid number of values");
1255
1255
  };
1256
- function pr(e, t) {
1256
+ function uo(e, t) {
1257
1257
  let n = e;
1258
1258
  return t === "cm" ? n *= 96 / 2.54 : t === "mm" ? n *= 96 / 25.4 : t === "in" ? n *= 96 : t === "pt" ? n *= 4 / 3 : t === "pc" && (n *= 16), n;
1259
1259
  }
1260
- function mn(e, t, n, r) {
1260
+ function rr(e, t, n, r) {
1261
1261
  if (t === "em" && n)
1262
1262
  e *= parseFloat(getComputedStyle(n).fontSize);
1263
1263
  else if (t === "rem")
@@ -1275,35 +1275,35 @@ function mn(e, t, n, r) {
1275
1275
  getComputedStyle(n.parentElement).getPropertyValue(r)
1276
1276
  );
1277
1277
  e = e / 100 * o;
1278
- } else t === "ex" || t === "ch" ? e *= parseFloat(getComputedStyle(n).fontSize) ?? 16 : e = pr(e, t);
1278
+ } else t === "ex" || t === "ch" ? e *= parseFloat(getComputedStyle(n).fontSize) ?? 16 : e = uo(e, t);
1279
1279
  return e;
1280
1280
  }
1281
- function pn(e, t) {
1281
+ function or(e, t) {
1282
1282
  return t === "s" && (e *= 1e3), e;
1283
1283
  }
1284
- function Se(e, t) {
1284
+ function _e(e, t) {
1285
1285
  return t === "grad" ? e *= 0.9 : t === "rad" ? e *= 180 / Math.PI : t === "turn" && (e *= 360), e;
1286
1286
  }
1287
- function hn(e, t) {
1287
+ function sr(e, t) {
1288
1288
  return t === "dpcm" ? e *= 2.54 : t === "dppx" && (e *= 96), e;
1289
1289
  }
1290
- const hr = {
1291
- length: mn,
1292
- time: pn,
1293
- angle: Se,
1294
- resolution: hn
1290
+ const po = {
1291
+ length: rr,
1292
+ time: or,
1293
+ angle: _e,
1294
+ resolution: sr
1295
1295
  };
1296
- function Ze(e) {
1297
- return Mt.includes(e) ? [Mt, "length"] : Bt.includes(e) ? [Bt, "time"] : Et.includes(e) ? [Et, "angle"] : At.includes(e) ? [At, "resolution"] : null;
1296
+ function pn(e) {
1297
+ return Pt.includes(e) ? [Pt, "length"] : Ot.includes(e) ? [Ot, "time"] : Lt.includes(e) ? [Lt, "angle"] : zt.includes(e) ? [zt, "resolution"] : null;
1298
1298
  }
1299
- function Gs(e, t, n, r) {
1300
- const o = Ze(t), s = Ze(n);
1299
+ function fa(e, t, n, r) {
1300
+ const o = pn(t), s = pn(n);
1301
1301
  if (!o || !s || o[1] !== s[1])
1302
1302
  throw new Error(`Incompatible units: ${t} and ${n}`);
1303
- const [, i] = o, a = hr[i], c = a(e, t, r), l = a(1, n, r);
1303
+ const [, i] = o, a = po[i], c = a(e, t, r), l = a(1, n, r);
1304
1304
  return c / l;
1305
1305
  }
1306
- class k {
1306
+ class S {
1307
1307
  constructor(t, n, r, o, s, i) {
1308
1308
  this.value = t, this.unit = n, this.superType = r, this.subProperty = o, this.property = s, this.targets = i;
1309
1309
  }
@@ -1323,36 +1323,36 @@ class k {
1323
1323
  this.value = t;
1324
1324
  }
1325
1325
  toString() {
1326
- return this.value == null ? "" : this.unit == null || this.unit === "string" ? `${this.value}` : re(this) ? this.value.toString() : this.unit === "var" ? `var(${this.value})` : this.unit === "calc" ? `calc(${this.value})` : `${this.value}${this.unit}`;
1326
+ return this.value == null ? "" : this.unit == null || this.unit === "string" ? `${this.value}` : be(this) ? this.value.toString() : this.unit === "var" ? `var(${this.value})` : this.unit === "calc" ? `calc(${this.value})` : `${this.value}${this.unit}`;
1327
1327
  }
1328
1328
  toJSON() {
1329
1329
  return this.valueOf();
1330
1330
  }
1331
1331
  toFixed(t = 2) {
1332
1332
  const n = Number(this.value).toFixed(t).replace(/\.0+$/, "");
1333
- return new k(n).coalesce(this, !0).toString();
1333
+ return new S(n).coalesce(this, !0).toString();
1334
1334
  }
1335
1335
  clone() {
1336
- return new k(
1337
- K(this.value),
1336
+ return new S(
1337
+ tt(this.value),
1338
1338
  this.unit,
1339
- K(this.superType),
1339
+ tt(this.superType),
1340
1340
  this.subProperty,
1341
1341
  this.property
1342
1342
  );
1343
1343
  }
1344
1344
  coalesce(t, n = !1) {
1345
- return t == null ? this : cr.includes(this.unit) ? this : n ? (this.unit ??= t.unit, this.superType ??= t.superType, this.subProperty ??= t.subProperty, this.property ??= t.property, this.targets ??= t.targets, this) : new k(
1346
- K(this.value),
1345
+ return t == null ? this : io.includes(this.unit) ? this : n ? (this.unit ??= t.unit, this.superType ??= t.superType, this.subProperty ??= t.subProperty, this.property ??= t.property, this.targets ??= t.targets, this) : new S(
1346
+ tt(this.value),
1347
1347
  this.unit ?? t.unit,
1348
- K(this.superType ?? t.superType),
1348
+ tt(this.superType ?? t.superType),
1349
1349
  this.subProperty ?? t.subProperty,
1350
1350
  this.property ?? t.property,
1351
1351
  this.targets ?? t.targets
1352
1352
  );
1353
1353
  }
1354
1354
  }
1355
- class at {
1355
+ class mt {
1356
1356
  constructor(t, n) {
1357
1357
  this.name = t, this.values = n, n.forEach((r) => {
1358
1358
  this.setSubProperty(t);
@@ -1382,13 +1382,13 @@ class at {
1382
1382
  };
1383
1383
  }
1384
1384
  clone() {
1385
- return new at(
1385
+ return new mt(
1386
1386
  this.name,
1387
1387
  this.values.map((t) => t.clone())
1388
1388
  );
1389
1389
  }
1390
1390
  }
1391
- class xt extends Array {
1391
+ class vt extends Array {
1392
1392
  constructor(...t) {
1393
1393
  super(...t);
1394
1394
  }
@@ -1414,28 +1414,28 @@ class xt extends Array {
1414
1414
  return this.map((t) => t.toJSON());
1415
1415
  }
1416
1416
  clone() {
1417
- return new xt(...this.map((t) => t.clone()));
1417
+ return new vt(...this.map((t) => t.clone()));
1418
1418
  }
1419
1419
  }
1420
- const Ke = 4;
1421
- function qe(e, t = "^", n = !1) {
1420
+ const mn = 4;
1421
+ function hn(e, t = "^", n = !1) {
1422
1422
  const r = e.src.split(`
1423
- `), o = Math.min(r.length - 1, e.getLineNumber()), s = Math.max(o - Ke, 0), i = Math.min(o + Ke + 1, r.length), a = r.slice(s, i);
1423
+ `), o = Math.min(r.length - 1, e.getLineNumber()), s = Math.max(o - mn, 0), i = Math.min(o + mn + 1, r.length), a = r.slice(s, i);
1424
1424
  if (t) {
1425
1425
  const l = " ".repeat(e.getColumnNumber()) + t;
1426
1426
  a.splice(o - s + 1, 0, l);
1427
1427
  }
1428
- return a.map((l, m) => ` ${s + m + 1}| ${l}`).join(`
1428
+ return a.map((l, p) => ` ${s + p + 1}| ${l}`).join(`
1429
1429
  `);
1430
1430
  }
1431
- const ot = /* @__PURE__ */ new Map();
1432
- function fn(e) {
1433
- if (ot.has(e.id))
1434
- return ot.get(e.id);
1431
+ const ct = /* @__PURE__ */ new Map();
1432
+ function ir(e) {
1433
+ if (ct.has(e.id))
1434
+ return ct.get(e.id);
1435
1435
  const t = (r, o) => {
1436
- if (ot.has(r.id))
1437
- return ot.get(r.id);
1438
- const { name: s, args: i, parser: a } = r.context, c = a != null ? t(a, o) : "unknown", m = (() => {
1436
+ if (ct.has(r.id))
1437
+ return ct.get(r.id);
1438
+ const { name: s, args: i, parser: a } = r.context, c = a != null ? t(a, o) : "unknown", p = (() => {
1439
1439
  switch (s) {
1440
1440
  case "string":
1441
1441
  return `"${i[0]}"`;
@@ -1445,8 +1445,8 @@ function fn(e) {
1445
1445
  return `${i[0]}`;
1446
1446
  case "wrap":
1447
1447
  case "trim": {
1448
- const [u, d] = i;
1449
- return `${t(u, o)} ${c} ${t(d, o)}`;
1448
+ const [u, f] = i;
1449
+ return `${t(u, o)} ${c} ${t(f, o)}`;
1450
1450
  }
1451
1451
  case "trimWhitespace":
1452
1452
  return `${c}?w`;
@@ -1467,26 +1467,26 @@ function fn(e) {
1467
1467
  case "all":
1468
1468
  case "then":
1469
1469
  return `[${i.map(
1470
- (d) => t(d, o)
1470
+ (f) => t(f, o)
1471
1471
  ).join(", ")}]`;
1472
1472
  case "any":
1473
1473
  case "or":
1474
1474
  return i.map(
1475
- (d) => t(d, o)
1475
+ (f) => t(f, o)
1476
1476
  ).join(" | ");
1477
1477
  case "many": {
1478
- const [u, d] = i, x = d === 1 / 0 ? `${u},` : `${u},${d}`;
1479
- return `${c} {${x}}`;
1478
+ const [u, f] = i, C = f === 1 / 0 ? `${u},` : `${u},${f}`;
1479
+ return `${c} {${C}}`;
1480
1480
  }
1481
1481
  case "sepBy":
1482
1482
  return `${c} sepBy ${t(i[0], o)}`;
1483
1483
  case "lazy": {
1484
- const [u] = i, d = dn(u);
1484
+ const [u] = i, f = cr(u);
1485
1485
  if (o)
1486
1486
  return s;
1487
1487
  {
1488
- const x = t(d, d.id);
1489
- return ot.set(d.id, x), x;
1488
+ const C = t(f, f.id);
1489
+ return ct.set(f.id, C), C;
1490
1490
  }
1491
1491
  }
1492
1492
  case "debug":
@@ -1495,39 +1495,39 @@ function fn(e) {
1495
1495
  return;
1496
1496
  }
1497
1497
  })() ?? s ?? "unknown";
1498
- return o && ot.set(r.id, m), m;
1498
+ return o && ct.set(r.id, p), p;
1499
1499
  }, n = t(e);
1500
- return ot.set(e.id, n), n;
1500
+ return ct.set(e.id, n), n;
1501
1501
  }
1502
- function bn(e, t = "", n = "") {
1503
- const r = String(e.value), o = e.offset >= e.src.length, a = `${`[${e.isError ? "err" : o ? "done" : "ok"}]`} ${t} offset=${e.offset} value=${r}`, c = e.offset >= e.src.length ? qe(e, "", e.isError) : qe(e, "^", e.isError);
1502
+ function ar(e, t = "", n = "") {
1503
+ const r = String(e.value), o = e.offset >= e.src.length, a = `${`[${e.isError ? "err" : o ? "done" : "ok"}]`} ${t} offset=${e.offset} value=${r}`, c = e.offset >= e.src.length ? hn(e, "", e.isError) : hn(e, "^", e.isError);
1504
1504
  return `${a}
1505
1505
  ${c}`;
1506
1506
  }
1507
- function fr(e, t = "", n = !1, r = console.log) {
1507
+ function mo(e, t = "", n = !1, r = console.log) {
1508
1508
  const o = (s) => {
1509
- const i = e.parser(s), a = n ? fn(e) : e.context.name ?? "", c = bn(
1509
+ const i = e.parser(s), a = n ? ir(e) : e.context.name ?? "", c = ar(
1510
1510
  i,
1511
1511
  t,
1512
1512
  a
1513
1513
  );
1514
1514
  return r(c), i;
1515
1515
  };
1516
- return new y(o, v("debug", e, r));
1516
+ return new x(o, M("debug", e, r));
1517
1517
  }
1518
- class It {
1518
+ class $t {
1519
1519
  constructor(t, n = void 0, r = 0, o = !1, s = 0) {
1520
1520
  this.src = t, this.value = n, this.offset = r, this.isError = o, this.furthest = s;
1521
1521
  }
1522
1522
  ok(t, n = 0) {
1523
- return n += this.offset, new It(this.src, t, n, !1);
1523
+ return n += this.offset, new $t(this.src, t, n, !1);
1524
1524
  }
1525
1525
  err(t, n = 0) {
1526
1526
  const r = this.ok(t, n);
1527
1527
  return r.isError = !0, r;
1528
1528
  }
1529
1529
  from(t, n = 0) {
1530
- return n += this.offset, new It(this.src, t, n, this.isError);
1530
+ return n += this.offset, new $t(this.src, t, n, this.isError);
1531
1531
  }
1532
1532
  getColumnNumber() {
1533
1533
  const t = this.offset, n = this.src.lastIndexOf(`
@@ -1541,38 +1541,38 @@ class It {
1541
1541
  `).length : 0;
1542
1542
  }
1543
1543
  toString() {
1544
- return bn(this);
1544
+ return ar(this);
1545
1545
  }
1546
1546
  }
1547
- function v(e, t, ...n) {
1547
+ function M(e, t, ...n) {
1548
1548
  return {
1549
1549
  name: e,
1550
1550
  parser: t,
1551
1551
  args: n
1552
1552
  };
1553
1553
  }
1554
- let br = 0;
1555
- const st = /* @__PURE__ */ new Map(), vt = /* @__PURE__ */ new Map();
1556
- let gt;
1557
- function L(e) {
1558
- return (!gt || e.offset > gt.offset) && (gt = e), gt;
1554
+ let ho = 0;
1555
+ const lt = /* @__PURE__ */ new Map(), _t = /* @__PURE__ */ new Map();
1556
+ let At;
1557
+ function F(e) {
1558
+ return (!At || e.offset > At.offset) && (At = e), At;
1559
1559
  }
1560
- function dn(e) {
1560
+ function cr(e) {
1561
1561
  return e.parser ? e.parser : e.parser = e();
1562
1562
  }
1563
- class y {
1563
+ class x {
1564
1564
  constructor(t, n = {}) {
1565
1565
  this.parser = t, this.context = n;
1566
1566
  }
1567
- id = br++;
1567
+ id = ho++;
1568
1568
  state;
1569
1569
  reset() {
1570
- gt = void 0, st.clear(), vt.clear();
1570
+ At = void 0, lt.clear(), _t.clear();
1571
1571
  }
1572
1572
  parseState(t) {
1573
1573
  this.reset();
1574
- const n = this.parser(new It(t));
1575
- return this.state = L(n), this.state.isError = n.isError, this.state.isError, n;
1574
+ const n = this.parser(new $t(t));
1575
+ return this.state = F(n), this.state.isError = n.isError, this.state.isError, n;
1576
1576
  }
1577
1577
  parse(t) {
1578
1578
  return this.parseState(t).value;
@@ -1581,38 +1581,38 @@ class y {
1581
1581
  return `${this.id}${t.offset}`;
1582
1582
  }
1583
1583
  atLeftRecursionLimit(t) {
1584
- return (vt.get(this.getCijKey(t)) ?? 0) > t.src.length - t.offset;
1584
+ return (_t.get(this.getCijKey(t)) ?? 0) > t.src.length - t.offset;
1585
1585
  }
1586
1586
  memoize() {
1587
1587
  const t = (n) => {
1588
- const r = this.getCijKey(n), o = vt.get(r) ?? 0;
1589
- let s = st.get(this.id);
1588
+ const r = this.getCijKey(n), o = _t.get(r) ?? 0;
1589
+ let s = lt.get(this.id);
1590
1590
  if (s && s.offset >= n.offset)
1591
1591
  return s;
1592
1592
  if (this.atLeftRecursionLimit(n))
1593
1593
  return n.err(void 0);
1594
- vt.set(r, o + 1);
1594
+ _t.set(r, o + 1);
1595
1595
  const i = this.parser(n);
1596
- return s = st.get(this.id), s && s.offset > i.offset ? i.offset = s.offset : s || st.set(this.id, i), i;
1596
+ return s = lt.get(this.id), s && s.offset > i.offset ? i.offset = s.offset : s || lt.set(this.id, i), i;
1597
1597
  };
1598
- return new y(
1598
+ return new x(
1599
1599
  t,
1600
- v("memoize", this)
1600
+ M("memoize", this)
1601
1601
  );
1602
1602
  }
1603
1603
  mergeMemos() {
1604
1604
  const t = (n) => {
1605
- let r = st.get(this.id);
1605
+ let r = lt.get(this.id);
1606
1606
  if (r)
1607
1607
  return r;
1608
1608
  if (this.atLeftRecursionLimit(n))
1609
1609
  return n.err(void 0);
1610
1610
  const o = this.parser(n);
1611
- return r = st.get(this.id), r || st.set(this.id, o), o;
1611
+ return r = lt.get(this.id), r || lt.set(this.id, o), o;
1612
1612
  };
1613
- return new y(
1613
+ return new x(
1614
1614
  t,
1615
- v("mergeMemo", this)
1615
+ M("mergeMemo", this)
1616
1616
  );
1617
1617
  }
1618
1618
  then(t) {
@@ -1623,11 +1623,11 @@ class y {
1623
1623
  if (!s.isError)
1624
1624
  return s.ok([o.value, s.value]);
1625
1625
  }
1626
- return L(r), r.err(void 0);
1626
+ return F(r), r.err(void 0);
1627
1627
  };
1628
- return new y(
1628
+ return new x(
1629
1629
  n,
1630
- v("then", this, this, t)
1630
+ M("then", this, this, t)
1631
1631
  );
1632
1632
  }
1633
1633
  or(t) {
@@ -1635,9 +1635,9 @@ class y {
1635
1635
  const o = this.parser(r);
1636
1636
  return o.isError ? t.parser(r) : o;
1637
1637
  };
1638
- return new y(
1638
+ return new x(
1639
1639
  n,
1640
- v("or", this, this, t)
1640
+ M("or", this, this, t)
1641
1641
  );
1642
1642
  }
1643
1643
  chain(t, n = !1) {
@@ -1645,9 +1645,9 @@ class y {
1645
1645
  const s = this.parser(o);
1646
1646
  return s.isError ? s : s.value || n ? t(s.value).parser(s) : o;
1647
1647
  };
1648
- return new y(
1648
+ return new x(
1649
1649
  r,
1650
- v("chain", this, t)
1650
+ M("chain", this, t)
1651
1651
  );
1652
1652
  }
1653
1653
  map(t, n = !1) {
@@ -1655,9 +1655,9 @@ class y {
1655
1655
  const s = this.parser(o);
1656
1656
  return !s.isError || n ? s.ok(t(s.value)) : s;
1657
1657
  };
1658
- return new y(
1658
+ return new x(
1659
1659
  r,
1660
- v("map", this)
1660
+ M("map", this)
1661
1661
  );
1662
1662
  }
1663
1663
  mapState(t) {
@@ -1665,9 +1665,9 @@ class y {
1665
1665
  const o = this.parser(r);
1666
1666
  return t(o, r);
1667
1667
  };
1668
- return new y(
1668
+ return new x(
1669
1669
  n,
1670
- v("mapState", this)
1670
+ M("mapState", this)
1671
1671
  );
1672
1672
  }
1673
1673
  skip(t) {
@@ -1678,54 +1678,54 @@ class y {
1678
1678
  if (!s.isError)
1679
1679
  return s.ok(o.value);
1680
1680
  }
1681
- return L(r), r.err(void 0);
1681
+ return F(r), r.err(void 0);
1682
1682
  };
1683
- return new y(
1683
+ return new x(
1684
1684
  n,
1685
- v("skip", this, t)
1685
+ M("skip", this, t)
1686
1686
  );
1687
1687
  }
1688
1688
  next(t) {
1689
1689
  const n = this.then(t).map(([, r]) => r);
1690
- return n.context = v("next", this, t), n;
1690
+ return n.context = M("next", this, t), n;
1691
1691
  }
1692
1692
  opt() {
1693
1693
  const t = (n) => {
1694
1694
  const r = this.parser(n);
1695
- return r.isError ? (L(n), n.ok(void 0)) : r;
1695
+ return r.isError ? (F(n), n.ok(void 0)) : r;
1696
1696
  };
1697
- return new y(
1697
+ return new x(
1698
1698
  t,
1699
- v("opt", this)
1699
+ M("opt", this)
1700
1700
  );
1701
1701
  }
1702
1702
  not(t) {
1703
- const n = (o) => this.parser(o).isError ? (L(o), o.ok(o.value)) : o.err(void 0), r = (o) => {
1703
+ const n = (o) => this.parser(o).isError ? (F(o), o.ok(o.value)) : o.err(void 0), r = (o) => {
1704
1704
  const s = this.parser(o);
1705
- return s.isError ? (L(o), s) : t.parser(o).isError ? s : (L(o), o.err(void 0));
1705
+ return s.isError ? (F(o), s) : t.parser(o).isError ? s : (F(o), o.err(void 0));
1706
1706
  };
1707
- return new y(
1707
+ return new x(
1708
1708
  t ? r : n,
1709
- v("not", this, t)
1709
+ M("not", this, t)
1710
1710
  );
1711
1711
  }
1712
1712
  wrap(t, n, r = !0) {
1713
1713
  if (!r)
1714
- return M(t, this, n);
1714
+ return I(t, this, n);
1715
1715
  const o = t.next(this).skip(n);
1716
- return o.context = v("wrap", this, t, n), o;
1716
+ return o.context = M("wrap", this, t, n), o;
1717
1717
  }
1718
1718
  trim(t = g, n = !0) {
1719
1719
  if (!n)
1720
- return M(t, this, t);
1720
+ return I(t, this, t);
1721
1721
  if (t.context?.name === "whitespace") {
1722
1722
  const r = (o) => {
1723
- const s = Qe(o), i = this.parser(s);
1724
- return i.isError ? (L(o), o.err(void 0)) : Qe(i);
1723
+ const s = bn(o), i = this.parser(s);
1724
+ return i.isError ? (F(o), o.err(void 0)) : bn(i);
1725
1725
  };
1726
- return new y(
1726
+ return new x(
1727
1727
  r,
1728
- v("trimWhitespace", this)
1728
+ M("trimWhitespace", this)
1729
1729
  );
1730
1730
  }
1731
1731
  return this.wrap(t, t);
@@ -1740,11 +1740,11 @@ class y {
1740
1740
  break;
1741
1741
  s.push(c.value), i = c;
1742
1742
  }
1743
- return s.length >= t ? i.ok(s) : (L(o), o.err([]));
1743
+ return s.length >= t ? i.ok(s) : (F(o), o.err([]));
1744
1744
  };
1745
- return new y(
1745
+ return new x(
1746
1746
  r,
1747
- v("many", this, t, n)
1747
+ M("many", this, t, n)
1748
1748
  );
1749
1749
  }
1750
1750
  sepBy(t, n = 0, r = 1 / 0) {
@@ -1756,58 +1756,58 @@ class y {
1756
1756
  if (l.isError)
1757
1757
  break;
1758
1758
  a = l, i.push(a.value);
1759
- const m = t.parser(a);
1760
- if (m.isError)
1759
+ const p = t.parser(a);
1760
+ if (p.isError)
1761
1761
  break;
1762
- a = m;
1762
+ a = p;
1763
1763
  }
1764
- return i.length > n ? a.ok(i) : (L(s), s.err([]));
1764
+ return i.length > n ? a.ok(i) : (F(s), s.err([]));
1765
1765
  };
1766
- return new y(
1766
+ return new x(
1767
1767
  o,
1768
- v("sepBy", this, t)
1768
+ M("sepBy", this, t)
1769
1769
  );
1770
1770
  }
1771
1771
  eof() {
1772
- const t = this.skip(dr());
1773
- return t.context = v("eof", this), t;
1772
+ const t = this.skip(fo());
1773
+ return t.context = M("eof", this), t;
1774
1774
  }
1775
1775
  debug(t = "", n = !1, r = console.log) {
1776
- return fr(this, t, n, r);
1776
+ return mo(this, t, n, r);
1777
1777
  }
1778
1778
  toString() {
1779
- return fn(this);
1779
+ return ir(this);
1780
1780
  }
1781
1781
  static lazy(t) {
1782
- const n = (r) => dn(t).parser(r);
1783
- return new y(
1782
+ const n = (r) => cr(t).parser(r);
1783
+ return new x(
1784
1784
  n,
1785
- v("lazy", void 0, t)
1785
+ M("lazy", void 0, t)
1786
1786
  );
1787
1787
  }
1788
1788
  }
1789
- function dr() {
1790
- const e = (t) => t.offset >= t.src.length ? t.ok(void 0) : (L(t), t.err());
1791
- return new y(
1789
+ function fo() {
1790
+ const e = (t) => t.offset >= t.src.length ? t.ok(void 0) : (F(t), t.err());
1791
+ return new x(
1792
1792
  e,
1793
- v("eof", void 0)
1793
+ M("eof", void 0)
1794
1794
  );
1795
1795
  }
1796
- function b(...e) {
1796
+ function d(...e) {
1797
1797
  const t = (n) => {
1798
1798
  for (const r of e) {
1799
1799
  const o = r.parser(n);
1800
1800
  if (!o.isError)
1801
1801
  return o;
1802
1802
  }
1803
- return L(n), n.err(void 0);
1803
+ return F(n), n.err(void 0);
1804
1804
  };
1805
- return new y(
1805
+ return new x(
1806
1806
  e.length === 1 ? e[0].parser : t,
1807
- v("any", void 0, ...e)
1807
+ M("any", void 0, ...e)
1808
1808
  );
1809
1809
  }
1810
- function M(...e) {
1810
+ function I(...e) {
1811
1811
  const t = (n) => {
1812
1812
  const r = [];
1813
1813
  let o = n;
@@ -1817,67 +1817,67 @@ function M(...e) {
1817
1817
  return i;
1818
1818
  i.value !== void 0 && r.push(i.value), o = i;
1819
1819
  }
1820
- return L(o), o.ok(r);
1820
+ return F(o), o.ok(r);
1821
1821
  };
1822
- return new y(
1822
+ return new x(
1823
1823
  e.length === 1 ? e[0].parser : t,
1824
- v("all", void 0, ...e)
1824
+ M("all", void 0, ...e)
1825
1825
  );
1826
1826
  }
1827
- function A(e) {
1827
+ function B(e) {
1828
1828
  const t = (n) => {
1829
1829
  if (n.offset >= n.src.length)
1830
1830
  return n.err(void 0);
1831
1831
  const r = n.src.slice(n.offset, n.offset + e.length);
1832
- return r === e ? n.ok(r, r.length) : (L(n), n.err(void 0));
1832
+ return r === e ? n.ok(r, r.length) : (F(n), n.err(void 0));
1833
1833
  };
1834
- return new y(
1834
+ return new x(
1835
1835
  t,
1836
- v("string", void 0, e)
1836
+ M("string", void 0, e)
1837
1837
  );
1838
1838
  }
1839
- function G(e, t = (n) => n?.[0] ?? null) {
1839
+ function D(e, t = (n) => n?.[0] ?? null) {
1840
1840
  const n = e.flags.replace(/y/g, ""), r = new RegExp(e, n + "y"), o = (s) => {
1841
1841
  if (s.offset >= s.src.length)
1842
1842
  return s.err(void 0);
1843
1843
  r.lastIndex = s.offset;
1844
1844
  const i = t(s.src.match(r));
1845
- return i ? s.ok(i, r.lastIndex - s.offset) : i === "" ? s.ok(void 0) : (L(s), s.err(void 0));
1845
+ return i ? s.ok(i, r.lastIndex - s.offset) : i === "" ? s.ok(void 0) : (F(s), s.err(void 0));
1846
1846
  };
1847
- return new y(
1847
+ return new x(
1848
1848
  o,
1849
- v("regex", void 0, e)
1849
+ M("regex", void 0, e)
1850
1850
  );
1851
1851
  }
1852
- const Je = /\s*/y, Qe = (e) => {
1852
+ const fn = /\s*/y, bn = (e) => {
1853
1853
  if (e.offset >= e.src.length)
1854
1854
  return e;
1855
- Je.lastIndex = e.offset;
1856
- const t = e.src.match(Je)?.[0] ?? "";
1855
+ fn.lastIndex = e.offset;
1856
+ const t = e.src.match(fn)?.[0] ?? "";
1857
1857
  return e.ok(e.value, t.length);
1858
- }, g = G(/\s*/);
1858
+ }, g = D(/\s*/);
1859
1859
  g.context.name = "whitespace";
1860
- const p = (e) => {
1860
+ const m = (e) => {
1861
1861
  const t = new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "i");
1862
- return G(t);
1863
- }, gr = G(/-?[a-zA-Z][a-zA-Z0-9-]*/), xe = p("none"), wr = G(/-?\d+/).map(Number), q = G(/-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/).map(Number);
1864
- function kr(e) {
1865
- return new y((t) => t.ok(e, 0));
1862
+ return D(t);
1863
+ }, bo = D(/-?[a-zA-Z][a-zA-Z0-9-]*/), Pe = m("none"), go = D(/-?\d+/).map(Number), et = D(/-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/).map(Number);
1864
+ function wo(e) {
1865
+ return new x((t) => t.ok(e, 0));
1866
1866
  }
1867
- function yr(e) {
1868
- return new y((t) => t.err(void 0, 0));
1867
+ function ko(e) {
1868
+ return new x((t) => t.err(void 0, 0));
1869
1869
  }
1870
- function Ct(e, t) {
1870
+ function Bt(e, t) {
1871
1871
  const n = e.parseState(t);
1872
1872
  if (n.isError)
1873
1873
  throw new Error(`Parse error at offset ${n.offset}`);
1874
1874
  return n.value;
1875
1875
  }
1876
- function Us(e, t) {
1876
+ function ba(e, t) {
1877
1877
  const n = e.parseState(t);
1878
1878
  return { status: !n.isError, value: n.value };
1879
1879
  }
1880
- function R(e, t) {
1880
+ function N(e, t) {
1881
1881
  const [n, r, o] = e;
1882
1882
  return [
1883
1883
  t[0] * n + t[1] * r + t[2] * o,
@@ -1885,7 +1885,7 @@ function R(e, t) {
1885
1885
  t[6] * n + t[7] * r + t[8] * o
1886
1886
  ];
1887
1887
  }
1888
- function Vs(e) {
1888
+ function da(e) {
1889
1889
  return [
1890
1890
  e[0],
1891
1891
  e[3],
@@ -1898,7 +1898,7 @@ function Vs(e) {
1898
1898
  e[8]
1899
1899
  ];
1900
1900
  }
1901
- function Ws(e, t) {
1901
+ function ga(e, t) {
1902
1902
  return [
1903
1903
  e[0] * t[0] + e[1] * t[3] + e[2] * t[6],
1904
1904
  e[0] * t[1] + e[1] * t[4] + e[2] * t[7],
@@ -1911,54 +1911,54 @@ function Ws(e, t) {
1911
1911
  e[6] * t[2] + e[7] * t[5] + e[8] * t[8]
1912
1912
  ];
1913
1913
  }
1914
- function J(e) {
1915
- const [t, n, r, o, s, i, a, c, l] = e, m = s * l - i * c, u = -(o * l - i * a), d = o * c - s * a, S = 1 / (t * m + n * u + r * d);
1914
+ function nt(e) {
1915
+ const [t, n, r, o, s, i, a, c, l] = e, p = s * l - i * c, u = -(o * l - i * a), f = o * c - s * a, y = 1 / (t * p + n * u + r * f);
1916
1916
  return [
1917
- m * S,
1918
- (r * c - n * l) * S,
1919
- (n * i - r * s) * S,
1920
- u * S,
1921
- (t * l - r * a) * S,
1922
- (r * o - t * i) * S,
1923
- d * S,
1924
- (n * a - t * c) * S,
1925
- (t * s - n * o) * S
1917
+ p * y,
1918
+ (r * c - n * l) * y,
1919
+ (n * i - r * s) * y,
1920
+ u * y,
1921
+ (t * l - r * a) * y,
1922
+ (r * o - t * i) * y,
1923
+ f * y,
1924
+ (n * a - t * c) * y,
1925
+ (t * s - n * o) * y
1926
1926
  ];
1927
1927
  }
1928
- const I = 255, h = {
1928
+ const _ = 255, h = {
1929
1929
  "%": { min: 0, max: 100 },
1930
1930
  number: { min: 0, max: 1 }
1931
- }, jt = {
1931
+ }, oe = {
1932
1932
  "%": h["%"],
1933
- number: { min: 0, max: I }
1933
+ number: { min: 0, max: _ }
1934
1934
  }, z = {
1935
1935
  "%": h["%"],
1936
1936
  number: h.number
1937
- }, dt = {
1937
+ }, Tt = {
1938
1938
  deg: { min: 0, max: 360 },
1939
1939
  number: { min: 0, max: 360 },
1940
1940
  "%": h["%"]
1941
- }, f = {
1941
+ }, b = {
1942
1942
  rgb: {
1943
- r: jt,
1944
- g: jt,
1945
- b: jt,
1943
+ r: oe,
1944
+ g: oe,
1945
+ b: oe,
1946
1946
  alpha: h
1947
1947
  },
1948
1948
  hsl: {
1949
- h: dt,
1949
+ h: Tt,
1950
1950
  s: { "%": h["%"], number: h.number },
1951
1951
  l: { "%": h["%"], number: h.number },
1952
1952
  alpha: h
1953
1953
  },
1954
1954
  hsv: {
1955
- h: dt,
1955
+ h: Tt,
1956
1956
  s: { "%": h["%"], number: h.number },
1957
1957
  v: { "%": h["%"], number: h.number },
1958
1958
  alpha: h
1959
1959
  },
1960
1960
  hwb: {
1961
- h: dt,
1961
+ h: Tt,
1962
1962
  w: { "%": h["%"], number: h.number },
1963
1963
  b: { "%": h["%"], number: h.number },
1964
1964
  alpha: h
@@ -1972,7 +1972,7 @@ const I = 255, h = {
1972
1972
  lch: {
1973
1973
  l: { "%": h["%"], number: h["%"] },
1974
1974
  c: { number: { min: 0, max: 150 }, "%": h["%"] },
1975
- h: dt,
1975
+ h: Tt,
1976
1976
  alpha: h
1977
1977
  },
1978
1978
  oklab: {
@@ -1984,7 +1984,7 @@ const I = 255, h = {
1984
1984
  oklch: {
1985
1985
  l: { "%": h["%"], number: h["%"] },
1986
1986
  c: { number: { min: 0, max: 0.5 }, "%": h["%"] },
1987
- h: dt,
1987
+ h: Tt,
1988
1988
  alpha: h
1989
1989
  },
1990
1990
  xyz: {
@@ -2027,96 +2027,96 @@ const I = 255, h = {
2027
2027
  b: z,
2028
2028
  alpha: h
2029
2029
  }
2030
- }, _ = "%", gn = {
2030
+ }, $ = "%", lr = {
2031
2031
  rgb: {
2032
2032
  r: "",
2033
2033
  g: "",
2034
2034
  b: "",
2035
- alpha: _
2035
+ alpha: $
2036
2036
  },
2037
2037
  hsl: {
2038
2038
  h: "deg",
2039
2039
  s: "%",
2040
2040
  l: "%",
2041
- alpha: _
2041
+ alpha: $
2042
2042
  },
2043
2043
  hsv: {
2044
2044
  h: "deg",
2045
2045
  s: "%",
2046
2046
  v: "%",
2047
- alpha: _
2047
+ alpha: $
2048
2048
  },
2049
2049
  hwb: {
2050
2050
  h: "deg",
2051
2051
  w: "%",
2052
2052
  b: "%",
2053
- alpha: _
2053
+ alpha: $
2054
2054
  },
2055
2055
  lab: {
2056
2056
  l: "%",
2057
2057
  a: "",
2058
2058
  b: "",
2059
- alpha: _
2059
+ alpha: $
2060
2060
  },
2061
2061
  lch: {
2062
2062
  l: "%",
2063
2063
  c: "",
2064
2064
  h: "deg",
2065
- alpha: _
2065
+ alpha: $
2066
2066
  },
2067
2067
  oklab: {
2068
2068
  l: "%",
2069
2069
  a: "",
2070
2070
  b: "",
2071
- alpha: _
2071
+ alpha: $
2072
2072
  },
2073
2073
  oklch: {
2074
2074
  l: "%",
2075
2075
  c: "",
2076
2076
  h: "deg",
2077
- alpha: _
2077
+ alpha: $
2078
2078
  },
2079
2079
  xyz: {
2080
2080
  x: "%",
2081
2081
  y: "%",
2082
2082
  z: "%",
2083
- alpha: _
2083
+ alpha: $
2084
2084
  },
2085
2085
  kelvin: {
2086
2086
  kelvin: "K",
2087
- alpha: _
2087
+ alpha: $
2088
2088
  },
2089
2089
  "srgb-linear": {
2090
2090
  r: "",
2091
2091
  g: "",
2092
2092
  b: "",
2093
- alpha: _
2093
+ alpha: $
2094
2094
  },
2095
2095
  "display-p3": {
2096
2096
  r: "",
2097
2097
  g: "",
2098
2098
  b: "",
2099
- alpha: _
2099
+ alpha: $
2100
2100
  },
2101
2101
  "a98-rgb": {
2102
2102
  r: "",
2103
2103
  g: "",
2104
2104
  b: "",
2105
- alpha: _
2105
+ alpha: $
2106
2106
  },
2107
2107
  "prophoto-rgb": {
2108
2108
  r: "",
2109
2109
  g: "",
2110
2110
  b: "",
2111
- alpha: _
2111
+ alpha: $
2112
2112
  },
2113
2113
  rec2020: {
2114
2114
  r: "",
2115
2115
  g: "",
2116
2116
  b: "",
2117
- alpha: _
2117
+ alpha: $
2118
2118
  }
2119
- }, Xs = {
2119
+ }, wa = {
2120
2120
  rgb: "RGB",
2121
2121
  hsl: "HSL",
2122
2122
  hsv: "HSV",
@@ -2132,15 +2132,15 @@ const I = 255, h = {
2132
2132
  "a98-rgb": "Adobe RGB",
2133
2133
  "prophoto-rgb": "ProPhoto RGB",
2134
2134
  rec2020: "Rec. 2020"
2135
- }, Sr = [
2135
+ }, So = [
2136
2136
  0.3127 / 0.329,
2137
2137
  1,
2138
2138
  (1 - 0.3127 - 0.329) / 0.329
2139
- ], xr = [
2139
+ ], yo = [
2140
2140
  0.3457 / 0.3585,
2141
2141
  1,
2142
2142
  (1 - 0.3457 - 0.3585) / 0.3585
2143
- ], Ce = [
2143
+ ], Oe = [
2144
2144
  1.0479297925449969,
2145
2145
  0.022946870601609652,
2146
2146
  -0.05019226628920524,
@@ -2150,10 +2150,10 @@ const I = 255, h = {
2150
2150
  -0.009243040646204504,
2151
2151
  0.015055191490298152,
2152
2152
  0.7518742814281371
2153
- ], wn = J(Ce), kn = {
2154
- D65: Sr,
2155
- D50: xr
2156
- }, yn = [
2153
+ ], ur = nt(Oe), pr = {
2154
+ D65: So,
2155
+ D50: yo
2156
+ }, mr = [
2157
2157
  0.819022437996703,
2158
2158
  0.3619062600528904,
2159
2159
  -0.1288737815209879,
@@ -2163,7 +2163,7 @@ const I = 255, h = {
2163
2163
  0.0481771893596242,
2164
2164
  0.2642395317527308,
2165
2165
  0.6335478284694309
2166
- ], Cr = J(yn), Sn = [
2166
+ ], Co = nt(mr), hr = [
2167
2167
  0.210454268309314,
2168
2168
  0.7936177747023054,
2169
2169
  -0.0040720430116193,
@@ -2173,7 +2173,7 @@ const I = 255, h = {
2173
2173
  0.0259040424655478,
2174
2174
  0.7827717124575296,
2175
2175
  -0.8086757549230774
2176
- ], Tr = J(Sn), w = [
2176
+ ], xo = nt(hr), k = [
2177
2177
  4.0767416621,
2178
2178
  -3.3077115913,
2179
2179
  0.2309699292,
@@ -2183,7 +2183,7 @@ const I = 255, h = {
2183
2183
  -0.0041960863,
2184
2184
  -0.7034186147,
2185
2185
  1.707614701
2186
- ], Y = [
2186
+ ], j = [
2187
2187
  0.4122214708,
2188
2188
  0.5363325363,
2189
2189
  0.0514459929,
@@ -2193,11 +2193,11 @@ const I = 255, h = {
2193
2193
  0.0883024619,
2194
2194
  0.2817188376,
2195
2195
  0.6299787005
2196
- ], O = {
2196
+ ], P = {
2197
2197
  l: [1, 0.3963377774, 0.2158037573],
2198
2198
  m: [1, -0.1055613458, -0.0638541728],
2199
2199
  s: [1, -0.0894841775, -1.291485548]
2200
- }, vr = [
2200
+ }, Eo = [
2201
2201
  {
2202
2202
  // Red sector: -1.88170328*a - 0.80936493*b > 1
2203
2203
  test: (e, t) => -1.88170328 * e - 0.80936493 * t > 1,
@@ -2234,7 +2234,7 @@ const I = 255, h = {
2234
2234
  wm: -0.7034186147,
2235
2235
  ws: 1.707614701
2236
2236
  }
2237
- ], tn = {
2237
+ ], dn = {
2238
2238
  aliceblue: "#f0f8ff",
2239
2239
  antiquewhite: "#faebd7",
2240
2240
  aqua: "#00ffff",
@@ -2375,6 +2375,7 @@ const I = 255, h = {
2375
2375
  tan: "#d2b48c",
2376
2376
  teal: "#008080",
2377
2377
  thistle: "#d8bfd8",
2378
+ transparent: "rgba(0, 0, 0, 0)",
2378
2379
  tomato: "#ff6347",
2379
2380
  turquoise: "#40e0d0",
2380
2381
  violet: "#ee82ee",
@@ -2389,184 +2390,184 @@ const I = 255, h = {
2389
2390
  shadyshroom: "oklch(53% 0.07 21.60deg / 100%)",
2390
2391
  patriarchalplum: "oklch(31.20% 0.11 19.80deg / 100%)"
2391
2392
  };
2392
- function X(e, t, n) {
2393
+ function v(e, t, n) {
2393
2394
  return Math.min(Math.max(e, t), n);
2394
2395
  }
2395
- function B(e, t, n, r = 0, o = 1) {
2396
+ function R(e, t, n, r = 0, o = 1) {
2396
2397
  const s = (o - r) / (n - t);
2397
2398
  if (n === t)
2398
2399
  throw new Error("fromMax and fromMin cannot be equal");
2399
2400
  return (e - t) * s + r;
2400
2401
  }
2401
- function oe(e, t, n) {
2402
+ function de(e, t, n) {
2402
2403
  return (1 - e) * t + e * n;
2403
2404
  }
2404
- function Hs(e, t, n) {
2405
+ function ka(e, t, n) {
2405
2406
  return t = t === 0 ? 1e-9 : t, t * Math.pow(n / t, e);
2406
2407
  }
2407
- function Rt(e, t) {
2408
+ function Ft(e, t) {
2408
2409
  const n = t.length - 1, r = [...t];
2409
2410
  for (let o = 1; o <= n; o++)
2410
2411
  for (let s = 0; s <= n - o; s++)
2411
- r[s] = oe(e, r[s], r[s + 1]);
2412
+ r[s] = de(e, r[s], r[s + 1]);
2412
2413
  return r[0];
2413
2414
  }
2414
- function Mr(e, t, n, r, o) {
2415
- return [Rt(e, [0, t, r, 1]), Rt(e, [0, n, o, 1])];
2415
+ function fr(e, t, n, r, o) {
2416
+ return [Ft(e, [0, t, r, 1]), Ft(e, [0, n, o, 1])];
2416
2417
  }
2417
- function Ys(e, t) {
2418
+ function jt(e, t) {
2418
2419
  const n = t.map((o) => o[0]), r = t.map((o) => o[1]);
2419
- return [Rt(e, n), Rt(e, r)];
2420
+ return [Ft(e, n), Ft(e, r)];
2420
2421
  }
2421
- function js(e, t, n, r) {
2422
+ function Sa(e, t, n, r) {
2422
2423
  let o = "M0 0";
2423
2424
  for (let s = 0; s <= 1; s += 1e-3) {
2424
- const [i, a] = Mr(s, e, t, n, r);
2425
+ const [i, a] = fr(s, e, t, n, r);
2425
2426
  o += ` L${i} ${a}`;
2426
2427
  }
2427
2428
  return `<path d="${o}"/>`;
2428
2429
  }
2429
- function Zs(e, t, n, r) {
2430
+ function ya(e, t, n, r) {
2430
2431
  const o = (s) => s.toFixed(2);
2431
2432
  return `cubic-bezier(${o(e)}, ${o(t)}, ${o(n)}, ${o(r)})`;
2432
2433
  }
2433
- const xn = 2.4, Pt = 0.055, Te = 12.92, Br = 0.04045, Cn = Br / Te;
2434
- function Zt(e) {
2434
+ const br = 2.4, Gt = 0.055, Le = 12.92, To = 0.04045, dr = To / Le;
2435
+ function se(e) {
2435
2436
  const t = e < 0 ? -1 : 1, n = e * t;
2436
- return n <= Cn ? e / Te : t * ((n + Pt) / (1 + Pt)) ** xn;
2437
+ return n <= dr ? e / Le : t * ((n + Gt) / (1 + Gt)) ** br;
2437
2438
  }
2438
- function Kt(e) {
2439
+ function ie(e) {
2439
2440
  const t = e < 0 ? -1 : 1, n = e * t;
2440
- return n <= Cn ? e * Te : t * ((1 + Pt) * n ** (1 / xn) - Pt);
2441
+ return n <= dr ? e * Le : t * ((1 + Gt) * n ** (1 / br) - Gt);
2441
2442
  }
2442
- function qt(e, t, n) {
2443
+ function ae(e, t, n) {
2443
2444
  return Math.min(Math.max(e, t), n);
2444
2445
  }
2445
- const Ks = 0.02;
2446
- function qs(e, t, n, r, o, s) {
2446
+ const Ca = 0.02;
2447
+ function xa(e, t, n, r, o, s) {
2447
2448
  const i = e - r, a = t - o, c = n - s;
2448
2449
  return Math.sqrt(i * i + a * a + c * c);
2449
2450
  }
2450
- function ve(e, t, n) {
2451
- const r = e + O.l[1] * t + O.l[2] * n, o = e + O.m[1] * t + O.m[2] * n, s = e + O.s[1] * t + O.s[2] * n, i = r * r * r, a = o * o * o, c = s * s * s;
2451
+ function ze(e, t, n) {
2452
+ const r = e + P.l[1] * t + P.l[2] * n, o = e + P.m[1] * t + P.m[2] * n, s = e + P.s[1] * t + P.s[2] * n, i = r * r * r, a = o * o * o, c = s * s * s;
2452
2453
  return [
2453
- w[0] * i + w[1] * a + w[2] * c,
2454
- w[3] * i + w[4] * a + w[5] * c,
2455
- w[6] * i + w[7] * a + w[8] * c
2454
+ k[0] * i + k[1] * a + k[2] * c,
2455
+ k[3] * i + k[4] * a + k[5] * c,
2456
+ k[6] * i + k[7] * a + k[8] * c
2456
2457
  ];
2457
2458
  }
2458
- function Er(e, t, n) {
2459
+ function Ao(e, t, n) {
2459
2460
  return e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1;
2460
2461
  }
2461
- function Ar(e, t) {
2462
- const n = vr.find((C) => C.test(e, t)), { k0: r, k1: o, k2: s, k3: i, k4: a, wl: c, wm: l, ws: m } = n;
2462
+ function Mo(e, t) {
2463
+ const n = Eo.find((E) => E.test(e, t)), { k0: r, k1: o, k2: s, k3: i, k4: a, wl: c, wm: l, ws: p } = n;
2463
2464
  let u = r + o * e + s * t + i * e * e + a * e * t;
2464
- const d = O.l[1] * e + O.l[2] * t, x = O.m[1] * e + O.m[2] * t, S = O.s[1] * e + O.s[2] * t;
2465
+ const f = P.l[1] * e + P.l[2] * t, C = P.m[1] * e + P.m[2] * t, y = P.s[1] * e + P.s[2] * t;
2465
2466
  {
2466
- const C = 1 + u * d, P = 1 + u * x, T = 1 + u * S, E = C * C * C, N = P * P * P, V = T * T * T, tt = 3 * d * C * C, et = 3 * x * P * P, nt = 3 * S * T * T, ht = 6 * d * d * C, ft = 6 * x * x * P, bt = 6 * S * S * T, ct = c * E + l * N + m * V, rt = c * tt + l * et + m * nt, Tt = c * ht + l * ft + m * bt;
2467
- u = u - ct * rt / (rt * rt - 0.5 * ct * Tt);
2467
+ const E = 1 + u * f, w = 1 + u * C, T = 1 + u * y, A = E * E * E, L = w * w * w, W = T * T * T, ot = 3 * f * E * E, st = 3 * C * w * w, it = 3 * y * T * T, Ct = 6 * f * f * E, xt = 6 * C * C * w, Et = 6 * y * y * T, ht = c * A + l * L + p * W, at = c * ot + l * st + p * it, Nt = c * Ct + l * xt + p * Et;
2468
+ u = u - ht * at / (at * at - 0.5 * ht * Nt);
2468
2469
  }
2469
2470
  return u;
2470
2471
  }
2471
- function Ir(e, t) {
2472
- const n = Ar(e, t), [r, o, s] = ve(1, n * e, n * t), i = Math.cbrt(1 / Math.max(r, o, s)), a = i * n;
2472
+ function Io(e, t) {
2473
+ const n = Mo(e, t), [r, o, s] = ze(1, n * e, n * t), i = Math.cbrt(1 / Math.max(r, o, s)), a = i * n;
2473
2474
  return { L: i, C: a };
2474
2475
  }
2475
- function Rr(e, t, n, r, o, s) {
2476
+ function Ro(e, t, n, r, o, s) {
2476
2477
  let i;
2477
2478
  if ((n - o) * s.C - (s.L - o) * r <= 0)
2478
2479
  i = s.C * o / (r * s.L + s.C * (o - n));
2479
2480
  else {
2480
2481
  i = s.C * (o - 1) / (r * (s.L - 1) + s.C * (o - n));
2481
- const a = n - o, c = r, l = O.l[1] * e + O.l[2] * t, m = O.m[1] * e + O.m[2] * t, u = O.s[1] * e + O.s[2] * t, d = a + c * l, x = a + c * m, S = a + c * u;
2482
+ const a = n - o, c = r, l = P.l[1] * e + P.l[2] * t, p = P.m[1] * e + P.m[2] * t, u = P.s[1] * e + P.s[2] * t, f = a + c * l, C = a + c * p, y = a + c * u;
2482
2483
  {
2483
- const C = o * (1 - i) + i * n, P = i * r, T = C + P * l, E = C + P * m, N = C + P * u, V = T * T * T, tt = E * E * E, et = N * N * N, nt = 3 * d * T * T, ht = 3 * x * E * E, ft = 3 * S * N * N, bt = 6 * d * d * T, ct = 6 * x * x * E, rt = 6 * S * S * N, Tt = w[0] * V + w[1] * tt + w[2] * et - 1, Ut = w[0] * nt + w[1] * ht + w[2] * ft, rr = w[0] * bt + w[1] * ct + w[2] * rt, Ue = Ut / (Ut * Ut - 0.5 * Tt * rr);
2484
- let Vt = -Tt * Ue;
2485
- const Ve = w[3] * V + w[4] * tt + w[5] * et - 1, Wt = w[3] * nt + w[4] * ht + w[5] * ft, or = w[3] * bt + w[4] * ct + w[5] * rt, We = Wt / (Wt * Wt - 0.5 * Ve * or);
2486
- let Xt = -Ve * We;
2487
- const Xe = w[6] * V + w[7] * tt + w[8] * et - 1, Ht = w[6] * nt + w[7] * ht + w[8] * ft, sr = w[6] * bt + w[7] * ct + w[8] * rt, He = Ht / (Ht * Ht - 0.5 * Xe * sr);
2488
- let Yt = -Xe * He;
2489
- Vt = Ue >= 0 ? Vt : 1 / 0, Xt = We >= 0 ? Xt : 1 / 0, Yt = He >= 0 ? Yt : 1 / 0, i += Math.min(Vt, Xt, Yt);
2484
+ const E = o * (1 - i) + i * n, w = i * r, T = E + w * l, A = E + w * p, L = E + w * u, W = T * T * T, ot = A * A * A, st = L * L * L, it = 3 * f * T * T, Ct = 3 * C * A * A, xt = 3 * y * L * L, Et = 6 * f * f * T, ht = 6 * C * C * A, at = 6 * y * y * L, Nt = k[0] * W + k[1] * ot + k[2] * st - 1, Jt = k[0] * it + k[1] * Ct + k[2] * xt, eo = k[0] * Et + k[1] * ht + k[2] * at, rn = Jt / (Jt * Jt - 0.5 * Nt * eo);
2485
+ let Qt = -Nt * rn;
2486
+ const on = k[3] * W + k[4] * ot + k[5] * st - 1, te = k[3] * it + k[4] * Ct + k[5] * xt, no = k[3] * Et + k[4] * ht + k[5] * at, sn = te / (te * te - 0.5 * on * no);
2487
+ let ee = -on * sn;
2488
+ const an = k[6] * W + k[7] * ot + k[8] * st - 1, ne = k[6] * it + k[7] * Ct + k[8] * xt, ro = k[6] * Et + k[7] * ht + k[8] * at, cn = ne / (ne * ne - 0.5 * an * ro);
2489
+ let re = -an * cn;
2490
+ Qt = rn >= 0 ? Qt : 1 / 0, ee = sn >= 0 ? ee : 1 / 0, re = cn >= 0 ? re : 1 / 0, i += Math.min(Qt, ee, re);
2490
2491
  }
2491
2492
  }
2492
2493
  return i;
2493
2494
  }
2494
- const Pr = 1e-5, Or = 0.05;
2495
- function Nr(e, t, n) {
2496
- const [r, o, s] = ve(e, t, n);
2497
- if (Er(r, o, s))
2495
+ const vo = 1e-5, Bo = 0.05;
2496
+ function No(e, t, n) {
2497
+ const [r, o, s] = ze(e, t, n);
2498
+ if (Ao(r, o, s))
2498
2499
  return [e, t, n];
2499
- const i = Math.max(Pr, Math.sqrt(t * t + n * n)), a = t / i, c = n / i, l = Ir(a, c), m = e - 0.5, u = 0.5 + Math.abs(m) + Or * i, d = 0.5 * (1 + Math.sign(m) * (u - Math.sqrt(u * u - 2 * Math.abs(m)))), x = Rr(a, c, e, i, d, l), S = d * (1 - x) + x * e, C = x * i;
2500
- return [S, C * a, C * c];
2500
+ const i = Math.max(vo, Math.sqrt(t * t + n * n)), a = t / i, c = n / i, l = Io(a, c), p = e - 0.5, u = 0.5 + Math.abs(p) + Bo * i, f = 0.5 * (1 + Math.sign(p) * (u - Math.sqrt(u * u - 2 * Math.abs(p)))), C = Ro(a, c, e, i, f, l), y = f * (1 - C) + C * e, E = C * i;
2501
+ return [y, E * a, E * c];
2501
2502
  }
2502
- function zr(e, t, n) {
2503
- const r = Zt(e), o = Zt(t), s = Zt(n), i = Math.cbrt(Y[0] * r + Y[1] * o + Y[2] * s), a = Math.cbrt(Y[3] * r + Y[4] * o + Y[5] * s), c = Math.cbrt(Y[6] * r + Y[7] * o + Y[8] * s);
2503
+ function _o(e, t, n) {
2504
+ const r = se(e), o = se(t), s = se(n), i = Math.cbrt(j[0] * r + j[1] * o + j[2] * s), a = Math.cbrt(j[3] * r + j[4] * o + j[5] * s), c = Math.cbrt(j[6] * r + j[7] * o + j[8] * s);
2504
2505
  return [
2505
2506
  0.2104542553 * i + 0.793617785 * a - 0.0040720468 * c,
2506
2507
  1.9779984951 * i - 2.428592205 * a + 0.4505937099 * c,
2507
2508
  0.0259040371 * i + 0.7827717662 * a - 0.808675766 * c
2508
2509
  ];
2509
2510
  }
2510
- function _r(e, t, n) {
2511
+ function Po(e, t, n) {
2511
2512
  if (e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1)
2512
2513
  return [e, t, n];
2513
- const [r, o, s] = zr(e, t, n), [i, a, c] = Nr(r, o, s), [l, m, u] = ve(i, a, c);
2514
+ const [r, o, s] = _o(e, t, n), [i, a, c] = No(r, o, s), [l, p, u] = ze(i, a, c);
2514
2515
  return [
2515
- qt(Kt(l), 0, 1),
2516
- qt(Kt(m), 0, 1),
2517
- qt(Kt(u), 0, 1)
2516
+ ae(ie(l), 0, 1),
2517
+ ae(ie(p), 0, 1),
2518
+ ae(ie(u), 0, 1)
2518
2519
  ];
2519
2520
  }
2520
- const Js = (e) => {
2521
- const t = f[e], n = gn[e];
2521
+ const Ea = (e) => {
2522
+ const t = b[e], n = lr[e];
2522
2523
  return Object.entries(t).reduce((r, [o, s]) => {
2523
2524
  const i = n[o];
2524
2525
  let { min: a, max: c } = s[i] ?? s.number;
2525
2526
  return a = `${a}${i}`, c = `${c}${i}`, r[o] = { min: a, max: c }, r;
2526
2527
  }, {});
2527
- }, j = 16, Lr = (e) => {
2528
+ }, Y = 16, Oo = (e) => {
2528
2529
  if (e = e.slice(1), e.length <= 4) {
2529
- const t = parseInt(e[0] + e[0], j), n = parseInt(e[1] + e[1], j), r = parseInt(e[2] + e[2], j), o = e[3] ? parseInt(e[3] + e[3], j) / I : 1;
2530
- return new $(t, n, r, o);
2530
+ const t = parseInt(e[0] + e[0], Y), n = parseInt(e[1] + e[1], Y), r = parseInt(e[2] + e[2], Y), o = e[3] ? parseInt(e[3] + e[3], Y) / _ : 1;
2531
+ return new O(t, n, r, o);
2531
2532
  } else {
2532
- const t = parseInt(e.slice(0, 2), j), n = parseInt(e.slice(2, 4), j), r = parseInt(e.slice(4, 6), j), o = e.length === 8 ? parseInt(e.slice(6, 8), j) / I : 1;
2533
- return new $(t, n, r, o);
2533
+ const t = parseInt(e.slice(0, 2), Y), n = parseInt(e.slice(2, 4), Y), r = parseInt(e.slice(4, 6), Y), o = e.length === 8 ? parseInt(e.slice(6, 8), Y) / _ : 1;
2534
+ return new O(t, n, r, o);
2534
2535
  }
2535
- }, Qs = ({ r: e, g: t, b: n, alpha: r }) => {
2536
+ }, Ta = ({ r: e, g: t, b: n, alpha: r }) => {
2536
2537
  const o = (s) => {
2537
- const i = s.toString(j);
2538
+ const i = s.toString(Y);
2538
2539
  return i.length === 1 ? "0" + i : i;
2539
2540
  };
2540
- return `#${o(e)}${o(t)}${o(n)}${r < 1 ? o(Math.round(r * I)) : ""}`;
2541
- }, Tn = 1e3, vn = 4e4, Mn = 100, Bn = ({ kelvin: e, alpha: t }) => {
2542
- e = X(e, Tn, vn) / Mn;
2541
+ return `#${o(e)}${o(t)}${o(n)}${r < 1 ? o(Math.round(r * _)) : ""}`;
2542
+ }, gr = 1e3, wr = 4e4, kr = 100, Sr = ({ kelvin: e, alpha: t }) => {
2543
+ e = v(e, gr, wr) / kr;
2543
2544
  let n, r, o;
2544
- return e <= 66 ? n = I : (n = e - 60, n = 329.698727446 * n ** -0.1332047592), n = X(n, 0, I) / I, e <= 66 ? (r = e, r = 99.4708025861 * Math.log(r) - 161.1195681661) : (r = e - 60, r = 288.1221695283 * r ** -0.0755148492), r = X(r, 0, I) / I, e >= 66 ? o = I : e <= 19 ? o = 0 : (o = e - 10, o = 138.5177312231 * Math.log(o) - 305.0447927307), o = X(o, 0, I) / I, new $(n, r, o, t);
2545
- }, $r = ({ r: e, g: t, b: n, alpha: r }) => {
2546
- e = X(e * I, 0, I), t = X(t * I, 0, I), n = X(n * I, 0, I);
2545
+ return e <= 66 ? n = _ : (n = e - 60, n = 329.698727446 * n ** -0.1332047592), n = v(n, 0, _) / _, e <= 66 ? (r = e, r = 99.4708025861 * Math.log(r) - 161.1195681661) : (r = e - 60, r = 288.1221695283 * r ** -0.0755148492), r = v(r, 0, _) / _, e >= 66 ? o = _ : e <= 19 ? o = 0 : (o = e - 10, o = 138.5177312231 * Math.log(o) - 305.0447927307), o = v(o, 0, _) / _, new O(n, r, o, t);
2546
+ }, Lo = ({ r: e, g: t, b: n, alpha: r }) => {
2547
+ e = v(e * _, 0, _), t = v(t * _, 0, _), n = v(n * _, 0, _);
2547
2548
  let o;
2548
- if (n === I ? o = 6600 : n === 0 ? o = 1900 : o = Math.exp((n + 305.0447927307) / 138.5177312231) + 10, e < I) {
2549
+ if (n === _ ? o = 6600 : n === 0 ? o = 1900 : o = Math.exp((n + 305.0447927307) / 138.5177312231) + 10, e < _) {
2549
2550
  const i = (329.698727446 / e) ** -7.507239275877164 + 60;
2550
2551
  o = Math.max(o, i);
2551
2552
  }
2552
2553
  const s = o <= 6600 ? Math.exp((t + 161.1195681661) / 99.4708025861) : (288.1221695283 / t) ** (1 / -0.0755148492) + 60;
2553
- return o = (o + s) / 2, o = X(Math.round(o * Mn), Tn, vn), new un(o, r);
2554
- }, En = ({ h: e, s: t, v: n, alpha: r }) => {
2554
+ return o = (o + s) / 2, o = v(Math.round(o * kr), gr, wr), new nr(o, r);
2555
+ }, yr = ({ h: e, s: t, v: n, alpha: r }) => {
2555
2556
  const o = n - n * t / 2;
2556
2557
  let s;
2557
- return o === 0 || o === 1 ? s = 0 : s = (n - o) / Math.min(o, 1 - o), new St(e, s, o, r);
2558
- }, An = ({ h: e, s: t, l: n, alpha: r }) => {
2558
+ return o === 0 || o === 1 ? s = 0 : s = (n - o) / Math.min(o, 1 - o), new yt(e, s, o, r);
2559
+ }, Cr = ({ h: e, s: t, l: n, alpha: r }) => {
2559
2560
  const o = n + t * Math.min(n, 1 - n);
2560
2561
  let s;
2561
- return o === 0 ? s = 0 : s = 2 * (1 - n / o), new pe(e, s, o, r);
2562
- }, Fr = ({ h: e, w: t, b: n, alpha: r }) => {
2562
+ return o === 0 ? s = 0 : s = 2 * (1 - n / o), new Ee(e, s, o, r);
2563
+ }, zo = ({ h: e, w: t, b: n, alpha: r }) => {
2563
2564
  let o, s;
2564
2565
  const i = t + n;
2565
- return i >= 1 ? (s = t / i, o = 0) : (s = 1 - n, o = s === 0 ? 0 : 1 - t / s), En(new pe(e, o, s, r));
2566
- }, Dr = ({ h: e, s: t, l: n, alpha: r }) => {
2567
- const { h: o, s, v: i } = An(new St(e, t, n, r));
2568
- return new he(o, i * (1 - s), 1 - i, r);
2569
- }, Gr = ({ r: e, g: t, b: n, alpha: r }) => {
2566
+ return i >= 1 ? (s = t / i, o = 0) : (s = 1 - n, o = s === 0 ? 0 : 1 - t / s), yr(new Ee(e, o, s, r));
2567
+ }, $o = ({ h: e, s: t, l: n, alpha: r }) => {
2568
+ const { h: o, s, v: i } = Cr(new yt(e, t, n, r));
2569
+ return new Te(o, i * (1 - s), 1 - i, r);
2570
+ }, xr = ({ r: e, g: t, b: n, alpha: r }) => {
2570
2571
  const o = Math.max(e, t, n), s = Math.min(e, t, n);
2571
2572
  let [i, a, c] = [0, 0, (o + s) / 2];
2572
2573
  const l = o - s;
@@ -2581,73 +2582,73 @@ const Js = (e) => {
2581
2582
  i = (e - t) / l + 4;
2582
2583
  break;
2583
2584
  }
2584
- return i /= 6, a < 0 && (i = (i + 0.5) % 1, a = Math.abs(a) % 1), i >= 1 && (i -= 1), new St(i, a, c, r);
2585
+ return i /= 6, a < 0 && (i = (i + 0.5) % 1, a = Math.abs(a) % 1), i >= 1 && (i -= 1), new yt(i, a, c, r);
2585
2586
  };
2586
- function Ur({ h: e, s: t, l: n, alpha: r }) {
2587
+ function Fo({ h: e, s: t, l: n, alpha: r }) {
2587
2588
  const o = (1 - Math.abs(2 * n - 1)) * t, s = o * (1 - Math.abs(e * 6 % 2 - 1)), i = n - o / 2;
2588
2589
  let a, c, l;
2589
- return e < 1 / 6 ? [a, c, l] = [o, s, 0] : e < 2 / 6 ? [a, c, l] = [s, o, 0] : e < 3 / 6 ? [a, c, l] = [0, o, s] : e < 4 / 6 ? [a, c, l] = [0, s, o] : e < 5 / 6 ? [a, c, l] = [s, 0, o] : [a, c, l] = [o, 0, s], new $(a + i, c + i, l + i, r);
2590
+ return e < 1 / 6 ? [a, c, l] = [o, s, 0] : e < 2 / 6 ? [a, c, l] = [s, o, 0] : e < 3 / 6 ? [a, c, l] = [0, o, s] : e < 4 / 6 ? [a, c, l] = [0, s, o] : e < 5 / 6 ? [a, c, l] = [s, 0, o] : [a, c, l] = [o, 0, s], new O(a + i, c + i, l + i, r);
2590
2591
  }
2591
- const Vr = 216 / 24389, Wr = 24 / 116, se = 24389 / 27, Xr = 8, kt = 16, yt = 116, In = 500, Rn = 200;
2592
- function Hr(e) {
2592
+ const Go = 216 / 24389, Uo = 24 / 116, ge = 24389 / 27, Do = 8, It = 16, Rt = 116, Er = 500, Tr = 200;
2593
+ function Vo(e) {
2593
2594
  if (e.whitePoint === "D50") return [e.x, e.y, e.z];
2594
- if (e.whitePoint === "D65") return R([e.x, e.y, e.z], Ce);
2595
+ if (e.whitePoint === "D65") return N([e.x, e.y, e.z], Oe);
2595
2596
  throw new Error(`Unsupported white point: ${e.whitePoint}`);
2596
2597
  }
2597
- function Yr(e) {
2598
+ function Wo(e) {
2598
2599
  if (e.whitePoint === "D65") return [e.x, e.y, e.z];
2599
- if (e.whitePoint === "D50") return R([e.x, e.y, e.z], wn);
2600
+ if (e.whitePoint === "D50") return N([e.x, e.y, e.z], ur);
2600
2601
  throw new Error(`Unsupported white point: ${e.whitePoint}`);
2601
2602
  }
2602
- function Me(e, t = "D50") {
2603
- const n = (T) => T > Vr ? Math.cbrt(T) : (se * T + kt) / yt, r = kn[t], [o, s, i] = Hr(e), a = o / r[0], c = s / r[1], l = i / r[2], m = n(a), u = n(c), d = n(l), x = yt * u - kt, S = In * (m - u), C = Rn * (u - d), P = new Lt(
2604
- B(
2605
- x,
2606
- f.lab.l.number.min,
2607
- f.lab.l.number.max
2603
+ function $e(e, t = "D50") {
2604
+ const n = (T) => T > Go ? Math.cbrt(T) : (ge * T + It) / Rt, r = pr[t], [o, s, i] = Vo(e), a = o / r[0], c = s / r[1], l = i / r[2], p = n(a), u = n(c), f = n(l), C = Rt * u - It, y = Er * (p - u), E = Tr * (u - f), w = new Xt(
2605
+ R(
2606
+ C,
2607
+ b.lab.l.number.min,
2608
+ b.lab.l.number.max
2608
2609
  ),
2609
- B(
2610
- S,
2611
- f.lab.a.number.min,
2612
- f.lab.a.number.max
2610
+ R(
2611
+ y,
2612
+ b.lab.a.number.min,
2613
+ b.lab.a.number.max
2613
2614
  ),
2614
- B(
2615
- C,
2616
- f.lab.b.number.min,
2617
- f.lab.b.number.max
2615
+ R(
2616
+ E,
2617
+ b.lab.b.number.min,
2618
+ b.lab.b.number.max
2618
2619
  ),
2619
2620
  e.alpha
2620
2621
  );
2621
- return P.whitePoint = t, P;
2622
+ return w.whitePoint = t, w;
2622
2623
  }
2623
- function Be(e) {
2624
- const t = (E) => E > Wr ? E ** 3 : (yt * E - kt) / se, n = (E) => E > Xr ? ((E + kt) / yt) ** 3 : E / se, r = kn[e.whitePoint];
2624
+ function Fe(e) {
2625
+ const t = (A) => A > Uo ? A ** 3 : (Rt * A - It) / ge, n = (A) => A > Do ? ((A + It) / Rt) ** 3 : A / ge, r = pr[e.whitePoint];
2625
2626
  let { l: o, a: s, b: i, alpha: a } = e;
2626
- o = B(
2627
+ o = R(
2627
2628
  o,
2628
2629
  0,
2629
2630
  1,
2630
- f.lab.l.number.min,
2631
- f.lab.l.number.max
2632
- ), s = B(
2631
+ b.lab.l.number.min,
2632
+ b.lab.l.number.max
2633
+ ), s = R(
2633
2634
  s,
2634
2635
  0,
2635
2636
  1,
2636
- f.lab.a.number.min,
2637
- f.lab.a.number.max
2638
- ), i = B(
2637
+ b.lab.a.number.min,
2638
+ b.lab.a.number.max
2639
+ ), i = R(
2639
2640
  i,
2640
2641
  0,
2641
2642
  1,
2642
- f.lab.b.number.min,
2643
- f.lab.b.number.max
2643
+ b.lab.b.number.min,
2644
+ b.lab.b.number.max
2644
2645
  );
2645
- const c = (o + kt) / yt, l = s / In + c, m = c - i / Rn, [u, d, x] = [t(l), n(o), t(m)];
2646
- let S = u * r[0], C = d * r[1], P = x * r[2];
2647
- const T = new D(S, C, P, a);
2648
- return T.whitePoint = e.whitePoint, [S, C, P] = Yr(T), T.whitePoint = "D65", T.x = S, T.y = C, T.z = P, T;
2646
+ const c = (o + It) / Rt, l = s / Er + c, p = c - i / Tr, [u, f, C] = [t(l), n(o), t(p)];
2647
+ let y = u * r[0], E = f * r[1], w = C * r[2];
2648
+ const T = new U(y, E, w, a);
2649
+ return T.whitePoint = e.whitePoint, [y, E, w] = Wo(T), T.whitePoint = "D65", T.x = y, T.y = E, T.z = w, T;
2649
2650
  }
2650
- const Ee = [
2651
+ const Ge = [
2651
2652
  0.41239079926595934,
2652
2653
  0.357584339383878,
2653
2654
  0.1804807884018343,
@@ -2657,221 +2658,221 @@ const Ee = [
2657
2658
  0.01933081871559182,
2658
2659
  0.11919477979462598,
2659
2660
  0.9505321522496607
2660
- ], Pn = J(Ee), On = 2.4, Ot = 0.055, Ae = 12.92, jr = 0.04045, Nn = jr / Ae;
2661
- function ut(e) {
2661
+ ], Ar = nt(Ge), Mr = 2.4, Ut = 0.055, Ue = 12.92, Xo = 0.04045, Ir = Xo / Ue;
2662
+ function wt(e) {
2662
2663
  const t = e < 0 ? -1 : 1, n = e * t;
2663
- return n <= Nn ? e / Ae : t * ((n + Ot) / (1 + Ot)) ** On;
2664
+ return n <= Ir ? e / Ue : t * ((n + Ut) / (1 + Ut)) ** Mr;
2664
2665
  }
2665
- function zn(e) {
2666
+ function Rr(e) {
2666
2667
  const t = e < 0 ? -1 : 1, n = e * t;
2667
- return n <= Nn ? e * Ae : t * ((1 + Ot) * n ** (1 / On) - Ot);
2668
+ return n <= Ir ? e * Ue : t * ((1 + Ut) * n ** (1 / Mr) - Ut);
2668
2669
  }
2669
- function Ie({ r: e, g: t, b: n, alpha: r }) {
2670
- const o = [ut(e), ut(t), ut(n)], [s, i, a] = R(o, Ee);
2671
- return new D(s, i, a, r);
2670
+ function De({ r: e, g: t, b: n, alpha: r }) {
2671
+ const o = [wt(e), wt(t), wt(n)], [s, i, a] = N(o, Ge);
2672
+ return new U(s, i, a, r);
2672
2673
  }
2673
- const Re = ({ x: e, y: t, z: n, alpha: r }, o = !0) => {
2674
- const s = R([e, t, n], Pn), [i, a, c] = s.map(zn);
2674
+ const Ve = ({ x: e, y: t, z: n, alpha: r }, o = !0) => {
2675
+ const s = N([e, t, n], Ar), [i, a, c] = s.map(Rr);
2675
2676
  if (o) {
2676
- const l = Bo(new $(i, a, c, r));
2677
- return new $(l.r, l.g, l.b, r);
2677
+ const l = xs(new O(i, a, c, r));
2678
+ return new O(l.r, l.g, l.b, r);
2678
2679
  } else
2679
- return new $(i, a, c, r);
2680
+ return new O(i, a, c, r);
2680
2681
  };
2681
- function Zr({ l: e, c: t, h: n, alpha: r }) {
2682
- t = B(
2682
+ function Ho({ l: e, c: t, h: n, alpha: r }) {
2683
+ t = R(
2683
2684
  t,
2684
2685
  0,
2685
2686
  1,
2686
- f.lch.c.number.min,
2687
- f.lch.c.number.max
2687
+ b.lch.c.number.min,
2688
+ b.lch.c.number.max
2688
2689
  );
2689
2690
  const o = n * 2 * Math.PI, s = Math.cos(o) * t, i = Math.sin(o) * t;
2690
- return new Lt(
2691
+ return new Xt(
2691
2692
  e,
2692
- B(
2693
+ R(
2693
2694
  s,
2694
- f.lab.a.number.min,
2695
- f.lab.a.number.max
2695
+ b.lab.a.number.min,
2696
+ b.lab.a.number.max
2696
2697
  ),
2697
- B(
2698
+ R(
2698
2699
  i,
2699
- f.lab.b.number.min,
2700
- f.lab.b.number.max
2700
+ b.lab.b.number.min,
2701
+ b.lab.b.number.max
2701
2702
  ),
2702
2703
  r
2703
2704
  );
2704
2705
  }
2705
- function Kr({ l: e, a: t, b: n, alpha: r }) {
2706
- t = B(
2706
+ function jo({ l: e, a: t, b: n, alpha: r }) {
2707
+ t = R(
2707
2708
  t,
2708
2709
  0,
2709
2710
  1,
2710
- f.lab.a.number.min,
2711
- f.lab.a.number.max
2712
- ), n = B(
2711
+ b.lab.a.number.min,
2712
+ b.lab.a.number.max
2713
+ ), n = R(
2713
2714
  n,
2714
2715
  0,
2715
2716
  1,
2716
- f.lab.b.number.min,
2717
- f.lab.b.number.max
2717
+ b.lab.b.number.min,
2718
+ b.lab.b.number.max
2718
2719
  );
2719
2720
  const o = Math.hypot(t, n);
2720
2721
  let s = Math.atan2(n, t) / (2 * Math.PI);
2721
- return s < 0 && (s += 1), new fe(
2722
+ return s < 0 && (s += 1), new Ae(
2722
2723
  e,
2723
- B(
2724
+ R(
2724
2725
  o,
2725
- f.lch.c.number.min,
2726
- f.lch.c.number.max
2726
+ b.lch.c.number.min,
2727
+ b.lch.c.number.max
2727
2728
  ),
2728
2729
  s,
2729
2730
  r
2730
2731
  );
2731
2732
  }
2732
- function Pe({ l: e, a: t, b: n, alpha: r }) {
2733
- t = B(
2733
+ function We({ l: e, a: t, b: n, alpha: r }) {
2734
+ t = R(
2734
2735
  t,
2735
2736
  0,
2736
2737
  1,
2737
- f.oklab.a.number.min,
2738
- f.oklab.a.number.max
2739
- ), n = B(
2738
+ b.oklab.a.number.min,
2739
+ b.oklab.a.number.max
2740
+ ), n = R(
2740
2741
  n,
2741
2742
  0,
2742
2743
  1,
2743
- f.oklab.b.number.min,
2744
- f.oklab.b.number.max
2744
+ b.oklab.b.number.min,
2745
+ b.oklab.b.number.max
2745
2746
  );
2746
- const o = R([e, t, n], Tr), s = [o[0] * o[0] * o[0], o[1] * o[1] * o[1], o[2] * o[2] * o[2]], [i, a, c] = R(s, Cr);
2747
- return new D(i, a, c, r);
2747
+ const o = N([e, t, n], xo), s = [o[0] * o[0] * o[0], o[1] * o[1] * o[1], o[2] * o[2] * o[2]], [i, a, c] = N(s, Co);
2748
+ return new U(i, a, c, r);
2748
2749
  }
2749
- function Oe(e) {
2750
- const { x: t, y: n, z: r } = e, o = R([t, n, r], yn), s = [Math.cbrt(o[0]), Math.cbrt(o[1]), Math.cbrt(o[2])], [i, a, c] = R(s, Sn);
2751
- return new $t(
2750
+ function Xe(e) {
2751
+ const { x: t, y: n, z: r } = e, o = N([t, n, r], mr), s = [Math.cbrt(o[0]), Math.cbrt(o[1]), Math.cbrt(o[2])], [i, a, c] = N(s, hr);
2752
+ return new Ht(
2752
2753
  i,
2753
- B(
2754
+ R(
2754
2755
  a,
2755
- f.oklab.a.number.min,
2756
- f.oklab.a.number.max
2756
+ b.oklab.a.number.min,
2757
+ b.oklab.a.number.max
2757
2758
  ),
2758
- B(
2759
+ R(
2759
2760
  c,
2760
- f.oklab.b.number.min,
2761
- f.oklab.b.number.max
2761
+ b.oklab.b.number.min,
2762
+ b.oklab.b.number.max
2762
2763
  ),
2763
2764
  e.alpha
2764
2765
  );
2765
2766
  }
2766
- function qr(e) {
2767
- const t = Pe(e);
2768
- return Me(t);
2767
+ function Yo(e) {
2768
+ const t = We(e);
2769
+ return $e(t);
2769
2770
  }
2770
- function Jr(e) {
2771
- const t = Be(e);
2772
- return Oe(t);
2771
+ function Zo(e) {
2772
+ const t = Fe(e);
2773
+ return Xe(t);
2773
2774
  }
2774
- function _n({ l: e, a: t, b: n, alpha: r }) {
2775
- t = B(t, 0, 1, f.oklab.a.number.min, f.oklab.a.number.max), n = B(n, 0, 1, f.oklab.b.number.min, f.oklab.b.number.max);
2775
+ function vr({ l: e, a: t, b: n, alpha: r }) {
2776
+ t = R(t, 0, 1, b.oklab.a.number.min, b.oklab.a.number.max), n = R(n, 0, 1, b.oklab.b.number.min, b.oklab.b.number.max);
2776
2777
  const o = Math.hypot(t, n);
2777
2778
  let s = Math.atan2(n, t) / (2 * Math.PI);
2778
- return s < 0 && (s += 1), new be(
2779
+ return s < 0 && (s += 1), new Me(
2779
2780
  e,
2780
- B(o, f.oklch.c.number.min, f.oklch.c.number.max),
2781
+ R(o, b.oklch.c.number.min, b.oklch.c.number.max),
2781
2782
  s,
2782
2783
  r
2783
2784
  );
2784
2785
  }
2785
- function Ln({ l: e, c: t, h: n, alpha: r }) {
2786
- t = B(t, 0, 1, f.oklch.c.number.min, f.oklch.c.number.max);
2786
+ function Br({ l: e, c: t, h: n, alpha: r }) {
2787
+ t = R(t, 0, 1, b.oklch.c.number.min, b.oklch.c.number.max);
2787
2788
  const o = n * 2 * Math.PI, s = Math.cos(o) * t, i = Math.sin(o) * t;
2788
- return new $t(
2789
+ return new Ht(
2789
2790
  e,
2790
- B(s, f.oklab.a.number.min, f.oklab.a.number.max),
2791
- B(i, f.oklab.b.number.min, f.oklab.b.number.max),
2791
+ R(s, b.oklab.a.number.min, b.oklab.a.number.max),
2792
+ R(i, b.oklab.b.number.min, b.oklab.b.number.max),
2792
2793
  r
2793
2794
  );
2794
2795
  }
2795
- function ti(e) {
2796
- return qr(Ln(e));
2796
+ function Aa(e) {
2797
+ return Yo(Br(e));
2797
2798
  }
2798
- function ei(e) {
2799
- return _n(Jr(e));
2799
+ function Ma(e) {
2800
+ return vr(Zo(e));
2800
2801
  }
2801
- function Ne(e) {
2802
- const t = Ur(e);
2803
- return Ie(t);
2802
+ function He(e) {
2803
+ const t = Fo(e);
2804
+ return De(t);
2804
2805
  }
2805
- function ze(e) {
2806
- const t = Re(e);
2807
- return Gr(t);
2806
+ function je(e) {
2807
+ const t = Ve(e);
2808
+ return xr(t);
2808
2809
  }
2809
- function Qr(e) {
2810
- const t = En(e);
2811
- return Ne(t);
2810
+ function qo(e) {
2811
+ const t = yr(e);
2812
+ return He(t);
2812
2813
  }
2813
- function to(e) {
2814
- const t = ze(e);
2815
- return An(t);
2814
+ function Ko(e) {
2815
+ const t = je(e);
2816
+ return Cr(t);
2816
2817
  }
2817
- function eo(e) {
2818
- const t = Fr(e);
2819
- return Ne(t);
2818
+ function Jo(e) {
2819
+ const t = zo(e);
2820
+ return He(t);
2820
2821
  }
2821
- function no(e) {
2822
- const t = ze(e);
2823
- return Dr(t);
2822
+ function Qo(e) {
2823
+ const t = je(e);
2824
+ return $o(t);
2824
2825
  }
2825
- function ro(e) {
2826
- const t = Zr(e);
2827
- return Be(t);
2826
+ function ts(e) {
2827
+ const t = Ho(e);
2828
+ return Fe(t);
2828
2829
  }
2829
- function oo(e) {
2830
- const t = Me(e);
2831
- return Kr(t);
2830
+ function es(e) {
2831
+ const t = $e(e);
2832
+ return jo(t);
2832
2833
  }
2833
- function so(e) {
2834
- const t = Ln(e);
2835
- return Pe(t);
2834
+ function ns(e) {
2835
+ const t = Br(e);
2836
+ return We(t);
2836
2837
  }
2837
- function io(e) {
2838
- const t = Oe(e);
2839
- return _n(t);
2838
+ function rs(e) {
2839
+ const t = Xe(e);
2840
+ return vr(t);
2840
2841
  }
2841
- function ao(e) {
2842
- const t = Bn(e);
2843
- return Ie(t);
2842
+ function os(e) {
2843
+ const t = Sr(e);
2844
+ return De(t);
2844
2845
  }
2845
- function co(e) {
2846
- const t = Re(e);
2847
- return $r(t);
2846
+ function ss(e) {
2847
+ const t = Ve(e);
2848
+ return Lo(t);
2848
2849
  }
2849
- const $n = 563 / 256;
2850
- function Jt(e) {
2851
- return (e < 0 ? -1 : 1) * Math.abs(e) ** $n;
2850
+ const Nr = 563 / 256;
2851
+ function ce(e) {
2852
+ return (e < 0 ? -1 : 1) * Math.abs(e) ** Nr;
2852
2853
  }
2853
- function lo(e) {
2854
- return (e < 0 ? -1 : 1) * Math.abs(e) ** (1 / $n);
2854
+ function is(e) {
2855
+ return (e < 0 ? -1 : 1) * Math.abs(e) ** (1 / Nr);
2855
2856
  }
2856
- const Fn = 1 / 512, Dn = 1.8;
2857
- function Qt(e) {
2857
+ const _r = 1 / 512, Pr = 1.8;
2858
+ function le(e) {
2858
2859
  const t = e < 0 ? -1 : 1, n = Math.abs(e);
2859
- return t * (n <= Fn * 16 ? n / 16 : n ** Dn);
2860
+ return t * (n <= _r * 16 ? n / 16 : n ** Pr);
2860
2861
  }
2861
- function uo(e) {
2862
+ function as(e) {
2862
2863
  const t = e < 0 ? -1 : 1, n = Math.abs(e);
2863
- return t * (n >= Fn ? n ** (1 / Dn) : n * 16);
2864
+ return t * (n >= _r ? n ** (1 / Pr) : n * 16);
2864
2865
  }
2865
- const Nt = 1.09929682680944, Gn = 0.018053968510807;
2866
- function te(e) {
2866
+ const Dt = 1.09929682680944, Or = 0.018053968510807;
2867
+ function ue(e) {
2867
2868
  const t = e < 0 ? -1 : 1, n = Math.abs(e);
2868
- return n < Gn * 4.5 ? t * n / 4.5 : t * ((n + Nt - 1) / Nt) ** (1 / 0.45);
2869
+ return n < Or * 4.5 ? t * n / 4.5 : t * ((n + Dt - 1) / Dt) ** (1 / 0.45);
2869
2870
  }
2870
- function mo(e) {
2871
+ function cs(e) {
2871
2872
  const t = e < 0 ? -1 : 1, n = Math.abs(e);
2872
- return n >= Gn ? t * (Nt * n ** 0.45 - (Nt - 1)) : t * 4.5 * n;
2873
+ return n >= Or ? t * (Dt * n ** 0.45 - (Dt - 1)) : t * 4.5 * n;
2873
2874
  }
2874
- const Un = [
2875
+ const Lr = [
2875
2876
  0.4865709486482162,
2876
2877
  0.26566769316909306,
2877
2878
  0.1982172852343625,
@@ -2881,7 +2882,7 @@ const Un = [
2881
2882
  0,
2882
2883
  0.04511338185890264,
2883
2884
  1.043944368900976
2884
- ], po = J(Un), Vn = [
2885
+ ], ls = nt(Lr), zr = [
2885
2886
  0.5766690429101305,
2886
2887
  0.1855582379065463,
2887
2888
  0.1882286462349947,
@@ -2891,7 +2892,7 @@ const Un = [
2891
2892
  0.02703136138641234,
2892
2893
  0.07068885253582723,
2893
2894
  0.9913375368376388
2894
- ], ho = J(Vn), Wn = [
2895
+ ], us = nt(zr), $r = [
2895
2896
  0.7977604896723027,
2896
2897
  0.13518583717574031,
2897
2898
  0.0313493495815248,
@@ -2901,7 +2902,7 @@ const Un = [
2901
2902
  0,
2902
2903
  0,
2903
2904
  0.8251046025104602
2904
- ], fo = J(Wn), Xn = [
2905
+ ], ps = nt($r), Fr = [
2905
2906
  0.6369580483012914,
2906
2907
  0.14461690358620832,
2907
2908
  0.1688809751641721,
@@ -2911,90 +2912,96 @@ const Un = [
2911
2912
  0,
2912
2913
  0.028072693049087428,
2913
2914
  1.0609850577107909
2914
- ], bo = J(Xn);
2915
- function go({ r: e, g: t, b: n, alpha: r }) {
2916
- const [o, s, i] = R([e, t, n], Ee);
2917
- return new D(o, s, i, r);
2918
- }
2919
- function wo({ x: e, y: t, z: n, alpha: r }) {
2920
- const [o, s, i] = R([e, t, n], Pn);
2921
- return new de(o, s, i, r);
2922
- }
2923
- function ko({ r: e, g: t, b: n, alpha: r }) {
2924
- const o = [ut(e), ut(t), ut(n)], [s, i, a] = R(o, Un);
2925
- return new D(s, i, a, r);
2926
- }
2927
- function yo({ x: e, y: t, z: n, alpha: r }) {
2928
- const o = R([e, t, n], po), [s, i, a] = o.map(zn);
2929
- return new ge(s, i, a, r);
2930
- }
2931
- function So({ r: e, g: t, b: n, alpha: r }) {
2932
- const o = [Jt(e), Jt(t), Jt(n)], [s, i, a] = R(o, Vn);
2933
- return new D(s, i, a, r);
2934
- }
2935
- function xo({ x: e, y: t, z: n, alpha: r }) {
2936
- const o = R([e, t, n], ho), [s, i, a] = o.map(lo);
2937
- return new we(s, i, a, r);
2938
- }
2939
- function Co({ r: e, g: t, b: n, alpha: r }) {
2940
- const o = [Qt(e), Qt(t), Qt(n)], s = R(o, Wn), [i, a, c] = R(s, wn);
2941
- return new D(i, a, c, r);
2942
- }
2943
- function To({ x: e, y: t, z: n, alpha: r }) {
2944
- const o = R([e, t, n], Ce), s = R(o, fo), [i, a, c] = s.map(uo);
2945
- return new ke(i, a, c, r);
2946
- }
2947
- function vo({ r: e, g: t, b: n, alpha: r }) {
2948
- const o = [te(e), te(t), te(n)], [s, i, a] = R(o, Xn);
2949
- return new D(s, i, a, r);
2950
- }
2951
- function Mo({ x: e, y: t, z: n, alpha: r }) {
2952
- const o = R([e, t, n], bo), [s, i, a] = o.map(mo);
2953
- return new ye(s, i, a, r);
2954
- }
2955
- const en = {
2956
- rgb: { to: Ie, from: Re },
2957
- hsl: { to: Ne, from: ze },
2958
- hsv: { to: Qr, from: to },
2959
- hwb: { to: eo, from: no },
2960
- lab: { to: Be, from: Me },
2961
- lch: { to: ro, from: oo },
2962
- oklab: { to: Pe, from: Oe },
2963
- oklch: { to: so, from: io },
2964
- kelvin: { to: ao, from: co },
2915
+ ], ms = nt(Fr);
2916
+ function hs({ r: e, g: t, b: n, alpha: r }) {
2917
+ const [o, s, i] = N([e, t, n], Ge);
2918
+ return new U(o, s, i, r);
2919
+ }
2920
+ function fs({ x: e, y: t, z: n, alpha: r }) {
2921
+ const [o, s, i] = N([e, t, n], Ar);
2922
+ return new Ie(o, s, i, r);
2923
+ }
2924
+ function bs({ r: e, g: t, b: n, alpha: r }) {
2925
+ const o = [wt(e), wt(t), wt(n)], [s, i, a] = N(o, Lr);
2926
+ return new U(s, i, a, r);
2927
+ }
2928
+ function ds({ x: e, y: t, z: n, alpha: r }) {
2929
+ const o = N([e, t, n], ls), [s, i, a] = o.map(Rr);
2930
+ return new Re(s, i, a, r);
2931
+ }
2932
+ function gs({ r: e, g: t, b: n, alpha: r }) {
2933
+ const o = [ce(e), ce(t), ce(n)], [s, i, a] = N(o, zr);
2934
+ return new U(s, i, a, r);
2935
+ }
2936
+ function ws({ x: e, y: t, z: n, alpha: r }) {
2937
+ const o = N([e, t, n], us), [s, i, a] = o.map(is);
2938
+ return new ve(s, i, a, r);
2939
+ }
2940
+ function ks({ r: e, g: t, b: n, alpha: r }) {
2941
+ const o = [le(e), le(t), le(n)], s = N(o, $r), [i, a, c] = N(s, ur);
2942
+ return new U(i, a, c, r);
2943
+ }
2944
+ function Ss({ x: e, y: t, z: n, alpha: r }) {
2945
+ const o = N([e, t, n], Oe), s = N(o, ps), [i, a, c] = s.map(as);
2946
+ return new Be(i, a, c, r);
2947
+ }
2948
+ function ys({ r: e, g: t, b: n, alpha: r }) {
2949
+ const o = [ue(e), ue(t), ue(n)], [s, i, a] = N(o, Fr);
2950
+ return new U(s, i, a, r);
2951
+ }
2952
+ function Cs({ x: e, y: t, z: n, alpha: r }) {
2953
+ const o = N([e, t, n], ms), [s, i, a] = o.map(cs);
2954
+ return new Ne(s, i, a, r);
2955
+ }
2956
+ const gn = {
2957
+ rgb: { to: De, from: Ve },
2958
+ hsl: { to: He, from: je },
2959
+ hsv: { to: qo, from: Ko },
2960
+ hwb: { to: Jo, from: Qo },
2961
+ lab: { to: Fe, from: $e },
2962
+ lch: { to: ts, from: es },
2963
+ oklab: { to: We, from: Xe },
2964
+ oklch: { to: ns, from: rs },
2965
+ kelvin: { to: os, from: ss },
2965
2966
  xyz: { to: (e) => e, from: (e) => e },
2966
- "srgb-linear": { to: go, from: wo },
2967
- "display-p3": { to: ko, from: yo },
2968
- "a98-rgb": { to: So, from: xo },
2969
- "prophoto-rgb": { to: Co, from: To },
2970
- rec2020: { to: vo, from: Mo }
2967
+ "srgb-linear": { to: hs, from: fs },
2968
+ "display-p3": { to: bs, from: ds },
2969
+ "a98-rgb": { to: gs, from: ws },
2970
+ "prophoto-rgb": { to: ks, from: Ss },
2971
+ rec2020: { to: ys, from: Cs }
2971
2972
  };
2972
- function it(e, t) {
2973
+ function pt(e, t) {
2973
2974
  if (e.colorSpace === t)
2974
2975
  return e;
2975
- const n = en[e.colorSpace].to, r = n(e), o = en[t].from;
2976
- return o(r);
2977
- }
2978
- const lt = 1e-6;
2979
- function Bo(e) {
2980
- const t = it(e, "rgb"), n = Number.isNaN(t.r) ? 0 : t.r, r = Number.isNaN(t.g) ? 0 : t.g, o = Number.isNaN(t.b) ? 0 : t.b;
2976
+ const n = gn[e.colorSpace];
2977
+ if (!n)
2978
+ throw new Error(`Unknown source color space: "${e.colorSpace}"`);
2979
+ const r = gn[t];
2980
+ if (!r)
2981
+ throw new Error(`Unknown target color space: "${t}"`);
2982
+ const o = n.to(e), s = r.from;
2983
+ return s(o);
2984
+ }
2985
+ const ft = 1e-6;
2986
+ function xs(e) {
2987
+ const t = pt(e, "rgb"), n = Number.isNaN(t.r) ? 0 : t.r, r = Number.isNaN(t.g) ? 0 : t.g, o = Number.isNaN(t.b) ? 0 : t.b;
2981
2988
  if (n >= 0 && n <= 1 && r >= 0 && r <= 1 && o >= 0 && o <= 1)
2982
2989
  return e;
2983
- if (n >= -lt && n <= 1 + lt && r >= -lt && r <= 1 + lt && o >= -lt && o <= 1 + lt) {
2984
- const l = new $(X(n, 0, 1), X(r, 0, 1), X(o, 0, 1), e.alpha);
2985
- return it(l, e.colorSpace);
2990
+ if (n >= -ft && n <= 1 + ft && r >= -ft && r <= 1 + ft && o >= -ft && o <= 1 + ft) {
2991
+ const l = new O(v(n, 0, 1), v(r, 0, 1), v(o, 0, 1), e.alpha);
2992
+ return pt(l, e.colorSpace);
2986
2993
  }
2987
- const [s, i, a] = _r(n, r, o), c = new $(s, i, a, e.alpha);
2988
- return it(c, e.colorSpace);
2994
+ const [s, i, a] = Po(n, r, o), c = new O(s, i, a, e.alpha);
2995
+ return pt(c, e.colorSpace);
2989
2996
  }
2990
- const Eo = {
2997
+ const Es = {
2991
2998
  hsl: "h",
2992
2999
  hsv: "h",
2993
3000
  hwb: "h",
2994
3001
  lch: "h",
2995
3002
  oklch: "h"
2996
3003
  };
2997
- function Ao(e, t, n, r = "shorter") {
3004
+ function Ts(e, t, n, r = "shorter") {
2998
3005
  if (Number.isNaN(e) && Number.isNaN(t)) return 0;
2999
3006
  if (Number.isNaN(e)) return t;
3000
3007
  if (Number.isNaN(t)) return e;
@@ -3016,40 +3023,40 @@ function Ao(e, t, n, r = "shorter") {
3016
3023
  let s = e + n * (t - e);
3017
3024
  return s = (s % 1 + 1) % 1, s;
3018
3025
  }
3019
- function Io(e, t, n, r, o = "oklab", s = "shorter") {
3020
- const i = it(e, o), a = it(t, o);
3026
+ function As(e, t, n, r, o = "oklab", s = "shorter") {
3027
+ const i = pt(e, o), a = pt(t, o);
3021
3028
  n < 0 && (n = 0), r < 0 && (r = 0);
3022
3029
  const c = n + r;
3023
3030
  c === 0 ? (n = 0.5, r = 0.5) : c !== 1 && (n = n / c, r = r / c);
3024
- const l = Math.min(c, 1), m = Eo[o], u = i.keys().filter((E) => E !== "alpha"), d = Number.isNaN(i.alpha) ? a.alpha : i.alpha, x = Number.isNaN(a.alpha) ? i.alpha : a.alpha, S = oe(r, d, x) * l, C = [];
3025
- for (const E of u) {
3026
- let N = i[E], V = a[E];
3027
- if (Number.isNaN(N) && Number.isNaN(V)) {
3028
- C.push(0);
3031
+ const l = Math.min(c, 1), p = Es[o], u = i.keys().filter((A) => A !== "alpha"), f = Number.isNaN(i.alpha) ? a.alpha : i.alpha, C = Number.isNaN(a.alpha) ? i.alpha : a.alpha, y = de(r, f, C) * l, E = [];
3032
+ for (const A of u) {
3033
+ let L = i[A], W = a[A];
3034
+ if (Number.isNaN(L) && Number.isNaN(W)) {
3035
+ E.push(0);
3029
3036
  continue;
3030
3037
  }
3031
- if (Number.isNaN(N) && (N = V), Number.isNaN(V) && (V = N), E === m)
3032
- C.push(Ao(N, V, r, s));
3038
+ if (Number.isNaN(L) && (L = W), Number.isNaN(W) && (W = L), A === p)
3039
+ E.push(Ts(L, W, r, s));
3033
3040
  else {
3034
- const tt = N * d, et = V * x, nt = oe(r, tt, et);
3035
- C.push(S > 0 ? nt / S : 0);
3041
+ const ot = L * f, st = W * C, it = de(r, ot, st);
3042
+ E.push(y > 0 ? it / y : 0);
3036
3043
  }
3037
3044
  }
3038
- const P = i.constructor;
3039
- return new P(...C, S);
3045
+ const w = i.constructor;
3046
+ return new w(...E, y);
3040
3047
  }
3041
- const Ro = (e, t, n) => {
3042
- const r = f[t][n];
3048
+ const Ms = (e, t, n) => {
3049
+ const r = b[t][n];
3043
3050
  return r[e] ?? r.number;
3044
- }, Po = (e, t, n, r, o = !1) => {
3045
- t = o ? gn[n][r] : t;
3046
- const { min: s, max: i } = Ro(t, n, r), [a, c, l, m] = o ? [s, i, 0, 1] : [0, 1, s, i], u = B(e, l, m, a, c);
3047
- return new k(u, o ? t : "");
3048
- }, Oo = (e, t = !1) => {
3051
+ }, Is = (e, t, n, r, o = !1) => {
3052
+ t = o ? lr[n][r] : t;
3053
+ const { min: s, max: i } = Ms(t, n, r), [a, c, l, p] = o ? [s, i, 0, 1] : [0, 1, s, i], u = R(e, l, p, a, c);
3054
+ return new S(u, o ? t : "");
3055
+ }, Rs = (e, t = !1) => {
3049
3056
  const n = e.colorSpace;
3050
3057
  return e.keys().forEach((r) => {
3051
- const o = e[r] instanceof k ? e[r].value : e[r];
3052
- e[r] = Po(
3058
+ const o = e[r] instanceof S ? e[r].value : e[r];
3059
+ e[r] = Is(
3053
3060
  o,
3054
3061
  e[r]?.unit,
3055
3062
  n,
@@ -3057,38 +3064,38 @@ const Ro = (e, t, n) => {
3057
3064
  t
3058
3065
  );
3059
3066
  }), e;
3060
- }, ie = (e, t = !1, n = !1) => {
3067
+ }, we = (e, t = !1, n = !1) => {
3061
3068
  e = n ? e : e.clone();
3062
- const r = Oo(e.value, t);
3063
- return n ? e : new k(r).coalesce(e, !0);
3064
- }, nn = (e, t = "lab", n = !1, r = !1, o = !1) => {
3065
- const s = n ? o ? e : e.clone() : ie(e, !1, o), i = it(s.toJSON(), t);
3069
+ const r = Rs(e.value, t);
3070
+ return n ? e : new S(r).coalesce(e, !0);
3071
+ }, wn = (e, t = "lab", n = !1, r = !1, o = !1) => {
3072
+ const s = n ? o ? e : e.clone() : we(e, !1, o), i = pt(s.toJSON(), t);
3066
3073
  return i.entries().forEach(([a, c]) => {
3067
- i[a] = new k(c);
3068
- }), s.value = i, s.superType[1] = t, r ? ie(s, !0, !0) : s;
3069
- }, No = (e, t, n = "lab", r = !1, o = !1, s = !1) => [
3070
- nn(e, n, r, o, s),
3071
- nn(t, n, r, o, s)
3072
- ], F = (e) => new k(
3074
+ i[a] = new S(c);
3075
+ }), s.value = i, s.superType[1] = t, r ? we(s, !0, !0) : s;
3076
+ }, vs = (e, t, n = "lab", r = !1, o = !1, s = !1) => [
3077
+ wn(e, n, r, o, s),
3078
+ wn(t, n, r, o, s)
3079
+ ], G = (e) => new S(
3073
3080
  e,
3074
3081
  "color",
3075
3082
  ["color", e.colorSpace],
3076
3083
  void 0,
3077
3084
  "color"
3078
3085
  );
3079
- function ae(e) {
3080
- const n = ie(e).value, r = n.clone();
3086
+ function ke(e) {
3087
+ const n = we(e).value, r = n.clone();
3081
3088
  for (const o of n.keys()) {
3082
3089
  const s = n[o];
3083
- r[o] = s instanceof k ? s.value : s;
3090
+ r[o] = s instanceof S ? s.value : s;
3084
3091
  }
3085
3092
  return r;
3086
3093
  }
3087
- function zo(e) {
3094
+ function Bs(e) {
3088
3095
  const t = e.replace(/[^0-9.+\-*/() e]/g, "");
3089
3096
  return new Function(`return (${t})`)();
3090
3097
  }
3091
- function rn(e, t) {
3098
+ function kn(e, t) {
3092
3099
  switch (e.type) {
3093
3100
  case "ref":
3094
3101
  return t[e.name] ?? 0;
@@ -3101,32 +3108,32 @@ function rn(e, t) {
3101
3108
  const r = Object.keys(t).sort((o, s) => s.length - o.length);
3102
3109
  for (const o of r)
3103
3110
  n = n.replace(new RegExp(`\\b${o}\\b`, "g"), String(t[o]));
3104
- return zo(n);
3111
+ return Bs(n);
3105
3112
  }
3106
3113
  }
3107
3114
  }
3108
- function _o(e, t, n, r) {
3109
- const o = ae(e), s = it(o, t), i = {};
3110
- for (const [d, x] of s.entries())
3111
- i[d] = x;
3112
- const a = n.map((d) => rn(d, i)), c = r ? rn(r, i) : i.alpha ?? 1, m = {
3113
- rgb: $,
3114
- hsl: St,
3115
- hwb: he,
3116
- lab: Lt,
3117
- lch: fe,
3118
- oklab: $t,
3119
- oklch: be,
3120
- xyz: D,
3121
- "srgb-linear": de,
3122
- "display-p3": ge,
3123
- "a98-rgb": we,
3124
- "prophoto-rgb": ke,
3125
- rec2020: ye
3126
- }[t] ?? $, u = new m(...a, c);
3127
- return F(u);
3128
- }
3129
- const Lo = {
3115
+ function Ns(e, t, n, r) {
3116
+ const o = ke(e), s = pt(o, t), i = {};
3117
+ for (const [f, C] of s.entries())
3118
+ i[f] = C;
3119
+ const a = n.map((f) => kn(f, i)), c = r ? kn(r, i) : i.alpha ?? 1, p = {
3120
+ rgb: O,
3121
+ hsl: yt,
3122
+ hwb: Te,
3123
+ lab: Xt,
3124
+ lch: Ae,
3125
+ oklab: Ht,
3126
+ oklch: Me,
3127
+ xyz: U,
3128
+ "srgb-linear": Ie,
3129
+ "display-p3": Re,
3130
+ "a98-rgb": ve,
3131
+ "prophoto-rgb": Be,
3132
+ rec2020: Ne
3133
+ }[t] ?? O, u = new p(...a, c);
3134
+ return G(u);
3135
+ }
3136
+ const _s = {
3130
3137
  srgb: "rgb",
3131
3138
  "srgb-linear": "srgb-linear",
3132
3139
  "display-p3": "display-p3",
@@ -3142,352 +3149,352 @@ const Lo = {
3142
3149
  xyz: "xyz",
3143
3150
  "xyz-d65": "xyz",
3144
3151
  "xyz-d50": "xyz"
3145
- }, $o = {
3146
- srgb: { space: "rgb", ctor: $ },
3147
- "srgb-linear": { space: "srgb-linear", ctor: de },
3148
- "display-p3": { space: "display-p3", ctor: ge },
3149
- "a98-rgb": { space: "a98-rgb", ctor: we },
3150
- "prophoto-rgb": { space: "prophoto-rgb", ctor: ke },
3151
- rec2020: { space: "rec2020", ctor: ye },
3152
- xyz: { space: "xyz", ctor: D },
3153
- "xyz-d65": { space: "xyz", ctor: D },
3154
- "xyz-d50": { space: "xyz", ctor: D }
3155
- }, Fo = A(","), Do = G(/\s+/), Ft = A("/"), Dt = A("("), Gt = A(")"), zt = b(Fo.trim(g), Do), Hn = b(Ft.trim(g), zt), W = y.lazy(() => b(
3152
+ }, Ps = {
3153
+ srgb: { space: "rgb", ctor: O },
3154
+ "srgb-linear": { space: "srgb-linear", ctor: Ie },
3155
+ "display-p3": { space: "display-p3", ctor: Re },
3156
+ "a98-rgb": { space: "a98-rgb", ctor: ve },
3157
+ "prophoto-rgb": { space: "prophoto-rgb", ctor: Be },
3158
+ rec2020: { space: "rec2020", ctor: Ne },
3159
+ xyz: { space: "xyz", ctor: U },
3160
+ "xyz-d65": { space: "xyz", ctor: U },
3161
+ "xyz-d50": { space: "xyz", ctor: U }
3162
+ }, Os = B(","), Ls = D(/\s+/), Yt = B("/"), Zt = B("("), qt = B(")"), Vt = d(Os.trim(g), Ls), Gr = d(Yt.trim(g), Vt), X = x.lazy(() => d(
3156
3163
  H.Percentage,
3157
3164
  H.Angle.map((e) => {
3158
- const t = Se(e.value, e.unit);
3159
- return new k(t, "deg", ["angle"]);
3165
+ const t = _e(e.value, e.unit);
3166
+ return new S(t, "deg", ["angle"]);
3160
3167
  }),
3161
- b(q, wr).map((e) => new k(e)),
3162
- xe.map(() => new k(NaN))
3163
- )), wt = b(
3168
+ d(et, go).map((e) => new S(e)),
3169
+ Pe.map(() => new S(NaN))
3170
+ )), Mt = d(
3164
3171
  // calc(...)
3165
- p("calc").next(
3166
- G(/\(([^)]+)\)/, (e) => e?.[1] ?? null)
3172
+ m("calc").next(
3173
+ D(/\(([^)]+)\)/, (e) => e?.[1] ?? null)
3167
3174
  ).map((e) => ({ type: "calc", expr: e })),
3168
3175
  // none
3169
- xe.map(() => ({ type: "none" })),
3176
+ Pe.map(() => ({ type: "none" })),
3170
3177
  // component reference (alpha must be tried before single 'a')
3171
- G(/\b(alpha|r|g|b|h|s|l|c|w|a|x|y|z)\b/).map(
3178
+ D(/\b(alpha|r|g|b|h|s|l|c|w|a|x|y|z)\b/).map(
3172
3179
  (e) => ({ type: "ref", name: e })
3173
3180
  ),
3174
3181
  // literal number / percentage / angle
3175
- W.map((e) => ({ type: "literal", value: e.value }))
3176
- ), Z = (e) => {
3177
- const t = A(e).skip(p("a").opt()), n = b(
3178
- M(W.skip(Hn), W),
3179
- W.map((o) => [o])
3180
- ), r = M(
3181
- W.skip(zt),
3182
- W.skip(zt),
3182
+ X.map((e) => ({ type: "literal", value: e.value }))
3183
+ ), q = (e) => {
3184
+ const t = B(e).skip(m("a").opt()), n = d(
3185
+ I(X.skip(Gr), X),
3186
+ X.map((o) => [o])
3187
+ ), r = I(
3188
+ X.skip(Vt),
3189
+ X.skip(Vt),
3183
3190
  n
3184
- ).trim(g).wrap(Dt, Gt);
3185
- return t.next(r).map(([o, s, [i, a]]) => [o, s, i, a ?? new k(1)]);
3191
+ ).trim(g).wrap(Zt, qt);
3192
+ return t.next(r).map(([o, s, [i, a]]) => [o, s, i, a ?? new S(1)]);
3186
3193
  };
3187
- function Q(e, t) {
3188
- return A(e).skip(p("a").opt()).next(
3189
- M(
3190
- p("from").skip(g).next(y.lazy(() => _e.Value)),
3191
- g.next(wt),
3192
- g.next(wt),
3193
- g.next(wt),
3194
- Ft.trim(g).next(wt).opt()
3195
- ).trim(g).wrap(Dt, Gt)
3196
- ).map(([n, r, o, s, i]) => _o(n, t, [r, o, s], i));
3197
- }
3198
- const Go = G(/#[0-9a-fA-F]{3,8}/).map((e) => {
3199
- const { r: t, g: n, b: r, alpha: o } = Lr(e);
3200
- return F(new $(t, n, r, o));
3201
- }), Uo = q.skip(p("k")).map((e) => {
3202
- const t = Bn(new un(e));
3203
- return F(t);
3204
- }), Vo = b(
3205
- Q("rgb", "rgb"),
3206
- Z("rgb").map(
3207
- ([e, t, n, r]) => F(new $(e, t, n, r))
3194
+ function rt(e, t) {
3195
+ return B(e).skip(m("a").opt()).next(
3196
+ I(
3197
+ m("from").skip(g).next(x.lazy(() => Ye.Value)),
3198
+ g.next(Mt),
3199
+ g.next(Mt),
3200
+ g.next(Mt),
3201
+ Yt.trim(g).next(Mt).opt()
3202
+ ).trim(g).wrap(Zt, qt)
3203
+ ).map(([n, r, o, s, i]) => Ns(n, t, [r, o, s], i));
3204
+ }
3205
+ const zs = D(/#[0-9a-fA-F]{3,8}/).map((e) => {
3206
+ const { r: t, g: n, b: r, alpha: o } = Oo(e);
3207
+ return G(new O(t, n, r, o));
3208
+ }), $s = et.skip(m("k")).map((e) => {
3209
+ const t = Sr(new nr(e));
3210
+ return G(t);
3211
+ }), Fs = d(
3212
+ rt("rgb", "rgb"),
3213
+ q("rgb").map(
3214
+ ([e, t, n, r]) => G(new O(e, t, n, r))
3208
3215
  )
3209
- ), Wo = b(
3210
- Q("hsl", "hsl"),
3211
- Z("hsl").map(
3212
- ([e, t, n, r]) => F(new St(e, t, n, r))
3216
+ ), Gs = d(
3217
+ rt("hsl", "hsl"),
3218
+ q("hsl").map(
3219
+ ([e, t, n, r]) => G(new yt(e, t, n, r))
3213
3220
  )
3214
- ), Xo = Z("hsv").map(
3215
- ([e, t, n, r]) => F(new pe(e, t, n, r))
3216
- ), Ho = b(
3217
- Q("hwb", "hwb"),
3218
- Z("hwb").map(
3219
- ([e, t, n, r]) => F(new he(e, t, n, r))
3221
+ ), Us = q("hsv").map(
3222
+ ([e, t, n, r]) => G(new Ee(e, t, n, r))
3223
+ ), Ds = d(
3224
+ rt("hwb", "hwb"),
3225
+ q("hwb").map(
3226
+ ([e, t, n, r]) => G(new Te(e, t, n, r))
3220
3227
  )
3221
- ), Yo = b(
3222
- Q("lab", "lab"),
3223
- Z("lab").map(
3224
- ([e, t, n, r]) => F(new Lt(e, t, n, r))
3228
+ ), Vs = d(
3229
+ rt("lab", "lab"),
3230
+ q("lab").map(
3231
+ ([e, t, n, r]) => G(new Xt(e, t, n, r))
3225
3232
  )
3226
- ), jo = b(
3227
- Q("lch", "lch"),
3228
- Z("lch").map(
3229
- ([e, t, n, r]) => F(new fe(e, t, n, r))
3233
+ ), Ws = d(
3234
+ rt("lch", "lch"),
3235
+ q("lch").map(
3236
+ ([e, t, n, r]) => G(new Ae(e, t, n, r))
3230
3237
  )
3231
- ), Zo = b(
3232
- Q("oklab", "oklab"),
3233
- Z("oklab").map(
3234
- ([e, t, n, r]) => F(new $t(e, t, n, r))
3238
+ ), Xs = d(
3239
+ rt("oklab", "oklab"),
3240
+ q("oklab").map(
3241
+ ([e, t, n, r]) => G(new Ht(e, t, n, r))
3235
3242
  )
3236
- ), Ko = b(
3237
- Q("oklch", "oklch"),
3238
- Z("oklch").map(
3239
- ([e, t, n, r]) => F(new be(e, t, n, r))
3243
+ ), Hs = d(
3244
+ rt("oklch", "oklch"),
3245
+ q("oklch").map(
3246
+ ([e, t, n, r]) => G(new Me(e, t, n, r))
3240
3247
  )
3241
- ), qo = b(
3242
- Q("xyz", "xyz"),
3243
- Z("xyz").map(
3244
- ([e, t, n, r]) => F(new D(e, t, n, r))
3248
+ ), js = d(
3249
+ rt("xyz", "xyz"),
3250
+ q("xyz").map(
3251
+ ([e, t, n, r]) => G(new U(e, t, n, r))
3245
3252
  )
3246
- ), Jo = b(
3247
- p("srgb-linear").map(() => "srgb-linear"),
3248
- p("srgb").map(() => "srgb"),
3249
- p("display-p3").map(() => "display-p3"),
3250
- p("a98-rgb").map(() => "a98-rgb"),
3251
- p("prophoto-rgb").map(() => "prophoto-rgb"),
3252
- p("rec2020").map(() => "rec2020"),
3253
- p("oklab").map(() => "oklab"),
3254
- p("oklch").map(() => "oklch"),
3255
- p("lab").map(() => "lab"),
3256
- p("lch").map(() => "lch"),
3257
- p("hsl").map(() => "hsl"),
3258
- p("hwb").map(() => "hwb"),
3259
- p("xyz-d65").map(() => "xyz-d65"),
3260
- p("xyz-d50").map(() => "xyz-d50"),
3261
- p("xyz").map(() => "xyz")
3262
- ), Qo = b(
3263
- p("shorter"),
3264
- p("longer"),
3265
- p("increasing"),
3266
- p("decreasing")
3267
- ).skip(g).skip(p("hue")), on = y.lazy(
3268
- () => M(
3269
- _e.Value,
3253
+ ), Ys = d(
3254
+ m("srgb-linear").map(() => "srgb-linear"),
3255
+ m("srgb").map(() => "srgb"),
3256
+ m("display-p3").map(() => "display-p3"),
3257
+ m("a98-rgb").map(() => "a98-rgb"),
3258
+ m("prophoto-rgb").map(() => "prophoto-rgb"),
3259
+ m("rec2020").map(() => "rec2020"),
3260
+ m("oklab").map(() => "oklab"),
3261
+ m("oklch").map(() => "oklch"),
3262
+ m("lab").map(() => "lab"),
3263
+ m("lch").map(() => "lch"),
3264
+ m("hsl").map(() => "hsl"),
3265
+ m("hwb").map(() => "hwb"),
3266
+ m("xyz-d65").map(() => "xyz-d65"),
3267
+ m("xyz-d50").map(() => "xyz-d50"),
3268
+ m("xyz").map(() => "xyz")
3269
+ ), Zs = d(
3270
+ m("shorter"),
3271
+ m("longer"),
3272
+ m("increasing"),
3273
+ m("decreasing")
3274
+ ).skip(g).skip(m("hue")), Sn = x.lazy(
3275
+ () => I(
3276
+ Ye.Value,
3270
3277
  g.next(H.Percentage).opt()
3271
3278
  )
3272
- ), ts = p("color-mix").next(
3273
- M(
3279
+ ), qs = m("color-mix").next(
3280
+ I(
3274
3281
  // "in <space> [<hueMethod>]"
3275
- p("in").skip(g).next(
3276
- M(
3277
- Jo,
3278
- g.next(Qo).opt()
3282
+ m("in").skip(g).next(
3283
+ I(
3284
+ Ys,
3285
+ g.next(Zs).opt()
3279
3286
  )
3280
3287
  ),
3281
3288
  // ", <color> [<pct>]?"
3282
- A(",").trim(g).next(on),
3289
+ B(",").trim(g).next(Sn),
3283
3290
  // ", <color> [<pct>]?"
3284
- A(",").trim(g).next(on)
3285
- ).trim(g).wrap(Dt, Gt)
3291
+ B(",").trim(g).next(Sn)
3292
+ ).trim(g).wrap(Zt, qt)
3286
3293
  ).map(([[e, t], [n, r], [o, s]]) => {
3287
- const i = Lo[e] ?? "oklab", a = t ?? "shorter";
3294
+ const i = _s[e] ?? "oklab", a = t ?? "shorter";
3288
3295
  let c = r != null ? r.value / 100 : -1, l = s != null ? s.value / 100 : -1;
3289
3296
  c < 0 && l < 0 ? (c = 0.5, l = 0.5) : c < 0 ? c = 1 - l : l < 0 && (l = 1 - c);
3290
- const m = ae(n), u = ae(o), d = Io(m, u, c, l, i, a);
3291
- return F(d);
3292
- }), es = b(
3293
- p("srgb-linear").map(() => "srgb-linear"),
3294
- p("srgb").map(() => "srgb"),
3295
- p("display-p3").map(() => "display-p3"),
3296
- p("a98-rgb").map(() => "a98-rgb"),
3297
- p("prophoto-rgb").map(() => "prophoto-rgb"),
3298
- p("rec2020").map(() => "rec2020"),
3299
- p("xyz-d65").map(() => "xyz-d65"),
3300
- p("xyz-d50").map(() => "xyz-d50"),
3301
- p("xyz").map(() => "xyz")
3302
- ), ns = p("color").next(
3303
- M(
3304
- es.skip(g),
3305
- W.skip(g),
3306
- W.skip(g),
3307
- b(
3308
- M(
3309
- W.skip(Ft.trim(g)),
3310
- W
3297
+ const p = ke(n), u = ke(o), f = As(p, u, c, l, i, a);
3298
+ return G(f);
3299
+ }), Ks = d(
3300
+ m("srgb-linear").map(() => "srgb-linear"),
3301
+ m("srgb").map(() => "srgb"),
3302
+ m("display-p3").map(() => "display-p3"),
3303
+ m("a98-rgb").map(() => "a98-rgb"),
3304
+ m("prophoto-rgb").map(() => "prophoto-rgb"),
3305
+ m("rec2020").map(() => "rec2020"),
3306
+ m("xyz-d65").map(() => "xyz-d65"),
3307
+ m("xyz-d50").map(() => "xyz-d50"),
3308
+ m("xyz").map(() => "xyz")
3309
+ ), Js = m("color").next(
3310
+ I(
3311
+ Ks.skip(g),
3312
+ X.skip(g),
3313
+ X.skip(g),
3314
+ d(
3315
+ I(
3316
+ X.skip(Yt.trim(g)),
3317
+ X
3311
3318
  ),
3312
- W.map((e) => [e, void 0])
3319
+ X.map((e) => [e, void 0])
3313
3320
  )
3314
- ).trim(g).wrap(Dt, Gt)
3321
+ ).trim(g).wrap(Zt, qt)
3315
3322
  ).map(([e, t, n, [r, o]]) => {
3316
- const s = $o[e];
3323
+ const s = Ps[e];
3317
3324
  if (!s)
3318
3325
  throw new Error(`Unknown color() space: ${e}`);
3319
- const i = o ?? new k(1);
3326
+ const i = o ?? new S(1);
3320
3327
  if (e === "srgb") {
3321
3328
  const c = (l) => l.value * 255;
3322
- return F(new $(c(t), c(n), c(r), i.value));
3329
+ return G(new O(c(t), c(n), c(r), i.value));
3323
3330
  }
3324
3331
  const a = new s.ctor(t, n, r, i);
3325
- return F(a);
3326
- }), rs = b(
3327
- ...Object.keys(tn).sort((e, t) => t.length - e.length).map(p)
3332
+ return G(a);
3333
+ }), Qs = d(
3334
+ ...Object.keys(dn).sort((e, t) => t.length - e.length).map(m)
3328
3335
  ).chain((e) => {
3329
- const t = tn[e.toLowerCase()];
3336
+ const t = dn[e.toLowerCase()];
3330
3337
  if (t) {
3331
- const n = tr(t);
3338
+ const n = Yr(t);
3332
3339
  if (n)
3333
- return kr(n);
3334
- }
3335
- return yr();
3336
- }), Yn = b(
3337
- ts,
3338
- ns,
3339
- Go,
3340
- Uo,
3341
- Vo,
3342
- Wo,
3343
- Xo,
3344
- Ho,
3345
- Yo,
3346
- jo,
3347
- Zo,
3348
- Ko,
3349
- qo,
3350
- rs
3351
- ).trim(g), _e = {
3352
- Value: Yn,
3353
- colorValue: W,
3354
- componentExpr: wt,
3355
- sep: zt,
3356
- alphaSep: Hn,
3357
- div: Ft
3340
+ return wo(n);
3341
+ }
3342
+ return ko();
3343
+ }), Ur = d(
3344
+ qs,
3345
+ Js,
3346
+ zs,
3347
+ $s,
3348
+ Fs,
3349
+ Gs,
3350
+ Us,
3351
+ Ds,
3352
+ Vs,
3353
+ Ws,
3354
+ Xs,
3355
+ Hs,
3356
+ js,
3357
+ Qs
3358
+ ).trim(g), Ye = {
3359
+ Value: Ur,
3360
+ colorValue: X,
3361
+ componentExpr: Mt,
3362
+ sep: Vt,
3363
+ alphaSep: Gr,
3364
+ div: Yt
3358
3365
  };
3359
- function ni(e) {
3360
- return Ct(Yn, e);
3366
+ function Ia(e) {
3367
+ return Bt(Ur, e);
3361
3368
  }
3362
- const os = b(...Mt.map(p)), ss = b(...Et.map(p)), is = b(...Bt.map(p)), as = b(...At.map(p)), cs = b(...ln.map(p)), ls = A(","), us = A(" "), ms = b(ls, us).trim(g), jn = M(q, os).map(([e, t]) => {
3369
+ const ti = d(...Pt.map(m)), ei = d(...Lt.map(m)), ni = d(...Ot.map(m)), ri = d(...zt.map(m)), oi = d(...er.map(m)), si = B(","), ii = B(" "), ai = d(si, ii).trim(g), Dr = I(et, ti).map(([e, t]) => {
3363
3370
  const n = ["length"];
3364
- return cn.includes(t) ? n.push("relative") : an.includes(t) && n.push("absolute"), new k(e, t, n);
3365
- }), Zn = M(q, ss).map(([e, t]) => new k(e, t, ["angle"])), Le = M(q, is).map(([e, t]) => new k(e, t, ["time"])), ps = y.lazy(() => b($e, Le)), Kn = M(q, as).map(([e, t]) => new k(e, t, ["resolution"])), $e = b(
3366
- M(q, cs),
3367
- p("from").map(() => [0, "%"]),
3368
- p("to").map(() => [100, "%"])
3369
- ).map(([e, t]) => new k(e, t, ["percentage"])), qn = y.lazy(() => _e.Value), Jn = A("/").trim(g).map(() => new k("/", "string")), Qn = b(
3370
- jn,
3371
- Zn,
3372
- Le,
3373
- Kn,
3374
- $e,
3375
- qn,
3376
- Jn,
3377
- q.map((e) => new k(e)),
3378
- xe.map(() => new k(NaN))
3371
+ return tr.includes(t) ? n.push("relative") : Qn.includes(t) && n.push("absolute"), new S(e, t, n);
3372
+ }), Vr = I(et, ei).map(([e, t]) => new S(e, t, ["angle"])), Ze = I(et, ni).map(([e, t]) => new S(e, t, ["time"])), ci = x.lazy(() => d(qe, Ze)), Wr = I(et, ri).map(([e, t]) => new S(e, t, ["resolution"])), qe = d(
3373
+ I(et, oi),
3374
+ m("from").map(() => [0, "%"]),
3375
+ m("to").map(() => [100, "%"])
3376
+ ).map(([e, t]) => new S(e, t, ["percentage"])), Xr = x.lazy(() => Ye.Value), Hr = B("/").trim(g).map(() => new S("/", "string")), jr = d(
3377
+ Dr,
3378
+ Vr,
3379
+ Ze,
3380
+ Wr,
3381
+ qe,
3382
+ Xr,
3383
+ Hr,
3384
+ et.map((e) => new S(e)),
3385
+ Pe.map(() => new S(NaN))
3379
3386
  ).trim(g), H = {
3380
- Length: jn,
3381
- Angle: Zn,
3382
- Time: Le,
3383
- TimePercentage: ps,
3384
- Resolution: Kn,
3385
- Percentage: $e,
3386
- Color: qn,
3387
- Slash: Jn,
3388
- Value: Qn,
3389
- sep: ms
3387
+ Length: Dr,
3388
+ Angle: Vr,
3389
+ Time: Ze,
3390
+ TimePercentage: ci,
3391
+ Resolution: Wr,
3392
+ Percentage: qe,
3393
+ Color: Xr,
3394
+ Slash: Hr,
3395
+ Value: jr,
3396
+ sep: ai
3390
3397
  };
3391
- function tr(e) {
3392
- return Ct(Qn, e);
3393
- }
3394
- const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
3395
- () => Ge.sepBy(b(ce, g)).trim(g).map((e) => new xt(...e))
3396
- ), Fe = (e) => M(
3397
- e || gr,
3398
- er.wrap(mt, pt)
3399
- ), hs = () => {
3400
- const e = G(/[^)]+/);
3401
- return A("var").next(e.trim(g).wrap(mt, pt)).map((t) => new k(t, "var"));
3402
- }, fs = () => {
3403
- const e = y.lazy(
3404
- () => b(
3405
- G(/[^()]+/),
3406
- e.many(1).wrap(mt, pt).map((t) => `(${t.join(" ")})`)
3398
+ function Yr(e) {
3399
+ return Bt(jr, e);
3400
+ }
3401
+ const kt = B("("), St = B(")"), Se = B(","), Zr = x.lazy(
3402
+ () => Qe.sepBy(d(Se, g)).trim(g).map((e) => new vt(...e))
3403
+ ), Ke = (e) => I(
3404
+ e || bo,
3405
+ Zr.wrap(kt, St)
3406
+ ), li = () => {
3407
+ const e = D(/[^)]+/);
3408
+ return B("var").next(e.trim(g).wrap(kt, St)).map((t) => new S(t, "var"));
3409
+ }, ui = () => {
3410
+ const e = x.lazy(
3411
+ () => d(
3412
+ D(/[^()]+/),
3413
+ e.many(1).wrap(kt, St).map((t) => `(${t.join(" ")})`)
3407
3414
  ).many(1)
3408
3415
  );
3409
- return A("calc").next(
3410
- b(
3411
- y.lazy(() => Ge).trim(g).wrap(mt, pt),
3412
- e.wrap(mt, pt).map((t) => t.join(" "))
3416
+ return B("calc").next(
3417
+ d(
3418
+ x.lazy(() => Qe).trim(g).wrap(kt, St),
3419
+ e.wrap(kt, St).map((t) => t.join(" "))
3413
3420
  )
3414
- ).map((t) => t instanceof k ? t : new k(t, "calc"));
3415
- }, bs = ["translate", "scale", "rotate", "skew"], le = ["x", "y", "z"], ds = le.map(p), gs = bs.map(p), ws = () => {
3416
- const e = M(
3417
- b(...gs),
3418
- b(...ds, A(""))
3421
+ ).map((t) => t instanceof S ? t : new S(t, "calc"));
3422
+ }, pi = ["translate", "scale", "rotate", "skew"], ye = ["x", "y", "z"], mi = ye.map(m), hi = pi.map(m), fi = () => {
3423
+ const e = I(
3424
+ d(...hi),
3425
+ d(...mi, B(""))
3419
3426
  ), t = (r, o) => r + o.toUpperCase();
3420
- return Fe(e).map(([[r, o], s]) => {
3427
+ return Ke(e).map(([[r, o], s]) => {
3421
3428
  const i = r.toLowerCase(), a = {};
3422
3429
  if (o) {
3423
3430
  const l = i + o.toUpperCase();
3424
3431
  a[l] = s[0];
3425
- } else s.length === 1 ? le.forEach((l) => {
3426
- const m = t(i, l);
3427
- a[m] = s[0];
3428
- }) : s.forEach((l, m) => {
3429
- const u = t(i, le[m]);
3432
+ } else s.length === 1 ? ye.forEach((l) => {
3433
+ const p = t(i, l);
3434
+ a[p] = s[0];
3435
+ }) : s.forEach((l, p) => {
3436
+ const u = t(i, ye[p]);
3430
3437
  a[u] = l;
3431
3438
  });
3432
- const c = Object.entries(a).map(([l, m]) => new at(l, [m]));
3433
- return new xt(...c);
3439
+ const c = Object.entries(a).map(([l, p]) => new mt(l, [p]));
3440
+ return new vt(...c);
3434
3441
  });
3435
- }, ks = {
3442
+ }, bi = {
3436
3443
  left: "270",
3437
3444
  right: "90",
3438
3445
  top: "0",
3439
3446
  bottom: "180"
3440
- }, ys = () => {
3441
- const e = b(...["linear-gradient", "radial-gradient"].map(p)), t = M(
3442
- A("to").skip(g),
3443
- b(...["left", "right", "top", "bottom"].map(p))
3447
+ }, di = () => {
3448
+ const e = d(...["linear-gradient", "radial-gradient"].map(m)), t = I(
3449
+ B("to").skip(g),
3450
+ d(...["left", "right", "top", "bottom"].map(m))
3444
3451
  ).map(([, a]) => {
3445
- const c = ks[a.toLowerCase()];
3446
- return new k(c, "deg");
3447
- }), n = b(H.Angle, t), r = b(H.Length, H.Percentage), o = M(
3452
+ const c = bi[a.toLowerCase()];
3453
+ return new S(c, "deg");
3454
+ }), n = d(H.Angle, t), r = d(H.Length, H.Percentage), o = I(
3448
3455
  H.Color,
3449
3456
  r.sepBy(g)
3450
- ).map(([a, c]) => !c || c.length === 0 ? [a] : [a, ...c]), s = M(
3457
+ ).map(([a, c]) => !c || c.length === 0 ? [a] : [a, ...c]), s = I(
3451
3458
  o,
3452
- ce.trim(g).next(b(o, r)).many()
3459
+ Se.trim(g).next(d(o, r)).many()
3453
3460
  ).map(([a, c]) => [a, ...c]);
3454
- return M(
3461
+ return I(
3455
3462
  e,
3456
- M(n.skip(ce).opt(), s).trim(g).wrap(mt, pt).map(([a, c]) => a ? [a, ...c].flat() : [c])
3457
- ).map(([a, c]) => new at(a, c));
3458
- }, Ss = () => Fe(A("cubic-bezier")).map((e) => new at("cubic-bezier", e[1])), nr = G(/[^\(\)\{\}\s,;]+/).map((e) => new k(e)), De = b(
3459
- ws(),
3460
- hs(),
3461
- fs(),
3462
- ys(),
3463
- Ss(),
3464
- Fe().map(([e, t]) => new at(e, t))
3465
- ), Ge = b(H.Value, De, nr).trim(g), ri = {
3466
- Function: De,
3467
- Value: Ge,
3468
- FunctionArgs: er
3469
- }, xs = M(A("{"), G(/[^{}]+/), A("}")).map(
3463
+ I(n.skip(Se).opt(), s).trim(g).wrap(kt, St).map(([a, c]) => a ? [a, ...c].flat() : [c])
3464
+ ).map(([a, c]) => new mt(a, c));
3465
+ }, gi = () => Ke(B("cubic-bezier")).map((e) => new mt("cubic-bezier", e[1])), qr = D(/[^\(\)\{\}\s,;]+/).map((e) => new S(e)), Je = d(
3466
+ fi(),
3467
+ li(),
3468
+ ui(),
3469
+ di(),
3470
+ gi(),
3471
+ Ke().map(([e, t]) => new mt(e, t))
3472
+ ), Qe = d(H.Value, Je, qr).trim(g), Ra = {
3473
+ Function: Je,
3474
+ Value: Qe,
3475
+ FunctionArgs: Zr
3476
+ }, wi = I(B("{"), D(/[^{}]+/), B("}")).map(
3470
3477
  (e) => {
3471
3478
  const t = e.join(`
3472
3479
  `);
3473
3480
  let n = JSON.parse(t);
3474
- return new k(n, "json");
3475
- }
3476
- ), ue = b(H.Value, De, xs, nr).trim(g), oi = {
3477
- Value: ue,
3478
- Values: ue.sepBy(g)
3479
- }, Cs = _t((e) => Ct(ue, e)), si = _t(
3480
- (e) => Ct(H.Percentage, String(e)).valueOf()
3481
- ), ii = _t((e) => Ct(
3481
+ return new S(n, "json");
3482
+ }
3483
+ ), Ce = d(H.Value, Je, wi, qr).trim(g), va = {
3484
+ Value: Ce,
3485
+ Values: Ce.sepBy(g)
3486
+ }, ki = Wt((e) => Bt(Ce, e)), Ba = Wt(
3487
+ (e) => Bt(H.Percentage, String(e)).valueOf()
3488
+ ), Na = Wt((e) => Bt(
3482
3489
  H.Time.map((t) => t.unit === "ms" ? t.value : t.unit === "s" ? t.value * 1e3 : t.value),
3483
3490
  e
3484
- )), ai = _t(
3491
+ )), _a = Wt(
3485
3492
  (e, t) => (() => {
3486
3493
  if (!t)
3487
3494
  return e;
3488
3495
  if (e.unit === "var") {
3489
3496
  const o = getComputedStyle(t).getPropertyValue(e.value);
3490
- return tr(o);
3497
+ return Yr(o);
3491
3498
  }
3492
3499
  if (e.unit === "calc" && e.property && e.subProperty && e.value && t) {
3493
3500
  const o = e.property, s = t.style[o], i = e.subProperty ? `${e.subProperty}(${e.toString()})` : e.toString();
@@ -3496,13 +3503,13 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
3496
3503
  o
3497
3504
  );
3498
3505
  t.style[o] = s;
3499
- const c = Cs(a);
3500
- if (c instanceof k)
3506
+ const c = ki(a);
3507
+ if (c instanceof S)
3501
3508
  return c;
3502
3509
  if (c.name.startsWith("matrix")) {
3503
- const m = mr(c)[e.subProperty];
3504
- if (m != null)
3505
- return new k(m, "px", [
3510
+ const p = lo(c)[e.subProperty];
3511
+ if (p != null)
3512
+ return new S(p, "px", [
3506
3513
  "length",
3507
3514
  "absolute"
3508
3515
  ]);
@@ -3511,29 +3518,29 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
3511
3518
  return e;
3512
3519
  })().coalesce(e),
3513
3520
  { keyFn: (e, t) => `${e.toString()}-${JSON.stringify(t)}` }
3514
- ), Ts = (e, t, n = !1) => {
3521
+ ), Si = (e, t, n = !1) => {
3515
3522
  if (e?.superType?.[0] !== t?.superType?.[0])
3516
3523
  return n ? [e, t] : [e.clone(), t.clone()];
3517
3524
  const r = (i) => {
3518
3525
  switch (i?.superType?.[0]) {
3519
3526
  case "length":
3520
3527
  return {
3521
- value: mn(i.value, i.unit, i.targets?.[0]),
3528
+ value: rr(i.value, i.unit, i.targets?.[0]),
3522
3529
  unit: "px"
3523
3530
  };
3524
3531
  case "angle":
3525
3532
  return {
3526
- value: Se(i.value, i.unit),
3533
+ value: _e(i.value, i.unit),
3527
3534
  unit: "deg"
3528
3535
  };
3529
3536
  case "time":
3530
3537
  return {
3531
- value: pn(i.value, i.unit),
3538
+ value: or(i.value, i.unit),
3532
3539
  unit: "ms"
3533
3540
  };
3534
3541
  case "resolution":
3535
3542
  return {
3536
- value: hn(i.value, i.unit),
3543
+ value: sr(i.value, i.unit),
3537
3544
  unit: "dpi"
3538
3545
  };
3539
3546
  default:
@@ -3541,7 +3548,7 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
3541
3548
  }
3542
3549
  }, [o, s] = [r(e), r(t)];
3543
3550
  return n ? (e.value = o.value, e.unit = o.unit, t.value = s.value, t.unit = s.unit, [e, t]) : [
3544
- new k(
3551
+ new S(
3545
3552
  o.value,
3546
3553
  o.unit,
3547
3554
  e.superType,
@@ -3549,7 +3556,7 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
3549
3556
  e.property,
3550
3557
  e.targets
3551
3558
  ),
3552
- new k(
3559
+ new S(
3553
3560
  s.value,
3554
3561
  s.unit,
3555
3562
  t.superType,
@@ -3559,15 +3566,15 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
3559
3566
  )
3560
3567
  ];
3561
3568
  };
3562
- function ci(e, t) {
3569
+ function Pa(e, t) {
3563
3570
  e = e.coalesce(t, !0), t = t.coalesce(e, !0);
3564
3571
  const n = {
3565
3572
  start: e,
3566
3573
  stop: t,
3567
3574
  value: e.clone()
3568
3575
  };
3569
- if (re(e) && re(t)) {
3570
- const [r, o] = No(
3576
+ if (be(e) && be(t)) {
3577
+ const [r, o] = vs(
3571
3578
  e,
3572
3579
  t,
3573
3580
  "lab",
@@ -3576,206 +3583,584 @@ function ci(e, t) {
3576
3583
  n.start = r, n.stop = o, n.value = r.clone();
3577
3584
  }
3578
3585
  if (e.unit !== t.unit) {
3579
- const [r, o] = Ts(
3586
+ const [r, o] = Si(
3580
3587
  e,
3581
3588
  t,
3582
3589
  !0
3583
3590
  );
3584
3591
  n.start = r, n.stop = o, n.value = r.clone();
3585
3592
  }
3586
- return n.computed = ne.includes(e.unit) || ne.includes(t.unit), n;
3593
+ return n.computed = fe.includes(e.unit) || fe.includes(t.unit), n;
3594
+ }
3595
+ function yi(e) {
3596
+ const t = (n, r = 1) => Math.round(e[n] * r);
3597
+ return `invert(${t(0)}%) sepia(${t(1)}%) saturate(${t(2)}%) hue-rotate(${t(3, 3.6)}deg) brightness(${t(4)}%) contrast(${t(5)}%)`;
3598
+ }
3599
+ const tn = (e) => [e.r, e.g, e.b], Kt = (e, t, n) => new O(e, t, n), Ci = (e, t, n) => new yt(e, t, n), Kr = (e) => {
3600
+ const t = xr(e);
3601
+ return Ci(t.h, t.s, t.l);
3602
+ }, xi = 1, Ei = 1 / 6, Ti = 5, Ai = 15, Mi = 100, Ii = 7500, Ri = 200, pe = 360, vi = 50, Bi = 20, Ni = 3750, _i = 50, Pi = 100, Oi = 100, K = 0.2126, J = 0.7152, Q = 0.0722;
3603
+ function Li(e, t = 0) {
3604
+ const n = Math.sin(t * Math.PI / 180), r = Math.cos(t * Math.PI / 180), o = [
3605
+ K + r * (1 - K) - n * K,
3606
+ J - r * J - n * J,
3607
+ Q - r * Q + n * (1 - Q),
3608
+ K - r * K + n * 0.143,
3609
+ J + r * (1 - J) + n * 0.14,
3610
+ Q - r * Q - n * 0.283,
3611
+ K - r * K - n * (1 - K),
3612
+ J - r * J + n * J,
3613
+ Q + r * (1 - Q) + n * Q
3614
+ ];
3615
+ return en(e, o);
3616
+ }
3617
+ const yn = 0.393, Cn = 0.769, xn = 0.189, En = 0.349, Tn = 0.686, An = 0.168, Mn = 0.272, In = 0.534, Rn = 0.131;
3618
+ function zi(e, t = 1) {
3619
+ const n = [
3620
+ yn + (1 - yn) * (1 - t),
3621
+ Cn - Cn * (1 - t),
3622
+ xn - xn * (1 - t),
3623
+ En - En * (1 - t),
3624
+ Tn + (1 - Tn) * (1 - t),
3625
+ An - An * (1 - t),
3626
+ Mn - Mn * (1 - t),
3627
+ In - In * (1 - t),
3628
+ Rn + (1 - Rn) * (1 - t)
3629
+ ];
3630
+ return en(e, n);
3631
+ }
3632
+ const bt = 0.213, dt = 0.715, gt = 0.072;
3633
+ function $i(e, t = 1) {
3634
+ const n = [
3635
+ bt + (1 - bt) * t,
3636
+ dt - dt * t,
3637
+ gt - gt * t,
3638
+ bt - bt * t,
3639
+ dt + (1 - dt) * t,
3640
+ gt - gt * t,
3641
+ bt - bt * t,
3642
+ dt - dt * t,
3643
+ gt + (1 - gt) * t
3644
+ ];
3645
+ return en(e, n);
3646
+ }
3647
+ function en(e, t) {
3648
+ const n = N(tn(e), t);
3649
+ return Kt(v(n[0], 0, 255), v(n[1], 0, 255), v(n[2], 0, 255));
3650
+ }
3651
+ function Fi(e, t = 1) {
3652
+ return Jr(e, t);
3653
+ }
3654
+ function Gi(e, t = 1) {
3655
+ return Jr(e, t, -(0.5 * t) + 0.5);
3656
+ }
3657
+ function Jr(e, t = 1, n = 0) {
3658
+ const r = tn(e);
3659
+ return Kt(
3660
+ v(r[0] * t + n * 255, 0, 255),
3661
+ v(r[1] * t + n * 255, 0, 255),
3662
+ v(r[2] * t + n * 255, 0, 255)
3663
+ );
3664
+ }
3665
+ function Ui(e, t = 1) {
3666
+ const n = tn(e);
3667
+ return Kt(
3668
+ v((t + n[0] / 255 * (1 - 2 * t)) * 255, 0, 255),
3669
+ v((t + n[1] / 255 * (1 - 2 * t)) * 255, 0, 255),
3670
+ v((t + n[2] / 255 * (1 - 2 * t)) * 255, 0, 255)
3671
+ );
3672
+ }
3673
+ function me(e, t, n) {
3674
+ let r = Kt(0, 0, 0);
3675
+ r = Ui(r, e[0] / 100), r = zi(r, e[1] / 100), r = $i(r, e[2] / 100), r = Li(r, e[3] * 3.6), r = Fi(r, e[4] / 100), r = Gi(r, e[5] / 100);
3676
+ const o = Kr(r);
3677
+ return Math.abs(r.r - t.r) + Math.abs(r.g - t.g) + Math.abs(r.b - t.b) + Math.abs(o.h - n.h) + Math.abs(o.s - n.s) + Math.abs(o.l - n.l);
3678
+ }
3679
+ function Qr(e, t, n, r, o, s, i) {
3680
+ let a = null, c = 1 / 0;
3681
+ const l = new Array(6), p = new Array(6), u = new Array(6);
3682
+ for (let f = 0; f < o; f++) {
3683
+ const C = n / Math.pow(f + 1, Ei);
3684
+ for (let w = 0; w < 6; w++)
3685
+ l[w] = Math.random() > 0.5 ? 1 : -1, p[w] = r[w] + C * l[w], u[w] = r[w] - C * l[w];
3686
+ const y = me(p, s, i) - me(u, s, i);
3687
+ for (let w = 0; w < 6; w++) {
3688
+ const T = y / (2 * C) * l[w], A = t[w] / Math.pow(e + f + 1, xi);
3689
+ r[w] = Di(r[w] - A * T, w);
3690
+ }
3691
+ const E = me(r, s, i);
3692
+ E < c && (a = [...r], c = E);
3693
+ }
3694
+ return { values: a ?? [...r], loss: c };
3695
+ }
3696
+ function Di(e, t) {
3697
+ let n = Mi;
3698
+ return t === 2 ? n = Ii : (t === 4 || t === 5) && (n = Ri), t === 3 ? (e % pe + pe) % pe : v(e, 0, n);
3699
+ }
3700
+ function Vi(e, t, n) {
3701
+ const r = e.loss, o = 2, s = r + 1, i = [0.25 * s, 0.25 * s, s, 0.25 * s, 0.2 * s, 0.2 * s];
3702
+ return Qr(r, i, o, e.values, 500, t, n);
3703
+ }
3704
+ function Wi(e, t) {
3705
+ const n = [60, 180, 18e3, 600, 1.2, 1.2];
3706
+ let r = { loss: 1 / 0, values: [] };
3707
+ for (let o = 0; o < 3; o++)
3708
+ if (r.loss > 25) {
3709
+ const i = Qr(
3710
+ Ti,
3711
+ n,
3712
+ Ai,
3713
+ [
3714
+ vi,
3715
+ Bi,
3716
+ Ni,
3717
+ _i,
3718
+ Pi,
3719
+ Oi
3720
+ ],
3721
+ 1e3,
3722
+ e,
3723
+ t
3724
+ );
3725
+ i.loss < r.loss && (r = i);
3726
+ }
3727
+ return r;
3728
+ }
3729
+ function Xi(e) {
3730
+ const t = Kr(e), n = Vi(Wi(e, t), e, t);
3731
+ return {
3732
+ values: n.values,
3733
+ loss: n.loss,
3734
+ filter: yi(n.values)
3735
+ };
3736
+ }
3737
+ function Oa(e) {
3738
+ return Xi(e);
3739
+ }
3740
+ function Hi(e) {
3741
+ return e;
3587
3742
  }
3743
+ function vn(e) {
3744
+ return e * e;
3745
+ }
3746
+ function Bn(e) {
3747
+ return -e * (e - 2);
3748
+ }
3749
+ function Nn(e) {
3750
+ return (e /= 0.5) < 1 ? 0.5 * e * e : -0.5 * (--e * (e - 2) - 1);
3751
+ }
3752
+ function _n(e) {
3753
+ return e * e * e;
3754
+ }
3755
+ function Pn(e) {
3756
+ return (e = e - 1) * e * e + 1;
3757
+ }
3758
+ function On(e) {
3759
+ return (e /= 0.5) < 1 ? 0.5 * e * e * e : 0.5 * ((e -= 2) * e * e + 2);
3760
+ }
3761
+ function Ln(e) {
3762
+ return e * e * (3 - 2 * e);
3763
+ }
3764
+ const Z = (e, t, n, r) => (o) => (o = fr(o, e, t, n, r)[1], o);
3765
+ function zn(e) {
3766
+ return e = Z(0.09, 0.91, 0.5, 1.5)(e), e;
3767
+ }
3768
+ function $n(e) {
3769
+ return e = Z(0.09, 0.91, 0.5, 1.5)(e), e;
3770
+ }
3771
+ function Fn(e) {
3772
+ return e = jt(e, [
3773
+ [0, 0],
3774
+ [0.026, 1.746],
3775
+ [0.633, 1.06],
3776
+ [1, 0]
3777
+ ])[1], e;
3778
+ }
3779
+ function Gn(e) {
3780
+ return e = jt(e, [
3781
+ [0, 0],
3782
+ [0.367, 0.94],
3783
+ [0.974, 0.254],
3784
+ [1, 0]
3785
+ ])[1], e;
3786
+ }
3787
+ function Un(e) {
3788
+ return e = jt(e, [
3789
+ [0, 0],
3790
+ [0.026, 1.746],
3791
+ [0.633, 1.06],
3792
+ [1, 0]
3793
+ ])[1], e;
3794
+ }
3795
+ function Dn(e) {
3796
+ return e = jt(e, [
3797
+ [0, 0],
3798
+ [0.026, 1.746],
3799
+ [0.633, 1.06],
3800
+ [1, 0]
3801
+ ])[1], e;
3802
+ }
3803
+ function Vn(e) {
3804
+ return 1 - Math.cos(e * Math.PI / 2);
3805
+ }
3806
+ function Wn(e) {
3807
+ return Math.sin(e * Math.PI / 2);
3808
+ }
3809
+ function Xn(e) {
3810
+ return -(Math.cos(Math.PI * e) - 1) / 2;
3811
+ }
3812
+ function Hn(e) {
3813
+ return 1 - Math.sqrt(1 - e * e);
3814
+ }
3815
+ function jn(e) {
3816
+ return Math.sqrt(1 - --e * e);
3817
+ }
3818
+ function Yn(e) {
3819
+ return (e /= 0.5) < 1 ? -(Math.sqrt(1 - e * e) - 1) / 2 : (Math.sqrt(1 - (e -= 2) * e) + 1) / 2;
3820
+ }
3821
+ function Zn(e) {
3822
+ return e === 0 ? 0 : Math.pow(2, 10 * (e - 1));
3823
+ }
3824
+ function qn(e) {
3825
+ return e === 1 ? 1 : 1 - Math.pow(2, -10 * e);
3826
+ }
3827
+ function Kn(e) {
3828
+ return e === 0 ? 0 : e === 1 ? 1 : (e /= 0.5) < 1 ? 0.5 * Math.pow(2, 10 * (e - 1)) : 0.5 * (2 - Math.pow(2, -10 * --e));
3829
+ }
3830
+ const La = [
3831
+ "jump-start",
3832
+ "jump-end",
3833
+ "jump-none",
3834
+ "jump-both",
3835
+ "start",
3836
+ "end",
3837
+ "both"
3838
+ ];
3839
+ function to(e, t) {
3840
+ return Math.floor(e * t) / t;
3841
+ }
3842
+ function ji(e, t) {
3843
+ return Math.ceil(e * t) / t;
3844
+ }
3845
+ function Yi(e, t) {
3846
+ return e === 0 || e === 1 ? e : to(e, t);
3847
+ }
3848
+ function Zi(e, t) {
3849
+ return Math.round(e * t) / t;
3850
+ }
3851
+ function nn(e, t = "jump-start") {
3852
+ switch (t) {
3853
+ case "jump-none":
3854
+ return (n) => Zi(n, e);
3855
+ case "jump-start":
3856
+ case "start":
3857
+ return (n) => to(n, e);
3858
+ case "jump-end":
3859
+ case "end":
3860
+ return (n) => ji(n, e);
3861
+ case "jump-both":
3862
+ case "both":
3863
+ return (n) => Yi(n, e);
3864
+ }
3865
+ }
3866
+ function qi() {
3867
+ return nn(1, "jump-start");
3868
+ }
3869
+ function Ki() {
3870
+ return nn(1, "jump-end");
3871
+ }
3872
+ const ut = {
3873
+ ease: [0.25, 0.1, 0.25, 1],
3874
+ "ease-in": [0.42, 0, 1, 1],
3875
+ "ease-out": [0, 0, 0.58, 1],
3876
+ "ease-in-out": [0.42, 0, 0.58, 1],
3877
+ "ease-in-back": [0.6, -0.28, 0.735, 0.045],
3878
+ "ease-out-back": [0.175, 0.885, 0.32, 1.275],
3879
+ "ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
3880
+ }, za = {
3881
+ linear: Hi,
3882
+ easeInQuad: vn,
3883
+ "ease-in-quad": vn,
3884
+ // "easeInQuad",
3885
+ easeOutQuad: Bn,
3886
+ "ease-out-quad": Bn,
3887
+ // "easeOutQuad",
3888
+ easeInOutQuad: Nn,
3889
+ "ease-in-out-quad": Nn,
3890
+ // "easeInOutQuad",
3891
+ easeInCubic: _n,
3892
+ "ease-in-cubic": _n,
3893
+ easeOutCubic: Pn,
3894
+ "ease-out-cubic": Pn,
3895
+ easeInOutCubic: On,
3896
+ "ease-in-out-cubic": On,
3897
+ easeInBounce: zn,
3898
+ "ease-in-bounce": zn,
3899
+ // "easeInBounce",
3900
+ bounceInEase: $n,
3901
+ "bounce-in-ease": $n,
3902
+ bounceInEaseHalf: Fn,
3903
+ "bounce-in-ease-half": Fn,
3904
+ bounceOutEase: Gn,
3905
+ "bounce-out-ease": Gn,
3906
+ bounceOutEaseHalf: Un,
3907
+ "bounce-out-ease-half": Un,
3908
+ bounceInOutEase: Dn,
3909
+ "bounce-in-out-ease": Dn,
3910
+ easeInSine: Vn,
3911
+ "ease-in-sine": Vn,
3912
+ easeOutSine: Wn,
3913
+ "ease-out-sine": Wn,
3914
+ easeInOutSine: Xn,
3915
+ "ease-in-out-sine": Xn,
3916
+ easeInCirc: Hn,
3917
+ "ease-in-circ": Hn,
3918
+ easeOutCirc: jn,
3919
+ "ease-out-circ": jn,
3920
+ easeInOutCirc: Yn,
3921
+ "ease-in-out-circ": Yn,
3922
+ easeInExpo: Zn,
3923
+ "ease-in-expo": Zn,
3924
+ easeOutExpo: qn,
3925
+ "ease-out-expo": qn,
3926
+ easeInOutExpo: Kn,
3927
+ "ease-in-out-expo": Kn,
3928
+ smoothStep3: Ln,
3929
+ "smooth-step-3": Ln,
3930
+ ease: Z(...ut.ease),
3931
+ "ease-in": Z(...ut["ease-in"]),
3932
+ "ease-out": Z(...ut["ease-out"]),
3933
+ "ease-in-out": Z(...ut["ease-in-out"]),
3934
+ "ease-in-back": Z(...ut["ease-in-back"]),
3935
+ "ease-out-back": Z(...ut["ease-out-back"]),
3936
+ "ease-in-out-back": Z(...ut["ease-in-out-back"]),
3937
+ steps: nn,
3938
+ "step-start": qi,
3939
+ "step-end": Ki
3940
+ };
3588
3941
  export {
3589
- an as ABSOLUTE_LENGTH_UNITS,
3590
- _ as ALPHA_DENORM_UNIT,
3942
+ Qn as ABSOLUTE_LENGTH_UNITS,
3943
+ $ as ALPHA_DENORM_UNIT,
3591
3944
  h as ALPHA_RANGE,
3592
- Et as ANGLE_UNITS,
3593
- we as AdobeRGBColor,
3594
- cr as BLACKLISTED_COALESCE_UNITS,
3595
- tn as COLOR_NAMES,
3596
- gn as COLOR_SPACE_DENORM_UNITS,
3597
- Xs as COLOR_SPACE_NAMES,
3598
- f as COLOR_SPACE_RANGES,
3599
- ar as COLOR_UNITS,
3600
- ne as COMPUTED_UNITS,
3601
- _e as CSSColor,
3602
- ri as CSSFunction,
3603
- xs as CSSJSON,
3604
- nr as CSSString,
3945
+ Lt as ANGLE_UNITS,
3946
+ ve as AdobeRGBColor,
3947
+ io as BLACKLISTED_COALESCE_UNITS,
3948
+ dn as COLOR_NAMES,
3949
+ lr as COLOR_SPACE_DENORM_UNITS,
3950
+ wa as COLOR_SPACE_NAMES,
3951
+ b as COLOR_SPACE_RANGES,
3952
+ so as COLOR_UNITS,
3953
+ fe as COMPUTED_UNITS,
3954
+ Ye as CSSColor,
3955
+ Z as CSSCubicBezier,
3956
+ Ra as CSSFunction,
3957
+ wi as CSSJSON,
3958
+ qr as CSSString,
3605
3959
  H as CSSValueUnit,
3606
- oi as CSSValues,
3607
- Eo as CYLINDRICAL_HUE_COMPONENT,
3608
- U as Color,
3609
- Ks as DELTA_E_OK_JND,
3610
- ge as DisplayP3Color,
3611
- ee as FRAME_RATE,
3612
- at as FunctionValue,
3613
- vr as GAMUT_SECTOR_COEFFICIENTS,
3614
- St as HSLColor,
3615
- pe as HSVColor,
3616
- dt as HUE_RANGE,
3617
- he as HWBColor,
3618
- un as KelvinColor,
3619
- Lt as LABColor,
3620
- fe as LCHColor,
3621
- Mt as LENGTH_UNITS,
3622
- Y as LINEAR_SRGB_TO_LMS,
3623
- w as LMS_TO_LINEAR_SRGB,
3624
- Sn as LMS_TO_OKLAB_MATRIX,
3625
- Cr as LMS_TO_XYZ_MATRIX,
3626
- de as LinearSRGBColor,
3627
- $t as OKLABColor,
3628
- O as OKLAB_TO_LMS_COEFF,
3629
- Tr as OKLAB_TO_LMS_MATRIX,
3630
- be as OKLCHColor,
3631
- ln as PERCENTAGE_UNITS,
3632
- ke as ProPhotoRGBColor,
3633
- cn as RELATIVE_LENGTH_UNITS,
3634
- At as RESOLUTION_UNITS,
3635
- I as RGBA_MAX,
3636
- $ as RGBColor,
3637
- jt as RGB_RANGE,
3638
- ye as Rec2020Color,
3639
- ir as STRING_UNITS,
3640
- lr as STYLE_NAMES,
3641
- Bt as TIME_UNITS,
3642
- zs as UNITS,
3960
+ va as CSSValues,
3961
+ Es as CYLINDRICAL_HUE_COMPONENT,
3962
+ V as Color,
3963
+ Ca as DELTA_E_OK_JND,
3964
+ Re as DisplayP3Color,
3965
+ he as FRAME_RATE,
3966
+ mt as FunctionValue,
3967
+ Eo as GAMUT_SECTOR_COEFFICIENTS,
3968
+ yt as HSLColor,
3969
+ Ee as HSVColor,
3970
+ Tt as HUE_RANGE,
3971
+ Te as HWBColor,
3972
+ nr as KelvinColor,
3973
+ Xt as LABColor,
3974
+ Ae as LCHColor,
3975
+ Pt as LENGTH_UNITS,
3976
+ j as LINEAR_SRGB_TO_LMS,
3977
+ k as LMS_TO_LINEAR_SRGB,
3978
+ hr as LMS_TO_OKLAB_MATRIX,
3979
+ Co as LMS_TO_XYZ_MATRIX,
3980
+ Ie as LinearSRGBColor,
3981
+ Ht as OKLABColor,
3982
+ P as OKLAB_TO_LMS_COEFF,
3983
+ xo as OKLAB_TO_LMS_MATRIX,
3984
+ Me as OKLCHColor,
3985
+ er as PERCENTAGE_UNITS,
3986
+ Be as ProPhotoRGBColor,
3987
+ tr as RELATIVE_LENGTH_UNITS,
3988
+ zt as RESOLUTION_UNITS,
3989
+ _ as RGBA_MAX,
3990
+ O as RGBColor,
3991
+ oe as RGB_RANGE,
3992
+ Ne as Rec2020Color,
3993
+ oo as STRING_UNITS,
3994
+ ao as STYLE_NAMES,
3995
+ Ot as TIME_UNITS,
3996
+ ca as UNITS,
3643
3997
  z as UNIT_RANGE,
3644
- xt as ValueArray,
3645
- k as ValueUnit,
3646
- kn as WHITE_POINTS,
3647
- xr as WHITE_POINT_D50,
3648
- wn as WHITE_POINT_D50_D65,
3649
- Sr as WHITE_POINT_D65,
3650
- Ce as WHITE_POINT_D65_D50,
3651
- D as XYZColor,
3652
- yn as XYZ_TO_LMS_MATRIX,
3653
- So as adobeRgb2xyz,
3654
- Jt as adobeRgbToLinear,
3655
- vs as arrayEquals,
3656
- Rs as camelCaseToHyphen,
3657
- Ns as cancelAnimationFrame,
3658
- X as clamp,
3659
- K as clone,
3660
- it as color2,
3661
- nn as colorUnit2,
3662
- Ar as computeMaxSaturation,
3663
- Gs as convert2,
3664
- pr as convertAbsoluteUnitToPixels,
3665
- hn as convertToDPI,
3666
- Se as convertToDegrees,
3667
- pn as convertToMs,
3668
- mn as convertToPixels,
3669
- As as createHash,
3670
- Mr as cubicBezier,
3671
- js as cubicBezierToSVG,
3672
- Zs as cubicBezierToString,
3673
- Rt as deCasteljau,
3674
- Es as debounce,
3675
- qs as deltaEOK,
3676
- ko as displayP32xyz,
3677
- yr as fail,
3678
- Ir as findCusp,
3679
- Rr as findGamutIntersection,
3680
- Ls as flattenObject,
3681
- Bo as gamutMap,
3682
- Nr as gamutMapOKLab,
3683
- _r as gamutMapSRGB,
3684
- ai as getComputedValue,
3685
- Js as getFormattedColorSpaceRange,
3686
- Lr as hex2rgb,
3687
- An as hsl2hsv,
3688
- Dr as hsl2hwb,
3689
- Ur as hsl2rgb,
3690
- Ne as hsl2xyz,
3691
- En as hsv2hsl,
3692
- Qr as hsv2xyz,
3693
- Fr as hwb2hsl,
3694
- eo as hwb2xyz,
3695
- Is as hyphenToCamelCase,
3696
- gr as identifier,
3697
- wr as integer,
3698
- Ys as interpBezier,
3699
- Ao as interpolateHue,
3700
- J as invertMat3,
3701
- Ds as isCSSStyleName,
3702
- re as isColorUnit,
3703
- Er as isInSRGBGamut,
3704
- sn as isObject,
3705
- p as istring,
3706
- Bn as kelvin2rgb,
3707
- ao as kelvin2xyz,
3708
- Kr as lab2lch,
3709
- Jr as lab2oklab,
3710
- ei as lab2oklch,
3711
- Be as lab2xyz,
3712
- Zr as lch2lab,
3713
- ro as lch2xyz,
3714
- oe as lerp,
3715
- go as linearSrgb2xyz,
3716
- lo as linearToAdobeRgb,
3717
- uo as linearToProPhoto,
3718
- mo as linearToRec2020,
3719
- zn as linearToSrgb,
3720
- Hs as logerp,
3721
- _t as memoize,
3722
- Io as mixColors,
3723
- Ws as multiplyMat3,
3724
- xe as none,
3725
- Oo as normalizeColor,
3726
- ie as normalizeColorUnit,
3727
- Po as normalizeColorUnitComponent,
3728
- No as normalizeColorUnits,
3729
- Ts as normalizeNumericUnits,
3730
- ci as normalizeValueUnits,
3731
- q as number,
3732
- qr as oklab2lab,
3733
- _n as oklab2oklch,
3734
- Pe as oklab2xyz,
3735
- ve as oklabToLinearSRGB,
3736
- ti as oklch2lab,
3737
- Ln as oklch2oklab,
3738
- so as oklch2xyz,
3739
- ni as parseCSSColor,
3740
- si as parseCSSPercent,
3741
- ii as parseCSSTime,
3742
- Cs as parseCSSValue,
3743
- tr as parseCSSValueUnit,
3744
- Us as parseResult,
3745
- Co as proPhoto2xyz,
3746
- Qt as proPhotoToLinear,
3747
- vo as rec20202xyz,
3748
- te as rec2020ToLinear,
3749
- Os as requestAnimationFrame,
3750
- Qs as rgb2hex,
3751
- Gr as rgb2hsl,
3752
- $r as rgb2kelvin,
3753
- Ie as rgb2xyz,
3754
- B as scale,
3755
- Ps as seekPreviousValue,
3756
- Ms as sleep,
3757
- ut as srgbToLinear,
3758
- zr as srgbToOKLab,
3759
- kr as succeed,
3760
- R as transformMat3,
3761
- Vs as transposeMat3,
3762
- Ct as tryParse,
3763
- $s as unflattenObject,
3764
- Fs as unflattenObjectToString,
3765
- mr as unpackMatrixValues,
3766
- Bs as waitUntil,
3767
- xo as xyz2adobeRgb,
3768
- yo as xyz2displayP3,
3769
- ze as xyz2hsl,
3770
- to as xyz2hsv,
3771
- no as xyz2hwb,
3772
- co as xyz2kelvin,
3773
- Me as xyz2lab,
3774
- oo as xyz2lch,
3775
- wo as xyz2linearSrgb,
3776
- Oe as xyz2oklab,
3777
- io as xyz2oklch,
3778
- To as xyz2proPhoto,
3779
- Mo as xyz2rec2020,
3780
- Re as xyz2rgb
3998
+ vt as ValueArray,
3999
+ S as ValueUnit,
4000
+ pr as WHITE_POINTS,
4001
+ yo as WHITE_POINT_D50,
4002
+ ur as WHITE_POINT_D50_D65,
4003
+ So as WHITE_POINT_D65,
4004
+ Oe as WHITE_POINT_D65_D50,
4005
+ U as XYZColor,
4006
+ mr as XYZ_TO_LMS_MATRIX,
4007
+ gs as adobeRgb2xyz,
4008
+ ce as adobeRgbToLinear,
4009
+ Ji as arrayEquals,
4010
+ ut as bezierPresets,
4011
+ $n as bounceInEase,
4012
+ Fn as bounceInEaseHalf,
4013
+ Dn as bounceInOutEase,
4014
+ Gn as bounceOutEase,
4015
+ Un as bounceOutEaseHalf,
4016
+ oa as camelCaseToHyphen,
4017
+ aa as cancelAnimationFrame,
4018
+ v as clamp,
4019
+ tt as clone,
4020
+ pt as color2,
4021
+ wn as colorUnit2,
4022
+ Mo as computeMaxSaturation,
4023
+ fa as convert2,
4024
+ uo as convertAbsoluteUnitToPixels,
4025
+ sr as convertToDPI,
4026
+ _e as convertToDegrees,
4027
+ or as convertToMs,
4028
+ rr as convertToPixels,
4029
+ na as createHash,
4030
+ yi as cssFiltersToString,
4031
+ fr as cubicBezier,
4032
+ Sa as cubicBezierToSVG,
4033
+ ya as cubicBezierToString,
4034
+ Ft as deCasteljau,
4035
+ ea as debounce,
4036
+ xa as deltaEOK,
4037
+ bs as displayP32xyz,
4038
+ zn as easeInBounce,
4039
+ Hn as easeInCirc,
4040
+ _n as easeInCubic,
4041
+ Zn as easeInExpo,
4042
+ Yn as easeInOutCirc,
4043
+ On as easeInOutCubic,
4044
+ Kn as easeInOutExpo,
4045
+ Nn as easeInOutQuad,
4046
+ Xn as easeInOutSine,
4047
+ vn as easeInQuad,
4048
+ Vn as easeInSine,
4049
+ jn as easeOutCirc,
4050
+ Pn as easeOutCubic,
4051
+ qn as easeOutExpo,
4052
+ Bn as easeOutQuad,
4053
+ Wn as easeOutSine,
4054
+ ko as fail,
4055
+ Io as findCusp,
4056
+ Ro as findGamutIntersection,
4057
+ ua as flattenObject,
4058
+ xs as gamutMap,
4059
+ No as gamutMapOKLab,
4060
+ Po as gamutMapSRGB,
4061
+ _a as getComputedValue,
4062
+ Ea as getFormattedColorSpaceRange,
4063
+ Oo as hex2rgb,
4064
+ Cr as hsl2hsv,
4065
+ $o as hsl2hwb,
4066
+ Fo as hsl2rgb,
4067
+ He as hsl2xyz,
4068
+ yr as hsv2hsl,
4069
+ qo as hsv2xyz,
4070
+ zo as hwb2hsl,
4071
+ Jo as hwb2xyz,
4072
+ ra as hyphenToCamelCase,
4073
+ bo as identifier,
4074
+ go as integer,
4075
+ jt as interpBezier,
4076
+ Ts as interpolateHue,
4077
+ nt as invertMat3,
4078
+ ha as isCSSStyleName,
4079
+ be as isColorUnit,
4080
+ Ao as isInSRGBGamut,
4081
+ Jn as isObject,
4082
+ m as istring,
4083
+ La as jumpTerms,
4084
+ Sr as kelvin2rgb,
4085
+ os as kelvin2xyz,
4086
+ jo as lab2lch,
4087
+ Zo as lab2oklab,
4088
+ Ma as lab2oklch,
4089
+ Fe as lab2xyz,
4090
+ Ho as lch2lab,
4091
+ ts as lch2xyz,
4092
+ de as lerp,
4093
+ Hi as linear,
4094
+ hs as linearSrgb2xyz,
4095
+ is as linearToAdobeRgb,
4096
+ as as linearToProPhoto,
4097
+ cs as linearToRec2020,
4098
+ Rr as linearToSrgb,
4099
+ ka as logerp,
4100
+ Wt as memoize,
4101
+ As as mixColors,
4102
+ ga as multiplyMat3,
4103
+ Pe as none,
4104
+ Rs as normalizeColor,
4105
+ we as normalizeColorUnit,
4106
+ Is as normalizeColorUnitComponent,
4107
+ vs as normalizeColorUnits,
4108
+ Si as normalizeNumericUnits,
4109
+ Pa as normalizeValueUnits,
4110
+ et as number,
4111
+ Yo as oklab2lab,
4112
+ vr as oklab2oklch,
4113
+ We as oklab2xyz,
4114
+ ze as oklabToLinearSRGB,
4115
+ Aa as oklch2lab,
4116
+ Br as oklch2oklab,
4117
+ ns as oklch2xyz,
4118
+ Ia as parseCSSColor,
4119
+ Ba as parseCSSPercent,
4120
+ Na as parseCSSTime,
4121
+ ki as parseCSSValue,
4122
+ Yr as parseCSSValueUnit,
4123
+ ba as parseResult,
4124
+ ks as proPhoto2xyz,
4125
+ le as proPhotoToLinear,
4126
+ ys as rec20202xyz,
4127
+ ue as rec2020ToLinear,
4128
+ ia as requestAnimationFrame,
4129
+ Oa as rgb2ColorFilter,
4130
+ Ta as rgb2hex,
4131
+ xr as rgb2hsl,
4132
+ Lo as rgb2kelvin,
4133
+ De as rgb2xyz,
4134
+ R as scale,
4135
+ sa as seekPreviousValue,
4136
+ Qi as sleep,
4137
+ Ln as smoothStep3,
4138
+ wt as srgbToLinear,
4139
+ _o as srgbToOKLab,
4140
+ Ki as stepEnd,
4141
+ qi as stepStart,
4142
+ nn as steppedEase,
4143
+ wo as succeed,
4144
+ za as timingFunctions,
4145
+ N as transformMat3,
4146
+ da as transposeMat3,
4147
+ Bt as tryParse,
4148
+ pa as unflattenObject,
4149
+ ma as unflattenObjectToString,
4150
+ lo as unpackMatrixValues,
4151
+ ta as waitUntil,
4152
+ ws as xyz2adobeRgb,
4153
+ ds as xyz2displayP3,
4154
+ je as xyz2hsl,
4155
+ Ko as xyz2hsv,
4156
+ Qo as xyz2hwb,
4157
+ ss as xyz2kelvin,
4158
+ $e as xyz2lab,
4159
+ es as xyz2lch,
4160
+ fs as xyz2linearSrgb,
4161
+ Xe as xyz2oklab,
4162
+ rs as xyz2oklch,
4163
+ Ss as xyz2proPhoto,
4164
+ Cs as xyz2rec2020,
4165
+ Ve as xyz2rgb
3781
4166
  };