summaryrefslogtreecommitdiff
path: root/node_modules/@csstools/css-tokenizer/dist
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@csstools/css-tokenizer/dist')
-rw-r--r--node_modules/@csstools/css-tokenizer/dist/index.cjs1
-rw-r--r--node_modules/@csstools/css-tokenizer/dist/index.d.ts627
-rw-r--r--node_modules/@csstools/css-tokenizer/dist/index.mjs1
3 files changed, 0 insertions, 629 deletions
diff --git a/node_modules/@csstools/css-tokenizer/dist/index.cjs b/node_modules/@csstools/css-tokenizer/dist/index.cjs
deleted file mode 100644
index 1a95fd10..00000000
--- a/node_modules/@csstools/css-tokenizer/dist/index.cjs
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,o,n,r){super(e),this.name="ParseError",this.sourceStart=o,this.sourceEnd=n,this.parserState=r}}class ParseErrorWithToken extends ParseError{token;constructor(e,o,n,r,t){super(e,o,n,r),this.token=t}}const e={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 "\\"'};class Reader{cursor=0;source="";codePointSource=[];representationIndices=[-1];length=0;representationStart=0;representationEnd=-1;constructor(e){this.source=e;{let o=-1,n="";for(n of e)o+=n.length,this.codePointSource.push(n.codePointAt(0)),this.representationIndices.push(o)}this.length=this.codePointSource.length}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor]}readCodePoint(e=1){const o=this.codePointSource[this.cursor];return void 0!==o&&(this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor],o)}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.representationIndices[this.cursor]}resetRepresentation(){this.representationStart=this.representationIndices[this.cursor]+1,this.representationEnd=-1}}const o="undefined"!=typeof globalThis&&"structuredClone"in globalThis;const n=39,r=42,t=8,i=13,s=9,c=58,a=44,u=64,d=127,p=33,T=12,P=46,S=62,k=45,C=31,l=69,f=101,x=123,m=40,h=91,E=60,y=10,v=11,g=95,I=1114111,U=0,O=35,D=37,R=43,w=34,L=65533,A=92,W=125,N=41,F=93,q=59,b=14,H=47,B=32,V=117,z=85,K=114,M=82,$=108,J=76,_=63,j=48,Q=70;function checkIfFourCodePointsWouldStartCDO(e){return e.codePointSource[e.cursor]===E&&e.codePointSource[e.cursor+1]===p&&e.codePointSource[e.cursor+2]===k&&e.codePointSource[e.cursor+3]===k}function isDigitCodePoint(e){return e>=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===g}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===k}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return e===y||e===i||e===T}function isWhitespace(e){return e===B||e===y||e===s||e===i||e===T}function checkIfTwoCodePointsAreAValidEscape(e){return e.codePointSource[e.cursor]===A&&!isNewLine(e.codePointSource[e.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,o){return o.codePointSource[o.cursor]===k?o.codePointSource[o.cursor+1]===k||(!!isIdentStartCodePoint(o.codePointSource[o.cursor+1])||o.codePointSource[o.cursor+1]===A&&!isNewLine(o.codePointSource[o.cursor+2])):!!isIdentStartCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(o)}function checkIfThreeCodePointsWouldStartANumber(e){return e.codePointSource[e.cursor]===R||e.codePointSource[e.cursor]===k?!!isDigitCodePoint(e.codePointSource[e.cursor+1])||e.codePointSource[e.cursor+1]===P&&isDigitCodePoint(e.codePointSource[e.cursor+2]):e.codePointSource[e.cursor]===P?isDigitCodePoint(e.codePointSource[e.cursor+1]):isDigitCodePoint(e.codePointSource[e.cursor])}function checkIfTwoCodePointsStartAComment(e){return e.codePointSource[e.cursor]===H&&e.codePointSource[e.cursor+1]===r}function checkIfThreeCodePointsWouldStartCDC(e){return e.codePointSource[e.cursor]===k&&e.codePointSource[e.cursor+1]===k&&e.codePointSource[e.cursor+2]===S}var G,X,Y;function consumeComment(o,n){for(n.advanceCodePoint(2);;){const t=n.readCodePoint();if(!1===t){const r=[exports.TokenType.Comment,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,void 0];return o.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInComment,n.representationStart,n.representationEnd,["4.3.2. Consume comments","Unexpected EOF"],r)),r}if(t===r&&(void 0!==n.codePointSource[n.cursor]&&n.codePointSource[n.cursor]===H)){n.advanceCodePoint();break}}return[exports.TokenType.Comment,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,void 0]}function consumeEscapedCodePoint(o,n){const r=n.readCodePoint();if(!1===r)return o.onParseError(new ParseError(e.UnexpectedEOFInEscapedCodePoint,n.representationStart,n.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),L;if(isHexDigitCodePoint(r)){const e=[r];for(;void 0!==n.codePointSource[n.cursor]&&isHexDigitCodePoint(n.codePointSource[n.cursor])&&e.length<6;)e.push(n.codePointSource[n.cursor]),n.advanceCodePoint();isWhitespace(n.codePointSource[n.cursor])&&n.advanceCodePoint();const o=parseInt(String.fromCodePoint(...e),16);return 0===o?L:(t=o)>=55296&&t<=57343||o>I?L:o}var t;return r}function consumeIdentSequence(e,o){const n=[];for(;;)if(isIdentCodePoint(o.codePointSource[o.cursor]))n.push(o.codePointSource[o.cursor]),o.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(o))return n;o.advanceCodePoint(),n.push(consumeEscapedCodePoint(e,o))}}function consumeHashToken(e,o){if(o.advanceCodePoint(),void 0!==o.codePointSource[o.cursor]&&(isIdentCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(o))){let n=exports.HashType.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)&&(n=exports.HashType.ID);const r=consumeIdentSequence(e,o);return[exports.TokenType.Hash,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r),type:n}]}return[exports.TokenType.Delim,"#",o.representationStart,o.representationEnd,{value:"#"}]}function consumeNumber(e,o){let n=exports.NumberType.Integer;for(o.codePointSource[o.cursor]!==R&&o.codePointSource[o.cursor]!==k||o.advanceCodePoint();isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===P&&isDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint(2),n=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===f||o.codePointSource[o.cursor]===l){if(isDigitCodePoint(o.codePointSource[o.cursor+1]))o.advanceCodePoint(2);else{if(o.codePointSource[o.cursor+1]!==k&&o.codePointSource[o.cursor+1]!==R||!isDigitCodePoint(o.codePointSource[o.cursor+2]))return n;o.advanceCodePoint(3)}for(n=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint()}return n}function consumeNumericToken(e,o){let n;{const e=o.codePointSource[o.cursor];e===k?n="-":e===R&&(n="+")}const r=consumeNumber(0,o),t=parseFloat(o.source.slice(o.representationStart,o.representationEnd+1));if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)){const i=consumeIdentSequence(e,o);return[exports.TokenType.Dimension,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n,type:r,unit:String.fromCodePoint(...i)}]}return o.codePointSource[o.cursor]===D?(o.advanceCodePoint(),[exports.TokenType.Percentage,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n}]):[exports.TokenType.Number,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n,type:r}]}function consumeWhiteSpace(e){for(;isWhitespace(e.codePointSource[e.cursor]);)e.advanceCodePoint();return[exports.TokenType.Whitespace,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0]}function consumeStringToken(o,n){let r="";const t=n.readCodePoint();for(;;){const s=n.readCodePoint();if(!1===s){const t=[exports.TokenType.String,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r}];return o.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInString,n.representationStart,n.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"],t)),t}if(isNewLine(s)){n.unreadCodePoint();const r=[exports.TokenType.BadString,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,void 0];return o.onParseError(new ParseErrorWithToken(e.UnexpectedNewLineInString,n.representationStart,n.codePointSource[n.cursor]===i&&n.codePointSource[n.cursor+1]===y?n.representationEnd+2:n.representationEnd+1,["4.3.5. Consume a string token","Unexpected newline"],r)),r}if(s===t)return[exports.TokenType.String,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r}];if(s!==A)r+=String.fromCodePoint(s);else{if(void 0===n.codePointSource[n.cursor])continue;if(isNewLine(n.codePointSource[n.cursor])){n.codePointSource[n.cursor]===i&&n.codePointSource[n.cursor+1]===y&&n.advanceCodePoint(),n.advanceCodePoint();continue}r+=String.fromCodePoint(consumeEscapedCodePoint(o,n))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==V&&e[0]!==z||e[1]!==K&&e[1]!==M||e[2]!==$&&e[2]!==J)}function consumeBadURL(e,o){for(;;){if(void 0===o.codePointSource[o.cursor])return;if(o.codePointSource[o.cursor]===N)return void o.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(o)?(o.advanceCodePoint(),consumeEscapedCodePoint(e,o)):o.advanceCodePoint()}}function consumeUrlToken(o,r){for(;isWhitespace(r.codePointSource[r.cursor]);)r.advanceCodePoint();let i="";for(;;){if(void 0===r.codePointSource[r.cursor]){const n=[exports.TokenType.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:i}];return o.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInURL,r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"],n)),n}if(r.codePointSource[r.cursor]===N)return r.advanceCodePoint(),[exports.TokenType.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:i}];if(isWhitespace(r.codePointSource[r.cursor])){for(r.advanceCodePoint();isWhitespace(r.codePointSource[r.cursor]);)r.advanceCodePoint();if(void 0===r.codePointSource[r.cursor]){const n=[exports.TokenType.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:i}];return o.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInURL,r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"],n)),n}return r.codePointSource[r.cursor]===N?(r.advanceCodePoint(),[exports.TokenType.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:i}]):(consumeBadURL(o,r),[exports.TokenType.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0])}if(r.codePointSource[r.cursor]===w||r.codePointSource[r.cursor]===n||r.codePointSource[r.cursor]===m||((s=r.codePointSource[r.cursor])===v||s===d||U<=s&&s<=t||b<=s&&s<=C)){consumeBadURL(o,r);const n=[exports.TokenType.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0];return o.onParseError(new ParseErrorWithToken(e.UnexpectedCharacterInURL,r.representationStart,r.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"],n)),n}if(r.codePointSource[r.cursor]===A){if(checkIfTwoCodePointsAreAValidEscape(r)){r.advanceCodePoint(),i+=String.fromCodePoint(consumeEscapedCodePoint(o,r));continue}consumeBadURL(o,r);const n=[exports.TokenType.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0];return o.onParseError(new ParseErrorWithToken(e.InvalidEscapeSequenceInURL,r.representationStart,r.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],n)),n}i+=String.fromCodePoint(r.codePointSource[r.cursor]),r.advanceCodePoint()}var s}function consumeIdentLikeToken(e,o){const r=consumeIdentSequence(e,o);if(o.codePointSource[o.cursor]!==m)return[exports.TokenType.Ident,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}];if(checkIfCodePointsMatchURLIdent(r)){o.advanceCodePoint();let t=0;for(;;){const e=isWhitespace(o.codePointSource[o.cursor]),i=isWhitespace(o.codePointSource[o.cursor+1]);if(e&&i){t+=1,o.advanceCodePoint(1);continue}const s=e?o.codePointSource[o.cursor+1]:o.codePointSource[o.cursor];if(s===w||s===n)return t>0&&o.unreadCodePoint(t),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}];break}return consumeUrlToken(e,o)}return o.advanceCodePoint(),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.codePointSource[e.cursor]!==V&&e.codePointSource[e.cursor]!==z||e.codePointSource[e.cursor+1]!==R||e.codePointSource[e.cursor+2]!==_&&!isHexDigitCodePoint(e.codePointSource[e.cursor+2]))}function consumeUnicodeRangeToken(e,o){o.advanceCodePoint(2);const n=[],r=[];for(;void 0!==o.codePointSource[o.cursor]&&n.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)n.push(o.codePointSource[o.cursor]),o.advanceCodePoint();for(;void 0!==o.codePointSource[o.cursor]&&n.length<6&&o.codePointSource[o.cursor]===_;)0===r.length&&r.push(...n),n.push(j),r.push(Q),o.advanceCodePoint();if(!r.length&&o.codePointSource[o.cursor]===k&&isHexDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint();void 0!==o.codePointSource[o.cursor]&&r.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)r.push(o.codePointSource[o.cursor]),o.advanceCodePoint();if(!r.length){const e=parseInt(String.fromCodePoint(...n),16);return[exports.TokenType.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:e,endOfRange:e}]}const t=parseInt(String.fromCodePoint(...n),16),i=parseInt(String.fromCodePoint(...r),16);return[exports.TokenType.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:t,endOfRange:i}]}function tokenizer(o,r){const t=o.css.valueOf(),d=o.unicodeRangesAllowed??!1,p=new Reader(t),S={onParseError:r?.onParseError??noop};return{nextToken:function nextToken(){p.resetRepresentation();const o=p.codePointSource[p.cursor];if(void 0===o)return[exports.TokenType.EOF,"",-1,-1,void 0];if(o===H&&checkIfTwoCodePointsStartAComment(p))return consumeComment(S,p);if(d&&(o===V||o===z)&&checkIfThreeCodePointsWouldStartAUnicodeRange(p))return consumeUnicodeRangeToken(0,p);if(isIdentStartCodePoint(o))return consumeIdentLikeToken(S,p);if(isDigitCodePoint(o))return consumeNumericToken(S,p);switch(o){case a:return p.advanceCodePoint(),[exports.TokenType.Comma,",",p.representationStart,p.representationEnd,void 0];case c:return p.advanceCodePoint(),[exports.TokenType.Colon,":",p.representationStart,p.representationEnd,void 0];case q:return p.advanceCodePoint(),[exports.TokenType.Semicolon,";",p.representationStart,p.representationEnd,void 0];case m:return p.advanceCodePoint(),[exports.TokenType.OpenParen,"(",p.representationStart,p.representationEnd,void 0];case N:return p.advanceCodePoint(),[exports.TokenType.CloseParen,")",p.representationStart,p.representationEnd,void 0];case h:return p.advanceCodePoint(),[exports.TokenType.OpenSquare,"[",p.representationStart,p.representationEnd,void 0];case F:return p.advanceCodePoint(),[exports.TokenType.CloseSquare,"]",p.representationStart,p.representationEnd,void 0];case x:return p.advanceCodePoint(),[exports.TokenType.OpenCurly,"{",p.representationStart,p.representationEnd,void 0];case W:return p.advanceCodePoint(),[exports.TokenType.CloseCurly,"}",p.representationStart,p.representationEnd,void 0];case n:case w:return consumeStringToken(S,p);case O:return consumeHashToken(S,p);case R:case P:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(S,p):(p.advanceCodePoint(),[exports.TokenType.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]);case y:case i:case T:case s:case B:return consumeWhiteSpace(p);case k:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(S,p):checkIfThreeCodePointsWouldStartCDC(p)?(p.advanceCodePoint(3),[exports.TokenType.CDC,"--\x3e",p.representationStart,p.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)?consumeIdentLikeToken(S,p):(p.advanceCodePoint(),[exports.TokenType.Delim,"-",p.representationStart,p.representationEnd,{value:"-"}]);case E:return checkIfFourCodePointsWouldStartCDO(p)?(p.advanceCodePoint(4),[exports.TokenType.CDO,"\x3c!--",p.representationStart,p.representationEnd,void 0]):(p.advanceCodePoint(),[exports.TokenType.Delim,"<",p.representationStart,p.representationEnd,{value:"<"}]);case u:if(p.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)){const e=consumeIdentSequence(S,p);return[exports.TokenType.AtKeyword,p.source.slice(p.representationStart,p.representationEnd+1),p.representationStart,p.representationEnd,{value:String.fromCodePoint(...e)}]}return[exports.TokenType.Delim,"@",p.representationStart,p.representationEnd,{value:"@"}];case A:{if(checkIfTwoCodePointsAreAValidEscape(p))return consumeIdentLikeToken(S,p);p.advanceCodePoint();const o=[exports.TokenType.Delim,"\\",p.representationStart,p.representationEnd,{value:"\\"}];return S.onParseError(new ParseErrorWithToken(e.InvalidEscapeSequenceAfterBackslash,p.representationStart,p.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],o)),o}}return p.advanceCodePoint(),[exports.TokenType.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]},endOfFile:function endOfFile(){return void 0===p.codePointSource[p.cursor]}}}function noop(){}function ensureThatValueRoundTripsAsIdent(e){let o=0;e[0]===k&&e[1]===k?o=2:e[0]===k&&e[1]?(o=2,isIdentStartCodePoint(e[1])||(o+=insertEscapedCodePoint(e,1,e[1]))):isIdentStartCodePoint(e[0])?o=1:(o=1,o+=insertEscapedCodePoint(e,0,e[0]));for(let n=o;n<e.length;n++)isIdentCodePoint(e[n])||(n+=insertEscapedCodePoint(e,n,e[n]));return e}function insertEscapedCodePoint(e,o,n){const r=n.toString(16),t=[];for(const e of r)t.push(e.codePointAt(0));const i=e[o+1];return o===e.length-1||i&&isHexDigitCodePoint(i)?(e.splice(o,1,92,...t,32),1+t.length):(e.splice(o,1,92,...t),t.length)}exports.TokenType=void 0,(G=exports.TokenType||(exports.TokenType={})).Comment="comment",G.AtKeyword="at-keyword-token",G.BadString="bad-string-token",G.BadURL="bad-url-token",G.CDC="CDC-token",G.CDO="CDO-token",G.Colon="colon-token",G.Comma="comma-token",G.Delim="delim-token",G.Dimension="dimension-token",G.EOF="EOF-token",G.Function="function-token",G.Hash="hash-token",G.Ident="ident-token",G.Number="number-token",G.Percentage="percentage-token",G.Semicolon="semicolon-token",G.String="string-token",G.URL="url-token",G.Whitespace="whitespace-token",G.OpenParen="(-token",G.CloseParen=")-token",G.OpenSquare="[-token",G.CloseSquare="]-token",G.OpenCurly="{-token",G.CloseCurly="}-token",G.UnicodeRange="unicode-range-token",exports.NumberType=void 0,(X=exports.NumberType||(exports.NumberType={})).Integer="integer",X.Number="number",exports.HashType=void 0,(Y=exports.HashType||(exports.HashType={})).Unrestricted="unrestricted",Y.ID="id";const Z=Object.values(exports.TokenType);exports.ParseError=ParseError,exports.ParseErrorMessage=e,exports.ParseErrorWithToken=ParseErrorWithToken,exports.Reader=Reader,exports.cloneTokens=function cloneTokens(e){return o?structuredClone(e):JSON.parse(JSON.stringify(e))},exports.isToken=function isToken(e){return!!Array.isArray(e)&&(!(e.length<4)&&(!!Z.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))},exports.isTokenAtKeyword=function isTokenAtKeyword(e){return!!e&&e[0]===exports.TokenType.AtKeyword},exports.isTokenBadString=function isTokenBadString(e){return!!e&&e[0]===exports.TokenType.BadString},exports.isTokenBadURL=function isTokenBadURL(e){return!!e&&e[0]===exports.TokenType.BadURL},exports.isTokenCDC=function isTokenCDC(e){return!!e&&e[0]===exports.TokenType.CDC},exports.isTokenCDO=function isTokenCDO(e){return!!e&&e[0]===exports.TokenType.CDO},exports.isTokenCloseCurly=function isTokenCloseCurly(e){return!!e&&e[0]===exports.TokenType.CloseCurly},exports.isTokenCloseParen=function isTokenCloseParen(e){return!!e&&e[0]===exports.TokenType.CloseParen},exports.isTokenCloseSquare=function isTokenCloseSquare(e){return!!e&&e[0]===exports.TokenType.CloseSquare},exports.isTokenColon=function isTokenColon(e){return!!e&&e[0]===exports.TokenType.Colon},exports.isTokenComma=function isTokenComma(e){return!!e&&e[0]===exports.TokenType.Comma},exports.isTokenComment=function isTokenComment(e){return!!e&&e[0]===exports.TokenType.Comment},exports.isTokenDelim=function isTokenDelim(e){return!!e&&e[0]===exports.TokenType.Delim},exports.isTokenDimension=function isTokenDimension(e){return!!e&&e[0]===exports.TokenType.Dimension},exports.isTokenEOF=function isTokenEOF(e){return!!e&&e[0]===exports.TokenType.EOF},exports.isTokenFunction=function isTokenFunction(e){return!!e&&e[0]===exports.TokenType.Function},exports.isTokenHash=function isTokenHash(e){return!!e&&e[0]===exports.TokenType.Hash},exports.isTokenIdent=function isTokenIdent(e){return!!e&&e[0]===exports.TokenType.Ident},exports.isTokenNumber=function isTokenNumber(e){return!!e&&e[0]===exports.TokenType.Number},exports.isTokenNumeric=function isTokenNumeric(e){switch(e[0]){case exports.TokenType.Dimension:case exports.TokenType.Number:case exports.TokenType.Percentage:return!0;default:return!1}},exports.isTokenOpenCurly=function isTokenOpenCurly(e){return!!e&&e[0]===exports.TokenType.OpenCurly},exports.isTokenOpenParen=function isTokenOpenParen(e){return!!e&&e[0]===exports.TokenType.OpenParen},exports.isTokenOpenSquare=function isTokenOpenSquare(e){return!!e&&e[0]===exports.TokenType.OpenSquare},exports.isTokenPercentage=function isTokenPercentage(e){return!!e&&e[0]===exports.TokenType.Percentage},exports.isTokenSemicolon=function isTokenSemicolon(e){return!!e&&e[0]===exports.TokenType.Semicolon},exports.isTokenString=function isTokenString(e){return!!e&&e[0]===exports.TokenType.String},exports.isTokenURL=function isTokenURL(e){return!!e&&e[0]===exports.TokenType.URL},exports.isTokenUnicodeRange=function isTokenUnicodeRange(e){return!!e&&e[0]===exports.TokenType.UnicodeRange},exports.isTokenWhiteSpaceOrComment=function isTokenWhiteSpaceOrComment(e){switch(e[0]){case exports.TokenType.Whitespace:case exports.TokenType.Comment:return!0;default:return!1}},exports.isTokenWhitespace=function isTokenWhitespace(e){return!!e&&e[0]===exports.TokenType.Whitespace},exports.mirrorVariant=function mirrorVariant(e){switch(e[0]){case exports.TokenType.OpenParen:return[exports.TokenType.CloseParen,")",-1,-1,void 0];case exports.TokenType.CloseParen:return[exports.TokenType.OpenParen,"(",-1,-1,void 0];case exports.TokenType.OpenCurly:return[exports.TokenType.CloseCurly,"}",-1,-1,void 0];case exports.TokenType.CloseCurly:return[exports.TokenType.OpenCurly,"{",-1,-1,void 0];case exports.TokenType.OpenSquare:return[exports.TokenType.CloseSquare,"]",-1,-1,void 0];case exports.TokenType.CloseSquare:return[exports.TokenType.OpenSquare,"[",-1,-1,void 0];default:return null}},exports.mirrorVariantType=function mirrorVariantType(e){switch(e){case exports.TokenType.OpenParen:return exports.TokenType.CloseParen;case exports.TokenType.CloseParen:return exports.TokenType.OpenParen;case exports.TokenType.OpenCurly:return exports.TokenType.CloseCurly;case exports.TokenType.CloseCurly:return exports.TokenType.OpenCurly;case exports.TokenType.OpenSquare:return exports.TokenType.CloseSquare;case exports.TokenType.CloseSquare:return exports.TokenType.OpenSquare;default:return null}},exports.mutateIdent=function mutateIdent(e,o){const n=[];for(const e of o)n.push(e.codePointAt(0));const r=String.fromCodePoint(...ensureThatValueRoundTripsAsIdent(n));e[1]=r,e[4].value=o},exports.mutateUnit=function mutateUnit(e,o){const n=[];for(const e of o)n.push(e.codePointAt(0));const r=ensureThatValueRoundTripsAsIdent(n);101===r[0]&&insertEscapedCodePoint(r,0,r[0]);const t=String.fromCodePoint(...r),i="+"===e[4].signCharacter?e[4].signCharacter:"",s=e[4].value.toString();e[1]=`${i}${s}${t}`,e[4].unit=o},exports.stringify=function stringify(...e){let o="";for(let n=0;n<e.length;n++)o+=e[n][1];return o},exports.tokenize=function tokenize(e,o){const n=tokenizer(e,o),r=[];{for(;!n.endOfFile();){const e=n.nextToken();e&&r.push(e)}const e=n.nextToken();e&&r.push(e)}return r},exports.tokenizer=tokenizer;
diff --git a/node_modules/@csstools/css-tokenizer/dist/index.d.ts b/node_modules/@csstools/css-tokenizer/dist/index.d.ts
deleted file mode 100644
index dc7c68ba..00000000
--- a/node_modules/@csstools/css-tokenizer/dist/index.d.ts
+++ /dev/null
@@ -1,627 +0,0 @@
-/**
- * Tokenize CSS following the {@link https://drafts.csswg.org/css-syntax/#tokenization | CSS Syntax Level 3 specification}.
- *
- * @remarks
- * The tokenizing and parsing tools provided by CSS Tools are designed to be low level and generic with strong ties to their respective specifications.
- *
- * Any analysis or mutation of CSS source code should be done with the least powerful tool that can accomplish the task.
- * For many applications it is sufficient to work with tokens.
- * For others you might need to use {@link https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms | @csstools/css-parser-algorithms} or a more specific parser.
- *
- * @example
- * Tokenize a string of CSS into an array of tokens:
- * ```js
- * import { tokenize } from '@csstools/css-tokenizer';
- *
- * const myCSS = `@media only screen and (min-width: 768rem) {
- * .foo {
- * content: 'Some content!' !important;
- * }
- * }
- * `;
- *
- * const tokens = tokenize({
- * css: myCSS,
- * });
- *
- * console.log(tokens);
- * ```
- *
- * @packageDocumentation
- */
-
-/**
- * Deep clone a list of tokens.
- * Useful for mutations without altering the original list.
- */
-export declare function cloneTokens(tokens: Array<CSSToken>): Array<CSSToken>;
-
-/**
- * @internal
- */
-export declare type CodePointReader = {
- representationStart: number;
- representationEnd: number;
- cursor: number;
- codePointSource: Array<number>;
- representationIndices: Array<number>;
- source: string;
- advanceCodePoint(n?: number): void;
- readCodePoint(n?: number): number | false;
- unreadCodePoint(n?: number): void;
- resetRepresentation(): void;
-};
-
-/**
- * The union of all possible CSS tokens
- */
-export declare type CSSToken = TokenAtKeyword | TokenBadString | TokenBadURL | TokenCDC | TokenCDO | TokenColon | TokenComma | TokenComment | TokenDelim | TokenDimension | TokenEOF | TokenFunction | TokenHash | TokenIdent | TokenNumber | TokenPercentage | TokenSemicolon | TokenString | TokenURL | TokenWhitespace | TokenOpenParen | TokenCloseParen | TokenOpenSquare | TokenCloseSquare | TokenOpenCurly | TokenCloseCurly | TokenUnicodeRange;
-
-/**
- * The type of hash token
- */
-export declare enum HashType {
- /**
- * The hash token did not start with an ident sequence (e.g. `#-2`)
- */
- Unrestricted = "unrestricted",
- /**
- * The hash token started with an ident sequence (e.g. `#foo`)
- * Only hash tokens with the "id" type are valid ID selectors.
- */
- ID = "id"
-}
-
-/**
- * Assert that a given value has the general structure of a CSS token:
- * 1. is an array.
- * 2. has at least four items.
- * 3. has a known token type.
- * 4. has a string representation.
- * 5. has a start position.
- * 6. has an end position.
- */
-export declare function isToken(x: any): x is CSSToken;
-
-export declare function isTokenAtKeyword(x?: CSSToken | null): x is TokenAtKeyword;
-
-export declare function isTokenBadString(x?: CSSToken | null): x is TokenBadString;
-
-export declare function isTokenBadURL(x?: CSSToken | null): x is TokenBadURL;
-
-export declare function isTokenCDC(x?: CSSToken | null): x is TokenCDC;
-
-export declare function isTokenCDO(x?: CSSToken | null): x is TokenCDO;
-
-export declare function isTokenCloseCurly(x?: CSSToken | null): x is TokenCloseCurly;
-
-export declare function isTokenCloseParen(x?: CSSToken | null): x is TokenCloseParen;
-
-export declare function isTokenCloseSquare(x?: CSSToken | null): x is TokenCloseSquare;
-
-export declare function isTokenColon(x?: CSSToken | null): x is TokenColon;
-
-export declare function isTokenComma(x?: CSSToken | null): x is TokenComma;
-
-export declare function isTokenComment(x?: CSSToken | null): x is TokenComment;
-
-export declare function isTokenDelim(x?: CSSToken | null): x is TokenDelim;
-
-export declare function isTokenDimension(x?: CSSToken | null): x is TokenDimension;
-
-export declare function isTokenEOF(x?: CSSToken | null): x is TokenEOF;
-
-export declare function isTokenFunction(x?: CSSToken | null): x is TokenFunction;
-
-export declare function isTokenHash(x?: CSSToken | null): x is TokenHash;
-
-export declare function isTokenIdent(x?: CSSToken | null): x is TokenIdent;
-
-export declare function isTokenNumber(x?: CSSToken | null): x is TokenNumber;
-
-/**
- * Assert that a token is a numeric token
- */
-export declare function isTokenNumeric(x: CSSToken): x is NumericToken;
-
-export declare function isTokenOpenCurly(x?: CSSToken | null): x is TokenOpenCurly;
-
-export declare function isTokenOpenParen(x?: CSSToken | null): x is TokenOpenParen;
-
-export declare function isTokenOpenSquare(x?: CSSToken | null): x is TokenOpenSquare;
-
-export declare function isTokenPercentage(x?: CSSToken | null): x is TokenPercentage;
-
-export declare function isTokenSemicolon(x?: CSSToken | null): x is TokenSemicolon;
-
-export declare function isTokenString(x?: CSSToken | null): x is TokenString;
-
-export declare function isTokenUnicodeRange(x?: CSSToken | null): x is TokenUnicodeRange;
-
-export declare function isTokenURL(x?: CSSToken | null): x is TokenURL;
-
-export declare function isTokenWhitespace(x?: CSSToken | null): x is TokenWhitespace;
-
-/**
- * Assert that a token is a whitespace or comment token
- */
-export declare function isTokenWhiteSpaceOrComment(x: CSSToken): x is TokenWhitespace | TokenComment;
-
-/**
- * Get the mirror variant of a given token
- *
- * @example
- *
- * ```js
- * const input = [TokenType.OpenParen, '(', 0, 1, undefined];
- * const output = mirrorVariant(input);
- *
- * console.log(output); // [TokenType.CloseParen, ')', -1, -1, undefined]
- * ```
- */
-export declare function mirrorVariant(token: CSSToken): CSSToken | null;
-
-/**
- * Get the mirror variant type of a given token type
- *
- * @example
- *
- * ```js
- * const input = TokenType.OpenParen;
- * const output = mirrorVariantType(input);
- *
- * console.log(output); // TokenType.CloseParen
- * ```
- */
-export declare function mirrorVariantType(type: TokenType): TokenType | null;
-
-/**
- * Set the ident value and update the string representation.
- * This handles escaping.
- */
-export declare function mutateIdent(ident: TokenIdent, newValue: string): void;
-
-/**
- * Set the unit and update the string representation.
- * This handles escaping.
- */
-export declare function mutateUnit(ident: TokenDimension, newUnit: string): void;
-
-/**
- * The type of number token
- * Either `integer` or `number`
- */
-export declare enum NumberType {
- Integer = "integer",
- Number = "number"
-}
-
-/**
- * The union of all possible CSS tokens that represent a numeric value
- */
-export declare type NumericToken = TokenDimension | TokenNumber | TokenPercentage;
-
-/**
- * The CSS Tokenizer is forgiving and will never throw on invalid input.
- * Any errors are reported through the `onParseError` callback.
- */
-export declare class ParseError extends Error {
- /** The index of the start character of the current token. */
- sourceStart: number;
- /** The index of the end character of the current token. */
- sourceEnd: number;
- /** The parser steps that preceded the error. */
- parserState: Array<string>;
- constructor(message: string, sourceStart: number, sourceEnd: number, parserState: Array<string>);
-}
-
-export declare const ParseErrorMessage: {
- UnexpectedNewLineInString: string;
- UnexpectedEOFInString: string;
- UnexpectedEOFInComment: string;
- UnexpectedEOFInURL: string;
- UnexpectedEOFInEscapedCodePoint: string;
- UnexpectedCharacterInURL: string;
- InvalidEscapeSequenceInURL: string;
- InvalidEscapeSequenceAfterBackslash: string;
-};
-
-export declare class ParseErrorWithToken extends ParseError {
- /** The associated token. */
- token: CSSToken;
- constructor(message: string, sourceStart: number, sourceEnd: number, parserState: Array<string>, token: CSSToken);
-}
-
-/**
- * @internal
- */
-export declare class Reader implements CodePointReader {
- cursor: number;
- source: string;
- codePointSource: Array<number>;
- representationIndices: Array<number>;
- length: number;
- representationStart: number;
- representationEnd: number;
- constructor(source: string);
- advanceCodePoint(n?: number): void;
- readCodePoint(n?: number): number | false;
- unreadCodePoint(n?: number): void;
- resetRepresentation(): void;
-}
-
-/**
- * Concatenate the string representation of a list of tokens.
- * This is not a proper serializer that will handle escaping and whitespace.
- * It only produces valid CSS for a token list that is also valid.
- */
-export declare function stringify(...tokens: Array<CSSToken>): string;
-
-/**
- * The CSS Token interface
- *
- * @remarks
- * CSS Tokens are fully typed and have a strict structure.
- * This makes it easier to iterate and analyze a token stream.
- *
- * The string representation and the parsed value are stored separately for many token types.
- * It is always assumed that the string representation will be used when stringifying, while the parsed value should be used when analyzing tokens.
- */
-export declare interface Token<T extends TokenType, U> extends Array<T | string | number | U> {
- /**
- * The type of token
- */
- 0: T;
- /**
- * The token representation
- *
- * @remarks
- * This field will be used when stringifying the token.
- * Any stored value is assumed to be valid CSS.
- *
- * You should never use this field when analyzing the token when there is a parsed value available.
- * But you must store mutated values here.
- */
- 1: string;
- /**
- * Start position of representation
- */
- 2: number;
- /**
- * End position of representation
- */
- 3: number;
- /**
- * Extra data
- *
- * @remarks
- * This holds the parsed value of each token.
- * These values are unescaped, unquoted, converted to numbers, etc.
- *
- * You should always use this field when analyzing the token.
- * But you must not assume that mutating only this field will have any effect.
- */
- 4: U;
-}
-
-export declare interface TokenAtKeyword extends Token<TokenType.AtKeyword, {
- /**
- * The unescaped at-keyword name without the leading `@`.
- */
- value: string;
-}> {
-}
-
-export declare interface TokenBadString extends Token<TokenType.BadString, undefined> {
-}
-
-export declare interface TokenBadURL extends Token<TokenType.BadURL, undefined> {
-}
-
-export declare interface TokenCDC extends Token<TokenType.CDC, undefined> {
-}
-
-export declare interface TokenCDO extends Token<TokenType.CDO, undefined> {
-}
-
-export declare interface TokenCloseCurly extends Token<TokenType.CloseCurly, undefined> {
-}
-
-export declare interface TokenCloseParen extends Token<TokenType.CloseParen, undefined> {
-}
-
-export declare interface TokenCloseSquare extends Token<TokenType.CloseSquare, undefined> {
-}
-
-export declare interface TokenColon extends Token<TokenType.Colon, undefined> {
-}
-
-export declare interface TokenComma extends Token<TokenType.Comma, undefined> {
-}
-
-export declare interface TokenComment extends Token<TokenType.Comment, undefined> {
-}
-
-export declare interface TokenDelim extends Token<TokenType.Delim, {
- /**
- * The delim character.
- */
- value: string;
-}> {
-}
-
-export declare interface TokenDimension extends Token<TokenType.Dimension, {
- /**
- * The numeric value.
- */
- value: number;
- /**
- * The unescaped unit name.
- */
- unit: string;
- /**
- * `integer` or `number`
- */
- type: NumberType;
- /**
- * The sign character as it appeared in the source.
- * This is only useful if you need to determine if a value was written as "2px" or "+2px".
- */
- signCharacter?: '+' | '-';
-}> {
-}
-
-export declare interface TokenEOF extends Token<TokenType.EOF, undefined> {
-}
-
-export declare interface TokenFunction extends Token<TokenType.Function, {
- /**
- * The unescaped function name without the trailing `(`.
- */
- value: string;
-}> {
-}
-
-export declare interface TokenHash extends Token<TokenType.Hash, {
- /**
- * The unescaped hash value without the leading `#`.
- */
- value: string;
- /**
- * The hash type.
- */
- type: HashType;
-}> {
-}
-
-export declare interface TokenIdent extends Token<TokenType.Ident, {
- /**
- * The unescaped ident value.
- */
- value: string;
-}> {
-}
-
-/**
- * Tokenize a CSS string into a list of tokens.
- */
-export declare function tokenize(input: {
- css: {
- valueOf(): string;
- };
- unicodeRangesAllowed?: boolean;
-}, options?: {
- onParseError?: (error: ParseError) => void;
-}): Array<CSSToken>;
-
-/**
- * Create a tokenizer for a CSS string.
- */
-export declare function tokenizer(input: {
- css: {
- valueOf(): string;
- };
- unicodeRangesAllowed?: boolean;
-}, options?: {
- onParseError?: (error: ParseError) => void;
-}): {
- nextToken: () => CSSToken | undefined;
- endOfFile: () => boolean;
-};
-
-export declare interface TokenNumber extends Token<TokenType.Number, {
- /**
- * The numeric value.
- */
- value: number;
- /**
- * `integer` or `number`
- */
- type: NumberType;
- /**
- * The sign character as it appeared in the source.
- * This is only useful if you need to determine if a value was written as "2" or "+2".
- */
- signCharacter?: '+' | '-';
-}> {
-}
-
-export declare interface TokenOpenCurly extends Token<TokenType.OpenCurly, undefined> {
-}
-
-export declare interface TokenOpenParen extends Token<TokenType.OpenParen, undefined> {
-}
-
-export declare interface TokenOpenSquare extends Token<TokenType.OpenSquare, undefined> {
-}
-
-export declare interface TokenPercentage extends Token<TokenType.Percentage, {
- /**
- * The numeric value.
- */
- value: number;
- /**
- * The sign character as it appeared in the source.
- * This is only useful if you need to determine if a value was written as "2%" or "+2%".
- */
- signCharacter?: '+' | '-';
-}> {
-}
-
-export declare interface TokenSemicolon extends Token<TokenType.Semicolon, undefined> {
-}
-
-export declare interface TokenString extends Token<TokenType.String, {
- /**
- * The unescaped string value without the leading and trailing quotes.
- */
- value: string;
-}> {
-}
-
-/**
- * All possible CSS token types
- */
-export declare enum TokenType {
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#comment-diagram}
- */
- Comment = "comment",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-at-keyword-token}
- */
- AtKeyword = "at-keyword-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-bad-string-token}
- */
- BadString = "bad-string-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-bad-url-token}
- */
- BadURL = "bad-url-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-cdc-token}
- */
- CDC = "CDC-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-cdo-token}
- */
- CDO = "CDO-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-colon-token}
- */
- Colon = "colon-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-comma-token}
- */
- Comma = "comma-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-delim-token}
- */
- Delim = "delim-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-dimension-token}
- */
- Dimension = "dimension-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-eof-token}
- */
- EOF = "EOF-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-function-token}
- */
- Function = "function-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-hash-token}
- */
- Hash = "hash-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-ident-token}
- */
- Ident = "ident-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-percentage-token}
- */
- Number = "number-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-percentage-token}
- */
- Percentage = "percentage-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-semicolon-token}
- */
- Semicolon = "semicolon-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-string-token}
- */
- String = "string-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-url-token}
- */
- URL = "url-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-whitespace-token}
- */
- Whitespace = "whitespace-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-paren}
- */
- OpenParen = "(-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-paren}
- */
- CloseParen = ")-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-square}
- */
- OpenSquare = "[-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-square}
- */
- CloseSquare = "]-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-curly}
- */
- OpenCurly = "{-token",
- /**
- * @see {@link https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-curly}
- */
- CloseCurly = "}-token",
- /**
- * Only appears in the token stream when the `unicodeRangesAllowed` option is set to true.
- *
- * @example
- * ```js
- * import { tokenize } from '@csstools/css-tokenizer';
- *
- * const tokens = tokenize({
- * css: `U+0025-00FF, U+4??`,
- * unicodeRangesAllowed: true,
- * });
- *
- * console.log(tokens);
- * ```
- *
- * @see {@link https://drafts.csswg.org/css-syntax/#typedef-unicode-range-token}
- */
- UnicodeRange = "unicode-range-token"
-}
-
-export declare interface TokenUnicodeRange extends Token<TokenType.UnicodeRange, {
- startOfRange: number;
- endOfRange: number;
-}> {
-}
-
-export declare interface TokenURL extends Token<TokenType.URL, {
- /**
- * The unescaped URL value without the leading `url(` and trailing `)`.
- */
- value: string;
-}> {
-}
-
-export declare interface TokenWhitespace extends Token<TokenType.Whitespace, undefined> {
-}
-
-export { }
diff --git a/node_modules/@csstools/css-tokenizer/dist/index.mjs b/node_modules/@csstools/css-tokenizer/dist/index.mjs
deleted file mode 100644
index 546539f4..00000000
--- a/node_modules/@csstools/css-tokenizer/dist/index.mjs
+++ /dev/null
@@ -1 +0,0 @@
-class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,n,o,t){super(e),this.name="ParseError",this.sourceStart=n,this.sourceEnd=o,this.parserState=t}}class ParseErrorWithToken extends ParseError{token;constructor(e,n,o,t,r){super(e,n,o,t),this.token=r}}const e={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 "\\"'};class Reader{cursor=0;source="";codePointSource=[];representationIndices=[-1];length=0;representationStart=0;representationEnd=-1;constructor(e){this.source=e;{let n=-1,o="";for(o of e)n+=o.length,this.codePointSource.push(o.codePointAt(0)),this.representationIndices.push(n)}this.length=this.codePointSource.length}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor]}readCodePoint(e=1){const n=this.codePointSource[this.cursor];return void 0!==n&&(this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor],n)}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.representationIndices[this.cursor]}resetRepresentation(){this.representationStart=this.representationIndices[this.cursor]+1,this.representationEnd=-1}}const n="undefined"!=typeof globalThis&&"structuredClone"in globalThis;function cloneTokens(e){return n?structuredClone(e):JSON.parse(JSON.stringify(e))}function stringify(...e){let n="";for(let o=0;o<e.length;o++)n+=e[o][1];return n}const o=39,t=42,r=8,i=13,s=9,c=58,a=44,u=64,d=127,p=33,P=12,S=46,C=62,l=45,f=31,m=69,h=101,k=123,E=40,T=91,v=60,g=10,I=11,U=95,O=1114111,D=0,R=35,w=37,L=43,A=34,x=65533,W=92,y=125,F=41,q=93,N=59,b=14,B=47,H=32,V=117,K=85,z=114,M=82,$=108,J=76,_=63,j=48,Q=70;function checkIfFourCodePointsWouldStartCDO(e){return e.codePointSource[e.cursor]===v&&e.codePointSource[e.cursor+1]===p&&e.codePointSource[e.cursor+2]===l&&e.codePointSource[e.cursor+3]===l}function isDigitCodePoint(e){return e>=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===U}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===l}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return e===g||e===i||e===P}function isWhitespace(e){return e===H||e===g||e===s||e===i||e===P}function checkIfTwoCodePointsAreAValidEscape(e){return e.codePointSource[e.cursor]===W&&!isNewLine(e.codePointSource[e.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,n){return n.codePointSource[n.cursor]===l?n.codePointSource[n.cursor+1]===l||(!!isIdentStartCodePoint(n.codePointSource[n.cursor+1])||n.codePointSource[n.cursor+1]===W&&!isNewLine(n.codePointSource[n.cursor+2])):!!isIdentStartCodePoint(n.codePointSource[n.cursor])||checkIfTwoCodePointsAreAValidEscape(n)}function checkIfThreeCodePointsWouldStartANumber(e){return e.codePointSource[e.cursor]===L||e.codePointSource[e.cursor]===l?!!isDigitCodePoint(e.codePointSource[e.cursor+1])||e.codePointSource[e.cursor+1]===S&&isDigitCodePoint(e.codePointSource[e.cursor+2]):e.codePointSource[e.cursor]===S?isDigitCodePoint(e.codePointSource[e.cursor+1]):isDigitCodePoint(e.codePointSource[e.cursor])}function checkIfTwoCodePointsStartAComment(e){return e.codePointSource[e.cursor]===B&&e.codePointSource[e.cursor+1]===t}function checkIfThreeCodePointsWouldStartCDC(e){return e.codePointSource[e.cursor]===l&&e.codePointSource[e.cursor+1]===l&&e.codePointSource[e.cursor+2]===C}var G,X,Y;function mirrorVariantType(e){switch(e){case G.OpenParen:return G.CloseParen;case G.CloseParen:return G.OpenParen;case G.OpenCurly:return G.CloseCurly;case G.CloseCurly:return G.OpenCurly;case G.OpenSquare:return G.CloseSquare;case G.CloseSquare:return G.OpenSquare;default:return null}}function mirrorVariant(e){switch(e[0]){case G.OpenParen:return[G.CloseParen,")",-1,-1,void 0];case G.CloseParen:return[G.OpenParen,"(",-1,-1,void 0];case G.OpenCurly:return[G.CloseCurly,"}",-1,-1,void 0];case G.CloseCurly:return[G.OpenCurly,"{",-1,-1,void 0];case G.OpenSquare:return[G.CloseSquare,"]",-1,-1,void 0];case G.CloseSquare:return[G.OpenSquare,"[",-1,-1,void 0];default:return null}}function consumeComment(n,o){for(o.advanceCodePoint(2);;){const r=o.readCodePoint();if(!1===r){const t=[G.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInComment,o.representationStart,o.representationEnd,["4.3.2. Consume comments","Unexpected EOF"],t)),t}if(r===t&&(void 0!==o.codePointSource[o.cursor]&&o.codePointSource[o.cursor]===B)){o.advanceCodePoint();break}}return[G.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeEscapedCodePoint(n,o){const t=o.readCodePoint();if(!1===t)return n.onParseError(new ParseError(e.UnexpectedEOFInEscapedCodePoint,o.representationStart,o.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),x;if(isHexDigitCodePoint(t)){const e=[t];for(;void 0!==o.codePointSource[o.cursor]&&isHexDigitCodePoint(o.codePointSource[o.cursor])&&e.length<6;)e.push(o.codePointSource[o.cursor]),o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor])&&o.advanceCodePoint();const n=parseInt(String.fromCodePoint(...e),16);return 0===n?x:(r=n)>=55296&&r<=57343||n>O?x:n}var r;return t}function consumeIdentSequence(e,n){const o=[];for(;;)if(isIdentCodePoint(n.codePointSource[n.cursor]))o.push(n.codePointSource[n.cursor]),n.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(n))return o;n.advanceCodePoint(),o.push(consumeEscapedCodePoint(e,n))}}function consumeHashToken(e,n){if(n.advanceCodePoint(),void 0!==n.codePointSource[n.cursor]&&(isIdentCodePoint(n.codePointSource[n.cursor])||checkIfTwoCodePointsAreAValidEscape(n))){let o=Y.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)&&(o=Y.ID);const t=consumeIdentSequence(e,n);return[G.Hash,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...t),type:o}]}return[G.Delim,"#",n.representationStart,n.representationEnd,{value:"#"}]}function consumeNumber(e,n){let o=X.Integer;for(n.codePointSource[n.cursor]!==L&&n.codePointSource[n.cursor]!==l||n.advanceCodePoint();isDigitCodePoint(n.codePointSource[n.cursor]);)n.advanceCodePoint();if(n.codePointSource[n.cursor]===S&&isDigitCodePoint(n.codePointSource[n.cursor+1]))for(n.advanceCodePoint(2),o=X.Number;isDigitCodePoint(n.codePointSource[n.cursor]);)n.advanceCodePoint();if(n.codePointSource[n.cursor]===h||n.codePointSource[n.cursor]===m){if(isDigitCodePoint(n.codePointSource[n.cursor+1]))n.advanceCodePoint(2);else{if(n.codePointSource[n.cursor+1]!==l&&n.codePointSource[n.cursor+1]!==L||!isDigitCodePoint(n.codePointSource[n.cursor+2]))return o;n.advanceCodePoint(3)}for(o=X.Number;isDigitCodePoint(n.codePointSource[n.cursor]);)n.advanceCodePoint()}return o}function consumeNumericToken(e,n){let o;{const e=n.codePointSource[n.cursor];e===l?o="-":e===L&&(o="+")}const t=consumeNumber(0,n),r=parseFloat(n.source.slice(n.representationStart,n.representationEnd+1));if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)){const i=consumeIdentSequence(e,n);return[G.Dimension,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r,signCharacter:o,type:t,unit:String.fromCodePoint(...i)}]}return n.codePointSource[n.cursor]===w?(n.advanceCodePoint(),[G.Percentage,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r,signCharacter:o}]):[G.Number,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:r,signCharacter:o,type:t}]}function consumeWhiteSpace(e){for(;isWhitespace(e.codePointSource[e.cursor]);)e.advanceCodePoint();return[G.Whitespace,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0]}function consumeStringToken(n,o){let t="";const r=o.readCodePoint();for(;;){const s=o.readCodePoint();if(!1===s){const r=[G.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t}];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInString,o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"],r)),r}if(isNewLine(s)){o.unreadCodePoint();const t=[G.BadString,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.UnexpectedNewLineInString,o.representationStart,o.codePointSource[o.cursor]===i&&o.codePointSource[o.cursor+1]===g?o.representationEnd+2:o.representationEnd+1,["4.3.5. Consume a string token","Unexpected newline"],t)),t}if(s===r)return[G.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t}];if(s!==W)t+=String.fromCodePoint(s);else{if(void 0===o.codePointSource[o.cursor])continue;if(isNewLine(o.codePointSource[o.cursor])){o.codePointSource[o.cursor]===i&&o.codePointSource[o.cursor+1]===g&&o.advanceCodePoint(),o.advanceCodePoint();continue}t+=String.fromCodePoint(consumeEscapedCodePoint(n,o))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==V&&e[0]!==K||e[1]!==z&&e[1]!==M||e[2]!==$&&e[2]!==J)}function consumeBadURL(e,n){for(;;){if(void 0===n.codePointSource[n.cursor])return;if(n.codePointSource[n.cursor]===F)return void n.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(n)?(n.advanceCodePoint(),consumeEscapedCodePoint(e,n)):n.advanceCodePoint()}}function consumeUrlToken(n,t){for(;isWhitespace(t.codePointSource[t.cursor]);)t.advanceCodePoint();let i="";for(;;){if(void 0===t.codePointSource[t.cursor]){const o=[G.URL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:i}];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInURL,t.representationStart,t.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"],o)),o}if(t.codePointSource[t.cursor]===F)return t.advanceCodePoint(),[G.URL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:i}];if(isWhitespace(t.codePointSource[t.cursor])){for(t.advanceCodePoint();isWhitespace(t.codePointSource[t.cursor]);)t.advanceCodePoint();if(void 0===t.codePointSource[t.cursor]){const o=[G.URL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:i}];return n.onParseError(new ParseErrorWithToken(e.UnexpectedEOFInURL,t.representationStart,t.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"],o)),o}return t.codePointSource[t.cursor]===F?(t.advanceCodePoint(),[G.URL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:i}]):(consumeBadURL(n,t),[G.BadURL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0])}if(t.codePointSource[t.cursor]===A||t.codePointSource[t.cursor]===o||t.codePointSource[t.cursor]===E||((s=t.codePointSource[t.cursor])===I||s===d||D<=s&&s<=r||b<=s&&s<=f)){consumeBadURL(n,t);const o=[G.BadURL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.UnexpectedCharacterInURL,t.representationStart,t.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"],o)),o}if(t.codePointSource[t.cursor]===W){if(checkIfTwoCodePointsAreAValidEscape(t)){t.advanceCodePoint(),i+=String.fromCodePoint(consumeEscapedCodePoint(n,t));continue}consumeBadURL(n,t);const o=[G.BadURL,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,void 0];return n.onParseError(new ParseErrorWithToken(e.InvalidEscapeSequenceInURL,t.representationStart,t.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],o)),o}i+=String.fromCodePoint(t.codePointSource[t.cursor]),t.advanceCodePoint()}var s}function consumeIdentLikeToken(e,n){const t=consumeIdentSequence(e,n);if(n.codePointSource[n.cursor]!==E)return[G.Ident,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...t)}];if(checkIfCodePointsMatchURLIdent(t)){n.advanceCodePoint();let r=0;for(;;){const e=isWhitespace(n.codePointSource[n.cursor]),i=isWhitespace(n.codePointSource[n.cursor+1]);if(e&&i){r+=1,n.advanceCodePoint(1);continue}const s=e?n.codePointSource[n.cursor+1]:n.codePointSource[n.cursor];if(s===A||s===o)return r>0&&n.unreadCodePoint(r),[G.Function,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...t)}];break}return consumeUrlToken(e,n)}return n.advanceCodePoint(),[G.Function,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCodePoint(...t)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.codePointSource[e.cursor]!==V&&e.codePointSource[e.cursor]!==K||e.codePointSource[e.cursor+1]!==L||e.codePointSource[e.cursor+2]!==_&&!isHexDigitCodePoint(e.codePointSource[e.cursor+2]))}function consumeUnicodeRangeToken(e,n){n.advanceCodePoint(2);const o=[],t=[];for(;void 0!==n.codePointSource[n.cursor]&&o.length<6&&isHexDigitCodePoint(n.codePointSource[n.cursor]);)o.push(n.codePointSource[n.cursor]),n.advanceCodePoint();for(;void 0!==n.codePointSource[n.cursor]&&o.length<6&&n.codePointSource[n.cursor]===_;)0===t.length&&t.push(...o),o.push(j),t.push(Q),n.advanceCodePoint();if(!t.length&&n.codePointSource[n.cursor]===l&&isHexDigitCodePoint(n.codePointSource[n.cursor+1]))for(n.advanceCodePoint();void 0!==n.codePointSource[n.cursor]&&t.length<6&&isHexDigitCodePoint(n.codePointSource[n.cursor]);)t.push(n.codePointSource[n.cursor]),n.advanceCodePoint();if(!t.length){const e=parseInt(String.fromCodePoint(...o),16);return[G.UnicodeRange,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{startOfRange:e,endOfRange:e}]}const r=parseInt(String.fromCodePoint(...o),16),i=parseInt(String.fromCodePoint(...t),16);return[G.UnicodeRange,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{startOfRange:r,endOfRange:i}]}function tokenize(e,n){const o=tokenizer(e,n),t=[];{for(;!o.endOfFile();){const e=o.nextToken();e&&t.push(e)}const e=o.nextToken();e&&t.push(e)}return t}function tokenizer(n,t){const r=n.css.valueOf(),d=n.unicodeRangesAllowed??!1,p=new Reader(r),C={onParseError:t?.onParseError??noop};return{nextToken:function nextToken(){p.resetRepresentation();const n=p.codePointSource[p.cursor];if(void 0===n)return[G.EOF,"",-1,-1,void 0];if(n===B&&checkIfTwoCodePointsStartAComment(p))return consumeComment(C,p);if(d&&(n===V||n===K)&&checkIfThreeCodePointsWouldStartAUnicodeRange(p))return consumeUnicodeRangeToken(0,p);if(isIdentStartCodePoint(n))return consumeIdentLikeToken(C,p);if(isDigitCodePoint(n))return consumeNumericToken(C,p);switch(n){case a:return p.advanceCodePoint(),[G.Comma,",",p.representationStart,p.representationEnd,void 0];case c:return p.advanceCodePoint(),[G.Colon,":",p.representationStart,p.representationEnd,void 0];case N:return p.advanceCodePoint(),[G.Semicolon,";",p.representationStart,p.representationEnd,void 0];case E:return p.advanceCodePoint(),[G.OpenParen,"(",p.representationStart,p.representationEnd,void 0];case F:return p.advanceCodePoint(),[G.CloseParen,")",p.representationStart,p.representationEnd,void 0];case T:return p.advanceCodePoint(),[G.OpenSquare,"[",p.representationStart,p.representationEnd,void 0];case q:return p.advanceCodePoint(),[G.CloseSquare,"]",p.representationStart,p.representationEnd,void 0];case k:return p.advanceCodePoint(),[G.OpenCurly,"{",p.representationStart,p.representationEnd,void 0];case y:return p.advanceCodePoint(),[G.CloseCurly,"}",p.representationStart,p.representationEnd,void 0];case o:case A:return consumeStringToken(C,p);case R:return consumeHashToken(C,p);case L:case S:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(C,p):(p.advanceCodePoint(),[G.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]);case g:case i:case P:case s:case H:return consumeWhiteSpace(p);case l:return checkIfThreeCodePointsWouldStartANumber(p)?consumeNumericToken(C,p):checkIfThreeCodePointsWouldStartCDC(p)?(p.advanceCodePoint(3),[G.CDC,"--\x3e",p.representationStart,p.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)?consumeIdentLikeToken(C,p):(p.advanceCodePoint(),[G.Delim,"-",p.representationStart,p.representationEnd,{value:"-"}]);case v:return checkIfFourCodePointsWouldStartCDO(p)?(p.advanceCodePoint(4),[G.CDO,"\x3c!--",p.representationStart,p.representationEnd,void 0]):(p.advanceCodePoint(),[G.Delim,"<",p.representationStart,p.representationEnd,{value:"<"}]);case u:if(p.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,p)){const e=consumeIdentSequence(C,p);return[G.AtKeyword,p.source.slice(p.representationStart,p.representationEnd+1),p.representationStart,p.representationEnd,{value:String.fromCodePoint(...e)}]}return[G.Delim,"@",p.representationStart,p.representationEnd,{value:"@"}];case W:{if(checkIfTwoCodePointsAreAValidEscape(p))return consumeIdentLikeToken(C,p);p.advanceCodePoint();const n=[G.Delim,"\\",p.representationStart,p.representationEnd,{value:"\\"}];return C.onParseError(new ParseErrorWithToken(e.InvalidEscapeSequenceAfterBackslash,p.representationStart,p.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"],n)),n}}return p.advanceCodePoint(),[G.Delim,p.source[p.representationStart],p.representationStart,p.representationEnd,{value:p.source[p.representationStart]}]},endOfFile:function endOfFile(){return void 0===p.codePointSource[p.cursor]}}}function noop(){}function mutateIdent(e,n){const o=[];for(const e of n)o.push(e.codePointAt(0));const t=String.fromCodePoint(...ensureThatValueRoundTripsAsIdent(o));e[1]=t,e[4].value=n}function mutateUnit(e,n){const o=[];for(const e of n)o.push(e.codePointAt(0));const t=ensureThatValueRoundTripsAsIdent(o);101===t[0]&&insertEscapedCodePoint(t,0,t[0]);const r=String.fromCodePoint(...t),i="+"===e[4].signCharacter?e[4].signCharacter:"",s=e[4].value.toString();e[1]=`${i}${s}${r}`,e[4].unit=n}function ensureThatValueRoundTripsAsIdent(e){let n=0;e[0]===l&&e[1]===l?n=2:e[0]===l&&e[1]?(n=2,isIdentStartCodePoint(e[1])||(n+=insertEscapedCodePoint(e,1,e[1]))):isIdentStartCodePoint(e[0])?n=1:(n=1,n+=insertEscapedCodePoint(e,0,e[0]));for(let o=n;o<e.length;o++)isIdentCodePoint(e[o])||(o+=insertEscapedCodePoint(e,o,e[o]));return e}function insertEscapedCodePoint(e,n,o){const t=o.toString(16),r=[];for(const e of t)r.push(e.codePointAt(0));const i=e[n+1];return n===e.length-1||i&&isHexDigitCodePoint(i)?(e.splice(n,1,92,...r,32),1+r.length):(e.splice(n,1,92,...r),r.length)}!function(e){e.Comment="comment",e.AtKeyword="at-keyword-token",e.BadString="bad-string-token",e.BadURL="bad-url-token",e.CDC="CDC-token",e.CDO="CDO-token",e.Colon="colon-token",e.Comma="comma-token",e.Delim="delim-token",e.Dimension="dimension-token",e.EOF="EOF-token",e.Function="function-token",e.Hash="hash-token",e.Ident="ident-token",e.Number="number-token",e.Percentage="percentage-token",e.Semicolon="semicolon-token",e.String="string-token",e.URL="url-token",e.Whitespace="whitespace-token",e.OpenParen="(-token",e.CloseParen=")-token",e.OpenSquare="[-token",e.CloseSquare="]-token",e.OpenCurly="{-token",e.CloseCurly="}-token",e.UnicodeRange="unicode-range-token"}(G||(G={})),function(e){e.Integer="integer",e.Number="number"}(X||(X={})),function(e){e.Unrestricted="unrestricted",e.ID="id"}(Y||(Y={}));const Z=Object.values(G);function isToken(e){return!!Array.isArray(e)&&(!(e.length<4)&&(!!Z.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))}function isTokenNumeric(e){switch(e[0]){case G.Dimension:case G.Number:case G.Percentage:return!0;default:return!1}}function isTokenWhiteSpaceOrComment(e){switch(e[0]){case G.Whitespace:case G.Comment:return!0;default:return!1}}function isTokenAtKeyword(e){return!!e&&e[0]===G.AtKeyword}function isTokenBadString(e){return!!e&&e[0]===G.BadString}function isTokenBadURL(e){return!!e&&e[0]===G.BadURL}function isTokenCDC(e){return!!e&&e[0]===G.CDC}function isTokenCDO(e){return!!e&&e[0]===G.CDO}function isTokenColon(e){return!!e&&e[0]===G.Colon}function isTokenComma(e){return!!e&&e[0]===G.Comma}function isTokenComment(e){return!!e&&e[0]===G.Comment}function isTokenDelim(e){return!!e&&e[0]===G.Delim}function isTokenDimension(e){return!!e&&e[0]===G.Dimension}function isTokenEOF(e){return!!e&&e[0]===G.EOF}function isTokenFunction(e){return!!e&&e[0]===G.Function}function isTokenHash(e){return!!e&&e[0]===G.Hash}function isTokenIdent(e){return!!e&&e[0]===G.Ident}function isTokenNumber(e){return!!e&&e[0]===G.Number}function isTokenPercentage(e){return!!e&&e[0]===G.Percentage}function isTokenSemicolon(e){return!!e&&e[0]===G.Semicolon}function isTokenString(e){return!!e&&e[0]===G.String}function isTokenURL(e){return!!e&&e[0]===G.URL}function isTokenWhitespace(e){return!!e&&e[0]===G.Whitespace}function isTokenOpenParen(e){return!!e&&e[0]===G.OpenParen}function isTokenCloseParen(e){return!!e&&e[0]===G.CloseParen}function isTokenOpenSquare(e){return!!e&&e[0]===G.OpenSquare}function isTokenCloseSquare(e){return!!e&&e[0]===G.CloseSquare}function isTokenOpenCurly(e){return!!e&&e[0]===G.OpenCurly}function isTokenCloseCurly(e){return!!e&&e[0]===G.CloseCurly}function isTokenUnicodeRange(e){return!!e&&e[0]===G.UnicodeRange}export{Y as HashType,X as NumberType,ParseError,e as ParseErrorMessage,ParseErrorWithToken,Reader,G as TokenType,cloneTokens,isToken,isTokenAtKeyword,isTokenBadString,isTokenBadURL,isTokenCDC,isTokenCDO,isTokenCloseCurly,isTokenCloseParen,isTokenCloseSquare,isTokenColon,isTokenComma,isTokenComment,isTokenDelim,isTokenDimension,isTokenEOF,isTokenFunction,isTokenHash,isTokenIdent,isTokenNumber,isTokenNumeric,isTokenOpenCurly,isTokenOpenParen,isTokenOpenSquare,isTokenPercentage,isTokenSemicolon,isTokenString,isTokenURL,isTokenUnicodeRange,isTokenWhiteSpaceOrComment,isTokenWhitespace,mirrorVariant,mirrorVariantType,mutateIdent,mutateUnit,stringify,tokenize,tokenizer};