diff --git a/dist/animatable.js b/dist/animatable.js index 38cc10a..4a5808e 100644 --- a/dist/animatable.js +++ b/dist/animatable.js @@ -1,3 +1,3 @@ //animatable-properties v3.0.13 https://github.com/apasov/animatable-properties#readme -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).animatable={})}(this,(function(e){"use strict";var t=Object.prototype.toString;var n=function(e){return"number"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Number]"==t.call(e)};var r=Function.prototype,a=Object.prototype,s=r.toString,i=a.hasOwnProperty,o=s.call(Object),c=a.toString,l=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object);var u=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||"[object Object]"!=c.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=l(e);if(null===t)return!0;var n=i.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==o},h=Object.prototype.toString,p=Array.isArray;var d=function(e){return"string"==typeof e||!p(e)&&function(e){return!!e&&"object"==typeof e}(e)&&"[object String]"==h.call(e)},f={};function y(e){return{prev:null,next:null,data:e}}function g(e,t,n){var r;return null!==k?(r=k,k=k.cursor,r.prev=t,r.next=n,r.cursor=e.cursor):r={prev:t,next:n,cursor:e.cursor},e.cursor=r,r}function m(e){var t=e.cursor;e.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=k,k=t}var k=null,x=function(){this.cursor=null,this.head=null,this.tail=null};x.createItem=y,x.prototype.createItem=y,x.prototype.updateCursors=function(e,t,n,r){for(var a=this.cursor;null!==a;)a.prev===e&&(a.prev=t),a.next===n&&(a.next=r),a=a.cursor},x.prototype.getSize=function(){for(var e=0,t=this.head;t;)e++,t=t.next;return e},x.prototype.fromArray=function(e){var t=null;this.head=null;for(var n=0;n100&&(l=s-60+3,s=58);for(var u=i;u<=o;u++)u>=0&&u0&&r[u].length>l?"…":"")+r[u].substr(l,98)+(r[u].length>l+100-1?"…":""));return[n(i,a),new Array(s+c+2).join("-")+"^",n(a,o)].filter(Boolean).join("\n")}var A=function(e,t,n,r,a){var s=S("SyntaxError",e);return s.source=t,s.offset=n,s.line=r,s.column=a,s.sourceFragment=function(e){return w(s,isNaN(e)?0:e)},Object.defineProperty(s,"formattedMessage",{get:function(){return"Parse error: "+s.message+"\n"+w(s,2)}}),s.parseError={offset:n,line:r,column:a},s},T={EOF:0,Ident:1,Function:2,AtKeyword:3,Hash:4,String:5,BadString:6,Url:7,BadUrl:8,Delim:9,Number:10,Percentage:11,Dimension:12,WhiteSpace:13,CDO:14,CDC:15,Colon:16,Semicolon:17,Comma:18,LeftSquareBracket:19,RightSquareBracket:20,LeftParenthesis:21,RightParenthesis:22,LeftCurlyBracket:23,RightCurlyBracket:24,Comment:25},P=Object.keys(T).reduce((function(e,t){return e[T[t]]=t,e}),{}),L={TYPE:T,NAME:P};function E(e){return e>=48&&e<=57}function D(e){return e>=65&&e<=90}function O(e){return e>=97&&e<=122}function B(e){return D(e)||O(e)}function N(e){return e>=128}function I(e){return B(e)||N(e)||95===e}function R(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function M(e){return 10===e||13===e||12===e}function j(e){return M(e)||32===e||9===e}function W(e,t){return 92===e&&(!M(t)&&0!==t)}var F=new Array(128);Y.Eof=128,Y.WhiteSpace=130,Y.Digit=131,Y.NameStart=132,Y.NonPrintable=133;for(var z=0;z=65&&e<=70||e>=97&&e<=102},isUppercaseLetter:D,isLowercaseLetter:O,isLetter:B,isNonAscii:N,isNameStart:I,isName:function(e){return I(e)||E(e)||45===e},isNonPrintable:R,isNewline:M,isWhiteSpace:j,isValidEscape:W,isIdentifierStart:function(e,t,n){return 45===e?I(t)||45===t||W(t,n):!!I(e)||92===e&&W(e,t)},isNumberStart:function(e,t,n){return 43===e||45===e?E(t)?2:46===t&&E(n)?3:0:46===e?E(t)?2:0:E(e)?1:0},isBOM:function(e){return 65279===e||65534===e?1:0},charCodeCategory:Y},q=U.isDigit,H=U.isHexDigit,V=U.isUppercaseLetter,K=U.isName,Q=U.isWhiteSpace,G=U.isValidEscape;function Z(e,t){return te.length)return!1;for(var a=t;a=0&&Q(e.charCodeAt(t));t--);return t+1},findWhiteSpaceEnd:function(e,t){for(;t>ce:ae},lookupOffset:function(e){return(e+=this.tokenIndex)0?e>ce,this.source,a)){case 1:break e;case 2:r++;break e;default:a=this.offsetAndType[r]&oe,this.balance[n]===r&&(r=n)}return r-this.tokenIndex},isBalanceEdge:function(e){return this.balance[this.tokenIndex]>ce===se;e++,t++);t>0&&this.skip(t)},skipSC:function(){for(;this.tokenType===se||this.tokenType===ie;)this.next()},skip:function(e){var t=this.tokenIndex+e;t>ce,this.tokenEnd=t&oe):(this.tokenIndex=this.tokenCount,this.next())},next:function(){var e=this.tokenIndex+1;e>ce,this.tokenEnd=e&oe):(this.tokenIndex=this.tokenCount,this.eof=!0,this.tokenType=ae,this.tokenStart=this.tokenEnd=this.source.length)},dump:function(){var e=this.firstCharOffset;return Array.prototype.slice.call(this.offsetAndType,0,this.tokenCount).map((function(t,n){var r=e,a=t&oe;return e=a,{idx:n,type:ne[t>>ce],chunk:this.source.substring(r,a),balance:this.balance[n]}}),this)}};var ue=le;function he(e){return e}function pe(e,t,n,r){var a,s;switch(e.type){case"Group":a=function(e,t,n,r){var a=" "===e.combinator||r?e.combinator:" "+e.combinator+" ",s=e.terms.map((function(e){return pe(e,t,n,r)})).join(a);return(e.explicit||n)&&(s=(r||","===s[0]?"[":"[ ")+s+(r?"]":" ]")),s}(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return pe(e.term,t,n,r)+t(0===(s=e).min&&0===s.max?"*":0===s.min&&1===s.max?"?":1===s.min&&0===s.max?s.comma?"#":"+":1===s.min&&1===s.max?"":(s.comma?"#":"")+(s.min===s.max?"{"+s.min+"}":"{"+s.min+","+(0!==s.max?s.max:"")+"}"),e);case"Type":a="<"+e.name+(e.opts?t(function(e){switch(e.type){case"Range":return" ["+(null===e.min?"-∞":e.min)+","+(null===e.max?"∞":e.max)+"]";default:throw new Error("Unknown node type `"+e.type+"`")}}(e.opts),e.opts):"")+">";break;case"Property":a="<'"+e.name+"'>";break;case"Keyword":a=e.name;break;case"AtKeyword":a="@"+e.name;break;case"Function":a=e.name+"(";break;case"String":case"Token":a=e.value;break;case"Comma":a=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(a,e)}var de=function(e,t){var n=he,r=!1,a=!1;return"function"==typeof t?n=t:t&&(r=Boolean(t.forceBraces),a=Boolean(t.compact),"function"==typeof t.decorate&&(n=t.decorate)),pe(e,n,r,a)},fe=v,ye=de;function ge(e,t){var n=e&&e.loc&&e.loc[t];return n?{offset:n.offset,line:n.line,column:n.column}:null}var me=function(e,t){var n=fe("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},ke=function(e,t,n,r){var a=fe("SyntaxMatchError",e),s=function(e){for(var t=e.tokens,n=e.longestMatch,r=n1}}(r),i=s.mismatchOffset||0,o=s.node||n,c=ge(o,"end"),l=s.last?c:ge(o,"start"),u=s.css;return a.rawMessage=e,a.syntax=t?ye(t):"",a.css=u,a.mismatchOffset=i,a.loc={source:o&&o.loc&&o.loc.source||"",start:l,end:c},a.line=l?l.line:void 0,a.column=l?l.column:void 0,a.offset=l?l.offset:void 0,a.message=e+"\n syntax: "+a.syntax+"\n value: "+(a.css||"")+"\n --------"+new Array(a.mismatchOffset+1).join("-")+"^",a},xe=Object.prototype.hasOwnProperty,be=Object.create(null),ve=Object.create(null);function Se(e,t){return t=t||0,e.length-t>=2&&45===e.charCodeAt(t)&&45===e.charCodeAt(t+1)}function Ce(e,t){if(t=t||0,e.length-t>=3&&45===e.charCodeAt(t)&&45!==e.charCodeAt(t+1)){var n=e.indexOf("-",t+2);if(-1!==n)return e.substring(t,n+1)}return""}var we={keyword:function(e){if(xe.call(be,e))return be[e];var t=e.toLowerCase();if(xe.call(be,t))return be[e]=be[t];var n=Se(t,0),r=n?"":Ce(t,0);return be[e]=Object.freeze({basename:t.substr(r.length),name:t,vendor:r,prefix:r,custom:n})},property:function(e){if(xe.call(ve,e))return ve[e];var t=e,n=e[0];"/"===n?n="/"===e[1]?"//":"/":"_"!==n&&"*"!==n&&"$"!==n&&"#"!==n&&"+"!==n&&"&"!==n&&(n="");var r=Se(t,n.length);if(!r&&(t=t.toLowerCase(),xe.call(ve,t)))return ve[e]=ve[t];var a=r?"":Ce(t,n.length),s=t.substr(0,n.length+a.length);return ve[e]=Object.freeze({basename:t.substr(s.length),name:t.substr(n.length),hack:n,vendor:a,prefix:s,custom:r})},isCustomProperty:Se,vendorPrefix:Ce},Ae="undefined"!=typeof Uint32Array?Uint32Array:Array,Te=function(e,t){return null===e||e.length=e.length?void(h>Ge,c[l]=f,c[f++]=l;f0?6:0;if(!pt(s))return 0;if(++a>6)return 0}return a}function St(e,t,n){if(!e)return 0;for(;xt(n(t),63);){if(++e>6)return 0;t++}return t}var Ct=_e,wt=Ct.isIdentifierStart,At=Ct.isHexDigit,Tt=Ct.isDigit,Pt=Ct.cmpStr,Lt=Ct.consumeNumber,Et=Ct.TYPE,Dt=function(e,t){var n=0;if(!e)return 0;if(e.type===at)return ut(e,0,false,n);if(e.type===rt&&e.value.charCodeAt(0)===it){if(!Je(e.value,1,110))return 0;switch(e.value.length){case 2:return ht(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==it?0:(n=lt(t(++n),n,t),ut(e=t(n),0,ot,n));default:return e.value.charCodeAt(2)!==it?0:ut(e,3,ot,n)}}else if(e.type===rt||ct(e,43)&&t(n+1).type===rt){if(e.type!==rt&&(e=t(++n)),null===e||!Je(e.value,0,110))return 0;switch(e.value.length){case 1:return ht(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==it?0:(n=lt(t(++n),n,t),ut(e=t(n),0,ot,n));default:return e.value.charCodeAt(1)!==it?0:ut(e,2,ot,n)}}else if(e.type===st){for(var r=e.value.charCodeAt(0),a=43===r||r===it?1:0,s=a;se.max)return!0}return!1}function Ft(e,t){var n=e.index,r=0;do{if(r++,e.balance<=n)break}while(e=t(r));return r}function zt(e){return function(t,n,r){return null===t?0:t.type===Et.Function&&Mt(t.value,Nt)?Ft(t,n):e(t,n,r)}}function Yt(e){return function(t){return null===t||t.type!==e?0:1}}function Ut(e){return function(t,n,r){if(null===t||t.type!==Et.Dimension)return 0;var a=Lt(t.value,0);if(null!==e){var s=t.value.indexOf("\\",a),i=-1!==s&&jt(t.value,s)?t.value.substring(a,s):t.value.substr(a);if(!1===e.hasOwnProperty(i.toLowerCase()))return 0}return Wt(r,t.value,a)?0:1}}function qt(e){return"function"!=typeof e&&(e=function(){return 0}),function(t,n,r){return null!==t&&t.type===Et.Number&&0===Number(t.value)?1:e(t,n,r)}}var Ht,Vt={"ident-token":Yt(Et.Ident),"function-token":Yt(Et.Function),"at-keyword-token":Yt(Et.AtKeyword),"hash-token":Yt(Et.Hash),"string-token":Yt(Et.String),"bad-string-token":Yt(Et.BadString),"url-token":Yt(Et.Url),"bad-url-token":Yt(Et.BadUrl),"delim-token":Yt(Et.Delim),"number-token":Yt(Et.Number),"percentage-token":Yt(Et.Percentage),"dimension-token":Yt(Et.Dimension),"whitespace-token":Yt(Et.WhiteSpace),"CDO-token":Yt(Et.CDO),"CDC-token":Yt(Et.CDC),"colon-token":Yt(Et.Colon),"semicolon-token":Yt(Et.Semicolon),"comma-token":Yt(Et.Comma),"[-token":Yt(Et.LeftSquareBracket),"]-token":Yt(Et.RightSquareBracket),"(-token":Yt(Et.LeftParenthesis),")-token":Yt(Et.RightParenthesis),"{-token":Yt(Et.LeftCurlyBracket),"}-token":Yt(Et.RightCurlyBracket),string:Yt(Et.String),ident:Yt(Et.Ident),"custom-ident":function(e){if(null===e||e.type!==Et.Ident)return 0;var t=e.value.toLowerCase();return Mt(t,Bt)||Rt(t,"default")?0:1},"custom-property-name":function(e){return null===e||e.type!==Et.Ident||45!==It(e.value,0)||45!==It(e.value,1)?0:1},"hex-color":function(e){if(null===e||e.type!==Et.Hash)return 0;var t=e.value.length;if(4!==t&&5!==t&&7!==t&&9!==t)return 0;for(var n=1;ne.index||e.balancee.index||e.balance=128||0===Jt[n])break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function nn(e){for(var t=e.pos;t57)break}return e.pos===t&&e.error("Expect a number"),e.substringToPos(t)}function rn(e){var t=e.str.indexOf("'",e.pos+1);return-1===t&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(t+1)}function an(e){var t,n=null;return e.eat(Xt),t=nn(e),44===e.charCode()?(e.pos++,125!==e.charCode()&&(n=nn(e))):n=t,e.eat(125),{min:Number(t),max:n?Number(n):0}}function sn(e,t){var n=function(e){var t=null,n=!1;switch(e.charCode()){case 42:e.pos++,t={min:0,max:0};break;case 43:e.pos++,t={min:1,max:0};break;case 63:e.pos++,t={min:0,max:1};break;case 35:e.pos++,n=!0,t=e.charCode()===Xt?an(e):{min:1,max:0};break;case Xt:t=an(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}(e);return null!==n?(n.term=t,n):t}function on(e){var t=e.peek();return""===t?null:{type:"Token",value:t}}function cn(e){var t,n=null;return e.eat(60),t=tn(e),40===e.charCode()&&41===e.nextCharCode()&&(e.pos+=2,t+="()"),91===e.charCodeAt(e.findWsEnd(e.pos))&&(en(e),n=function(e){var t=null,n=null,r=1;return e.eat(91),45===e.charCode()&&(e.peek(),r=-1),-1==r&&8734===e.charCode()?e.peek():t=r*Number(nn(e)),en(e),e.eat(44),en(e),8734===e.charCode()?e.peek():(r=1,45===e.charCode()&&(e.peek(),r=-1),n=r*Number(nn(e))),e.eat(93),null===t&&null===n?null:{type:"Range",min:t,max:n}}(e)),e.eat(62),sn(e,{type:"Type",name:t,opts:n})}function ln(e,t){function n(e,t){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:!1}}for(t=Object.keys(t).sort((function(e,t){return $t[e]-$t[t]}));t.length>0;){for(var r=t.shift(),a=0,s=0;a1&&(e.splice(s,a-s,n(e.slice(s,a),r)),a=s+1),s=-1))}-1!==s&&t.length&&e.splice(s,a-s,n(e.slice(s,a),r))}return r}function un(e){for(var t,n=[],r={},a=null,s=e.pos;t=hn(e);)"Spaces"!==t.type&&("Combinator"===t.type?(null!==a&&"Combinator"!==a.type||(e.pos=s,e.error("Unexpected combinator")),r[t.value]=!0):null!==a&&"Combinator"!==a.type&&(r[" "]=!0,n.push({type:"Combinator",value:" "})),n.push(t),a=t,s=e.pos);return null!==a&&"Combinator"===a.type&&(e.pos-=s,e.error("Unexpected combinator")),{type:"Group",terms:n,combinator:ln(n,r)||" ",disallowEmpty:!1,explicit:!1}}function hn(e){var t=e.charCode();if(t<128&&1===Jt[t])return function(e){var t;return t=tn(e),40===e.charCode()?(e.pos++,{type:"Function",name:t}):sn(e,{type:"Keyword",name:t})}(e);switch(t){case 93:break;case 91:return sn(e,function(e){var t;return e.eat(91),t=un(e),e.eat(93),t.explicit=!0,33===e.charCode()&&(e.pos++,t.disallowEmpty=!0),t}(e));case 60:return 39===e.nextCharCode()?function(e){var t;return e.eat(60),e.eat(39),t=tn(e),e.eat(39),e.eat(62),sn(e,{type:"Property",name:t})}(e):cn(e);case 124:return{type:"Combinator",value:e.substringToPos(124===e.nextCharCode()?e.pos+2:e.pos+1)};case 38:return e.pos++,e.eat(38),{type:"Combinator",value:"&&"};case 44:return e.pos++,{type:"Comma"};case 39:return sn(e,{type:"String",value:rn(e)});case 32:case 9:case 10:case 13:case 12:return{type:"Spaces",value:en(e)};case 64:return(t=e.nextCharCode())<128&&1===Jt[t]?(e.pos++,{type:"AtKeyword",name:tn(e)}):on(e);case 42:case 43:case 63:case 35:case 33:break;case Xt:if((t=e.nextCharCode())<48||t>57)return on(e);break;default:return on(e)}}function pn(e){var t=new _t(e),n=un(t);return t.pos!==e.length&&t.error("Unexpected input"),1===n.terms.length&&"Group"===n.terms[0].type&&(n=n.terms[0]),n}pn("[a&&#|<'c'>*||e() f{2} /,(% g#{1,2} h{2,})]!");var dn=pn,fn=function(){};function yn(e){return"function"==typeof e?e:fn}var gn=function(e,t,n){var r=fn,a=fn;if("function"==typeof t?r=t:t&&(r=yn(t.enter),a=yn(t.leave)),r===fn&&a===fn)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");!function e(t){switch(r.call(n,t),t.type){case"Group":t.terms.forEach(e);break;case"Multiplier":e(t.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+t.type)}a.call(n,t)}(e)},mn=_e,kn=new ue,xn={decorator:function(e){var t=null,n={len:0,node:null},r=[n],a="";return{children:e.children,node:function(n){var r=t;t=n,e.node.call(this,n),t=r},chunk:function(e){a+=e,n.node!==t?r.push({len:e.length,node:t}):n.len+=e.length},result:function(){return bn(a,r)}}}};function bn(e,t){var n=[],r=0,a=0,s=t?t[a].node:null;for(mn(e,kn);!kn.eof;){if(t)for(;a2&&40===e.charCodeAt(e.length-2)&&41===e.charCodeAt(e.length-1)}function Pn(e){return"Keyword"===e.type||"AtKeyword"===e.type||"Function"===e.type||"Type"===e.type&&Tn(e.name)}function Ln(e,t,n){switch(e){case" ":for(var r=Sn,a=t.length-1;a>=0;a--){r=An(o=t[a],r,Cn)}return r;case"|":r=Cn;var s=null;for(a=t.length-1;a>=0;a--){if(Pn(o=t[a])&&(null===s&&a>0&&Pn(t[a-1])&&(r=An({type:"Enum",map:s=Object.create(null)},Sn,r)),null!==s)){var i=(Tn(o.name)?o.name.slice(0,-1):o.name).toLowerCase();if(i in s==!1){s[i]=o;continue}}s=null,r=An(o,Sn,r)}return r;case"&&":if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};for(r=Cn,a=t.length-1;a>=0;a--){var o=t[a];c=t.length>1?Ln(e,t.filter((function(e){return e!==o})),!1):Sn,r=An(o,c,r)}return r;case"||":if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};for(r=n?Sn:Cn,a=t.length-1;a>=0;a--){var c;o=t[a];c=t.length>1?Ln(e,t.filter((function(e){return e!==o})),!0):Sn,r=An(o,c,r)}return r}}function En(e){if("function"==typeof e)return{type:"Generic",fn:e};switch(e.type){case"Group":var t=Ln(e.combinator,e.terms.map(En),!1);return e.disallowEmpty&&(t=An(t,wn,Cn)),t;case"Multiplier":return function(e){var t=Sn,n=En(e.term);if(0===e.max)n=An(n,wn,Cn),(t=An(n,null,Cn)).then=An(Sn,Sn,t),e.comma&&(t.then.else=An({type:"Comma",syntax:e},t,Cn));else for(var r=e.min||1;r<=e.max;r++)e.comma&&t!==Sn&&(t=An({type:"Comma",syntax:e},t,Cn)),t=An(n,An(Sn,Sn,t),Cn);if(0===e.min)t=An(Sn,Sn,t);else for(r=0;r=65&&r<=90&&(r|=32),r!==t.charCodeAt(n))return!1}return!0}function Fn(e){return null===e||(e.type===Rn.Comma||e.type===Rn.Function||e.type===Rn.LeftParenthesis||e.type===Rn.LeftSquareBracket||e.type===Rn.LeftCurlyBracket||e.type===Rn.Delim)}function zn(e){return null===e||(e.type===Rn.RightParenthesis||e.type===Rn.RightSquareBracket||e.type===Rn.RightCurlyBracket||e.type===Rn.Delim)}function Yn(e,t,n){function r(){do{m++,g=mk&&(k=m)}function l(){x=2===x.type?x.prev:{type:3,syntax:u.syntax,token:x.token,prev:x},u=u.prev}var u=null,h=null,p=null,d=null,f=0,y=null,g=null,m=-1,k=0,x={type:0,syntax:null,token:null,prev:null};for(r();null===y&&++f<15e3;)switch(t.type){case"Match":if(null===h){if(null!==g&&(m!==e.length-1||"\\0"!==g.value&&"\\9"!==g.value)){t=Nn;break}y=Mn;break}if((t=h.nextState)===In){if(h.matchStack===x){t=Nn;break}t=Bn}for(;h.syntaxStack!==u;)l();h=h.prev;break;case"Mismatch":if(null!==d&&!1!==d)(null===p||m>p.tokenIndex)&&(p=d,d=!1);else if(null===p){y="Mismatch";break}t=p.nextState,h=p.thenStack,u=p.syntaxStack,x=p.matchStack,m=p.tokenIndex,g=mm){for(;m":"<'"+t.name+"'>"));if(!1!==d&&null!==g&&"Type"===t.type)if("custom-ident"===t.name&&g.type===Rn.Ident||"length"===t.name&&"0"===g.value){null===d&&(d=s(t,p)),t=Nn;break}u={syntax:t.syntax,opts:t.syntax.opts||null!==u&&u.opts||null,prev:u},x={type:2,syntax:t.syntax,token:x.token,prev:x},t=A.match;break;case"Keyword":var T=t.name;if(null!==g){var P=g.value;if(-1!==P.indexOf("\\")&&(P=P.replace(/\\[09].*$/,"")),Wn(P,T)){c(),t=Bn;break}}t=Nn;break;case"AtKeyword":case"Function":if(null!==g&&Wn(g.value,t.name)){c(),t=Bn;break}t=Nn;break;case"Token":if(null!==g&&g.value===t.value){c(),t=Bn;break}t=Nn;break;case"Comma":null!==g&&g.type===Rn.Comma?Fn(x.token)?t=Nn:(c(),t=zn(g)?Nn:Bn):t=Fn(x.token)||zn(g)?Bn:Nn;break;case"String":var L="";for(C=m;C=0}function $n(e){return Boolean(e)&&Jn(e.offset)&&Jn(e.line)&&Jn(e.column)}function er(e,t){return function(n,r){if(!n||n.constructor!==Object)return r(n,"Type of node should be an Object");for(var a in n){var s=!0;if(!1!==Xn.call(n,a)){if("type"===a)n.type!==e&&r(n,"Wrong node type `"+n.type+"`, expected `"+e+"`");else if("loc"===a){if(null===n.loc)continue;if(n.loc&&n.loc.constructor===Object)if("string"!=typeof n.loc.source)a+=".source";else if($n(n.loc.start)){if($n(n.loc.end))continue;a+=".end"}else a+=".start";s=!1}else if(t.hasOwnProperty(a)){var i=0;for(s=!1;!s&&i");else{if(!Array.isArray(l))throw new Error("Wrong value `"+l+"` in `"+e+"."+s+"` structure definition");i.push("List")}}a[s]=i.join(" | ")}return{docs:a,check:er(e,r)}}var nr=me,rr=ke,ar=we,sr=Vt,ir=dn,or=de,cr=gn,lr=function(e,t){return"string"==typeof e?bn(e,null):t.generate(e,xn)},ur=Dn.buildMatchGraph,hr=Un,pr=Vn,dr=Zn,fr=function(e){var t={};if(e.node)for(var n in e.node)if(Xn.call(e.node,n)){var r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=tr(n,r)}return t},yr=ur("inherit | initial | unset"),gr=ur("inherit | initial | unset | <-ms-legacy-expression>");function mr(e,t,n){var r={};for(var a in e)e[a].syntax&&(r[a]=n?e[a].syntax:or(e[a].syntax,{compact:t}));return r}function kr(e,t,n){return{matched:e,iterations:n,error:t,getTrace:pr.getTrace,isType:pr.isType,isProperty:pr.isProperty,isKeyword:pr.isKeyword}}function xr(e,t,n,r){var a,s=lr(n,e.syntax);return function(e){for(var t=0;t(e[n]=this.createDescriptor(t.descriptors[n],"AtruleDescriptor",n),e)),{}):null}},addProperty_:function(e,t){this.properties[e]=this.createDescriptor(t,"Property",e)},addType_:function(e,t){this.types[e]=this.createDescriptor(t,"Type",e),t===sr["-ms-legacy-expression"]&&(this.valueCommonSyntax=gr)},matchAtrulePrelude:function(e,t){var n=ar.keyword(e),r=n.vendor?this.getAtrulePrelude(n.name)||this.getAtrulePrelude(n.basename):this.getAtrulePrelude(n.name);return r?xr(this,r,t,!0):n.basename in this.atrules?kr(null,new Error("At-rule `"+e+"` should not contain a prelude")):kr(null,new nr("Unknown at-rule",e))},matchAtruleDescriptor:function(e,t,n){var r=ar.keyword(e),a=ar.keyword(t),s=r.vendor?this.atrules[r.name]||this.atrules[r.basename]:this.atrules[r.name];if(!s)return kr(null,new nr("Unknown at-rule",e));if(!s.descriptors)return kr(null,new Error("At-rule `"+e+"` has no known descriptors"));var i=a.vendor?s.descriptors[a.name]||s.descriptors[a.basename]:s.descriptors[a.name];return i?xr(this,i,n,!0):kr(null,new nr("Unknown at-rule descriptor",t))},matchDeclaration:function(e){return"Declaration"!==e.type?kr(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)},matchProperty:function(e,t){var n=ar.property(e);if(n.custom)return kr(null,new Error("Lexer matching doesn't applicable for custom properties"));var r=n.vendor?this.getProperty(n.name)||this.getProperty(n.basename):this.getProperty(n.name);return r?xr(this,r,t,!0):kr(null,new nr("Unknown property",e))},matchType:function(e,t){var n=this.getType(e);return n?xr(this,n,t,!1):kr(null,new nr("Unknown type",e))},match:function(e,t){return"string"==typeof e||e&&e.type?("string"!=typeof e&&e.match||(e=this.createDescriptor(e,"Type","anonymous")),xr(this,e,t,!1)):kr(null,new nr("Bad syntax"))},findValueFragments:function(e,t,n,r){return dr.matchFragments(this,t,this.matchProperty(e,t),n,r)},findDeclarationValueFragments:function(e,t,n){return dr.matchFragments(this,e.value,this.matchDeclaration(e),t,n)},findAllFragments:function(e,t,n){var r=[];return this.syntax.walk(e,{visit:"Declaration",enter:function(e){r.push.apply(r,this.findDeclarationValueFragments(e,t,n))}.bind(this)}),r},getAtrulePrelude:function(e){return this.atrules.hasOwnProperty(e)?this.atrules[e].prelude:null},getAtruleDescriptor:function(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null},getProperty:function(e){return this.properties.hasOwnProperty(e)?this.properties[e]:null},getType:function(e){return this.types.hasOwnProperty(e)?this.types[e]:null},validate:function(){function e(r,a,s,i){if(s.hasOwnProperty(a))return s[a];s[a]=!1,null!==i.syntax&&cr(i.syntax,(function(i){if("Type"===i.type||"Property"===i.type){var o="Type"===i.type?r.types:r.properties,c="Type"===i.type?t:n;o.hasOwnProperty(i.name)&&!e(r,i.name,c,o[i.name])||(s[a]=!0)}}),this)}var t={},n={};for(var r in this.types)e(this,r,t,this.types[r]);for(var r in this.properties)e(this,r,n,this.properties[r]);return t=Object.keys(t).filter((function(e){return t[e]})),n=Object.keys(n).filter((function(e){return n[e]})),t.length||n.length?{types:t,properties:n}:null},dump:function(e,t){return{generic:this.generic,types:mr(this.types,!t,e),properties:mr(this.properties,!t,e)}},toString:function(){return JSON.stringify(this.dump())}};var vr=br,Sr={SyntaxError:Qt,parse:dn,generate:de,walk:gn},Cr=Te,wr=_e.isBOM;var Ar=function(){this.lines=null,this.columns=null,this.linesAndColumnsComputed=!1};Ar.prototype={setSource:function(e,t,n,r){this.source=e,this.startOffset=void 0===t?0:t,this.startLine=void 0===n?1:n,this.startColumn=void 0===r?1:r,this.linesAndColumnsComputed=!1},ensureLinesAndColumnsComputed:function(){this.linesAndColumnsComputed||(!function(e,t){for(var n=t.length,r=Cr(e.lines,n),a=e.startLine,s=Cr(e.columns,n),i=e.startColumn,o=t.length>0?wr(t.charCodeAt(0)):0;o",needPositions:!1,onParseError:jr,onParseErrorThrow:!1,parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Mr,createList:function(){return new Nr},createSingleNodeList:function(e){return(new Nr).appendData(e)},getFirstListNode:function(e){return e&&e.first()},getLastListNode:function(e){return e.last()},parseWithFallback:function(e,t){var n=this.scanner.tokenIndex;try{return e.call(this)}catch(e){if(this.onParseErrorThrow)throw e;var r=t.call(this,n);return this.onParseErrorThrow=!0,this.onParseError(e,r),this.onParseErrorThrow=!1,r}},lookupNonWSType:function(e){do{var t=this.scanner.lookupType(e++);if(t!==zr)return t}while(0!==t);return 0},eat:function(e){if(this.scanner.tokenType!==e){var t=this.scanner.tokenStart,n=Fr[e]+" is expected";switch(e){case Yr:this.scanner.tokenType===Ur||this.scanner.tokenType===qr?(t=this.scanner.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case Hr:this.scanner.isDelim(35)&&(this.scanner.next(),t++,n="Name is expected");break;case Vr:this.scanner.tokenType===Kr&&(t=this.scanner.tokenEnd,n="Percent sign is expected");break;default:this.scanner.source.charCodeAt(this.scanner.tokenStart)===e&&(t+=1)}this.error(n,t)}this.scanner.next()},consume:function(e){var t=this.scanner.getTokenValue();return this.eat(e),t},consumeFunctionName:function(){var e=this.scanner.source.substring(this.scanner.tokenStart,this.scanner.tokenEnd-1);return this.eat(Ur),e},getLocation:function(e,t){return this.needPositions?this.locationMap.getLocationRange(e,t,this.filename):null},getLocationFromList:function(e){if(this.needPositions){var t=this.getFirstListNode(e),n=this.getLastListNode(e);return this.locationMap.getLocationRange(null!==t?t.loc.start.offset-this.locationMap.startOffset:this.scanner.tokenStart,null!==n?n.loc.end.offset-this.locationMap.startOffset:this.scanner.tokenStart,this.filename)}return null},error:function(e,t){var n=void 0!==t&&t",t.needPositions=Boolean(n.positions),t.onParseError="function"==typeof n.onParseError?n.onParseError:jr,t.onParseErrorThrow=!1,t.parseAtrulePrelude=!("parseAtrulePrelude"in n)||Boolean(n.parseAtrulePrelude),t.parseRulePrelude=!("parseRulePrelude"in n)||Boolean(n.parseRulePrelude),t.parseValue=!("parseValue"in n)||Boolean(n.parseValue),t.parseCustomProperty="parseCustomProperty"in n&&Boolean(n.parseCustomProperty),!t.context.hasOwnProperty(a))throw new Error("Unknown context `"+a+"`");return r=t.context[a].call(t,n),t.scanner.eof||t.error(),r}},ka=function(e){function t(e){if(!Gr.call(n,e.type))throw new Error("Unknown node type: "+e.type);n[e.type].call(this,e)}var n={};if(e.node)for(var r in e.node)n[r]=e.node[r].generate;return function(e,n){var r="",a={children:Zr,node:t,chunk:function(e){r+=e},result:function(){return r}};return n&&"function"==typeof n.decorator&&(a=n.decorator(a)),a.node(e),a.result()}},xa=function(e){return{fromPlainObject:function(t){return e(t,{enter:function(e){e.children&&e.children instanceof _r==!1&&(e.children=(new _r).fromArray(e.children))}}),t},toPlainObject:function(t){return e(t,{leave:function(e){e.children&&e.children instanceof _r&&(e.children=e.children.toArray())}}),t}}},ba=function(e){var t=function(e){var t={};for(var n in e.node)if(Xr.call(e.node,n)){var r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=ta(0,r)}return t}(e),n={},r={};for(var a in t)Xr.call(t,a)&&null!==t[a]&&(n[a]=na(t[a],!1),r[a]=na(t[a],!0));var s=ra(n),i=ra(r),o=function(e,a){var o=Jr,c=Jr,l=n,u={root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if("function"==typeof a)o=a;else if(a&&(o=$r(a.enter),c=$r(a.leave),a.reverse&&(l=r),a.visit)){if(s.hasOwnProperty(a.visit))l=a.reverse?i[a.visit]:s[a.visit];else if(!t.hasOwnProperty(a.visit))throw new Error("Bad value `"+a.visit+"` for `visit` option (should be: "+Object.keys(t).join(", ")+")");o=ea(o,a.visit),c=ea(c,a.visit)}if(o===Jr&&c===Jr)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");if(a.reverse){var h=o;o=c,c=h}!function e(t,n,r){o.call(u,t,n,r),l.hasOwnProperty(t.type)&&l[t.type](t,u,e),c.call(u,t,n,r)}(e)};return o.find=function(e,t){var n=null;return o(e,(function(e,r,a){null===n&&t.call(this,e,r,a)&&(n=e)})),n},o.findLast=function(e,t){var n=null;return o(e,{reverse:!0,enter:function(e,r,a){null===n&&t.call(this,e,r,a)&&(n=e)}}),n},o.findAll=function(e,t){var n=[];return o(e,(function(e,r,a){t.call(this,e,r,a)&&n.push(e)})),n},o},va=function e(t){var n={};for(var r in t){var a=t[r];a&&(Array.isArray(a)||a instanceof aa?a=a.map(e):a.constructor===Object&&(a=e(a))),n[r]=a}return n},Sa=we,Ca=function(e,t){return ua(e,t,ia)};function wa(e){var t=ma(e),n=ba(e),r=ka(e),a=xa(n),s={List:ha,SyntaxError:pa,TokenStream:da,Lexer:fa,vendorPrefix:Sa.vendorPrefix,keyword:Sa.keyword,property:Sa.property,isCustomProperty:Sa.isCustomProperty,definitionSyntax:ya,lexer:null,createLexer:function(e){return new fa(e,s,s.lexer.structure)},tokenize:ga,parse:t,walk:n,generate:r,find:n.find,findLast:n.findLast,findAll:n.findAll,clone:va,fromPlainObject:a.fromPlainObject,toPlainObject:a.toPlainObject,createSyntax:function(e){return wa(Ca({},e))},fork:function(t){var n=Ca({},e);return wa("function"==typeof t?t(n,Object.assign):Ca(n,t))}};return s.lexer=new fa({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}f.create=function(e){return wa(Ca({},e))};var Aa={"accent-color":{syntax:"auto | "},all:{syntax:"initial | inherit | unset | revert"},"backdrop-filter":{syntax:"none | "},background:{syntax:"[ , ]* "},"background-color":{syntax:""},"background-position":{syntax:"#"},"background-size":{syntax:"#"},"block-size":{syntax:"<'width'>"},border:{syntax:" || || "},"border-block-end":{syntax:"<'border-top-width'> || <'border-top-style'> || "},"border-block-end-color":{syntax:"<'border-top-color'>"},"border-block-end-width":{syntax:"<'border-top-width'>"},"border-block-start":{syntax:"<'border-top-width'> || <'border-top-style'> || "},"border-block-start-color":{syntax:"<'border-top-color'>"},"border-block-start-width":{syntax:"<'border-top-width'>"},"border-bottom":{syntax:" || || "},"border-bottom-color":{syntax:"<'border-top-color'>"},"border-bottom-left-radius":{syntax:"{1,2}"},"border-bottom-right-radius":{syntax:"{1,2}"},"border-bottom-width":{syntax:""},"border-color":{syntax:"{1,4}"},"border-end-end-radius":{syntax:"{1,2}"},"border-end-start-radius":{syntax:"{1,2}"},"border-image-outset":{syntax:"[ | ]{1,4}"},"border-image-slice":{syntax:"{1,4} && fill?"},"border-image-width":{syntax:"[ | | auto ]{1,4}"},"border-inline-end":{syntax:"<'border-top-width'> || <'border-top-style'> || "},"border-inline-end-color":{syntax:"<'border-top-color'>"},"border-inline-end-width":{syntax:"<'border-top-width'>"},"border-inline-start":{syntax:"<'border-top-width'> || <'border-top-style'> || "},"border-inline-start-color":{syntax:"<'border-top-color'>"},"border-inline-start-width":{syntax:"<'border-top-width'>"},"border-left":{syntax:" || || "},"border-left-color":{syntax:""},"border-left-width":{syntax:""},"border-radius":{syntax:"{1,4} [ / {1,4} ]?"},"border-right":{syntax:" || || "},"border-right-color":{syntax:""},"border-right-width":{syntax:""},"border-start-end-radius":{syntax:"{1,2}"},"border-start-start-radius":{syntax:"{1,2}"},"border-top":{syntax:" || || "},"border-top-color":{syntax:""},"border-top-left-radius":{syntax:"{1,2}"},"border-top-right-radius":{syntax:"{1,2}"},"border-top-width":{syntax:""},"border-width":{syntax:"{1,4}"},bottom:{syntax:" | | auto"},"box-shadow":{syntax:"none | #"},"caret-color":{syntax:"auto | "},clip:{syntax:" | auto"},"clip-path":{syntax:" | [ || ] | none"},color:{syntax:""},"column-count":{syntax:" | auto"},"column-gap":{syntax:"normal | "},"column-rule":{syntax:"<'column-rule-width'> || <'column-rule-style'> || <'column-rule-color'>"},"column-rule-color":{syntax:""},"column-rule-width":{syntax:"<'border-width'>"},"column-width":{syntax:" | auto"},columns:{syntax:"<'column-width'> || <'column-count'>"},filter:{syntax:"none | "},flex:{syntax:"none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]"},"flex-basis":{syntax:"content | <'width'>"},"flex-grow":{syntax:""},"flex-shrink":{syntax:""},font:{syntax:"[ [ <'font-style'> || || <'font-weight'> || <'font-stretch'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar"},"font-variation-settings":{syntax:"normal | [ ]#"},"font-size":{syntax:" | | "},"font-size-adjust":{syntax:"none | [ ex-height | cap-height | ch-width | ic-width | ic-height ]? [ from-font | ]"},"font-stretch":{syntax:""},"font-weight":{syntax:" | bolder | lighter"},gap:{syntax:"<'row-gap'> <'column-gap'>?"},"grid-column-gap":{syntax:""},"grid-gap":{syntax:"<'grid-row-gap'> <'grid-column-gap'>?"},"grid-row-gap":{syntax:""},"grid-template-columns":{syntax:"none | | | subgrid ?"},"grid-template-rows":{syntax:"none | | | subgrid ?"},height:{syntax:"auto | | | min-content | max-content | fit-content | fit-content()"},"inline-size":{syntax:"<'width'>"},inset:{syntax:"<'top'>{1,4}"},"inset-block":{syntax:"<'top'>{1,2}"},"inset-block-end":{syntax:"<'top'>"},"inset-block-start":{syntax:"<'top'>"},"inset-inline":{syntax:"<'top'>{1,2}"},"inset-inline-end":{syntax:"<'top'>"},"inset-inline-start":{syntax:"<'top'>"},left:{syntax:" | | auto"},"letter-spacing":{syntax:"normal | "},"line-clamp":{syntax:"none | "},"line-height":{syntax:"normal | | | "},margin:{syntax:"[ | | auto ]{1,4}"},"margin-block-end":{syntax:"<'margin-left'>"},"margin-block-start":{syntax:"<'margin-left'>"},"margin-bottom":{syntax:" | | auto"},"margin-inline-end":{syntax:"<'margin-left'>"},"margin-inline-start":{syntax:"<'margin-left'>"},"margin-left":{syntax:" | | auto"},"margin-right":{syntax:" | | auto"},"margin-top":{syntax:" | | auto"},mask:{syntax:"#"},"mask-border":{syntax:"<'mask-border-source'> || <'mask-border-slice'> [ / <'mask-border-width'>? [ / <'mask-border-outset'> ]? ]? || <'mask-border-repeat'> || <'mask-border-mode'>"},"mask-position":{syntax:"#"},"mask-size":{syntax:"#"},"max-block-size":{syntax:"<'max-width'>"},"max-height":{syntax:"none | | min-content | max-content | fit-content | fit-content()"},"max-inline-size":{syntax:"<'max-width'>"},"max-lines":{syntax:"none | "},"max-width":{syntax:"none | | min-content | max-content | fit-content | fit-content()"},"min-block-size":{syntax:"<'min-width'>"},"min-height":{syntax:"auto | | | min-content | max-content | fit-content | fit-content()"},"min-inline-size":{syntax:"<'min-width'>"},"min-width":{syntax:"auto | | | min-content | max-content | fit-content | fit-content()"},"object-position":{syntax:""},offset:{syntax:"[ <'offset-position'>? [ <'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? ]? ]! [ / <'offset-anchor'> ]?"},"offset-anchor":{syntax:"auto | "},"offset-distance":{syntax:""},"offset-path":{syntax:"none | ray( [ && && contain? ] ) | | | [ || ]"},"offset-position":{syntax:"auto | "},"offset-rotate":{syntax:"[ auto | reverse ] || "},opacity:{syntax:""},order:{syntax:""},outline:{syntax:"[ <'outline-color'> || <'outline-style'> || <'outline-width'> ]"},"outline-color":{syntax:" | invert"},"outline-offset":{syntax:""},"outline-width":{syntax:""},padding:{syntax:"[ | ]{1,4}"},"padding-block-end":{syntax:"<'padding-left'>"},"padding-block-start":{syntax:"<'padding-left'>"},"padding-bottom":{syntax:" | "},"padding-inline-end":{syntax:"<'padding-left'>"},"padding-inline-start":{syntax:"<'padding-left'>"},"padding-left":{syntax:" | "},"padding-right":{syntax:" | "},"padding-top":{syntax:" | "},perspective:{syntax:"none | "},"perspective-origin":{syntax:""},right:{syntax:" | | auto"},rotate:{syntax:"none | | [ x | y | z | {3} ] && "},"row-gap":{syntax:"normal | "},scale:{syntax:"none | {1,3}"},"scrollbar-color":{syntax:"auto | {2}"},"scroll-margin":{syntax:"{1,4}"},"scroll-margin-block":{syntax:"{1,2}"},"scroll-margin-block-start":{syntax:""},"scroll-margin-block-end":{syntax:""},"scroll-margin-bottom":{syntax:""},"scroll-margin-inline":{syntax:"{1,2}"},"scroll-margin-inline-start":{syntax:""},"scroll-margin-inline-end":{syntax:""},"scroll-margin-left":{syntax:""},"scroll-margin-right":{syntax:""},"scroll-margin-top":{syntax:""},"scroll-padding":{syntax:"[ auto | ]{1,4}"},"scroll-padding-block":{syntax:"[ auto | ]{1,2}"},"scroll-padding-block-start":{syntax:"auto | "},"scroll-padding-block-end":{syntax:"auto | "},"scroll-padding-bottom":{syntax:"auto | "},"scroll-padding-inline":{syntax:"[ auto | ]{1,2}"},"scroll-padding-inline-start":{syntax:"auto | "},"scroll-padding-inline-end":{syntax:"auto | "},"scroll-padding-left":{syntax:"auto | "},"scroll-padding-right":{syntax:"auto | "},"scroll-padding-top":{syntax:"auto | "},"scroll-snap-coordinate":{syntax:"none | #"},"scroll-snap-destination":{syntax:""},"shape-image-threshold":{syntax:""},"shape-margin":{syntax:""},"shape-outside":{syntax:"none | [ || ] | "},"tab-size":{syntax:" | "},"text-decoration":{syntax:"<'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'> || <'text-decoration-thickness'>"},"text-decoration-color":{syntax:""},"text-decoration-thickness":{syntax:"auto | from-font | | "},"text-emphasis":{syntax:"<'text-emphasis-style'> || <'text-emphasis-color'>"},"text-emphasis-color":{syntax:""},"text-indent":{syntax:" && hanging? && each-line?"},"text-shadow":{syntax:"none | #"},"text-underline-offset":{syntax:"auto | | "},top:{syntax:" | | auto"},transform:{syntax:"none | "},"transform-origin":{syntax:"[ | left | center | right | top | bottom ] | [ [ | left | center | right ] && [ | top | center | bottom ] ] ?"},translate:{syntax:"none | [ ? ]?"},"vertical-align":{syntax:"baseline | sub | super | text-top | text-bottom | middle | top | bottom | | "},visibility:{syntax:"visible | hidden | collapse"},width:{syntax:"auto | | | min-content | max-content | fit-content | fit-content()"},"word-spacing":{syntax:"normal | "},"z-index":{syntax:"auto | "},zoom:{syntax:"normal | reset | | "},"border-top-style":{syntax:""},"column-rule-style":{syntax:"<'border-style'>"},"border-style":{syntax:"{1,4}"},"font-style":{syntax:"normal | italic | oblique ?"},"font-family":{syntax:"[ | ]#"},"mask-border-source":{syntax:"none | "},"mask-border-slice":{syntax:"{1,4} fill?"},"mask-border-width":{syntax:"[ | | auto ]{1,4}"},"mask-border-outset":{syntax:"[ | ]{1,4}"},"mask-border-repeat":{syntax:"[ stretch | repeat | round | space ]{1,2}"},"mask-border-mode":{syntax:"luminance | alpha"},"outline-style":{syntax:"auto | <'border-style'>"},"text-decoration-line":{syntax:"none | [ underline || overline || line-through || blink ] | spelling-error | grammar-error"},"text-decoration-style":{syntax:"solid | double | dotted | dashed | wavy"},"text-emphasis-style":{syntax:"none | [ [ filled | open ] || [ dot | circle | double-circle | triangle | sesame ] ] | "}},Ta={"absolute-size":{syntax:"xx-small | x-small | small | medium | large | x-large | xx-large | xxx-large"},"alpha-value":{syntax:" | "},"angle-percentage":{syntax:" | "},"angular-color-hint":{syntax:""},"angular-color-stop":{syntax:" && ?"},"angular-color-stop-list":{syntax:"[ [, ]? ]# , "},attachment:{syntax:"scroll | fixed | local"},"auto-repeat":{syntax:"repeat( [ auto-fill | auto-fit ] , [ ? ]+ ? )"},"auto-track-list":{syntax:"[ ? [ | ] ]* ? \n[ ? [ | ] ]* ?"},"basic-shape":{syntax:" | | | | "},"bg-image":{syntax:"none | "},"bg-layer":{syntax:" || [ / ]? || || || || "},"bg-position":{syntax:"[ [ left | center | right | top | bottom | ] | [ left | center | right | ] [ top | center | bottom | ] | [ center | [ left | right ] ? ] && [ center | [ top | bottom ] ? ] ]"},"bg-size":{syntax:"[ | auto ]{1,2} | cover | contain"},"blur()":{syntax:"blur( )"},box:{syntax:"border-box | padding-box | content-box"},"brightness()":{syntax:"brightness( )"},"cf-final-image":{syntax:" | "},"cf-mixing-image":{syntax:"? && "},"circle()":{syntax:"circle( [ ]? [ at ]? )"},"clip-source":{syntax:""},color:{syntax:" | | | | | | currentcolor | "},"color-stop-angle":{syntax:"{1,2}"},"color-stop-length":{syntax:"{1,2}"},"color-stop-list":{syntax:"[ [, ]? ]# , "},"compositing-operator":{syntax:"add | subtract | intersect | exclude"},"conic-gradient()":{syntax:"conic-gradient( [ from ]? [ at ]?, )"},"contrast()":{syntax:"contrast( [ ] )"},"cross-fade()":{syntax:"cross-fade( , ? )"},"deprecated-system-color":{syntax:"ActiveBorder | ActiveCaption | AppWorkspace | Background | ButtonFace | ButtonHighlight | ButtonShadow | ButtonText | CaptionText | GrayText | Highlight | HighlightText | InactiveBorder | InactiveCaption | InactiveCaptionText | InfoBackground | InfoText | Menu | MenuText | Scrollbar | ThreeDDarkShadow | ThreeDFace | ThreeDHighlight | ThreeDLightShadow | ThreeDShadow | Window | WindowFrame | WindowText"},"drop-shadow()":{syntax:"drop-shadow( {2,3} ? )"},"element()":{syntax:"element( )"},"ellipse()":{syntax:"ellipse( [ {2} ]? [ at ]? )"},"ending-shape":{syntax:"circle | ellipse"},"family-name":{syntax:" | +"},"fill-rule":{syntax:"nonzero | evenodd"},"filter-function":{syntax:" | | | | | | | | | "},"filter-function-list":{syntax:"[ | ]+"},"final-bg-layer":{syntax:"<'background-color'> || || [ / ]? || || || || "},"fixed-breadth":{syntax:""},"fixed-repeat":{syntax:"repeat( [ ] , [ ? ]+ ? )"},"fixed-size":{syntax:" | minmax( , ) | minmax( , )"},"font-stretch-absolute":{syntax:"normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | "},"font-variant-css21":{syntax:"[ normal | small-caps ]"},"font-weight-absolute":{syntax:"normal | bold | "},"generic-family":{syntax:"serif | sans-serif | cursive | fantasy | monospace"},"geometry-box":{syntax:" | fill-box | stroke-box | view-box"},gradient:{syntax:" | | | | "},"grayscale()":{syntax:"grayscale( )"},"hsl()":{syntax:"hsl( [ / ]? ) | hsl( , , , ? )"},"hsla()":{syntax:"hsla( [ / ]? ) | hsla( , , , ? )"},hue:{syntax:" | "},"hue-rotate()":{syntax:"hue-rotate( )"},"id-selector":{syntax:""},image:{syntax:" | | | | | | "},"image()":{syntax:"image( ? [ ? , ? ]! )"},"image-set()":{syntax:"image-set( # )"},"image-set-option":{syntax:"[ | ] [ || type() ]"},"image-src":{syntax:" | "},"image-tags":{syntax:"ltr | rtl"},"inflexible-breadth":{syntax:" | | min-content | max-content | auto"},"inset()":{syntax:"inset( {1,4} [ round <'border-radius'> ]? )"},"invert()":{syntax:"invert( )"},"length-percentage":{syntax:" | "},"line-names":{syntax:"'[' * ']'"},"line-name-list":{syntax:"[ | ]+"},"line-style":{syntax:"none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset"},"line-width":{syntax:" | thin | medium | thick"},"linear-color-hint":{syntax:""},"linear-color-stop":{syntax:" ?"},"linear-gradient()":{syntax:"linear-gradient( [ | to ]? , )"},"mask-layer":{syntax:" || [ / ]? || || || [ | no-clip ] || || "},"mask-reference":{syntax:"none | | "},"mask-source":{syntax:""},"masking-mode":{syntax:"alpha | luminance | match-source"},"matrix()":{syntax:"matrix( #{6} )"},"matrix3d()":{syntax:"matrix3d( #{16} )"},"named-color":{syntax:"transparent | aliceblue | antiquewhite | aqua | aquamarine | azure | beige | bisque | black | blanchedalmond | blue | blueviolet | brown | burlywood | cadetblue | chartreuse | chocolate | coral | cornflowerblue | cornsilk | crimson | cyan | darkblue | darkcyan | darkgoldenrod | darkgray | darkgreen | darkgrey | darkkhaki | darkmagenta | darkolivegreen | darkorange | darkorchid | darkred | darksalmon | darkseagreen | darkslateblue | darkslategray | darkslategrey | darkturquoise | darkviolet | deeppink | deepskyblue | dimgray | dimgrey | dodgerblue | firebrick | floralwhite | forestgreen | fuchsia | gainsboro | ghostwhite | gold | goldenrod | gray | green | greenyellow | grey | honeydew | hotpink | indianred | indigo | ivory | khaki | lavender | lavenderblush | lawngreen | lemonchiffon | lightblue | lightcoral | lightcyan | lightgoldenrodyellow | lightgray | lightgreen | lightgrey | lightpink | lightsalmon | lightseagreen | lightskyblue | lightslategray | lightslategrey | lightsteelblue | lightyellow | lime | limegreen | linen | magenta | maroon | mediumaquamarine | mediumblue | mediumorchid | mediumpurple | mediumseagreen | mediumslateblue | mediumspringgreen | mediumturquoise | mediumvioletred | midnightblue | mintcream | mistyrose | moccasin | navajowhite | navy | oldlace | olive | olivedrab | orange | orangered | orchid | palegoldenrod | palegreen | paleturquoise | palevioletred | papayawhip | peachpuff | peru | pink | plum | powderblue | purple | rebeccapurple | red | rosybrown | royalblue | saddlebrown | salmon | sandybrown | seagreen | seashell | sienna | silver | skyblue | slateblue | slategray | slategrey | snow | springgreen | steelblue | tan | teal | thistle | tomato | turquoise | violet | wheat | white | whitesmoke | yellow | yellowgreen"},"number-percentage":{syntax:" | "},"opacity()":{syntax:"opacity( [ ] )"},"path()":{syntax:"path( [ , ]? )"},"paint()":{syntax:"paint( , ? )"},"perspective()":{syntax:"perspective( )"},"polygon()":{syntax:"polygon( ? , [ ]# )"},position:{syntax:"[ [ left | center | right ] || [ top | center | bottom ] | [ left | center | right | ] [ top | center | bottom | ]? | [ [ left | right ] ] && [ [ top | bottom ] ] ]"},"radial-gradient()":{syntax:"radial-gradient( [ || ]? [ at ]? , )"},"relative-size":{syntax:"larger | smaller"},"repeat-style":{syntax:"repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2}"},"repeating-linear-gradient()":{syntax:"repeating-linear-gradient( [ | to ]? , )"},"repeating-radial-gradient()":{syntax:"repeating-radial-gradient( [ || ]? [ at ]? , )"},"rgb()":{syntax:"rgb( {3} [ / ]? ) | rgb( {3} [ / ]? ) | rgb( #{3} , ? ) | rgb( #{3} , ? )"},"rgba()":{syntax:"rgba( {3} [ / ]? ) | rgba( {3} [ / ]? ) | rgba( #{3} , ? ) | rgba( #{3} , ? )"},"rotate()":{syntax:"rotate( [ | ] )"},"rotate3d()":{syntax:"rotate3d( , , , [ | ] )"},"rotateX()":{syntax:"rotateX( [ | ] )"},"rotateY()":{syntax:"rotateY( [ | ] )"},"rotateZ()":{syntax:"rotateZ( [ | ] )"},"saturate()":{syntax:"saturate( )"},"scale()":{syntax:"scale( , ? )"},"scale3d()":{syntax:"scale3d( , , )"},"scaleX()":{syntax:"scaleX( )"},"scaleY()":{syntax:"scaleY( )"},"scaleZ()":{syntax:"scaleZ( )"},"shape-radius":{syntax:" | closest-side | farthest-side"},"skew()":{syntax:"skew( [ | ] , [ | ]? )"},"skewX()":{syntax:"skewX( [ | ] )"},"skewY()":{syntax:"skewY( [ | ] )"},"sepia()":{syntax:"sepia( )"},shadow:{syntax:"inset? && {2,4} && ?"},"shadow-t":{syntax:"[ {2,3} && ? ]"},shape:{syntax:"rect(, , , )"},"shape-box":{syntax:" | margin-box"},"side-or-corner":{syntax:"[ left | right ] || [ top | bottom ]"},size:{syntax:"closest-side | farthest-side | closest-corner | farthest-corner | | {2}"},"track-breadth":{syntax:" | | min-content | max-content | auto"},"track-list":{syntax:"[ ? [ | ] ]+ ?"},"track-repeat":{syntax:"repeat( [ ] , [ ? ]+ ? )"},"track-size":{syntax:" | minmax( , ) | fit-content( [ | ] )"},"transform-function":{syntax:" | | | | | | | | | | | | | | | | | | | | "},"transform-list":{syntax:"+"},"translate()":{syntax:"translate( , ? )"},"translate3d()":{syntax:"translate3d( , , )"},"translateX()":{syntax:"translateX( )"},"translateY()":{syntax:"translateY( )"},"translateZ()":{syntax:"translateZ( )"}},Pa={properties:{},syntaxes:{bottom:{syntax:" | auto"},left:{syntax:" | auto"},"name-repeat":{syntax:"repeat( [ | auto-fill ], +)"},right:{syntax:" | auto"},top:{syntax:" | auto"},url:{syntax:"url( * ) | "},"url-modifier":{syntax:" | )"},"positive-integer":{syntax:""}}},La={},Ea=Aa,Da=Pa;function Oa(e,t){var n={};for(var r in e)n[r]=e[r].syntax;for(var r in t)r in e?t[r].syntax?n[r]=t[r].syntax:delete n[r]:t[r].syntax&&(n[r]=t[r].syntax);return n}var Ba={types:Oa(Ta,Da.syntaxes),atrules:function(e){var t=Object.create(null);for(var n in e){var r=e[n],a=null;if(r.descriptors)for(var s in a=Object.create(null),r.descriptors)a[s]=r.descriptors[s].syntax;t[n.substr(1)]={prelude:r.syntax.trim().match(/^@\S+\s+([^;\{]*)/)[1].trim()||null,descriptors:a}}return t}(La),properties:Oa(Ea,Da.properties)},Na=_e.cmpChar,Ia=_e.isDigit,Ra=_e.TYPE,Ma=Ra.WhiteSpace,ja=Ra.Comment,Wa=Ra.Ident,Fa=Ra.Number,za=Ra.Dimension,Ya=43,Ua=45,qa=110,Ha=!0;function Va(e,t){var n=this.scanner.tokenStart+e,r=this.scanner.source.charCodeAt(n);for(r!==Ya&&r!==Ua||(t&&this.error("Number sign is not allowed"),n++);n0&&this.scanner.skip(e),0===t&&(n=this.scanner.source.charCodeAt(this.scanner.tokenStart))!==Ya&&n!==Ua&&this.error("Number sign is expected"),Ka.call(this,0!==t),t===Ua?"-"+this.consume(Fa):this.consume(Fa)}var Za={name:"AnPlusB",structure:{a:[String,null],b:[String,null]},parse:function(){var e=this.scanner.tokenStart,t=null,n=null;if(this.scanner.tokenType===Fa)Ka.call(this,false),n=this.consume(Fa);else if(this.scanner.tokenType===Wa&&Na(this.scanner.source,this.scanner.tokenStart,Ua))switch(t="-1",Qa.call(this,1,qa),this.scanner.getTokenLength()){case 2:this.scanner.next(),n=Ga.call(this);break;case 3:Qa.call(this,2,Ua),this.scanner.next(),this.scanner.skipSC(),Ka.call(this,Ha),n="-"+this.consume(Fa);break;default:Qa.call(this,2,Ua),Va.call(this,3,Ha),this.scanner.next(),n=this.scanner.substrToCursor(e+2)}else if(this.scanner.tokenType===Wa||this.scanner.isDelim(Ya)&&this.scanner.lookupType(1)===Wa){var r=0;switch(t="1",this.scanner.isDelim(Ya)&&(r=1,this.scanner.next()),Qa.call(this,0,qa),this.scanner.getTokenLength()){case 1:this.scanner.next(),n=Ga.call(this);break;case 2:Qa.call(this,1,Ua),this.scanner.next(),this.scanner.skipSC(),Ka.call(this,Ha),n="-"+this.consume(Fa);break;default:Qa.call(this,1,Ua),Va.call(this,2,Ha),this.scanner.next(),n=this.scanner.substrToCursor(e+r+1)}}else if(this.scanner.tokenType===za){for(var a=this.scanner.source.charCodeAt(this.scanner.tokenStart),s=(r=a===Ya||a===Ua,this.scanner.tokenStart+r);s0&&this.scanner.lookupType(-1)===Xa?this.scanner.tokenIndex>1?this.scanner.getTokenStart(this.scanner.tokenIndex-1):this.scanner.firstCharOffset:this.scanner.tokenStart}function ns(){return 0}var rs={name:"Raw",structure:{value:String},parse:function(e,t,n){var r,a=this.scanner.getTokenStart(e);return this.scanner.skip(this.scanner.getRawLength(e,t||ns)),r=n&&this.scanner.tokenStart>a?ts.call(this):this.scanner.tokenStart,{type:"Raw",loc:this.getLocation(a,r),value:this.scanner.source.substring(a,r)}},generate:function(e){this.chunk(e.value)},mode:{default:ns,leftCurlyBracket:function(e){return e===$a?1:0},leftCurlyBracketOrSemicolon:function(e){return e===$a||e===Ja?1:0},exclamationMarkOrSemicolon:function(e,t,n){return e===es&&33===t.charCodeAt(n)||e===Ja?1:0},semicolonIncluded:function(e){return e===Ja?2:0}}},as=_e.TYPE,ss=rs.mode,is=as.AtKeyword,os=as.Semicolon,cs=as.LeftCurlyBracket,ls=as.RightCurlyBracket;function us(e){return this.Raw(e,ss.leftCurlyBracketOrSemicolon,!0)}function hs(){for(var e,t=1;e=this.scanner.lookupType(t);t++){if(e===ls)return!0;if(e===cs||e===is)return!1}return!1}var ps={name:"Atrule",structure:{name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]},parse:function(){var e,t,n=this.scanner.tokenStart,r=null,a=null;switch(this.eat(is),t=(e=this.scanner.substrToCursor(n+1)).toLowerCase(),this.scanner.skipSC(),!1===this.scanner.eof&&this.scanner.tokenType!==cs&&this.scanner.tokenType!==os&&(this.parseAtrulePrelude?"AtrulePrelude"===(r=this.parseWithFallback(this.AtrulePrelude.bind(this,e),us)).type&&null===r.children.head&&(r=null):r=us.call(this,this.scanner.tokenIndex),this.scanner.skipSC()),this.scanner.tokenType){case os:this.scanner.next();break;case cs:a=this.atrule.hasOwnProperty(t)&&"function"==typeof this.atrule[t].block?this.atrule[t].block.call(this):this.Block(hs.call(this))}return{type:"Atrule",loc:this.getLocation(n,this.scanner.tokenStart),name:e,prelude:r,block:a}},generate:function(e){this.chunk("@"),this.chunk(e.name),null!==e.prelude&&(this.chunk(" "),this.node(e.prelude)),e.block?this.node(e.block):this.chunk(";")},walkContext:"atrule"},ds=_e.TYPE,fs=ds.Semicolon,ys=ds.LeftCurlyBracket,gs={name:"AtrulePrelude",structure:{children:[[]]},parse:function(e){var t=null;return null!==e&&(e=e.toLowerCase()),this.scanner.skipSC(),t=this.atrule.hasOwnProperty(e)&&"function"==typeof this.atrule[e].prelude?this.atrule[e].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.scanner.skipSC(),!0!==this.scanner.eof&&this.scanner.tokenType!==ys&&this.scanner.tokenType!==fs&&this.error("Semicolon or block is expected"),null===t&&(t=this.createList()),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}},generate:function(e){this.children(e)},walkContext:"atrulePrelude"},ms=_e.TYPE,ks=ms.Ident,xs=ms.String,bs=ms.Colon,vs=ms.LeftSquareBracket,Ss=ms.RightSquareBracket;function Cs(){this.scanner.eof&&this.error("Unexpected end of input");var e=this.scanner.tokenStart,t=!1,n=!0;return this.scanner.isDelim(42)?(t=!0,n=!1,this.scanner.next()):this.scanner.isDelim(124)||this.eat(ks),this.scanner.isDelim(124)?61!==this.scanner.source.charCodeAt(this.scanner.tokenStart+1)?(this.scanner.next(),this.eat(ks)):t&&this.error("Identifier is expected",this.scanner.tokenEnd):t&&this.error("Vertical line is expected"),n&&this.scanner.tokenType===bs&&(this.scanner.next(),this.eat(ks)),{type:"Identifier",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e)}}function ws(){var e=this.scanner.tokenStart,t=this.scanner.source.charCodeAt(e);return 61!==t&&126!==t&&94!==t&&36!==t&&42!==t&&124!==t&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.scanner.next(),61!==t&&(this.scanner.isDelim(61)||this.error("Equal sign is expected"),this.scanner.next()),this.scanner.substrToCursor(e)}var As={name:"AttributeSelector",structure:{name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]},parse:function(){var e,t=this.scanner.tokenStart,n=null,r=null,a=null;return this.eat(vs),this.scanner.skipSC(),e=Cs.call(this),this.scanner.skipSC(),this.scanner.tokenType!==Ss&&(this.scanner.tokenType!==ks&&(n=ws.call(this),this.scanner.skipSC(),r=this.scanner.tokenType===xs?this.String():this.Identifier(),this.scanner.skipSC()),this.scanner.tokenType===ks&&(a=this.scanner.getTokenValue(),this.scanner.next(),this.scanner.skipSC())),this.eat(Ss),{type:"AttributeSelector",loc:this.getLocation(t,this.scanner.tokenStart),name:e,matcher:n,value:r,flags:a}},generate:function(e){var t=" ";this.chunk("["),this.node(e.name),null!==e.matcher&&(this.chunk(e.matcher),null!==e.value&&(this.node(e.value),"String"===e.value.type&&(t=""))),null!==e.flags&&(this.chunk(t),this.chunk(e.flags)),this.chunk("]")}},Ts=_e.TYPE,Ps=rs.mode,Ls=Ts.WhiteSpace,Es=Ts.Comment,Ds=Ts.Semicolon,Os=Ts.AtKeyword,Bs=Ts.LeftCurlyBracket,Ns=Ts.RightCurlyBracket;function Is(e){return this.Raw(e,null,!0)}function Rs(){return this.parseWithFallback(this.Rule,Is)}function Ms(e){return this.Raw(e,Ps.semicolonIncluded,!0)}function js(){if(this.scanner.tokenType===Ds)return Ms.call(this,this.scanner.tokenIndex);var e=this.parseWithFallback(this.Declaration,Ms);return this.scanner.tokenType===Ds&&this.scanner.next(),e}var Ws={name:"Block",structure:{children:[["Atrule","Rule","Declaration"]]},parse:function(e){var t=e?js:Rs,n=this.scanner.tokenStart,r=this.createList();this.eat(Bs);e:for(;!this.scanner.eof;)switch(this.scanner.tokenType){case Ns:break e;case Ls:case Es:this.scanner.next();break;case Os:r.push(this.parseWithFallback(this.Atrule,Is));break;default:r.push(t.call(this))}return this.scanner.eof||this.eat(Ns),{type:"Block",loc:this.getLocation(n,this.scanner.tokenStart),children:r}},generate:function(e){this.chunk("{"),this.children(e,(function(e){"Declaration"===e.type&&this.chunk(";")})),this.chunk("}")},walkContext:"block"},Fs=_e.TYPE,zs=Fs.LeftSquareBracket,Ys=Fs.RightSquareBracket,Us={name:"Brackets",structure:{children:[[]]},parse:function(e,t){var n,r=this.scanner.tokenStart;return this.eat(zs),n=e.call(this,t),this.scanner.eof||this.eat(Ys),{type:"Brackets",loc:this.getLocation(r,this.scanner.tokenStart),children:n}},generate:function(e){this.chunk("["),this.children(e),this.chunk("]")}},qs=_e.TYPE.CDC,Hs={name:"CDC",structure:[],parse:function(){var e=this.scanner.tokenStart;return this.eat(qs),{type:"CDC",loc:this.getLocation(e,this.scanner.tokenStart)}},generate:function(){this.chunk("--\x3e")}},Vs=_e.TYPE.CDO,Ks={name:"CDO",structure:[],parse:function(){var e=this.scanner.tokenStart;return this.eat(Vs),{type:"CDO",loc:this.getLocation(e,this.scanner.tokenStart)}},generate:function(){this.chunk("\x3c!--")}},Qs=_e.TYPE.Ident,Gs={name:"ClassSelector",structure:{name:String},parse:function(){return this.scanner.isDelim(46)||this.error("Full stop is expected"),this.scanner.next(),{type:"ClassSelector",loc:this.getLocation(this.scanner.tokenStart-1,this.scanner.tokenEnd),name:this.consume(Qs)}},generate:function(e){this.chunk("."),this.chunk(e.name)}},Zs=_e.TYPE.Ident,_s={name:"Combinator",structure:{name:String},parse:function(){var e=this.scanner.tokenStart;switch(this.scanner.source.charCodeAt(this.scanner.tokenStart)){case 62:case 43:case 126:this.scanner.next();break;case 47:this.scanner.next(),this.scanner.tokenType===Zs&&!1!==this.scanner.lookupValue(0,"deep")||this.error("Identifier `deep` is expected"),this.scanner.next(),this.scanner.isDelim(47)||this.error("Solidus is expected"),this.scanner.next();break;default:this.error("Combinator is expected")}return{type:"Combinator",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.name)}},Xs=_e.TYPE.Comment,Js={name:"Comment",structure:{value:String},parse:function(){var e=this.scanner.tokenStart,t=this.scanner.tokenEnd;return this.eat(Xs),t-e+2>=2&&42===this.scanner.source.charCodeAt(t-2)&&47===this.scanner.source.charCodeAt(t-1)&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.source.substring(e+2,t)}},generate:function(e){this.chunk("/*"),this.chunk(e.value),this.chunk("*/")}},$s=we.isCustomProperty,ei=_e.TYPE,ti=rs.mode,ni=ei.Ident,ri=ei.Hash,ai=ei.Colon,si=ei.Semicolon,ii=ei.Delim;function oi(e){return this.Raw(e,ti.exclamationMarkOrSemicolon,!0)}function ci(e){return this.Raw(e,ti.exclamationMarkOrSemicolon,!1)}function li(){var e=this.scanner.tokenIndex,t=this.Value();return"Raw"!==t.type&&!1===this.scanner.eof&&this.scanner.tokenType!==si&&!1===this.scanner.isDelim(33)&&!1===this.scanner.isBalanceEdge(e)&&this.error(),t}var ui={name:"Declaration",structure:{important:[Boolean,String],property:String,value:["Value","Raw"]},parse:function(){var e,t=this.scanner.tokenStart,n=this.scanner.tokenIndex,r=hi.call(this),a=$s(r),s=a?this.parseCustomProperty:this.parseValue,i=a?ci:oi,o=!1;return this.scanner.skipSC(),this.eat(ai),a||this.scanner.skipSC(),e=s?this.parseWithFallback(li,i):i.call(this,this.scanner.tokenIndex),this.scanner.isDelim(33)&&(o=pi.call(this),this.scanner.skipSC()),!1===this.scanner.eof&&this.scanner.tokenType!==si&&!1===this.scanner.isBalanceEdge(n)&&this.error(),{type:"Declaration",loc:this.getLocation(t,this.scanner.tokenStart),important:o,property:r,value:e}},generate:function(e){this.chunk(e.property),this.chunk(":"),this.node(e.value),e.important&&this.chunk(!0===e.important?"!important":"!"+e.important)},walkContext:"declaration"};function hi(){var e=this.scanner.tokenStart;if(this.scanner.tokenType===ii)switch(this.scanner.source.charCodeAt(this.scanner.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.scanner.next();break;case 47:this.scanner.next(),this.scanner.isDelim(47)&&this.scanner.next()}return this.scanner.tokenType===ri?this.eat(ri):this.eat(ni),this.scanner.substrToCursor(e)}function pi(){this.eat(ii),this.scanner.skipSC();var e=this.consume(ni);return"important"===e||e}var di=_e.TYPE,fi=rs.mode,yi=di.WhiteSpace,gi=di.Comment,mi=di.Semicolon;function ki(e){return this.Raw(e,fi.semicolonIncluded,!0)}var xi={name:"DeclarationList",structure:{children:[["Declaration"]]},parse:function(){for(var e=this.createList();!this.scanner.eof;)switch(this.scanner.tokenType){case yi:case gi:case mi:this.scanner.next();break;default:e.push(this.parseWithFallback(this.Declaration,ki))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}},generate:function(e){this.children(e,(function(e){"Declaration"===e.type&&this.chunk(";")}))}},bi=ee.consumeNumber,vi=_e.TYPE.Dimension,Si={name:"Dimension",structure:{value:String,unit:String},parse:function(){var e=this.scanner.tokenStart,t=bi(this.scanner.source,e);return this.eat(vi),{type:"Dimension",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.source.substring(e,t),unit:this.scanner.source.substring(t,this.scanner.tokenStart)}},generate:function(e){this.chunk(e.value),this.chunk(e.unit)}},Ci=_e.TYPE.RightParenthesis,wi={name:"Function",structure:{name:String,children:[[]]},parse:function(e,t){var n,r=this.scanner.tokenStart,a=this.consumeFunctionName(),s=a.toLowerCase();return n=t.hasOwnProperty(s)?t[s].call(this,t):e.call(this,t),this.scanner.eof||this.eat(Ci),{type:"Function",loc:this.getLocation(r,this.scanner.tokenStart),name:a,children:n}},generate:function(e){this.chunk(e.name),this.chunk("("),this.children(e),this.chunk(")")},walkContext:"function"},Ai=_e.TYPE.Hash,Ti={name:"HexColor",structure:{value:String},parse:function(){var e=this.scanner.tokenStart;return this.eat(Ai),{type:"HexColor",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.substrToCursor(e+1)}},generate:function(e){this.chunk("#"),this.chunk(e.value)}},Pi=_e.TYPE.Ident,Li={name:"Identifier",structure:{name:String},parse:function(){return{type:"Identifier",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),name:this.consume(Pi)}},generate:function(e){this.chunk(e.name)}},Ei=_e.TYPE.Hash,Di={name:"IdSelector",structure:{name:String},parse:function(){var e=this.scanner.tokenStart;return this.eat(Ei),{type:"IdSelector",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e+1)}},generate:function(e){this.chunk("#"),this.chunk(e.name)}},Oi=_e.TYPE,Bi=Oi.Ident,Ni=Oi.Number,Ii=Oi.Dimension,Ri=Oi.LeftParenthesis,Mi=Oi.RightParenthesis,ji=Oi.Colon,Wi=Oi.Delim,Fi={name:"MediaFeature",structure:{name:String,value:["Identifier","Number","Dimension","Ratio",null]},parse:function(){var e,t=this.scanner.tokenStart,n=null;if(this.eat(Ri),this.scanner.skipSC(),e=this.consume(Bi),this.scanner.skipSC(),this.scanner.tokenType!==Mi){switch(this.eat(ji),this.scanner.skipSC(),this.scanner.tokenType){case Ni:n=this.lookupNonWSType(1)===Wi?this.Ratio():this.Number();break;case Ii:n=this.Dimension();break;case Bi:n=this.Identifier();break;default:this.error("Number, dimension, ratio or identifier is expected")}this.scanner.skipSC()}return this.eat(Mi),{type:"MediaFeature",loc:this.getLocation(t,this.scanner.tokenStart),name:e,value:n}},generate:function(e){this.chunk("("),this.chunk(e.name),null!==e.value&&(this.chunk(":"),this.node(e.value)),this.chunk(")")}},zi=_e.TYPE,Yi=zi.WhiteSpace,Ui=zi.Comment,qi=zi.Ident,Hi=zi.LeftParenthesis,Vi={name:"MediaQuery",structure:{children:[["Identifier","MediaFeature","WhiteSpace"]]},parse:function(){this.scanner.skipSC();var e=this.createList(),t=null,n=null;e:for(;!this.scanner.eof;){switch(this.scanner.tokenType){case Ui:this.scanner.next();continue;case Yi:n=this.WhiteSpace();continue;case qi:t=this.Identifier();break;case Hi:t=this.MediaFeature();break;default:break e}null!==n&&(e.push(n),n=null),e.push(t)}return null===t&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(e),children:e}},generate:function(e){this.children(e)}},Ki=_e.TYPE.Comma,Qi={name:"MediaQueryList",structure:{children:[["MediaQuery"]]},parse:function(e){var t=this.createList();for(this.scanner.skipSC();!this.scanner.eof&&(t.push(this.MediaQuery(e)),this.scanner.tokenType===Ki);)this.scanner.next();return{type:"MediaQueryList",loc:this.getLocationFromList(t),children:t}},generate:function(e){this.children(e,(function(){this.chunk(",")}))}},Gi=_e.TYPE.Number,Zi={name:"Number",structure:{value:String},parse:function(){return{type:"Number",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),value:this.consume(Gi)}},generate:function(e){this.chunk(e.value)}},_i={name:"Operator",structure:{value:String},parse:function(){var e=this.scanner.tokenStart;return this.scanner.next(),{type:"Operator",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.value)}},Xi=_e.TYPE,Ji=Xi.LeftParenthesis,$i=Xi.RightParenthesis,eo={name:"Parentheses",structure:{children:[[]]},parse:function(e,t){var n,r=this.scanner.tokenStart;return this.eat(Ji),n=e.call(this,t),this.scanner.eof||this.eat($i),{type:"Parentheses",loc:this.getLocation(r,this.scanner.tokenStart),children:n}},generate:function(e){this.chunk("("),this.children(e),this.chunk(")")}},to=ee.consumeNumber,no=_e.TYPE.Percentage,ro={name:"Percentage",structure:{value:String},parse:function(){var e=this.scanner.tokenStart,t=to(this.scanner.source,e);return this.eat(no),{type:"Percentage",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.source.substring(e,t)}},generate:function(e){this.chunk(e.value),this.chunk("%")}},ao=_e.TYPE,so=ao.Ident,io=ao.Function,oo=ao.Colon,co=ao.RightParenthesis,lo={name:"PseudoClassSelector",structure:{name:String,children:[["Raw"],null]},parse:function(){var e,t,n=this.scanner.tokenStart,r=null;return this.eat(oo),this.scanner.tokenType===io?(t=(e=this.consumeFunctionName()).toLowerCase(),this.pseudo.hasOwnProperty(t)?(this.scanner.skipSC(),r=this.pseudo[t].call(this),this.scanner.skipSC()):(r=this.createList()).push(this.Raw(this.scanner.tokenIndex,null,!1)),this.eat(co)):e=this.consume(so),{type:"PseudoClassSelector",loc:this.getLocation(n,this.scanner.tokenStart),name:e,children:r}},generate:function(e){this.chunk(":"),this.chunk(e.name),null!==e.children&&(this.chunk("("),this.children(e),this.chunk(")"))},walkContext:"function"},uo=_e.TYPE,ho=uo.Ident,po=uo.Function,fo=uo.Colon,yo=uo.RightParenthesis,go={name:"PseudoElementSelector",structure:{name:String,children:[["Raw"],null]},parse:function(){var e,t,n=this.scanner.tokenStart,r=null;return this.eat(fo),this.eat(fo),this.scanner.tokenType===po?(t=(e=this.consumeFunctionName()).toLowerCase(),this.pseudo.hasOwnProperty(t)?(this.scanner.skipSC(),r=this.pseudo[t].call(this),this.scanner.skipSC()):(r=this.createList()).push(this.Raw(this.scanner.tokenIndex,null,!1)),this.eat(yo)):e=this.consume(ho),{type:"PseudoElementSelector",loc:this.getLocation(n,this.scanner.tokenStart),name:e,children:r}},generate:function(e){this.chunk("::"),this.chunk(e.name),null!==e.children&&(this.chunk("("),this.children(e),this.chunk(")"))},walkContext:"function"},mo=_e.isDigit,ko=_e.TYPE,xo=ko.Number,bo=ko.Delim;function vo(){this.scanner.skipWS();for(var e=this.consume(xo),t=0;t6&&this.error("Too many hex digits",n)}return this.scanner.next(),r}function Jo(e){for(var t=0;this.scanner.isDelim(63);)++t>e&&this.error("Too many question marks"),this.scanner.next()}function $o(e){this.scanner.source.charCodeAt(this.scanner.tokenStart)!==e&&this.error(Qo[e]+" is expected")}function ec(){var e=0;return this.scanner.isDelim(43)?(this.scanner.next(),this.scanner.tokenType===Go?void((e=Xo.call(this,0,!0))>0&&Jo.call(this,6-e)):this.scanner.isDelim(63)?(this.scanner.next(),void Jo.call(this,5)):void this.error("Hex digit or question mark is expected")):this.scanner.tokenType===Zo?($o.call(this,43),e=Xo.call(this,1,!0),this.scanner.isDelim(63)?void Jo.call(this,6-e):this.scanner.tokenType===_o||this.scanner.tokenType===Zo?($o.call(this,45),void Xo.call(this,1,!1)):void 0):this.scanner.tokenType===_o?($o.call(this,43),void((e=Xo.call(this,1,!0))>0&&Jo.call(this,6-e))):void this.error()}var tc={name:"UnicodeRange",structure:{value:String},parse:function(){var e=this.scanner.tokenStart;return Vo(this.scanner.source,e,117)||this.error("U is expected"),Vo(this.scanner.source,e+1,43)||this.error("Plus sign is expected"),this.scanner.next(),ec.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.value)}},nc=_e.isWhiteSpace,rc=_e.cmpStr,ac=_e.TYPE,sc=ac.Function,ic=ac.Url,oc=ac.RightParenthesis,cc={name:"Url",structure:{value:["String","Raw"]},parse:function(){var e,t=this.scanner.tokenStart;switch(this.scanner.tokenType){case ic:for(var n=t+4,r=this.scanner.tokenEnd-1;n{fl.includes(e)||gl.push(e)}));const ml=(e,t=!1)=>{let n=e.toLowerCase().trim();if("cssoffset"===n&&(n=n.substr(3)),gl.includes(n))return!t||n;if(n.includes("-"))return!!t&&"";n=n.replace(/-/g,"");for(const e of gl)if(n===e.replace(/-/g,""))return!t||e;return!!t&&""},kl=(e,t=!0)=>{let n=ml(e,!0);return n?(t&&"offset"===n&&(n="css-"+n),n.replace(/-([a-z])/g,((e,t)=>t.toUpperCase()))):""},xl=e=>ml(e,!0),bl={main:"",links:{},order:[]},vl=e=>{const t=e.match(/<'[a-zA-Z0-9-()]+'>/g);Array.isArray(t)&&t.forEach((e=>{const t=e.slice(2,-2),n=Aa[t];bl[e]=n.syntax,bl.order.push(e),vl(n.syntax)}));const n=e.match(/<[a-zA-Z0-9-()]+>/g);Array.isArray(n)&&n.forEach((e=>{const t=e.slice(1,-1);if(!bl[e]){const n=Ta[t],r=Pa.syntaxes[t];n?(bl[e]=n.syntax,bl.order.push(e),vl(n.syntax)):r?(bl[e]=r.syntax,bl.order.push(e),vl(r.syntax)):["url-token","any-value","function-token","hex-color","declaration-value","hash-token","zero"].includes(t)||(bl.links[e]="https://developer.mozilla.org/docs/Web/CSS/"+t.replace(/flex/,"flex_value"))}}))},Sl=(e,t=!0)=>{const r=[];if(u(e))for(let[t,a]of Object.entries(e))if(d(a)||n(a)){const e=ml(t,!0);if(e){let t;try{t=dl.parse(`${e}: ${a}`,{context:"declaration",onParseError:e=>{r.push(e)}}),dl.walk(t,{visit:"Declaration",enter:function(e){const t=dl.lexer.matchDeclaration(e).error;t&&r.push(t)}})}catch(e){r.push(e)}}else r.push({name:"MatchError",message:t+" is not an animatable CSS property."})}else r.push({name:"TypeError",message:"Property value must be a string or a number. "+typeof a+" given."});else r.push({name:"TypeError",message:"Argument is not a plain object."});return!r.length||!!t&&r[r.length-1]},Cl=(e,t)=>{switch(t){case"css":e=xl(e);break;case"js":e=kl(e,!1);break;default:e=kl(e)}return e};var wl={properties:gl,cssToJs:kl,jsToCss:xl,isAnimatable:ml,popular:(e=0,t=10)=>{const n=[];let r;t>=yl.length&&(r=gl.filter((e=>!yl.includes(gl.indexOf(e)))));for(let a=e;a{for(const e in bl)delete bl[e];bl.main="",bl.links={},bl.order=[];const t=ml(e,!0);if(t){const e=Aa[t].syntax;bl.main=e,vl(e)}else bl.main=`Error: ${e} is not an animatable CSS property.`;return bl},validate:Sl,sanitize:(e,t="waapi")=>{t=t.toString().toLowerCase();let n={};if(Array.isArray(e))n=[],e.forEach((e=>{const r=ml(e,!0);r&&n.push(Cl(r,t))}));else if(u(e))for(let[r,a]of Object.entries(e)){const e={};e[r]=a,Sl(e,!1)&&(n[Cl(r,t)]=a)}else if(d(e))switch(t){case"css":return xl(e);case"js":return kl(e,!1);default:return kl(e)}return n}},Al={properties:wl.properties.map((e=>wl.cssToJs(e))),propertiesCSS:wl.properties,propertiesJS:wl.properties.map((e=>wl.cssToJs(e,!1)))};const Tl=Al.properties,Pl=Al.propertiesCSS,Ll=Al.propertiesJS,El=wl.cssToJs,Dl=wl.jsToCss,Ol=wl.isAnimatable,Bl=wl.popular,Nl=wl.syntax,Il=wl.validate,Rl=wl.sanitize;e.cssToJs=El,e.isAnimatable=Ol,e.jsToCss=Dl,e.popular=Bl,e.properties=Tl,e.propertiesCSS=Pl,e.propertiesJS=Ll,e.sanitize=Rl,e.syntax=Nl,e.validate=Il,Object.defineProperty(e,"__esModule",{value:!0})})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).animatable={})}(this,(function(e){"use strict";var t=Object.prototype.toString;var n=function(e){return"number"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Number]"==t.call(e)};var r=Function.prototype,a=Object.prototype,s=r.toString,i=a.hasOwnProperty,o=s.call(Object),c=a.toString,l=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object);var u=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||"[object Object]"!=c.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=l(e);if(null===t)return!0;var n=i.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==o},h=Object.prototype.toString,p=Array.isArray;var d=function(e){return"string"==typeof e||!p(e)&&function(e){return!!e&&"object"==typeof e}(e)&&"[object String]"==h.call(e)},f={};function y(e){return{prev:null,next:null,data:e}}function g(e,t,n){var r;return null!==k?(r=k,k=k.cursor,r.prev=t,r.next=n,r.cursor=e.cursor):r={prev:t,next:n,cursor:e.cursor},e.cursor=r,r}function m(e){var t=e.cursor;e.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=k,k=t}var k=null,x=function(){this.cursor=null,this.head=null,this.tail=null};x.createItem=y,x.prototype.createItem=y,x.prototype.updateCursors=function(e,t,n,r){for(var a=this.cursor;null!==a;)a.prev===e&&(a.prev=t),a.next===n&&(a.next=r),a=a.cursor},x.prototype.getSize=function(){for(var e=0,t=this.head;t;)e++,t=t.next;return e},x.prototype.fromArray=function(e){var t=null;this.head=null;for(var n=0;n100&&(l=s-60+3,s=58);for(var u=i;u<=o;u++)u>=0&&u0&&r[u].length>l?"…":"")+r[u].substr(l,98)+(r[u].length>l+100-1?"…":""));return[n(i,a),new Array(s+c+2).join("-")+"^",n(a,o)].filter(Boolean).join("\n")}var A=function(e,t,n,r,a){var s=S("SyntaxError",e);return s.source=t,s.offset=n,s.line=r,s.column=a,s.sourceFragment=function(e){return w(s,isNaN(e)?0:e)},Object.defineProperty(s,"formattedMessage",{get:function(){return"Parse error: "+s.message+"\n"+w(s,2)}}),s.parseError={offset:n,line:r,column:a},s},T={EOF:0,Ident:1,Function:2,AtKeyword:3,Hash:4,String:5,BadString:6,Url:7,BadUrl:8,Delim:9,Number:10,Percentage:11,Dimension:12,WhiteSpace:13,CDO:14,CDC:15,Colon:16,Semicolon:17,Comma:18,LeftSquareBracket:19,RightSquareBracket:20,LeftParenthesis:21,RightParenthesis:22,LeftCurlyBracket:23,RightCurlyBracket:24,Comment:25},P=Object.keys(T).reduce((function(e,t){return e[T[t]]=t,e}),{}),L={TYPE:T,NAME:P};function E(e){return e>=48&&e<=57}function D(e){return e>=65&&e<=90}function O(e){return e>=97&&e<=122}function B(e){return D(e)||O(e)}function N(e){return e>=128}function I(e){return B(e)||N(e)||95===e}function R(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function M(e){return 10===e||13===e||12===e}function j(e){return M(e)||32===e||9===e}function W(e,t){return 92===e&&(!M(t)&&0!==t)}var F=new Array(128);Y.Eof=128,Y.WhiteSpace=130,Y.Digit=131,Y.NameStart=132,Y.NonPrintable=133;for(var z=0;z=65&&e<=70||e>=97&&e<=102},isUppercaseLetter:D,isLowercaseLetter:O,isLetter:B,isNonAscii:N,isNameStart:I,isName:function(e){return I(e)||E(e)||45===e},isNonPrintable:R,isNewline:M,isWhiteSpace:j,isValidEscape:W,isIdentifierStart:function(e,t,n){return 45===e?I(t)||45===t||W(t,n):!!I(e)||92===e&&W(e,t)},isNumberStart:function(e,t,n){return 43===e||45===e?E(t)?2:46===t&&E(n)?3:0:46===e?E(t)?2:0:E(e)?1:0},isBOM:function(e){return 65279===e||65534===e?1:0},charCodeCategory:Y},q=U.isDigit,H=U.isHexDigit,V=U.isUppercaseLetter,K=U.isName,Q=U.isWhiteSpace,G=U.isValidEscape;function Z(e,t){return te.length)return!1;for(var a=t;a=0&&Q(e.charCodeAt(t));t--);return t+1},findWhiteSpaceEnd:function(e,t){for(;t>ce:ae},lookupOffset:function(e){return(e+=this.tokenIndex)0?e>ce,this.source,a)){case 1:break e;case 2:r++;break e;default:a=this.offsetAndType[r]&oe,this.balance[n]===r&&(r=n)}return r-this.tokenIndex},isBalanceEdge:function(e){return this.balance[this.tokenIndex]>ce===se;e++,t++);t>0&&this.skip(t)},skipSC:function(){for(;this.tokenType===se||this.tokenType===ie;)this.next()},skip:function(e){var t=this.tokenIndex+e;t>ce,this.tokenEnd=t&oe):(this.tokenIndex=this.tokenCount,this.next())},next:function(){var e=this.tokenIndex+1;e>ce,this.tokenEnd=e&oe):(this.tokenIndex=this.tokenCount,this.eof=!0,this.tokenType=ae,this.tokenStart=this.tokenEnd=this.source.length)},dump:function(){var e=this.firstCharOffset;return Array.prototype.slice.call(this.offsetAndType,0,this.tokenCount).map((function(t,n){var r=e,a=t&oe;return e=a,{idx:n,type:ne[t>>ce],chunk:this.source.substring(r,a),balance:this.balance[n]}}),this)}};var ue=le;function he(e){return e}function pe(e,t,n,r){var a,s;switch(e.type){case"Group":a=function(e,t,n,r){var a=" "===e.combinator||r?e.combinator:" "+e.combinator+" ",s=e.terms.map((function(e){return pe(e,t,n,r)})).join(a);return(e.explicit||n)&&(s=(r||","===s[0]?"[":"[ ")+s+(r?"]":" ]")),s}(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return pe(e.term,t,n,r)+t(0===(s=e).min&&0===s.max?"*":0===s.min&&1===s.max?"?":1===s.min&&0===s.max?s.comma?"#":"+":1===s.min&&1===s.max?"":(s.comma?"#":"")+(s.min===s.max?"{"+s.min+"}":"{"+s.min+","+(0!==s.max?s.max:"")+"}"),e);case"Type":a="<"+e.name+(e.opts?t(function(e){switch(e.type){case"Range":return" ["+(null===e.min?"-∞":e.min)+","+(null===e.max?"∞":e.max)+"]";default:throw new Error("Unknown node type `"+e.type+"`")}}(e.opts),e.opts):"")+">";break;case"Property":a="<'"+e.name+"'>";break;case"Keyword":a=e.name;break;case"AtKeyword":a="@"+e.name;break;case"Function":a=e.name+"(";break;case"String":case"Token":a=e.value;break;case"Comma":a=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(a,e)}var de=function(e,t){var n=he,r=!1,a=!1;return"function"==typeof t?n=t:t&&(r=Boolean(t.forceBraces),a=Boolean(t.compact),"function"==typeof t.decorate&&(n=t.decorate)),pe(e,n,r,a)},fe=v,ye=de;function ge(e,t){var n=e&&e.loc&&e.loc[t];return n?{offset:n.offset,line:n.line,column:n.column}:null}var me=function(e,t){var n=fe("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},ke=function(e,t,n,r){var a=fe("SyntaxMatchError",e),s=function(e){for(var t=e.tokens,n=e.longestMatch,r=n1}}(r),i=s.mismatchOffset||0,o=s.node||n,c=ge(o,"end"),l=s.last?c:ge(o,"start"),u=s.css;return a.rawMessage=e,a.syntax=t?ye(t):"",a.css=u,a.mismatchOffset=i,a.loc={source:o&&o.loc&&o.loc.source||"",start:l,end:c},a.line=l?l.line:void 0,a.column=l?l.column:void 0,a.offset=l?l.offset:void 0,a.message=e+"\n syntax: "+a.syntax+"\n value: "+(a.css||"")+"\n --------"+new Array(a.mismatchOffset+1).join("-")+"^",a},xe=Object.prototype.hasOwnProperty,be=Object.create(null),ve=Object.create(null);function Se(e,t){return t=t||0,e.length-t>=2&&45===e.charCodeAt(t)&&45===e.charCodeAt(t+1)}function Ce(e,t){if(t=t||0,e.length-t>=3&&45===e.charCodeAt(t)&&45!==e.charCodeAt(t+1)){var n=e.indexOf("-",t+2);if(-1!==n)return e.substring(t,n+1)}return""}var we={keyword:function(e){if(xe.call(be,e))return be[e];var t=e.toLowerCase();if(xe.call(be,t))return be[e]=be[t];var n=Se(t,0),r=n?"":Ce(t,0);return be[e]=Object.freeze({basename:t.substr(r.length),name:t,vendor:r,prefix:r,custom:n})},property:function(e){if(xe.call(ve,e))return ve[e];var t=e,n=e[0];"/"===n?n="/"===e[1]?"//":"/":"_"!==n&&"*"!==n&&"$"!==n&&"#"!==n&&"+"!==n&&"&"!==n&&(n="");var r=Se(t,n.length);if(!r&&(t=t.toLowerCase(),xe.call(ve,t)))return ve[e]=ve[t];var a=r?"":Ce(t,n.length),s=t.substr(0,n.length+a.length);return ve[e]=Object.freeze({basename:t.substr(s.length),name:t.substr(n.length),hack:n,vendor:a,prefix:s,custom:r})},isCustomProperty:Se,vendorPrefix:Ce},Ae="undefined"!=typeof Uint32Array?Uint32Array:Array,Te=function(e,t){return null===e||e.length=e.length?void(h>Ge,c[l]=f,c[f++]=l;f0?6:0;if(!pt(s))return 0;if(++a>6)return 0}return a}function St(e,t,n){if(!e)return 0;for(;xt(n(t),63);){if(++e>6)return 0;t++}return t}var Ct=_e,wt=Ct.isIdentifierStart,At=Ct.isHexDigit,Tt=Ct.isDigit,Pt=Ct.cmpStr,Lt=Ct.consumeNumber,Et=Ct.TYPE,Dt=function(e,t){var n=0;if(!e)return 0;if(e.type===at)return ut(e,0,false,n);if(e.type===rt&&e.value.charCodeAt(0)===it){if(!Je(e.value,1,110))return 0;switch(e.value.length){case 2:return ht(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==it?0:(n=lt(t(++n),n,t),ut(e=t(n),0,ot,n));default:return e.value.charCodeAt(2)!==it?0:ut(e,3,ot,n)}}else if(e.type===rt||ct(e,43)&&t(n+1).type===rt){if(e.type!==rt&&(e=t(++n)),null===e||!Je(e.value,0,110))return 0;switch(e.value.length){case 1:return ht(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==it?0:(n=lt(t(++n),n,t),ut(e=t(n),0,ot,n));default:return e.value.charCodeAt(1)!==it?0:ut(e,2,ot,n)}}else if(e.type===st){for(var r=e.value.charCodeAt(0),a=43===r||r===it?1:0,s=a;se.max)return!0}return!1}function Ft(e,t){var n=e.index,r=0;do{if(r++,e.balance<=n)break}while(e=t(r));return r}function zt(e){return function(t,n,r){return null===t?0:t.type===Et.Function&&Mt(t.value,Nt)?Ft(t,n):e(t,n,r)}}function Yt(e){return function(t){return null===t||t.type!==e?0:1}}function Ut(e){return function(t,n,r){if(null===t||t.type!==Et.Dimension)return 0;var a=Lt(t.value,0);if(null!==e){var s=t.value.indexOf("\\",a),i=-1!==s&&jt(t.value,s)?t.value.substring(a,s):t.value.substr(a);if(!1===e.hasOwnProperty(i.toLowerCase()))return 0}return Wt(r,t.value,a)?0:1}}function qt(e){return"function"!=typeof e&&(e=function(){return 0}),function(t,n,r){return null!==t&&t.type===Et.Number&&0===Number(t.value)?1:e(t,n,r)}}var Ht,Vt={"ident-token":Yt(Et.Ident),"function-token":Yt(Et.Function),"at-keyword-token":Yt(Et.AtKeyword),"hash-token":Yt(Et.Hash),"string-token":Yt(Et.String),"bad-string-token":Yt(Et.BadString),"url-token":Yt(Et.Url),"bad-url-token":Yt(Et.BadUrl),"delim-token":Yt(Et.Delim),"number-token":Yt(Et.Number),"percentage-token":Yt(Et.Percentage),"dimension-token":Yt(Et.Dimension),"whitespace-token":Yt(Et.WhiteSpace),"CDO-token":Yt(Et.CDO),"CDC-token":Yt(Et.CDC),"colon-token":Yt(Et.Colon),"semicolon-token":Yt(Et.Semicolon),"comma-token":Yt(Et.Comma),"[-token":Yt(Et.LeftSquareBracket),"]-token":Yt(Et.RightSquareBracket),"(-token":Yt(Et.LeftParenthesis),")-token":Yt(Et.RightParenthesis),"{-token":Yt(Et.LeftCurlyBracket),"}-token":Yt(Et.RightCurlyBracket),string:Yt(Et.String),ident:Yt(Et.Ident),"custom-ident":function(e){if(null===e||e.type!==Et.Ident)return 0;var t=e.value.toLowerCase();return Mt(t,Bt)||Rt(t,"default")?0:1},"custom-property-name":function(e){return null===e||e.type!==Et.Ident||45!==It(e.value,0)||45!==It(e.value,1)?0:1},"hex-color":function(e){if(null===e||e.type!==Et.Hash)return 0;var t=e.value.length;if(4!==t&&5!==t&&7!==t&&9!==t)return 0;for(var n=1;ne.index||e.balancee.index||e.balance=128||0===Jt[n])break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function nn(e){for(var t=e.pos;t57)break}return e.pos===t&&e.error("Expect a number"),e.substringToPos(t)}function rn(e){var t=e.str.indexOf("'",e.pos+1);return-1===t&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(t+1)}function an(e){var t,n=null;return e.eat(Xt),t=nn(e),44===e.charCode()?(e.pos++,125!==e.charCode()&&(n=nn(e))):n=t,e.eat(125),{min:Number(t),max:n?Number(n):0}}function sn(e,t){var n=function(e){var t=null,n=!1;switch(e.charCode()){case 42:e.pos++,t={min:0,max:0};break;case 43:e.pos++,t={min:1,max:0};break;case 63:e.pos++,t={min:0,max:1};break;case 35:e.pos++,n=!0,t=e.charCode()===Xt?an(e):{min:1,max:0};break;case Xt:t=an(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}(e);return null!==n?(n.term=t,n):t}function on(e){var t=e.peek();return""===t?null:{type:"Token",value:t}}function cn(e){var t,n=null;return e.eat(60),t=tn(e),40===e.charCode()&&41===e.nextCharCode()&&(e.pos+=2,t+="()"),91===e.charCodeAt(e.findWsEnd(e.pos))&&(en(e),n=function(e){var t=null,n=null,r=1;return e.eat(91),45===e.charCode()&&(e.peek(),r=-1),-1==r&&8734===e.charCode()?e.peek():t=r*Number(nn(e)),en(e),e.eat(44),en(e),8734===e.charCode()?e.peek():(r=1,45===e.charCode()&&(e.peek(),r=-1),n=r*Number(nn(e))),e.eat(93),null===t&&null===n?null:{type:"Range",min:t,max:n}}(e)),e.eat(62),sn(e,{type:"Type",name:t,opts:n})}function ln(e,t){function n(e,t){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:!1}}for(t=Object.keys(t).sort((function(e,t){return $t[e]-$t[t]}));t.length>0;){for(var r=t.shift(),a=0,s=0;a1&&(e.splice(s,a-s,n(e.slice(s,a),r)),a=s+1),s=-1))}-1!==s&&t.length&&e.splice(s,a-s,n(e.slice(s,a),r))}return r}function un(e){for(var t,n=[],r={},a=null,s=e.pos;t=hn(e);)"Spaces"!==t.type&&("Combinator"===t.type?(null!==a&&"Combinator"!==a.type||(e.pos=s,e.error("Unexpected combinator")),r[t.value]=!0):null!==a&&"Combinator"!==a.type&&(r[" "]=!0,n.push({type:"Combinator",value:" "})),n.push(t),a=t,s=e.pos);return null!==a&&"Combinator"===a.type&&(e.pos-=s,e.error("Unexpected combinator")),{type:"Group",terms:n,combinator:ln(n,r)||" ",disallowEmpty:!1,explicit:!1}}function hn(e){var t=e.charCode();if(t<128&&1===Jt[t])return function(e){var t;return t=tn(e),40===e.charCode()?(e.pos++,{type:"Function",name:t}):sn(e,{type:"Keyword",name:t})}(e);switch(t){case 93:break;case 91:return sn(e,function(e){var t;return e.eat(91),t=un(e),e.eat(93),t.explicit=!0,33===e.charCode()&&(e.pos++,t.disallowEmpty=!0),t}(e));case 60:return 39===e.nextCharCode()?function(e){var t;return e.eat(60),e.eat(39),t=tn(e),e.eat(39),e.eat(62),sn(e,{type:"Property",name:t})}(e):cn(e);case 124:return{type:"Combinator",value:e.substringToPos(124===e.nextCharCode()?e.pos+2:e.pos+1)};case 38:return e.pos++,e.eat(38),{type:"Combinator",value:"&&"};case 44:return e.pos++,{type:"Comma"};case 39:return sn(e,{type:"String",value:rn(e)});case 32:case 9:case 10:case 13:case 12:return{type:"Spaces",value:en(e)};case 64:return(t=e.nextCharCode())<128&&1===Jt[t]?(e.pos++,{type:"AtKeyword",name:tn(e)}):on(e);case 42:case 43:case 63:case 35:case 33:break;case Xt:if((t=e.nextCharCode())<48||t>57)return on(e);break;default:return on(e)}}function pn(e){var t=new _t(e),n=un(t);return t.pos!==e.length&&t.error("Unexpected input"),1===n.terms.length&&"Group"===n.terms[0].type&&(n=n.terms[0]),n}pn("[a&&#|<'c'>*||e() f{2} /,(% g#{1,2} h{2,})]!");var dn=pn,fn=function(){};function yn(e){return"function"==typeof e?e:fn}var gn=function(e,t,n){var r=fn,a=fn;if("function"==typeof t?r=t:t&&(r=yn(t.enter),a=yn(t.leave)),r===fn&&a===fn)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");!function e(t){switch(r.call(n,t),t.type){case"Group":t.terms.forEach(e);break;case"Multiplier":e(t.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+t.type)}a.call(n,t)}(e)},mn=_e,kn=new ue,xn={decorator:function(e){var t=null,n={len:0,node:null},r=[n],a="";return{children:e.children,node:function(n){var r=t;t=n,e.node.call(this,n),t=r},chunk:function(e){a+=e,n.node!==t?r.push({len:e.length,node:t}):n.len+=e.length},result:function(){return bn(a,r)}}}};function bn(e,t){var n=[],r=0,a=0,s=t?t[a].node:null;for(mn(e,kn);!kn.eof;){if(t)for(;a2&&40===e.charCodeAt(e.length-2)&&41===e.charCodeAt(e.length-1)}function Pn(e){return"Keyword"===e.type||"AtKeyword"===e.type||"Function"===e.type||"Type"===e.type&&Tn(e.name)}function Ln(e,t,n){switch(e){case" ":for(var r=Sn,a=t.length-1;a>=0;a--){r=An(o=t[a],r,Cn)}return r;case"|":r=Cn;var s=null;for(a=t.length-1;a>=0;a--){if(Pn(o=t[a])&&(null===s&&a>0&&Pn(t[a-1])&&(r=An({type:"Enum",map:s=Object.create(null)},Sn,r)),null!==s)){var i=(Tn(o.name)?o.name.slice(0,-1):o.name).toLowerCase();if(i in s==!1){s[i]=o;continue}}s=null,r=An(o,Sn,r)}return r;case"&&":if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};for(r=Cn,a=t.length-1;a>=0;a--){var o=t[a];c=t.length>1?Ln(e,t.filter((function(e){return e!==o})),!1):Sn,r=An(o,c,r)}return r;case"||":if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};for(r=n?Sn:Cn,a=t.length-1;a>=0;a--){var c;o=t[a];c=t.length>1?Ln(e,t.filter((function(e){return e!==o})),!0):Sn,r=An(o,c,r)}return r}}function En(e){if("function"==typeof e)return{type:"Generic",fn:e};switch(e.type){case"Group":var t=Ln(e.combinator,e.terms.map(En),!1);return e.disallowEmpty&&(t=An(t,wn,Cn)),t;case"Multiplier":return function(e){var t=Sn,n=En(e.term);if(0===e.max)n=An(n,wn,Cn),(t=An(n,null,Cn)).then=An(Sn,Sn,t),e.comma&&(t.then.else=An({type:"Comma",syntax:e},t,Cn));else for(var r=e.min||1;r<=e.max;r++)e.comma&&t!==Sn&&(t=An({type:"Comma",syntax:e},t,Cn)),t=An(n,An(Sn,Sn,t),Cn);if(0===e.min)t=An(Sn,Sn,t);else for(r=0;r=65&&r<=90&&(r|=32),r!==t.charCodeAt(n))return!1}return!0}function Fn(e){return null===e||(e.type===Rn.Comma||e.type===Rn.Function||e.type===Rn.LeftParenthesis||e.type===Rn.LeftSquareBracket||e.type===Rn.LeftCurlyBracket||e.type===Rn.Delim)}function zn(e){return null===e||(e.type===Rn.RightParenthesis||e.type===Rn.RightSquareBracket||e.type===Rn.RightCurlyBracket||e.type===Rn.Delim)}function Yn(e,t,n){function r(){do{m++,g=mk&&(k=m)}function l(){x=2===x.type?x.prev:{type:3,syntax:u.syntax,token:x.token,prev:x},u=u.prev}var u=null,h=null,p=null,d=null,f=0,y=null,g=null,m=-1,k=0,x={type:0,syntax:null,token:null,prev:null};for(r();null===y&&++f<15e3;)switch(t.type){case"Match":if(null===h){if(null!==g&&(m!==e.length-1||"\\0"!==g.value&&"\\9"!==g.value)){t=Nn;break}y=Mn;break}if((t=h.nextState)===In){if(h.matchStack===x){t=Nn;break}t=Bn}for(;h.syntaxStack!==u;)l();h=h.prev;break;case"Mismatch":if(null!==d&&!1!==d)(null===p||m>p.tokenIndex)&&(p=d,d=!1);else if(null===p){y="Mismatch";break}t=p.nextState,h=p.thenStack,u=p.syntaxStack,x=p.matchStack,m=p.tokenIndex,g=mm){for(;m":"<'"+t.name+"'>"));if(!1!==d&&null!==g&&"Type"===t.type)if("custom-ident"===t.name&&g.type===Rn.Ident||"length"===t.name&&"0"===g.value){null===d&&(d=s(t,p)),t=Nn;break}u={syntax:t.syntax,opts:t.syntax.opts||null!==u&&u.opts||null,prev:u},x={type:2,syntax:t.syntax,token:x.token,prev:x},t=A.match;break;case"Keyword":var T=t.name;if(null!==g){var P=g.value;if(-1!==P.indexOf("\\")&&(P=P.replace(/\\[09].*$/,"")),Wn(P,T)){c(),t=Bn;break}}t=Nn;break;case"AtKeyword":case"Function":if(null!==g&&Wn(g.value,t.name)){c(),t=Bn;break}t=Nn;break;case"Token":if(null!==g&&g.value===t.value){c(),t=Bn;break}t=Nn;break;case"Comma":null!==g&&g.type===Rn.Comma?Fn(x.token)?t=Nn:(c(),t=zn(g)?Nn:Bn):t=Fn(x.token)||zn(g)?Bn:Nn;break;case"String":var L="";for(C=m;C=0}function $n(e){return Boolean(e)&&Jn(e.offset)&&Jn(e.line)&&Jn(e.column)}function er(e,t){return function(n,r){if(!n||n.constructor!==Object)return r(n,"Type of node should be an Object");for(var a in n){var s=!0;if(!1!==Xn.call(n,a)){if("type"===a)n.type!==e&&r(n,"Wrong node type `"+n.type+"`, expected `"+e+"`");else if("loc"===a){if(null===n.loc)continue;if(n.loc&&n.loc.constructor===Object)if("string"!=typeof n.loc.source)a+=".source";else if($n(n.loc.start)){if($n(n.loc.end))continue;a+=".end"}else a+=".start";s=!1}else if(t.hasOwnProperty(a)){var i=0;for(s=!1;!s&&i");else{if(!Array.isArray(l))throw new Error("Wrong value `"+l+"` in `"+e+"."+s+"` structure definition");i.push("List")}}a[s]=i.join(" | ")}return{docs:a,check:er(e,r)}}var nr=me,rr=ke,ar=we,sr=Vt,ir=dn,or=de,cr=gn,lr=function(e,t){return"string"==typeof e?bn(e,null):t.generate(e,xn)},ur=Dn.buildMatchGraph,hr=Un,pr=Vn,dr=Zn,fr=function(e){var t={};if(e.node)for(var n in e.node)if(Xn.call(e.node,n)){var r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=tr(n,r)}return t},yr=ur("inherit | initial | unset"),gr=ur("inherit | initial | unset | <-ms-legacy-expression>");function mr(e,t,n){var r={};for(var a in e)e[a].syntax&&(r[a]=n?e[a].syntax:or(e[a].syntax,{compact:t}));return r}function kr(e,t,n){return{matched:e,iterations:n,error:t,getTrace:pr.getTrace,isType:pr.isType,isProperty:pr.isProperty,isKeyword:pr.isKeyword}}function xr(e,t,n,r){var a,s=lr(n,e.syntax);return function(e){for(var t=0;t(e[n]=this.createDescriptor(t.descriptors[n],"AtruleDescriptor",n),e)),{}):null}},addProperty_:function(e,t){this.properties[e]=this.createDescriptor(t,"Property",e)},addType_:function(e,t){this.types[e]=this.createDescriptor(t,"Type",e),t===sr["-ms-legacy-expression"]&&(this.valueCommonSyntax=gr)},matchAtrulePrelude:function(e,t){var n=ar.keyword(e),r=n.vendor?this.getAtrulePrelude(n.name)||this.getAtrulePrelude(n.basename):this.getAtrulePrelude(n.name);return r?xr(this,r,t,!0):n.basename in this.atrules?kr(null,new Error("At-rule `"+e+"` should not contain a prelude")):kr(null,new nr("Unknown at-rule",e))},matchAtruleDescriptor:function(e,t,n){var r=ar.keyword(e),a=ar.keyword(t),s=r.vendor?this.atrules[r.name]||this.atrules[r.basename]:this.atrules[r.name];if(!s)return kr(null,new nr("Unknown at-rule",e));if(!s.descriptors)return kr(null,new Error("At-rule `"+e+"` has no known descriptors"));var i=a.vendor?s.descriptors[a.name]||s.descriptors[a.basename]:s.descriptors[a.name];return i?xr(this,i,n,!0):kr(null,new nr("Unknown at-rule descriptor",t))},matchDeclaration:function(e){return"Declaration"!==e.type?kr(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)},matchProperty:function(e,t){var n=ar.property(e);if(n.custom)return kr(null,new Error("Lexer matching doesn't applicable for custom properties"));var r=n.vendor?this.getProperty(n.name)||this.getProperty(n.basename):this.getProperty(n.name);return r?xr(this,r,t,!0):kr(null,new nr("Unknown property",e))},matchType:function(e,t){var n=this.getType(e);return n?xr(this,n,t,!1):kr(null,new nr("Unknown type",e))},match:function(e,t){return"string"==typeof e||e&&e.type?("string"!=typeof e&&e.match||(e=this.createDescriptor(e,"Type","anonymous")),xr(this,e,t,!1)):kr(null,new nr("Bad syntax"))},findValueFragments:function(e,t,n,r){return dr.matchFragments(this,t,this.matchProperty(e,t),n,r)},findDeclarationValueFragments:function(e,t,n){return dr.matchFragments(this,e.value,this.matchDeclaration(e),t,n)},findAllFragments:function(e,t,n){var r=[];return this.syntax.walk(e,{visit:"Declaration",enter:function(e){r.push.apply(r,this.findDeclarationValueFragments(e,t,n))}.bind(this)}),r},getAtrulePrelude:function(e){return this.atrules.hasOwnProperty(e)?this.atrules[e].prelude:null},getAtruleDescriptor:function(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null},getProperty:function(e){return this.properties.hasOwnProperty(e)?this.properties[e]:null},getType:function(e){return this.types.hasOwnProperty(e)?this.types[e]:null},validate:function(){function e(r,a,s,i){if(s.hasOwnProperty(a))return s[a];s[a]=!1,null!==i.syntax&&cr(i.syntax,(function(i){if("Type"===i.type||"Property"===i.type){var o="Type"===i.type?r.types:r.properties,c="Type"===i.type?t:n;o.hasOwnProperty(i.name)&&!e(r,i.name,c,o[i.name])||(s[a]=!0)}}),this)}var t={},n={};for(var r in this.types)e(this,r,t,this.types[r]);for(var r in this.properties)e(this,r,n,this.properties[r]);return t=Object.keys(t).filter((function(e){return t[e]})),n=Object.keys(n).filter((function(e){return n[e]})),t.length||n.length?{types:t,properties:n}:null},dump:function(e,t){return{generic:this.generic,types:mr(this.types,!t,e),properties:mr(this.properties,!t,e)}},toString:function(){return JSON.stringify(this.dump())}};var vr=br,Sr={SyntaxError:Qt,parse:dn,generate:de,walk:gn},Cr=Te,wr=_e.isBOM;var Ar=function(){this.lines=null,this.columns=null,this.linesAndColumnsComputed=!1};Ar.prototype={setSource:function(e,t,n,r){this.source=e,this.startOffset=void 0===t?0:t,this.startLine=void 0===n?1:n,this.startColumn=void 0===r?1:r,this.linesAndColumnsComputed=!1},ensureLinesAndColumnsComputed:function(){this.linesAndColumnsComputed||(!function(e,t){for(var n=t.length,r=Cr(e.lines,n),a=e.startLine,s=Cr(e.columns,n),i=e.startColumn,o=t.length>0?wr(t.charCodeAt(0)):0;o",needPositions:!1,onParseError:jr,onParseErrorThrow:!1,parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Mr,createList:function(){return new Nr},createSingleNodeList:function(e){return(new Nr).appendData(e)},getFirstListNode:function(e){return e&&e.first()},getLastListNode:function(e){return e.last()},parseWithFallback:function(e,t){var n=this.scanner.tokenIndex;try{return e.call(this)}catch(e){if(this.onParseErrorThrow)throw e;var r=t.call(this,n);return this.onParseErrorThrow=!0,this.onParseError(e,r),this.onParseErrorThrow=!1,r}},lookupNonWSType:function(e){do{var t=this.scanner.lookupType(e++);if(t!==zr)return t}while(0!==t);return 0},eat:function(e){if(this.scanner.tokenType!==e){var t=this.scanner.tokenStart,n=Fr[e]+" is expected";switch(e){case Yr:this.scanner.tokenType===Ur||this.scanner.tokenType===qr?(t=this.scanner.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case Hr:this.scanner.isDelim(35)&&(this.scanner.next(),t++,n="Name is expected");break;case Vr:this.scanner.tokenType===Kr&&(t=this.scanner.tokenEnd,n="Percent sign is expected");break;default:this.scanner.source.charCodeAt(this.scanner.tokenStart)===e&&(t+=1)}this.error(n,t)}this.scanner.next()},consume:function(e){var t=this.scanner.getTokenValue();return this.eat(e),t},consumeFunctionName:function(){var e=this.scanner.source.substring(this.scanner.tokenStart,this.scanner.tokenEnd-1);return this.eat(Ur),e},getLocation:function(e,t){return this.needPositions?this.locationMap.getLocationRange(e,t,this.filename):null},getLocationFromList:function(e){if(this.needPositions){var t=this.getFirstListNode(e),n=this.getLastListNode(e);return this.locationMap.getLocationRange(null!==t?t.loc.start.offset-this.locationMap.startOffset:this.scanner.tokenStart,null!==n?n.loc.end.offset-this.locationMap.startOffset:this.scanner.tokenStart,this.filename)}return null},error:function(e,t){var n=void 0!==t&&t",t.needPositions=Boolean(n.positions),t.onParseError="function"==typeof n.onParseError?n.onParseError:jr,t.onParseErrorThrow=!1,t.parseAtrulePrelude=!("parseAtrulePrelude"in n)||Boolean(n.parseAtrulePrelude),t.parseRulePrelude=!("parseRulePrelude"in n)||Boolean(n.parseRulePrelude),t.parseValue=!("parseValue"in n)||Boolean(n.parseValue),t.parseCustomProperty="parseCustomProperty"in n&&Boolean(n.parseCustomProperty),!t.context.hasOwnProperty(a))throw new Error("Unknown context `"+a+"`");return r=t.context[a].call(t,n),t.scanner.eof||t.error(),r}},ka=function(e){function t(e){if(!Gr.call(n,e.type))throw new Error("Unknown node type: "+e.type);n[e.type].call(this,e)}var n={};if(e.node)for(var r in e.node)n[r]=e.node[r].generate;return function(e,n){var r="",a={children:Zr,node:t,chunk:function(e){r+=e},result:function(){return r}};return n&&"function"==typeof n.decorator&&(a=n.decorator(a)),a.node(e),a.result()}},xa=function(e){return{fromPlainObject:function(t){return e(t,{enter:function(e){e.children&&e.children instanceof _r==!1&&(e.children=(new _r).fromArray(e.children))}}),t},toPlainObject:function(t){return e(t,{leave:function(e){e.children&&e.children instanceof _r&&(e.children=e.children.toArray())}}),t}}},ba=function(e){var t=function(e){var t={};for(var n in e.node)if(Xr.call(e.node,n)){var r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=ta(0,r)}return t}(e),n={},r={};for(var a in t)Xr.call(t,a)&&null!==t[a]&&(n[a]=na(t[a],!1),r[a]=na(t[a],!0));var s=ra(n),i=ra(r),o=function(e,a){var o=Jr,c=Jr,l=n,u={root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if("function"==typeof a)o=a;else if(a&&(o=$r(a.enter),c=$r(a.leave),a.reverse&&(l=r),a.visit)){if(s.hasOwnProperty(a.visit))l=a.reverse?i[a.visit]:s[a.visit];else if(!t.hasOwnProperty(a.visit))throw new Error("Bad value `"+a.visit+"` for `visit` option (should be: "+Object.keys(t).join(", ")+")");o=ea(o,a.visit),c=ea(c,a.visit)}if(o===Jr&&c===Jr)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");if(a.reverse){var h=o;o=c,c=h}!function e(t,n,r){o.call(u,t,n,r),l.hasOwnProperty(t.type)&&l[t.type](t,u,e),c.call(u,t,n,r)}(e)};return o.find=function(e,t){var n=null;return o(e,(function(e,r,a){null===n&&t.call(this,e,r,a)&&(n=e)})),n},o.findLast=function(e,t){var n=null;return o(e,{reverse:!0,enter:function(e,r,a){null===n&&t.call(this,e,r,a)&&(n=e)}}),n},o.findAll=function(e,t){var n=[];return o(e,(function(e,r,a){t.call(this,e,r,a)&&n.push(e)})),n},o},va=function e(t){var n={};for(var r in t){var a=t[r];a&&(Array.isArray(a)||a instanceof aa?a=a.map(e):a.constructor===Object&&(a=e(a))),n[r]=a}return n},Sa=we,Ca=function(e,t){return ua(e,t,ia)};function wa(e){var t=ma(e),n=ba(e),r=ka(e),a=xa(n),s={List:ha,SyntaxError:pa,TokenStream:da,Lexer:fa,vendorPrefix:Sa.vendorPrefix,keyword:Sa.keyword,property:Sa.property,isCustomProperty:Sa.isCustomProperty,definitionSyntax:ya,lexer:null,createLexer:function(e){return new fa(e,s,s.lexer.structure)},tokenize:ga,parse:t,walk:n,generate:r,find:n.find,findLast:n.findLast,findAll:n.findAll,clone:va,fromPlainObject:a.fromPlainObject,toPlainObject:a.toPlainObject,createSyntax:function(e){return wa(Ca({},e))},fork:function(t){var n=Ca({},e);return wa("function"==typeof t?t(n,Object.assign):Ca(n,t))}};return s.lexer=new fa({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}f.create=function(e){return wa(Ca({},e))};var Aa={"accent-color":{syntax:"auto | "},all:{syntax:"initial | inherit | unset | revert"},"backdrop-filter":{syntax:"none | "},background:{syntax:"[ , ]* "},"background-color":{syntax:""},"background-position":{syntax:"#"},"background-size":{syntax:"#"},"block-size":{syntax:"<'width'>"},border:{syntax:" || || "},"border-block-end":{syntax:"<'border-top-width'> || <'border-top-style'> || "},"border-block-end-color":{syntax:"<'border-top-color'>"},"border-block-end-width":{syntax:"<'border-top-width'>"},"border-block-start":{syntax:"<'border-top-width'> || <'border-top-style'> || "},"border-block-start-color":{syntax:"<'border-top-color'>"},"border-block-start-width":{syntax:"<'border-top-width'>"},"border-bottom":{syntax:" || || "},"border-bottom-color":{syntax:"<'border-top-color'>"},"border-bottom-left-radius":{syntax:"{1,2}"},"border-bottom-right-radius":{syntax:"{1,2}"},"border-bottom-width":{syntax:""},"border-color":{syntax:"{1,4}"},"border-end-end-radius":{syntax:"{1,2}"},"border-end-start-radius":{syntax:"{1,2}"},"border-image-outset":{syntax:"[ | ]{1,4}"},"border-image-slice":{syntax:"{1,4} && fill?"},"border-image-width":{syntax:"[ | | auto ]{1,4}"},"border-inline-end":{syntax:"<'border-top-width'> || <'border-top-style'> || "},"border-inline-end-color":{syntax:"<'border-top-color'>"},"border-inline-end-width":{syntax:"<'border-top-width'>"},"border-inline-start":{syntax:"<'border-top-width'> || <'border-top-style'> || "},"border-inline-start-color":{syntax:"<'border-top-color'>"},"border-inline-start-width":{syntax:"<'border-top-width'>"},"border-left":{syntax:" || || "},"border-left-color":{syntax:""},"border-left-width":{syntax:""},"border-radius":{syntax:"{1,4} [ / {1,4} ]?"},"border-right":{syntax:" || || "},"border-right-color":{syntax:""},"border-right-width":{syntax:""},"border-start-end-radius":{syntax:"{1,2}"},"border-start-start-radius":{syntax:"{1,2}"},"border-top":{syntax:" || || "},"border-top-color":{syntax:""},"border-top-left-radius":{syntax:"{1,2}"},"border-top-right-radius":{syntax:"{1,2}"},"border-top-width":{syntax:""},"border-width":{syntax:"{1,4}"},bottom:{syntax:" | | auto"},"box-shadow":{syntax:"none | #"},"caret-color":{syntax:"auto | "},clip:{syntax:" | auto"},"clip-path":{syntax:" | [ || ] | none"},color:{syntax:""},"column-count":{syntax:" | auto"},"column-gap":{syntax:"normal | "},"column-rule":{syntax:"<'column-rule-width'> || <'column-rule-style'> || <'column-rule-color'>"},"column-rule-color":{syntax:""},"column-rule-width":{syntax:"<'border-width'>"},"column-width":{syntax:" | auto"},columns:{syntax:"<'column-width'> || <'column-count'>"},filter:{syntax:"none | "},flex:{syntax:"none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]"},"flex-basis":{syntax:"content | <'width'>"},"flex-grow":{syntax:""},"flex-shrink":{syntax:""},font:{syntax:"[ [ <'font-style'> || || <'font-weight'> || <'font-stretch'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar"},"font-variation-settings":{syntax:"normal | [ ]#"},"font-size":{syntax:" | | "},"font-size-adjust":{syntax:"none | [ ex-height | cap-height | ch-width | ic-width | ic-height ]? [ from-font | ]"},"font-stretch":{syntax:""},"font-weight":{syntax:" | bolder | lighter"},gap:{syntax:"<'row-gap'> <'column-gap'>?"},"grid-column-gap":{syntax:""},"grid-gap":{syntax:"<'grid-row-gap'> <'grid-column-gap'>?"},"grid-row-gap":{syntax:""},"grid-template-columns":{syntax:"none | | | subgrid ?"},"grid-template-rows":{syntax:"none | | | subgrid ?"},height:{syntax:"auto | | | min-content | max-content | fit-content | fit-content()"},"inline-size":{syntax:"<'width'>"},"input-security":{syntax:"auto | none"},inset:{syntax:"<'top'>{1,4}"},"inset-block":{syntax:"<'top'>{1,2}"},"inset-block-end":{syntax:"<'top'>"},"inset-block-start":{syntax:"<'top'>"},"inset-inline":{syntax:"<'top'>{1,2}"},"inset-inline-end":{syntax:"<'top'>"},"inset-inline-start":{syntax:"<'top'>"},left:{syntax:" | | auto"},"letter-spacing":{syntax:"normal | "},"line-clamp":{syntax:"none | "},"line-height":{syntax:"normal | | | "},margin:{syntax:"[ | | auto ]{1,4}"},"margin-block-end":{syntax:"<'margin-left'>"},"margin-block-start":{syntax:"<'margin-left'>"},"margin-bottom":{syntax:" | | auto"},"margin-inline-end":{syntax:"<'margin-left'>"},"margin-inline-start":{syntax:"<'margin-left'>"},"margin-left":{syntax:" | | auto"},"margin-right":{syntax:" | | auto"},"margin-top":{syntax:" | | auto"},mask:{syntax:"#"},"mask-border":{syntax:"<'mask-border-source'> || <'mask-border-slice'> [ / <'mask-border-width'>? [ / <'mask-border-outset'> ]? ]? || <'mask-border-repeat'> || <'mask-border-mode'>"},"mask-position":{syntax:"#"},"mask-size":{syntax:"#"},"max-block-size":{syntax:"<'max-width'>"},"max-height":{syntax:"none | | min-content | max-content | fit-content | fit-content()"},"max-inline-size":{syntax:"<'max-width'>"},"max-lines":{syntax:"none | "},"max-width":{syntax:"none | | min-content | max-content | fit-content | fit-content()"},"min-block-size":{syntax:"<'min-width'>"},"min-height":{syntax:"auto | | | min-content | max-content | fit-content | fit-content()"},"min-inline-size":{syntax:"<'min-width'>"},"min-width":{syntax:"auto | | | min-content | max-content | fit-content | fit-content()"},"object-position":{syntax:""},offset:{syntax:"[ <'offset-position'>? [ <'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? ]? ]! [ / <'offset-anchor'> ]?"},"offset-anchor":{syntax:"auto | "},"offset-distance":{syntax:""},"offset-path":{syntax:"none | ray( [ && && contain? ] ) | | | [ || ]"},"offset-position":{syntax:"auto | "},"offset-rotate":{syntax:"[ auto | reverse ] || "},opacity:{syntax:""},order:{syntax:""},outline:{syntax:"[ <'outline-color'> || <'outline-style'> || <'outline-width'> ]"},"outline-color":{syntax:" | invert"},"outline-offset":{syntax:""},"outline-width":{syntax:""},padding:{syntax:"[ | ]{1,4}"},"padding-block-end":{syntax:"<'padding-left'>"},"padding-block-start":{syntax:"<'padding-left'>"},"padding-bottom":{syntax:" | "},"padding-inline-end":{syntax:"<'padding-left'>"},"padding-inline-start":{syntax:"<'padding-left'>"},"padding-left":{syntax:" | "},"padding-right":{syntax:" | "},"padding-top":{syntax:" | "},perspective:{syntax:"none | "},"perspective-origin":{syntax:""},right:{syntax:" | | auto"},rotate:{syntax:"none | | [ x | y | z | {3} ] && "},"row-gap":{syntax:"normal | "},scale:{syntax:"none | {1,3}"},"scrollbar-color":{syntax:"auto | {2}"},"scroll-margin":{syntax:"{1,4}"},"scroll-margin-block":{syntax:"{1,2}"},"scroll-margin-block-start":{syntax:""},"scroll-margin-block-end":{syntax:""},"scroll-margin-bottom":{syntax:""},"scroll-margin-inline":{syntax:"{1,2}"},"scroll-margin-inline-start":{syntax:""},"scroll-margin-inline-end":{syntax:""},"scroll-margin-left":{syntax:""},"scroll-margin-right":{syntax:""},"scroll-margin-top":{syntax:""},"scroll-padding":{syntax:"[ auto | ]{1,4}"},"scroll-padding-block":{syntax:"[ auto | ]{1,2}"},"scroll-padding-block-start":{syntax:"auto | "},"scroll-padding-block-end":{syntax:"auto | "},"scroll-padding-bottom":{syntax:"auto | "},"scroll-padding-inline":{syntax:"[ auto | ]{1,2}"},"scroll-padding-inline-start":{syntax:"auto | "},"scroll-padding-inline-end":{syntax:"auto | "},"scroll-padding-left":{syntax:"auto | "},"scroll-padding-right":{syntax:"auto | "},"scroll-padding-top":{syntax:"auto | "},"scroll-snap-coordinate":{syntax:"none | #"},"scroll-snap-destination":{syntax:""},"shape-image-threshold":{syntax:""},"shape-margin":{syntax:""},"shape-outside":{syntax:"none | [ || ] | "},"tab-size":{syntax:" | "},"text-decoration":{syntax:"<'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'> || <'text-decoration-thickness'>"},"text-decoration-color":{syntax:""},"text-decoration-thickness":{syntax:"auto | from-font | | "},"text-emphasis":{syntax:"<'text-emphasis-style'> || <'text-emphasis-color'>"},"text-emphasis-color":{syntax:""},"text-indent":{syntax:" && hanging? && each-line?"},"text-shadow":{syntax:"none | #"},"text-underline-offset":{syntax:"auto | | "},top:{syntax:" | | auto"},transform:{syntax:"none | "},"transform-origin":{syntax:"[ | left | center | right | top | bottom ] | [ [ | left | center | right ] && [ | top | center | bottom ] ] ?"},translate:{syntax:"none | [ ? ]?"},"vertical-align":{syntax:"baseline | sub | super | text-top | text-bottom | middle | top | bottom | | "},visibility:{syntax:"visible | hidden | collapse"},width:{syntax:"auto | | | min-content | max-content | fit-content | fit-content()"},"word-spacing":{syntax:"normal | "},"z-index":{syntax:"auto | "},zoom:{syntax:"normal | reset | | "},"border-top-style":{syntax:""},"column-rule-style":{syntax:"<'border-style'>"},"border-style":{syntax:"{1,4}"},"font-style":{syntax:"normal | italic | oblique ?"},"font-family":{syntax:"[ | ]#"},"mask-border-source":{syntax:"none | "},"mask-border-slice":{syntax:"{1,4} fill?"},"mask-border-width":{syntax:"[ | | auto ]{1,4}"},"mask-border-outset":{syntax:"[ | ]{1,4}"},"mask-border-repeat":{syntax:"[ stretch | repeat | round | space ]{1,2}"},"mask-border-mode":{syntax:"luminance | alpha"},"outline-style":{syntax:"auto | <'border-style'>"},"text-decoration-line":{syntax:"none | [ underline || overline || line-through || blink ] | spelling-error | grammar-error"},"text-decoration-style":{syntax:"solid | double | dotted | dashed | wavy"},"text-emphasis-style":{syntax:"none | [ [ filled | open ] || [ dot | circle | double-circle | triangle | sesame ] ] | "}},Ta={"absolute-size":{syntax:"xx-small | x-small | small | medium | large | x-large | xx-large | xxx-large"},"alpha-value":{syntax:" | "},"angle-percentage":{syntax:" | "},"angular-color-hint":{syntax:""},"angular-color-stop":{syntax:" && ?"},"angular-color-stop-list":{syntax:"[ [, ]? ]# , "},attachment:{syntax:"scroll | fixed | local"},"auto-repeat":{syntax:"repeat( [ auto-fill | auto-fit ] , [ ? ]+ ? )"},"auto-track-list":{syntax:"[ ? [ | ] ]* ? \n[ ? [ | ] ]* ?"},"basic-shape":{syntax:" | | | | "},"bg-image":{syntax:"none | "},"bg-layer":{syntax:" || [ / ]? || || || || "},"bg-position":{syntax:"[ [ left | center | right | top | bottom | ] | [ left | center | right | ] [ top | center | bottom | ] | [ center | [ left | right ] ? ] && [ center | [ top | bottom ] ? ] ]"},"bg-size":{syntax:"[ | auto ]{1,2} | cover | contain"},"blur()":{syntax:"blur( )"},box:{syntax:"border-box | padding-box | content-box"},"brightness()":{syntax:"brightness( )"},"cf-final-image":{syntax:" | "},"cf-mixing-image":{syntax:"? && "},"circle()":{syntax:"circle( [ ]? [ at ]? )"},"clip-source":{syntax:""},color:{syntax:" | | | | | | | currentcolor | "},"color-stop-angle":{syntax:"{1,2}"},"color-stop-length":{syntax:"{1,2}"},"color-stop-list":{syntax:"[ [, ]? ]# , "},"compositing-operator":{syntax:"add | subtract | intersect | exclude"},"conic-gradient()":{syntax:"conic-gradient( [ from ]? [ at ]?, )"},"contrast()":{syntax:"contrast( [ ] )"},"cross-fade()":{syntax:"cross-fade( , ? )"},"deprecated-system-color":{syntax:"ActiveBorder | ActiveCaption | AppWorkspace | Background | ButtonFace | ButtonHighlight | ButtonShadow | ButtonText | CaptionText | GrayText | Highlight | HighlightText | InactiveBorder | InactiveCaption | InactiveCaptionText | InfoBackground | InfoText | Menu | MenuText | Scrollbar | ThreeDDarkShadow | ThreeDFace | ThreeDHighlight | ThreeDLightShadow | ThreeDShadow | Window | WindowFrame | WindowText"},"drop-shadow()":{syntax:"drop-shadow( {2,3} ? )"},"element()":{syntax:"element( )"},"ellipse()":{syntax:"ellipse( [ {2} ]? [ at ]? )"},"ending-shape":{syntax:"circle | ellipse"},"family-name":{syntax:" | +"},"fill-rule":{syntax:"nonzero | evenodd"},"filter-function":{syntax:" | | | | | | | | | "},"filter-function-list":{syntax:"[ | ]+"},"final-bg-layer":{syntax:"<'background-color'> || || [ / ]? || || || || "},"fixed-breadth":{syntax:""},"fixed-repeat":{syntax:"repeat( [ ] , [ ? ]+ ? )"},"fixed-size":{syntax:" | minmax( , ) | minmax( , )"},"font-stretch-absolute":{syntax:"normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | "},"font-variant-css21":{syntax:"[ normal | small-caps ]"},"font-weight-absolute":{syntax:"normal | bold | "},"generic-family":{syntax:"serif | sans-serif | cursive | fantasy | monospace"},"geometry-box":{syntax:" | fill-box | stroke-box | view-box"},gradient:{syntax:" | | | | "},"grayscale()":{syntax:"grayscale( )"},"hsl()":{syntax:"hsl( [ / ]? ) | hsl( , , , ? )"},"hsla()":{syntax:"hsla( [ / ]? ) | hsla( , , , ? )"},hue:{syntax:" | "},"hue-rotate()":{syntax:"hue-rotate( )"},"hwb()":{syntax:"hwb( [ | none] [ | none] [ | none] [ / [ | none] ]? )"},"id-selector":{syntax:""},image:{syntax:" | | | | | | "},"image()":{syntax:"image( ? [ ? , ? ]! )"},"image-set()":{syntax:"image-set( # )"},"image-set-option":{syntax:"[ | ] [ || type() ]"},"image-src":{syntax:" | "},"image-tags":{syntax:"ltr | rtl"},"inflexible-breadth":{syntax:" | | min-content | max-content | auto"},"inset()":{syntax:"inset( {1,4} [ round <'border-radius'> ]? )"},"invert()":{syntax:"invert( )"},"length-percentage":{syntax:" | "},"line-names":{syntax:"'[' * ']'"},"line-name-list":{syntax:"[ | ]+"},"line-style":{syntax:"none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset"},"line-width":{syntax:" | thin | medium | thick"},"linear-color-hint":{syntax:""},"linear-color-stop":{syntax:" ?"},"linear-gradient()":{syntax:"linear-gradient( [ | to ]? , )"},"mask-layer":{syntax:" || [ / ]? || || || [ | no-clip ] || || "},"mask-reference":{syntax:"none | | "},"mask-source":{syntax:""},"masking-mode":{syntax:"alpha | luminance | match-source"},"matrix()":{syntax:"matrix( #{6} )"},"matrix3d()":{syntax:"matrix3d( #{16} )"},"named-color":{syntax:"transparent | aliceblue | antiquewhite | aqua | aquamarine | azure | beige | bisque | black | blanchedalmond | blue | blueviolet | brown | burlywood | cadetblue | chartreuse | chocolate | coral | cornflowerblue | cornsilk | crimson | cyan | darkblue | darkcyan | darkgoldenrod | darkgray | darkgreen | darkgrey | darkkhaki | darkmagenta | darkolivegreen | darkorange | darkorchid | darkred | darksalmon | darkseagreen | darkslateblue | darkslategray | darkslategrey | darkturquoise | darkviolet | deeppink | deepskyblue | dimgray | dimgrey | dodgerblue | firebrick | floralwhite | forestgreen | fuchsia | gainsboro | ghostwhite | gold | goldenrod | gray | green | greenyellow | grey | honeydew | hotpink | indianred | indigo | ivory | khaki | lavender | lavenderblush | lawngreen | lemonchiffon | lightblue | lightcoral | lightcyan | lightgoldenrodyellow | lightgray | lightgreen | lightgrey | lightpink | lightsalmon | lightseagreen | lightskyblue | lightslategray | lightslategrey | lightsteelblue | lightyellow | lime | limegreen | linen | magenta | maroon | mediumaquamarine | mediumblue | mediumorchid | mediumpurple | mediumseagreen | mediumslateblue | mediumspringgreen | mediumturquoise | mediumvioletred | midnightblue | mintcream | mistyrose | moccasin | navajowhite | navy | oldlace | olive | olivedrab | orange | orangered | orchid | palegoldenrod | palegreen | paleturquoise | palevioletred | papayawhip | peachpuff | peru | pink | plum | powderblue | purple | rebeccapurple | red | rosybrown | royalblue | saddlebrown | salmon | sandybrown | seagreen | seashell | sienna | silver | skyblue | slateblue | slategray | slategrey | snow | springgreen | steelblue | tan | teal | thistle | tomato | turquoise | violet | wheat | white | whitesmoke | yellow | yellowgreen"},"number-percentage":{syntax:" | "},"opacity()":{syntax:"opacity( [ ] )"},"path()":{syntax:"path( [ , ]? )"},"paint()":{syntax:"paint( , ? )"},"perspective()":{syntax:"perspective( )"},"polygon()":{syntax:"polygon( ? , [ ]# )"},position:{syntax:"[ [ left | center | right ] || [ top | center | bottom ] | [ left | center | right | ] [ top | center | bottom | ]? | [ [ left | right ] ] && [ [ top | bottom ] ] ]"},"radial-gradient()":{syntax:"radial-gradient( [ || ]? [ at ]? , )"},"relative-size":{syntax:"larger | smaller"},"repeat-style":{syntax:"repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2}"},"repeating-linear-gradient()":{syntax:"repeating-linear-gradient( [ | to ]? , )"},"repeating-radial-gradient()":{syntax:"repeating-radial-gradient( [ || ]? [ at ]? , )"},"rgb()":{syntax:"rgb( {3} [ / ]? ) | rgb( {3} [ / ]? ) | rgb( #{3} , ? ) | rgb( #{3} , ? )"},"rgba()":{syntax:"rgba( {3} [ / ]? ) | rgba( {3} [ / ]? ) | rgba( #{3} , ? ) | rgba( #{3} , ? )"},"rotate()":{syntax:"rotate( [ | ] )"},"rotate3d()":{syntax:"rotate3d( , , , [ | ] )"},"rotateX()":{syntax:"rotateX( [ | ] )"},"rotateY()":{syntax:"rotateY( [ | ] )"},"rotateZ()":{syntax:"rotateZ( [ | ] )"},"saturate()":{syntax:"saturate( )"},"scale()":{syntax:"scale( , ? )"},"scale3d()":{syntax:"scale3d( , , )"},"scaleX()":{syntax:"scaleX( )"},"scaleY()":{syntax:"scaleY( )"},"scaleZ()":{syntax:"scaleZ( )"},"shape-radius":{syntax:" | closest-side | farthest-side"},"skew()":{syntax:"skew( [ | ] , [ | ]? )"},"skewX()":{syntax:"skewX( [ | ] )"},"skewY()":{syntax:"skewY( [ | ] )"},"sepia()":{syntax:"sepia( )"},shadow:{syntax:"inset? && {2,4} && ?"},"shadow-t":{syntax:"[ {2,3} && ? ]"},shape:{syntax:"rect(, , , )"},"shape-box":{syntax:" | margin-box"},"side-or-corner":{syntax:"[ left | right ] || [ top | bottom ]"},size:{syntax:"closest-side | farthest-side | closest-corner | farthest-corner | | {2}"},"track-breadth":{syntax:" | | min-content | max-content | auto"},"track-list":{syntax:"[ ? [ | ] ]+ ?"},"track-repeat":{syntax:"repeat( [ ] , [ ? ]+ ? )"},"track-size":{syntax:" | minmax( , ) | fit-content( [ | ] )"},"transform-function":{syntax:" | | | | | | | | | | | | | | | | | | | | "},"transform-list":{syntax:"+"},"translate()":{syntax:"translate( , ? )"},"translate3d()":{syntax:"translate3d( , , )"},"translateX()":{syntax:"translateX( )"},"translateY()":{syntax:"translateY( )"},"translateZ()":{syntax:"translateZ( )"}},Pa={properties:{},syntaxes:{bottom:{syntax:" | auto"},left:{syntax:" | auto"},"name-repeat":{syntax:"repeat( [ | auto-fill ], +)"},right:{syntax:" | auto"},top:{syntax:" | auto"},url:{syntax:"url( * ) | "},"url-modifier":{syntax:" | )"},"positive-integer":{syntax:""}}},La={},Ea=Aa,Da=Pa;function Oa(e,t){var n={};for(var r in e)n[r]=e[r].syntax;for(var r in t)r in e?t[r].syntax?n[r]=t[r].syntax:delete n[r]:t[r].syntax&&(n[r]=t[r].syntax);return n}var Ba={types:Oa(Ta,Da.syntaxes),atrules:function(e){var t=Object.create(null);for(var n in e){var r=e[n],a=null;if(r.descriptors)for(var s in a=Object.create(null),r.descriptors)a[s]=r.descriptors[s].syntax;t[n.substr(1)]={prelude:r.syntax.trim().match(/^@\S+\s+([^;\{]*)/)[1].trim()||null,descriptors:a}}return t}(La),properties:Oa(Ea,Da.properties)},Na=_e.cmpChar,Ia=_e.isDigit,Ra=_e.TYPE,Ma=Ra.WhiteSpace,ja=Ra.Comment,Wa=Ra.Ident,Fa=Ra.Number,za=Ra.Dimension,Ya=43,Ua=45,qa=110,Ha=!0;function Va(e,t){var n=this.scanner.tokenStart+e,r=this.scanner.source.charCodeAt(n);for(r!==Ya&&r!==Ua||(t&&this.error("Number sign is not allowed"),n++);n0&&this.scanner.skip(e),0===t&&(n=this.scanner.source.charCodeAt(this.scanner.tokenStart))!==Ya&&n!==Ua&&this.error("Number sign is expected"),Ka.call(this,0!==t),t===Ua?"-"+this.consume(Fa):this.consume(Fa)}var Za={name:"AnPlusB",structure:{a:[String,null],b:[String,null]},parse:function(){var e=this.scanner.tokenStart,t=null,n=null;if(this.scanner.tokenType===Fa)Ka.call(this,false),n=this.consume(Fa);else if(this.scanner.tokenType===Wa&&Na(this.scanner.source,this.scanner.tokenStart,Ua))switch(t="-1",Qa.call(this,1,qa),this.scanner.getTokenLength()){case 2:this.scanner.next(),n=Ga.call(this);break;case 3:Qa.call(this,2,Ua),this.scanner.next(),this.scanner.skipSC(),Ka.call(this,Ha),n="-"+this.consume(Fa);break;default:Qa.call(this,2,Ua),Va.call(this,3,Ha),this.scanner.next(),n=this.scanner.substrToCursor(e+2)}else if(this.scanner.tokenType===Wa||this.scanner.isDelim(Ya)&&this.scanner.lookupType(1)===Wa){var r=0;switch(t="1",this.scanner.isDelim(Ya)&&(r=1,this.scanner.next()),Qa.call(this,0,qa),this.scanner.getTokenLength()){case 1:this.scanner.next(),n=Ga.call(this);break;case 2:Qa.call(this,1,Ua),this.scanner.next(),this.scanner.skipSC(),Ka.call(this,Ha),n="-"+this.consume(Fa);break;default:Qa.call(this,1,Ua),Va.call(this,2,Ha),this.scanner.next(),n=this.scanner.substrToCursor(e+r+1)}}else if(this.scanner.tokenType===za){for(var a=this.scanner.source.charCodeAt(this.scanner.tokenStart),s=(r=a===Ya||a===Ua,this.scanner.tokenStart+r);s0&&this.scanner.lookupType(-1)===Xa?this.scanner.tokenIndex>1?this.scanner.getTokenStart(this.scanner.tokenIndex-1):this.scanner.firstCharOffset:this.scanner.tokenStart}function ns(){return 0}var rs={name:"Raw",structure:{value:String},parse:function(e,t,n){var r,a=this.scanner.getTokenStart(e);return this.scanner.skip(this.scanner.getRawLength(e,t||ns)),r=n&&this.scanner.tokenStart>a?ts.call(this):this.scanner.tokenStart,{type:"Raw",loc:this.getLocation(a,r),value:this.scanner.source.substring(a,r)}},generate:function(e){this.chunk(e.value)},mode:{default:ns,leftCurlyBracket:function(e){return e===$a?1:0},leftCurlyBracketOrSemicolon:function(e){return e===$a||e===Ja?1:0},exclamationMarkOrSemicolon:function(e,t,n){return e===es&&33===t.charCodeAt(n)||e===Ja?1:0},semicolonIncluded:function(e){return e===Ja?2:0}}},as=_e.TYPE,ss=rs.mode,is=as.AtKeyword,os=as.Semicolon,cs=as.LeftCurlyBracket,ls=as.RightCurlyBracket;function us(e){return this.Raw(e,ss.leftCurlyBracketOrSemicolon,!0)}function hs(){for(var e,t=1;e=this.scanner.lookupType(t);t++){if(e===ls)return!0;if(e===cs||e===is)return!1}return!1}var ps={name:"Atrule",structure:{name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]},parse:function(){var e,t,n=this.scanner.tokenStart,r=null,a=null;switch(this.eat(is),t=(e=this.scanner.substrToCursor(n+1)).toLowerCase(),this.scanner.skipSC(),!1===this.scanner.eof&&this.scanner.tokenType!==cs&&this.scanner.tokenType!==os&&(this.parseAtrulePrelude?"AtrulePrelude"===(r=this.parseWithFallback(this.AtrulePrelude.bind(this,e),us)).type&&null===r.children.head&&(r=null):r=us.call(this,this.scanner.tokenIndex),this.scanner.skipSC()),this.scanner.tokenType){case os:this.scanner.next();break;case cs:a=this.atrule.hasOwnProperty(t)&&"function"==typeof this.atrule[t].block?this.atrule[t].block.call(this):this.Block(hs.call(this))}return{type:"Atrule",loc:this.getLocation(n,this.scanner.tokenStart),name:e,prelude:r,block:a}},generate:function(e){this.chunk("@"),this.chunk(e.name),null!==e.prelude&&(this.chunk(" "),this.node(e.prelude)),e.block?this.node(e.block):this.chunk(";")},walkContext:"atrule"},ds=_e.TYPE,fs=ds.Semicolon,ys=ds.LeftCurlyBracket,gs={name:"AtrulePrelude",structure:{children:[[]]},parse:function(e){var t=null;return null!==e&&(e=e.toLowerCase()),this.scanner.skipSC(),t=this.atrule.hasOwnProperty(e)&&"function"==typeof this.atrule[e].prelude?this.atrule[e].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.scanner.skipSC(),!0!==this.scanner.eof&&this.scanner.tokenType!==ys&&this.scanner.tokenType!==fs&&this.error("Semicolon or block is expected"),null===t&&(t=this.createList()),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}},generate:function(e){this.children(e)},walkContext:"atrulePrelude"},ms=_e.TYPE,ks=ms.Ident,xs=ms.String,bs=ms.Colon,vs=ms.LeftSquareBracket,Ss=ms.RightSquareBracket;function Cs(){this.scanner.eof&&this.error("Unexpected end of input");var e=this.scanner.tokenStart,t=!1,n=!0;return this.scanner.isDelim(42)?(t=!0,n=!1,this.scanner.next()):this.scanner.isDelim(124)||this.eat(ks),this.scanner.isDelim(124)?61!==this.scanner.source.charCodeAt(this.scanner.tokenStart+1)?(this.scanner.next(),this.eat(ks)):t&&this.error("Identifier is expected",this.scanner.tokenEnd):t&&this.error("Vertical line is expected"),n&&this.scanner.tokenType===bs&&(this.scanner.next(),this.eat(ks)),{type:"Identifier",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e)}}function ws(){var e=this.scanner.tokenStart,t=this.scanner.source.charCodeAt(e);return 61!==t&&126!==t&&94!==t&&36!==t&&42!==t&&124!==t&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.scanner.next(),61!==t&&(this.scanner.isDelim(61)||this.error("Equal sign is expected"),this.scanner.next()),this.scanner.substrToCursor(e)}var As={name:"AttributeSelector",structure:{name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]},parse:function(){var e,t=this.scanner.tokenStart,n=null,r=null,a=null;return this.eat(vs),this.scanner.skipSC(),e=Cs.call(this),this.scanner.skipSC(),this.scanner.tokenType!==Ss&&(this.scanner.tokenType!==ks&&(n=ws.call(this),this.scanner.skipSC(),r=this.scanner.tokenType===xs?this.String():this.Identifier(),this.scanner.skipSC()),this.scanner.tokenType===ks&&(a=this.scanner.getTokenValue(),this.scanner.next(),this.scanner.skipSC())),this.eat(Ss),{type:"AttributeSelector",loc:this.getLocation(t,this.scanner.tokenStart),name:e,matcher:n,value:r,flags:a}},generate:function(e){var t=" ";this.chunk("["),this.node(e.name),null!==e.matcher&&(this.chunk(e.matcher),null!==e.value&&(this.node(e.value),"String"===e.value.type&&(t=""))),null!==e.flags&&(this.chunk(t),this.chunk(e.flags)),this.chunk("]")}},Ts=_e.TYPE,Ps=rs.mode,Ls=Ts.WhiteSpace,Es=Ts.Comment,Ds=Ts.Semicolon,Os=Ts.AtKeyword,Bs=Ts.LeftCurlyBracket,Ns=Ts.RightCurlyBracket;function Is(e){return this.Raw(e,null,!0)}function Rs(){return this.parseWithFallback(this.Rule,Is)}function Ms(e){return this.Raw(e,Ps.semicolonIncluded,!0)}function js(){if(this.scanner.tokenType===Ds)return Ms.call(this,this.scanner.tokenIndex);var e=this.parseWithFallback(this.Declaration,Ms);return this.scanner.tokenType===Ds&&this.scanner.next(),e}var Ws={name:"Block",structure:{children:[["Atrule","Rule","Declaration"]]},parse:function(e){var t=e?js:Rs,n=this.scanner.tokenStart,r=this.createList();this.eat(Bs);e:for(;!this.scanner.eof;)switch(this.scanner.tokenType){case Ns:break e;case Ls:case Es:this.scanner.next();break;case Os:r.push(this.parseWithFallback(this.Atrule,Is));break;default:r.push(t.call(this))}return this.scanner.eof||this.eat(Ns),{type:"Block",loc:this.getLocation(n,this.scanner.tokenStart),children:r}},generate:function(e){this.chunk("{"),this.children(e,(function(e){"Declaration"===e.type&&this.chunk(";")})),this.chunk("}")},walkContext:"block"},Fs=_e.TYPE,zs=Fs.LeftSquareBracket,Ys=Fs.RightSquareBracket,Us={name:"Brackets",structure:{children:[[]]},parse:function(e,t){var n,r=this.scanner.tokenStart;return this.eat(zs),n=e.call(this,t),this.scanner.eof||this.eat(Ys),{type:"Brackets",loc:this.getLocation(r,this.scanner.tokenStart),children:n}},generate:function(e){this.chunk("["),this.children(e),this.chunk("]")}},qs=_e.TYPE.CDC,Hs={name:"CDC",structure:[],parse:function(){var e=this.scanner.tokenStart;return this.eat(qs),{type:"CDC",loc:this.getLocation(e,this.scanner.tokenStart)}},generate:function(){this.chunk("--\x3e")}},Vs=_e.TYPE.CDO,Ks={name:"CDO",structure:[],parse:function(){var e=this.scanner.tokenStart;return this.eat(Vs),{type:"CDO",loc:this.getLocation(e,this.scanner.tokenStart)}},generate:function(){this.chunk("\x3c!--")}},Qs=_e.TYPE.Ident,Gs={name:"ClassSelector",structure:{name:String},parse:function(){return this.scanner.isDelim(46)||this.error("Full stop is expected"),this.scanner.next(),{type:"ClassSelector",loc:this.getLocation(this.scanner.tokenStart-1,this.scanner.tokenEnd),name:this.consume(Qs)}},generate:function(e){this.chunk("."),this.chunk(e.name)}},Zs=_e.TYPE.Ident,_s={name:"Combinator",structure:{name:String},parse:function(){var e=this.scanner.tokenStart;switch(this.scanner.source.charCodeAt(this.scanner.tokenStart)){case 62:case 43:case 126:this.scanner.next();break;case 47:this.scanner.next(),this.scanner.tokenType===Zs&&!1!==this.scanner.lookupValue(0,"deep")||this.error("Identifier `deep` is expected"),this.scanner.next(),this.scanner.isDelim(47)||this.error("Solidus is expected"),this.scanner.next();break;default:this.error("Combinator is expected")}return{type:"Combinator",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.name)}},Xs=_e.TYPE.Comment,Js={name:"Comment",structure:{value:String},parse:function(){var e=this.scanner.tokenStart,t=this.scanner.tokenEnd;return this.eat(Xs),t-e+2>=2&&42===this.scanner.source.charCodeAt(t-2)&&47===this.scanner.source.charCodeAt(t-1)&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.source.substring(e+2,t)}},generate:function(e){this.chunk("/*"),this.chunk(e.value),this.chunk("*/")}},$s=we.isCustomProperty,ei=_e.TYPE,ti=rs.mode,ni=ei.Ident,ri=ei.Hash,ai=ei.Colon,si=ei.Semicolon,ii=ei.Delim;function oi(e){return this.Raw(e,ti.exclamationMarkOrSemicolon,!0)}function ci(e){return this.Raw(e,ti.exclamationMarkOrSemicolon,!1)}function li(){var e=this.scanner.tokenIndex,t=this.Value();return"Raw"!==t.type&&!1===this.scanner.eof&&this.scanner.tokenType!==si&&!1===this.scanner.isDelim(33)&&!1===this.scanner.isBalanceEdge(e)&&this.error(),t}var ui={name:"Declaration",structure:{important:[Boolean,String],property:String,value:["Value","Raw"]},parse:function(){var e,t=this.scanner.tokenStart,n=this.scanner.tokenIndex,r=hi.call(this),a=$s(r),s=a?this.parseCustomProperty:this.parseValue,i=a?ci:oi,o=!1;return this.scanner.skipSC(),this.eat(ai),a||this.scanner.skipSC(),e=s?this.parseWithFallback(li,i):i.call(this,this.scanner.tokenIndex),this.scanner.isDelim(33)&&(o=pi.call(this),this.scanner.skipSC()),!1===this.scanner.eof&&this.scanner.tokenType!==si&&!1===this.scanner.isBalanceEdge(n)&&this.error(),{type:"Declaration",loc:this.getLocation(t,this.scanner.tokenStart),important:o,property:r,value:e}},generate:function(e){this.chunk(e.property),this.chunk(":"),this.node(e.value),e.important&&this.chunk(!0===e.important?"!important":"!"+e.important)},walkContext:"declaration"};function hi(){var e=this.scanner.tokenStart;if(this.scanner.tokenType===ii)switch(this.scanner.source.charCodeAt(this.scanner.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.scanner.next();break;case 47:this.scanner.next(),this.scanner.isDelim(47)&&this.scanner.next()}return this.scanner.tokenType===ri?this.eat(ri):this.eat(ni),this.scanner.substrToCursor(e)}function pi(){this.eat(ii),this.scanner.skipSC();var e=this.consume(ni);return"important"===e||e}var di=_e.TYPE,fi=rs.mode,yi=di.WhiteSpace,gi=di.Comment,mi=di.Semicolon;function ki(e){return this.Raw(e,fi.semicolonIncluded,!0)}var xi={name:"DeclarationList",structure:{children:[["Declaration"]]},parse:function(){for(var e=this.createList();!this.scanner.eof;)switch(this.scanner.tokenType){case yi:case gi:case mi:this.scanner.next();break;default:e.push(this.parseWithFallback(this.Declaration,ki))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}},generate:function(e){this.children(e,(function(e){"Declaration"===e.type&&this.chunk(";")}))}},bi=ee.consumeNumber,vi=_e.TYPE.Dimension,Si={name:"Dimension",structure:{value:String,unit:String},parse:function(){var e=this.scanner.tokenStart,t=bi(this.scanner.source,e);return this.eat(vi),{type:"Dimension",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.source.substring(e,t),unit:this.scanner.source.substring(t,this.scanner.tokenStart)}},generate:function(e){this.chunk(e.value),this.chunk(e.unit)}},Ci=_e.TYPE.RightParenthesis,wi={name:"Function",structure:{name:String,children:[[]]},parse:function(e,t){var n,r=this.scanner.tokenStart,a=this.consumeFunctionName(),s=a.toLowerCase();return n=t.hasOwnProperty(s)?t[s].call(this,t):e.call(this,t),this.scanner.eof||this.eat(Ci),{type:"Function",loc:this.getLocation(r,this.scanner.tokenStart),name:a,children:n}},generate:function(e){this.chunk(e.name),this.chunk("("),this.children(e),this.chunk(")")},walkContext:"function"},Ai=_e.TYPE.Hash,Ti={name:"HexColor",structure:{value:String},parse:function(){var e=this.scanner.tokenStart;return this.eat(Ai),{type:"HexColor",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.substrToCursor(e+1)}},generate:function(e){this.chunk("#"),this.chunk(e.value)}},Pi=_e.TYPE.Ident,Li={name:"Identifier",structure:{name:String},parse:function(){return{type:"Identifier",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),name:this.consume(Pi)}},generate:function(e){this.chunk(e.name)}},Ei=_e.TYPE.Hash,Di={name:"IdSelector",structure:{name:String},parse:function(){var e=this.scanner.tokenStart;return this.eat(Ei),{type:"IdSelector",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e+1)}},generate:function(e){this.chunk("#"),this.chunk(e.name)}},Oi=_e.TYPE,Bi=Oi.Ident,Ni=Oi.Number,Ii=Oi.Dimension,Ri=Oi.LeftParenthesis,Mi=Oi.RightParenthesis,ji=Oi.Colon,Wi=Oi.Delim,Fi={name:"MediaFeature",structure:{name:String,value:["Identifier","Number","Dimension","Ratio",null]},parse:function(){var e,t=this.scanner.tokenStart,n=null;if(this.eat(Ri),this.scanner.skipSC(),e=this.consume(Bi),this.scanner.skipSC(),this.scanner.tokenType!==Mi){switch(this.eat(ji),this.scanner.skipSC(),this.scanner.tokenType){case Ni:n=this.lookupNonWSType(1)===Wi?this.Ratio():this.Number();break;case Ii:n=this.Dimension();break;case Bi:n=this.Identifier();break;default:this.error("Number, dimension, ratio or identifier is expected")}this.scanner.skipSC()}return this.eat(Mi),{type:"MediaFeature",loc:this.getLocation(t,this.scanner.tokenStart),name:e,value:n}},generate:function(e){this.chunk("("),this.chunk(e.name),null!==e.value&&(this.chunk(":"),this.node(e.value)),this.chunk(")")}},zi=_e.TYPE,Yi=zi.WhiteSpace,Ui=zi.Comment,qi=zi.Ident,Hi=zi.LeftParenthesis,Vi={name:"MediaQuery",structure:{children:[["Identifier","MediaFeature","WhiteSpace"]]},parse:function(){this.scanner.skipSC();var e=this.createList(),t=null,n=null;e:for(;!this.scanner.eof;){switch(this.scanner.tokenType){case Ui:this.scanner.next();continue;case Yi:n=this.WhiteSpace();continue;case qi:t=this.Identifier();break;case Hi:t=this.MediaFeature();break;default:break e}null!==n&&(e.push(n),n=null),e.push(t)}return null===t&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(e),children:e}},generate:function(e){this.children(e)}},Ki=_e.TYPE.Comma,Qi={name:"MediaQueryList",structure:{children:[["MediaQuery"]]},parse:function(e){var t=this.createList();for(this.scanner.skipSC();!this.scanner.eof&&(t.push(this.MediaQuery(e)),this.scanner.tokenType===Ki);)this.scanner.next();return{type:"MediaQueryList",loc:this.getLocationFromList(t),children:t}},generate:function(e){this.children(e,(function(){this.chunk(",")}))}},Gi=_e.TYPE.Number,Zi={name:"Number",structure:{value:String},parse:function(){return{type:"Number",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),value:this.consume(Gi)}},generate:function(e){this.chunk(e.value)}},_i={name:"Operator",structure:{value:String},parse:function(){var e=this.scanner.tokenStart;return this.scanner.next(),{type:"Operator",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.value)}},Xi=_e.TYPE,Ji=Xi.LeftParenthesis,$i=Xi.RightParenthesis,eo={name:"Parentheses",structure:{children:[[]]},parse:function(e,t){var n,r=this.scanner.tokenStart;return this.eat(Ji),n=e.call(this,t),this.scanner.eof||this.eat($i),{type:"Parentheses",loc:this.getLocation(r,this.scanner.tokenStart),children:n}},generate:function(e){this.chunk("("),this.children(e),this.chunk(")")}},to=ee.consumeNumber,no=_e.TYPE.Percentage,ro={name:"Percentage",structure:{value:String},parse:function(){var e=this.scanner.tokenStart,t=to(this.scanner.source,e);return this.eat(no),{type:"Percentage",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.source.substring(e,t)}},generate:function(e){this.chunk(e.value),this.chunk("%")}},ao=_e.TYPE,so=ao.Ident,io=ao.Function,oo=ao.Colon,co=ao.RightParenthesis,lo={name:"PseudoClassSelector",structure:{name:String,children:[["Raw"],null]},parse:function(){var e,t,n=this.scanner.tokenStart,r=null;return this.eat(oo),this.scanner.tokenType===io?(t=(e=this.consumeFunctionName()).toLowerCase(),this.pseudo.hasOwnProperty(t)?(this.scanner.skipSC(),r=this.pseudo[t].call(this),this.scanner.skipSC()):(r=this.createList()).push(this.Raw(this.scanner.tokenIndex,null,!1)),this.eat(co)):e=this.consume(so),{type:"PseudoClassSelector",loc:this.getLocation(n,this.scanner.tokenStart),name:e,children:r}},generate:function(e){this.chunk(":"),this.chunk(e.name),null!==e.children&&(this.chunk("("),this.children(e),this.chunk(")"))},walkContext:"function"},uo=_e.TYPE,ho=uo.Ident,po=uo.Function,fo=uo.Colon,yo=uo.RightParenthesis,go={name:"PseudoElementSelector",structure:{name:String,children:[["Raw"],null]},parse:function(){var e,t,n=this.scanner.tokenStart,r=null;return this.eat(fo),this.eat(fo),this.scanner.tokenType===po?(t=(e=this.consumeFunctionName()).toLowerCase(),this.pseudo.hasOwnProperty(t)?(this.scanner.skipSC(),r=this.pseudo[t].call(this),this.scanner.skipSC()):(r=this.createList()).push(this.Raw(this.scanner.tokenIndex,null,!1)),this.eat(yo)):e=this.consume(ho),{type:"PseudoElementSelector",loc:this.getLocation(n,this.scanner.tokenStart),name:e,children:r}},generate:function(e){this.chunk("::"),this.chunk(e.name),null!==e.children&&(this.chunk("("),this.children(e),this.chunk(")"))},walkContext:"function"},mo=_e.isDigit,ko=_e.TYPE,xo=ko.Number,bo=ko.Delim;function vo(){this.scanner.skipWS();for(var e=this.consume(xo),t=0;t6&&this.error("Too many hex digits",n)}return this.scanner.next(),r}function Jo(e){for(var t=0;this.scanner.isDelim(63);)++t>e&&this.error("Too many question marks"),this.scanner.next()}function $o(e){this.scanner.source.charCodeAt(this.scanner.tokenStart)!==e&&this.error(Qo[e]+" is expected")}function ec(){var e=0;return this.scanner.isDelim(43)?(this.scanner.next(),this.scanner.tokenType===Go?void((e=Xo.call(this,0,!0))>0&&Jo.call(this,6-e)):this.scanner.isDelim(63)?(this.scanner.next(),void Jo.call(this,5)):void this.error("Hex digit or question mark is expected")):this.scanner.tokenType===Zo?($o.call(this,43),e=Xo.call(this,1,!0),this.scanner.isDelim(63)?void Jo.call(this,6-e):this.scanner.tokenType===_o||this.scanner.tokenType===Zo?($o.call(this,45),void Xo.call(this,1,!1)):void 0):this.scanner.tokenType===_o?($o.call(this,43),void((e=Xo.call(this,1,!0))>0&&Jo.call(this,6-e))):void this.error()}var tc={name:"UnicodeRange",structure:{value:String},parse:function(){var e=this.scanner.tokenStart;return Vo(this.scanner.source,e,117)||this.error("U is expected"),Vo(this.scanner.source,e+1,43)||this.error("Plus sign is expected"),this.scanner.next(),ec.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.scanner.tokenStart),value:this.scanner.substrToCursor(e)}},generate:function(e){this.chunk(e.value)}},nc=_e.isWhiteSpace,rc=_e.cmpStr,ac=_e.TYPE,sc=ac.Function,ic=ac.Url,oc=ac.RightParenthesis,cc={name:"Url",structure:{value:["String","Raw"]},parse:function(){var e,t=this.scanner.tokenStart;switch(this.scanner.tokenType){case ic:for(var n=t+4,r=this.scanner.tokenEnd-1;n{fl.includes(e)||gl.push(e)}));const ml=(e,t=!1)=>{let n=e.toLowerCase().trim();if("cssoffset"===n&&(n=n.substr(3)),gl.includes(n))return!t||n;if(n.includes("-"))return!!t&&"";n=n.replace(/-/g,"");for(const e of gl)if(n===e.replace(/-/g,""))return!t||e;return!!t&&""},kl=(e,t=!0)=>{let n=ml(e,!0);return n?(t&&"offset"===n&&(n="css-"+n),n.replace(/-([a-z])/g,((e,t)=>t.toUpperCase()))):""},xl=e=>ml(e,!0),bl={main:"",links:{},order:[]},vl=e=>{const t=e.match(/<'[a-zA-Z0-9-()]+'>/g);Array.isArray(t)&&t.forEach((e=>{const t=e.slice(2,-2),n=Aa[t];bl[e]=n.syntax,bl.order.push(e),vl(n.syntax)}));const n=e.match(/<[a-zA-Z0-9-()]+>/g);Array.isArray(n)&&n.forEach((e=>{const t=e.slice(1,-1);if(!bl[e]){const n=Ta[t],r=Pa.syntaxes[t];n?(bl[e]=n.syntax,bl.order.push(e),vl(n.syntax)):r?(bl[e]=r.syntax,bl.order.push(e),vl(r.syntax)):["url-token","any-value","function-token","hex-color","declaration-value","hash-token","zero"].includes(t)||(bl.links[e]="https://developer.mozilla.org/docs/Web/CSS/"+t.replace(/flex/,"flex_value"))}}))},Sl=(e,t=!0)=>{const r=[];if(u(e))for(let[t,a]of Object.entries(e))if(d(a)||n(a)){const e=ml(t,!0);if(e){let t;try{t=dl.parse(`${e}: ${a}`,{context:"declaration",onParseError:e=>{r.push(e)}}),dl.walk(t,{visit:"Declaration",enter:function(e){const t=dl.lexer.matchDeclaration(e).error;t&&r.push(t)}})}catch(e){r.push(e)}}else r.push({name:"MatchError",message:t+" is not an animatable CSS property."})}else r.push({name:"TypeError",message:"Property value must be a string or a number. "+typeof a+" given."});else r.push({name:"TypeError",message:"Argument is not a plain object."});return!r.length||!!t&&r[r.length-1]},Cl=(e,t)=>{switch(t){case"css":e=xl(e);break;case"js":e=kl(e,!1);break;default:e=kl(e)}return e};var wl={properties:gl,cssToJs:kl,jsToCss:xl,isAnimatable:ml,popular:(e=0,t=10)=>{const n=[];let r;t>=yl.length&&(r=gl.filter((e=>!yl.includes(gl.indexOf(e)))));for(let a=e;a{for(const e in bl)delete bl[e];bl.main="",bl.links={},bl.order=[];const t=ml(e,!0);if(t){const e=Aa[t].syntax;bl.main=e,vl(e)}else bl.main=`Error: ${e} is not an animatable CSS property.`;return bl},validate:Sl,sanitize:(e,t="waapi")=>{t=t.toString().toLowerCase();let n={};if(Array.isArray(e))n=[],e.forEach((e=>{const r=ml(e,!0);r&&n.push(Cl(r,t))}));else if(u(e))for(let[r,a]of Object.entries(e)){const e={};e[r]=a,Sl(e,!1)&&(n[Cl(r,t)]=a)}else if(d(e))switch(t){case"css":return xl(e);case"js":return kl(e,!1);default:return kl(e)}return n}},Al={properties:wl.properties.map((e=>wl.cssToJs(e))),propertiesCSS:wl.properties,propertiesJS:wl.properties.map((e=>wl.cssToJs(e,!1)))};const Tl=Al.properties,Pl=Al.propertiesCSS,Ll=Al.propertiesJS,El=wl.cssToJs,Dl=wl.jsToCss,Ol=wl.isAnimatable,Bl=wl.popular,Nl=wl.syntax,Il=wl.validate,Rl=wl.sanitize;e.cssToJs=El,e.isAnimatable=Ol,e.jsToCss=Dl,e.popular=Bl,e.properties=Tl,e.propertiesCSS=Pl,e.propertiesJS=Ll,e.sanitize=Rl,e.syntax=Nl,e.validate=Il,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=animatable.js.map diff --git a/dist/animatable.js.map b/dist/animatable.js.map index 958f48c..9ae60a3 100644 --- a/dist/animatable.js.map +++ b/dist/animatable.js.map @@ -1 +1 @@ -{"version":3,"file":"animatable.js","sources":["../node_modules/lodash.isnumber/index.js","../node_modules/lodash.isplainobject/index.js","../node_modules/lodash.isstring/index.js","../node_modules/css-tree-animatable/lib/common/List.js","../node_modules/css-tree-animatable/lib/utils/createCustomError.js","../node_modules/css-tree-animatable/lib/common/SyntaxError.js","../node_modules/css-tree-animatable/lib/tokenizer/const.js","../node_modules/css-tree-animatable/lib/tokenizer/char-code-definitions.js","../node_modules/css-tree-animatable/lib/tokenizer/utils.js","../node_modules/css-tree-animatable/lib/common/TokenStream.js","../node_modules/css-tree-animatable/lib/definition-syntax/generate.js","../node_modules/css-tree-animatable/lib/lexer/error.js","../node_modules/css-tree-animatable/lib/utils/names.js","../node_modules/css-tree-animatable/lib/common/adopt-buffer.js","../node_modules/css-tree-animatable/lib/tokenizer/index.js","../node_modules/css-tree-animatable/lib/lexer/generic-an-plus-b.js","../node_modules/css-tree-animatable/lib/lexer/generic-urange.js","../node_modules/css-tree-animatable/lib/lexer/generic.js","../node_modules/css-tree-animatable/lib/definition-syntax/SyntaxError.js","../node_modules/css-tree-animatable/lib/definition-syntax/tokenizer.js","../node_modules/css-tree-animatable/lib/definition-syntax/parse.js","../node_modules/css-tree-animatable/lib/definition-syntax/walk.js","../node_modules/css-tree-animatable/lib/lexer/prepare-tokens.js","../node_modules/css-tree-animatable/lib/lexer/match-graph.js","../node_modules/css-tree-animatable/lib/lexer/match.js","../node_modules/css-tree-animatable/lib/lexer/trace.js","../node_modules/css-tree-animatable/lib/lexer/search.js","../node_modules/css-tree-animatable/lib/lexer/structure.js","../node_modules/css-tree-animatable/lib/lexer/Lexer.js","../node_modules/css-tree-animatable/lib/definition-syntax/index.js","../node_modules/css-tree-animatable/lib/common/OffsetToLocation.js","../node_modules/css-tree-animatable/lib/parser/sequence.js","../node_modules/css-tree-animatable/lib/parser/create.js","../node_modules/css-tree-animatable/lib/generator/create.js","../node_modules/css-tree-animatable/lib/convertor/create.js","../node_modules/css-tree-animatable/lib/walker/create.js","../node_modules/css-tree-animatable/lib/utils/clone.js","../node_modules/css-tree-animatable/lib/syntax/config/mix.js","../node_modules/css-tree-animatable/lib/syntax/create.js","../node_modules/css-tree-animatable/data/index.js","../node_modules/css-tree-animatable/lib/syntax/node/AnPlusB.js","../node_modules/css-tree-animatable/lib/syntax/node/Raw.js","../node_modules/css-tree-animatable/lib/syntax/node/Atrule.js","../node_modules/css-tree-animatable/lib/syntax/node/AtrulePrelude.js","../node_modules/css-tree-animatable/lib/syntax/node/AttributeSelector.js","../node_modules/css-tree-animatable/lib/syntax/node/Block.js","../node_modules/css-tree-animatable/lib/syntax/node/Brackets.js","../node_modules/css-tree-animatable/lib/syntax/node/CDC.js","../node_modules/css-tree-animatable/lib/syntax/node/CDO.js","../node_modules/css-tree-animatable/lib/syntax/node/ClassSelector.js","../node_modules/css-tree-animatable/lib/syntax/node/Combinator.js","../node_modules/css-tree-animatable/lib/syntax/node/Comment.js","../node_modules/css-tree-animatable/lib/syntax/node/Declaration.js","../node_modules/css-tree-animatable/lib/syntax/node/DeclarationList.js","../node_modules/css-tree-animatable/lib/syntax/node/Dimension.js","../node_modules/css-tree-animatable/lib/syntax/node/Function.js","../node_modules/css-tree-animatable/lib/syntax/node/HexColor.js","../node_modules/css-tree-animatable/lib/syntax/node/Identifier.js","../node_modules/css-tree-animatable/lib/syntax/node/IdSelector.js","../node_modules/css-tree-animatable/lib/syntax/node/MediaFeature.js","../node_modules/css-tree-animatable/lib/syntax/node/MediaQuery.js","../node_modules/css-tree-animatable/lib/syntax/node/MediaQueryList.js","../node_modules/css-tree-animatable/lib/syntax/node/Number.js","../node_modules/css-tree-animatable/lib/syntax/node/Operator.js","../node_modules/css-tree-animatable/lib/syntax/node/Parentheses.js","../node_modules/css-tree-animatable/lib/syntax/node/Percentage.js","../node_modules/css-tree-animatable/lib/syntax/node/PseudoClassSelector.js","../node_modules/css-tree-animatable/lib/syntax/node/PseudoElementSelector.js","../node_modules/css-tree-animatable/lib/syntax/node/Ratio.js","../node_modules/css-tree-animatable/lib/syntax/node/Rule.js","../node_modules/css-tree-animatable/lib/syntax/node/SelectorList.js","../node_modules/css-tree-animatable/lib/syntax/node/String.js","../node_modules/css-tree-animatable/lib/syntax/node/StyleSheet.js","../node_modules/css-tree-animatable/lib/syntax/node/TypeSelector.js","../node_modules/css-tree-animatable/lib/syntax/node/UnicodeRange.js","../node_modules/css-tree-animatable/lib/syntax/node/Url.js","../node_modules/css-tree-animatable/lib/syntax/node/WhiteSpace.js","../node_modules/css-tree-animatable/lib/syntax/node/index.js","../node_modules/css-tree-animatable/lib/syntax/node/Nth.js","../node_modules/css-tree-animatable/lib/syntax/node/Selector.js","../node_modules/css-tree-animatable/lib/syntax/node/Value.js","../node_modules/css-tree-animatable/lib/syntax/config/lexer.js","../node_modules/css-tree-animatable/lib/syntax/scope/default.js","../node_modules/css-tree-animatable/lib/syntax/scope/atrulePrelude.js","../node_modules/css-tree-animatable/lib/syntax/scope/selector.js","../node_modules/css-tree-animatable/lib/syntax/function/element.js","../node_modules/css-tree-animatable/lib/syntax/function/var.js","../node_modules/css-tree-animatable/lib/syntax/scope/index.js","../node_modules/css-tree-animatable/lib/syntax/scope/value.js","../node_modules/css-tree-animatable/lib/syntax/function/expression.js","../node_modules/css-tree-animatable/lib/syntax/atrule/import.js","../node_modules/css-tree-animatable/lib/syntax/atrule/supports.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/common/selectorList.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/common/nthWithOfClause.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/common/nth.js","../node_modules/css-tree-animatable/lib/syntax/config/parser.js","../node_modules/css-tree-animatable/lib/syntax/atrule/index.js","../node_modules/css-tree-animatable/lib/syntax/atrule/font-face.js","../node_modules/css-tree-animatable/lib/syntax/atrule/media.js","../node_modules/css-tree-animatable/lib/syntax/atrule/page.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/index.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/dir.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/has.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/lang.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/matches.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/not.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/nth-child.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/nth-last-child.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/nth-last-of-type.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/nth-of-type.js","../node_modules/css-tree-animatable/lib/syntax/pseudo/slotted.js","../node_modules/css-tree-animatable/lib/syntax/config/walker.js","../node_modules/css-tree-animatable/lib/index.js","../node_modules/css-tree-animatable/lib/syntax/index.js","../src/functions.js","../src/arrays.js","../src/index.js"],"sourcesContent":["/**\n * lodash 3.0.3 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified\n * as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\nfunction isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && objectToString.call(value) == numberTag);\n}\n\nmodule.exports = isNumber;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) ||\n objectToString.call(value) != objectTag || isHostObject(value)) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return (typeof Ctor == 'function' &&\n Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);\n}\n\nmodule.exports = isPlainObject;\n","/**\n * lodash 4.0.1 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @type Function\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);\n}\n\nmodule.exports = isString;\n","//\r\n// list\r\n// ┌──────┐\r\n// ┌──────────────┼─head │\r\n// │ │ tail─┼──────────────┐\r\n// │ └──────┘ │\r\n// ▼ ▼\r\n// item item item item\r\n// ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐\r\n// null ◀──┼─prev │◀───┼─prev │◀───┼─prev │◀───┼─prev │\r\n// │ next─┼───▶│ next─┼───▶│ next─┼───▶│ next─┼──▶ null\r\n// ├──────┤ ├──────┤ ├──────┤ ├──────┤\r\n// │ data │ │ data │ │ data │ │ data │\r\n// └──────┘ └──────┘ └──────┘ └──────┘\r\n//\r\n\r\nfunction createItem(data) {\r\n return {\r\n prev: null,\r\n next: null,\r\n data: data\r\n };\r\n}\r\n\r\nfunction allocateCursor(node, prev, next) {\r\n var cursor;\r\n\r\n if (cursors !== null) {\r\n cursor = cursors;\r\n cursors = cursors.cursor;\r\n cursor.prev = prev;\r\n cursor.next = next;\r\n cursor.cursor = node.cursor;\r\n } else {\r\n cursor = {\r\n prev: prev,\r\n next: next,\r\n cursor: node.cursor\r\n };\r\n }\r\n\r\n node.cursor = cursor;\r\n\r\n return cursor;\r\n}\r\n\r\nfunction releaseCursor(node) {\r\n var cursor = node.cursor;\r\n\r\n node.cursor = cursor.cursor;\r\n cursor.prev = null;\r\n cursor.next = null;\r\n cursor.cursor = cursors;\r\n cursors = cursor;\r\n}\r\n\r\nvar cursors = null;\r\nvar List = function() {\r\n this.cursor = null;\r\n this.head = null;\r\n this.tail = null;\r\n};\r\n\r\nList.createItem = createItem;\r\nList.prototype.createItem = createItem;\r\n\r\nList.prototype.updateCursors = function(prevOld, prevNew, nextOld, nextNew) {\r\n var cursor = this.cursor;\r\n\r\n while (cursor !== null) {\r\n if (cursor.prev === prevOld) {\r\n cursor.prev = prevNew;\r\n }\r\n\r\n if (cursor.next === nextOld) {\r\n cursor.next = nextNew;\r\n }\r\n\r\n cursor = cursor.cursor;\r\n }\r\n};\r\n\r\nList.prototype.getSize = function() {\r\n var size = 0;\r\n var cursor = this.head;\r\n\r\n while (cursor) {\r\n size++;\r\n cursor = cursor.next;\r\n }\r\n\r\n return size;\r\n};\r\n\r\nList.prototype.fromArray = function(array) {\r\n var cursor = null;\r\n\r\n this.head = null;\r\n\r\n for (var i = 0; i < array.length; i++) {\r\n var item = createItem(array[i]);\r\n\r\n if (cursor !== null) {\r\n cursor.next = item;\r\n } else {\r\n this.head = item;\r\n }\r\n\r\n item.prev = cursor;\r\n cursor = item;\r\n }\r\n\r\n this.tail = cursor;\r\n\r\n return this;\r\n};\r\n\r\nList.prototype.toArray = function() {\r\n var cursor = this.head;\r\n var result = [];\r\n\r\n while (cursor) {\r\n result.push(cursor.data);\r\n cursor = cursor.next;\r\n }\r\n\r\n return result;\r\n};\r\n\r\nList.prototype.toJSON = List.prototype.toArray;\r\n\r\nList.prototype.isEmpty = function() {\r\n return this.head === null;\r\n};\r\n\r\nList.prototype.first = function() {\r\n return this.head && this.head.data;\r\n};\r\n\r\nList.prototype.last = function() {\r\n return this.tail && this.tail.data;\r\n};\r\n\r\nList.prototype.each = function(fn, context) {\r\n var item;\r\n\r\n if (context === undefined) {\r\n context = this;\r\n }\r\n\r\n // push cursor\r\n var cursor = allocateCursor(this, null, this.head);\r\n\r\n while (cursor.next !== null) {\r\n item = cursor.next;\r\n cursor.next = item.next;\r\n\r\n fn.call(context, item.data, item, this);\r\n }\r\n\r\n // pop cursor\r\n releaseCursor(this);\r\n};\r\n\r\nList.prototype.forEach = List.prototype.each;\r\n\r\nList.prototype.eachRight = function(fn, context) {\r\n var item;\r\n\r\n if (context === undefined) {\r\n context = this;\r\n }\r\n\r\n // push cursor\r\n var cursor = allocateCursor(this, this.tail, null);\r\n\r\n while (cursor.prev !== null) {\r\n item = cursor.prev;\r\n cursor.prev = item.prev;\r\n\r\n fn.call(context, item.data, item, this);\r\n }\r\n\r\n // pop cursor\r\n releaseCursor(this);\r\n};\r\n\r\nList.prototype.forEachRight = List.prototype.eachRight;\r\n\r\nList.prototype.nextUntil = function(start, fn, context) {\r\n if (start === null) {\r\n return;\r\n }\r\n\r\n var item;\r\n\r\n if (context === undefined) {\r\n context = this;\r\n }\r\n\r\n // push cursor\r\n var cursor = allocateCursor(this, null, start);\r\n\r\n while (cursor.next !== null) {\r\n item = cursor.next;\r\n cursor.next = item.next;\r\n\r\n if (fn.call(context, item.data, item, this)) {\r\n break;\r\n }\r\n }\r\n\r\n // pop cursor\r\n releaseCursor(this);\r\n};\r\n\r\nList.prototype.prevUntil = function(start, fn, context) {\r\n if (start === null) {\r\n return;\r\n }\r\n\r\n var item;\r\n\r\n if (context === undefined) {\r\n context = this;\r\n }\r\n\r\n // push cursor\r\n var cursor = allocateCursor(this, start, null);\r\n\r\n while (cursor.prev !== null) {\r\n item = cursor.prev;\r\n cursor.prev = item.prev;\r\n\r\n if (fn.call(context, item.data, item, this)) {\r\n break;\r\n }\r\n }\r\n\r\n // pop cursor\r\n releaseCursor(this);\r\n};\r\n\r\nList.prototype.some = function(fn, context) {\r\n var cursor = this.head;\r\n\r\n if (context === undefined) {\r\n context = this;\r\n }\r\n\r\n while (cursor !== null) {\r\n if (fn.call(context, cursor.data, cursor, this)) {\r\n return true;\r\n }\r\n\r\n cursor = cursor.next;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nList.prototype.map = function(fn, context) {\r\n var result = new List();\r\n var cursor = this.head;\r\n\r\n if (context === undefined) {\r\n context = this;\r\n }\r\n\r\n while (cursor !== null) {\r\n result.appendData(fn.call(context, cursor.data, cursor, this));\r\n cursor = cursor.next;\r\n }\r\n\r\n return result;\r\n};\r\n\r\nList.prototype.filter = function(fn, context) {\r\n var result = new List();\r\n var cursor = this.head;\r\n\r\n if (context === undefined) {\r\n context = this;\r\n }\r\n\r\n while (cursor !== null) {\r\n if (fn.call(context, cursor.data, cursor, this)) {\r\n result.appendData(cursor.data);\r\n }\r\n cursor = cursor.next;\r\n }\r\n\r\n return result;\r\n};\r\n\r\nList.prototype.clear = function() {\r\n this.head = null;\r\n this.tail = null;\r\n};\r\n\r\nList.prototype.copy = function() {\r\n var result = new List();\r\n var cursor = this.head;\r\n\r\n while (cursor !== null) {\r\n result.insert(createItem(cursor.data));\r\n cursor = cursor.next;\r\n }\r\n\r\n return result;\r\n};\r\n\r\nList.prototype.prepend = function(item) {\r\n // head\r\n // ^\r\n // item\r\n this.updateCursors(null, item, this.head, item);\r\n\r\n // insert to the beginning of the list\r\n if (this.head !== null) {\r\n // new item <- first item\r\n this.head.prev = item;\r\n\r\n // new item -> first item\r\n item.next = this.head;\r\n } else {\r\n // if list has no head, then it also has no tail\r\n // in this case tail points to the new item\r\n this.tail = item;\r\n }\r\n\r\n // head always points to new item\r\n this.head = item;\r\n\r\n return this;\r\n};\r\n\r\nList.prototype.prependData = function(data) {\r\n return this.prepend(createItem(data));\r\n};\r\n\r\nList.prototype.append = function(item) {\r\n return this.insert(item);\r\n};\r\n\r\nList.prototype.appendData = function(data) {\r\n return this.insert(createItem(data));\r\n};\r\n\r\nList.prototype.insert = function(item, before) {\r\n if (before !== undefined && before !== null) {\r\n // prev before\r\n // ^\r\n // item\r\n this.updateCursors(before.prev, item, before, item);\r\n\r\n if (before.prev === null) {\r\n // insert to the beginning of list\r\n if (this.head !== before) {\r\n throw new Error('before doesn\\'t belong to list');\r\n }\r\n\r\n // since head points to before therefore list doesn't empty\r\n // no need to check tail\r\n this.head = item;\r\n before.prev = item;\r\n item.next = before;\r\n\r\n this.updateCursors(null, item);\r\n } else {\r\n\r\n // insert between two items\r\n before.prev.next = item;\r\n item.prev = before.prev;\r\n\r\n before.prev = item;\r\n item.next = before;\r\n }\r\n } else {\r\n // tail\r\n // ^\r\n // item\r\n this.updateCursors(this.tail, item, null, item);\r\n\r\n // insert to the ending of the list\r\n if (this.tail !== null) {\r\n // last item -> new item\r\n this.tail.next = item;\r\n\r\n // last item <- new item\r\n item.prev = this.tail;\r\n } else {\r\n // if list has no tail, then it also has no head\r\n // in this case head points to new item\r\n this.head = item;\r\n }\r\n\r\n // tail always points to new item\r\n this.tail = item;\r\n }\r\n\r\n return this;\r\n};\r\n\r\nList.prototype.insertData = function(data, before) {\r\n return this.insert(createItem(data), before);\r\n};\r\n\r\nList.prototype.remove = function(item) {\r\n // item\r\n // ^\r\n // prev next\r\n this.updateCursors(item, item.prev, item, item.next);\r\n\r\n if (item.prev !== null) {\r\n item.prev.next = item.next;\r\n } else {\r\n if (this.head !== item) {\r\n throw new Error('item doesn\\'t belong to list');\r\n }\r\n\r\n this.head = item.next;\r\n }\r\n\r\n if (item.next !== null) {\r\n item.next.prev = item.prev;\r\n } else {\r\n if (this.tail !== item) {\r\n throw new Error('item doesn\\'t belong to list');\r\n }\r\n\r\n this.tail = item.prev;\r\n }\r\n\r\n item.prev = null;\r\n item.next = null;\r\n\r\n return item;\r\n};\r\n\r\nList.prototype.push = function(data) {\r\n this.insert(createItem(data));\r\n};\r\n\r\nList.prototype.pop = function() {\r\n if (this.tail !== null) {\r\n return this.remove(this.tail);\r\n }\r\n};\r\n\r\nList.prototype.unshift = function(data) {\r\n this.prepend(createItem(data));\r\n};\r\n\r\nList.prototype.shift = function() {\r\n if (this.head !== null) {\r\n return this.remove(this.head);\r\n }\r\n};\r\n\r\nList.prototype.prependList = function(list) {\r\n return this.insertList(list, this.head);\r\n};\r\n\r\nList.prototype.appendList = function(list) {\r\n return this.insertList(list);\r\n};\r\n\r\nList.prototype.insertList = function(list, before) {\r\n // ignore empty lists\r\n if (list.head === null) {\r\n return this;\r\n }\r\n\r\n if (before !== undefined && before !== null) {\r\n this.updateCursors(before.prev, list.tail, before, list.head);\r\n\r\n // insert in the middle of dist list\r\n if (before.prev !== null) {\r\n // before.prev <-> list.head\r\n before.prev.next = list.head;\r\n list.head.prev = before.prev;\r\n } else {\r\n this.head = list.head;\r\n }\r\n\r\n before.prev = list.tail;\r\n list.tail.next = before;\r\n } else {\r\n this.updateCursors(this.tail, list.tail, null, list.head);\r\n\r\n // insert to end of the list\r\n if (this.tail !== null) {\r\n // if destination list has a tail, then it also has a head,\r\n // but head doesn't change\r\n\r\n // dest tail -> source head\r\n this.tail.next = list.head;\r\n\r\n // dest tail <- source head\r\n list.head.prev = this.tail;\r\n } else {\r\n // if list has no a tail, then it also has no a head\r\n // in this case points head to new item\r\n this.head = list.head;\r\n }\r\n\r\n // tail always start point to new item\r\n this.tail = list.tail;\r\n }\r\n\r\n list.head = null;\r\n list.tail = null;\r\n\r\n return this;\r\n};\r\n\r\nList.prototype.replace = function(oldItem, newItemOrList) {\r\n if ('head' in newItemOrList) {\r\n this.insertList(newItemOrList, oldItem);\r\n } else {\r\n this.insert(newItemOrList, oldItem);\r\n }\r\n\r\n this.remove(oldItem);\r\n};\r\n\r\nmodule.exports = List;\r\n","module.exports = function createCustomError(name, message) {\r\n // use Object.create(), because some VMs prevent setting line/column otherwise\r\n // (iOS Safari 10 even throws an exception)\r\n var error = Object.create(SyntaxError.prototype);\r\n var errorStack = new Error();\r\n\r\n error.name = name;\r\n error.message = message;\r\n\r\n Object.defineProperty(error, 'stack', {\r\n get: function() {\r\n return (errorStack.stack || '').replace(/^(.+\\n){1,3}/, name + ': ' + message + '\\n');\r\n }\r\n });\r\n\r\n return error;\r\n};\r\n","var createCustomError = require('../utils/createCustomError');\r\nvar MAX_LINE_LENGTH = 100;\r\nvar OFFSET_CORRECTION = 60;\r\nvar TAB_REPLACEMENT = ' ';\r\n\r\nfunction sourceFragment(error, extraLines) {\r\n function processLines(start, end) {\r\n return lines.slice(start, end).map(function(line, idx) {\r\n var num = String(start + idx + 1);\r\n\r\n while (num.length < maxNumLength) {\r\n num = ' ' + num;\r\n }\r\n\r\n return num + ' |' + line;\r\n }).join('\\n');\r\n }\r\n\r\n var lines = error.source.split(/\\r\\n?|\\n|\\f/);\r\n var line = error.line;\r\n var column = error.column;\r\n var startLine = Math.max(1, line - extraLines) - 1;\r\n var endLine = Math.min(line + extraLines, lines.length + 1);\r\n var maxNumLength = Math.max(4, String(endLine).length) + 1;\r\n var cutLeft = 0;\r\n\r\n // column correction according to replaced tab before column\r\n column += (TAB_REPLACEMENT.length - 1) * (lines[line - 1].substr(0, column - 1).match(/\\t/g) || []).length;\r\n\r\n if (column > MAX_LINE_LENGTH) {\r\n cutLeft = column - OFFSET_CORRECTION + 3;\r\n column = OFFSET_CORRECTION - 2;\r\n }\r\n\r\n for (var i = startLine; i <= endLine; i++) {\r\n if (i >= 0 && i < lines.length) {\r\n lines[i] = lines[i].replace(/\\t/g, TAB_REPLACEMENT);\r\n lines[i] =\r\n (cutLeft > 0 && lines[i].length > cutLeft ? '\\u2026' : '') +\r\n lines[i].substr(cutLeft, MAX_LINE_LENGTH - 2) +\r\n (lines[i].length > cutLeft + MAX_LINE_LENGTH - 1 ? '\\u2026' : '');\r\n }\r\n }\r\n\r\n return [\r\n processLines(startLine, line),\r\n new Array(column + maxNumLength + 2).join('-') + '^',\r\n processLines(line, endLine)\r\n ].filter(Boolean).join('\\n');\r\n}\r\n\r\nvar SyntaxError = function(message, source, offset, line, column) {\r\n var error = createCustomError('SyntaxError', message);\r\n\r\n error.source = source;\r\n error.offset = offset;\r\n error.line = line;\r\n error.column = column;\r\n\r\n error.sourceFragment = function(extraLines) {\r\n return sourceFragment(error, isNaN(extraLines) ? 0 : extraLines);\r\n };\r\n Object.defineProperty(error, 'formattedMessage', {\r\n get: function() {\r\n return (\r\n 'Parse error: ' + error.message + '\\n' +\r\n sourceFragment(error, 2)\r\n );\r\n }\r\n });\r\n\r\n // for backward capability\r\n error.parseError = {\r\n offset: offset,\r\n line: line,\r\n column: column\r\n };\r\n\r\n return error;\r\n};\r\n\r\nmodule.exports = SyntaxError;\r\n","// CSS Syntax Module Level 3\r\n// https://www.w3.org/TR/css-syntax-3/\r\nvar TYPE = {\r\n EOF: 0, // \r\n Ident: 1, // \r\n Function: 2, // \r\n AtKeyword: 3, // \r\n Hash: 4, // \r\n String: 5, // \r\n BadString: 6, // \r\n Url: 7, // \r\n BadUrl: 8, // \r\n Delim: 9, // \r\n Number: 10, // \r\n Percentage: 11, // \r\n Dimension: 12, // \r\n WhiteSpace: 13, // \r\n CDO: 14, // \r\n CDC: 15, // \r\n Colon: 16, // :\r\n Semicolon: 17, // ;\r\n Comma: 18, // ,\r\n LeftSquareBracket: 19, // <[-token>\r\n RightSquareBracket: 20, // <]-token>\r\n LeftParenthesis: 21, // <(-token>\r\n RightParenthesis: 22, // <)-token>\r\n LeftCurlyBracket: 23, // <{-token>\r\n RightCurlyBracket: 24, // <}-token>\r\n Comment: 25\r\n};\r\n\r\nvar NAME = Object.keys(TYPE).reduce(function(result, key) {\r\n result[TYPE[key]] = key;\r\n return result;\r\n}, {});\r\n\r\nmodule.exports = {\r\n TYPE: TYPE,\r\n NAME: NAME\r\n};\r\n","var EOF = 0;\r\n\r\n// https://drafts.csswg.org/css-syntax-3/\r\n// § 4.2. Definitions\r\n\r\n// digit\r\n// A code point between U+0030 DIGIT ZERO (0) and U+0039 DIGIT NINE (9).\r\nfunction isDigit(code) {\r\n return code >= 0x0030 && code <= 0x0039;\r\n}\r\n\r\n// hex digit\r\n// A digit, or a code point between U+0041 LATIN CAPITAL LETTER A (A) and U+0046 LATIN CAPITAL LETTER F (F),\r\n// or a code point between U+0061 LATIN SMALL LETTER A (a) and U+0066 LATIN SMALL LETTER F (f).\r\nfunction isHexDigit(code) {\r\n return (\r\n isDigit(code) || // 0 .. 9\r\n (code >= 0x0041 && code <= 0x0046) || // A .. F\r\n (code >= 0x0061 && code <= 0x0066) // a .. f\r\n );\r\n}\r\n\r\n// uppercase letter\r\n// A code point between U+0041 LATIN CAPITAL LETTER A (A) and U+005A LATIN CAPITAL LETTER Z (Z).\r\nfunction isUppercaseLetter(code) {\r\n return code >= 0x0041 && code <= 0x005A;\r\n}\r\n\r\n// lowercase letter\r\n// A code point between U+0061 LATIN SMALL LETTER A (a) and U+007A LATIN SMALL LETTER Z (z).\r\nfunction isLowercaseLetter(code) {\r\n return code >= 0x0061 && code <= 0x007A;\r\n}\r\n\r\n// letter\r\n// An uppercase letter or a lowercase letter.\r\nfunction isLetter(code) {\r\n return isUppercaseLetter(code) || isLowercaseLetter(code);\r\n}\r\n\r\n// non-ASCII code point\r\n// A code point with a value equal to or greater than U+0080 .\r\nfunction isNonAscii(code) {\r\n return code >= 0x0080;\r\n}\r\n\r\n// name-start code point\r\n// A letter, a non-ASCII code point, or U+005F LOW LINE (_).\r\nfunction isNameStart(code) {\r\n return isLetter(code) || isNonAscii(code) || code === 0x005F;\r\n}\r\n\r\n// name code point\r\n// A name-start code point, a digit, or U+002D HYPHEN-MINUS (-).\r\nfunction isName(code) {\r\n return isNameStart(code) || isDigit(code) || code === 0x002D;\r\n}\r\n\r\n// non-printable code point\r\n// A code point between U+0000 NULL and U+0008 BACKSPACE, or U+000B LINE TABULATION,\r\n// or a code point between U+000E SHIFT OUT and U+001F INFORMATION SEPARATOR ONE, or U+007F DELETE.\r\nfunction isNonPrintable(code) {\r\n return (\r\n (code >= 0x0000 && code <= 0x0008) ||\r\n (code === 0x000B) ||\r\n (code >= 0x000E && code <= 0x001F) ||\r\n (code === 0x007F)\r\n );\r\n}\r\n\r\n// newline\r\n// U+000A LINE FEED. Note that U+000D CARRIAGE RETURN and U+000C FORM FEED are not included in this definition,\r\n// as they are converted to U+000A LINE FEED during preprocessing.\r\n// TODO: we doesn't do a preprocessing, so check a code point for U+000D CARRIAGE RETURN and U+000C FORM FEED\r\nfunction isNewline(code) {\r\n return code === 0x000A || code === 0x000D || code === 0x000C;\r\n}\r\n\r\n// whitespace\r\n// A newline, U+0009 CHARACTER TABULATION, or U+0020 SPACE.\r\nfunction isWhiteSpace(code) {\r\n return isNewline(code) || code === 0x0020 || code === 0x0009;\r\n}\r\n\r\n// § 4.3.8. Check if two code points are a valid escape\r\nfunction isValidEscape(first, second) {\r\n // If the first code point is not U+005C REVERSE SOLIDUS (\\), return false.\r\n if (first !== 0x005C) {\r\n return false;\r\n }\r\n\r\n // Otherwise, if the second code point is a newline or EOF, return false.\r\n if (isNewline(second) || second === EOF) {\r\n return false;\r\n }\r\n\r\n // Otherwise, return true.\r\n return true;\r\n}\r\n\r\n// § 4.3.9. Check if three code points would start an identifier\r\nfunction isIdentifierStart(first, second, third) {\r\n // Look at the first code point:\r\n\r\n // U+002D HYPHEN-MINUS\r\n if (first === 0x002D) {\r\n // If the second code point is a name-start code point or a U+002D HYPHEN-MINUS,\r\n // or the second and third code points are a valid escape, return true. Otherwise, return false.\r\n return (\r\n isNameStart(second) ||\r\n second === 0x002D ||\r\n isValidEscape(second, third)\r\n );\r\n }\r\n\r\n // name-start code point\r\n if (isNameStart(first)) {\r\n // Return true.\r\n return true;\r\n }\r\n\r\n // U+005C REVERSE SOLIDUS (\\)\r\n if (first === 0x005C) {\r\n // If the first and second code points are a valid escape, return true. Otherwise, return false.\r\n return isValidEscape(first, second);\r\n }\r\n\r\n // anything else\r\n // Return false.\r\n return false;\r\n}\r\n\r\n// § 4.3.10. Check if three code points would start a number\r\nfunction isNumberStart(first, second, third) {\r\n // Look at the first code point:\r\n\r\n // U+002B PLUS SIGN (+)\r\n // U+002D HYPHEN-MINUS (-)\r\n if (first === 0x002B || first === 0x002D) {\r\n // If the second code point is a digit, return true.\r\n if (isDigit(second)) {\r\n return 2;\r\n }\r\n\r\n // Otherwise, if the second code point is a U+002E FULL STOP (.)\r\n // and the third code point is a digit, return true.\r\n // Otherwise, return false.\r\n return second === 0x002E && isDigit(third) ? 3 : 0;\r\n }\r\n\r\n // U+002E FULL STOP (.)\r\n if (first === 0x002E) {\r\n // If the second code point is a digit, return true. Otherwise, return false.\r\n return isDigit(second) ? 2 : 0;\r\n }\r\n\r\n // digit\r\n if (isDigit(first)) {\r\n // Return true.\r\n return 1;\r\n }\r\n\r\n // anything else\r\n // Return false.\r\n return 0;\r\n}\r\n\r\n//\r\n// Misc\r\n//\r\n\r\n// detect BOM (https://en.wikipedia.org/wiki/Byte_order_mark)\r\nfunction isBOM(code) {\r\n // UTF-16BE\r\n if (code === 0xFEFF) {\r\n return 1;\r\n }\r\n\r\n // UTF-16LE\r\n if (code === 0xFFFE) {\r\n return 1;\r\n }\r\n\r\n return 0;\r\n}\r\n\r\n// Fast code category\r\n//\r\n// https://drafts.csswg.org/css-syntax/#tokenizer-definitions\r\n// > non-ASCII code point\r\n// > A code point with a value equal to or greater than U+0080 \r\n// > name-start code point\r\n// > A letter, a non-ASCII code point, or U+005F LOW LINE (_).\r\n// > name code point\r\n// > A name-start code point, a digit, or U+002D HYPHEN-MINUS (-)\r\n// That means only ASCII code points has a special meaning and we define a maps for 0..127 codes only\r\nvar CATEGORY = new Array(0x80);\r\ncharCodeCategory.Eof = 0x80;\r\ncharCodeCategory.WhiteSpace = 0x82;\r\ncharCodeCategory.Digit = 0x83;\r\ncharCodeCategory.NameStart = 0x84;\r\ncharCodeCategory.NonPrintable = 0x85;\r\n\r\nfor (var i = 0; i < CATEGORY.length; i++) {\r\n switch (true) {\r\n case isWhiteSpace(i):\r\n CATEGORY[i] = charCodeCategory.WhiteSpace;\r\n break;\r\n\r\n case isDigit(i):\r\n CATEGORY[i] = charCodeCategory.Digit;\r\n break;\r\n\r\n case isNameStart(i):\r\n CATEGORY[i] = charCodeCategory.NameStart;\r\n break;\r\n\r\n case isNonPrintable(i):\r\n CATEGORY[i] = charCodeCategory.NonPrintable;\r\n break;\r\n\r\n default:\r\n CATEGORY[i] = i || charCodeCategory.Eof;\r\n }\r\n}\r\n\r\nfunction charCodeCategory(code) {\r\n return code < 0x80 ? CATEGORY[code] : charCodeCategory.NameStart;\r\n};\r\n\r\nmodule.exports = {\r\n isDigit: isDigit,\r\n isHexDigit: isHexDigit,\r\n isUppercaseLetter: isUppercaseLetter,\r\n isLowercaseLetter: isLowercaseLetter,\r\n isLetter: isLetter,\r\n isNonAscii: isNonAscii,\r\n isNameStart: isNameStart,\r\n isName: isName,\r\n isNonPrintable: isNonPrintable,\r\n isNewline: isNewline,\r\n isWhiteSpace: isWhiteSpace,\r\n isValidEscape: isValidEscape,\r\n isIdentifierStart: isIdentifierStart,\r\n isNumberStart: isNumberStart,\r\n\r\n isBOM: isBOM,\r\n charCodeCategory: charCodeCategory\r\n};\r\n","var charCodeDef = require('./char-code-definitions');\r\nvar isDigit = charCodeDef.isDigit;\r\nvar isHexDigit = charCodeDef.isHexDigit;\r\nvar isUppercaseLetter = charCodeDef.isUppercaseLetter;\r\nvar isName = charCodeDef.isName;\r\nvar isWhiteSpace = charCodeDef.isWhiteSpace;\r\nvar isValidEscape = charCodeDef.isValidEscape;\r\n\r\nfunction getCharCode(source, offset) {\r\n return offset < source.length ? source.charCodeAt(offset) : 0;\r\n}\r\n\r\nfunction getNewlineLength(source, offset, code) {\r\n if (code === 13 /* \\r */ && getCharCode(source, offset + 1) === 10 /* \\n */) {\r\n return 2;\r\n }\r\n\r\n return 1;\r\n}\r\n\r\nfunction cmpChar(testStr, offset, referenceCode) {\r\n var code = testStr.charCodeAt(offset);\r\n\r\n // code.toLowerCase() for A..Z\r\n if (isUppercaseLetter(code)) {\r\n code = code | 32;\r\n }\r\n\r\n return code === referenceCode;\r\n}\r\n\r\nfunction cmpStr(testStr, start, end, referenceStr) {\r\n if (end - start !== referenceStr.length) {\r\n return false;\r\n }\r\n\r\n if (start < 0 || end > testStr.length) {\r\n return false;\r\n }\r\n\r\n for (var i = start; i < end; i++) {\r\n var testCode = testStr.charCodeAt(i);\r\n var referenceCode = referenceStr.charCodeAt(i - start);\r\n\r\n // testCode.toLowerCase() for A..Z\r\n if (isUppercaseLetter(testCode)) {\r\n testCode = testCode | 32;\r\n }\r\n\r\n if (testCode !== referenceCode) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}\r\n\r\nfunction findWhiteSpaceStart(source, offset) {\r\n for (; offset >= 0; offset--) {\r\n if (!isWhiteSpace(source.charCodeAt(offset))) {\r\n break;\r\n }\r\n }\r\n\r\n return offset + 1;\r\n}\r\n\r\nfunction findWhiteSpaceEnd(source, offset) {\r\n for (; offset < source.length; offset++) {\r\n if (!isWhiteSpace(source.charCodeAt(offset))) {\r\n break;\r\n }\r\n }\r\n\r\n return offset;\r\n}\r\n\r\nfunction findDecimalNumberEnd(source, offset) {\r\n for (; offset < source.length; offset++) {\r\n if (!isDigit(source.charCodeAt(offset))) {\r\n break;\r\n }\r\n }\r\n\r\n return offset;\r\n}\r\n\r\n// § 4.3.7. Consume an escaped code point\r\nfunction consumeEscaped(source, offset) {\r\n // It assumes that the U+005C REVERSE SOLIDUS (\\) has already been consumed and\r\n // that the next input code point has already been verified to be part of a valid escape.\r\n offset += 2;\r\n\r\n // hex digit\r\n if (isHexDigit(getCharCode(source, offset - 1))) {\r\n // Consume as many hex digits as possible, but no more than 5.\r\n // Note that this means 1-6 hex digits have been consumed in total.\r\n for (var maxOffset = Math.min(source.length, offset + 5); offset < maxOffset; offset++) {\r\n if (!isHexDigit(getCharCode(source, offset))) {\r\n break;\r\n }\r\n }\r\n\r\n // If the next input code point is whitespace, consume it as well.\r\n var code = getCharCode(source, offset);\r\n if (isWhiteSpace(code)) {\r\n offset += getNewlineLength(source, offset, code);\r\n }\r\n }\r\n\r\n return offset;\r\n}\r\n\r\n// §4.3.11. Consume a name\r\n// Note: This algorithm does not do the verification of the first few code points that are necessary\r\n// to ensure the returned code points would constitute an . If that is the intended use,\r\n// ensure that the stream starts with an identifier before calling this algorithm.\r\nfunction consumeName(source, offset) {\r\n // Let result initially be an empty string.\r\n // Repeatedly consume the next input code point from the stream:\r\n for (; offset < source.length; offset++) {\r\n var code = source.charCodeAt(offset);\r\n\r\n // name code point\r\n if (isName(code)) {\r\n // Append the code point to result.\r\n continue;\r\n }\r\n\r\n // the stream starts with a valid escape\r\n if (isValidEscape(code, getCharCode(source, offset + 1))) {\r\n // Consume an escaped code point. Append the returned code point to result.\r\n offset = consumeEscaped(source, offset) - 1;\r\n continue;\r\n }\r\n\r\n // anything else\r\n // Reconsume the current input code point. Return result.\r\n break;\r\n }\r\n\r\n return offset;\r\n}\r\n\r\n// §4.3.12. Consume a number\r\nfunction consumeNumber(source, offset) {\r\n var code = source.charCodeAt(offset);\r\n\r\n // 2. If the next input code point is U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-),\r\n // consume it and append it to repr.\r\n if (code === 0x002B || code === 0x002D) {\r\n code = source.charCodeAt(offset += 1);\r\n }\r\n\r\n // 3. While the next input code point is a digit, consume it and append it to repr.\r\n if (isDigit(code)) {\r\n offset = findDecimalNumberEnd(source, offset + 1);\r\n code = source.charCodeAt(offset);\r\n }\r\n\r\n // 4. If the next 2 input code points are U+002E FULL STOP (.) followed by a digit, then:\r\n if (code === 0x002E && isDigit(source.charCodeAt(offset + 1))) {\r\n // 4.1 Consume them.\r\n // 4.2 Append them to repr.\r\n code = source.charCodeAt(offset += 2);\r\n\r\n // 4.3 Set type to \"number\".\r\n // TODO\r\n\r\n // 4.4 While the next input code point is a digit, consume it and append it to repr.\r\n\r\n offset = findDecimalNumberEnd(source, offset);\r\n }\r\n\r\n // 5. If the next 2 or 3 input code points are U+0045 LATIN CAPITAL LETTER E (E)\r\n // or U+0065 LATIN SMALL LETTER E (e), ... , followed by a digit, then:\r\n if (cmpChar(source, offset, 101 /* e */)) {\r\n var sign = 0;\r\n code = source.charCodeAt(offset + 1);\r\n\r\n // ... optionally followed by U+002D HYPHEN-MINUS (-) or U+002B PLUS SIGN (+) ...\r\n if (code === 0x002D || code === 0x002B) {\r\n sign = 1;\r\n code = source.charCodeAt(offset + 2);\r\n }\r\n\r\n // ... followed by a digit\r\n if (isDigit(code)) {\r\n // 5.1 Consume them.\r\n // 5.2 Append them to repr.\r\n\r\n // 5.3 Set type to \"number\".\r\n // TODO\r\n\r\n // 5.4 While the next input code point is a digit, consume it and append it to repr.\r\n offset = findDecimalNumberEnd(source, offset + 1 + sign + 1);\r\n }\r\n }\r\n\r\n return offset;\r\n}\r\n\r\n// § 4.3.14. Consume the remnants of a bad url\r\n// ... its sole use is to consume enough of the input stream to reach a recovery point\r\n// where normal tokenizing can resume.\r\nfunction consumeBadUrlRemnants(source, offset) {\r\n // Repeatedly consume the next input code point from the stream:\r\n for (; offset < source.length; offset++) {\r\n var code = source.charCodeAt(offset);\r\n\r\n // U+0029 RIGHT PARENTHESIS ())\r\n // EOF\r\n if (code === 0x0029) {\r\n // Return.\r\n offset++;\r\n break;\r\n }\r\n\r\n if (isValidEscape(code, getCharCode(source, offset + 1))) {\r\n // Consume an escaped code point.\r\n // Note: This allows an escaped right parenthesis (\"\\)\") to be encountered\r\n // without ending the . This is otherwise identical to\r\n // the \"anything else\" clause.\r\n offset = consumeEscaped(source, offset);\r\n }\r\n }\r\n\r\n return offset;\r\n}\r\n\r\nmodule.exports = {\r\n consumeEscaped: consumeEscaped,\r\n consumeName: consumeName,\r\n consumeNumber: consumeNumber,\r\n consumeBadUrlRemnants: consumeBadUrlRemnants,\r\n\r\n cmpChar: cmpChar,\r\n cmpStr: cmpStr,\r\n\r\n getNewlineLength: getNewlineLength,\r\n findWhiteSpaceStart: findWhiteSpaceStart,\r\n findWhiteSpaceEnd: findWhiteSpaceEnd\r\n};\r\n","var constants = require('../tokenizer/const');\r\nvar TYPE = constants.TYPE;\r\nvar NAME = constants.NAME;\r\n\r\nvar utils = require('../tokenizer/utils');\r\nvar cmpStr = utils.cmpStr;\r\n\r\nvar EOF = TYPE.EOF;\r\nvar WHITESPACE = TYPE.WhiteSpace;\r\nvar COMMENT = TYPE.Comment;\r\n\r\nvar OFFSET_MASK = 0x00FFFFFF;\r\nvar TYPE_SHIFT = 24;\r\n\r\nvar TokenStream = function() {\r\n this.offsetAndType = null;\r\n this.balance = null;\r\n\r\n this.reset();\r\n};\r\n\r\nTokenStream.prototype = {\r\n reset: function() {\r\n this.eof = false;\r\n this.tokenIndex = -1;\r\n this.tokenType = 0;\r\n this.tokenStart = this.firstCharOffset;\r\n this.tokenEnd = this.firstCharOffset;\r\n },\r\n\r\n lookupType: function(offset) {\r\n offset += this.tokenIndex;\r\n\r\n if (offset < this.tokenCount) {\r\n return this.offsetAndType[offset] >> TYPE_SHIFT;\r\n }\r\n\r\n return EOF;\r\n },\r\n lookupOffset: function(offset) {\r\n offset += this.tokenIndex;\r\n\r\n if (offset < this.tokenCount) {\r\n return this.offsetAndType[offset - 1] & OFFSET_MASK;\r\n }\r\n\r\n return this.source.length;\r\n },\r\n lookupValue: function(offset, referenceStr) {\r\n offset += this.tokenIndex;\r\n\r\n if (offset < this.tokenCount) {\r\n return cmpStr(\r\n this.source,\r\n this.offsetAndType[offset - 1] & OFFSET_MASK,\r\n this.offsetAndType[offset] & OFFSET_MASK,\r\n referenceStr\r\n );\r\n }\r\n\r\n return false;\r\n },\r\n getTokenStart: function(tokenIndex) {\r\n if (tokenIndex === this.tokenIndex) {\r\n return this.tokenStart;\r\n }\r\n\r\n if (tokenIndex > 0) {\r\n return tokenIndex < this.tokenCount\r\n ? this.offsetAndType[tokenIndex - 1] & OFFSET_MASK\r\n : this.offsetAndType[this.tokenCount] & OFFSET_MASK;\r\n }\r\n\r\n return this.firstCharOffset;\r\n },\r\n\r\n // TODO: -> skipUntilBalanced\r\n getRawLength: function(startToken, mode) {\r\n var cursor = startToken;\r\n var balanceEnd;\r\n var offset = this.offsetAndType[Math.max(cursor - 1, 0)] & OFFSET_MASK;\r\n var type;\r\n\r\n loop:\r\n for (; cursor < this.tokenCount; cursor++) {\r\n balanceEnd = this.balance[cursor];\r\n\r\n // stop scanning on balance edge that points to offset before start token\r\n if (balanceEnd < startToken) {\r\n break loop;\r\n }\r\n\r\n type = this.offsetAndType[cursor] >> TYPE_SHIFT;\r\n\r\n // check token is stop type\r\n switch (mode(type, this.source, offset)) {\r\n case 1:\r\n break loop;\r\n\r\n case 2:\r\n cursor++;\r\n break loop;\r\n\r\n default:\r\n offset = this.offsetAndType[cursor] & OFFSET_MASK;\r\n\r\n // fast forward to the end of balanced block\r\n if (this.balance[balanceEnd] === cursor) {\r\n cursor = balanceEnd;\r\n }\r\n }\r\n }\r\n\r\n return cursor - this.tokenIndex;\r\n },\r\n isBalanceEdge: function(pos) {\r\n return this.balance[this.tokenIndex] < pos;\r\n },\r\n isDelim: function(code, offset) {\r\n if (offset) {\r\n return (\r\n this.lookupType(offset) === TYPE.Delim &&\r\n this.source.charCodeAt(this.lookupOffset(offset)) === code\r\n );\r\n }\r\n\r\n return (\r\n this.tokenType === TYPE.Delim &&\r\n this.source.charCodeAt(this.tokenStart) === code\r\n );\r\n },\r\n\r\n getTokenValue: function() {\r\n return this.source.substring(this.tokenStart, this.tokenEnd);\r\n },\r\n getTokenLength: function() {\r\n return this.tokenEnd - this.tokenStart;\r\n },\r\n substrToCursor: function(start) {\r\n return this.source.substring(start, this.tokenStart);\r\n },\r\n\r\n skipWS: function() {\r\n for (var i = this.tokenIndex, skipTokenCount = 0; i < this.tokenCount; i++, skipTokenCount++) {\r\n if ((this.offsetAndType[i] >> TYPE_SHIFT) !== WHITESPACE) {\r\n break;\r\n }\r\n }\r\n\r\n if (skipTokenCount > 0) {\r\n this.skip(skipTokenCount);\r\n }\r\n },\r\n skipSC: function() {\r\n while (this.tokenType === WHITESPACE || this.tokenType === COMMENT) {\r\n this.next();\r\n }\r\n },\r\n skip: function(tokenCount) {\r\n var next = this.tokenIndex + tokenCount;\r\n\r\n if (next < this.tokenCount) {\r\n this.tokenIndex = next;\r\n this.tokenStart = this.offsetAndType[next - 1] & OFFSET_MASK;\r\n next = this.offsetAndType[next];\r\n this.tokenType = next >> TYPE_SHIFT;\r\n this.tokenEnd = next & OFFSET_MASK;\r\n } else {\r\n this.tokenIndex = this.tokenCount;\r\n this.next();\r\n }\r\n },\r\n next: function() {\r\n var next = this.tokenIndex + 1;\r\n\r\n if (next < this.tokenCount) {\r\n this.tokenIndex = next;\r\n this.tokenStart = this.tokenEnd;\r\n next = this.offsetAndType[next];\r\n this.tokenType = next >> TYPE_SHIFT;\r\n this.tokenEnd = next & OFFSET_MASK;\r\n } else {\r\n this.tokenIndex = this.tokenCount;\r\n this.eof = true;\r\n this.tokenType = EOF;\r\n this.tokenStart = this.tokenEnd = this.source.length;\r\n }\r\n },\r\n\r\n dump: function() {\r\n var offset = this.firstCharOffset;\r\n\r\n return Array.prototype.slice.call(this.offsetAndType, 0, this.tokenCount).map(function(item, idx) {\r\n var start = offset;\r\n var end = item & OFFSET_MASK;\r\n\r\n offset = end;\r\n\r\n return {\r\n idx: idx,\r\n type: NAME[item >> TYPE_SHIFT],\r\n chunk: this.source.substring(start, end),\r\n balance: this.balance[idx]\r\n };\r\n }, this);\r\n }\r\n};\r\n\r\nmodule.exports = TokenStream;\r\n","function noop(value) {\n return value\n}\n\nfunction generateMultiplier(multiplier) {\n if (multiplier.min === 0 && multiplier.max === 0) {\n return '*'\n }\n\n if (multiplier.min === 0 && multiplier.max === 1) {\n return '?'\n }\n\n if (multiplier.min === 1 && multiplier.max === 0) {\n return multiplier.comma ? '#' : '+'\n }\n\n if (multiplier.min === 1 && multiplier.max === 1) {\n return ''\n }\n\n return (multiplier.comma ? '#' : '') + (multiplier.min === multiplier.max ? '{' + multiplier.min + '}' : '{' + multiplier.min + ',' + (multiplier.max !== 0 ? multiplier.max : '') + '}')\n}\n\nfunction generateTypeOpts(node) {\n switch (node.type) {\n case 'Range':\n return ' [' + (node.min === null ? '-∞' : node.min) + ',' + (node.max === null ? '∞' : node.max) + ']'\n\n default:\n throw new Error('Unknown node type `' + node.type + '`')\n }\n}\n\nfunction generateSequence(node, decorate, forceBraces, compact) {\n var combinator = node.combinator === ' ' || compact ? node.combinator : ' ' + node.combinator + ' '\n var result = node.terms\n .map(function (term) {\n return generate(term, decorate, forceBraces, compact)\n })\n .join(combinator)\n\n if (node.explicit || forceBraces) {\n result = (compact || result[0] === ',' ? '[' : '[ ') + result + (compact ? ']' : ' ]')\n }\n\n return result\n}\n\nfunction generate(node, decorate, forceBraces, compact) {\n var result\n\n switch (node.type) {\n case 'Group':\n result = generateSequence(node, decorate, forceBraces, compact) + (node.disallowEmpty ? '!' : '')\n break\n\n case 'Multiplier':\n // return since node is a composition\n return generate(node.term, decorate, forceBraces, compact) + decorate(generateMultiplier(node), node)\n\n case 'Type':\n result = '<' + node.name + (node.opts ? decorate(generateTypeOpts(node.opts), node.opts) : '') + '>'\n break\n\n case 'Property':\n result = \"<'\" + node.name + \"'>\"\n break\n\n case 'Keyword':\n result = node.name\n break\n\n case 'AtKeyword':\n result = '@' + node.name\n break\n\n case 'Function':\n result = node.name + '('\n break\n\n case 'String':\n case 'Token':\n result = node.value\n break\n\n case 'Comma':\n result = ','\n break\n\n default:\n throw new Error('Unknown node type `' + node.type + '`')\n }\n\n return decorate(result, node)\n}\n\nmodule.exports = function (node, options) {\n var decorate = noop\n var forceBraces = false\n var compact = false\n\n if (typeof options === 'function') {\n decorate = options\n } else if (options) {\n forceBraces = Boolean(options.forceBraces)\n compact = Boolean(options.compact)\n if (typeof options.decorate === 'function') {\n decorate = options.decorate\n }\n }\n\n return generate(node, decorate, forceBraces, compact)\n}\n","var createCustomError = require('../utils/createCustomError');\r\nvar generate = require('../definition-syntax/generate');\r\n\r\nfunction fromMatchResult(matchResult) {\r\n var tokens = matchResult.tokens;\r\n var longestMatch = matchResult.longestMatch;\r\n var node = longestMatch < tokens.length ? tokens[longestMatch].node : null;\r\n var mismatchOffset = -1;\r\n var entries = 0;\r\n var css = '';\r\n\r\n for (var i = 0; i < tokens.length; i++) {\r\n if (i === longestMatch) {\r\n mismatchOffset = css.length;\r\n }\r\n\r\n if (node !== null && tokens[i].node === node) {\r\n if (i <= longestMatch) {\r\n entries++;\r\n } else {\r\n entries = 0;\r\n }\r\n }\r\n\r\n css += tokens[i].value;\r\n }\r\n\r\n return {\r\n node: node,\r\n css: css,\r\n mismatchOffset: mismatchOffset === -1 ? css.length : mismatchOffset,\r\n last: node === null || entries > 1\r\n };\r\n}\r\n\r\nfunction getLocation(node, point) {\r\n var loc = node && node.loc && node.loc[point];\r\n\r\n if (loc) {\r\n return {\r\n offset: loc.offset,\r\n line: loc.line,\r\n column: loc.column\r\n };\r\n }\r\n\r\n return null;\r\n}\r\n\r\nvar SyntaxReferenceError = function(type, referenceName) {\r\n var error = createCustomError(\r\n 'SyntaxReferenceError',\r\n type + (referenceName ? ' `' + referenceName + '`' : '')\r\n );\r\n\r\n error.reference = referenceName;\r\n\r\n return error;\r\n};\r\n\r\nvar MatchError = function(message, syntax, node, matchResult) {\r\n var error = createCustomError('SyntaxMatchError', message);\r\n var details = fromMatchResult(matchResult);\r\n var mismatchOffset = details.mismatchOffset || 0;\r\n var badNode = details.node || node;\r\n var end = getLocation(badNode, 'end');\r\n var start = details.last ? end : getLocation(badNode, 'start');\r\n var css = details.css;\r\n\r\n error.rawMessage = message;\r\n error.syntax = syntax ? generate(syntax) : '';\r\n error.css = css;\r\n error.mismatchOffset = mismatchOffset;\r\n error.loc = {\r\n source: (badNode && badNode.loc && badNode.loc.source) || '',\r\n start: start,\r\n end: end\r\n };\r\n error.line = start ? start.line : undefined;\r\n error.column = start ? start.column : undefined;\r\n error.offset = start ? start.offset : undefined;\r\n error.message = message + '\\n' +\r\n ' syntax: ' + error.syntax + '\\n' +\r\n ' value: ' + (error.css || '') + '\\n' +\r\n ' --------' + new Array(error.mismatchOffset + 1).join('-') + '^';\r\n\r\n return error;\r\n};\r\n\r\nmodule.exports = {\r\n SyntaxReferenceError: SyntaxReferenceError,\r\n MatchError: MatchError\r\n};\r\n","var hasOwnProperty = Object.prototype.hasOwnProperty;\r\nvar keywords = Object.create(null);\r\nvar properties = Object.create(null);\r\nvar HYPHENMINUS = 45; // '-'.charCodeAt()\r\n\r\nfunction isCustomProperty(str, offset) {\r\n offset = offset || 0;\r\n\r\n return str.length - offset >= 2 &&\r\n str.charCodeAt(offset) === HYPHENMINUS &&\r\n str.charCodeAt(offset + 1) === HYPHENMINUS;\r\n}\r\n\r\nfunction getVendorPrefix(str, offset) {\r\n offset = offset || 0;\r\n\r\n // verdor prefix should be at least 3 chars length\r\n if (str.length - offset >= 3) {\r\n // vendor prefix starts with hyper minus following non-hyper minus\r\n if (str.charCodeAt(offset) === HYPHENMINUS &&\r\n str.charCodeAt(offset + 1) !== HYPHENMINUS) {\r\n // vendor prefix should contain a hyper minus at the ending\r\n var secondDashIndex = str.indexOf('-', offset + 2);\r\n\r\n if (secondDashIndex !== -1) {\r\n return str.substring(offset, secondDashIndex + 1);\r\n }\r\n }\r\n }\r\n\r\n return '';\r\n}\r\n\r\nfunction getKeywordDescriptor(keyword) {\r\n if (hasOwnProperty.call(keywords, keyword)) {\r\n return keywords[keyword];\r\n }\r\n\r\n var name = keyword.toLowerCase();\r\n\r\n if (hasOwnProperty.call(keywords, name)) {\r\n return keywords[keyword] = keywords[name];\r\n }\r\n\r\n var custom = isCustomProperty(name, 0);\r\n var vendor = !custom ? getVendorPrefix(name, 0) : '';\r\n\r\n return keywords[keyword] = Object.freeze({\r\n basename: name.substr(vendor.length),\r\n name: name,\r\n vendor: vendor,\r\n prefix: vendor,\r\n custom: custom\r\n });\r\n}\r\n\r\nfunction getPropertyDescriptor(property) {\r\n if (hasOwnProperty.call(properties, property)) {\r\n return properties[property];\r\n }\r\n\r\n var name = property;\r\n var hack = property[0];\r\n\r\n if (hack === '/') {\r\n hack = property[1] === '/' ? '//' : '/';\r\n } else if (hack !== '_' &&\r\n hack !== '*' &&\r\n hack !== '$' &&\r\n hack !== '#' &&\r\n hack !== '+' &&\r\n hack !== '&') {\r\n hack = '';\r\n }\r\n\r\n var custom = isCustomProperty(name, hack.length);\r\n\r\n // re-use result when possible (the same as for lower case)\r\n if (!custom) {\r\n name = name.toLowerCase();\r\n if (hasOwnProperty.call(properties, name)) {\r\n return properties[property] = properties[name];\r\n }\r\n }\r\n\r\n var vendor = !custom ? getVendorPrefix(name, hack.length) : '';\r\n var prefix = name.substr(0, hack.length + vendor.length);\r\n\r\n return properties[property] = Object.freeze({\r\n basename: name.substr(prefix.length),\r\n name: name.substr(hack.length),\r\n hack: hack,\r\n vendor: vendor,\r\n prefix: prefix,\r\n custom: custom\r\n });\r\n}\r\n\r\nmodule.exports = {\r\n keyword: getKeywordDescriptor,\r\n property: getPropertyDescriptor,\r\n isCustomProperty: isCustomProperty,\r\n vendorPrefix: getVendorPrefix\r\n};\r\n","var MIN_SIZE = 16 * 1024;\r\nvar SafeUint32Array = typeof Uint32Array !== 'undefined' ? Uint32Array : Array; // fallback on Array when TypedArray is not supported\r\n\r\nmodule.exports = function adoptBuffer(buffer, size) {\r\n if (buffer === null || buffer.length < size) {\r\n return new SafeUint32Array(Math.max(size + 1024, MIN_SIZE));\r\n }\r\n\r\n return buffer;\r\n};\r\n","var TokenStream = require('../common/TokenStream');\r\nvar adoptBuffer = require('../common/adopt-buffer');\r\n\r\nvar constants = require('./const');\r\nvar TYPE = constants.TYPE;\r\n\r\nvar charCodeDefinitions = require('./char-code-definitions');\r\nvar isNewline = charCodeDefinitions.isNewline;\r\nvar isName = charCodeDefinitions.isName;\r\nvar isValidEscape = charCodeDefinitions.isValidEscape;\r\nvar isNumberStart = charCodeDefinitions.isNumberStart;\r\nvar isIdentifierStart = charCodeDefinitions.isIdentifierStart;\r\nvar charCodeCategory = charCodeDefinitions.charCodeCategory;\r\nvar isBOM = charCodeDefinitions.isBOM;\r\n\r\nvar utils = require('./utils');\r\nvar cmpStr = utils.cmpStr;\r\nvar getNewlineLength = utils.getNewlineLength;\r\nvar findWhiteSpaceEnd = utils.findWhiteSpaceEnd;\r\nvar consumeEscaped = utils.consumeEscaped;\r\nvar consumeName = utils.consumeName;\r\nvar consumeNumber = utils.consumeNumber;\r\nvar consumeBadUrlRemnants = utils.consumeBadUrlRemnants;\r\n\r\nvar OFFSET_MASK = 0x00FFFFFF;\r\nvar TYPE_SHIFT = 24;\r\n\r\nfunction tokenize(source, stream) {\r\n function getCharCode(offset) {\r\n return offset < sourceLength ? source.charCodeAt(offset) : 0;\r\n }\r\n\r\n // § 4.3.3. Consume a numeric token\r\n function consumeNumericToken() {\r\n // Consume a number and let number be the result.\r\n offset = consumeNumber(source, offset);\r\n\r\n // If the next 3 input code points would start an identifier, then:\r\n if (isIdentifierStart(getCharCode(offset), getCharCode(offset + 1), getCharCode(offset + 2))) {\r\n // Create a with the same value and type flag as number, and a unit set initially to the empty string.\r\n // Consume a name. Set the ’s unit to the returned value.\r\n // Return the .\r\n type = TYPE.Dimension;\r\n offset = consumeName(source, offset);\r\n return;\r\n }\r\n\r\n // Otherwise, if the next input code point is U+0025 PERCENTAGE SIGN (%), consume it.\r\n if (getCharCode(offset) === 0x0025) {\r\n // Create a with the same value as number, and return it.\r\n type = TYPE.Percentage;\r\n offset++;\r\n return;\r\n }\r\n\r\n // Otherwise, create a with the same value and type flag as number, and return it.\r\n type = TYPE.Number;\r\n }\r\n\r\n // § 4.3.4. Consume an ident-like token\r\n function consumeIdentLikeToken() {\r\n const nameStartOffset = offset;\r\n\r\n // Consume a name, and let string be the result.\r\n offset = consumeName(source, offset);\r\n\r\n // If string’s value is an ASCII case-insensitive match for \"url\",\r\n // and the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.\r\n if (cmpStr(source, nameStartOffset, offset, 'url') && getCharCode(offset) === 0x0028) {\r\n // While the next two input code points are whitespace, consume the next input code point.\r\n offset = findWhiteSpaceEnd(source, offset + 1);\r\n\r\n // If the next one or two input code points are U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('),\r\n // or whitespace followed by U+0022 QUOTATION MARK (\") or U+0027 APOSTROPHE ('),\r\n // then create a with its value set to string and return it.\r\n if (getCharCode(offset) === 0x0022 ||\r\n getCharCode(offset) === 0x0027) {\r\n type = TYPE.Function;\r\n offset = nameStartOffset + 4;\r\n return;\r\n }\r\n\r\n // Otherwise, consume a url token, and return it.\r\n consumeUrlToken();\r\n return;\r\n }\r\n\r\n // Otherwise, if the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.\r\n // Create a with its value set to string and return it.\r\n if (getCharCode(offset) === 0x0028) {\r\n type = TYPE.Function;\r\n offset++;\r\n return;\r\n }\r\n\r\n // Otherwise, create an with its value set to string and return it.\r\n type = TYPE.Ident;\r\n }\r\n\r\n // § 4.3.5. Consume a string token\r\n function consumeStringToken(endingCodePoint) {\r\n // This algorithm may be called with an ending code point, which denotes the code point\r\n // that ends the string. If an ending code point is not specified,\r\n // the current input code point is used.\r\n if (!endingCodePoint) {\r\n endingCodePoint = getCharCode(offset++);\r\n }\r\n\r\n // Initially create a with its value set to the empty string.\r\n type = TYPE.String;\r\n\r\n // Repeatedly consume the next input code point from the stream:\r\n for (; offset < source.length; offset++) {\r\n var code = source.charCodeAt(offset);\r\n\r\n switch (charCodeCategory(code)) {\r\n // ending code point\r\n case endingCodePoint:\r\n // Return the .\r\n offset++;\r\n return;\r\n\r\n // EOF\r\n case charCodeCategory.Eof:\r\n // This is a parse error. Return the .\r\n return;\r\n\r\n // newline\r\n case charCodeCategory.WhiteSpace:\r\n if (isNewline(code)) {\r\n // This is a parse error. Reconsume the current input code point,\r\n // create a , and return it.\r\n offset += getNewlineLength(source, offset, code);\r\n type = TYPE.BadString;\r\n return;\r\n }\r\n break;\r\n\r\n // U+005C REVERSE SOLIDUS (\\)\r\n case 0x005C:\r\n // If the next input code point is EOF, do nothing.\r\n if (offset === source.length - 1) {\r\n break;\r\n }\r\n\r\n var nextCode = getCharCode(offset + 1);\r\n\r\n // Otherwise, if the next input code point is a newline, consume it.\r\n if (isNewline(nextCode)) {\r\n offset += getNewlineLength(source, offset + 1, nextCode);\r\n } else if (isValidEscape(code, nextCode)) {\r\n // Otherwise, (the stream starts with a valid escape) consume\r\n // an escaped code point and append the returned code point to\r\n // the ’s value.\r\n offset = consumeEscaped(source, offset) - 1;\r\n }\r\n break;\r\n\r\n // anything else\r\n // Append the current input code point to the ’s value.\r\n }\r\n }\r\n }\r\n\r\n // § 4.3.6. Consume a url token\r\n // Note: This algorithm assumes that the initial \"url(\" has already been consumed.\r\n // This algorithm also assumes that it’s being called to consume an \"unquoted\" value, like url(foo).\r\n // A quoted value, like url(\"foo\"), is parsed as a . Consume an ident-like token\r\n // automatically handles this distinction; this algorithm shouldn’t be called directly otherwise.\r\n function consumeUrlToken() {\r\n // Initially create a with its value set to the empty string.\r\n type = TYPE.Url;\r\n\r\n // Consume as much whitespace as possible.\r\n offset = findWhiteSpaceEnd(source, offset);\r\n\r\n // Repeatedly consume the next input code point from the stream:\r\n for (; offset < source.length; offset++) {\r\n var code = source.charCodeAt(offset);\r\n\r\n switch (charCodeCategory(code)) {\r\n // U+0029 RIGHT PARENTHESIS ())\r\n case 0x0029:\r\n // Return the .\r\n offset++;\r\n return;\r\n\r\n // EOF\r\n case charCodeCategory.Eof:\r\n // This is a parse error. Return the .\r\n return;\r\n\r\n // whitespace\r\n case charCodeCategory.WhiteSpace:\r\n // Consume as much whitespace as possible.\r\n offset = findWhiteSpaceEnd(source, offset);\r\n\r\n // If the next input code point is U+0029 RIGHT PARENTHESIS ()) or EOF,\r\n // consume it and return the \r\n // (if EOF was encountered, this is a parse error);\r\n if (getCharCode(offset) === 0x0029 || offset >= source.length) {\r\n if (offset < source.length) {\r\n offset++;\r\n }\r\n return;\r\n }\r\n\r\n // otherwise, consume the remnants of a bad url, create a ,\r\n // and return it.\r\n offset = consumeBadUrlRemnants(source, offset);\r\n type = TYPE.BadUrl;\r\n return;\r\n\r\n // U+0022 QUOTATION MARK (\")\r\n // U+0027 APOSTROPHE (')\r\n // U+0028 LEFT PARENTHESIS (()\r\n // non-printable code point\r\n case 0x0022:\r\n case 0x0027:\r\n case 0x0028:\r\n case charCodeCategory.NonPrintable:\r\n // This is a parse error. Consume the remnants of a bad url,\r\n // create a , and return it.\r\n offset = consumeBadUrlRemnants(source, offset);\r\n type = TYPE.BadUrl;\r\n return;\r\n\r\n // U+005C REVERSE SOLIDUS (\\)\r\n case 0x005C:\r\n // If the stream starts with a valid escape, consume an escaped code point and\r\n // append the returned code point to the ’s value.\r\n if (isValidEscape(code, getCharCode(offset + 1))) {\r\n offset = consumeEscaped(source, offset) - 1;\r\n break;\r\n }\r\n\r\n // Otherwise, this is a parse error. Consume the remnants of a bad url,\r\n // create a , and return it.\r\n offset = consumeBadUrlRemnants(source, offset);\r\n type = TYPE.BadUrl;\r\n return;\r\n\r\n // anything else\r\n // Append the current input code point to the ’s value.\r\n }\r\n }\r\n }\r\n\r\n if (!stream) {\r\n stream = new TokenStream();\r\n }\r\n\r\n // ensure source is a string\r\n source = String(source || '');\r\n\r\n var sourceLength = source.length;\r\n var offsetAndType = adoptBuffer(stream.offsetAndType, sourceLength + 1); // +1 because of eof-token\r\n var balance = adoptBuffer(stream.balance, sourceLength + 1);\r\n var tokenCount = 0;\r\n var start = isBOM(getCharCode(0));\r\n var offset = start;\r\n var balanceCloseType = 0;\r\n var balanceStart = 0;\r\n var balancePrev = 0;\r\n\r\n // https://drafts.csswg.org/css-syntax-3/#consume-token\r\n // § 4.3.1. Consume a token\r\n while (offset < sourceLength) {\r\n var code = source.charCodeAt(offset);\r\n var type = 0;\r\n\r\n balance[tokenCount] = sourceLength;\r\n\r\n switch (charCodeCategory(code)) {\r\n // whitespace\r\n case charCodeCategory.WhiteSpace:\r\n // Consume as much whitespace as possible. Return a .\r\n type = TYPE.WhiteSpace;\r\n offset = findWhiteSpaceEnd(source, offset + 1);\r\n break;\r\n\r\n // U+0022 QUOTATION MARK (\")\r\n case 0x0022:\r\n // Consume a string token and return it.\r\n consumeStringToken();\r\n break;\r\n\r\n // U+0023 NUMBER SIGN (#)\r\n case 0x0023:\r\n // If the next input code point is a name code point or the next two input code points are a valid escape, then:\r\n if (isName(getCharCode(offset + 1)) || isValidEscape(getCharCode(offset + 1), getCharCode(offset + 2))) {\r\n // Create a .\r\n type = TYPE.Hash;\r\n\r\n // If the next 3 input code points would start an identifier, set the ’s type flag to \"id\".\r\n // if (isIdentifierStart(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {\r\n // // TODO: set id flag\r\n // }\r\n\r\n // Consume a name, and set the ’s value to the returned string.\r\n offset = consumeName(source, offset + 1);\r\n\r\n // Return the .\r\n } else {\r\n // Otherwise, return a with its value set to the current input code point.\r\n type = TYPE.Delim;\r\n offset++;\r\n }\r\n\r\n break;\r\n\r\n // U+0027 APOSTROPHE (')\r\n case 0x0027:\r\n // Consume a string token and return it.\r\n consumeStringToken();\r\n break;\r\n\r\n // U+0028 LEFT PARENTHESIS (()\r\n case 0x0028:\r\n // Return a <(-token>.\r\n type = TYPE.LeftParenthesis;\r\n offset++;\r\n break;\r\n\r\n // U+0029 RIGHT PARENTHESIS ())\r\n case 0x0029:\r\n // Return a <)-token>.\r\n type = TYPE.RightParenthesis;\r\n offset++;\r\n break;\r\n\r\n // U+002B PLUS SIGN (+)\r\n case 0x002B:\r\n // If the input stream starts with a number, ...\r\n if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {\r\n // ... reconsume the current input code point, consume a numeric token, and return it.\r\n consumeNumericToken();\r\n } else {\r\n // Otherwise, return a with its value set to the current input code point.\r\n type = TYPE.Delim;\r\n offset++;\r\n }\r\n break;\r\n\r\n // U+002C COMMA (,)\r\n case 0x002C:\r\n // Return a .\r\n type = TYPE.Comma;\r\n offset++;\r\n break;\r\n\r\n // U+002D HYPHEN-MINUS (-)\r\n case 0x002D:\r\n // If the input stream starts with a number, reconsume the current input code point, consume a numeric token, and return it.\r\n if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {\r\n consumeNumericToken();\r\n } else {\r\n // Otherwise, if the next 2 input code points are U+002D HYPHEN-MINUS U+003E GREATER-THAN SIGN (->), consume them and return a .\r\n if (getCharCode(offset + 1) === 0x002D &&\r\n getCharCode(offset + 2) === 0x003E) {\r\n type = TYPE.CDC;\r\n offset = offset + 3;\r\n } else {\r\n // Otherwise, if the input stream starts with an identifier, ...\r\n if (isIdentifierStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {\r\n // ... reconsume the current input code point, consume an ident-like token, and return it.\r\n consumeIdentLikeToken();\r\n } else {\r\n // Otherwise, return a with its value set to the current input code point.\r\n type = TYPE.Delim;\r\n offset++;\r\n }\r\n }\r\n }\r\n break;\r\n\r\n // U+002E FULL STOP (.)\r\n case 0x002E:\r\n // If the input stream starts with a number, ...\r\n if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {\r\n // ... reconsume the current input code point, consume a numeric token, and return it.\r\n consumeNumericToken();\r\n } else {\r\n // Otherwise, return a with its value set to the current input code point.\r\n type = TYPE.Delim;\r\n offset++;\r\n }\r\n\r\n break;\r\n\r\n // U+002F SOLIDUS (/)\r\n case 0x002F:\r\n // If the next two input code point are U+002F SOLIDUS (/) followed by a U+002A ASTERISK (*),\r\n if (getCharCode(offset + 1) === 0x002A) {\r\n // ... consume them and all following code points up to and including the first U+002A ASTERISK (*)\r\n // followed by a U+002F SOLIDUS (/), or up to an EOF code point.\r\n type = TYPE.Comment;\r\n offset = source.indexOf('*/', offset + 2) + 2;\r\n if (offset === 1) {\r\n offset = source.length;\r\n }\r\n } else {\r\n type = TYPE.Delim;\r\n offset++;\r\n }\r\n break;\r\n\r\n // U+003A COLON (:)\r\n case 0x003A:\r\n // Return a .\r\n type = TYPE.Colon;\r\n offset++;\r\n break;\r\n\r\n // U+003B SEMICOLON (;)\r\n case 0x003B:\r\n // Return a .\r\n type = TYPE.Semicolon;\r\n offset++;\r\n break;\r\n\r\n // U+003C LESS-THAN SIGN (<)\r\n case 0x003C:\r\n // If the next 3 input code points are U+0021 EXCLAMATION MARK U+002D HYPHEN-MINUS U+002D HYPHEN-MINUS (!--), ...\r\n if (getCharCode(offset + 1) === 0x0021 &&\r\n getCharCode(offset + 2) === 0x002D &&\r\n getCharCode(offset + 3) === 0x002D) {\r\n // ... consume them and return a .\r\n type = TYPE.CDO;\r\n offset = offset + 4;\r\n } else {\r\n // Otherwise, return a with its value set to the current input code point.\r\n type = TYPE.Delim;\r\n offset++;\r\n }\r\n\r\n break;\r\n\r\n // U+0040 COMMERCIAL AT (@)\r\n case 0x0040:\r\n // If the next 3 input code points would start an identifier, ...\r\n if (isIdentifierStart(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {\r\n // ... consume a name, create an with its value set to the returned value, and return it.\r\n type = TYPE.AtKeyword;\r\n offset = consumeName(source, offset + 1);\r\n } else {\r\n // Otherwise, return a with its value set to the current input code point.\r\n type = TYPE.Delim;\r\n offset++;\r\n }\r\n\r\n break;\r\n\r\n // U+005B LEFT SQUARE BRACKET ([)\r\n case 0x005B:\r\n // Return a <[-token>.\r\n type = TYPE.LeftSquareBracket;\r\n offset++;\r\n break;\r\n\r\n // U+005C REVERSE SOLIDUS (\\)\r\n case 0x005C:\r\n // If the input stream starts with a valid escape, ...\r\n if (isValidEscape(code, getCharCode(offset + 1))) {\r\n // ... reconsume the current input code point, consume an ident-like token, and return it.\r\n consumeIdentLikeToken();\r\n } else {\r\n // Otherwise, this is a parse error. Return a with its value set to the current input code point.\r\n type = TYPE.Delim;\r\n offset++;\r\n }\r\n break;\r\n\r\n // U+005D RIGHT SQUARE BRACKET (])\r\n case 0x005D:\r\n // Return a <]-token>.\r\n type = TYPE.RightSquareBracket;\r\n offset++;\r\n break;\r\n\r\n // U+007B LEFT CURLY BRACKET ({)\r\n case 0x007B:\r\n // Return a <{-token>.\r\n type = TYPE.LeftCurlyBracket;\r\n offset++;\r\n break;\r\n\r\n // U+007D RIGHT CURLY BRACKET (})\r\n case 0x007D:\r\n // Return a <}-token>.\r\n type = TYPE.RightCurlyBracket;\r\n offset++;\r\n break;\r\n\r\n // digit\r\n case charCodeCategory.Digit:\r\n // Reconsume the current input code point, consume a numeric token, and return it.\r\n consumeNumericToken();\r\n break;\r\n\r\n // name-start code point\r\n case charCodeCategory.NameStart:\r\n // Reconsume the current input code point, consume an ident-like token, and return it.\r\n consumeIdentLikeToken();\r\n break;\r\n\r\n // EOF\r\n case charCodeCategory.Eof:\r\n // Return an .\r\n break;\r\n\r\n // anything else\r\n default:\r\n // Return a with its value set to the current input code point.\r\n type = TYPE.Delim;\r\n offset++;\r\n }\r\n\r\n switch (type) {\r\n case balanceCloseType:\r\n balancePrev = balanceStart & OFFSET_MASK;\r\n balanceStart = balance[balancePrev];\r\n balanceCloseType = balanceStart >> TYPE_SHIFT;\r\n balance[tokenCount] = balancePrev;\r\n balance[balancePrev++] = tokenCount;\r\n for (; balancePrev < tokenCount; balancePrev++) {\r\n if (balance[balancePrev] === sourceLength) {\r\n balance[balancePrev] = tokenCount;\r\n }\r\n }\r\n break;\r\n\r\n case TYPE.LeftParenthesis:\r\n case TYPE.Function:\r\n balance[tokenCount] = balanceStart;\r\n balanceCloseType = TYPE.RightParenthesis;\r\n balanceStart = (balanceCloseType << TYPE_SHIFT) | tokenCount;\r\n break;\r\n\r\n case TYPE.LeftSquareBracket:\r\n balance[tokenCount] = balanceStart;\r\n balanceCloseType = TYPE.RightSquareBracket;\r\n balanceStart = (balanceCloseType << TYPE_SHIFT) | tokenCount;\r\n break;\r\n\r\n case TYPE.LeftCurlyBracket:\r\n balance[tokenCount] = balanceStart;\r\n balanceCloseType = TYPE.RightCurlyBracket;\r\n balanceStart = (balanceCloseType << TYPE_SHIFT) | tokenCount;\r\n break;\r\n }\r\n\r\n offsetAndType[tokenCount++] = (type << TYPE_SHIFT) | offset;\r\n }\r\n\r\n // finalize buffers\r\n offsetAndType[tokenCount] = (TYPE.EOF << TYPE_SHIFT) | offset; // \r\n balance[tokenCount] = sourceLength;\r\n balance[sourceLength] = sourceLength; // prevents false positive balance match with any token\r\n while (balanceStart !== 0) {\r\n balancePrev = balanceStart & OFFSET_MASK;\r\n balanceStart = balance[balancePrev];\r\n balance[balancePrev] = sourceLength;\r\n }\r\n\r\n // update stream\r\n stream.source = source;\r\n stream.firstCharOffset = start;\r\n stream.offsetAndType = offsetAndType;\r\n stream.tokenCount = tokenCount;\r\n stream.balance = balance;\r\n stream.reset();\r\n stream.next();\r\n\r\n return stream;\r\n}\r\n\r\n// extend tokenizer with constants\r\nObject.keys(constants).forEach(function(key) {\r\n tokenize[key] = constants[key];\r\n});\r\n\r\n// extend tokenizer with static methods from utils\r\nObject.keys(charCodeDefinitions).forEach(function(key) {\r\n tokenize[key] = charCodeDefinitions[key];\r\n});\r\nObject.keys(utils).forEach(function(key) {\r\n tokenize[key] = utils[key];\r\n});\r\n\r\nmodule.exports = tokenize;\r\n","var isDigit = require('../tokenizer').isDigit;\r\nvar cmpChar = require('../tokenizer').cmpChar;\r\nvar TYPE = require('../tokenizer').TYPE;\r\n\r\nvar DELIM = TYPE.Delim;\r\nvar WHITESPACE = TYPE.WhiteSpace;\r\nvar COMMENT = TYPE.Comment;\r\nvar IDENT = TYPE.Ident;\r\nvar NUMBER = TYPE.Number;\r\nvar DIMENSION = TYPE.Dimension;\r\nvar PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)\r\nvar HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)\r\nvar N = 0x006E; // U+006E LATIN SMALL LETTER N (n)\r\nvar DISALLOW_SIGN = true;\r\nvar ALLOW_SIGN = false;\r\n\r\nfunction isDelim(token, code) {\r\n return token !== null && token.type === DELIM && token.value.charCodeAt(0) === code;\r\n}\r\n\r\nfunction skipSC(token, offset, getNextToken) {\r\n while (token !== null && (token.type === WHITESPACE || token.type === COMMENT)) {\r\n token = getNextToken(++offset);\r\n }\r\n\r\n return offset;\r\n}\r\n\r\nfunction checkInteger(token, valueOffset, disallowSign, offset) {\r\n if (!token) {\r\n return 0;\r\n }\r\n\r\n var code = token.value.charCodeAt(valueOffset);\r\n\r\n if (code === PLUSSIGN || code === HYPHENMINUS) {\r\n if (disallowSign) {\r\n // Number sign is not allowed\r\n return 0;\r\n }\r\n valueOffset++;\r\n }\r\n\r\n for (; valueOffset < token.value.length; valueOffset++) {\r\n if (!isDigit(token.value.charCodeAt(valueOffset))) {\r\n // Integer is expected\r\n return 0;\r\n }\r\n }\r\n\r\n return offset + 1;\r\n}\r\n\r\n// ... \r\n// ... ['+' | '-'] \r\nfunction consumeB(token, offset_, getNextToken) {\r\n var sign = false;\r\n var offset = skipSC(token, offset_, getNextToken);\r\n\r\n token = getNextToken(offset);\r\n\r\n if (token === null) {\r\n return offset_;\r\n }\r\n\r\n if (token.type !== NUMBER) {\r\n if (isDelim(token, PLUSSIGN) || isDelim(token, HYPHENMINUS)) {\r\n sign = true;\r\n offset = skipSC(getNextToken(++offset), offset, getNextToken);\r\n token = getNextToken(offset);\r\n\r\n if (token === null && token.type !== NUMBER) {\r\n return 0;\r\n }\r\n } else {\r\n return offset_;\r\n }\r\n }\r\n\r\n if (!sign) {\r\n var code = token.value.charCodeAt(0);\r\n if (code !== PLUSSIGN && code !== HYPHENMINUS) {\r\n // Number sign is expected\r\n return 0;\r\n }\r\n }\r\n\r\n return checkInteger(token, sign ? 0 : 1, sign, offset);\r\n}\r\n\r\n// An+B microsyntax https://www.w3.org/TR/css-syntax-3/#anb\r\nmodule.exports = function anPlusB(token, getNextToken) {\r\n /* eslint-disable brace-style*/\r\n var offset = 0;\r\n\r\n if (!token) {\r\n return 0;\r\n }\r\n\r\n // \r\n if (token.type === NUMBER) {\r\n return checkInteger(token, 0, ALLOW_SIGN, offset); // b\r\n }\r\n\r\n // -n\r\n // -n \r\n // -n ['+' | '-'] \r\n // -n- \r\n // \r\n else if (token.type === IDENT && token.value.charCodeAt(0) === HYPHENMINUS) {\r\n // expect 1st char is N\r\n if (!cmpChar(token.value, 1, N)) {\r\n return 0;\r\n }\r\n\r\n switch (token.value.length) {\r\n // -n\r\n // -n \r\n // -n ['+' | '-'] \r\n case 2:\r\n return consumeB(getNextToken(++offset), offset, getNextToken);\r\n\r\n // -n- \r\n case 3:\r\n if (token.value.charCodeAt(2) !== HYPHENMINUS) {\r\n return 0;\r\n }\r\n\r\n offset = skipSC(getNextToken(++offset), offset, getNextToken);\r\n token = getNextToken(offset);\r\n\r\n return checkInteger(token, 0, DISALLOW_SIGN, offset);\r\n\r\n // \r\n default:\r\n if (token.value.charCodeAt(2) !== HYPHENMINUS) {\r\n return 0;\r\n }\r\n\r\n return checkInteger(token, 3, DISALLOW_SIGN, offset);\r\n }\r\n }\r\n\r\n // '+'? n\r\n // '+'? n \r\n // '+'? n ['+' | '-'] \r\n // '+'? n- \r\n // '+'? \r\n else if (token.type === IDENT || (isDelim(token, PLUSSIGN) && getNextToken(offset + 1).type === IDENT)) {\r\n // just ignore a plus\r\n if (token.type !== IDENT) {\r\n token = getNextToken(++offset);\r\n }\r\n\r\n if (token === null || !cmpChar(token.value, 0, N)) {\r\n return 0;\r\n }\r\n\r\n switch (token.value.length) {\r\n // '+'? n\r\n // '+'? n \r\n // '+'? n ['+' | '-'] \r\n case 1:\r\n return consumeB(getNextToken(++offset), offset, getNextToken);\r\n\r\n // '+'? n- \r\n case 2:\r\n if (token.value.charCodeAt(1) !== HYPHENMINUS) {\r\n return 0;\r\n }\r\n\r\n offset = skipSC(getNextToken(++offset), offset, getNextToken);\r\n token = getNextToken(offset);\r\n\r\n return checkInteger(token, 0, DISALLOW_SIGN, offset);\r\n\r\n // '+'? \r\n default:\r\n if (token.value.charCodeAt(1) !== HYPHENMINUS) {\r\n return 0;\r\n }\r\n\r\n return checkInteger(token, 2, DISALLOW_SIGN, offset);\r\n }\r\n }\r\n\r\n // \r\n // \r\n // \r\n // \r\n // ['+' | '-'] \r\n else if (token.type === DIMENSION) {\r\n var code = token.value.charCodeAt(0);\r\n var sign = code === PLUSSIGN || code === HYPHENMINUS ? 1 : 0;\r\n\r\n for (var i = sign; i < token.value.length; i++) {\r\n if (!isDigit(token.value.charCodeAt(i))) {\r\n break;\r\n }\r\n }\r\n\r\n if (i === sign) {\r\n // Integer is expected\r\n return 0;\r\n }\r\n\r\n if (!cmpChar(token.value, i, N)) {\r\n return 0;\r\n }\r\n\r\n // \r\n // \r\n // ['+' | '-'] \r\n if (i + 1 === token.value.length) {\r\n return consumeB(getNextToken(++offset), offset, getNextToken);\r\n } else {\r\n if (token.value.charCodeAt(i + 1) !== HYPHENMINUS) {\r\n return 0;\r\n }\r\n\r\n // \r\n if (i + 2 === token.value.length) {\r\n offset = skipSC(getNextToken(++offset), offset, getNextToken);\r\n token = getNextToken(offset);\r\n\r\n return checkInteger(token, 0, DISALLOW_SIGN, offset);\r\n }\r\n // \r\n else {\r\n return checkInteger(token, i + 2, DISALLOW_SIGN, offset);\r\n }\r\n }\r\n }\r\n\r\n return 0;\r\n};\r\n","var isHexDigit = require('../tokenizer').isHexDigit;\r\nvar cmpChar = require('../tokenizer').cmpChar;\r\nvar TYPE = require('../tokenizer').TYPE;\r\n\r\nvar IDENT = TYPE.Ident;\r\nvar DELIM = TYPE.Delim;\r\nvar NUMBER = TYPE.Number;\r\nvar DIMENSION = TYPE.Dimension;\r\nvar PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)\r\nvar HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)\r\nvar QUESTIONMARK = 0x003F; // U+003F QUESTION MARK (?)\r\nvar U = 0x0075; // U+0075 LATIN SMALL LETTER U (u)\r\n\r\nfunction isDelim(token, code) {\r\n return token !== null && token.type === DELIM && token.value.charCodeAt(0) === code;\r\n}\r\n\r\nfunction startsWith(token, code) {\r\n return token.value.charCodeAt(0) === code;\r\n}\r\n\r\nfunction hexSequence(token, offset, allowDash) {\r\n for (var pos = offset, hexlen = 0; pos < token.value.length; pos++) {\r\n var code = token.value.charCodeAt(pos);\r\n\r\n if (code === HYPHENMINUS && allowDash && hexlen !== 0) {\r\n if (hexSequence(token, offset + hexlen + 1, false) > 0) {\r\n return 6; // dissallow following question marks\r\n }\r\n\r\n return 0; // dash at the ending of a hex sequence is not allowed\r\n }\r\n\r\n if (!isHexDigit(code)) {\r\n return 0; // not a hex digit\r\n }\r\n\r\n if (++hexlen > 6) {\r\n return 0; // too many hex digits\r\n };\r\n }\r\n\r\n return hexlen;\r\n}\r\n\r\nfunction withQuestionMarkSequence(consumed, length, getNextToken) {\r\n if (!consumed) {\r\n return 0; // nothing consumed\r\n }\r\n\r\n while (isDelim(getNextToken(length), QUESTIONMARK)) {\r\n if (++consumed > 6) {\r\n return 0; // too many question marks\r\n }\r\n\r\n length++;\r\n }\r\n\r\n return length;\r\n}\r\n\r\n// https://drafts.csswg.org/css-syntax/#urange\r\n// Informally, the production has three forms:\r\n// U+0001\r\n// Defines a range consisting of a single code point, in this case the code point \"1\".\r\n// U+0001-00ff\r\n// Defines a range of codepoints between the first and the second value, in this case\r\n// the range between \"1\" and \"ff\" (255 in decimal) inclusive.\r\n// U+00??\r\n// Defines a range of codepoints where the \"?\" characters range over all hex digits,\r\n// in this case defining the same as the value U+0000-00ff.\r\n// In each form, a maximum of 6 digits is allowed for each hexadecimal number (if you treat \"?\" as a hexadecimal digit).\r\n//\r\n// =\r\n// u '+' '?'* |\r\n// u '?'* |\r\n// u '?'* |\r\n// u |\r\n// u |\r\n// u '+' '?'+\r\nmodule.exports = function urange(token, getNextToken) {\r\n var length = 0;\r\n\r\n // should start with `u` or `U`\r\n if (token === null || token.type !== IDENT || !cmpChar(token.value, 0, U)) {\r\n return 0;\r\n }\r\n\r\n token = getNextToken(++length);\r\n if (token === null) {\r\n return 0;\r\n }\r\n\r\n // u '+' '?'*\r\n // u '+' '?'+\r\n if (isDelim(token, PLUSSIGN)) {\r\n token = getNextToken(++length);\r\n if (token === null) {\r\n return 0;\r\n }\r\n\r\n if (token.type === IDENT) {\r\n // u '+' '?'*\r\n return withQuestionMarkSequence(hexSequence(token, 0, true), ++length, getNextToken);\r\n }\r\n\r\n if (isDelim(token, QUESTIONMARK)) {\r\n // u '+' '?'+\r\n return withQuestionMarkSequence(1, ++length, getNextToken);\r\n }\r\n\r\n // Hex digit or question mark is expected\r\n return 0;\r\n }\r\n\r\n // u '?'*\r\n // u \r\n // u \r\n if (token.type === NUMBER) {\r\n if (!startsWith(token, PLUSSIGN)) {\r\n return 0;\r\n }\r\n\r\n var consumedHexLength = hexSequence(token, 1, true);\r\n if (consumedHexLength === 0) {\r\n return 0;\r\n }\r\n\r\n token = getNextToken(++length);\r\n if (token === null) {\r\n // u \r\n return length;\r\n }\r\n\r\n if (token.type === DIMENSION || token.type === NUMBER) {\r\n // u \r\n // u \r\n if (!startsWith(token, HYPHENMINUS) || !hexSequence(token, 1, false)) {\r\n return 0;\r\n }\r\n\r\n return length + 1;\r\n }\r\n\r\n // u '?'*\r\n return withQuestionMarkSequence(consumedHexLength, length, getNextToken);\r\n }\r\n\r\n // u '?'*\r\n if (token.type === DIMENSION) {\r\n if (!startsWith(token, PLUSSIGN)) {\r\n return 0;\r\n }\r\n\r\n return withQuestionMarkSequence(hexSequence(token, 1, true), ++length, getNextToken);\r\n }\r\n\r\n return 0;\r\n};\r\n","var tokenizer = require('../tokenizer');\r\nvar isIdentifierStart = tokenizer.isIdentifierStart;\r\nvar isHexDigit = tokenizer.isHexDigit;\r\nvar isDigit = tokenizer.isDigit;\r\nvar cmpStr = tokenizer.cmpStr;\r\nvar consumeNumber = tokenizer.consumeNumber;\r\nvar TYPE = tokenizer.TYPE;\r\nvar anPlusB = require('./generic-an-plus-b');\r\nvar urange = require('./generic-urange');\r\n\r\nvar cssWideKeywords = ['unset', 'initial', 'inherit'];\r\nvar calcFunctionNames = ['calc(', '-moz-calc(', '-webkit-calc('];\r\n\r\n// https://www.w3.org/TR/css-values-3/#lengths\r\nvar LENGTH = {\r\n // absolute length units\r\n 'px': true,\r\n 'mm': true,\r\n 'cm': true,\r\n 'in': true,\r\n 'pt': true,\r\n 'pc': true,\r\n 'q': true,\r\n\r\n // relative length units\r\n 'em': true,\r\n 'ex': true,\r\n 'ch': true,\r\n 'rem': true,\r\n\r\n // viewport-percentage lengths\r\n 'vh': true,\r\n 'vw': true,\r\n 'vmin': true,\r\n 'vmax': true,\r\n 'vm': true\r\n};\r\n\r\nvar ANGLE = {\r\n 'deg': true,\r\n 'grad': true,\r\n 'rad': true,\r\n 'turn': true\r\n};\r\n\r\nvar TIME = {\r\n 's': true,\r\n 'ms': true\r\n};\r\n\r\nvar FREQUENCY = {\r\n 'hz': true,\r\n 'khz': true\r\n};\r\n\r\n// https://www.w3.org/TR/css-values-3/#resolution (https://drafts.csswg.org/css-values/#resolution)\r\nvar RESOLUTION = {\r\n 'dpi': true,\r\n 'dpcm': true,\r\n 'dppx': true,\r\n 'x': true // https://github.com/w3c/csswg-drafts/issues/461\r\n};\r\n\r\n// https://drafts.csswg.org/css-grid/#fr-unit\r\nvar FLEX = {\r\n 'fr': true\r\n};\r\n\r\n// https://www.w3.org/TR/css3-speech/#mixing-props-voice-volume\r\nvar DECIBEL = {\r\n 'db': true\r\n};\r\n\r\n// https://www.w3.org/TR/css3-speech/#voice-props-voice-pitch\r\nvar SEMITONES = {\r\n 'st': true\r\n};\r\n\r\n// safe char code getter\r\nfunction charCode(str, index) {\r\n return index < str.length ? str.charCodeAt(index) : 0;\r\n}\r\n\r\nfunction eqStr(actual, expected) {\r\n return cmpStr(actual, 0, actual.length, expected);\r\n}\r\n\r\nfunction eqStrAny(actual, expected) {\r\n for (var i = 0; i < expected.length; i++) {\r\n if (eqStr(actual, expected[i])) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n\r\n// IE postfix hack, i.e. 123\\0 or 123px\\9\r\nfunction isPostfixIeHack(str, offset) {\r\n if (offset !== str.length - 2) {\r\n return false;\r\n }\r\n\r\n return (\r\n str.charCodeAt(offset) === 0x005C && // U+005C REVERSE SOLIDUS (\\)\r\n isDigit(str.charCodeAt(offset + 1))\r\n );\r\n}\r\n\r\nfunction outOfRange(opts, value, numEnd) {\r\n if (opts && opts.type === 'Range') {\r\n var num = Number(\r\n numEnd !== undefined && numEnd !== value.length\r\n ? value.substr(0, numEnd)\r\n : value\r\n );\r\n\r\n if (isNaN(num)) {\r\n return true;\r\n }\r\n\r\n if (opts.min !== null && num < opts.min) {\r\n return true;\r\n }\r\n\r\n if (opts.max !== null && num > opts.max) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n\r\nfunction consumeFunction(token, getNextToken) {\r\n var startIdx = token.index;\r\n var length = 0;\r\n\r\n // balanced token consuming\r\n do {\r\n length++;\r\n\r\n if (token.balance <= startIdx) {\r\n break;\r\n }\r\n } while (token = getNextToken(length));\r\n\r\n return length;\r\n}\r\n\r\n// TODO: implement\r\n// can be used wherever , , ,