tailwind-clamp 4.1.2 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +313 -305
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +13 -8
package/dist/index.js
CHANGED
|
@@ -572,7 +572,7 @@ const lt = (t) => {
|
|
|
572
572
|
console.log("\x1B[90m", ...arguments, "\x1B[0m");
|
|
573
573
|
}
|
|
574
574
|
};
|
|
575
|
-
class
|
|
575
|
+
class be extends Error {
|
|
576
576
|
constructor(n, r, o, i) {
|
|
577
577
|
super(n);
|
|
578
578
|
C(this, "sourceStart");
|
|
@@ -581,22 +581,22 @@ class Se extends Error {
|
|
|
581
581
|
this.name = "ParseError", this.sourceStart = r, this.sourceEnd = o, this.parserState = i;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
class J extends
|
|
584
|
+
class J extends be {
|
|
585
585
|
constructor(n, r, o, i, s) {
|
|
586
586
|
super(n, r, o, i);
|
|
587
587
|
C(this, "token");
|
|
588
588
|
this.token = s;
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
|
-
const
|
|
591
|
+
const V = { UnexpectedNewLineInString: "Unexpected newline while consuming a string token.", UnexpectedEOFInString: "Unexpected EOF while consuming a string token.", UnexpectedEOFInComment: "Unexpected EOF while consuming a comment.", UnexpectedEOFInURL: "Unexpected EOF while consuming a url token.", UnexpectedEOFInEscapedCodePoint: "Unexpected EOF while consuming an escaped code point.", UnexpectedCharacterInURL: "Unexpected character while consuming a url token.", InvalidEscapeSequenceInURL: "Invalid escape sequence while consuming a url token.", InvalidEscapeSequenceAfterBackslash: 'Invalid escape sequence after "\\"' };
|
|
592
592
|
function j(...t) {
|
|
593
593
|
let e = "";
|
|
594
594
|
for (let n = 0; n < t.length; n++) e += t[n][1];
|
|
595
595
|
return e;
|
|
596
596
|
}
|
|
597
|
-
const ee = 13,
|
|
597
|
+
const ee = 13, b = 45, te = 10, ne = 43, Y = 65533;
|
|
598
598
|
function dt(t) {
|
|
599
|
-
return t.source.codePointAt(t.cursor) === 60 && t.source.codePointAt(t.cursor + 1) === 33 && t.source.codePointAt(t.cursor + 2) ===
|
|
599
|
+
return t.source.codePointAt(t.cursor) === 60 && t.source.codePointAt(t.cursor + 1) === 33 && t.source.codePointAt(t.cursor + 2) === b && t.source.codePointAt(t.cursor + 3) === b;
|
|
600
600
|
}
|
|
601
601
|
function R(t) {
|
|
602
602
|
return t >= 48 && t <= 57;
|
|
@@ -607,7 +607,7 @@ function pt(t) {
|
|
|
607
607
|
function ft(t) {
|
|
608
608
|
return t >= 97 && t <= 122;
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function _(t) {
|
|
611
611
|
return t >= 48 && t <= 57 || t >= 97 && t <= 102 || t >= 65 && t <= 70;
|
|
612
612
|
}
|
|
613
613
|
function vt(t) {
|
|
@@ -617,12 +617,12 @@ function re(t) {
|
|
|
617
617
|
return vt(t) || gt(t) || t === 95;
|
|
618
618
|
}
|
|
619
619
|
function Me(t) {
|
|
620
|
-
return re(t) || R(t) || t ===
|
|
620
|
+
return re(t) || R(t) || t === b;
|
|
621
621
|
}
|
|
622
622
|
function gt(t) {
|
|
623
623
|
return t === 183 || t === 8204 || t === 8205 || t === 8255 || t === 8256 || t === 8204 || 192 <= t && t <= 214 || 216 <= t && t <= 246 || 248 <= t && t <= 893 || 895 <= t && t <= 8191 || 8304 <= t && t <= 8591 || 11264 <= t && t <= 12271 || 12289 <= t && t <= 55295 || 63744 <= t && t <= 64975 || 65008 <= t && t <= 65533 || t === 0 || !!oe(t) || t >= 65536;
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function Ee(t) {
|
|
626
626
|
return t === te || t === ee || t === 12;
|
|
627
627
|
}
|
|
628
628
|
function Q(t) {
|
|
@@ -632,21 +632,21 @@ function oe(t) {
|
|
|
632
632
|
return t >= 55296 && t <= 57343;
|
|
633
633
|
}
|
|
634
634
|
function ce(t) {
|
|
635
|
-
return t.source.codePointAt(t.cursor) === 92 && !
|
|
635
|
+
return t.source.codePointAt(t.cursor) === 92 && !Ee(t.source.codePointAt(t.cursor + 1) ?? -1);
|
|
636
636
|
}
|
|
637
|
-
function
|
|
638
|
-
return e.source.codePointAt(e.cursor) ===
|
|
637
|
+
function Pe(t, e) {
|
|
638
|
+
return e.source.codePointAt(e.cursor) === b ? e.source.codePointAt(e.cursor + 1) === b || !!re(e.source.codePointAt(e.cursor + 1) ?? -1) || e.source.codePointAt(e.cursor + 1) === 92 && !Ee(e.source.codePointAt(e.cursor + 2) ?? -1) : !!re(e.source.codePointAt(e.cursor) ?? -1) || ce(e);
|
|
639
639
|
}
|
|
640
640
|
function $e(t) {
|
|
641
|
-
return t.source.codePointAt(t.cursor) === ne || t.source.codePointAt(t.cursor) ===
|
|
641
|
+
return t.source.codePointAt(t.cursor) === ne || t.source.codePointAt(t.cursor) === b ? !!R(t.source.codePointAt(t.cursor + 1) ?? -1) || t.source.codePointAt(t.cursor + 1) === 46 && R(t.source.codePointAt(t.cursor + 2) ?? -1) : t.source.codePointAt(t.cursor) === 46 ? R(t.source.codePointAt(t.cursor + 1) ?? -1) : R(t.source.codePointAt(t.cursor) ?? -1);
|
|
642
642
|
}
|
|
643
643
|
function mt(t) {
|
|
644
644
|
return t.source.codePointAt(t.cursor) === 47 && t.source.codePointAt(t.cursor + 1) === 42;
|
|
645
645
|
}
|
|
646
646
|
function ht(t) {
|
|
647
|
-
return t.source.codePointAt(t.cursor) ===
|
|
647
|
+
return t.source.codePointAt(t.cursor) === b && t.source.codePointAt(t.cursor + 1) === b && t.source.codePointAt(t.cursor + 2) === 62;
|
|
648
648
|
}
|
|
649
|
-
var a, l,
|
|
649
|
+
var a, l, ke;
|
|
650
650
|
function Ct(t) {
|
|
651
651
|
switch (t) {
|
|
652
652
|
case a.OpenParen:
|
|
@@ -688,7 +688,7 @@ function Et(t, e) {
|
|
|
688
688
|
const n = e.readCodePoint();
|
|
689
689
|
if (n === void 0) {
|
|
690
690
|
const r = [a.Comment, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, void 0];
|
|
691
|
-
return t.onParseError(new J(
|
|
691
|
+
return t.onParseError(new J(V.UnexpectedEOFInComment, e.representationStart, e.representationEnd, ["4.3.2. Consume comments", "Unexpected EOF"], r)), r;
|
|
692
692
|
}
|
|
693
693
|
if (n === 42 && e.source.codePointAt(e.cursor) !== void 0 && e.source.codePointAt(e.cursor) === 47) {
|
|
694
694
|
e.advanceCodePoint();
|
|
@@ -697,28 +697,28 @@ function Et(t, e) {
|
|
|
697
697
|
}
|
|
698
698
|
return [a.Comment, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, void 0];
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function Se(t, e) {
|
|
701
701
|
const n = e.readCodePoint();
|
|
702
|
-
if (n === void 0) return t.onParseError(new
|
|
703
|
-
if (
|
|
702
|
+
if (n === void 0) return t.onParseError(new be(V.UnexpectedEOFInEscapedCodePoint, e.representationStart, e.representationEnd, ["4.3.7. Consume an escaped code point", "Unexpected EOF"])), Y;
|
|
703
|
+
if (_(n)) {
|
|
704
704
|
const r = [n];
|
|
705
705
|
let o;
|
|
706
|
-
for (; (o = e.source.codePointAt(e.cursor)) !== void 0 &&
|
|
706
|
+
for (; (o = e.source.codePointAt(e.cursor)) !== void 0 && _(o) && r.length < 6; ) r.push(o), e.advanceCodePoint();
|
|
707
707
|
Q(e.source.codePointAt(e.cursor) ?? -1) && (e.source.codePointAt(e.cursor) === ee && e.source.codePointAt(e.cursor + 1) === te && e.advanceCodePoint(), e.advanceCodePoint());
|
|
708
708
|
const i = parseInt(String.fromCodePoint(...r), 16);
|
|
709
|
-
return i === 0 || oe(i) || i > 1114111 ?
|
|
709
|
+
return i === 0 || oe(i) || i > 1114111 ? Y : i;
|
|
710
710
|
}
|
|
711
|
-
return n === 0 || oe(n) ?
|
|
711
|
+
return n === 0 || oe(n) ? Y : n;
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function Ae(t, e) {
|
|
714
714
|
const n = [];
|
|
715
715
|
for (; ; ) {
|
|
716
716
|
const r = e.source.codePointAt(e.cursor) ?? -1;
|
|
717
|
-
if (r === 0 || oe(r)) n.push(
|
|
717
|
+
if (r === 0 || oe(r)) n.push(Y), e.advanceCodePoint(+(r > 65535) + 1);
|
|
718
718
|
else if (Me(r)) n.push(r), e.advanceCodePoint(+(r > 65535) + 1);
|
|
719
719
|
else {
|
|
720
720
|
if (!ce(e)) return n;
|
|
721
|
-
e.advanceCodePoint(), n.push(
|
|
721
|
+
e.advanceCodePoint(), n.push(Se(t, e));
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
724
|
}
|
|
@@ -726,36 +726,36 @@ function Pt(t, e) {
|
|
|
726
726
|
e.advanceCodePoint();
|
|
727
727
|
const n = e.source.codePointAt(e.cursor);
|
|
728
728
|
if (n !== void 0 && (Me(n) || ce(e))) {
|
|
729
|
-
let r =
|
|
730
|
-
|
|
731
|
-
const o =
|
|
729
|
+
let r = ke.Unrestricted;
|
|
730
|
+
Pe(0, e) && (r = ke.ID);
|
|
731
|
+
const o = Ae(t, e);
|
|
732
732
|
return [a.Hash, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: String.fromCodePoint(...o), type: r }];
|
|
733
733
|
}
|
|
734
734
|
return [a.Delim, "#", e.representationStart, e.representationEnd, { value: "#" }];
|
|
735
735
|
}
|
|
736
736
|
function kt(t, e) {
|
|
737
737
|
let n = l.Integer;
|
|
738
|
-
for (e.source.codePointAt(e.cursor) !== ne && e.source.codePointAt(e.cursor) !==
|
|
738
|
+
for (e.source.codePointAt(e.cursor) !== ne && e.source.codePointAt(e.cursor) !== b || e.advanceCodePoint(); R(e.source.codePointAt(e.cursor) ?? -1); ) e.advanceCodePoint();
|
|
739
739
|
if (e.source.codePointAt(e.cursor) === 46 && R(e.source.codePointAt(e.cursor + 1) ?? -1)) for (e.advanceCodePoint(2), n = l.Number; R(e.source.codePointAt(e.cursor) ?? -1); ) e.advanceCodePoint();
|
|
740
740
|
if (e.source.codePointAt(e.cursor) === 101 || e.source.codePointAt(e.cursor) === 69) {
|
|
741
741
|
if (R(e.source.codePointAt(e.cursor + 1) ?? -1)) e.advanceCodePoint(2);
|
|
742
742
|
else {
|
|
743
|
-
if (e.source.codePointAt(e.cursor + 1) !==
|
|
743
|
+
if (e.source.codePointAt(e.cursor + 1) !== b && e.source.codePointAt(e.cursor + 1) !== ne || !R(e.source.codePointAt(e.cursor + 2) ?? -1)) return n;
|
|
744
744
|
e.advanceCodePoint(3);
|
|
745
745
|
}
|
|
746
746
|
for (n = l.Number; R(e.source.codePointAt(e.cursor) ?? -1); ) e.advanceCodePoint();
|
|
747
747
|
}
|
|
748
748
|
return n;
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function Ne(t, e) {
|
|
751
751
|
let n;
|
|
752
752
|
{
|
|
753
753
|
const i = e.source.codePointAt(e.cursor);
|
|
754
|
-
i ===
|
|
754
|
+
i === b ? n = "-" : i === ne && (n = "+");
|
|
755
755
|
}
|
|
756
756
|
const r = kt(0, e), o = parseFloat(e.source.slice(e.representationStart, e.representationEnd + 1));
|
|
757
|
-
if (
|
|
758
|
-
const i =
|
|
757
|
+
if (Pe(0, e)) {
|
|
758
|
+
const i = Ae(t, e);
|
|
759
759
|
return [a.Dimension, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: o, signCharacter: n, type: r, unit: String.fromCodePoint(...i) }];
|
|
760
760
|
}
|
|
761
761
|
return e.source.codePointAt(e.cursor) === 37 ? (e.advanceCodePoint(), [a.Percentage, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: o, signCharacter: n }]) : [a.Number, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: o, signCharacter: n, type: r }];
|
|
@@ -766,11 +766,11 @@ function bt(t) {
|
|
|
766
766
|
}
|
|
767
767
|
(function(t) {
|
|
768
768
|
t.Comment = "comment", t.AtKeyword = "at-keyword-token", t.BadString = "bad-string-token", t.BadURL = "bad-url-token", t.CDC = "CDC-token", t.CDO = "CDO-token", t.Colon = "colon-token", t.Comma = "comma-token", t.Delim = "delim-token", t.Dimension = "dimension-token", t.EOF = "EOF-token", t.Function = "function-token", t.Hash = "hash-token", t.Ident = "ident-token", t.Number = "number-token", t.Percentage = "percentage-token", t.Semicolon = "semicolon-token", t.String = "string-token", t.URL = "url-token", t.Whitespace = "whitespace-token", t.OpenParen = "(-token", t.CloseParen = ")-token", t.OpenSquare = "[-token", t.CloseSquare = "]-token", t.OpenCurly = "{-token", t.CloseCurly = "}-token", t.UnicodeRange = "unicode-range-token";
|
|
769
|
-
})(a || (a = {})), function(t) {
|
|
769
|
+
})(a || (a = {})), (function(t) {
|
|
770
770
|
t.Integer = "integer", t.Number = "number";
|
|
771
|
-
}(l || (l = {})), function(t) {
|
|
771
|
+
})(l || (l = {})), (function(t) {
|
|
772
772
|
t.Unrestricted = "unrestricted", t.ID = "id";
|
|
773
|
-
}(
|
|
773
|
+
})(ke || (ke = {}));
|
|
774
774
|
class St {
|
|
775
775
|
constructor(e) {
|
|
776
776
|
C(this, "cursor", 0);
|
|
@@ -800,34 +800,34 @@ function At(t, e) {
|
|
|
800
800
|
const o = e.readCodePoint();
|
|
801
801
|
if (o === void 0) {
|
|
802
802
|
const i = [a.String, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }];
|
|
803
|
-
return t.onParseError(new J(
|
|
803
|
+
return t.onParseError(new J(V.UnexpectedEOFInString, e.representationStart, e.representationEnd, ["4.3.5. Consume a string token", "Unexpected EOF"], i)), i;
|
|
804
804
|
}
|
|
805
|
-
if (
|
|
805
|
+
if (Ee(o)) {
|
|
806
806
|
e.unreadCodePoint();
|
|
807
807
|
const i = [a.BadString, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, void 0];
|
|
808
|
-
return t.onParseError(new J(
|
|
808
|
+
return t.onParseError(new J(V.UnexpectedNewLineInString, e.representationStart, e.source.codePointAt(e.cursor) === ee && e.source.codePointAt(e.cursor + 1) === te ? e.representationEnd + 2 : e.representationEnd + 1, ["4.3.5. Consume a string token", "Unexpected newline"], i)), i;
|
|
809
809
|
}
|
|
810
810
|
if (o === r) return [a.String, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }];
|
|
811
|
-
if (o !== 92) o === 0 || oe(o) ? n += String.fromCodePoint(
|
|
811
|
+
if (o !== 92) o === 0 || oe(o) ? n += String.fromCodePoint(Y) : n += String.fromCodePoint(o);
|
|
812
812
|
else {
|
|
813
813
|
if (e.source.codePointAt(e.cursor) === void 0) continue;
|
|
814
|
-
if (
|
|
814
|
+
if (Ee(e.source.codePointAt(e.cursor) ?? -1)) {
|
|
815
815
|
e.source.codePointAt(e.cursor) === ee && e.source.codePointAt(e.cursor + 1) === te && e.advanceCodePoint(), e.advanceCodePoint();
|
|
816
816
|
continue;
|
|
817
817
|
}
|
|
818
|
-
n += String.fromCodePoint(
|
|
818
|
+
n += String.fromCodePoint(Se(t, e));
|
|
819
819
|
}
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
822
|
function Dt(t) {
|
|
823
823
|
return !(t.length !== 3 || t[0] !== 117 && t[0] !== 85 || t[1] !== 114 && t[1] !== 82 || t[2] !== 108 && t[2] !== 76);
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function we(t, e) {
|
|
826
826
|
for (; ; ) {
|
|
827
827
|
const n = e.source.codePointAt(e.cursor);
|
|
828
828
|
if (n === void 0) return;
|
|
829
829
|
if (n === 41) return void e.advanceCodePoint();
|
|
830
|
-
ce(e) ? (e.advanceCodePoint(),
|
|
830
|
+
ce(e) ? (e.advanceCodePoint(), Se(t, e)) : e.advanceCodePoint();
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
833
|
function Bt(t, e) {
|
|
@@ -836,38 +836,38 @@ function Bt(t, e) {
|
|
|
836
836
|
for (; ; ) {
|
|
837
837
|
if (e.source.codePointAt(e.cursor) === void 0) {
|
|
838
838
|
const i = [a.URL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }];
|
|
839
|
-
return t.onParseError(new J(
|
|
839
|
+
return t.onParseError(new J(V.UnexpectedEOFInURL, e.representationStart, e.representationEnd, ["4.3.6. Consume a url token", "Unexpected EOF"], i)), i;
|
|
840
840
|
}
|
|
841
841
|
if (e.source.codePointAt(e.cursor) === 41) return e.advanceCodePoint(), [a.URL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }];
|
|
842
842
|
if (Q(e.source.codePointAt(e.cursor) ?? -1)) {
|
|
843
843
|
for (e.advanceCodePoint(); Q(e.source.codePointAt(e.cursor) ?? -1); ) e.advanceCodePoint();
|
|
844
844
|
if (e.source.codePointAt(e.cursor) === void 0) {
|
|
845
845
|
const i = [a.URL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }];
|
|
846
|
-
return t.onParseError(new J(
|
|
846
|
+
return t.onParseError(new J(V.UnexpectedEOFInURL, e.representationStart, e.representationEnd, ["4.3.6. Consume a url token", "Consume as much whitespace as possible", "Unexpected EOF"], i)), i;
|
|
847
847
|
}
|
|
848
|
-
return e.source.codePointAt(e.cursor) === 41 ? (e.advanceCodePoint(), [a.URL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }]) : (
|
|
848
|
+
return e.source.codePointAt(e.cursor) === 41 ? (e.advanceCodePoint(), [a.URL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: n }]) : (we(t, e), [a.BadURL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, void 0]);
|
|
849
849
|
}
|
|
850
850
|
const o = e.source.codePointAt(e.cursor);
|
|
851
851
|
if (o === 34 || o === 39 || o === 40 || (r = o ?? -1) === 11 || r === 127 || 0 <= r && r <= 8 || 14 <= r && r <= 31) {
|
|
852
|
-
|
|
852
|
+
we(t, e);
|
|
853
853
|
const i = [a.BadURL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, void 0];
|
|
854
|
-
return t.onParseError(new J(
|
|
854
|
+
return t.onParseError(new J(V.UnexpectedCharacterInURL, e.representationStart, e.representationEnd, ["4.3.6. Consume a url token", `Unexpected U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point`], i)), i;
|
|
855
855
|
}
|
|
856
856
|
if (o === 92) {
|
|
857
857
|
if (ce(e)) {
|
|
858
|
-
e.advanceCodePoint(), n += String.fromCodePoint(
|
|
858
|
+
e.advanceCodePoint(), n += String.fromCodePoint(Se(t, e));
|
|
859
859
|
continue;
|
|
860
860
|
}
|
|
861
|
-
|
|
861
|
+
we(t, e);
|
|
862
862
|
const i = [a.BadURL, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, void 0];
|
|
863
|
-
return t.onParseError(new J(
|
|
863
|
+
return t.onParseError(new J(V.InvalidEscapeSequenceInURL, e.representationStart, e.representationEnd, ["4.3.6. Consume a url token", "U+005C REVERSE SOLIDUS (\\)", "The input stream does not start with a valid escape sequence"], i)), i;
|
|
864
864
|
}
|
|
865
|
-
e.source.codePointAt(e.cursor) === 0 || oe(e.source.codePointAt(e.cursor) ?? -1) ? (n += String.fromCodePoint(
|
|
865
|
+
e.source.codePointAt(e.cursor) === 0 || oe(e.source.codePointAt(e.cursor) ?? -1) ? (n += String.fromCodePoint(Y), e.advanceCodePoint()) : (n += e.source[e.cursor], e.advanceCodePoint());
|
|
866
866
|
}
|
|
867
867
|
var r;
|
|
868
868
|
}
|
|
869
|
-
function
|
|
870
|
-
const n =
|
|
869
|
+
function Ie(t, e) {
|
|
870
|
+
const n = Ae(t, e);
|
|
871
871
|
if (e.source.codePointAt(e.cursor) !== 40) return [a.Ident, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: String.fromCodePoint(...n) }];
|
|
872
872
|
if (Dt(n)) {
|
|
873
873
|
e.advanceCodePoint();
|
|
@@ -887,15 +887,15 @@ function xe(t, e) {
|
|
|
887
887
|
return e.advanceCodePoint(), [a.Function, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { value: String.fromCodePoint(...n) }];
|
|
888
888
|
}
|
|
889
889
|
function Ft(t) {
|
|
890
|
-
return !(t.source.codePointAt(t.cursor) !== 117 && t.source.codePointAt(t.cursor) !== 85 || t.source.codePointAt(t.cursor + 1) !== ne || t.source.codePointAt(t.cursor + 2) !== 63 && !
|
|
890
|
+
return !(t.source.codePointAt(t.cursor) !== 117 && t.source.codePointAt(t.cursor) !== 85 || t.source.codePointAt(t.cursor + 1) !== ne || t.source.codePointAt(t.cursor + 2) !== 63 && !_(t.source.codePointAt(t.cursor + 2) ?? -1));
|
|
891
891
|
}
|
|
892
892
|
function Nt(t, e) {
|
|
893
893
|
e.advanceCodePoint(2);
|
|
894
894
|
const n = [], r = [];
|
|
895
895
|
let o;
|
|
896
|
-
for (; (o = e.source.codePointAt(e.cursor)) !== void 0 && n.length < 6 &&
|
|
896
|
+
for (; (o = e.source.codePointAt(e.cursor)) !== void 0 && n.length < 6 && _(o); ) n.push(o), e.advanceCodePoint();
|
|
897
897
|
for (; (o = e.source.codePointAt(e.cursor)) !== void 0 && n.length < 6 && o === 63; ) r.length === 0 && r.push(...n), n.push(48), r.push(70), e.advanceCodePoint();
|
|
898
|
-
if (!r.length && e.source.codePointAt(e.cursor) ===
|
|
898
|
+
if (!r.length && e.source.codePointAt(e.cursor) === b && _(e.source.codePointAt(e.cursor + 1) ?? -1)) for (e.advanceCodePoint(); (o = e.source.codePointAt(e.cursor)) !== void 0 && r.length < 6 && _(o); ) r.push(o), e.advanceCodePoint();
|
|
899
899
|
if (!r.length) {
|
|
900
900
|
const u = parseInt(String.fromCodePoint(...n), 16);
|
|
901
901
|
return [a.UnicodeRange, e.source.slice(e.representationStart, e.representationEnd + 1), e.representationStart, e.representationEnd, { startOfRange: u, endOfRange: u }];
|
|
@@ -916,8 +916,8 @@ function It(t, e) {
|
|
|
916
916
|
if (u === void 0) return [a.EOF, "", -1, -1, void 0];
|
|
917
917
|
if (u === 47 && mt(o)) return Et(i, o);
|
|
918
918
|
if (r && (u === 117 || u === 85) && Ft(o)) return Nt(0, o);
|
|
919
|
-
if (re(u)) return
|
|
920
|
-
if (R(u)) return
|
|
919
|
+
if (re(u)) return Ie(i, o);
|
|
920
|
+
if (R(u)) return Ne(i, o);
|
|
921
921
|
switch (u) {
|
|
922
922
|
case 44:
|
|
923
923
|
return o.advanceCodePoint(), [a.Comma, ",", o.representationStart, o.representationEnd, void 0];
|
|
@@ -944,28 +944,28 @@ function It(t, e) {
|
|
|
944
944
|
return Pt(i, o);
|
|
945
945
|
case ne:
|
|
946
946
|
case 46:
|
|
947
|
-
return $e(o) ?
|
|
947
|
+
return $e(o) ? Ne(i, o) : (o.advanceCodePoint(), [a.Delim, o.source[o.representationStart], o.representationStart, o.representationEnd, { value: o.source[o.representationStart] }]);
|
|
948
948
|
case te:
|
|
949
949
|
case ee:
|
|
950
950
|
case 12:
|
|
951
951
|
case 9:
|
|
952
952
|
case 32:
|
|
953
953
|
return bt(o);
|
|
954
|
-
case
|
|
955
|
-
return $e(o) ?
|
|
954
|
+
case b:
|
|
955
|
+
return $e(o) ? Ne(i, o) : ht(o) ? (o.advanceCodePoint(3), [a.CDC, "-->", o.representationStart, o.representationEnd, void 0]) : Pe(0, o) ? Ie(i, o) : (o.advanceCodePoint(), [a.Delim, "-", o.representationStart, o.representationEnd, { value: "-" }]);
|
|
956
956
|
case 60:
|
|
957
957
|
return dt(o) ? (o.advanceCodePoint(4), [a.CDO, "<!--", o.representationStart, o.representationEnd, void 0]) : (o.advanceCodePoint(), [a.Delim, "<", o.representationStart, o.representationEnd, { value: "<" }]);
|
|
958
958
|
case 64:
|
|
959
|
-
if (o.advanceCodePoint(),
|
|
960
|
-
const c =
|
|
959
|
+
if (o.advanceCodePoint(), Pe(0, o)) {
|
|
960
|
+
const c = Ae(i, o);
|
|
961
961
|
return [a.AtKeyword, o.source.slice(o.representationStart, o.representationEnd + 1), o.representationStart, o.representationEnd, { value: String.fromCodePoint(...c) }];
|
|
962
962
|
}
|
|
963
963
|
return [a.Delim, "@", o.representationStart, o.representationEnd, { value: "@" }];
|
|
964
964
|
case 92: {
|
|
965
|
-
if (ce(o)) return
|
|
965
|
+
if (ce(o)) return Ie(i, o);
|
|
966
966
|
o.advanceCodePoint();
|
|
967
967
|
const c = [a.Delim, "\\", o.representationStart, o.representationEnd, { value: "\\" }];
|
|
968
|
-
return i.onParseError(new J(
|
|
968
|
+
return i.onParseError(new J(V.InvalidEscapeSequenceAfterBackslash, o.representationStart, o.representationEnd, ["4.3.1. Consume a token", "U+005C REVERSE SOLIDUS (\\)", "The input stream does not start with a valid escape sequence"], c)), c;
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
971
|
return o.advanceCodePoint(), [a.Delim, o.source[o.representationStart], o.representationStart, o.representationEnd, { value: o.source[o.representationStart] }];
|
|
@@ -975,31 +975,39 @@ function It(t, e) {
|
|
|
975
975
|
}
|
|
976
976
|
function xt() {
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function Ot(t, e) {
|
|
979
979
|
const n = [];
|
|
980
980
|
for (const u of e) n.push(u.codePointAt(0));
|
|
981
|
-
const r =
|
|
982
|
-
r[0] === 101 &&
|
|
981
|
+
const r = Tt(n);
|
|
982
|
+
r[0] === 101 && Oe(r, 0, r[0]);
|
|
983
983
|
const o = String.fromCodePoint(...r), i = t[4].signCharacter === "+" ? t[4].signCharacter : "", s = t[4].value.toString();
|
|
984
984
|
t[1] = `${i}${s}${o}`, t[4].unit = e;
|
|
985
985
|
}
|
|
986
|
-
function
|
|
986
|
+
function Tt(t) {
|
|
987
987
|
let e = 0;
|
|
988
|
-
t[0] ===
|
|
989
|
-
|
|
988
|
+
if (t[0] === 0) t.splice(0, 1, Y), e = 1;
|
|
989
|
+
else if (t[0] === b && t[1] === b) e = 2;
|
|
990
|
+
else if (t[0] === b && t[1]) e = 2, re(t[1]) || (e += Oe(t, 1, t[1]));
|
|
991
|
+
else {
|
|
992
|
+
if (t[0] === b && !t[1]) return [92, t[0]];
|
|
993
|
+
re(t[0]) ? e = 1 : (e = 1, e += Oe(t, 0, t[0]));
|
|
994
|
+
}
|
|
995
|
+
for (let n = e; n < t.length; n++) t[n] !== 0 ? Me(t[n]) || (n += Mt(t, n, t[n])) : (t.splice(n, 1, Y), n++);
|
|
990
996
|
return t;
|
|
991
997
|
}
|
|
992
|
-
function
|
|
998
|
+
function Mt(t, e, n) {
|
|
999
|
+
return t.splice(e, 1, 92, n), 1;
|
|
1000
|
+
}
|
|
1001
|
+
function Oe(t, e, n) {
|
|
993
1002
|
const r = n.toString(16), o = [];
|
|
994
|
-
for (const
|
|
995
|
-
|
|
996
|
-
return e === t.length - 1 || i && K(i) ? (t.splice(e, 1, 92, ...o, 32), 1 + o.length) : (t.splice(e, 1, 92, ...o), o.length);
|
|
1003
|
+
for (const i of r) o.push(i.codePointAt(0));
|
|
1004
|
+
return t.splice(e, 1, 92, ...o, 32), 1 + o.length;
|
|
997
1005
|
}
|
|
998
|
-
const
|
|
1006
|
+
const Rt = Object.values(a);
|
|
999
1007
|
function Ye(t) {
|
|
1000
|
-
return !!Array.isArray(t) && !(t.length < 4) && !!
|
|
1008
|
+
return !!Array.isArray(t) && !(t.length < 4) && !!Rt.includes(t[0]) && typeof t[1] == "string" && typeof t[2] == "number" && typeof t[3] == "number";
|
|
1001
1009
|
}
|
|
1002
|
-
function
|
|
1010
|
+
function S(t) {
|
|
1003
1011
|
if (!t) return !1;
|
|
1004
1012
|
switch (t[0]) {
|
|
1005
1013
|
case a.Dimension:
|
|
@@ -1032,10 +1040,10 @@ function qe(t) {
|
|
|
1032
1040
|
function y(t) {
|
|
1033
1041
|
return !!t && t[0] === a.Dimension;
|
|
1034
1042
|
}
|
|
1035
|
-
function
|
|
1043
|
+
function Z(t) {
|
|
1036
1044
|
return !!t && t[0] === a.EOF;
|
|
1037
1045
|
}
|
|
1038
|
-
function
|
|
1046
|
+
function Ut(t) {
|
|
1039
1047
|
return !!t && t[0] === a.Function;
|
|
1040
1048
|
}
|
|
1041
1049
|
function ve(t) {
|
|
@@ -1053,13 +1061,13 @@ function Re(t) {
|
|
|
1053
1061
|
function Qe(t) {
|
|
1054
1062
|
return !!t && t[0] === a.OpenParen;
|
|
1055
1063
|
}
|
|
1056
|
-
function
|
|
1064
|
+
function Wt(t) {
|
|
1057
1065
|
return !!t && t[0] === a.CloseParen;
|
|
1058
1066
|
}
|
|
1059
|
-
function
|
|
1067
|
+
function Lt(t) {
|
|
1060
1068
|
return !!t && t[0] === a.OpenSquare;
|
|
1061
1069
|
}
|
|
1062
|
-
function
|
|
1070
|
+
function $t(t) {
|
|
1063
1071
|
return !!t && t[0] === a.OpenCurly;
|
|
1064
1072
|
}
|
|
1065
1073
|
var U;
|
|
@@ -1073,12 +1081,12 @@ function Xe(t) {
|
|
|
1073
1081
|
}
|
|
1074
1082
|
function Ue(t, e) {
|
|
1075
1083
|
const n = e[0];
|
|
1076
|
-
if (Qe(n) ||
|
|
1077
|
-
const r =
|
|
1084
|
+
if (Qe(n) || $t(n) || Lt(n)) {
|
|
1085
|
+
const r = zt(t, e);
|
|
1078
1086
|
return { advance: r.advance, node: r.node };
|
|
1079
1087
|
}
|
|
1080
|
-
if (
|
|
1081
|
-
const r =
|
|
1088
|
+
if (Ut(n)) {
|
|
1089
|
+
const r = qt(t, e);
|
|
1082
1090
|
return { advance: r.advance, node: r.node };
|
|
1083
1091
|
}
|
|
1084
1092
|
if (Re(n)) {
|
|
@@ -1086,7 +1094,7 @@ function Ue(t, e) {
|
|
|
1086
1094
|
return { advance: r.advance, node: r.node };
|
|
1087
1095
|
}
|
|
1088
1096
|
if (Ke(n)) {
|
|
1089
|
-
const r =
|
|
1097
|
+
const r = Ht(t, e);
|
|
1090
1098
|
return { advance: r.advance, node: r.node };
|
|
1091
1099
|
}
|
|
1092
1100
|
return { advance: 1, node: new d(n) };
|
|
@@ -1116,7 +1124,7 @@ class _e {
|
|
|
1116
1124
|
}
|
|
1117
1125
|
}
|
|
1118
1126
|
walk(e, n) {
|
|
1119
|
-
this.value.length !== 0 && this.forEach((r, o) => e(r, o) !== !1 && (!("walk" in r.node) || !this.value.includes(r.node) || r.node.walk(e, r.state) !== !1) && void 0, n);
|
|
1127
|
+
this.value.length !== 0 && this.forEach(((r, o) => e(r, o) !== !1 && (!("walk" in r.node) || !this.value.includes(r.node) || r.node.walk(e, r.state) !== !1) && void 0), n);
|
|
1120
1128
|
}
|
|
1121
1129
|
}
|
|
1122
1130
|
class F extends _e {
|
|
@@ -1131,17 +1139,17 @@ class F extends _e {
|
|
|
1131
1139
|
return this.name[4].value;
|
|
1132
1140
|
}
|
|
1133
1141
|
normalize() {
|
|
1134
|
-
|
|
1142
|
+
Z(this.endToken) && (this.endToken = [a.CloseParen, ")", -1, -1, void 0]);
|
|
1135
1143
|
}
|
|
1136
1144
|
tokens() {
|
|
1137
|
-
return
|
|
1145
|
+
return Z(this.endToken) ? [this.name, ...this.value.flatMap(((n) => n.tokens()))] : [this.name, ...this.value.flatMap(((n) => n.tokens())), this.endToken];
|
|
1138
1146
|
}
|
|
1139
1147
|
toString() {
|
|
1140
|
-
const n = this.value.map((r) => Ye(r) ? j(r) : r.toString()).join("");
|
|
1148
|
+
const n = this.value.map(((r) => Ye(r) ? j(r) : r.toString())).join("");
|
|
1141
1149
|
return j(this.name) + n + j(this.endToken);
|
|
1142
1150
|
}
|
|
1143
1151
|
toJSON() {
|
|
1144
|
-
return { type: this.type, name: this.getName(), tokens: this.tokens(), value: this.value.map((n) => n.toJSON()) };
|
|
1152
|
+
return { type: this.type, name: this.getName(), tokens: this.tokens(), value: this.value.map(((n) => n.toJSON())) };
|
|
1145
1153
|
}
|
|
1146
1154
|
isFunctionNode() {
|
|
1147
1155
|
return F.isFunctionNode(this);
|
|
@@ -1150,13 +1158,13 @@ class F extends _e {
|
|
|
1150
1158
|
return !!n && n instanceof F && n.type === U.Function;
|
|
1151
1159
|
}
|
|
1152
1160
|
}
|
|
1153
|
-
function
|
|
1161
|
+
function qt(t, e) {
|
|
1154
1162
|
const n = [];
|
|
1155
1163
|
let r = 1;
|
|
1156
1164
|
for (; ; ) {
|
|
1157
1165
|
const o = e[r];
|
|
1158
|
-
if (!o ||
|
|
1159
|
-
if (
|
|
1166
|
+
if (!o || Z(o)) return t.onParseError(new be("Unexpected EOF while consuming a function.", e[0][2], e[e.length - 1][3], ["5.4.9. Consume a function", "Unexpected EOF"])), { advance: e.length, node: new F(e[0], o, n) };
|
|
1167
|
+
if (Wt(o)) return { advance: r + 1, node: new F(e[0], o, n) };
|
|
1160
1168
|
if (Ze(o)) {
|
|
1161
1169
|
const s = tt(t, e.slice(r));
|
|
1162
1170
|
r += s.advance, n.push(...s.nodes);
|
|
@@ -1175,20 +1183,20 @@ class ae extends _e {
|
|
|
1175
1183
|
this.startToken = n, this.endToken = r, this.value = o;
|
|
1176
1184
|
}
|
|
1177
1185
|
normalize() {
|
|
1178
|
-
if (
|
|
1186
|
+
if (Z(this.endToken)) {
|
|
1179
1187
|
const n = yt(this.startToken);
|
|
1180
1188
|
n && (this.endToken = n);
|
|
1181
1189
|
}
|
|
1182
1190
|
}
|
|
1183
1191
|
tokens() {
|
|
1184
|
-
return
|
|
1192
|
+
return Z(this.endToken) ? [this.startToken, ...this.value.flatMap(((n) => n.tokens()))] : [this.startToken, ...this.value.flatMap(((n) => n.tokens())), this.endToken];
|
|
1185
1193
|
}
|
|
1186
1194
|
toString() {
|
|
1187
|
-
const n = this.value.map((r) => Ye(r) ? j(r) : r.toString()).join("");
|
|
1195
|
+
const n = this.value.map(((r) => Ye(r) ? j(r) : r.toString())).join("");
|
|
1188
1196
|
return j(this.startToken) + n + j(this.endToken);
|
|
1189
1197
|
}
|
|
1190
1198
|
toJSON() {
|
|
1191
|
-
return { type: this.type, startToken: this.startToken, tokens: this.tokens(), value: this.value.map((n) => n.toJSON()) };
|
|
1199
|
+
return { type: this.type, startToken: this.startToken, tokens: this.tokens(), value: this.value.map(((n) => n.toJSON())) };
|
|
1192
1200
|
}
|
|
1193
1201
|
isSimpleBlockNode() {
|
|
1194
1202
|
return ae.isSimpleBlockNode(this);
|
|
@@ -1197,14 +1205,14 @@ class ae extends _e {
|
|
|
1197
1205
|
return !!n && n instanceof ae && n.type === U.SimpleBlock;
|
|
1198
1206
|
}
|
|
1199
1207
|
}
|
|
1200
|
-
function
|
|
1208
|
+
function zt(t, e) {
|
|
1201
1209
|
const n = Ct(e[0][0]);
|
|
1202
1210
|
if (!n) throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");
|
|
1203
1211
|
const r = [];
|
|
1204
1212
|
let o = 1;
|
|
1205
1213
|
for (; ; ) {
|
|
1206
1214
|
const i = e[o];
|
|
1207
|
-
if (!i ||
|
|
1215
|
+
if (!i || Z(i)) return t.onParseError(new be("Unexpected EOF while consuming a simple block.", e[0][2], e[e.length - 1][3], ["5.4.8. Consume a simple block", "Unexpected EOF"])), { advance: e.length, node: new ae(e[0], i, r) };
|
|
1208
1216
|
if (i[0] === n) return { advance: o + 1, node: new ae(e[0], i, r) };
|
|
1209
1217
|
if (Ze(i)) {
|
|
1210
1218
|
const u = tt(t, e.slice(o));
|
|
@@ -1215,7 +1223,7 @@ function qt(t, e) {
|
|
|
1215
1223
|
o += s.advance, r.push(s.node);
|
|
1216
1224
|
}
|
|
1217
1225
|
}
|
|
1218
|
-
class
|
|
1226
|
+
class O {
|
|
1219
1227
|
constructor(e) {
|
|
1220
1228
|
C(this, "type", U.Whitespace);
|
|
1221
1229
|
C(this, "value");
|
|
@@ -1231,17 +1239,17 @@ class T {
|
|
|
1231
1239
|
return { type: this.type, tokens: this.tokens() };
|
|
1232
1240
|
}
|
|
1233
1241
|
isWhitespaceNode() {
|
|
1234
|
-
return
|
|
1242
|
+
return O.isWhitespaceNode(this);
|
|
1235
1243
|
}
|
|
1236
1244
|
static isWhitespaceNode(e) {
|
|
1237
|
-
return !!e && e instanceof
|
|
1245
|
+
return !!e && e instanceof O && e.type === U.Whitespace;
|
|
1238
1246
|
}
|
|
1239
1247
|
}
|
|
1240
1248
|
function et(t, e) {
|
|
1241
1249
|
let n = 0;
|
|
1242
1250
|
for (; ; ) {
|
|
1243
1251
|
const r = e[n];
|
|
1244
|
-
if (!Re(r)) return { advance: n, node: new
|
|
1252
|
+
if (!Re(r)) return { advance: n, node: new O(e.slice(0, n)) };
|
|
1245
1253
|
n++;
|
|
1246
1254
|
}
|
|
1247
1255
|
}
|
|
@@ -1267,7 +1275,7 @@ class se {
|
|
|
1267
1275
|
return !!e && e instanceof se && e.type === U.Comment;
|
|
1268
1276
|
}
|
|
1269
1277
|
}
|
|
1270
|
-
function
|
|
1278
|
+
function Ht(t, e) {
|
|
1271
1279
|
return { advance: 1, node: new se(e[0]) };
|
|
1272
1280
|
}
|
|
1273
1281
|
function tt(t, e) {
|
|
@@ -1307,11 +1315,11 @@ function Vt(t, e) {
|
|
|
1307
1315
|
const n = { onParseError: (e == null ? void 0 : e.onParseError) ?? (() => {
|
|
1308
1316
|
}) }, r = [...t];
|
|
1309
1317
|
if (t.length === 0) return [];
|
|
1310
|
-
|
|
1318
|
+
Z(r[r.length - 1]) && r.push([a.EOF, "", r[r.length - 1][2], r[r.length - 1][3], void 0]);
|
|
1311
1319
|
const o = [];
|
|
1312
1320
|
let i = [], s = 0;
|
|
1313
1321
|
for (; ; ) {
|
|
1314
|
-
if (!r[s] ||
|
|
1322
|
+
if (!r[s] || Z(r[s])) return i.length && o.push(i), o;
|
|
1315
1323
|
if (ie(r[s])) {
|
|
1316
1324
|
o.push(i), i = [], s++;
|
|
1317
1325
|
continue;
|
|
@@ -1320,7 +1328,7 @@ function Vt(t, e) {
|
|
|
1320
1328
|
i.push(u.node), s += u.advance;
|
|
1321
1329
|
}
|
|
1322
1330
|
}
|
|
1323
|
-
function
|
|
1331
|
+
function jt(t, e, n) {
|
|
1324
1332
|
if (t.length === 0) return;
|
|
1325
1333
|
const r = Xe(t);
|
|
1326
1334
|
let o = 0;
|
|
@@ -1330,26 +1338,26 @@ function Ht(t, e, n) {
|
|
|
1330
1338
|
if (o = r(t, i, o), o === -1) break;
|
|
1331
1339
|
}
|
|
1332
1340
|
}
|
|
1333
|
-
function
|
|
1334
|
-
t.length !== 0 &&
|
|
1341
|
+
function Gt(t, e, n) {
|
|
1342
|
+
t.length !== 0 && jt(t, ((r, o) => e(r, o) !== !1 && (!("walk" in r.node) || !t.includes(r.node) || r.node.walk(e, r.state) !== !1) && void 0));
|
|
1335
1343
|
}
|
|
1336
|
-
function
|
|
1344
|
+
function Jt(t, e) {
|
|
1337
1345
|
for (let n = 0; n < t.length; n++)
|
|
1338
|
-
|
|
1346
|
+
Gt(t[n], ((r, o) => {
|
|
1339
1347
|
if (typeof o != "number") return;
|
|
1340
1348
|
const i = e(r.node);
|
|
1341
1349
|
i && (Array.isArray(i) ? r.parent.value.splice(o, 1, ...i) : r.parent.value.splice(o, 1, i));
|
|
1342
|
-
});
|
|
1350
|
+
}));
|
|
1343
1351
|
return t;
|
|
1344
1352
|
}
|
|
1345
|
-
function
|
|
1353
|
+
function Yt(t) {
|
|
1346
1354
|
return ae.isSimpleBlockNode(t);
|
|
1347
1355
|
}
|
|
1348
1356
|
function le(t) {
|
|
1349
1357
|
return F.isFunctionNode(t);
|
|
1350
1358
|
}
|
|
1351
1359
|
function nt(t) {
|
|
1352
|
-
return
|
|
1360
|
+
return O.isWhitespaceNode(t);
|
|
1353
1361
|
}
|
|
1354
1362
|
function rt(t) {
|
|
1355
1363
|
return se.isCommentNode(t);
|
|
@@ -1360,23 +1368,23 @@ function X(t) {
|
|
|
1360
1368
|
function m(t) {
|
|
1361
1369
|
return d.isTokenNode(t);
|
|
1362
1370
|
}
|
|
1363
|
-
const
|
|
1364
|
-
function
|
|
1365
|
-
return t.replace(
|
|
1371
|
+
const Zt = /[A-Z]/g;
|
|
1372
|
+
function T(t) {
|
|
1373
|
+
return t.replace(Zt, ((e) => String.fromCharCode(e.charCodeAt(0) + 32)));
|
|
1366
1374
|
}
|
|
1367
|
-
const
|
|
1375
|
+
const Kt = /* @__PURE__ */ new Map([["cm", (t) => t], ["mm", (t) => 10 * t], ["q", (t) => 40 * t], ["in", (t) => t / 2.54], ["pc", (t) => t / 2.54 * 6], ["pt", (t) => t / 2.54 * 72], ["px", (t) => t / 2.54 * 96]]), De = /* @__PURE__ */ new Map([["deg", (t) => t], ["grad", (t) => t / 0.9], ["rad", (t) => t / 180 * Math.PI], ["turn", (t) => t / 360]]), ge = /* @__PURE__ */ new Map([["deg", (t) => 0.9 * t], ["grad", (t) => t], ["rad", (t) => 0.9 * t / 180 * Math.PI], ["turn", (t) => 0.9 * t / 360]]), Qt = /* @__PURE__ */ new Map([["hz", (t) => t], ["khz", (t) => t / 1e3]]), Xt = /* @__PURE__ */ new Map([["cm", (t) => 2.54 * t], ["mm", (t) => 25.4 * t], ["q", (t) => 25.4 * t * 4], ["in", (t) => t], ["pc", (t) => 6 * t], ["pt", (t) => 72 * t], ["px", (t) => 96 * t]]), _t = /* @__PURE__ */ new Map([["hz", (t) => 1e3 * t], ["khz", (t) => t]]), en = /* @__PURE__ */ new Map([["cm", (t) => t / 10], ["mm", (t) => t], ["q", (t) => 4 * t], ["in", (t) => t / 25.4], ["pc", (t) => t / 25.4 * 6], ["pt", (t) => t / 25.4 * 72], ["px", (t) => t / 25.4 * 96]]), tn = /* @__PURE__ */ new Map([["ms", (t) => t], ["s", (t) => t / 1e3]]), nn = /* @__PURE__ */ new Map([["cm", (t) => t / 6 * 2.54], ["mm", (t) => t / 6 * 25.4], ["q", (t) => t / 6 * 25.4 * 4], ["in", (t) => t / 6], ["pc", (t) => t], ["pt", (t) => t / 6 * 72], ["px", (t) => t / 6 * 96]]), rn = /* @__PURE__ */ new Map([["cm", (t) => t / 72 * 2.54], ["mm", (t) => t / 72 * 25.4], ["q", (t) => t / 72 * 25.4 * 4], ["in", (t) => t / 72], ["pc", (t) => t / 72 * 6], ["pt", (t) => t], ["px", (t) => t / 72 * 96]]), on = /* @__PURE__ */ new Map([["cm", (t) => t / 96 * 2.54], ["mm", (t) => t / 96 * 25.4], ["q", (t) => t / 96 * 25.4 * 4], ["in", (t) => t / 96], ["pc", (t) => t / 96 * 6], ["pt", (t) => t / 96 * 72], ["px", (t) => t]]), an = /* @__PURE__ */ new Map([["cm", (t) => t / 4 / 10], ["mm", (t) => t / 4], ["q", (t) => t], ["in", (t) => t / 4 / 25.4], ["pc", (t) => t / 4 / 25.4 * 6], ["pt", (t) => t / 4 / 25.4 * 72], ["px", (t) => t / 4 / 25.4 * 96]]), ot = /* @__PURE__ */ new Map([["deg", (t) => 180 * t / Math.PI], ["grad", (t) => 180 * t / Math.PI / 0.9], ["rad", (t) => t], ["turn", (t) => 180 * t / Math.PI / 360]]), sn = /* @__PURE__ */ new Map([["ms", (t) => 1e3 * t], ["s", (t) => t]]), me = /* @__PURE__ */ new Map([["deg", (t) => 360 * t], ["grad", (t) => 360 * t / 0.9], ["rad", (t) => 360 * t / 180 * Math.PI], ["turn", (t) => t]]), un = /* @__PURE__ */ new Map([["cm", Kt], ["mm", en], ["q", an], ["in", Xt], ["pc", nn], ["pt", rn], ["px", on], ["ms", tn], ["s", sn], ["deg", De], ["grad", ge], ["rad", ot], ["turn", me], ["hz", Qt], ["khz", _t]]);
|
|
1368
1376
|
function M(t, e) {
|
|
1369
1377
|
if (!y(t) || !y(e)) return e;
|
|
1370
|
-
const n =
|
|
1378
|
+
const n = T(t[4].unit), r = T(e[4].unit);
|
|
1371
1379
|
if (n === r) return e;
|
|
1372
|
-
const o =
|
|
1380
|
+
const o = un.get(r);
|
|
1373
1381
|
if (!o) return e;
|
|
1374
1382
|
const i = o.get(n);
|
|
1375
1383
|
if (!i) return e;
|
|
1376
1384
|
const s = i(e[4].value), u = [a.Dimension, "", e[2], e[3], { ...e[4], signCharacter: s < 0 ? "-" : void 0, type: Number.isInteger(s) ? l.Integer : l.Number, value: s }];
|
|
1377
|
-
return
|
|
1385
|
+
return Ot(u, t[4].unit), u;
|
|
1378
1386
|
}
|
|
1379
|
-
function
|
|
1387
|
+
function cn(t) {
|
|
1380
1388
|
if (t.length !== 2) return -1;
|
|
1381
1389
|
const e = t[0].value;
|
|
1382
1390
|
let n = t[1].value;
|
|
@@ -1388,13 +1396,13 @@ function un(t) {
|
|
|
1388
1396
|
const r = e[4].value + n[4].value;
|
|
1389
1397
|
return new d([a.Percentage, r.toString() + "%", e[2], n[3], { value: r }]);
|
|
1390
1398
|
}
|
|
1391
|
-
if (y(e) && y(n) && (n = M(e, n),
|
|
1399
|
+
if (y(e) && y(n) && (n = M(e, n), T(e[4].unit) === T(n[4].unit))) {
|
|
1392
1400
|
const r = e[4].value + n[4].value;
|
|
1393
1401
|
return new d([a.Dimension, r.toString() + e[4].unit, e[2], n[3], { value: r, type: e[4].type === l.Integer && n[4].type === l.Integer ? l.Integer : l.Number, unit: e[4].unit }]);
|
|
1394
1402
|
}
|
|
1395
1403
|
return -1;
|
|
1396
1404
|
}
|
|
1397
|
-
function
|
|
1405
|
+
function ln(t) {
|
|
1398
1406
|
if (t.length !== 2) return -1;
|
|
1399
1407
|
const e = t[0].value, n = t[1].value;
|
|
1400
1408
|
if (g(e) && g(n)) {
|
|
@@ -1411,7 +1419,7 @@ function cn(t) {
|
|
|
1411
1419
|
}
|
|
1412
1420
|
return -1;
|
|
1413
1421
|
}
|
|
1414
|
-
function
|
|
1422
|
+
function K(t) {
|
|
1415
1423
|
return !!t && typeof t == "object" && "inputs" in t && Array.isArray(t.inputs) && "operation" in t;
|
|
1416
1424
|
}
|
|
1417
1425
|
function N(t) {
|
|
@@ -1429,7 +1437,7 @@ function N(t) {
|
|
|
1429
1437
|
}
|
|
1430
1438
|
return t.operation(e);
|
|
1431
1439
|
}
|
|
1432
|
-
function
|
|
1440
|
+
function dn(t) {
|
|
1433
1441
|
if (t.length !== 2) return -1;
|
|
1434
1442
|
const e = t[0].value, n = t[1].value;
|
|
1435
1443
|
if (g(e) && g(n)) {
|
|
@@ -1460,7 +1468,7 @@ function ue(t, e) {
|
|
|
1460
1468
|
if (!m(r)) continue;
|
|
1461
1469
|
const o = r.value;
|
|
1462
1470
|
if (!ve(o)) continue;
|
|
1463
|
-
const i =
|
|
1471
|
+
const i = T(o[4].value);
|
|
1464
1472
|
switch (i) {
|
|
1465
1473
|
case "e":
|
|
1466
1474
|
t.splice(n, 1, new d([a.Number, Math.E.toString(), o[2], o[3], { value: Math.E, type: l.Number }]));
|
|
@@ -1486,51 +1494,51 @@ function ue(t, e) {
|
|
|
1486
1494
|
}
|
|
1487
1495
|
return t;
|
|
1488
1496
|
}
|
|
1489
|
-
function
|
|
1497
|
+
function Be(t) {
|
|
1490
1498
|
if (t.length !== 1) return -1;
|
|
1491
1499
|
const e = t[0].value;
|
|
1492
|
-
return
|
|
1500
|
+
return S(e) ? t[0] : -1;
|
|
1493
1501
|
}
|
|
1494
1502
|
function w(t, e, n) {
|
|
1495
|
-
return y(e) ? he(t, e[4].unit, n) : P(e) ?
|
|
1503
|
+
return y(e) ? he(t, e[4].unit, n) : P(e) ? pn(t, n) : g(e) ? z(t, n) : -1;
|
|
1496
1504
|
}
|
|
1497
1505
|
function he(t, e, n) {
|
|
1498
1506
|
const r = t.tokens();
|
|
1499
|
-
return { inputs: [new d([a.Dimension, n.toString() + e, r[0][2], r[r.length - 1][3], { value: n, type: Number.isInteger(n) ? l.Integer : l.Number, unit: e }])], operation:
|
|
1507
|
+
return { inputs: [new d([a.Dimension, n.toString() + e, r[0][2], r[r.length - 1][3], { value: n, type: Number.isInteger(n) ? l.Integer : l.Number, unit: e }])], operation: Be };
|
|
1500
1508
|
}
|
|
1501
|
-
function
|
|
1509
|
+
function pn(t, e) {
|
|
1502
1510
|
const n = t.tokens();
|
|
1503
|
-
return { inputs: [new d([a.Percentage, e.toString() + "%", n[0][2], n[n.length - 1][3], { value: e }])], operation:
|
|
1511
|
+
return { inputs: [new d([a.Percentage, e.toString() + "%", n[0][2], n[n.length - 1][3], { value: e }])], operation: Be };
|
|
1504
1512
|
}
|
|
1505
1513
|
function z(t, e) {
|
|
1506
1514
|
const n = t.tokens();
|
|
1507
|
-
return { inputs: [new d([a.Number, e.toString(), n[0][2], n[n.length - 1][3], { value: e, type: Number.isInteger(e) ? l.Integer : l.Number }])], operation:
|
|
1515
|
+
return { inputs: [new d([a.Number, e.toString(), n[0][2], n[n.length - 1][3], { value: e, type: Number.isInteger(e) ? l.Integer : l.Number }])], operation: Be };
|
|
1508
1516
|
}
|
|
1509
|
-
function
|
|
1517
|
+
function fn(t, e) {
|
|
1510
1518
|
const n = e.value;
|
|
1511
1519
|
return g(n) ? he(t, "rad", Math.acos(n[4].value)) : -1;
|
|
1512
1520
|
}
|
|
1513
|
-
function
|
|
1521
|
+
function vn(t, e) {
|
|
1514
1522
|
const n = e.value;
|
|
1515
1523
|
return g(n) ? he(t, "rad", Math.asin(n[4].value)) : -1;
|
|
1516
1524
|
}
|
|
1517
|
-
function
|
|
1525
|
+
function gn(t, e) {
|
|
1518
1526
|
const n = e.value;
|
|
1519
1527
|
return g(n) ? he(t, "rad", Math.atan(n[4].value)) : -1;
|
|
1520
1528
|
}
|
|
1521
|
-
function
|
|
1529
|
+
function Fe(t) {
|
|
1522
1530
|
return y(t) || g(t);
|
|
1523
1531
|
}
|
|
1524
1532
|
function We(t) {
|
|
1525
1533
|
if (t.length === 0) return !0;
|
|
1526
1534
|
const e = t[0];
|
|
1527
|
-
if (!
|
|
1535
|
+
if (!S(e)) return !1;
|
|
1528
1536
|
if (t.length === 1) return !0;
|
|
1529
1537
|
if (y(e)) {
|
|
1530
|
-
const n =
|
|
1538
|
+
const n = T(e[4].unit);
|
|
1531
1539
|
for (let r = 1; r < t.length; r++) {
|
|
1532
1540
|
const o = t[r];
|
|
1533
|
-
if (e[0] !== o[0] || n !==
|
|
1541
|
+
if (e[0] !== o[0] || n !== T(o[4].unit)) return !1;
|
|
1534
1542
|
}
|
|
1535
1543
|
return !0;
|
|
1536
1544
|
}
|
|
@@ -1541,36 +1549,36 @@ function We(t) {
|
|
|
1541
1549
|
return !0;
|
|
1542
1550
|
}
|
|
1543
1551
|
function G(t, e) {
|
|
1544
|
-
return !!
|
|
1552
|
+
return !!S(t) && (y(t) ? t[0] === e[0] && T(t[4].unit) === T(e[4].unit) : t[0] === e[0]);
|
|
1545
1553
|
}
|
|
1546
|
-
function
|
|
1554
|
+
function mn(t, e, n) {
|
|
1547
1555
|
const r = e.value;
|
|
1548
|
-
if (!
|
|
1556
|
+
if (!Fe(r)) return -1;
|
|
1549
1557
|
const o = M(r, n.value);
|
|
1550
1558
|
return G(r, o) ? he(t, "rad", Math.atan2(r[4].value, o[4].value)) : -1;
|
|
1551
1559
|
}
|
|
1552
|
-
function
|
|
1560
|
+
function hn(t, e, n) {
|
|
1553
1561
|
const r = e.value;
|
|
1554
|
-
return !
|
|
1562
|
+
return !S(r) || !n.rawPercentages && P(r) ? -1 : w(t, r, Math.abs(r[4].value));
|
|
1555
1563
|
}
|
|
1556
|
-
function
|
|
1564
|
+
function Cn(t, e, n, r, o) {
|
|
1557
1565
|
if (!m(e) || !m(n) || !m(r)) return -1;
|
|
1558
1566
|
const i = e.value;
|
|
1559
|
-
if (!
|
|
1567
|
+
if (!S(i) || !o.rawPercentages && P(i)) return -1;
|
|
1560
1568
|
const s = M(i, n.value);
|
|
1561
1569
|
if (!G(i, s)) return -1;
|
|
1562
1570
|
const u = M(i, r.value);
|
|
1563
1571
|
return G(i, u) ? w(t, i, Math.max(i[4].value, Math.min(s[4].value, u[4].value))) : -1;
|
|
1564
1572
|
}
|
|
1565
|
-
function
|
|
1573
|
+
function yn(t, e) {
|
|
1566
1574
|
const n = e.value;
|
|
1567
|
-
if (!
|
|
1575
|
+
if (!Fe(n)) return -1;
|
|
1568
1576
|
let r = n[4].value;
|
|
1569
1577
|
if (y(n)) switch (n[4].unit.toLowerCase()) {
|
|
1570
1578
|
case "rad":
|
|
1571
1579
|
break;
|
|
1572
1580
|
case "deg":
|
|
1573
|
-
r =
|
|
1581
|
+
r = De.get("rad")(n[4].value);
|
|
1574
1582
|
break;
|
|
1575
1583
|
case "grad":
|
|
1576
1584
|
r = ge.get("rad")(n[4].value);
|
|
@@ -1583,60 +1591,60 @@ function Cn(t, e) {
|
|
|
1583
1591
|
}
|
|
1584
1592
|
return r = Math.cos(r), z(t, r);
|
|
1585
1593
|
}
|
|
1586
|
-
function
|
|
1594
|
+
function En(t, e) {
|
|
1587
1595
|
const n = e.value;
|
|
1588
1596
|
return g(n) ? z(t, Math.exp(n[4].value)) : -1;
|
|
1589
1597
|
}
|
|
1590
|
-
function
|
|
1598
|
+
function Pn(t, e, n) {
|
|
1591
1599
|
if (!e.every(m)) return -1;
|
|
1592
1600
|
const r = e[0].value;
|
|
1593
|
-
if (!
|
|
1594
|
-
const o = e.map((u) => M(r, u.value));
|
|
1601
|
+
if (!S(r) || !n.rawPercentages && P(r)) return -1;
|
|
1602
|
+
const o = e.map(((u) => M(r, u.value)));
|
|
1595
1603
|
if (!We(o)) return -1;
|
|
1596
|
-
const i = o.map((u) => u[4].value), s = Math.hypot(...i);
|
|
1604
|
+
const i = o.map(((u) => u[4].value)), s = Math.hypot(...i);
|
|
1597
1605
|
return w(t, r, s);
|
|
1598
1606
|
}
|
|
1599
1607
|
function ze(t, e, n) {
|
|
1600
1608
|
if (!e.every(m)) return -1;
|
|
1601
1609
|
const r = e[0].value;
|
|
1602
|
-
if (!
|
|
1603
|
-
const o = e.map((u) => M(r, u.value));
|
|
1610
|
+
if (!S(r) || !n.rawPercentages && P(r)) return -1;
|
|
1611
|
+
const o = e.map(((u) => M(r, u.value)));
|
|
1604
1612
|
if (!We(o)) return -1;
|
|
1605
|
-
const i = o.map((u) => u[4].value), s = Math.max(...i);
|
|
1613
|
+
const i = o.map(((u) => u[4].value)), s = Math.max(...i);
|
|
1606
1614
|
return w(t, r, s);
|
|
1607
1615
|
}
|
|
1608
|
-
function
|
|
1616
|
+
function He(t, e, n) {
|
|
1609
1617
|
if (!e.every(m)) return -1;
|
|
1610
1618
|
const r = e[0].value;
|
|
1611
|
-
if (!
|
|
1612
|
-
const o = e.map((u) => M(r, u.value));
|
|
1619
|
+
if (!S(r) || !n.rawPercentages && P(r)) return -1;
|
|
1620
|
+
const o = e.map(((u) => M(r, u.value)));
|
|
1613
1621
|
if (!We(o)) return -1;
|
|
1614
|
-
const i = o.map((u) => u[4].value), s = Math.min(...i);
|
|
1622
|
+
const i = o.map(((u) => u[4].value)), s = Math.min(...i);
|
|
1615
1623
|
return w(t, r, s);
|
|
1616
1624
|
}
|
|
1617
|
-
function
|
|
1625
|
+
function kn(t, e, n) {
|
|
1618
1626
|
const r = e.value;
|
|
1619
|
-
if (!
|
|
1627
|
+
if (!S(r)) return -1;
|
|
1620
1628
|
const o = M(r, n.value);
|
|
1621
1629
|
if (!G(r, o)) return -1;
|
|
1622
1630
|
let i;
|
|
1623
1631
|
return i = o[4].value === 0 ? Number.NaN : Number.isFinite(r[4].value) && (Number.isFinite(o[4].value) || (o[4].value !== Number.POSITIVE_INFINITY || r[4].value !== Number.NEGATIVE_INFINITY && !Object.is(0 * r[4].value, -0)) && (o[4].value !== Number.NEGATIVE_INFINITY || r[4].value !== Number.POSITIVE_INFINITY && !Object.is(0 * r[4].value, 0))) ? Number.isFinite(o[4].value) ? (r[4].value % o[4].value + o[4].value) % o[4].value : r[4].value : Number.NaN, w(t, r, i);
|
|
1624
1632
|
}
|
|
1625
|
-
function
|
|
1633
|
+
function bn(t, e, n) {
|
|
1626
1634
|
const r = e.value, o = n.value;
|
|
1627
1635
|
return !g(r) || !G(r, o) ? -1 : z(t, Math.pow(r[4].value, o[4].value));
|
|
1628
1636
|
}
|
|
1629
|
-
function
|
|
1637
|
+
function Sn(t, e, n) {
|
|
1630
1638
|
const r = e.value;
|
|
1631
|
-
if (!
|
|
1639
|
+
if (!S(r)) return -1;
|
|
1632
1640
|
const o = M(r, n.value);
|
|
1633
1641
|
if (!G(r, o)) return -1;
|
|
1634
1642
|
let i;
|
|
1635
1643
|
return i = o[4].value === 0 ? Number.NaN : Number.isFinite(r[4].value) ? Number.isFinite(o[4].value) ? r[4].value % o[4].value : r[4].value : Number.NaN, w(t, r, i);
|
|
1636
1644
|
}
|
|
1637
|
-
function
|
|
1645
|
+
function An(t, e, n, r, o) {
|
|
1638
1646
|
const i = n.value;
|
|
1639
|
-
if (!
|
|
1647
|
+
if (!S(i) || !o.rawPercentages && P(i)) return -1;
|
|
1640
1648
|
const s = M(i, r.value);
|
|
1641
1649
|
if (!G(i, s)) return -1;
|
|
1642
1650
|
let u;
|
|
@@ -1665,8 +1673,8 @@ function Sn(t, e, n, r, o) {
|
|
|
1665
1673
|
default: {
|
|
1666
1674
|
let c = Math.floor(i[4].value / s[4].value) * s[4].value, p = Math.ceil(i[4].value / s[4].value) * s[4].value;
|
|
1667
1675
|
if (c > p) {
|
|
1668
|
-
const
|
|
1669
|
-
c = p, p =
|
|
1676
|
+
const A = c;
|
|
1677
|
+
c = p, p = A;
|
|
1670
1678
|
}
|
|
1671
1679
|
const f = Math.abs(i[4].value - c), v = Math.abs(i[4].value - p);
|
|
1672
1680
|
u = f === v ? p : f < v ? c : p;
|
|
@@ -1677,19 +1685,19 @@ function Sn(t, e, n, r, o) {
|
|
|
1677
1685
|
else u = Number.NaN;
|
|
1678
1686
|
return w(t, i, u);
|
|
1679
1687
|
}
|
|
1680
|
-
function
|
|
1688
|
+
function Dn(t, e, n) {
|
|
1681
1689
|
const r = e.value;
|
|
1682
|
-
return !
|
|
1690
|
+
return !S(r) || !n.rawPercentages && P(r) ? -1 : z(t, Math.sign(r[4].value));
|
|
1683
1691
|
}
|
|
1684
|
-
function
|
|
1692
|
+
function Bn(t, e) {
|
|
1685
1693
|
const n = e.value;
|
|
1686
|
-
if (!
|
|
1694
|
+
if (!Fe(n)) return -1;
|
|
1687
1695
|
let r = n[4].value;
|
|
1688
|
-
if (y(n)) switch (
|
|
1696
|
+
if (y(n)) switch (T(n[4].unit)) {
|
|
1689
1697
|
case "rad":
|
|
1690
1698
|
break;
|
|
1691
1699
|
case "deg":
|
|
1692
|
-
r =
|
|
1700
|
+
r = De.get("rad")(n[4].value);
|
|
1693
1701
|
break;
|
|
1694
1702
|
case "grad":
|
|
1695
1703
|
r = ge.get("rad")(n[4].value);
|
|
@@ -1702,21 +1710,21 @@ function Dn(t, e) {
|
|
|
1702
1710
|
}
|
|
1703
1711
|
return r = Math.sin(r), z(t, r);
|
|
1704
1712
|
}
|
|
1705
|
-
function
|
|
1713
|
+
function Fn(t, e) {
|
|
1706
1714
|
const n = e.value;
|
|
1707
1715
|
return g(n) ? z(t, Math.sqrt(n[4].value)) : -1;
|
|
1708
1716
|
}
|
|
1709
|
-
function
|
|
1717
|
+
function Nn(t, e) {
|
|
1710
1718
|
const n = e.value;
|
|
1711
|
-
if (!
|
|
1719
|
+
if (!Fe(n)) return -1;
|
|
1712
1720
|
const r = n[4].value;
|
|
1713
1721
|
let o = 0, i = n[4].value;
|
|
1714
|
-
if (y(n)) switch (
|
|
1722
|
+
if (y(n)) switch (T(n[4].unit)) {
|
|
1715
1723
|
case "rad":
|
|
1716
1724
|
o = ot.get("deg")(r);
|
|
1717
1725
|
break;
|
|
1718
1726
|
case "deg":
|
|
1719
|
-
o = r, i =
|
|
1727
|
+
o = r, i = De.get("rad")(r);
|
|
1720
1728
|
break;
|
|
1721
1729
|
case "grad":
|
|
1722
1730
|
o = ge.get("deg")(r), i = ge.get("rad")(r);
|
|
@@ -1730,7 +1738,7 @@ function Fn(t, e) {
|
|
|
1730
1738
|
const s = o / 90;
|
|
1731
1739
|
return i = o % 90 == 0 && s % 2 != 0 ? s > 0 ? 1 / 0 : -1 / 0 : Math.tan(i), z(t, i);
|
|
1732
1740
|
}
|
|
1733
|
-
function
|
|
1741
|
+
function wn(t) {
|
|
1734
1742
|
if (t.length !== 2) return -1;
|
|
1735
1743
|
const e = t[0].value;
|
|
1736
1744
|
let n = t[1].value;
|
|
@@ -1742,13 +1750,13 @@ function Nn(t) {
|
|
|
1742
1750
|
const r = e[4].value - n[4].value;
|
|
1743
1751
|
return new d([a.Percentage, r.toString() + "%", e[2], n[3], { value: r }]);
|
|
1744
1752
|
}
|
|
1745
|
-
if (y(e) && y(n) && (n = M(e, n),
|
|
1753
|
+
if (y(e) && y(n) && (n = M(e, n), T(e[4].unit) === T(n[4].unit))) {
|
|
1746
1754
|
const r = e[4].value - n[4].value;
|
|
1747
1755
|
return new d([a.Dimension, r.toString() + e[4].unit, e[2], n[3], { value: r, type: e[4].type === l.Integer && n[4].type === l.Integer ? l.Integer : l.Number, unit: e[4].unit }]);
|
|
1748
1756
|
}
|
|
1749
1757
|
return -1;
|
|
1750
1758
|
}
|
|
1751
|
-
function
|
|
1759
|
+
function In(t, e) {
|
|
1752
1760
|
if (e.length === 1) {
|
|
1753
1761
|
const n = e[0];
|
|
1754
1762
|
if (!n || !m(n)) return -1;
|
|
@@ -1767,30 +1775,30 @@ function wn(t, e) {
|
|
|
1767
1775
|
}
|
|
1768
1776
|
return -1;
|
|
1769
1777
|
}
|
|
1770
|
-
const
|
|
1771
|
-
function
|
|
1778
|
+
const xn = /^none$/i;
|
|
1779
|
+
function Te(t) {
|
|
1772
1780
|
if (Array.isArray(t)) {
|
|
1773
|
-
const n = t.filter((r) => !(nt(r) && rt(r)));
|
|
1774
|
-
return n.length === 1 &&
|
|
1781
|
+
const n = t.filter(((r) => !(nt(r) && rt(r))));
|
|
1782
|
+
return n.length === 1 && Te(n[0]);
|
|
1775
1783
|
}
|
|
1776
1784
|
if (!m(t)) return !1;
|
|
1777
1785
|
const e = t.value;
|
|
1778
|
-
return !!ve(e) &&
|
|
1786
|
+
return !!ve(e) && xn.test(e[4].value);
|
|
1779
1787
|
}
|
|
1780
|
-
const
|
|
1788
|
+
const On = String.fromCodePoint(0);
|
|
1781
1789
|
function Tn(t, e, n, r, o, i) {
|
|
1782
1790
|
var E;
|
|
1783
1791
|
if (e.fixed === -1 && !i.randomCaching) return -1;
|
|
1784
1792
|
i.randomCaching || (i.randomCaching = { propertyName: "", propertyN: 0, elementID: "", documentID: "" }), i.randomCaching && !i.randomCaching.propertyN && (i.randomCaching.propertyN = 0);
|
|
1785
1793
|
const s = n.value;
|
|
1786
|
-
if (!
|
|
1794
|
+
if (!S(s)) return -1;
|
|
1787
1795
|
const u = M(s, r.value);
|
|
1788
1796
|
if (!G(s, u)) return -1;
|
|
1789
1797
|
let c = null;
|
|
1790
1798
|
if (o && (c = M(s, o.value), !G(s, c))) return -1;
|
|
1791
1799
|
if (!Number.isFinite(s[4].value) || !Number.isFinite(u[4].value) || !Number.isFinite(u[4].value - s[4].value)) return w(t, s, Number.NaN);
|
|
1792
1800
|
if (c && !Number.isFinite(c[4].value)) return w(t, s, s[4].value);
|
|
1793
|
-
const p = e.fixed === -1 ?
|
|
1801
|
+
const p = e.fixed === -1 ? Mn(Rn([e.dashedIdent ? e.dashedIdent : `${(E = i.randomCaching) == null ? void 0 : E.propertyName} ${i.randomCaching.propertyN++}`, e.elementShared ? "" : i.randomCaching.elementID, i.randomCaching.documentID].join(On))) : () => e.fixed;
|
|
1794
1802
|
let f = s[4].value, v = u[4].value;
|
|
1795
1803
|
if (f > v && ([f, v] = [v, f]), c && (c[4].value <= 0 || Math.abs(f - v) / c[4].value > 1e10) && (c = null), c) {
|
|
1796
1804
|
const I = Math.max(c[4].value / 1e3, 1e-9), h = [f];
|
|
@@ -1804,41 +1812,41 @@ function Tn(t, e, n, r, o, i) {
|
|
|
1804
1812
|
}
|
|
1805
1813
|
if (h.push(de), de + c[4].value - I > v) break;
|
|
1806
1814
|
}
|
|
1807
|
-
const
|
|
1808
|
-
return w(t, s, Number(h[Math.floor(h.length *
|
|
1815
|
+
const H = p();
|
|
1816
|
+
return w(t, s, Number(h[Math.floor(h.length * H)].toFixed(5)));
|
|
1809
1817
|
}
|
|
1810
|
-
const
|
|
1811
|
-
return w(t, s, Number((
|
|
1818
|
+
const A = p();
|
|
1819
|
+
return w(t, s, Number((A * (v - f) + f).toFixed(5)));
|
|
1812
1820
|
}
|
|
1813
|
-
function
|
|
1821
|
+
function Mn(t = 0.34944106645296036, e = 0.19228640875738723, n = 0.8784393832007205, r = 0.04850964319275053) {
|
|
1814
1822
|
return () => {
|
|
1815
1823
|
const o = ((t |= 0) + (e |= 0) | 0) + (r |= 0) | 0;
|
|
1816
1824
|
return r = r + 1 | 0, t = e ^ e >>> 9, e = (n |= 0) + (n << 3) | 0, n = (n = n << 21 | n >>> 11) + o | 0, (o >>> 0) / 4294967296;
|
|
1817
1825
|
};
|
|
1818
1826
|
}
|
|
1819
|
-
function
|
|
1827
|
+
function Rn(t) {
|
|
1820
1828
|
let e = 0, n = 0, r = 0;
|
|
1821
|
-
e
|
|
1829
|
+
e ^= -1;
|
|
1822
1830
|
for (let o = 0, i = t.length; o < i; o++) r = 255 & (e ^ t.charCodeAt(o)), n = +("0x" + "00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D".substring(9 * r, 9 * r + 8)), e = e >>> 8 ^ n;
|
|
1823
|
-
return
|
|
1831
|
+
return (-1 ^ e) >>> 0;
|
|
1824
1832
|
}
|
|
1825
1833
|
const Le = /* @__PURE__ */ new Map([["abs", function(e, n, r) {
|
|
1826
|
-
return $(e, n, r,
|
|
1834
|
+
return $(e, n, r, hn);
|
|
1827
1835
|
}], ["acos", function(e, n, r) {
|
|
1828
|
-
return $(e, n, r, pn);
|
|
1829
|
-
}], ["asin", function(e, n, r) {
|
|
1830
1836
|
return $(e, n, r, fn);
|
|
1831
|
-
}], ["
|
|
1837
|
+
}], ["asin", function(e, n, r) {
|
|
1832
1838
|
return $(e, n, r, vn);
|
|
1839
|
+
}], ["atan", function(e, n, r) {
|
|
1840
|
+
return $(e, n, r, gn);
|
|
1833
1841
|
}], ["atan2", function(e, n, r) {
|
|
1834
|
-
return Ce(e, n, r,
|
|
1842
|
+
return Ce(e, n, r, mn);
|
|
1835
1843
|
}], ["calc", B], ["clamp", function(e, n, r) {
|
|
1836
|
-
const o = ue([...e.value.filter((h) => !X(h))], n), i = [], s = [], u = [];
|
|
1844
|
+
const o = ue([...e.value.filter(((h) => !X(h)))], n), i = [], s = [], u = [];
|
|
1837
1845
|
{
|
|
1838
1846
|
let h = i;
|
|
1839
1847
|
for (let L = 0; L < o.length; L++) {
|
|
1840
|
-
const
|
|
1841
|
-
if (m(
|
|
1848
|
+
const H = o[L];
|
|
1849
|
+
if (m(H) && ie(H.value)) {
|
|
1842
1850
|
if (h === u) return -1;
|
|
1843
1851
|
if (h === s) {
|
|
1844
1852
|
h = u;
|
|
@@ -1850,62 +1858,62 @@ const Le = /* @__PURE__ */ new Map([["abs", function(e, n, r) {
|
|
|
1850
1858
|
}
|
|
1851
1859
|
return -1;
|
|
1852
1860
|
}
|
|
1853
|
-
h.push(
|
|
1861
|
+
h.push(H);
|
|
1854
1862
|
}
|
|
1855
1863
|
}
|
|
1856
|
-
const c =
|
|
1864
|
+
const c = Te(i), p = Te(u);
|
|
1857
1865
|
if (c && p) return B(x(s), n, r);
|
|
1858
1866
|
const f = N(B(x(s), n, r));
|
|
1859
1867
|
if (f === -1) return -1;
|
|
1860
1868
|
if (c) {
|
|
1861
1869
|
const h = N(B(x(u), n, r));
|
|
1862
|
-
return h === -1 ? -1 :
|
|
1870
|
+
return h === -1 ? -1 : He((v = f, A = h, new F([a.Function, "min(", -1, -1, { value: "min" }], [a.CloseParen, ")", -1, -1, void 0], [v, new d([a.Comma, ",", -1, -1, void 0]), A])), [f, h], r);
|
|
1863
1871
|
}
|
|
1864
1872
|
if (p) {
|
|
1865
1873
|
const h = N(B(x(i), n, r));
|
|
1866
|
-
return h === -1 ? -1 : ze(
|
|
1874
|
+
return h === -1 ? -1 : ze(qn(h, f), [h, f], r);
|
|
1867
1875
|
}
|
|
1868
|
-
var v,
|
|
1876
|
+
var v, A;
|
|
1869
1877
|
const E = N(B(x(i), n, r));
|
|
1870
1878
|
if (E === -1) return -1;
|
|
1871
1879
|
const I = N(B(x(u), n, r));
|
|
1872
|
-
return I === -1 ? -1 :
|
|
1880
|
+
return I === -1 ? -1 : Cn(e, E, f, I, r);
|
|
1873
1881
|
}], ["cos", function(e, n, r) {
|
|
1874
|
-
return $(e, n, r, Cn);
|
|
1875
|
-
}], ["exp", function(e, n, r) {
|
|
1876
1882
|
return $(e, n, r, yn);
|
|
1883
|
+
}], ["exp", function(e, n, r) {
|
|
1884
|
+
return $(e, n, r, En);
|
|
1877
1885
|
}], ["hypot", function(e, n, r) {
|
|
1878
|
-
return ye(e, e.value, n, r,
|
|
1886
|
+
return ye(e, e.value, n, r, Pn);
|
|
1879
1887
|
}], ["log", function(e, n, r) {
|
|
1880
|
-
return ye(e, e.value, n, r,
|
|
1888
|
+
return ye(e, e.value, n, r, In);
|
|
1881
1889
|
}], ["max", function(e, n, r) {
|
|
1882
1890
|
return ye(e, e.value, n, r, ze);
|
|
1883
1891
|
}], ["min", function(e, n, r) {
|
|
1884
|
-
return ye(e, e.value, n, r,
|
|
1892
|
+
return ye(e, e.value, n, r, He);
|
|
1885
1893
|
}], ["mod", function(e, n, r) {
|
|
1886
|
-
return Ce(e, n, r, Pn);
|
|
1887
|
-
}], ["pow", function(e, n, r) {
|
|
1888
1894
|
return Ce(e, n, r, kn);
|
|
1895
|
+
}], ["pow", function(e, n, r) {
|
|
1896
|
+
return Ce(e, n, r, bn);
|
|
1889
1897
|
}], ["random", function(e, n, r) {
|
|
1890
|
-
const o =
|
|
1898
|
+
const o = $n(e.value.filter(((v) => !X(v))), n, r);
|
|
1891
1899
|
if (o === -1) return -1;
|
|
1892
1900
|
const [i, s] = o, u = it(s, n, r);
|
|
1893
1901
|
if (u === -1) return -1;
|
|
1894
1902
|
const [c, p, f] = u;
|
|
1895
1903
|
return !c || !p ? -1 : Tn(e, i, c, p, f, r);
|
|
1896
1904
|
}], ["rem", function(e, n, r) {
|
|
1897
|
-
return Ce(e, n, r,
|
|
1905
|
+
return Ce(e, n, r, Sn);
|
|
1898
1906
|
}], ["round", function(e, n, r) {
|
|
1899
|
-
const o = ue([...e.value.filter((v) => !X(v))], n);
|
|
1907
|
+
const o = ue([...e.value.filter(((v) => !X(v)))], n);
|
|
1900
1908
|
let i = "", s = !1;
|
|
1901
1909
|
const u = [], c = [];
|
|
1902
1910
|
{
|
|
1903
1911
|
let v = u;
|
|
1904
|
-
for (let
|
|
1905
|
-
const E = o[
|
|
1912
|
+
for (let A = 0; A < o.length; A++) {
|
|
1913
|
+
const E = o[A];
|
|
1906
1914
|
if (!i && u.length === 0 && c.length === 0 && m(E) && ve(E.value)) {
|
|
1907
1915
|
const I = E.value[4].value.toLowerCase();
|
|
1908
|
-
if (
|
|
1916
|
+
if (Ln.has(I)) {
|
|
1909
1917
|
i = I;
|
|
1910
1918
|
continue;
|
|
1911
1919
|
}
|
|
@@ -1926,23 +1934,23 @@ const Le = /* @__PURE__ */ new Map([["abs", function(e, n, r) {
|
|
|
1926
1934
|
if (p === -1) return -1;
|
|
1927
1935
|
s || c.length !== 0 || c.push(new d([a.Number, "1", -1, -1, { value: 1, type: l.Integer }]));
|
|
1928
1936
|
const f = N(B(x(c), n, r));
|
|
1929
|
-
return f === -1 ? -1 : (i || (i = "nearest"),
|
|
1937
|
+
return f === -1 ? -1 : (i || (i = "nearest"), An(e, i, p, f, r));
|
|
1930
1938
|
}], ["sign", function(e, n, r) {
|
|
1931
|
-
return $(e, n, r, An);
|
|
1932
|
-
}], ["sin", function(e, n, r) {
|
|
1933
1939
|
return $(e, n, r, Dn);
|
|
1934
|
-
}], ["
|
|
1940
|
+
}], ["sin", function(e, n, r) {
|
|
1935
1941
|
return $(e, n, r, Bn);
|
|
1936
|
-
}], ["
|
|
1942
|
+
}], ["sqrt", function(e, n, r) {
|
|
1937
1943
|
return $(e, n, r, Fn);
|
|
1944
|
+
}], ["tan", function(e, n, r) {
|
|
1945
|
+
return $(e, n, r, Nn);
|
|
1938
1946
|
}]]);
|
|
1939
1947
|
function B(t, e, n) {
|
|
1940
|
-
const r = ue([...t.value.filter((i) => !X(i))], e);
|
|
1941
|
-
if (r.length === 1 && m(r[0])) return { inputs: [r[0]], operation:
|
|
1948
|
+
const r = ue([...t.value.filter(((i) => !X(i)))], e);
|
|
1949
|
+
if (r.length === 1 && m(r[0])) return { inputs: [r[0]], operation: Be };
|
|
1942
1950
|
let o = 0;
|
|
1943
1951
|
for (; o < r.length; ) {
|
|
1944
1952
|
const i = r[o];
|
|
1945
|
-
if (
|
|
1953
|
+
if (Yt(i) && Qe(i.startToken)) {
|
|
1946
1954
|
const s = B(i, e, n);
|
|
1947
1955
|
if (s === -1) return -1;
|
|
1948
1956
|
r.splice(o, 1, s);
|
|
@@ -1954,10 +1962,10 @@ function B(t, e, n) {
|
|
|
1954
1962
|
r.splice(o, 1, u);
|
|
1955
1963
|
} else o++;
|
|
1956
1964
|
}
|
|
1957
|
-
if (o = 0, r.length === 1 &&
|
|
1965
|
+
if (o = 0, r.length === 1 && K(r[0])) return r[0];
|
|
1958
1966
|
for (; o < r.length; ) {
|
|
1959
1967
|
const i = r[o];
|
|
1960
|
-
if (!i || !m(i) && !
|
|
1968
|
+
if (!i || !m(i) && !K(i)) {
|
|
1961
1969
|
o++;
|
|
1962
1970
|
continue;
|
|
1963
1971
|
}
|
|
@@ -1972,13 +1980,13 @@ function B(t, e, n) {
|
|
|
1972
1980
|
continue;
|
|
1973
1981
|
}
|
|
1974
1982
|
const c = r[o + 2];
|
|
1975
|
-
if (!c || !m(c) && !
|
|
1976
|
-
u[4].value !== "*" ? u[4].value !== "/" ? o++ : r.splice(o, 3, { inputs: [i, c], operation:
|
|
1983
|
+
if (!c || !m(c) && !K(c)) return -1;
|
|
1984
|
+
u[4].value !== "*" ? u[4].value !== "/" ? o++ : r.splice(o, 3, { inputs: [i, c], operation: ln }) : r.splice(o, 3, { inputs: [i, c], operation: dn });
|
|
1977
1985
|
}
|
|
1978
|
-
if (o = 0, r.length === 1 &&
|
|
1986
|
+
if (o = 0, r.length === 1 && K(r[0])) return r[0];
|
|
1979
1987
|
for (; o < r.length; ) {
|
|
1980
1988
|
const i = r[o];
|
|
1981
|
-
if (!i || !m(i) && !
|
|
1989
|
+
if (!i || !m(i) && !K(i)) {
|
|
1982
1990
|
o++;
|
|
1983
1991
|
continue;
|
|
1984
1992
|
}
|
|
@@ -1993,27 +2001,27 @@ function B(t, e, n) {
|
|
|
1993
2001
|
continue;
|
|
1994
2002
|
}
|
|
1995
2003
|
const c = r[o + 2];
|
|
1996
|
-
if (!c || !m(c) && !
|
|
1997
|
-
u[4].value !== "+" ? u[4].value !== "-" ? o++ : r.splice(o, 3, { inputs: [i, c], operation:
|
|
2004
|
+
if (!c || !m(c) && !K(c)) return -1;
|
|
2005
|
+
u[4].value !== "+" ? u[4].value !== "-" ? o++ : r.splice(o, 3, { inputs: [i, c], operation: wn }) : r.splice(o, 3, { inputs: [i, c], operation: cn });
|
|
1998
2006
|
}
|
|
1999
|
-
return r.length === 1 &&
|
|
2007
|
+
return r.length === 1 && K(r[0]) ? r[0] : -1;
|
|
2000
2008
|
}
|
|
2001
2009
|
function $(t, e, n, r) {
|
|
2002
|
-
const o =
|
|
2010
|
+
const o = Un(t.value, e, n);
|
|
2003
2011
|
return o === -1 ? -1 : r(t, o, n);
|
|
2004
2012
|
}
|
|
2005
|
-
function
|
|
2006
|
-
const r = N(B(x(ue([...t.filter((o) => !X(o))], e)), e, n));
|
|
2013
|
+
function Un(t, e, n) {
|
|
2014
|
+
const r = N(B(x(ue([...t.filter(((o) => !X(o)))], e)), e, n));
|
|
2007
2015
|
return r === -1 ? -1 : r;
|
|
2008
2016
|
}
|
|
2009
2017
|
function Ce(t, e, n, r) {
|
|
2010
|
-
const o =
|
|
2018
|
+
const o = Wn(t.value, e, n);
|
|
2011
2019
|
if (o === -1) return -1;
|
|
2012
2020
|
const [i, s] = o;
|
|
2013
2021
|
return r(t, i, s, n);
|
|
2014
2022
|
}
|
|
2015
|
-
function
|
|
2016
|
-
const r = ue([...t.filter((c) => !X(c))], e), o = [], i = [];
|
|
2023
|
+
function Wn(t, e, n) {
|
|
2024
|
+
const r = ue([...t.filter(((c) => !X(c)))], e), o = [], i = [];
|
|
2017
2025
|
{
|
|
2018
2026
|
let c = o;
|
|
2019
2027
|
for (let p = 0; p < r.length; p++) {
|
|
@@ -2039,7 +2047,7 @@ function ye(t, e, n, r, o) {
|
|
|
2039
2047
|
return i === -1 ? -1 : o(t, i, r);
|
|
2040
2048
|
}
|
|
2041
2049
|
function it(t, e, n) {
|
|
2042
|
-
const r = ue([...t.filter((i) => !X(i))], e), o = [];
|
|
2050
|
+
const r = ue([...t.filter(((i) => !X(i)))], e), o = [];
|
|
2043
2051
|
{
|
|
2044
2052
|
const i = [];
|
|
2045
2053
|
let s = [];
|
|
@@ -2057,8 +2065,8 @@ function it(t, e, n) {
|
|
|
2057
2065
|
}
|
|
2058
2066
|
return o;
|
|
2059
2067
|
}
|
|
2060
|
-
const
|
|
2061
|
-
function
|
|
2068
|
+
const Ln = /* @__PURE__ */ new Set(["nearest", "up", "down", "to-zero"]);
|
|
2069
|
+
function $n(t, e, n) {
|
|
2062
2070
|
const r = { isAuto: !1, dashedIdent: "", fixed: -1, elementShared: !1 }, o = t[0];
|
|
2063
2071
|
if (!m(o) || !ve(o.value)) return [r, t];
|
|
2064
2072
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -2095,56 +2103,56 @@ function Ln(t, e, n) {
|
|
|
2095
2103
|
function x(t) {
|
|
2096
2104
|
return new F([a.Function, "calc(", -1, -1, { value: "calc" }], [a.CloseParen, ")", -1, -1, void 0], t);
|
|
2097
2105
|
}
|
|
2098
|
-
function
|
|
2106
|
+
function qn(t, e) {
|
|
2099
2107
|
return new F([a.Function, "max(", -1, -1, { value: "max" }], [a.CloseParen, ")", -1, -1, void 0], [t, new d([a.Comma, ",", -1, -1, void 0]), e]);
|
|
2100
2108
|
}
|
|
2101
|
-
function
|
|
2109
|
+
function zn(t) {
|
|
2102
2110
|
if (t === -1) return -1;
|
|
2103
2111
|
if (le(t)) return t;
|
|
2104
2112
|
const e = t.value;
|
|
2105
|
-
return
|
|
2113
|
+
return S(e) && Number.isNaN(e[4].value) ? g(e) ? new F([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new d([a.Ident, "NaN", e[2], e[3], { value: "NaN" }])]) : y(e) ? new F([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new d([a.Ident, "NaN", e[2], e[3], { value: "NaN" }]), new O([[a.Whitespace, " ", e[2], e[3], void 0]]), new d([a.Delim, "*", e[2], e[3], { value: "*" }]), new O([[a.Whitespace, " ", e[2], e[3], void 0]]), new d([a.Dimension, "1" + e[4].unit, e[2], e[3], { value: 1, type: l.Integer, unit: e[4].unit }])]) : P(e) ? new F([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new d([a.Ident, "NaN", e[2], e[3], { value: "NaN" }]), new O([[a.Whitespace, " ", e[2], e[3], void 0]]), new d([a.Delim, "*", e[2], e[3], { value: "*" }]), new O([[a.Whitespace, " ", e[2], e[3], void 0]]), new d([a.Percentage, "1%", e[2], e[3], { value: 1 }])]) : -1 : t;
|
|
2106
2114
|
}
|
|
2107
|
-
function
|
|
2115
|
+
function Hn(t) {
|
|
2108
2116
|
if (t === -1) return -1;
|
|
2109
2117
|
if (le(t)) return t;
|
|
2110
2118
|
const e = t.value;
|
|
2111
|
-
if (!
|
|
2119
|
+
if (!S(e) || Number.isFinite(e[4].value) || Number.isNaN(e[4].value)) return t;
|
|
2112
2120
|
let n = "";
|
|
2113
|
-
return Number.NEGATIVE_INFINITY === e[4].value && (n = "-"), g(e) ? new F([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new d([a.Ident, n + "infinity", e[2], e[3], { value: n + "infinity" }])]) : y(e) ? new F([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new d([a.Ident, n + "infinity", e[2], e[3], { value: n + "infinity" }]), new
|
|
2121
|
+
return Number.NEGATIVE_INFINITY === e[4].value && (n = "-"), g(e) ? new F([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new d([a.Ident, n + "infinity", e[2], e[3], { value: n + "infinity" }])]) : y(e) ? new F([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new d([a.Ident, n + "infinity", e[2], e[3], { value: n + "infinity" }]), new O([[a.Whitespace, " ", e[2], e[3], void 0]]), new d([a.Delim, "*", e[2], e[3], { value: "*" }]), new O([[a.Whitespace, " ", e[2], e[3], void 0]]), new d([a.Dimension, "1" + e[4].unit, e[2], e[3], { value: 1, type: l.Integer, unit: e[4].unit }])]) : new F([a.Function, "calc(", e[2], e[3], { value: "calc" }], [a.CloseParen, ")", e[2], e[3], void 0], [new d([a.Ident, n + "infinity", e[2], e[3], { value: n + "infinity" }]), new O([[a.Whitespace, " ", e[2], e[3], void 0]]), new d([a.Delim, "*", e[2], e[3], { value: "*" }]), new O([[a.Whitespace, " ", e[2], e[3], void 0]]), new d([a.Percentage, "1%", e[2], e[3], { value: 1 }])]);
|
|
2114
2122
|
}
|
|
2115
2123
|
function Vn(t) {
|
|
2116
2124
|
if (t === -1) return -1;
|
|
2117
2125
|
if (le(t)) return t;
|
|
2118
2126
|
const e = t.value;
|
|
2119
|
-
return
|
|
2127
|
+
return S(e) && Object.is(-0, e[4].value) && (e[1] === "-0" || (P(e) ? e[1] = "-0%" : y(e) ? e[1] = "-0" + e[4].unit : e[1] = "-0")), t;
|
|
2120
2128
|
}
|
|
2121
|
-
function
|
|
2129
|
+
function jn(t, e = 13) {
|
|
2122
2130
|
if (t === -1) return -1;
|
|
2123
2131
|
if (e <= 0 || le(t)) return t;
|
|
2124
2132
|
const n = t.value;
|
|
2125
|
-
if (!
|
|
2133
|
+
if (!S(n) || Number.isInteger(n[4].value)) return t;
|
|
2126
2134
|
const r = Number(n[4].value.toFixed(e)).toString();
|
|
2127
2135
|
return g(n) ? n[1] = r : P(n) ? n[1] = r + "%" : y(n) && (n[1] = r + n[4].unit), t;
|
|
2128
2136
|
}
|
|
2129
|
-
function
|
|
2137
|
+
function Gn(t, e) {
|
|
2130
2138
|
let n = t;
|
|
2131
|
-
return n =
|
|
2139
|
+
return n = jn(n, e == null ? void 0 : e.precision), n = Vn(n), n = zn(n), n = Hn(n), n;
|
|
2132
2140
|
}
|
|
2133
|
-
function
|
|
2141
|
+
function Jn(t) {
|
|
2134
2142
|
return /* @__PURE__ */ new Map();
|
|
2135
2143
|
}
|
|
2136
|
-
function Jn(t, e) {
|
|
2137
|
-
return Yn(Vt(wt({ css: t }), {}), e).map((n) => n.map((r) => j(...r.tokens())).join("")).join(",");
|
|
2138
|
-
}
|
|
2139
2144
|
function Yn(t, e) {
|
|
2140
|
-
|
|
2141
|
-
|
|
2145
|
+
return Zn(Vt(wt({ css: t }), {}), e).map(((n) => n.map(((r) => j(...r.tokens()))).join(""))).join(",");
|
|
2146
|
+
}
|
|
2147
|
+
function Zn(t, e) {
|
|
2148
|
+
const n = Jn();
|
|
2149
|
+
return Jt(t, ((r) => {
|
|
2142
2150
|
if (!le(r)) return;
|
|
2143
2151
|
const o = Le.get(r.getName().toLowerCase());
|
|
2144
2152
|
if (!o) return;
|
|
2145
|
-
const i =
|
|
2153
|
+
const i = Gn(N(o(r, n, {})), e);
|
|
2146
2154
|
return i !== -1 ? i : void 0;
|
|
2147
|
-
});
|
|
2155
|
+
}));
|
|
2148
2156
|
}
|
|
2149
2157
|
new Set(Le.keys());
|
|
2150
2158
|
const q = (t) => {
|
|
@@ -2152,7 +2160,7 @@ const q = (t) => {
|
|
|
2152
2160
|
let r = "unsupported";
|
|
2153
2161
|
const o = e.match(/px|rem|em/);
|
|
2154
2162
|
return o && (r = o[0]), n === 0 && r === "unsupported" && (r = "zero"), { number: n, unit: r };
|
|
2155
|
-
},
|
|
2163
|
+
}, Ve = (t) => {
|
|
2156
2164
|
const e = {};
|
|
2157
2165
|
if (typeof t == "string")
|
|
2158
2166
|
e.fontSize = q(t);
|
|
@@ -2162,7 +2170,7 @@ const q = (t) => {
|
|
|
2162
2170
|
else if (typeof t[1] == "object") {
|
|
2163
2171
|
if ("lineHeight" in t[1]) {
|
|
2164
2172
|
let n = t[1].lineHeight;
|
|
2165
|
-
typeof n == "string" && n.includes("calc") && (n =
|
|
2173
|
+
typeof n == "string" && n.includes("calc") && (n = Yn(n));
|
|
2166
2174
|
const r = q(n);
|
|
2167
2175
|
r.unit === "unsupported" ? e.lineHeight = {
|
|
2168
2176
|
number: n * e.fontSize.number,
|
|
@@ -2173,7 +2181,7 @@ const q = (t) => {
|
|
|
2173
2181
|
}
|
|
2174
2182
|
}
|
|
2175
2183
|
return e;
|
|
2176
|
-
},
|
|
2184
|
+
}, xe = (t, e, n, r = null) => t.number === e.number ? (fe.error(
|
|
2177
2185
|
`Same value for start an end${r ? ` (${r})` : ""}: "clamp-[${n}]".`
|
|
2178
2186
|
), null) : t.unit !== e.unit && t.unit !== "zero" && e.unit !== "zero" ? (fe.error(
|
|
2179
2187
|
`Units need to match${r ? ` (${r})` : ""}: "clamp-[${n}]" ${t.unit} !== ${e.unit}.`
|
|
@@ -2183,9 +2191,9 @@ const q = (t) => {
|
|
|
2183
2191
|
const i = t.unit === "zero" ? e.unit : t.unit, s = i === "px";
|
|
2184
2192
|
let u = t.number, c = e.number, p = !1, f = n.number, v = r.number;
|
|
2185
2193
|
n.unit !== "px" && s && (f = n.number * 16), n.unit === "px" && !s && (f = n.number / 16), r.unit !== "px" && s && (v = r.number * 16), r.unit === "px" && !s && (v = r.number / 16), c < u && u < 0 && c < 0 ? (u = Math.abs(u), c = Math.abs(c), p = !0) : c < u && u > 0 && c > 0 ? (u = u * -1, c = c * -1, p = !0) : c < u && (u = Math.abs(u) * -1, c = Math.abs(c), p = !0);
|
|
2186
|
-
const
|
|
2194
|
+
const A = (c - u) / (v - f), E = `${(u - f * A).toFixed(6)}${i} + ${(100 * A).toFixed(6)}${o ? "cqw" : "vw"}`, I = `clamp(${u}${i}, ${E}, ${c}${i})`;
|
|
2187
2195
|
return p ? `calc(${I} * -1)` : I;
|
|
2188
|
-
},
|
|
2196
|
+
}, Kn = {
|
|
2189
2197
|
minSize: "23.4375rem",
|
|
2190
2198
|
maxSize: "90rem"
|
|
2191
2199
|
};
|
|
@@ -2201,8 +2209,8 @@ function Ge(t, e, n, r) {
|
|
|
2201
2209
|
isContainer: o
|
|
2202
2210
|
};
|
|
2203
2211
|
}
|
|
2204
|
-
const
|
|
2205
|
-
const e = { ...
|
|
2212
|
+
const _n = ct.withOptions(function(t = {}) {
|
|
2213
|
+
const e = { ...Kn, ...t };
|
|
2206
2214
|
return function({ matchUtilities: n, theme: r, config: o }) {
|
|
2207
2215
|
n(
|
|
2208
2216
|
{
|
|
@@ -2223,38 +2231,38 @@ const Xn = ct.withOptions(function(t = {}) {
|
|
|
2223
2231
|
u,
|
|
2224
2232
|
c
|
|
2225
2233
|
);
|
|
2226
|
-
if (!
|
|
2234
|
+
if (!xe(p, f, i))
|
|
2227
2235
|
return {};
|
|
2228
|
-
const v = p.isContainer,
|
|
2229
|
-
if (!
|
|
2236
|
+
const v = p.isContainer, A = lt(s[0]);
|
|
2237
|
+
if (!A)
|
|
2230
2238
|
return fe.error(
|
|
2231
2239
|
`Property "${s[0]}" is not supported: "clamp-[${i}]".`
|
|
2232
2240
|
), {};
|
|
2233
|
-
const { key: E, props: I, type: h } =
|
|
2241
|
+
const { key: E, props: I, type: h } = A;
|
|
2234
2242
|
if (h === "fontSize") {
|
|
2235
|
-
const k =
|
|
2243
|
+
const k = Ve(
|
|
2236
2244
|
o().theme[E][s[1]] || s[1]
|
|
2237
|
-
), W =
|
|
2245
|
+
), W = Ve(
|
|
2238
2246
|
o().theme[E][s[2]] || s[2]
|
|
2239
2247
|
), pe = {};
|
|
2240
|
-
return Object.keys(k).forEach((
|
|
2241
|
-
if (
|
|
2242
|
-
if ((
|
|
2243
|
-
pe[
|
|
2244
|
-
else if (
|
|
2248
|
+
return Object.keys(k).forEach((D) => {
|
|
2249
|
+
if (D in W) {
|
|
2250
|
+
if ((D === "letterSpacing" || D === "lineHeight") && k[D].number === W[D].number && k[D].unit === W[D].unit)
|
|
2251
|
+
pe[D] = `${k[D].number}${k[D].unit}`;
|
|
2252
|
+
else if (xe(k[D], W[D], i, D)) {
|
|
2245
2253
|
const at = je(
|
|
2246
|
-
k[
|
|
2247
|
-
W[
|
|
2254
|
+
k[D],
|
|
2255
|
+
W[D],
|
|
2248
2256
|
p,
|
|
2249
2257
|
f,
|
|
2250
2258
|
v
|
|
2251
2259
|
);
|
|
2252
|
-
pe[
|
|
2260
|
+
pe[D] = at;
|
|
2253
2261
|
}
|
|
2254
2262
|
}
|
|
2255
2263
|
}), pe;
|
|
2256
2264
|
}
|
|
2257
|
-
let L = q(o().theme[E][s[1]] || s[1]),
|
|
2265
|
+
let L = q(o().theme[E][s[1]] || s[1]), H = q(o().theme[E][s[2]] || s[2]);
|
|
2258
2266
|
if (h === "spacing") {
|
|
2259
2267
|
const k = q(
|
|
2260
2268
|
typeof r("spacing") == "string" ? r("spacing") : r("spacing.1")
|
|
@@ -2262,14 +2270,14 @@ const Xn = ct.withOptions(function(t = {}) {
|
|
|
2262
2270
|
W && (L = {
|
|
2263
2271
|
number: k.number * parseFloat(s[1]),
|
|
2264
2272
|
unit: k.unit
|
|
2265
|
-
}), pe && (
|
|
2273
|
+
}), pe && (H = {
|
|
2266
2274
|
number: k.number * parseFloat(s[2]),
|
|
2267
2275
|
unit: k.unit
|
|
2268
2276
|
});
|
|
2269
2277
|
}
|
|
2270
|
-
if (!
|
|
2278
|
+
if (!xe(L, H, i))
|
|
2271
2279
|
return {};
|
|
2272
|
-
const de = je(L,
|
|
2280
|
+
const de = je(L, H, p, f, v);
|
|
2273
2281
|
return I.reduce((k, W) => (typeof W == "string" ? k[W] = de : k = { ...k, ...W }, k), {});
|
|
2274
2282
|
}
|
|
2275
2283
|
},
|
|
@@ -2285,6 +2293,6 @@ const Xn = ct.withOptions(function(t = {}) {
|
|
|
2285
2293
|
};
|
|
2286
2294
|
});
|
|
2287
2295
|
export {
|
|
2288
|
-
|
|
2296
|
+
_n as default
|
|
2289
2297
|
};
|
|
2290
2298
|
//# sourceMappingURL=index.js.map
|