stylus/vendor/stylus-lang-bundle/stylus-renderer.min.js

106 lines
148 KiB
JavaScript
Raw Permalink Normal View History

var StylusRenderer=function(){"use strict";function assertPath(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function normalizeStringPosix(t,e){for(var n,i="",r=0,o=-1,a=0,h=0;h<=t.length;++h){if(h<t.length)n=t.charCodeAt(h);else{if(47===n)break;n=47}if(47===n){if(o===h-1||1===a);else if(o!==h-1&&2===a){if(i.length<2||2!==r||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){var l=i.lastIndexOf("/");if(l!==i.length-1){-1===l?(i="",r=0):r=(i=i.slice(0,l)).length-1-i.lastIndexOf("/"),o=h,a=0;continue}}else if(2===i.length||1===i.length){i="",r=0,o=h,a=0;continue}e&&(i.length>0?i+="/..":i="..",r=2)}else i.length>0?i+="/"+t.slice(o+1,h):i=t.slice(o+1,h),r=h-o-1;o=h,a=0}else 46===n&&-1!==a?++a:a=-1}return i}var t={resolve:function resolve(){for(var t,e="",n=!1,i=arguments.length-1;i>=-1&&!n;i--){var r;i>=0?r=arguments[i]:(void 0===t&&(t=process.cwd()),r=t),assertPath(r),0!==r.length&&(e=r+"/"+e,n=47===r.charCodeAt(0))}return e=normalizeStringPosix(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function normalize(t){if(assertPath(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=normalizeStringPosix(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function isAbsolute(t){return assertPath(t),t.length>0&&47===t.charCodeAt(0)},join:function join(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];assertPath(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":t.normalize(e)},relative:function relative(e,n){if(assertPath(e),assertPath(n),e===n)return"";if((e=t.resolve(e))===(n=t.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var r=e.length,o=r-i,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var h=n.length-a,l=o<h?o:h,c=-1,u=0;u<=l;++u){if(u===l){if(h>l){if(47===n.charCodeAt(a+u))return n.slice(a+u+1);if(0===u)return n.slice(a+u)}else o>l&&(47===e.charCodeAt(i+u)?c=u:0===u&&(c=0));break}var f=e.charCodeAt(i+u);if(f!==n.charCodeAt(a+u))break;47===f&&(c=u)}var d="";for(u=i+c+1;u<=r;++u)u!==r&&47!==e.charCodeAt(u)||(0===d.length?d+="..":d+="/..");return d.length>0?d+n.slice(a+c):(a+=c,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function _makeLong(t){return t},dirname:function dirname(t){if(assertPath(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,i=-1,r=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!r){i=o;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function basename(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');assertPath(t);var n,i=0,r=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,h=-1;for(n=t.length-1;n>=0;--n){var l=t.charCodeAt(n);if(47===l){if(!o){i=n+1;break}}else-1===h&&(o=!1,h=n+1),a>=0&&(l===e.charCodeAt(a)?-1==--a&&(r=n):(a=-1,r=h))}return i===r?r=h:-1===r&&(r=t.length),t.slice(i,r)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!o){i=n+1;break}}else-1===r&&(o=!1,r=n+1);return-1===r?"":t.slice(i,r)},extname:function extname(t){assertPath(t);for(var e=-1,n=0,i=-1,r=!0,o=0,a=t.length-1;a>=0;--a){var h=t.charCodeAt(a);if(47!==h)-1===i&&(r=!1,i=a+1),46===h?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!r){n=a+1;break}}return-1===e||-1===i||0===o||1===o&&e===i-1&&e===n+1?"":t.slice(e,i)},format:function format(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function _format(t,e){var n=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+i:n+t+i:i}("/",t)},parse:function parse(t){assertPath(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,i=t.charCodeAt(0),r=47===i;r?(e.root="/",n=1):n=0;for(var o=-1,a=0,h=-1,l=!0,c=t.length-1,u=0;c>=n;--c)if(47!==(i=t.charCodeAt(c)))-1===h&&(l=!1,h=c+1),46===i?-1===o?o=c:1!==u&&(u=1):-1!==o&&(u=-1);else if(!l){a=c+1;break}return-1===o||-1===h
/*!
* Stylus - Token
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
*/
2022-06-23 18:16:02 +00:00
let e;t.posix=t;var n=e=e=function Token(t,e){this.type=t,this.val=e};n.prototype.inspect=function(){var t=" "+nodeUtil.inspect(this.val);return"[Token:"+this.lineno+":"+this.column+" "+this.type+""+(this.val?t:"")+"]"},n.prototype.toString=function(){return(void 0===this.val?this.type:this.val).toString()};const noop$2=()=>noop$2
/*!
* Stylus - Visitor
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
2022-06-23 18:16:02 +00:00
*/;var i=function Visitor(t){this.root=t};i.prototype.visit=function(t,e){var n="visit"+t.constructor.name;return this[n]?this[n](t):t};
/*!
* Stylus - units
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
*/
2022-06-23 18:16:02 +00:00
var r=["em","ex","ch","rem","vw","vh","vmin","vmax","cm","mm","in","pt","pc","px","deg","grad","rad","turn","s","ms","Hz","kHz","dpi","dpcm","dppx","x","%","fr"],o=function Stack(){Array.apply(this,arguments)};
/*!
* Stylus - Stack
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
2022-06-23 18:16:02 +00:00
*/o.prototype.__proto__=Array.prototype,o.prototype.push=function(t){return t.stack=this,t.parent=this.currentFrame,[].push.apply(this,arguments)},o.prototype.__defineGetter__("currentFrame",(function(){return this[this.length-1]})),o.prototype.getBlockFrame=function(t){for(var e=0;e<this.length;++e)if(t==this[e].block)return this[e]},o.prototype.lookup=function(t){var e,n=this.currentFrame.block;do{var i=this.getBlockFrame(n);if(i&&(e=i.lookup(t)))return e}while(n=n.parent)},o.prototype.inspect=function(){return this.reverse().map((function(t){return t.inspect()})).join("\n")},o.prototype.toString=function(){for(var t,e,n=[],i=this.length;i--;)if(t=this[i].block.node)switch(e="("+t.filename+":"+(t.lineno+1)+":"+t.column+")",t.nodeName){case"function":n.push(" at "+t.name+"() "+e);break;case"group":n.push(' at "'+t.nodes[0].val+'" '+e)}return n.join("\n")};
/*!
* Stylus - stack - Scope
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
*/
2022-06-23 18:16:02 +00:00
var a=function Scope(){this.locals={}};a.prototype.add=function(t){this.locals[t.name]=t.val},a.prototype.lookup=function(t){return function hasOwnProperty(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(this.locals,t)?this.locals[t]:void 0},a.prototype.inspect=function(){var t=Object.keys(this.locals).map((function(t){return"@"+t}));return"[Scope"+(t.length?" "+t.join(", "):"")+"]"};var h=function Frame(t){this._scope=!1===t.scope?null:new a,this.block=t};h.prototype.__defineGetter__("scope",(function(){return this._scope||this.parent.scope})),h.prototype.lookup=function(t){return this.scope.lookup(t)},h.prototype.inspect=function(){return"[Frame "+(!1===this.block.scope?"scope-less":this.scope.inspect())+"]"};const _export_sync_=t=>"functions/index.styl"===t?[t]:[];function notImplemented(){throw new Error("Not implemented")}const _export_statSync_=t=>"functions/index.styl"===t?{mtime:0}:notImplemented(),_export_readFileSync_=t=>"functions/index.styl"===t?"called-from = ()\n\nvendors = moz webkit o ms official\n\n// stringify the given arg\n\n-string(arg)\n type(arg) + ' ' + arg\n\n// require a color\n\nrequire-color(color)\n unless color is a 'color'\n error('RGB or HSL value expected, got a ' + -string(color))\n\n// require a unit\n\nrequire-unit(n)\n unless n is a 'unit'\n error('unit expected, got a ' + -string(n))\n\n// require a string\n\nrequire-string(str)\n unless str is a 'string' or str is a 'ident'\n error('string expected, got a ' + -string(str))\n\n// Math functions\n\nabs(n) { math(n, 'abs') }\nmin(a, b) { a < b ? a : b }\nmax(a, b) { a > b ? a : b }\n\n// Trigonometrics\nPI = -math-prop('PI')\n\nradians-to-degrees(angle)\n angle * (180 / PI)\n\ndegrees-to-radians(angle)\n angle * (PI / 180)\n\nsin(n)\n n = unit(n) == 'deg' ? degrees-to-radians(unit(n, '')) : unit(n, '')\n round(math(n, 'sin'), 9)\n\ncos(n)\n n = unit(n) == 'deg' ? degrees-to-radians(unit(n, '')) : unit(n, '')\n round(math(n, 'cos'), 9)\n\n// Rounding Math functions\n\nceil(n, precision = 0)\n multiplier = 10 ** precision\n math(n * multiplier, 'ceil') / multiplier\n\nfloor(n, precision = 0)\n multiplier = 10 ** precision\n math(n * multiplier, 'floor') / multiplier\n\nround(n, precision = 0)\n multiplier = 10 ** precision\n math(n * multiplier, 'round') / multiplier\n\n// return the sum of the given numbers\n\nsum(nums)\n sum = 0\n sum += n for n in nums\n\n// return the average of the given numbers\n\navg(nums)\n sum(nums) / length(nums)\n\n// return a unitless number, or pass through\n\nremove-unit(n)\n if typeof(n) is \"unit\"\n unit(n, \"\")\n else\n n\n\n// convert a percent to a decimal, or pass through\n\npercent-to-decimal(n)\n if unit(n) is \"%\"\n remove-unit(n) / 100\n else\n n\n\n// check if n is an odd number\n\nodd(n)\n 1 == n % 2\n\n// check if n is an even number\n\neven(n)\n 0 == n % 2\n\n// check if color is light\n\nlight(color)\n lightness(color) >= 50%\n\n// check if color is dark\n\ndark(color)\n lightness(color) < 50%\n\n// desaturate color by amount\n\ndesaturate(color, amount)\n adjust(color, 'saturation', - amount)\n\n// saturate color by amount\n\nsaturate(color = '', amount = 100%)\n if color is a 'color'\n adjust(color, 'saturation', amount)\n else\n unquote( \"saturate(\" + color + \")\" )\n\n// darken by the given amount\n\ndarken(color, amount)\n adjust(color, 'lightness', - amount)\n\n// lighten by the given amount\n\nlighten(color, amount)\n adjust(color, 'lightness', amount)\n\n// decrease opacity by amount\n\nfade-out(color, amount)\n color - rgba(black, percent-to-decimal(amount))\n\n// increase opacity by amount\n\nfade-in(color, amount)\n color + rgba(black, percent-to-decimal(amount))\n\n// spin hue by a given amount\n\nspin(color, amount)\n color + unit(amount, deg)\n\n// mix two colors by a given amount\n\nmix(color1, color2, weight = 50%)\n unless weight in 0..100\n error(\"Weight must be between 0% and 100%\")\n\n if length(color1) == 2\n weight = color1[0]\n color1 = color1[1]\n\n else if length(color2) == 2\n
/*!
* Stylus - Selector Parser
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
*/
2022-06-23 18:16:02 +00:00
var l=[">","+","~"],c=function SelectorParser(t,e,n){this.str=t,this.stack=e||[],this.parts=n||[],this.pos=0,this.level=2,this.nested=!0,this.ignore=!1};c.prototype.skip=function(t){this.str=this.str.substr(t),this.pos+=t},c.prototype.skipSpaces=function(){for(;" "==this.str[0];)this.skip(1)},c.prototype.advance=function(){return this.root()||this.relative()||this.initial()||this.escaped()||this.parent()||this.partial()||this.char()},c.prototype.root=function(){this.pos||"/"!=this.str[0]||"deep"==this.str.slice(1,5)||(this.nested=!1,this.skip(1))},c.prototype.relative=function(t){if((!this.pos||t)&&"../"==this.str.slice(0,3)){for(this.nested=!1,this.skip(3);this.relative(!0);)this.level++;if(!this.raw){var e=this.stack[this.stack.length-this.level];if(e)return e;this.ignore=!0}}},c.prototype.initial=function(){if(!this.pos&&"~"==this.str[0]&&"/"==this.str[1])return this.nested=!1,this.skip(2),this.stack[0]},c.prototype.escaped=function(){if("\\"==this.str[0]){var t=this.str[1];if("&"==t||"^"==t)return this.skip(2),t}},c.prototype.parent=function(){if("&"==this.str[0]){if(this.nested=!1,!this.pos&&(!this.stack.length||this.raw)){for(var t=0;" "==this.str[++t];);if(~l.indexOf(this.str[t]))return void this.skip(t+1)}if(this.skip(1),!this.raw)return this.stack[this.stack.length-1]}},c.prototype.partial=function(){if("^"==this.str[0]&&"["==this.str[1]){this.skip(2),this.skipSpaces();var t=this.range();if(this.skipSpaces(),"]"!=this.str[0])return"^[";if(this.nested=!1,this.skip(1),t)return t;this.ignore=!0}},c.prototype.number=function(){var t=0,e="";for("-"==this.str[t]&&(e+=this.str[t++]);this.str.charCodeAt(t)>=48&&this.str.charCodeAt(t)<=57;)e+=this.str[t++];if(e)return this.skip(t),Number(e)},c.prototype.range=function(){var t,e=this.number();if(".."==this.str.slice(0,2)){this.skip(2);var n=this.number(),i=this.parts.length;if(e<0&&(e=i+e-1),n<0&&(n=i+n-1),e>n){var r=e;e=n,n=r}n<i-1&&(t=this.parts.slice(e,n+1).map((function(t){var e=new c(t,this.stack,this.parts);return e.raw=!0,e.parse()}),this).map((function(t){return(t.nested?" ":"")+t.val})).join("").trim())}else t=this.stack[e<0?this.stack.length+e-1:e];if(t)return t;this.ignore=!0},c.prototype.char=function(){var t=this.str[0];return this.skip(1),t},c.prototype.parse=function(){for(var t="";this.str.length;)if(t+=this.advance()||"",this.ignore){t="";break}return{val:t.trimRight(),nested:this.nested}};var u=t.basename,f=t.relative,d=t.join;const m=t.isAbsolute||function(t){return"\\\\"==t.substr(0,2)||"/"===t.charAt(0)||/^[a-z]:[\\\/]/i.test(t)},_export_lookup_=function(t,e,n){var i,r=e.length;if(m(t))try{return _export_statSync_(t),t}catch(t){}for(;r--;)try{if(n==(i=d(e[r],t)))continue;return _export_statSync_(i),i}catch(t){}},_export_find_=function(t,e,n){var i,r,o=e.length;if(m(t)&&(r=_export_sync_(t)).length)return r;for(;o--;)if(n!=(i=d(e[o],t))&&(r=_export_sync_(i)).length)return r},_export_lookupIndex_=function(t,e,n){var i=_export_find_(d(t,"index.styl"),e,n);return i||(i=_export_find_(d(t,u(t).replace(/\.styl/i,"")+".styl"),e,n)),i||~t.indexOf("node_modules")||(i=function lookupPackage(t){var r=_export_lookup_(d(t,"package.json"),e,n);if(!r)return/\.styl$/i.test(t)?_export_lookupIndex_(t,e,n):lookupPackage(t+".styl");var o=require(f("/",r)).main;return i=o?_export_find_(d(t,o),e,n):_export_lookupIndex_(t,e,n)}(d("node_modules",t))),i},_export_formatException_=function(t,e){var n=e.lineno,i=e.column,r=e.filename,o=e.input,a=(a=e.context||8)/2,h=("\n"+o).split("\n"),l=Math.max(n-a,1),c=Math.min(h.length,n+a),u=c.toString().length;return a=h.slice(l,c).map((function(t,e){var r=e+l;return" "+Array(u-r.toString().length+1).join(" ")+r+"| "+t+(r==n?"\n"+Array(r.toString().length+5+i).join("-")+"^":"")})).join("\n"),t.message=r+":"+n+":"+i+"\n"+a+"\n\n"+t.message+"\n"+(t.stylusStack?t.stylusStack+"\n":""),t.fromStylus&&(t.stack="Error: "+t.message),t},_export_assertType_=function(t,e,n){if(_export_assertPresent_(t,n),t.nodeName!=e){var i=t.nodeName;throw new Error("TypeError: expected "+(n?'"'+n+'" to be a ':"")+e+", but got "+i+":"+t)}},_export_assertString_=fu
/*!
* Stylus - colors
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
*/
2022-06-23 18:16:02 +00:00
var q={aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],transparent:[0,0,0,0],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1],rebeccapurple:[102,51,153,1]},T=t.extname,$={".gif":"image/gif",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".svg":"image/svg+xml",".webp":"image/webp",".ttf":"application/x-font-ttf",".eot":"application/vnd.ms-fontobject",".woff":"application/font-woff",".woff2":"application/font-woff2"};const _module_exports_$4=function(t){var e=(t=t||{}).paths||[],n=null!=t.limit?t.limit:3e4,i=t.mime
/*!
* Stylus - String
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
*/
2022-06-23 18:16:02 +00:00
var st=F.s,ot=function String(t,e){W.call(this),this.val=t,this.string=t,this.prefixed=!1,this.quote="string"!=typeof e?"'":e};let at;ot.prototype.__proto__=W.prototype,ot.prototype.toString=function(){return this.quote+this.val+this.quote},ot.prototype.clone=function(){var t=new ot(this.val,this.quote);return t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t},ot.prototype.toJSON=function(){return{__type:"String",val:this.val,quote:this.quote,lineno:this.lineno,column:this.column,filename:this.filename}},ot.prototype.toBoolean=function(){return qt.Boolean(this.val.length)},ot.prototype.coerce=function(t){switch(t.nodeName){case"string":return t;case"expression":return new ot(t.nodes.map((function(t){return this.coerce(t).val}),this).join(" "));default:return new ot(t.toString())}},ot.prototype.operate=function(t,e){switch(t){case"%":(i=new qt.Expression).push(this);var n="expression"==e.nodeName?_export_unwrap_(e).nodes:[e];return st.apply(null,[i].concat(n));case"+":var i;return(i=new qt.Expression).push(new ot(this.val+this.coerce(e).val)),i;default:return W.prototype.operate.call(this,t,e)}};var ht=at=at=function HSLA(t,e,n,i){W.call(this),this.h=clampDegrees(t),this.s=clampPercentage(e),this.l=clampPercentage(n),this.a=function clampAlpha$1(t){return Math.max(0,Math.min(t,1))}(i),this.hsla=this};function clampDegrees(t){return(t%=360)>=0?t:360+t}function clampPercentage(t){return Math.max(0,Math.min(t,100))}ht.prototype.__proto__=W.prototype,ht.prototype.toString=function(){return"hsla("+this.h+","+this.s.toFixed(0)+"%,"+this.l.toFixed(0)+"%,"+this.a+")"},ht.prototype.clone=function(t){var e=new ht(this.h,this.s,this.l,this.a);return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},ht.prototype.toJSON=function(){return{__type:"HSLA",h:this.h,s:this.s,l:this.l,a:this.a,lineno:this.lineno,column:this.column,filename:this.filename}},ht.prototype.__defineGetter__("rgba",(function(){return qt.RGBA.fromHSLA(this)})),ht.prototype.__defineGetter__("hash",(function(){return this.rgba.toString()})),ht.prototype.add=function(t,e,n){return new ht(this.h+t,this.s+e,this.l+n,this.a)},ht.prototype.sub=function(t,e,n){return this.add(-t,-e,-n)},ht.prototype.operate=function(t,e){switch(t){case"==":case"!=":case"<=":case">=":case"<":case">":case"is a":case"||":case"&&":return this.rgba.operate(t,e);default:return this.rgba.operate(t,e).hsla}},at.fromRGBA=function(t){var e,n,i=t.r/255,r=t.g/255,o=t.b/255,a=t.a,h=Math.min(i,r,o),l=Math.max(i,r,o),c=(l+h)/2,u=l-h;switch(l){case h:e=0;break;case i:e=60*(r-o)/u;break;case r:e=60*(o-i)/u+120;break;case o:e=60*(i-r)/u+240}return n=l==h?0:c<.5?u/(2*c):u/(2-2*c),new ht(e%=360,n*=100,c*=100,a)},ht.prototype.adjustLightness=function(t){return this.l=clampPercentage(this.l+this.l*(t/100)),this},ht.prototype.adjustHue=function(t){return this.h=clampDegrees(this.h+t),this};var lt=F.adjust;let ct;var pt=ct=ct=function RGBA(t,e,n,i){W.call(this),this.r=clamp(t),this.g=clamp(e),this.b=clamp(n),this.a=function clampAlpha(t){return Math.max(0,Math.min(t,1))}(i),this.name="",this.rgba=this};function clamp(t){return Math.max(0,Math.min(t.toFixed(0),255))}pt.prototype.__proto__=W.prototype,pt.withoutClamping=function(t,e,n,i){var r=new pt(0,0,0,0);return r.r=t,r.g=e,r.b=n,r.a=i,r},pt.prototype.clone=function(){var t=new pt(this.r,this.g,this.b,this.a);return t.raw=this.raw,t.name=this.name,t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t},pt.prototype.toJSON=function(){return{__type:"RGBA",r:this.r,g:this.g,b:this.b,a:this.a,raw:this.raw,name:this.name,lineno:this.lineno,column:this.column,filename:this.filename}},pt.prototype.toBoolean=function(){return qt.true},pt.prototype.__defineGetter__("hsla",(function(){return at.fromRGBA(this)})),pt.prototype.__defineGetter__("hash",(function(){return this.toString()})),pt.prototype.add=function(t,e,n,i){return new pt(this.r+t,this.g+e,this.b+n,this.a+i)},pt.prototype.sub=function(t,e,n,i){return new pt(this.r-t,this.g-e,this.b-n,1==i?this.a:this.a-i)},pt.prototype.multiply=function(t){return new pt(thi
/*!
* Stylus - at-rule
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
*/
2022-06-23 18:16:02 +00:00
var yt=function Atrule(t){W.call(this),this.type=t};function hasOutput(t){var e=t.nodes;return!e.every((function(t){return"group"==t.nodeName&&t.hasOnlyPlaceholders}))&&e.some((function(t){switch(t.nodeName){case"property":case"literal":case"import":return!0;case"block":return hasOutput(t);default:if(t.block)return hasOutput(t.block)}}))}yt.prototype.__proto__=W.prototype,yt.prototype.__defineGetter__("hasOnlyProperties",(function(){if(!this.block)return!1;for(var t=this.block.nodes,e=0,n=t.length;e<n;++e)switch(t[e].nodeName,t[e].nodeName){case"property":case"expression":case"comment":continue;default:return!1}return!0})),yt.prototype.clone=function(t){var e=new yt(this.type);return this.block&&(e.block=this.block.clone(t,e)),e.segments=this.segments.map((function(n){return n.clone(t,e)})),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},yt.prototype.toJSON=function(){var t={__type:"Atrule",type:this.type,segments:this.segments,lineno:this.lineno,column:this.column,filename:this.filename};return this.block&&(t.block=this.block),t},yt.prototype.toString=function(){return"@"+this.type},yt.prototype.__defineGetter__("hasOutput",(function(){return!!this.block&&hasOutput(this.block)}));var gt=function Media(t){yt.call(this,"media"),this.val=t};gt.prototype.__proto__=yt.prototype,gt.prototype.clone=function(t){var e=new gt;return e.val=this.val.clone(t,e),e.block=this.block.clone(t,e),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},gt.prototype.toJSON=function(){return{__type:"Media",val:this.val,block:this.block,lineno:this.lineno,column:this.column,filename:this.filename}},gt.prototype.toString=function(){return"@media "+this.val};var kt=function QueryList(){W.call(this),this.nodes=[]};kt.prototype.__proto__=W.prototype,kt.prototype.clone=function(t){var e=new kt;e.lineno=this.lineno,e.column=this.column,e.filename=this.filename;for(var n=0;n<this.nodes.length;++n)e.push(this.nodes[n].clone(t,e));return e},kt.prototype.push=function(t){this.nodes.push(t)},kt.prototype.merge=function(t){var e,n=new kt;return this.nodes.forEach((function(i){for(var r=0,o=t.nodes.length;r<o;++r)(e=i.merge(t.nodes[r]))&&n.push(e)})),n},kt.prototype.toString=function(){return"("+this.nodes.map((function(t){return t.toString()})).join(", ")+")"},kt.prototype.toJSON=function(){return{__type:"QueryList",nodes:this.nodes,lineno:this.lineno,column:this.column,filename:this.filename}};var wt=function Query(){W.call(this),this.nodes=[],this.type="",this.predicate=""};wt.prototype.__proto__=W.prototype,wt.prototype.clone=function(t){var e=new wt;e.predicate=this.predicate,e.type=this.type;for(var n=0,i=this.nodes.length;n<i;++n)e.push(this.nodes[n].clone(t,e));return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},wt.prototype.push=function(t){this.nodes.push(t)},wt.prototype.__defineGetter__("resolvedType",(function(){if(this.type)return this.type.nodeName?this.type.string:this.type})),wt.prototype.__defineGetter__("resolvedPredicate",(function(){if(this.predicate)return this.predicate.nodeName?this.predicate.string:this.predicate})),wt.prototype.merge=function(t){var e,n,i=new wt,r=this.resolvedPredicate,o=t.resolvedPredicate,a=this.resolvedType,h=t.resolvedType;if(a=a||h,h=h||a,"not"==r^"not"==o){if(a==h)return;e="not"==r?h:a,n="not"==r?o:r}else if("not"==r&&"not"==o){if(a!=h)return;e=a,n="not"}else{if(a!=h)return;e=a,n=r||o}return i.predicate=n,i.type=e,i.nodes=this.nodes.concat(t.nodes),i},wt.prototype.toString=function(){var t=this.predicate?this.predicate+" ":"",e=this.type||"",n=t+e;return this.nodes.length&&(n+=(e&&" and ")+this.nodes.map((function(t){return t.toString()})).join(" and ")),n},wt.prototype.toJSON=function(){return{__type:"Query",predicate:this.predicate,type:this.type,nodes:this.nodes,lineno:this.lineno,column:this.column,filename:this.filename}};var bt=function Feature(t){W.call(this),this.segments=t,this.expr=null};bt.prototype.__proto__=W.prototype,bt.prototype.clone=function(t){var e=new bt;return e.segments=this.segments.map((function(n){return n.clone(t,e)}))
/*!
* Stylus - Namespace
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
*/
2022-06-23 18:16:02 +00:00
var At=function Namespace(t,e){W.call(this),this.val=t,this.prefix=e};At.prototype.__proto__=W.prototype,At.prototype.toString=function(){return"@namespace "+(this.prefix?this.prefix+" ":"")+this.val},At.prototype.toJSON=function(){return{__type:"Namespace",val:this.val,prefix:this.prefix,lineno:this.lineno,column:this.column,filename:this.filename}};var Ot=function Import(t,e){W.call(this),this.path=t,this.once=e||!1};Ot.prototype.__proto__=W.prototype,Ot.prototype.clone=function(t){var e=new Ot;return e.path=this.path.nodeName?this.path.clone(t,e):this.path,e.once=this.once,e.mtime=this.mtime,e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},Ot.prototype.toJSON=function(){return{__type:"Import",path:this.path,once:this.once,mtime:this.mtime,lineno:this.lineno,column:this.column,filename:this.filename}};var Lt=function Extend(t){W.call(this),this.selectors=t};Lt.prototype.__proto__=W.prototype,Lt.prototype.clone=function(){return new Lt(this.selectors)},Lt.prototype.toString=function(){return"@extend "+this.selectors.join(", ")},Lt.prototype.toJSON=function(){return{__type:"Extend",selectors:this.selectors,lineno:this.lineno,column:this.column,filename:this.filename}};var Bt={}.constructor,Ct=function Object(){W.call(this),this.vals={},this.keys={}};Ct.prototype.__proto__=W.prototype,Ct.prototype.setValue=function(t,e){return this.vals[t]=e,this},Ct.prototype.set=Ct.prototype.setValue,Ct.prototype.setKey=function(t,e){return this.keys[t]=e,this},Ct.prototype.__defineGetter__("length",(function(){return Bt.keys(this.vals).length})),Ct.prototype.get=function(t){return this.vals[t]||qt.null},Ct.prototype.has=function(t){return t in this.vals},Ct.prototype.operate=function(t,e){switch(t){case".":case"[]":return this.get(e.hash);case"==":var n,i,r=this.vals;if("object"!=e.nodeName||this.length!=e.length)return qt.false;for(var o in r)if(n=r[o],i=e.vals[o],n.operate(t,i).isFalse)return qt.false;return qt.true;case"!=":return this.operate("==",e).negate();default:return W.prototype.operate.call(this,t,e)}},Ct.prototype.toBoolean=function(){return qt.Boolean(this.length)},Ct.prototype.toBlock=function(){var t,e,n="{";for(t in this.vals)"object"==(e=this.get(t)).first.nodeName?n+=t+" "+e.first.toBlock():n+="@charset"===t?t+" "+e.first.toString()+";":t+":"+toString(e)+";";return n+"}";function toString(t){return t.nodes?t.nodes.map(toString).join(t.isList?",":" "):"literal"==t.nodeName&&","==t.val?"\\,":t.toString()}},Ct.prototype.clone=function(t){var e,n=new Ct;for(e in n.lineno=this.lineno,n.column=this.column,n.filename=this.filename,this.vals)n.vals[e]=this.vals[e].clone(t,n);for(e in this.keys)n.keys[e]=this.keys[e].clone(t,n);return n},Ct.prototype.toJSON=function(){return{__type:"Object",vals:this.vals,keys:this.keys,lineno:this.lineno,column:this.column,filename:this.filename}},Ct.prototype.toString=function(){var t={};for(var e in this.vals)t[e]=this.vals[e].toString();return JSON.stringify(t)};var jt=function Function(t,e,n){W.call(this),this.name=t,this.params=e,this.block=n,"function"==typeof e&&(this.fn=e)};jt.prototype.__defineGetter__("arity",(function(){return this.params.length})),jt.prototype.__proto__=W.prototype,jt.prototype.__defineGetter__("hash",(function(){return"function "+this.name})),jt.prototype.clone=function(t){if(this.fn)var e=new jt(this.name,this.fn);else(e=new jt(this.name)).params=this.params.clone(t,e),e.block=this.block.clone(t,e);return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},jt.prototype.toString=function(){return this.fn?this.name+"("+this.fn.toString().match(/^function *\w*\((.*?)\)/).slice(1).join(", ")+")":this.name+"("+this.params.nodes.join(", ")+")"},jt.prototype.toJSON=function(){var t={__type:"Function",name:this.name,lineno:this.lineno,column:this.column,filename:this.filename};return this.fn?t.fn=this.fn:(t.params=this.params,t.block=this.block),t};var Pt=function Property(t,e){W.call(this),this.segments=t,this.expr=e};Pt.prototype.__proto__=W.prototype,Pt.prototype.clone=function(t){var e=new Pt(this.segments);return e.name=this
/*!
* Stylus - @block
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
*/
2022-06-23 18:16:02 +00:00
var Mt=function Atblock(){W.call(this)};Mt.prototype.__defineGetter__("nodes",(function(){return this.block.nodes})),Mt.prototype.__proto__=W.prototype,Mt.prototype.clone=function(t){var e=new Mt;return e.block=this.block.clone(t,e),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},Mt.prototype.toString=function(){return"@block"},Mt.prototype.toJSON=function(){return{__type:"Atblock",block:this.block,lineno:this.lineno,column:this.column,fileno:this.fileno}};
/*!
* Stylus - supports
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
*/
2022-06-23 18:16:02 +00:00
var Ft=function Supports(t){yt.call(this,"supports"),this.condition=t};Ft.prototype.__proto__=yt.prototype,Ft.prototype.clone=function(t){var e=new Ft;return e.condition=this.condition.clone(t,e),e.block=this.block.clone(t,e),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},Ft.prototype.toJSON=function(){return{__type:"Supports",condition:this.condition,block:this.block,lineno:this.lineno,column:this.column,filename:this.filename}},Ft.prototype.toString=function(){return"@supports "+this.condition};
/*!
* Stylus - nodes
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
*/
2022-06-23 18:16:02 +00:00
const qt={};function ParseError(t){this.name="ParseError",this.message=t,Error.captureStackTrace&&Error.captureStackTrace(this,ParseError)}function SyntaxError(t){this.name="SyntaxError",this.message=t,Error.captureStackTrace&&Error.captureStackTrace(this,ParseError)}qt.lineno=null,qt.column=null,qt.filename=null,qt.Node=W,qt.Root=D,qt.Null=K,qt.Each=V,qt.If=Z,qt.Call=Y,qt.UnaryOp=X,qt.BinOp=tt,qt.Ternary=et,qt.Block=nt,qt.Unit=rt,qt.String=ot,qt.HSLA=at,qt.RGBA=ct,qt.Ident=ut,qt.Group=ft,qt.Literal=dt,qt.Boolean=mt,qt.Return=vt,qt.Media=gt,qt.QueryList=kt,qt.Query=wt,qt.Feature=bt,qt.Params=xt,qt.Comment=_t,qt.Keyframes=St,qt.Member=Et,qt.Charset=Nt,qt.Namespace=At,qt.Import=Ot,qt.Extend=Lt,qt.Object=Ct,qt.Function=jt,qt.Property=Pt,qt.Selector=It,qt.Expression=Ut,qt.Arguments=Gt,qt.Atblock=Mt,qt.Atrule=yt,qt.Supports=Ft,qt.true=new qt.Boolean(!0),qt.false=new qt.Boolean(!1),qt.null=new qt.Null,ParseError.prototype.__proto__=Error.prototype,SyntaxError.prototype.__proto__=Error.prototype;const Tt=Lexer;var $t={and:"&&",or:"||",is:"==",isnt:"!=","is not":"!=",":=":"?="};function Lexer(t,e){function comment(t,e,n,i){var r=i.lastIndexOf("/*",n)>i.lastIndexOf("*/",n),o=i.lastIndexOf("//",n),a=i.lastIndexOf("\n",n),h=0,l=0;if(~o&&o>a)for(;a!=n;){if("'"==i[a]&&(l?l--:l++),'"'==i[a]&&(h?h--:h++),"/"==i[a]&&"/"==i[a+1]){r=!l&&!h;break}++a}return r?t:","===e&&/^[,\t\n]+$/.test(t)?t.replace(/\n/,"\r"):e+"\r"}this.stash=[],this.indentStack=[],this.indentRe=null,this.lineno=1,this.column=1,"\ufeff"==t.charAt(0)&&(t=t.slice(1)),this.str=t.replace(/\s+$/,"\n").replace(/\r\n?/g,"\n").replace(/\\ *\n/g,"\r").replace(/([,(:](?!\/\/[^ ])) *(?:\/\/[^\n]*|\/\*.*?\*\/)?\n\s*/g,comment).replace(/\s*\n[ \t]*([,)])/g,comment)}Lexer.prototype={inspect:function(){for(var t,e=this.str,n=[];"eos"!=(t=this.next()).type;)n.push(t.inspect());return this.str=e,n.concat(t.inspect()).join("\n")},lookahead:function(t){for(var e=t-this.stash.length;e-- >0;)this.stash.push(this.advance());return this.stash[--t]},skip:function(t){var e=t[0];t=e?e.length:t,this.str=this.str.substr(t),e?this.move(e):this.column+=t},move:function(t){var e=t.match(/\n/g),n=t.lastIndexOf("\n");e&&(this.lineno+=e.length),this.column=~n?t.length-n:this.column+t.length},next:function(){var t=this.stashed()||this.advance();return this.prev=t,t},isPartOfSelector:function(){var t=this.stash[this.stash.length-1]||this.prev;switch(t&&t.type){case"color":return 2==t.val.raw.length;case".":case"[":return!0}return!1},advance:function(){var t=this.column,e=this.lineno,n=this.eos()||this.null()||this.sep()||this.keyword()||this.urlchars()||this.comment()||this.newline()||this.escaped()||this.important()||this.literal()||this.anonFunc()||this.atrule()||this.function()||this.brace()||this.paren()||this.color()||this.string()||this.unit()||this.namedop()||this.boolean()||this.unicode()||this.ident()||this.op()||function(){var n=this.eol();return n&&(t=n.column,e=n.lineno),n}.call(this)||this.space()||this.selector();return n.lineno=e,n.column=t,n},peek:function(){return this.lookahead(1)},stashed:function(){return this.stash.shift()},eos:function(){if(!this.str.length)return this.indentStack.length?(this.indentStack.shift(),new e("outdent")):new e("eos")},urlchars:function(){var t;if(this.isURL)return(t=/^[\/:@.;?&=*!,<>#%0-9]+/.exec(this.str))?(this.skip(t),new e("literal",new qt.Literal(t[0]))):void 0},sep:function(){var t;if(t=/^;[ \t]*/.exec(this.str))return this.skip(t),new e(";")},eol:function(){if("\r"==this.str[0]){for(++this.lineno,this.skip(1),this.column=1;this.space(););return this.advance()}},space:function(){var t;if(t=/^([ \t]+)/.exec(this.str))return this.skip(t),new e("space")},escaped:function(){var t;if(t=/^\\(.)[ \t]*/.exec(this.str)){var n=t[1];return this.skip(t),new e("ident",new qt.Literal(n))}},literal:function(){var t;if(t=/^@css[ \t]*\{/.exec(this.str)){this.skip(t);for(var n,i,r=1,o="";n=this.str[0];){switch(this.str=this.str.substr(1),n){case"{":++r;break;case"}":--r;break;case"\n":case"\r":++this.lineno}if(o+=n,!r)break}return o=o.replace(/\s*}$/,""),(i=new qt.Lit
/*!
* Stylus - Parser
* Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
2022-06-23 18:16:02 +00:00
*/Dt.getCache=function(t){return!1===t.cache?getCache(!1):getCache(t.cache||"memory",t)},Dt.prototype={constructor:Dt,currentState:function(){return this.state[this.state.length-1]},previousState:function(){return this.state[this.state.length-2]},parse:function(){var t=this.parent=this.root;if(Dt.cache.has(this.hash))"block"==(t=Dt.cache.get(this.hash)).nodeName&&(t.constructor=qt.Root);else{for(;"eos"!=this.peek().type&&(this.skipWhitespace(),"eos"!=this.peek().type);){var e=this.statement();this.accept(";"),e||this.error("unexpected token {peek}, not allowed at the root level"),t.push(e)}Dt.cache.set(this.hash,t)}return t},error:function(t){var e=this.peek().type,n=null==this.peek().val?"":" "+this.peek().toString();throw n.trim()==e.trim()&&(n=""),new ParseError(t.replace("{peek}",'"'+e+n+'"'))},accept:function(t){if(t==this.peek().type)return this.next()},expect:function(t){return t!=this.peek().type&&this.error('expected "'+t+'", got {peek}'),this.next()},next:function(){var t=this.stash.length?this.stash.pop():this.lexer.next(),e=t.lineno,n=t.column||1;return t.val&&t.val.nodeName&&(t.val.lineno=e,t.val.column=n),qt.lineno=e,qt.column=n,Ht.lexer("%s %s",t.type,t.val||""),t},peek:function(){return this.lexer.peek()},lookahead:function(t){return this.lexer.lookahead(t)},isSelectorToken:function(t){var e=this.lookahead(t).type;switch(e){case"for":return this.bracketed;case"[":return this.bracketed=!0,!0;case"]":return this.bracketed=!1,!0;default:return~Qt.indexOf(e)}},isPseudoSelector:function(t){var e=this.lookahead(t).val;return e&&~Wt.indexOf(e.name)},lineContains:function(t){for(var e,n=1;e=this.lookahead(n++);){if(~["indent","outdent","newline","eos"].indexOf(e.type))return;if(t==e.type)return!0}},selectorToken:function(){if(this.isSelectorToken(1)){if("{"==this.peek().type){if(!this.lineContains("}"))return;for(var t,e=0;t=this.lookahead(++e);){if("}"==t.type){if(2==e||3==e&&"space"==this.lookahead(e-1).type)return;break}if(":"==t.type)return}}return this.next()}},skip:function(t){for(;~t.indexOf(this.peek().type);)this.next()},skipWhitespace:function(){this.skip(["space","indent","outdent","newline"])},skipNewlines:function(){for(;"newline"==this.peek().type;)this.next()},skipSpaces:function(){for(;"space"==this.peek().type;)this.next()},skipSpacesAndComments:function(){for(;"space"==this.peek().type||"comment"==this.peek().type;)this.next()},looksLikeFunctionDefinition:function(t){return"indent"==this.lookahead(t).type||"{"==this.lookahead(t).type},looksLikeSelector:function(t){var e,n,i=1;if(t&&":"==this.lookahead(i+1).type&&(this.lookahead(i+1).space||"indent"==this.lookahead(i+2).type))return!1;for(;"ident"==this.lookahead(i).type&&("newline"==this.lookahead(i+1).type||","==this.lookahead(i+1).type);)i+=2;for(;this.isSelectorToken(i)||","==this.lookahead(i).type;){if("selector"==this.lookahead(i).type)return!0;if("&"==this.lookahead(i+1).type)return!0;if(i>1&&"ident"===this.lookahead(i-1).type&&"."===this.lookahead(i).type&&"ident"===this.lookahead(i+1).type){for(;e=this.lookahead(i+2);){if(-1!==["indent","outdent","{",";","eos","selector","media","if","atrule",")","}","unit","[","for","function"].indexOf(e.type)){if("["!==e.type){if(this.isPseudoSelector(i+2))return!0;if(")"===e.type&&this.lookahead(i+3)&&"}"===this.lookahead(i+3).type)break;return-1===["outdent",";","eos","media","if","atrule",")","}","unit","for","function"].indexOf(e.type)}for(;(e=this.lookahead(i+3))&&"]"!==e.type;){if(~[".","unit"].indexOf(e.type))return!1;i+=1}}i+=1}return!0}if("."==this.lookahead(i).type&&"ident"==this.lookahead(i+1).type)return!0;if("*"==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return!0;if(":"==this.lookahead(i).type&&":"==this.lookahead(i+1).type)return!0;if("color"==this.lookahead(i).type&&"newline"==this.lookahead(i-1).type)return!0;if(this.looksLikeAttributeSelector(i))return!0;if(("="==this.lookahead(i).type||"function"==this.lookahead(i).type)&&"{"==this.lookahead(i+1).type)return!1;if(":"==this.lookahead(i).type&&!this.isPseudoSelector(i+1)&&this.lineContains("."))return!1;if("{"==thi
/**
* event-lite.js - Light-weight EventEmitter (less than 1KB when gzipped)
*
* @copyright Yusuke Kawasaki
* @license MIT
* @constructor
* @see https://github.com/kawanet/event-lite
* @see http://kawanet.github.io/event-lite/EventLite.html
* @example
* var EventLite = require("event-lite");
*
* function MyClass() {...} // your class
*
* EventLite.mixin(MyClass.prototype); // import event methods
*
* var obj = new MyClass();
* obj.on("foo", function() {...}); // add event listener
* obj.once("bar", function() {...}); // add one-time event listener
* obj.emit("foo"); // dispatch event
* obj.emit("bar"); // dispatch another event
* obj.off("foo"); // remove event listener
*/
2022-06-23 18:16:02 +00:00
function EventLite(){if(!(this instanceof EventLite))return new EventLite}));var Vt=Kt.exports;const Zt=class{constructor(){this.events=new Vt}on(...t){return this.events.on(...t)}off(...t){return this.events.off(...t)}once(...t){return this.events.once(...t)}emit(...t){return this.events.emit(...t)}listeners(t){return this.events.listeners&&this.events.listeners[t]||[]}},noop=()=>noop;var Yt=t.dirname,Xt=function DepsResolver(t,e){this.root=t,this.filename=e.filename,this.paths=e.paths||[],this.paths.push(Yt(e.filename||".")),this.options=e,this.functions={},this.deps=[]};Xt.prototype.__proto__=i.prototype;var te=Xt.prototype.visit;Xt.prototype.visit=function(t){switch(t.nodeName){case"root":case"block":case"expression":this.visitRoot(t);break;case"group":case"media":case"atblock":case"atrule":case"keyframes":case"each":case"supports":this.visit(t.block);break;default:te.call(this,t)}},Xt.prototype.visitRoot=function(t){for(var e=0,n=t.nodes.length;e<n;++e)this.visit(t.nodes[e])},Xt.prototype.visitIdent=function(t){this.visit(t.val)},Xt.prototype.visitIf=function(t){this.visit(t.block),this.visit(t.cond);for(var e=0,n=t.elses.length;e<n;++e)this.visit(t.elses[e])},Xt.prototype.visitFunction=function(t){this.functions[t.name]=t.block},Xt.prototype.visitCall=function(t){t.name in this.functions&&this.visit(this.functions[t.name]),t.block&&this.visit(t.block)},Xt.prototype.visitImport=function(t){if("url"!==t.path.first.name){var e,n,i,r=!t.path.first.val.isNull&&t.path.first.val||t.path.first.name;if(r&&((e=/\.css(?:"|$)/.test(r))||/\.styl$/i.test(r)||(i=r,r+=".styl"),!(n=_export_find_(r,this.paths,this.filename))&&i&&(n=_export_lookupIndex_(i,this.paths,this.filename)),n&&(this.deps=this.deps.concat(n),!e)))for(var o=0,a=n.length;o<a;++o){var h=n[o],l=Yt(h),c=_export_readFileSync_(h),u=new qt.Block,f=new Dt(c,_export_merge_({root:u},this.options));~this.paths.indexOf(l)||this.paths.push(l);try{u=f.parse()}catch(t){throw t.filename=h,t.lineno=f.lexer.lineno,t.column=f.lexer.column,t.input=c,t}this.visit(u)}}},Xt.prototype.resolve=function(){return this.visit(this.root),_export_uniq_(this.deps)};var ee=new Zt,ie=t.join;function Renderer(t,e){(e=e||{}).globals=e.globals||{},e.functions=e.functions||{},e.use=e.use||[],e.use=Array.isArray(e.use)?e.use:[e.use],e.imports=[ie("/","functions/index.styl")].concat(e.imports||[]),e.paths=e.paths||[],e.filename=e.filename||"stylus",e.Evaluator=e.Evaluator||H,this.options=e,this.str=t,this.events=ee}return Renderer.prototype.__proto__=Zt.prototype,Renderer.prototype.render=function(t){for(var e=this.parser=new Dt(this.str,this.options),n=0,i=this.options.use.length;n<i;n++)this.use(this.options.use[n]);try{qt.filename=this.options.filename;var r=e.parse();this.evaluator=new this.options.Evaluator(r,this.options),this.nodes=qt,this.evaluator.renderer=this,r=this.evaluator.evaluate(),r=new I(r,this.options).normalize();var o=this.options.sourcemap?new noop(r,this.options):new j(r,this.options),a=o.compile();this.options.sourcemap&&(this.sourcemap=o.map.toJSON())}catch(n){var h={};if(h.input=n.input||this.str,h.filename=n.filename||this.options.filename,h.lineno=n.lineno||e.lexer.lineno,h.column=n.column||e.lexer.column,!t)throw _export_formatException_(n,h);return t(_export_formatException_(n,h))}var l=this.listeners("end");for(t&&l.push(t),n=0,i=l.length;n<i;n++){var c=l[n](null,a);c&&(a=c)}if(!t)return a},Renderer.prototype.deps=function(t){var e=_export_merge_({cache:!1},this.options);t&&(e.filename=t);var n=Xt,i=new Dt(this.str,e);try{return qt.filename=e.filename,new n(i.parse(),e).resolve()}catch(t){var r={};throw r.input=t.input||this.str,r.filename=t.filename||e.filename,r.lineno=t.lineno||i.lexer.lineno,r.column=t.column||i.lexer.column,_export_formatException_(t,r)}},Renderer.prototype.set=function(t,e){return this.options[t]=e,this},Renderer.prototype.get=function(t){return this.options[t]},Renderer.prototype.include=function(t){return this.options.paths.push(t),this},Renderer.prototype.use=function(t){return t.call(this,this),this},Renderer.prototype.define=function(t,e,n){