import{Function as e,Ident as r,Dimension as a,Percentage as t,Number as s,String as c,BadString as o,Url as i,BadUrl as n,Delim as d,RightCurlyBracket as k,LeftCurlyBracket as b,RightSquareBracket as f,LeftSquareBracket as m,AtKeyword as p,CDO as u,Semicolon as h,Colon as l,Comment as v,CDC as g,Comma as S,RightParenthesis as j,LeftParenthesis as x,Hash as C,WhiteSpace as y}from"./types.mjs";import*as A from"./types.mjs";export{A as tokenTypes};export{EOF}from"./types.mjs";import{isBOM as w,charCodeCategory as E,NameStartCategory as L,DigitCategory as N,isValidEscape as D,isIdentifierStart as T,isNumberStart as O,isName as W,WhiteSpaceCategory as F,isNewline as H,NonPrintableCategory as P}from"./char-code-definitions.mjs";export{EofCategory,isDigit,isHexDigit,isLetter,isLowercaseLetter,isNameStart,isNonAscii,isNonPrintable,isUppercaseLetter,isWhiteSpace}from"./char-code-definitions.mjs";import{consumeName as U,findWhiteSpaceEnd as q,cmpStr as z,consumeNumber as B,getNewlineLength as G,consumeEscaped as I,consumeBadUrlRemnants as J}from"./utils.mjs";export{cmpChar,decodeEscaped,findDecimalNumberEnd,findWhiteSpaceStart}from"./utils.mjs";export{TokenStream}from"./TokenStream.mjs";function K(A,K){function M(e){return e<X?A.charCodeAt(e):0}function Q(){return $=B(A,$),T(M($),M($+1),M($+2))?(Y=a,void($=U(A,$))):37===M($)?(Y=t,void $++):void(Y=s)}function R(){const a=$;return $=U(A,$),z(A,a,$,"url")&&40===M($)?($=q(A,$+1),34===M($)||39===M($)?(Y=e,void($=a+4)):void function(){for(Y=i,$=q(A,$);$<A.length;$++){const e=A.charCodeAt($);switch(E(e)){case 41:return void $++;case F:return $=q(A,$),41===M($)||$>=A.length?void($<A.length&&$++):($=J(A,$),void(Y=n));case 34:case 39:case 40:case P:return $=J(A,$),void(Y=n);case 92:if(D(e,M($+1))){$=I(A,$)-1;break}return $=J(A,$),void(Y=n)}}}()):40===M($)?(Y=e,void $++):void(Y=r)}function V(e){for(e||(e=M($++)),Y=c;$<A.length;$++){const r=A.charCodeAt($);switch(E(r)){case e:return void $++;case F:if(H(r))return $+=G(A,$,r),void(Y=o);break;case 92:if($===A.length-1)break;const a=M($+1);H(a)?$+=G(A,$+1,a):D(r,a)&&($=I(A,$)-1)}}}const X=(A=String(A||"")).length;let Y,Z=w(M(0)),$=Z;for(;$<X;){const e=A.charCodeAt($);switch(E(e)){case F:Y=y,$=q(A,$+1);break;case 34:V();break;case 35:W(M($+1))||D(M($+1),M($+2))?(Y=C,$=U(A,$+1)):(Y=d,$++);break;case 39:V();break;case 40:Y=x,$++;break;case 41:Y=j,$++;break;case 43:O(e,M($+1),M($+2))?Q():(Y=d,$++);break;case 44:Y=S,$++;break;case 45:O(e,M($+1),M($+2))?Q():45===M($+1)&&62===M($+2)?(Y=g,$+=3):T(e,M($+1),M($+2))?R():(Y=d,$++);break;case 46:O(e,M($+1),M($+2))?Q():(Y=d,$++);break;case 47:42===M($+1)?(Y=v,$=A.indexOf("*/",$+2),$=-1===$?A.length:$+2):(Y=d,$++);break;case 58:Y=l,$++;break;case 59:Y=h,$++;break;case 60:33===M($+1)&&45===M($+2)&&45===M($+3)?(Y=u,$+=4):(Y=d,$++);break;case 64:T(M($+1),M($+2),M($+3))?(Y=p,$=U(A,$+1)):(Y=d,$++);break;case 91:Y=m,$++;break;case 92:D(e,M($+1))?R():(Y=d,$++);break;case 93:Y=f,$++;break;case 123:Y=b,$++;break;case 125:Y=k,$++;break;case N:Q();break;case L:R();break;default:Y=d,$++}K(Y,Z,Z=$)}}export{p as AtKeyword,o as BadString,n as BadUrl,g as CDC,u as CDO,l as Colon,S as Comma,v as Comment,d as Delim,N as DigitCategory,a as Dimension,e as Function,C as Hash,r as Ident,b as LeftCurlyBracket,x as LeftParenthesis,m as LeftSquareBracket,L as NameStartCategory,P as NonPrintableCategory,s as Number,t as Percentage,k as RightCurlyBracket,j as RightParenthesis,f as RightSquareBracket,h as Semicolon,c as String,i as Url,y as WhiteSpace,F as WhiteSpaceCategory,E as charCodeCategory,z as cmpStr,J as consumeBadUrlRemnants,I as consumeEscaped,U as consumeName,B as consumeNumber,q as findWhiteSpaceEnd,G as getNewlineLength,w as isBOM,T as isIdentifierStart,W as isName,H as isNewline,O as isNumberStart,D as isValidEscape,K as tokenize};