From 6897a1916b749c050562bb7aa18b182a988fb5df Mon Sep 17 00:00:00 2001
From: Daniel Puckowski
Date: Sun, 20 Aug 2023 10:09:16 -0400
Subject: [PATCH] fix(issue:4211) parse entities in comma list
correctly parse all entities in a comma separated list such that all
URLs are rewritten correctly
---
dist/less.js | 11 ++++++++++-
dist/less.min.js | 2 +-
dist/less.min.js.map | 2 +-
packages/less/dist/less.js | 11 ++++++++++-
packages/less/dist/less.min.js | 2 +-
packages/less/dist/less.min.js.map | 2 +-
packages/less/src/less/parser/parser.js | 4 ++++
packages/less/src/less/tree/expression.js | 8 +++++++-
8 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/dist/less.js b/dist/less.js
index 1c06b3e9c..c93afa6f3 100644
--- a/dist/less.js
+++ b/dist/less.js
@@ -4706,6 +4706,10 @@
if (e) {
value.push(e);
}
+ if (parserInput.peek(',')) {
+ value.push(new (tree.Anonymous)(',', parserInput.i));
+ parserInput.$char(',');
+ }
} while (e);
done = testCurrentChar();
if (value.length > 0) {
@@ -7125,7 +7129,12 @@
for (var i_1 = 0; i_1 < this.value.length; i_1++) {
this.value[i_1].genCSS(context, output);
if (!this.noSpacing && i_1 + 1 < this.value.length) {
- output.add(' ');
+ if (!this.noSpacing && i_1 + 1 < this.value.length) {
+ if (i_1 + 1 < this.value.length && !(this.value[i_1 + 1] instanceof Anonymous) ||
+ this.value[i_1 + 1] instanceof Anonymous && this.value[i_1 + 1].value !== ',') {
+ output.add(' ');
+ }
+ }
}
}
},
diff --git a/dist/less.min.js b/dist/less.min.js
index 44a6df818..f4d168e48 100644
--- a/dist/less.min.js
+++ b/dist/less.min.js
@@ -7,5 +7,5 @@
*
* @license Apache-2.0
*/
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).less=t()}(this,(function(){"use strict";function e(e){return e.replace(/^[a-z-]+:\/+?[^/]+/,"").replace(/[?&]livereload=\w+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^.\w-]+/g,"-").replace(/\./g,":")}function t(e,t){if(t)for(var i in t.dataset)if(Object.prototype.hasOwnProperty.call(t.dataset,i))if("env"===i||"dumpLineNumbers"===i||"rootpath"===i||"errorReporting"===i)e[i]=t.dataset[i];else try{e[i]=JSON.parse(t.dataset[i])}catch(e){}}var i=function(t,i,n){var r=n.href||"",s="less:"+(n.title||e(r)),o=t.getElementById(s),a=!1,l=t.createElement("style");l.setAttribute("type","text/css"),n.media&&l.setAttribute("media",n.media),l.id=s,l.styleSheet||(l.appendChild(t.createTextNode(i)),a=null!==o&&o.childNodes.length>0&&l.childNodes.length>0&&o.firstChild.nodeValue===l.firstChild.nodeValue);var u=t.getElementsByTagName("head")[0];if(null===o||!1===a){var c=n&&n.nextSibling||null;c?c.parentNode.insertBefore(l,c):u.appendChild(l)}if(o&&!1===a&&o.parentNode.removeChild(o),l.styleSheet)try{l.styleSheet.cssText=i}catch(e){throw new Error("Couldn't reassign styleSheet.cssText.")}},n=function(e){var t,i=e.document;return i.currentScript||(t=i.getElementsByTagName("script"))[t.length-1]},r={error:function(e){this._fireEvent("error",e)},warn:function(e){this._fireEvent("warn",e)},info:function(e){this._fireEvent("info",e)},debug:function(e){this._fireEvent("debug",e)},addListener:function(e){this._listeners.push(e)},removeListener:function(e){for(var t=0;t=0;a--){var l=o[a];if(l[s?"supportsSync":"supports"](e,t,i,n))return l}return null},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},e}(),o={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},a={length:{m:1,cm:.01,mm:.001,in:.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:1/400,turn:1}},l={colors:o,unitConversions:a},u=function(){function e(){this.parent=null,this.visibilityBlocks=void 0,this.nodeVisible=void 0,this.rootNode=null,this.parsed=null}return Object.defineProperty(e.prototype,"currentFileInfo",{get:function(){return this.fileInfo()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.getIndex()},enumerable:!1,configurable:!0}),e.prototype.setParent=function(t,i){function n(t){t&&t instanceof e&&(t.parent=i)}Array.isArray(t)?t.forEach(n):n(t)},e.prototype.getIndex=function(){return this._index||this.parent&&this.parent.getIndex()||0},e.prototype.fileInfo=function(){return this._fileInfo||this.parent&&this.parent.fileInfo()||{}},e.prototype.isRulesetLike=function(){return!1},e.prototype.toCSS=function(e){var t=[];return this.genCSS(e,{add:function(e,i,n){t.push(e)},isEmpty:function(){return 0===t.length}}),t.join("")},e.prototype.genCSS=function(e,t){t.add(this.value)},e.prototype.accept=function(e){this.value=e.visit(this.value)},e.prototype.eval=function(){return this},e.prototype._operate=function(e,t,i,n){switch(t){case"+":return i+n;case"-":return i-n;case"*":return i*n;case"/":return i/n}},e.prototype.fround=function(e,t){var i=e&&e.numPrecision;return i?Number((t+2e-16).toFixed(i)):t},e.compare=function(t,i){if(t.compare&&"Quoted"!==i.type&&"Anonymous"!==i.type)return t.compare(i);if(i.compare)return-i.compare(t);if(t.type===i.type){if(t=t.value,i=i.value,!Array.isArray(t))return t===i?0:void 0;if(t.length===i.length){for(var n=0;nt?1:void 0},e.prototype.blocksVisibility=function(){return void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),0!==this.visibilityBlocks},e.prototype.addVisibilityBlock=function(){void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks+1},e.prototype.removeVisibilityBlock=function(){void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks-1},e.prototype.ensureVisibility=function(){this.nodeVisible=!0},e.prototype.ensureInvisibility=function(){this.nodeVisible=!1},e.prototype.isVisible=function(){return this.nodeVisible},e.prototype.visibilityInfo=function(){return{visibilityBlocks:this.visibilityBlocks,nodeVisible:this.nodeVisible}},e.prototype.copyVisibilityInfo=function(e){e&&(this.visibilityBlocks=e.visibilityBlocks,this.nodeVisible=e.nodeVisible)},e}(),c=function(e,t,i){var n=this;Array.isArray(e)?this.rgb=e:e.length>=6?(this.rgb=[],e.match(/.{2}/g).map((function(e,t){t<3?n.rgb.push(parseInt(e,16)):n.alpha=parseInt(e,16)/255}))):(this.rgb=[],e.split("").map((function(e,t){t<3?n.rgb.push(parseInt(e+e,16)):n.alpha=parseInt(e+e,16)/255}))),this.alpha=this.alpha||("number"==typeof t?t:1),void 0!==i&&(this.value=i)};function h(e,t){return Math.min(Math.max(e,0),t)}function f(e){return"#"+e.map((function(e){return((e=h(Math.round(e),255))<16?"0":"")+e.toString(16)})).join("")}c.prototype=Object.assign(new u,{type:"Color",luma:function(){var e=this.rgb[0]/255,t=this.rgb[1]/255,i=this.rgb[2]/255;return.2126*(e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(i=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))},genCSS:function(e,t){t.add(this.toCSS(e))},toCSS:function(e,t){var i,n,r,s=e&&e.compress&&!t,o=[];if(n=this.fround(e,this.alpha),this.value)if(0===this.value.indexOf("rgb"))n<1&&(r="rgba");else{if(0!==this.value.indexOf("hsl"))return this.value;r=n<1?"hsla":"hsl"}else n<1&&(r="rgba");switch(r){case"rgba":o=this.rgb.map((function(e){return h(Math.round(e),255)})).concat(h(n,1));break;case"hsla":o.push(h(n,1));case"hsl":i=this.toHSL(),o=[this.fround(e,i.h),this.fround(e,100*i.s)+"%",this.fround(e,100*i.l)+"%"].concat(o)}if(r)return r+"("+o.join(","+(s?"":" "))+")";if(i=this.toRGB(),s){var a=i.split("");a[1]===a[2]&&a[3]===a[4]&&a[5]===a[6]&&(i="#"+a[1]+a[3]+a[5])}return i},operate:function(e,t,i){for(var n=new Array(3),r=this.alpha*(1-i.alpha)+i.alpha,s=0;s<3;s++)n[s]=this._operate(e,t,this.rgb[s],i.rgb[s]);return new c(n,r)},toRGB:function(){return f(this.rgb)},toHSL:function(){var e,t,i=this.rgb[0]/255,n=this.rgb[1]/255,r=this.rgb[2]/255,s=this.alpha,o=Math.max(i,n,r),a=Math.min(i,n,r),l=(o+a)/2,u=o-a;if(o===a)e=t=0;else{switch(t=l>.5?u/(2-o-a):u/(o+a),o){case i:e=(n-r)/u+(n=0&&"\n"!==t.charAt(i);)r++;return"number"==typeof e&&(n=(t.slice(0,e).match(/\n/g)||"").length),{line:n,column:r}}function k(e){var t,i=e.length,n=new Array(i);for(t=0;t|Function):(\d+):(\d+)/,V=function(e,t,i){Error.call(this);var n=e.filename||i;if(this.message=e.message,this.stack=e.stack,t&&n){var r=t.contents[n],s=C(e.index,r),o=s.line,a=s.column,l=e.call&&C(e.call,r).line,u=r?r.split("\n"):"";if(this.type=e.type||"Syntax",this.filename=n,this.index=e.index,this.line="number"==typeof o?o+1:null,this.column=a,!this.line&&this.stack){var c=this.stack.match(O),h=new Function("a","throw new Error()"),f=0;try{h()}catch(e){var p=e.stack.match(O);f=1-parseInt(p[2])}c&&(c[2]&&(this.line=parseInt(c[2])+f),c[3]&&(this.column=parseInt(c[3])))}this.callLine=l+1,this.callExtract=u[l],this.extract=[u[this.line-2],u[this.line-1],u[this.line]]}};if(void 0===Object.create){var F=function(){};F.prototype=Error.prototype,V.prototype=new F}else V.prototype=Object.create(Error.prototype);V.prototype.constructor=V,V.prototype.toString=function(e){e=e||{};var t="",i=this.extract||[],n=[],r=function(e){return e};if(e.stylize){var s=typeof e.stylize;if("function"!==s)throw Error("options.stylize should be a function, got a "+s+"!");r=e.stylize}if(null!==this.line){if("string"==typeof i[0]&&n.push(r(this.line-1+" "+i[0],"grey")),"string"==typeof i[1]){var o=this.line+" ";i[1]&&(o+=i[1].slice(0,this.column)+r(r(r(i[1].substr(this.column,1),"bold")+i[1].slice(this.column+1),"red"),"inverse")),n.push(o)}"string"==typeof i[2]&&n.push(r(this.line+1+" "+i[2],"grey")),n=n.join("\n")+r("","reset")+"\n"}return t+=r(this.type+"Error: "+this.message,"red"),this.filename&&(t+=r(" in ","red")+this.filename),this.line&&(t+=r(" on line "+this.line+", column "+(this.column+1)+":","grey")),t+="\n"+n,this.callLine&&(t+=r("from ","red")+(this.filename||"")+"/n",t+=r(this.callLine,"grey")+" "+this.callExtract+"/n"),t};var $={visitDeeper:!0},L=!1;function j(e){return e}var N=function(){function e(e){this._implementation=e,this._visitInCache={},this._visitOutCache={},L||(!function e(t,i){var n,r;for(n in t)switch(typeof(r=t[n])){case"function":r.prototype&&r.prototype.type&&(r.prototype.typeIndex=i++);break;case"object":i=e(r,i)}return i}(He,1),L=!0)}return e.prototype.visit=function(e){if(!e)return e;var t=e.typeIndex;if(!t)return e.value&&e.value.typeIndex&&this.visit(e.value),e;var i,n=this._implementation,r=this._visitInCache[t],s=this._visitOutCache[t],o=$;if(o.visitDeeper=!0,r||(r=n[i="visit"+e.type]||j,s=n[i+"Out"]||j,this._visitInCache[t]=r,this._visitOutCache[t]=s),r!==j){var a=r.call(n,e,o);e&&n.isReplacing&&(e=a)}if(o.visitDeeper&&e)if(e.length)for(var l=0,u=e.length;lg.PARENS_DIVISION)||this.parensStack&&this.parensStack.length))},D.Eval.prototype.pathRequiresRewrite=function(e){return(this.rewriteUrls===b?z:T)(e)},D.Eval.prototype.rewritePath=function(e,t){var i;return t=t||"",i=this.normalizePath(t+e),z(e)&&T(t)&&!1===z(i)&&(i="./"+i),i},D.Eval.prototype.normalizePath=function(e){var t,i=e.split("/").reverse();for(e=[];0!==i.length;)switch(t=i.pop()){case".":break;case"..":0===e.length||".."===e[e.length-1]?e.push(t):e.pop();break;default:e.push(t)}return e.join("/")};var G=function(){function e(e){this.imports=[],this.variableImports=[],this._onSequencerEmpty=e,this._currentDepth=0}return e.prototype.addImport=function(e){var t=this,i={callback:e,args:null,isReady:!1};return this.imports.push(i),function(){i.args=Array.prototype.slice.call(arguments,0),i.isReady=!0,t.tryRun()}},e.prototype.addVariableImport=function(e){this.variableImports.push(e)},e.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var e=this.imports[0];if(!e.isReady)return;this.imports=this.imports.slice(1),e.callback.apply(null,e.args)}if(0===this.variableImports.length)break;var t=this.variableImports[0];this.variableImports=this.variableImports.slice(1),t()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},e}(),W=function(e,t){this._visitor=new N(this),this._importer=e,this._finish=t,this.context=new D.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new G(this._onSequencerEmpty.bind(this))};W.prototype={isReplacing:!1,run:function(e){try{this._visitor.visit(e)}catch(e){this.error=e}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(e,t){var i=e.options.inline;if(!e.css||i){var n=new D.Eval(this.context,k(this.context.frames)),r=n.frames[0];this.importCount++,e.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,e,n,r)):this.processImportNode(e,n,r)}t.visitDeeper=!1},processImportNode:function(e,t,i){var n,r=e.options.inline;try{n=e.evalForImport(t)}catch(t){t.filename||(t.index=e.getIndex(),t.filename=e.fileInfo().filename),e.css=!0,e.error=t}if(!n||n.css&&!r)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{n.options.multiple&&(t.importMultiple=!0);for(var s=void 0===n.css,o=0;o=0||(a=[u.selfSelectors[0]],(s=f.findMatch(l,a)).length&&(l.hasFoundMatches=!0,l.selfSelectors.forEach((function(e){var t=u.visibilityInfo();o=f.extendSelector(s,a,e,l.isVisible()),(c=new He.Extend(u.selector,u.option,0,u.fileInfo(),t)).selfSelectors=o,o[o.length-1].extendList=[c],h.push(c),c.ruleset=u.ruleset,c.parent_ids=c.parent_ids.concat(u.parent_ids,l.parent_ids),u.firstExtendOnThisSelectorPath&&(c.firstExtendOnThisSelectorPath=!0,u.ruleset.paths.push(o))}))));if(h.length){if(this.extendChainCount++,i>100){var p="{unable to calculate}",v="{unable to calculate}";try{p=h[0].selfSelectors[0].toCSS(),v=h[0].selector.toCSS()}catch(e){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+p+":extend("+v+")"}}return h.concat(f.doExtendChaining(h,t,i+1))}return h},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitSelector=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){if(!e.root){var i,n,r,s,o=this.allExtendsStack[this.allExtendsStack.length-1],a=[],l=this;for(r=0;r0&&u[l.matched].combinator.value!==o?l=null:l.matched++,l&&(l.finished=l.matched===u.length,l.finished&&!e.allowAfter&&(r+1u&&c>0&&(h[h.length-1].elements=h[h.length-1].elements.concat(t[u].elements.slice(c)),c=0,u++),l=s.elements.slice(c,a.index).concat([o]).concat(i.elements.slice(1)),u===a.pathIndex&&r>0?h[h.length-1].elements=h[h.length-1].elements.concat(l):(h=h.concat(t.slice(u,a.pathIndex))).push(new He.Selector(l)),u=a.endPathIndex,(c=a.endPathElementIndex)>=t[u].elements.length&&(c=0,u++);return u0&&(h[h.length-1].elements=h[h.length-1].elements.concat(t[u].elements.slice(c)),u++),h=(h=h.concat(t.slice(u,t.length))).map((function(e){var t=e.createDerived(e.elements);return n?t.ensureVisibility():t.ensureInvisibility(),t}))},e.prototype.visitMedia=function(e,t){var i=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);i=i.concat(this.doExtendChaining(i,e.allExtends)),this.allExtendsStack.push(i)},e.prototype.visitMediaOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e.prototype.visitAtRule=function(e,t){var i=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);i=i.concat(this.doExtendChaining(i,e.allExtends)),this.allExtendsStack.push(i)},e.prototype.visitAtRuleOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e}(),K=function(){function e(){this.contexts=[[]],this._visitor=new N(this)}return e.prototype.run=function(e){return this._visitor.visit(e)},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){var i,n=this.contexts[this.contexts.length-1],r=[];this.contexts.push(r),e.root||((i=e.selectors)&&(i=i.filter((function(e){return e.getIsOutput()})),e.selectors=i.length?i:i=null,i&&e.joinSelectors(r,n,i)),i||(e.rules=null),e.paths=r)},e.prototype.visitRulesetOut=function(e){this.contexts.length=this.contexts.length-1},e.prototype.visitMedia=function(e,t){var i=this.contexts[this.contexts.length-1];e.rules[0].root=0===i.length||i[0].multiMedia},e.prototype.visitAtRule=function(e,t){var i=this.contexts[this.contexts.length-1];e.rules&&e.rules.length&&(e.rules[0].root=e.isRooted||0===i.length||null)},e}(),Z=function(){function e(e){this._visitor=new N(this),this._context=e}return e.prototype.containsSilentNonBlockedChild=function(e){var t;if(!e)return!1;for(var i=0;i0},e.prototype.resolveVisibility=function(e){if(!e.blocksVisibility()){if(this.isEmpty(e))return;return e}var t=e.rules[0];if(this.keepOnlyVisibleChilds(t),!this.isEmpty(t))return e.ensureVisibility(),e.removeVisibilityBlock(),e},e.prototype.isVisibleRuleset=function(e){return!!e.firstRoot||!this.isEmpty(e)&&!(!e.root&&!this.hasVisibleSelector(e))},e}(),X=function(e){this._visitor=new N(this),this._context=e,this.utils=new Z(e)};X.prototype={isReplacing:!0,run:function(e){return this._visitor.visit(e)},visitDeclaration:function(e,t){if(!e.blocksVisibility()&&!e.variable)return e},visitMixinDefinition:function(e,t){e.frames=[]},visitExtend:function(e,t){},visitComment:function(e,t){if(!e.blocksVisibility()&&!e.isSilent(this._context))return e},visitMedia:function(e,t){var i=e.rules[0].rules;return e.accept(this._visitor),t.visitDeeper=!1,this.utils.resolveVisibility(e,i)},visitImport:function(e,t){if(!e.blocksVisibility())return e},visitAtRule:function(e,t){return e.rules&&e.rules.length?this.visitAtRuleWithBody(e,t):this.visitAtRuleWithoutBody(e,t)},visitAnonymous:function(e,t){if(!e.blocksVisibility())return e.accept(this._visitor),e},visitAtRuleWithBody:function(e,t){var i=function(e){var t=e.rules;return function(e){var t=e.rules;return 1===t.length&&(!t[0].paths||0===t[0].paths.length)}(e)?t[0].rules:t}(e);return e.accept(this._visitor),t.visitDeeper=!1,this.utils.isEmpty(e)||this._mergeRules(e.rules[0].rules),this.utils.resolveVisibility(e,i)},visitAtRuleWithoutBody:function(e,t){if(!e.blocksVisibility()){if("@charset"===e.name){if(this.charset){if(e.debugInfo){var i=new He.Comment("/* "+e.toCSS(this._context).replace(/\n/g,"")+" */\n");return i.debugInfo=e.debugInfo,this._visitor.visit(i)}return}this.charset=!0}return e}},checkValidNodes:function(e,t){if(e)for(var i=0;i0?e.accept(this._visitor):e.rules=null,t.visitDeeper=!1}return e.rules&&(this._mergeRules(e.rules),this._removeDuplicateRules(e.rules)),this.utils.isVisibleRuleset(e)&&(e.ensureVisibility(),n.splice(0,0,e)),1===n.length?n[0]:n},_compileRulesetPaths:function(e){e.paths&&(e.paths=e.paths.filter((function(e){var t;for(" "===e[0].elements[0].combinator.value&&(e[0].elements[0].combinator=new He.Combinator("")),t=0;t=0;n--)if((i=e[n])instanceof He.Declaration)if(r[i.name]){(t=r[i.name])instanceof He.Declaration&&(t=r[i.name]=[r[i.name].toCSS(this._context)]);var s=i.toCSS(this._context);-1!==t.indexOf(s)?e.splice(n,1):t.push(s)}else r[i.name]=i}},_mergeRules:function(e){if(e){for(var t={},i=[],n=0;n0){var t=e[0],i=[],n=[new He.Expression(i)];e.forEach((function(e){"+"===e.merge&&i.length>0&&n.push(new He.Expression(i=[])),i.push(e.value),t.important=t.important||e.important})),t.value=new He.Value(n)}}))}}};var Y={Visitor:N,ImportVisitor:W,MarkVisibleSelectorsVisitor:J,ExtendVisitor:Q,JoinSelectorVisitor:K,ToCSSVisitor:X};var ee=function(){var e,t,i,n,r,s,o,a=[],l={};function u(i){for(var n,a,c,h=l.i,f=t,p=l.i-o,v=l.i+s.length-p,d=l.i+=i,m=e;l.i=0){c={index:l.i,text:m.substr(l.i,y+2-l.i),isLineComment:!1},l.i+=c.text.length-1,l.commentStore.push(c);continue}}break}if(32!==n&&10!==n&&9!==n&&13!==n)break}if(s=s.slice(i+l.i-d+p),o=l.i,!s.length){if(ti||l.i===i&&e&&!n)&&(i=l.i,n=e);var r=a.pop();s=r.current,o=l.i=r.i,t=r.j},l.forget=function(){a.pop()},l.isWhitespace=function(t){var i=l.i+(t||0),n=e.charCodeAt(i);return 32===n||13===n||9===n||10===n},l.$re=function(e){l.i>o&&(s=s.slice(l.i-o),o=l.i);var t=e.exec(s);return t?(u(t[0].length),"string"==typeof t?t:1===t.length?t[0]:t):null},l.$char=function(t){return e.charAt(l.i)!==t?null:(u(1),t)},l.$peekChar=function(t){return e.charAt(l.i)!==t?null:t},l.$str=function(t){for(var i=t.length,n=0;nh&&(d=!1)}}while(d);return r||null},l.autoCommentAbsorb=!0,l.commentStore=[],l.finished=!1,l.peek=function(t){if("string"==typeof t){for(var i=0;i57||t<43||47===t||44===t},l.start=function(n,a,c){e=n,l.i=t=o=i=0,r=a?function(e,t){var i,n,r,s,o,a,l,u,c,h=e.length,f=0,p=0,v=[],d=0;function m(t){var i=o-d;i<512&&!t||!i||(v.push(e.slice(d,o+1)),d=o+1)}for(o=0;o=97&&l<=122||l<34))switch(l){case 40:p++,n=o;continue;case 41:if(--p<0)return t("missing opening `(`",o);continue;case 59:p||m();continue;case 123:f++,i=o;continue;case 125:if(--f<0)return t("missing opening `{`",o);f||p||m();continue;case 92:if(o96)){if(u==l){c=1;break}if(92==u){if(o==h-1)return t("unescaped `\\`",o);o++}}if(c)continue;return t("unmatched `"+String.fromCharCode(l)+"`",a);case 47:if(p||o==h-1)continue;if(47==(u=e.charCodeAt(o+1)))for(o+=2;oi&&s>r?"missing closing `}` or `*/`":"missing closing `}`",i):0!==p?t("missing closing `)`",n):(m(!0),v)}(n,c):[n],s=r[0],u(0)},l.end=function(){var t,r=l.i>=e.length;return l.i=e.length-1,furthestChar:e[l.i]}},l};var te=function e(t){return{_data:{},add:function(e,t){e=e.toLowerCase(),this._data.hasOwnProperty(e),this._data[e]=t},addMultiple:function(e){var t=this;Object.keys(e).forEach((function(i){t.add(i,e[i])}))},get:function(e){return this._data[e]||t&&t.get(e)},getLocalFunctions:function(){return this._data},inherit:function(){return e(this)},create:function(t){return e(t)}}}(null),ie={queryInParens:!0},ne={queryInParens:!0},re=function e(t,i,n,r){var s;r=r||0;var o=ee();function a(e,t){throw new V({index:o.i,filename:n.filename,type:t||"Syntax",message:e},i)}function l(e,t){var i=e instanceof Function?e.call(s):o.$re(e);if(i)return i;a(t||("string"==typeof e?"expected '"+e+"' got '"+o.currentChar()+"'":"unexpected token"))}function u(e,t){if(o.$char(e))return e;a(t||"expected '"+e+"' got '"+o.currentChar()+"'")}function c(e){var t=n.filename;return{lineNumber:C(e,o.getInput()).line+1,fileName:t}}return{parserInput:o,imports:i,fileInfo:n,parseNode:function(e,t,a){var l,u=[],c=o;try{c.start(e,!1,(function(e,t){a({message:e,index:t+r})}));for(var h=0,f=void 0;f=t[h];h++)l=s[f](),u.push(l||null);c.end().isFinished?a(null,u):a(!0,null)}catch(e){throw new V({index:e.index+r,message:e.message},i,n.filename)}},parse:function(r,l,u){var c,h,f,p,v=null,d="";if(u&&u.disablePluginRule&&(s.plugin=function(){o.$re(/^@plugin?\s+/)&&a("@plugin statements are not allowed when disablePluginRule is set to true")}),h=u&&u.globalVars?e.serializeVars(u.globalVars)+"\n":"",f=u&&u.modifyVars?"\n"+e.serializeVars(u.modifyVars):"",t.pluginManager)for(var m=t.pluginManager.getPreProcessors(),g=0;g");return e},args:function(e){var t,i,n,r,l,u,c,h=s.entities,f={args:null,variadic:!1},p=[],v=[],d=[],m=!0;for(o.save();;){if(e)u=s.detachedRuleset()||s.expression();else{if(o.commentStore.length=0,o.$str("...")){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({variadic:!0});break}u=h.variable()||h.property()||h.literal()||h.keyword()||this.call(!0)}if(!u||!m)break;r=null,u.throwAwayComments&&u.throwAwayComments(),l=u;var g=null;if(e?u.value&&1==u.value.length&&(g=u.value[0]):g=u,g&&(g instanceof He.Variable||g instanceof He.Property))if(o.$char(":")){if(p.length>0&&(t&&a("Cannot mix ; and , as delimiter types"),i=!0),!(l=s.detachedRuleset()||s.expression())){if(!e)return o.restore(),f.args=[],f;a("could not understand value for named argument")}r=n=g.name}else if(o.$str("...")){if(!e){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({name:u.name,variadic:!0});break}c=!0}else e||(n=r=g.name,l=null);l&&p.push(l),d.push({name:r,value:l,expand:c}),o.$char(",")?m=!0:((m=";"===o.$char(";"))||t)&&(i&&a("Cannot mix ; and , as delimiter types"),t=!0,p.length>1&&(l=new He.Value(p)),v.push({name:n,value:l,expand:c}),n=null,p=[],i=!1)}return o.forget(),f.args=t?v:d,f},definition:function(){var e,t,i,n,r=[],a=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),t=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){e=t[1];var u=this.args(!1);if(r=u.args,a=u.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(n=l(s.conditions,"expected condition")),i=s.block())return o.forget(),new He.mixin.Definition(e,r,i,n,a);o.restore()}else o.restore()},ruleLookups:function(){var e,t=[];if("["===o.currentChar()){for(;;){if(o.save(),!(e=this.lookupValue())&&""!==e){o.restore();break}t.push(e),o.forget()}return t.length>0?t:void 0}},lookupValue:function(){if(o.save(),o.$char("[")){var e=o.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);if(o.$char("]"))return e||""===e?(o.forget(),e):void o.restore();o.restore()}else o.restore()}},entity:function(){var e=this.entities;return this.comment()||e.literal()||e.variable()||e.url()||e.property()||e.call()||e.keyword()||this.mixin.call(!0)||e.javascript()},end:function(){return o.$char(";")||o.peek("}")},ieAlpha:function(){var e;if(o.$re(/^opacity=/i))return(e=o.$re(/^\d+/))||(e="@{"+(e=l(s.entities.variable,"Could not parse alpha")).name.slice(1)+"}"),u(")"),new He.Quoted("","alpha(opacity="+e+")")},element:function(){var e,t,i,s=o.i;if(t=this.combinator(),(e=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[.#:](?=@)/)||this.entities.variableCurly())||(o.save(),o.$char("(")?(i=this.selector(!1))&&o.$char(")")?(e=new He.Paren(i),o.forget()):o.restore("Missing closing ')'"):o.forget()),e)return new He.Element(t,e,e instanceof He.Variable,s+r,n)},combinator:function(){var e=o.currentChar();if("/"===e){o.save();var t=o.$re(/^\/[a-z]+\//i);if(t)return o.forget(),new He.Combinator(t);o.restore()}if(">"===e||"+"===e||"~"===e||"|"===e||"^"===e){for(o.i++,"^"===e&&"^"===o.currentChar()&&(e="^^",o.i++);o.isWhitespace();)o.i++;return new He.Combinator(e)}return o.isWhitespace(-1)?new He.Combinator(" "):new He.Combinator(null)},selector:function(e){var t,i,s,u,c,h,f,p=o.i;for(e=!1!==e;(e&&(i=this.extend())||e&&(h=o.$str("when"))||(u=this.element()))&&(h?f=l(this.conditions,"expected condition"):f?a("CSS guard can only be used at the end of selector"):i?c=c?c.concat(i):i:(c&&a("Extend can only be used at the end of selector"),s=o.currentChar(),t?t.push(u):t=[u],u=null),"{"!==s&&"}"!==s&&";"!==s&&","!==s&&")"!==s););if(t)return new He.Selector(t,c,f,p+r,n);c&&a("Extend must be used to extend a selector, it cannot be used on its own")},selectors:function(){for(var e,t;(e=this.selector())&&(t?t.push(e):t=[e],o.commentStore.length=0,e.condition&&t.length>1&&a("Guards are only currently allowed on a single selector."),o.$char(","));)e.condition&&a("Guards are only currently allowed on a single selector."),o.commentStore.length=0;return t},attribute:function(){if(o.$char("[")){var e,t,i,n,r=this.entities;return(e=r.variableCurly())||(e=l(/^(?:[_A-Za-z0-9-*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),(i=o.$re(/^[|~*$^]?=/))&&(t=r.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||r.variableCurly())&&(n=o.$re(/^[iIsS]/)),u("]"),new He.Attribute(e,i,t,n)}},block:function(){var e;if(o.$char("{")&&(e=this.primary())&&o.$char("}"))return e},blockRuleset:function(){var e=this.block();return e&&(e=new He.Ruleset(null,e)),e},detachedRuleset:function(){var e,t,i;if(o.save(),!o.$re(/^[.#]\(/)||(t=(e=this.mixin.args(!1)).args,i=e.variadic,o.$char(")"))){var n=this.blockRuleset();if(n)return o.forget(),t?new He.mixin.Definition(null,t,n,null,i):new He.DetachedRuleset(n);o.restore()}else o.restore()},ruleset:function(){var e,i,n;if(o.save(),t.dumpLineNumbers&&(n=c(o.i)),(e=this.selectors())&&(i=this.block())){o.forget();var r=new He.Ruleset(e,i,t.strictImports);return t.dumpLineNumbers&&(r.debugInfo=n),r}o.restore()},declaration:function(){var e,t,i,s,a,l,u=o.i,c=o.currentChar();if("."!==c&&"#"!==c&&"&"!==c&&":"!==c)if(o.save(),e=this.variable()||this.ruleProperty()){if((l="string"==typeof e)&&(t=this.detachedRuleset())&&(i=!0),o.commentStore.length=0,!t){if(a=!l&&e.length>1&&e.pop().value,t=e[0].value&&"--"===e[0].value.slice(0,2)?this.permissiveValue(/[;}]/):this.anonymousValue())return o.forget(),new He.Declaration(e,t,!1,a,u+r,n);t||(t=this.value()),t?s=this.important():l&&(t=this.permissiveValue())}if(t&&(this.end()||i))return o.forget(),new He.Declaration(e,t,s,a,u+r,n);o.restore()}else o.restore()},anonymousValue:function(){var e=o.i,t=o.$re(/^([^.#@$+/'"*`(;{}-]*);/);if(t)return new He.Anonymous(t[1],e+r)},permissiveValue:function(e){var t,i,r,s,l=e||";",u=o.i,c=[];function h(){var e=o.currentChar();return"string"==typeof l?e===l:l.test(e)}if(!h()){s=[];do{((i=this.comment())||(i=this.entity()))&&s.push(i)}while(i);if(r=h(),s.length>0){if(s=new He.Expression(s),r)return s;c.push(s)," "===o.prevChar()&&c.push(new He.Anonymous(" ",u))}if(o.save(),s=o.$parseUntil(l)){if("string"==typeof s&&a("Expected '"+s+"'","Parse"),1===s.length&&" "===s[0])return o.forget(),new He.Anonymous("",u);var f=void 0;for(t=0;t]=|<=|>=|[<>]|=)/)?(o.restore(),i=this.condition(),o.save(),(s=this.atomicCondition(null,i.rvalue))||o.restore()):(o.restore(),t=this.value()),o.$char(")")?i&&!t?(u.push(new He.Paren(new He.QueryInParens(i.op,i.lvalue,i.rvalue,s?s.op:null,s?s.rvalue:null,i._index))),t=i):i&&t?u.push(new He.Paren(new He.Declaration(i,t,null,null,o.i+r,n,!0))):t?u.push(new He.Paren(t)):a("badly formed media feature definition"):a("Missing closing ')'","Parse"))}while(t);if(o.forget(),u.length>0)return new He.Expression(u)},mediaFeatures:function(e){var t,i=this.entities,n=[];do{if(t=this.mediaFeature(e)){if(n.push(t),!o.$char(","))break}else if((t=i.variable()||i.mixinLookup())&&(n.push(t),!o.$char(",")))break}while(t);return n.length>0?n:null},prepareAndGetNestableAtRule:function(e,i,s,l){var u=this.mediaFeatures(l),c=this.block();c||a("media definitions require block statements after any features"),o.forget();var h=new e(c,u,i+r,n);return t.dumpLineNumbers&&(h.debugInfo=s),h},nestableAtRule:function(){var e,i=o.i;if(t.dumpLineNumbers&&(e=c(i)),o.save(),o.$peekChar("@")){if(o.$str("@media"))return this.prepareAndGetNestableAtRule(He.Media,i,e,ie);if(o.$str("@container"))return this.prepareAndGetNestableAtRule(He.Container,i,e,ne)}o.restore()},plugin:function(){var e,t,i,s=o.i;if(o.$re(/^@plugin\s+/)){if(i=(t=this.pluginArgs())?{pluginArgs:t,isPlugin:!0}:{isPlugin:!0},e=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=s,a("missing semi-colon on @plugin")),new He.Import(e,null,i,s+r,n);o.i=s,a("malformed @plugin statement")}},pluginArgs:function(){if(o.save(),!o.$char("("))return o.restore(),null;var e=o.$re(/^\s*([^);]+)\)\s*/);return e[1]?(o.forget(),e[1].trim()):(o.restore(),null)},atrule:function(){var e,i,s,l,u,h,f,p=o.i,v=!0,d=!0;if("@"===o.currentChar()){if(i=this.import()||this.plugin()||this.nestableAtRule())return i;if(o.save(),e=o.$re(/^@[a-z-]+/)){switch(l=e,"-"==e.charAt(1)&&e.indexOf("-",2)>0&&(l="@"+e.slice(e.indexOf("-",2)+1)),l){case"@charset":u=!0,v=!1;break;case"@namespace":h=!0,v=!1;break;case"@keyframes":case"@counter-style":u=!0;break;case"@document":case"@supports":f=!0,d=!1;break;default:f=!0}if(o.commentStore.length=0,u?(i=this.entity())||a("expected "+e+" identifier"):h?(i=this.expression())||a("expected "+e+" expression"):f&&(i=this.permissiveValue(/^[{;]/),v="{"===o.currentChar(),i?i.value||(i=null):v||";"===o.currentChar()||a(e+" rule is missing block or ending semi-colon")),v&&(s=this.blockRuleset()),s||!v&&i&&o.$char(";"))return o.forget(),new He.AtRule(e,i,s,p+r,n,t.dumpLineNumbers?c(p):null,d);o.restore("at-rule options not recognised")}}},value:function(){var e,t=[],i=o.i;do{if((e=this.expression())&&(t.push(e),!o.$char(",")))break}while(e);if(t.length>0)return new He.Value(t,i+r)},important:function(){if("!"===o.currentChar())return o.$re(/^! *important/)},sub:function(){var e,t;if(o.save(),o.$char("("))return(e=this.addition())&&o.$char(")")?(o.forget(),(t=new He.Expression([e])).parens=!0,t):void o.restore("Expected ')'");o.restore()},multiplication:function(){var e,t,i,n,r;if(e=this.operand()){for(r=o.isWhitespace(-1);!o.peek(/^\/[*/]/);){if(o.save(),!(i=o.$char("/")||o.$char("*")||o.$str("./"))){o.forget();break}if(!(t=this.operand())){o.restore();break}o.forget(),e.parensInOp=!0,t.parensInOp=!0,n=new He.Operation(i,[n||e,t],r),r=o.isWhitespace(-1)}return n||e}},addition:function(){var e,t,i,n,r;if(e=this.multiplication()){for(r=o.isWhitespace(-1);(i=o.$re(/^[-+]\s+/)||!r&&(o.$char("+")||o.$char("-")))&&(t=this.multiplication());)e.parensInOp=!0,t.parensInOp=!0,n=new He.Operation(i,[n||e,t],r),r=o.isWhitespace(-1);return n||e}},conditions:function(){var e,t,i,n=o.i;if(e=this.condition(!0)){for(;o.peek(/^,\s*(not\s*)?\(/)&&o.$char(",")&&(t=this.condition(!0));)i=new He.Condition("or",i||e,t,n+r);return i||e}},condition:function(e){var t,i,n;if(t=this.conditionAnd(e)){if(i=o.$str("or")){if(!(n=this.condition(e)))return;t=new He.Condition(i,t,n)}return t}},conditionAnd:function(e){var t,i,n,r,s=this;if(t=(r=s.negatedCondition(e)||s.parenthesisCondition(e))||e?r:s.atomicCondition(e)){if(i=o.$str("and")){if(!(n=this.conditionAnd(e)))return;t=new He.Condition(i,t,n)}return t}},negatedCondition:function(e){if(o.$str("not")){var t=this.parenthesisCondition(e);return t&&(t.negate=!t.negate),t}},parenthesisCondition:function(e){var t;if(o.save(),o.$str("(")){if(t=function(t){var i;if(o.save(),i=t.condition(e)){if(o.$char(")"))return o.forget(),i;o.restore()}else o.restore()}(this))return o.forget(),t;if(t=this.atomicCondition(e)){if(o.$char(")"))return o.forget(),t;o.restore("expected ')' got '"+o.currentChar()+"'")}else o.restore()}else o.restore()},atomicCondition:function(e,t){var i,n,s,l,u=this.entities,c=o.i,h=function(){return this.addition()||u.keyword()||u.quoted()||u.mixinLookup()}.bind(this);if(i=t||h())return o.$char(">")?l=o.$char("=")?">=":">":o.$char("<")?l=o.$char("=")?"<=":"<":o.$char("=")&&(l=o.$char(">")?"=>":o.$char("<")?"=<":"="),l?(n=h())?s=new He.Condition(l,i,n,c+r,!1):a("expected expression"):t||(s=new He.Condition("=",i,new He.Keyword("true"),c+r,!1)),s},operand:function(){var e,t=this.entities;o.peek(/^-[@$(]/)&&(e=o.$char("-"));var i=this.sub()||t.dimension()||t.color()||t.variable()||t.property()||t.call()||t.quoted(!0)||t.colorKeyword()||t.mixinLookup();return e&&(i.parensInOp=!0,i=new He.Negative(i)),i},expression:function(){var e,t,i=[],n=o.i;do{(e=this.comment())?i.push(e):((e=this.addition()||this.entity())instanceof He.Comment&&(e=null),e&&(i.push(e),o.peek(/^\/[/*]/)||(t=o.$char("/"))&&i.push(new He.Anonymous(t,n+r))))}while(e);if(i.length>0)return new He.Expression(i)},property:function(){var e=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(e)return e[1]},ruleProperty:function(){var e,t,i=[],s=[];o.save();var a=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(a)return i=[new He.Keyword(a[1])],o.forget(),i;function l(e){var t=o.i,n=o.$re(e);if(n)return s.push(t),i.push(n[1])}for(l(/^(\*?)/);l(/^((?:[\w-]+)|(?:[@$]\{[\w-]+\}))/););if(i.length>1&&l(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===i[0]&&(i.shift(),s.shift()),t=0;t0;e--){var t=this.rules[e-1];if(t instanceof ce)return this.parseValue(t)}},parseValue:function(e){var t=this;function i(e){return e.value instanceof le&&!e.parsed?("string"==typeof e.value.value?new re(this.parse.context,this.parse.importManager,e.fileInfo(),e.value.getIndex()).parseNode(e.value.value,["value","important"],(function(t,i){t&&(e.parsed=!0),i&&(e.value=i[0],e.important=i[1]||"",e.parsed=!0)})):e.parsed=!0,e):e}if(Array.isArray(e)){var n=[];return e.forEach((function(e){n.push(i.call(t,e))})),n}return i.call(t,e)},rulesets:function(){if(!this.rules)return[];var e,t,i=[],n=this.rules;for(e=0;t=n[e];e++)t.isRuleset&&i.push(t);return i},prependRule:function(e){var t=this.rules;t?t.unshift(e):this.rules=[e],this.setParent(e,this)},find:function(e,t,i){t=t||this;var n,r,s=[],o=e.toCSS();return o in this._lookups?this._lookups[o]:(this.rulesets().forEach((function(o){if(o!==t)for(var a=0;an){if(!i||i(o)){r=o.find(new se(e.elements.slice(n)),t,i);for(var l=0;l0&&t.add(l),e.firstSelector=!0,o[0].genCSS(e,t),e.firstSelector=!1,n=1;n0?(s=(r=k(e)).pop(),o=n.createDerived(k(s.elements))):o=n.createDerived([]),t.length>0){var a=i.combinator,l=t[0].elements[0];a.emptyOrWhitespace&&!l.combinator.emptyOrWhitespace&&(a=l.combinator),o.elements.push(new m(a,l.value,i.isVariable,i._index,i._fileInfo)),o.elements=o.elements.concat(t[0].elements.slice(1))}if(0!==o.elements.length&&r.push(o),t.length>1){var u=t.slice(1);u=u.map((function(e){return e.createDerived(e.elements,[])})),r=r.concat(u)}return r}function o(e,t,i,n,r){var o;for(o=0;o0?n[n.length-1]=n[n.length-1].createDerived(n[n.length-1].elements.concat(e)):n.push(new se(e));else t.push([new se(e)])}function l(e,t){var i=t.createDerived(t.elements,t.extendList,t.evaldCondition);return i.copyVisibilityInfo(e),i}var u,c;if(!function e(t,i,l){var u,c,h,f,v,d,g,y,b,w,x,S,I=!1;for(f=[],v=[[]],u=0;y=l.elements[u];u++)if("&"!==y.value){var C=(S=void 0,(x=y).value instanceof p&&(S=x.value.value)instanceof se?S:null);if(null!==C){a(f,v);var k,_=[],A=[];for(k=e(_,i,C),I=I||k,h=0;h<_.length;h++){o(v,[r(n(_[h],y),y)],y,l,A)}v=A,f=[]}else f.push(y)}else{for(I=!0,d=[],a(f,v),c=0;c0&&g[0].elements.push(new m(y.combinator,"",y.isVariable,y._index,y._fileInfo)),d.push(g);else for(h=0;h0&&(t.push(v[u]),w=v[u][b-1],v[u][b-1]=w.createDerived(w.elements,l.extendList));return I}(c=[],t,i))if(t.length>0)for(c=[],u=0;u0)for(t=0;t-1e-6&&(n=i.toFixed(20).replace(/0+$/,"")),e&&e.compress){if(0===i&&this.unit.isLength())return void t.add(n);i>0&&i<1&&(n=n.substr(1))}t.add(n),this.unit.genCSS(e,t)},operate:function(e,t,i){var n=this._operate(e,t,this.value,i.value),r=this.unit.clone();if("+"===t||"-"===t)if(0===r.numerator.length&&0===r.denominator.length)r=i.unit.clone(),this.unit.backupUnit&&(r.backupUnit=this.unit.backupUnit);else if(0===i.unit.numerator.length&&0===r.denominator.length);else{if(i=i.convertTo(this.unit.usedUnits()),e.strictUnits&&i.unit.toString()!==r.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+r.toString()+"' and '"+i.unit.toString()+"'.");n=this._operate(e,t,this.value,i.value)}else"*"===t?(r.numerator=r.numerator.concat(i.unit.numerator).sort(),r.denominator=r.denominator.concat(i.unit.denominator).sort(),r.cancel()):"/"===t&&(r.numerator=r.numerator.concat(i.unit.denominator).sort(),r.denominator=r.denominator.concat(i.unit.numerator).sort(),r.cancel());return new we(n,r)},compare:function(e){var t,i;if(e instanceof we){if(this.unit.isEmpty()||e.unit.isEmpty())t=this,i=e;else if(t=this.unify(),i=e.unify(),0!==t.unit.compare(i.unit))return;return u.numericCompare(t.value,i.value)}},unify:function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},convertTo:function(e){var t,i,n,r,s,o=this.value,l=this.unit.clone(),u={};if("string"==typeof e){for(t in a)a[t].hasOwnProperty(e)&&((u={})[t]=e);e=u}for(i in s=function(e,t){return n.hasOwnProperty(e)?(t?o/=n[e]/n[r]:o*=n[e]/n[r],r):e},e)e.hasOwnProperty(i)&&(r=e[i],n=a[i],l.map(s));return l.cancel(),new we(o,l)}});var xe=g,Se=function(e,t,i){this.op=e.trim(),this.operands=t,this.isSpaced=i};Se.prototype=Object.assign(new u,{type:"Operation",accept:function(e){this.operands=e.visitArray(this.operands)},eval:function(e){var t,i=this.operands[0].eval(e),n=this.operands[1].eval(e);if(e.isMathOn(this.op)){if(t="./"===this.op?"/":this.op,i instanceof we&&n instanceof c&&(i=i.toColor()),n instanceof we&&i instanceof c&&(n=n.toColor()),!i.operate||!n.operate){if((i instanceof Se||n instanceof Se)&&"/"===i.op&&e.math===xe.PARENS_DIVISION)return new Se(this.op,[i,n],this.isSpaced);throw{type:"Operation",message:"Operation on an invalid type"}}return i.operate(e,t,n)}return new Se(this.op,[i,n],this.isSpaced)},genCSS:function(e,t){this.operands[0].genCSS(e,t),this.isSpaced&&t.add(" "),t.add(this.op),this.isSpaced&&t.add(" "),this.operands[1].genCSS(e,t)}});var Ie=function(){return(Ie=Object.assign||function(e){for(var t,i=1,n=arguments.length;i1?t=new Ce(this.value.map((function(t){return t.eval?t.eval(e):t})),this.noSpacing):1===this.value.length?(!this.value[0].parens||this.value[0].parensInOp||e.inCalc||(r=!0),t=this.value[0].eval(e)):t=this,n&&e.outOfParenthesis(),!this.parens||!this.parensInOp||i||r||t instanceof we||(t=new p(t)),t},genCSS:function(e,t){for(var i=0;i1){var i=new se([],null,null,this.getIndex(),this.fileInfo()).createEmptySelectors();(t=new me(i,e.mediaBlocks)).multiMedia=!0,t.copyVisibilityInfo(this.visibilityInfo()),this.setParent(t,this)}return delete e.mediaBlocks,delete e.mediaPath,t},evalNested:function(e){var t,i,n=e.mediaPath.concat([this]);for(t=0;t0;t--)e.splice(t,0,new le("and"));return new Ce(e)}))),this.setParent(this.features,this),new me([],[])},permute:function(e){if(0===e.length)return[];if(1===e.length)return e[0];for(var t=[],i=this.permute(e.slice(1)),n=0;n1?"["+e.value.map((function(e){return e.toCSS()})).join(", ")+"]":e.toCSS()}});var Le=function(e,t,i,n){this.escaped=t,this.expression=e,this._index=i,this._fileInfo=n};Le.prototype=Object.assign(new $e,{type:"JavaScript",eval:function(e){var t=this.evaluateJavaScript(this.expression,e),i=typeof t;return"number"!==i||isNaN(t)?"string"===i?new Ee('"'+t+'"',t,this.escaped,this._index):Array.isArray(t)?new le(t.join(", ")):new le(t):new we(t)}});var je=function(e,t){this.key=e,this.value=t};je.prototype=Object.assign(new u,{type:"Assignment",accept:function(e){this.value=e.visit(this.value)},eval:function(e){return this.value.eval?new je(this.key,this.value.eval(e)):this},genCSS:function(e,t){t.add(this.key+"="),this.value.genCSS?this.value.genCSS(e,t):t.add(this.value)}});var Ne=function(e,t,i,n,r){this.op=e.trim(),this.lvalue=t,this.rvalue=i,this._index=n,this.negate=r};Ne.prototype=Object.assign(new u,{type:"Condition",accept:function(e){this.lvalue=e.visit(this.lvalue),this.rvalue=e.visit(this.rvalue)},eval:function(e){var t=function(e,t,i){switch(e){case"and":return t&&i;case"or":return t||i;default:switch(u.compare(t,i)){case-1:return"<"===e||"=<"===e||"<="===e;case 0:return"="===e||">="===e||"=<"===e||"<="===e;case 1:return">"===e||">="===e;default:return!1}}}(this.op,this.lvalue.eval(e),this.rvalue.eval(e));return this.negate?!t:t}});var De=function(e,t,i,n,r,s){this.op=e.trim(),this.lvalue=t,this.mvalue=i,this.op2=n?n.trim():null,this.rvalue=r,this._index=s};De.prototype=Object.assign(new u,{type:"QueryInParens",accept:function(e){this.lvalue=e.visit(this.lvalue),this.mvalue=e.visit(this.mvalue),this.rvalue&&(this.rvalue=e.visit(this.rvalue))},eval:function(e){return this.lvalue=this.lvalue.eval(e),this.mvalue=this.mvalue.eval(e),this.rvalue&&(this.rvalue=this.rvalue.eval(e)),this},genCSS:function(e,t){this.lvalue.genCSS(e,t),t.add(" "+this.op+" "),this.mvalue.genCSS(e,t),this.rvalue&&(t.add(" "+this.op2+" "),this.rvalue.genCSS(e,t))}});var Be=function(e,t,i,n,r){this._index=i,this._fileInfo=n;var s=new se([],null,null,this._index,this._fileInfo).createEmptySelectors();this.features=new oe(t),this.rules=[new me(s,e)],this.rules[0].allowImports=!0,this.copyVisibilityInfo(r),this.allowRoot=!0,this.setParent(s,this),this.setParent(this.features,this),this.setParent(this.rules,this)};Be.prototype=Object.assign(new ge,Ie(Ie({type:"Container"},Oe),{genCSS:function(e,t){t.add("@container ",this._fileInfo,this._index),this.features.genCSS(e,t),this.outputRuleset(e,t,this.rules)},eval:function(e){e.mediaBlocks||(e.mediaBlocks=[],e.mediaPath=[]);var t=new Be(null,[],this._index,this._fileInfo,this.visibilityInfo());return this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,t.debugInfo=this.debugInfo),t.features=this.features.eval(e),e.mediaPath.push(t),e.mediaBlocks.push(t),this.rules[0].functionRegistry=e.frames[0].functionRegistry.inherit(),e.frames.unshift(this.rules[0]),t.rules=[this.rules[0].eval(e)],e.frames.shift(),e.mediaPath.pop(),0===e.mediaPath.length?t.evalTop(e):t.evalNested(e)}}));var Ue=function(e){this.value=e};Ue.prototype=Object.assign(new u,{type:"UnicodeDescriptor"});var qe=function(e){this.value=e};qe.prototype=Object.assign(new u,{type:"Negative",genCSS:function(e,t){t.add("-"),this.value.genCSS(e,t)},eval:function(e){return e.isMathOn()?new Se("*",[new we(-1),this.value]).eval(e):new qe(this.value.eval(e))}});var Te=function(e,t,i,n,r){switch(this.selector=e,this.option=t,this.object_id=Te.next_id++,this.parent_ids=[this.object_id],this._index=i,this._fileInfo=n,this.copyVisibilityInfo(r),this.allowRoot=!0,t){case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}this.setParent(this.selector,this)};Te.prototype=Object.assign(new u,{type:"Extend",accept:function(e){this.selector=e.visit(this.selector)},eval:function(e){return new Te(this.selector.eval(e),this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},clone:function(e){return new Te(this.selector,this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},findSelfSelectors:function(e){var t,i,n=[];for(t=0;t0&&i.length&&""===i[0].combinator.value&&(i[0].combinator.value=" "),n=n.concat(e[t].elements);this.selfSelectors=[new se(n)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())}}),Te.next_id=0;var ze=function(e,t,i){this.variable=e,this._index=t,this._fileInfo=i,this.allowRoot=!0};ze.prototype=Object.assign(new u,{type:"VariableCall",eval:function(e){var t,i=new Ae(this.variable,this.getIndex(),this.fileInfo()).eval(e),n=new V({message:"Could not evaluate variable call "+this.variable});if(!i.ruleset){if(i.rules)t=i;else if(Array.isArray(i))t=new me("",i);else{if(!Array.isArray(i.value))throw n;t=new me("",i.value)}i=new ye(t)}if(i.ruleset)return i.callEval(e);throw n}});var Ge=function(e,t,i,n){this.value=e,this.lookups=t,this._index=i,this._fileInfo=n};Ge.prototype=Object.assign(new u,{type:"NamespaceValue",eval:function(e){var t,i,n=this.value.eval(e);for(t=0;tthis.params.length)return!1}i=Math.min(s,this.arity);for(var o=0;o0){for(c=!0,a=0;a0)f=2;else if(f=1,p[1]+p[2]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(m)+"`",index:this.getIndex(),filename:this.fileInfo().filename};for(a=0;a0&&(e=e.slice(0,t)),(t=e.lastIndexOf("/"))<0&&(t=e.lastIndexOf("\\")),t<0?"":e.slice(0,t+1)},e.prototype.tryAppendExtension=function(e,t){return/(\.[a-z]*$)|([?;].*)$/.test(e)?e:e+t},e.prototype.tryAppendLessExtension=function(e){return this.tryAppendExtension(e,".less")},e.prototype.supportsSync=function(){return!1},e.prototype.alwaysMakePathsAbsolute=function(){return!1},e.prototype.isPathAbsolute=function(e){return/^(?:[a-z-]+:|\/|\\|#)/i.test(e)},e.prototype.join=function(e,t){return e?e+t:t},e.prototype.pathDiff=function(e,t){var i,n,r,s,o=this.extractUrlParts(e),a=this.extractUrlParts(t),l="";if(o.hostPart!==a.hostPart)return"";for(n=Math.max(a.directories.length,o.directories.length),i=0;iparseInt(t[i])?-1:1;return 0},e.prototype.versionToString=function(e){for(var t="",i=0;i1?e-1:e)<1?r+(s-r)*e*6:2*e<1?s:3*e<2?r+(s-r)*(2/3-e)*6:r}try{if(e instanceof c)return n=t?st(t):e.alpha,new c(e.rgb,n,"hsla");e=st(e)%360/360,t=tt(st(t)),i=tt(st(i)),n=tt(st(n)),r=2*i-(s=i<=.5?i*(t+1):i+t-i*t);var a=[255*o(e+1/3),255*o(e),255*o(e-1/3)];return n=st(n),new c(a,n,"hsla")}catch(e){}},hsv:function(e,t,i){return Ye.hsva(e,t,i,1)},hsva:function(e,t,i,n){var r,s;e=st(e)%360/360*360,t=st(t),i=st(i),n=st(n);var o=[i,i*(1-t),i*(1-(s=e/60-(r=Math.floor(e/60%6)))*t),i*(1-(1-s)*t)],a=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return Ye.rgba(255*o[a[r][0]],255*o[a[r][1]],255*o[a[r][2]],n)},hue:function(e){return new we(nt(e).h)},saturation:function(e){return new we(100*nt(e).s,"%")},lightness:function(e){return new we(100*nt(e).l,"%")},hsvhue:function(e){return new we(rt(e).h)},hsvsaturation:function(e){return new we(100*rt(e).s,"%")},hsvvalue:function(e){return new we(100*rt(e).v,"%")},red:function(e){return new we(e.rgb[0])},green:function(e){return new we(e.rgb[1])},blue:function(e){return new we(e.rgb[2])},alpha:function(e){return new we(nt(e).a)},luma:function(e){return new we(e.luma()*e.alpha*100,"%")},luminance:function(e){var t=.2126*e.rgb[0]/255+.7152*e.rgb[1]/255+.0722*e.rgb[2]/255;return new we(t*e.alpha*100,"%")},saturate:function(e,t,i){if(!e.rgb)return null;var n=nt(e);return void 0!==i&&"relative"===i.value?n.s+=n.s*t.value/100:n.s+=t.value/100,n.s=tt(n.s),it(e,n)},desaturate:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.s-=n.s*t.value/100:n.s-=t.value/100,n.s=tt(n.s),it(e,n)},lighten:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.l+=n.l*t.value/100:n.l+=t.value/100,n.l=tt(n.l),it(e,n)},darken:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.l-=n.l*t.value/100:n.l-=t.value/100,n.l=tt(n.l),it(e,n)},fadein:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.a+=n.a*t.value/100:n.a+=t.value/100,n.a=tt(n.a),it(e,n)},fadeout:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.a-=n.a*t.value/100:n.a-=t.value/100,n.a=tt(n.a),it(e,n)},fade:function(e,t){var i=nt(e);return i.a=t.value/100,i.a=tt(i.a),it(e,i)},spin:function(e,t){var i=nt(e),n=(i.h+t.value)%360;return i.h=n<0?360+n:n,it(e,i)},mix:function(e,t,i){i||(i=new we(50));var n=i.value/100,r=2*n-1,s=nt(e).a-nt(t).a,o=((r*s==-1?r:(r+s)/(1+r*s))+1)/2,a=1-o,l=[e.rgb[0]*o+t.rgb[0]*a,e.rgb[1]*o+t.rgb[1]*a,e.rgb[2]*o+t.rgb[2]*a],u=e.alpha*n+t.alpha*(1-n);return new c(l,u)},greyscale:function(e){return Ye.desaturate(e,new we(100))},contrast:function(e,t,i,n){if(!e.rgb)return null;if(void 0===i&&(i=Ye.rgba(255,255,255,1)),void 0===t&&(t=Ye.rgba(0,0,0,1)),t.luma()>i.luma()){var r=i;i=t,t=r}return n=void 0===n?.43:st(n),e.luma().5&&(n=1,i=e>.25?Math.sqrt(e):((16*e-12)*e+4)*e),e-(1-2*t)*n*(i-e)},hardlight:function(e,t){return lt.overlay(t,e)},difference:function(e,t){return Math.abs(e-t)},exclusion:function(e,t){return e+t-2*e*t},average:function(e,t){return(e+t)/2},negation:function(e,t){return 1-Math.abs(e+t-1)}};for(var ut in lt)lt.hasOwnProperty(ut)&&(at[ut]=at.bind(null,lt[ut]));var ct=function(e){return Array.isArray(e.value)?e.value:Array(e)},ht={_SELF:function(e){return e},"~":function(){for(var e=[],t=0;to.value)&&(h[n]=r);else{if(void 0!==l&&a!==l)throw{type:"Argument",message:"incompatible types"};f[a]=h.length,h.push(r)}else Array.isArray(t[i].value)&&Array.prototype.push.apply(t,Array.prototype.slice.call(t[i].value));return 1==h.length?h[0]:(t=h.map((function(e){return e.toCSS(c.context)})).join(this.context.compress?",":", "),new le((e?"min":"max")+"("+t+")"))},mt={min:function(){for(var e=[],t=0;t<'+u+'Gradient id="g" '+i+">",r=0;r";return n+=""+u+"Gradient>',n=encodeURIComponent(n),new Re(new Ee("'"+(n="data:image/svg+xml,"+n)+"'",n,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)}}),te.addMultiple(wt),t};function St(e,t){var i,n=(t=t||{}).variables,r=new D.Eval(t);"object"!=typeof n||Array.isArray(n)||(n=Object.keys(n).map((function(e){var t=n[e];return t instanceof He.Value||(t instanceof He.Expression||(t=new He.Expression([t])),t=new He.Value([t])),new He.Declaration("@"+e,t,!1,null,0)})),r.frames=[new He.Ruleset(null,n)]);var s,o,a=[new Y.JoinSelectorVisitor,new Y.MarkVisibleSelectorsVisitor(!0),new Y.ExtendVisitor,new Y.ToCSSVisitor({compress:Boolean(t.compress)})],l=[];if(t.pluginManager){o=t.pluginManager.visitor();for(var u=0;u<2;u++)for(o.first();s=o.get();)s.isPreEvalVisitor?0!==u&&-1!==l.indexOf(s)||(l.push(s),s.run(e)):0!==u&&-1!==a.indexOf(s)||(s.isPreVisitor?a.unshift(s):a.push(s))}i=e.eval(r);for(var c=0;c=t);i++);this.preProcessors.splice(i,0,{preProcessor:e,priority:t})},e.prototype.addPostProcessor=function(e,t){var i;for(i=0;i=t);i++);this.postProcessors.splice(i,0,{postProcessor:e,priority:t})},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.getPreProcessors=function(){for(var e=[],t=0;t0){var n=void 0,r=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?n=this.sourceMapURL:this._sourceMapFilename&&(n=this._sourceMapFilename),this.sourceMapURL=n,this.sourceMap=r}return this._css.join("")},t}()}(e=new s(e,t)),e)),a=function(e){return function(){function t(e,t,i){this.less=e,this.rootFilename=i.filename,this.paths=t.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=t.mime,this.error=null,this.context=t,this.queue=[],this.files={}}return t.prototype.push=function(t,i,n,s,o){var a=this,l=this.context.pluginManager.Loader;this.queue.push(t);var u=function(e,i,n){a.queue.splice(a.queue.indexOf(t),1);var l=n===a.rootFilename;s.optional&&e?(o(null,{rules:[]},!1,null),r.info("The file "+n+" was skipped because it was not found and the import was marked optional.")):(a.files[n]||s.inline||(a.files[n]={root:i,options:s}),e&&!a.error&&(a.error=e),o(e,i,l,n))},c={rewriteUrls:this.context.rewriteUrls,entryPath:n.entryPath,rootpath:n.rootpath,rootFilename:n.rootFilename},h=e.getFileManager(t,n.currentDirectory,this.context,e);if(h){var f,p,v=function(e){var t,i=e.filename,r=e.contents.replace(/^\uFEFF/,"");c.currentDirectory=h.getPath(i),c.rewriteUrls&&(c.rootpath=h.join(a.context.rootpath||"",h.pathDiff(c.currentDirectory,c.entryPath)),!h.isPathAbsolute(c.rootpath)&&h.alwaysMakePathsAbsolute()&&(c.rootpath=h.join(c.entryPath,c.rootpath))),c.filename=i;var o=new D.Parse(a.context);o.processImports=!1,a.contents[i]=r,(n.reference||s.reference)&&(c.reference=!0),s.isPlugin?(t=l.evalPlugin(r,o,a,s.pluginArgs,c))instanceof V?u(t,null,i):u(null,t,i):s.inline?u(null,r,i):!a.files[i]||a.files[i].options.multiple||s.multiple?new re(o,a,c).parse(r,(function(e,t){u(e,t,i)})):u(null,a.files[i].root,i)},d=_(this.context);i&&(d.ext=s.isPlugin?".js":".less"),s.isPlugin?(d.mime="application/javascript",d.syncImport?f=l.loadPluginSync(t,n.currentDirectory,d,e,h):p=l.loadPlugin(t,n.currentDirectory,d,e,h)):d.syncImport?f=h.loadFileSync(t,n.currentDirectory,d,e):p=h.loadFile(t,n.currentDirectory,d,e,(function(e,t){e?u(e):v(t)})),f?f.filename?v(f):u(f):p&&p.then(v,u)}else u({message:"Could not find a file-manager for "+t})},t}()}(e);var u,c=function(e,t){var i=function(e,n,r){if("function"==typeof n?(r=n,n=P(this.options,{})):n=P(this.options,n||{}),!r){var s=this;return new Promise((function(t,r){i.call(s,e,n,(function(e,i){e?r(e):t(i)}))}))}this.parse(e,n,(function(e,i,n,s){if(e)return r(e);var o;try{o=new t(i,n).toCSS(s)}catch(e){return r(e)}r(null,o)}))};return i}(0,o),h=function(e,t,i){var n=function(e,t,r){if("function"==typeof t?(r=t,t=P(this.options,{})):t=P(this.options,t||{}),!r){var s=this;return new Promise((function(i,r){n.call(s,e,t,(function(e,t){e?r(e):i(t)}))}))}var o,a=void 0,l=new kt(this,!t.reUsePluginManager);if(t.pluginManager=l,o=new D.Parse(t),t.rootFileInfo)a=t.rootFileInfo;else{var u=t.filename||"input",c=u.replace(/[^/\\]*$/,"");(a={filename:u,rewriteUrls:o.rewriteUrls,rootpath:o.rootpath||"",currentDirectory:c,entryPath:c,rootFilename:u}).rootpath&&"/"!==a.rootpath.slice(-1)&&(a.rootpath+="/")}var h=new i(this,o,a);this.importManager=h,t.plugins&&t.plugins.forEach((function(e){var t,i;if(e.fileContent){if(i=e.fileContent.replace(/^\uFEFF/,""),(t=l.Loader.evalPlugin(i,o,h,e.options,e.filename))instanceof V)return r(t)}else l.addPlugin(e)})),new re(o,h,a).parse(e,(function(e,i){if(e)return r(e);r(null,i,h,t)}),t)};return n}(0,0,a),f=Pt("v4.2.0"),p={version:[f.major,f.minor,f.patch],data:l,tree:He,Environment:s,AbstractFileManager:Qe,AbstractPluginLoader:Ke,environment:e,visitors:Y,Parser:re,functions:xt(e),contexts:D,SourceMapOutput:i,SourceMapBuilder:n,ParseTree:o,ImportManager:a,render:c,parse:h,LessError:V,transformTree:St,utils:R,PluginManager:kt,logger:r},v=function(e){return function(){var t=Object.create(e.prototype);return e.apply(t,Array.prototype.slice.call(arguments,0)),t}},d=Object.create(p);for(var m in p.tree)if("function"==typeof(u=p.tree[m]))d[m.toLowerCase()]=v(u);else for(var g in d[m]=Object.create(null),u)d[m][g.toLowerCase()]=v(u[g]);return p.parse=p.parse.bind(d),p.render=p.render.bind(d),d}var Et={},Rt=function(){};Rt.prototype=Object.assign(new Qe,{alwaysMakePathsAbsolute:function(){return!0},join:function(e,t){return e?this.extractUrlParts(t,e).path:t},doXHR:function(e,t,i,n){var r=new XMLHttpRequest,s=!_t.isFileProtocol||_t.fileAsync;function o(t,i,n){t.status>=200&&t.status<300?i(t.responseText,t.getResponseHeader("Last-Modified")):"function"==typeof n&&n(t.status,e)}"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/css"),At.debug("XHR: Getting '"+e+"'"),r.open("GET",e,s),r.setRequestHeader("Accept",t||"text/x-less, text/css; q=0.9, */*; q=0.5"),r.send(null),_t.isFileProtocol&&!_t.fileAsync?0===r.status||r.status>=200&&r.status<300?i(r.responseText):n(r.status,e):s?r.onreadystatechange=function(){4==r.readyState&&o(r,i,n)}:o(r,i,n)},supports:function(){return!0},clearFileCache:function(){Et={}},loadFile:function(e,t,i){t&&!this.isPathAbsolute(e)&&(e=t+e),e=i.ext?this.tryAppendExtension(e,i.ext):e,i=i||{};var n=this.extractUrlParts(e,window.location.href).url,r=this;return new Promise((function(e,t){if(i.useFileCache&&Et[n])try{var s=Et[n];return e({contents:s,filename:n,webInfo:{lastModified:new Date}})}catch(e){return t({filename:n,message:"Error loading file "+n+" error was "+e.message})}r.doXHR(n,i.mime,(function(t,i){Et[n]=t,e({contents:t,filename:n,webInfo:{lastModified:i}})}),(function(e,i){t({type:"File",message:"'"+i+"' wasn't found ("+e+")",href:n})}))}))}});var Ot=function(e,t){return _t=e,At=t,Rt},Vt=function(e){this.less=e};Vt.prototype=Object.assign(new Ke,{loadPlugin:function(e,t,i,n,r){return new Promise((function(s,o){r.loadFile(e,t,i,n).then(s).catch(o)}))}});var Ft=function(t,n,r){return{add:function(s,o){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting?function(e,t){var i=e.filename||t,s=[],o=(e.type||"Syntax")+"Error: "+(e.message||"There is an error in your .less file")+" in "+i,a=function(e,t,i){void 0!==e.extract[t]&&s.push("{line} {content}".replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,i).replace(/\{content\}/,e.extract[t]))};e.line&&(a(e,0,""),a(e,1,"line"),a(e,2,""),o+=" on line "+e.line+", column "+(e.column+1)+":\n"+s.join("\n")),e.stack&&(e.extract||r.logLevel>=4)&&(o+="\nStack Trace\n"+e.stack),n.logger.error(o)}(s,o):"function"==typeof r.errorReporting&&r.errorReporting("add",s,o):function(n,s){var o,a,l="less-error-message:"+e(s||""),u=t.document.createElement("div"),c=[],h=n.filename||s,f=h.match(/([^/]+(\?.*)?)$/)[1];u.id=l,u.className="less-error-message",a=""+(n.type||"Syntax")+"Error: "+(n.message||"There is an error in your .less file")+'
in '+f+" ";var p=function(e,t,i){void 0!==e.extract[t]&&c.push('
{content}
'.replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,i).replace(/\{content\}/,e.extract[t]))};n.line&&(p(n,0,""),p(n,1,"line"),p(n,2,""),a+="on line "+n.line+", column "+(n.column+1)+":
"),n.stack&&(n.extract||r.logLevel>=4)&&(a+="
Stack Trace"+n.stack.split("\n").slice(1).join("
")),u.innerHTML=a,i(t.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),u.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===r.env&&(o=setInterval((function(){var e=t.document,i=e.body;i&&(e.getElementById(l)?i.replaceChild(u,e.getElementById(l)):i.insertBefore(u,i.firstChild),clearInterval(o))}),10))}(s,o)},remove:function(i){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting||"function"==typeof r.errorReporting&&r.errorReporting("remove",i):function(i){var n=t.document.getElementById("less-error-message:"+e(i));n&&n.parentNode.removeChild(n)}(i)}}},$t={javascriptEnabled:!1,depends:!1,compress:!1,lint:!1,paths:[],color:!0,strictImports:!1,insecure:!1,rootpath:"",rewriteUrls:!1,math:1,strictUnits:!1,globalVars:null,modifyVars:null,urlArgs:""};if(window.less)for(var Lt in window.less)Object.prototype.hasOwnProperty.call(window.less,Lt)&&($t[Lt]=window.less[Lt]);!function(e,i){t(i,n(e)),void 0===i.isFileProtocol&&(i.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(e.location.protocol)),i.async=i.async||!1,i.fileAsync=i.fileAsync||!1,i.poll=i.poll||(i.isFileProtocol?1e3:1500),i.env=i.env||("127.0.0.1"==e.location.hostname||"0.0.0.0"==e.location.hostname||"localhost"==e.location.hostname||e.location.port&&e.location.port.length>0||i.isFileProtocol?"development":"production");var r=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(e.location.hash);r&&(i.dumpLineNumbers=r[1]),void 0===i.useFileCache&&(i.useFileCache=!0),void 0===i.onReady&&(i.onReady=!0),i.relativeUrls&&(i.rewriteUrls="all")}(window,$t),$t.plugins=$t.plugins||[],window.LESS_PLUGINS&&($t.plugins=$t.plugins.concat(window.LESS_PLUGINS));var jt,Nt,Dt,Bt=function(e,n){var r=e.document,s=Mt();s.options=n;var o=s.environment,a=Ot(n,s.logger),l=new a;o.addFileManager(l),s.FileManager=a,s.PluginLoader=Vt,function(e,t){t.logLevel=void 0!==t.logLevel?t.logLevel:"development"===t.env?3:1,t.loggers||(t.loggers=[{debug:function(e){t.logLevel>=4&&console.log(e)},info:function(e){t.logLevel>=3&&console.log(e)},warn:function(e){t.logLevel>=2&&console.warn(e)},error:function(e){t.logLevel>=1&&console.error(e)}}]);for(var i=0;i0&&l.childNodes.length>0&&o.firstChild.nodeValue===l.firstChild.nodeValue);var u=t.getElementsByTagName("head")[0];if(null===o||!1===a){var h=n&&n.nextSibling||null;h?h.parentNode.insertBefore(l,h):u.appendChild(l)}if(o&&!1===a&&o.parentNode.removeChild(o),l.styleSheet)try{l.styleSheet.cssText=i}catch(e){throw new Error("Couldn't reassign styleSheet.cssText.")}},n=function(e){var t,i=e.document;return i.currentScript||(t=i.getElementsByTagName("script"))[t.length-1]},r={error:function(e){this._fireEvent("error",e)},warn:function(e){this._fireEvent("warn",e)},info:function(e){this._fireEvent("info",e)},debug:function(e){this._fireEvent("debug",e)},addListener:function(e){this._listeners.push(e)},removeListener:function(e){for(var t=0;t=0;a--){var l=o[a];if(l[s?"supportsSync":"supports"](e,t,i,n))return l}return null},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},e}(),o={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},a={length:{m:1,cm:.01,mm:.001,in:.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:1/400,turn:1}},l={colors:o,unitConversions:a},u=function(){function e(){this.parent=null,this.visibilityBlocks=void 0,this.nodeVisible=void 0,this.rootNode=null,this.parsed=null}return Object.defineProperty(e.prototype,"currentFileInfo",{get:function(){return this.fileInfo()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.getIndex()},enumerable:!1,configurable:!0}),e.prototype.setParent=function(t,i){function n(t){t&&t instanceof e&&(t.parent=i)}Array.isArray(t)?t.forEach(n):n(t)},e.prototype.getIndex=function(){return this._index||this.parent&&this.parent.getIndex()||0},e.prototype.fileInfo=function(){return this._fileInfo||this.parent&&this.parent.fileInfo()||{}},e.prototype.isRulesetLike=function(){return!1},e.prototype.toCSS=function(e){var t=[];return this.genCSS(e,{add:function(e,i,n){t.push(e)},isEmpty:function(){return 0===t.length}}),t.join("")},e.prototype.genCSS=function(e,t){t.add(this.value)},e.prototype.accept=function(e){this.value=e.visit(this.value)},e.prototype.eval=function(){return this},e.prototype._operate=function(e,t,i,n){switch(t){case"+":return i+n;case"-":return i-n;case"*":return i*n;case"/":return i/n}},e.prototype.fround=function(e,t){var i=e&&e.numPrecision;return i?Number((t+2e-16).toFixed(i)):t},e.compare=function(t,i){if(t.compare&&"Quoted"!==i.type&&"Anonymous"!==i.type)return t.compare(i);if(i.compare)return-i.compare(t);if(t.type===i.type){if(t=t.value,i=i.value,!Array.isArray(t))return t===i?0:void 0;if(t.length===i.length){for(var n=0;nt?1:void 0},e.prototype.blocksVisibility=function(){return void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),0!==this.visibilityBlocks},e.prototype.addVisibilityBlock=function(){void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks+1},e.prototype.removeVisibilityBlock=function(){void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks-1},e.prototype.ensureVisibility=function(){this.nodeVisible=!0},e.prototype.ensureInvisibility=function(){this.nodeVisible=!1},e.prototype.isVisible=function(){return this.nodeVisible},e.prototype.visibilityInfo=function(){return{visibilityBlocks:this.visibilityBlocks,nodeVisible:this.nodeVisible}},e.prototype.copyVisibilityInfo=function(e){e&&(this.visibilityBlocks=e.visibilityBlocks,this.nodeVisible=e.nodeVisible)},e}(),h=function(e,t,i){var n=this;Array.isArray(e)?this.rgb=e:e.length>=6?(this.rgb=[],e.match(/.{2}/g).map((function(e,t){t<3?n.rgb.push(parseInt(e,16)):n.alpha=parseInt(e,16)/255}))):(this.rgb=[],e.split("").map((function(e,t){t<3?n.rgb.push(parseInt(e+e,16)):n.alpha=parseInt(e+e,16)/255}))),this.alpha=this.alpha||("number"==typeof t?t:1),void 0!==i&&(this.value=i)};function c(e,t){return Math.min(Math.max(e,0),t)}function f(e){return"#"+e.map((function(e){return((e=c(Math.round(e),255))<16?"0":"")+e.toString(16)})).join("")}h.prototype=Object.assign(new u,{type:"Color",luma:function(){var e=this.rgb[0]/255,t=this.rgb[1]/255,i=this.rgb[2]/255;return.2126*(e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(i=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))},genCSS:function(e,t){t.add(this.toCSS(e))},toCSS:function(e,t){var i,n,r,s=e&&e.compress&&!t,o=[];if(n=this.fround(e,this.alpha),this.value)if(0===this.value.indexOf("rgb"))n<1&&(r="rgba");else{if(0!==this.value.indexOf("hsl"))return this.value;r=n<1?"hsla":"hsl"}else n<1&&(r="rgba");switch(r){case"rgba":o=this.rgb.map((function(e){return c(Math.round(e),255)})).concat(c(n,1));break;case"hsla":o.push(c(n,1));case"hsl":i=this.toHSL(),o=[this.fround(e,i.h),this.fround(e,100*i.s)+"%",this.fround(e,100*i.l)+"%"].concat(o)}if(r)return r+"("+o.join(","+(s?"":" "))+")";if(i=this.toRGB(),s){var a=i.split("");a[1]===a[2]&&a[3]===a[4]&&a[5]===a[6]&&(i="#"+a[1]+a[3]+a[5])}return i},operate:function(e,t,i){for(var n=new Array(3),r=this.alpha*(1-i.alpha)+i.alpha,s=0;s<3;s++)n[s]=this._operate(e,t,this.rgb[s],i.rgb[s]);return new h(n,r)},toRGB:function(){return f(this.rgb)},toHSL:function(){var e,t,i=this.rgb[0]/255,n=this.rgb[1]/255,r=this.rgb[2]/255,s=this.alpha,o=Math.max(i,n,r),a=Math.min(i,n,r),l=(o+a)/2,u=o-a;if(o===a)e=t=0;else{switch(t=l>.5?u/(2-o-a):u/(o+a),o){case i:e=(n-r)/u+(n=0&&"\n"!==t.charAt(i);)r++;return"number"==typeof e&&(n=(t.slice(0,e).match(/\n/g)||"").length),{line:n,column:r}}function k(e){var t,i=e.length,n=new Array(i);for(t=0;t|Function):(\d+):(\d+)/,V=function(e,t,i){Error.call(this);var n=e.filename||i;if(this.message=e.message,this.stack=e.stack,t&&n){var r=t.contents[n],s=C(e.index,r),o=s.line,a=s.column,l=e.call&&C(e.call,r).line,u=r?r.split("\n"):"";if(this.type=e.type||"Syntax",this.filename=n,this.index=e.index,this.line="number"==typeof o?o+1:null,this.column=a,!this.line&&this.stack){var h=this.stack.match(O),c=new Function("a","throw new Error()"),f=0;try{c()}catch(e){var p=e.stack.match(O);f=1-parseInt(p[2])}h&&(h[2]&&(this.line=parseInt(h[2])+f),h[3]&&(this.column=parseInt(h[3])))}this.callLine=l+1,this.callExtract=u[l],this.extract=[u[this.line-2],u[this.line-1],u[this.line]]}};if(void 0===Object.create){var F=function(){};F.prototype=Error.prototype,V.prototype=new F}else V.prototype=Object.create(Error.prototype);V.prototype.constructor=V,V.prototype.toString=function(e){e=e||{};var t="",i=this.extract||[],n=[],r=function(e){return e};if(e.stylize){var s=typeof e.stylize;if("function"!==s)throw Error("options.stylize should be a function, got a "+s+"!");r=e.stylize}if(null!==this.line){if("string"==typeof i[0]&&n.push(r(this.line-1+" "+i[0],"grey")),"string"==typeof i[1]){var o=this.line+" ";i[1]&&(o+=i[1].slice(0,this.column)+r(r(r(i[1].substr(this.column,1),"bold")+i[1].slice(this.column+1),"red"),"inverse")),n.push(o)}"string"==typeof i[2]&&n.push(r(this.line+1+" "+i[2],"grey")),n=n.join("\n")+r("","reset")+"\n"}return t+=r(this.type+"Error: "+this.message,"red"),this.filename&&(t+=r(" in ","red")+this.filename),this.line&&(t+=r(" on line "+this.line+", column "+(this.column+1)+":","grey")),t+="\n"+n,this.callLine&&(t+=r("from ","red")+(this.filename||"")+"/n",t+=r(this.callLine,"grey")+" "+this.callExtract+"/n"),t};var $={visitDeeper:!0},L=!1;function j(e){return e}var N=function(){function e(e){this._implementation=e,this._visitInCache={},this._visitOutCache={},L||(!function e(t,i){var n,r;for(n in t)switch(typeof(r=t[n])){case"function":r.prototype&&r.prototype.type&&(r.prototype.typeIndex=i++);break;case"object":i=e(r,i)}return i}(He,1),L=!0)}return e.prototype.visit=function(e){if(!e)return e;var t=e.typeIndex;if(!t)return e.value&&e.value.typeIndex&&this.visit(e.value),e;var i,n=this._implementation,r=this._visitInCache[t],s=this._visitOutCache[t],o=$;if(o.visitDeeper=!0,r||(r=n[i="visit"+e.type]||j,s=n[i+"Out"]||j,this._visitInCache[t]=r,this._visitOutCache[t]=s),r!==j){var a=r.call(n,e,o);e&&n.isReplacing&&(e=a)}if(o.visitDeeper&&e)if(e.length)for(var l=0,u=e.length;lg.PARENS_DIVISION)||this.parensStack&&this.parensStack.length))},D.Eval.prototype.pathRequiresRewrite=function(e){return(this.rewriteUrls===b?z:T)(e)},D.Eval.prototype.rewritePath=function(e,t){var i;return t=t||"",i=this.normalizePath(t+e),z(e)&&T(t)&&!1===z(i)&&(i="./"+i),i},D.Eval.prototype.normalizePath=function(e){var t,i=e.split("/").reverse();for(e=[];0!==i.length;)switch(t=i.pop()){case".":break;case"..":0===e.length||".."===e[e.length-1]?e.push(t):e.pop();break;default:e.push(t)}return e.join("/")};var G=function(){function e(e){this.imports=[],this.variableImports=[],this._onSequencerEmpty=e,this._currentDepth=0}return e.prototype.addImport=function(e){var t=this,i={callback:e,args:null,isReady:!1};return this.imports.push(i),function(){i.args=Array.prototype.slice.call(arguments,0),i.isReady=!0,t.tryRun()}},e.prototype.addVariableImport=function(e){this.variableImports.push(e)},e.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var e=this.imports[0];if(!e.isReady)return;this.imports=this.imports.slice(1),e.callback.apply(null,e.args)}if(0===this.variableImports.length)break;var t=this.variableImports[0];this.variableImports=this.variableImports.slice(1),t()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},e}(),W=function(e,t){this._visitor=new N(this),this._importer=e,this._finish=t,this.context=new D.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new G(this._onSequencerEmpty.bind(this))};W.prototype={isReplacing:!1,run:function(e){try{this._visitor.visit(e)}catch(e){this.error=e}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(e,t){var i=e.options.inline;if(!e.css||i){var n=new D.Eval(this.context,k(this.context.frames)),r=n.frames[0];this.importCount++,e.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,e,n,r)):this.processImportNode(e,n,r)}t.visitDeeper=!1},processImportNode:function(e,t,i){var n,r=e.options.inline;try{n=e.evalForImport(t)}catch(t){t.filename||(t.index=e.getIndex(),t.filename=e.fileInfo().filename),e.css=!0,e.error=t}if(!n||n.css&&!r)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{n.options.multiple&&(t.importMultiple=!0);for(var s=void 0===n.css,o=0;o=0||(a=[u.selfSelectors[0]],(s=f.findMatch(l,a)).length&&(l.hasFoundMatches=!0,l.selfSelectors.forEach((function(e){var t=u.visibilityInfo();o=f.extendSelector(s,a,e,l.isVisible()),(h=new He.Extend(u.selector,u.option,0,u.fileInfo(),t)).selfSelectors=o,o[o.length-1].extendList=[h],c.push(h),h.ruleset=u.ruleset,h.parent_ids=h.parent_ids.concat(u.parent_ids,l.parent_ids),u.firstExtendOnThisSelectorPath&&(h.firstExtendOnThisSelectorPath=!0,u.ruleset.paths.push(o))}))));if(c.length){if(this.extendChainCount++,i>100){var p="{unable to calculate}",v="{unable to calculate}";try{p=c[0].selfSelectors[0].toCSS(),v=c[0].selector.toCSS()}catch(e){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+p+":extend("+v+")"}}return c.concat(f.doExtendChaining(c,t,i+1))}return c},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitSelector=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){if(!e.root){var i,n,r,s,o=this.allExtendsStack[this.allExtendsStack.length-1],a=[],l=this;for(r=0;r0&&u[l.matched].combinator.value!==o?l=null:l.matched++,l&&(l.finished=l.matched===u.length,l.finished&&!e.allowAfter&&(r+1u&&h>0&&(c[c.length-1].elements=c[c.length-1].elements.concat(t[u].elements.slice(h)),h=0,u++),l=s.elements.slice(h,a.index).concat([o]).concat(i.elements.slice(1)),u===a.pathIndex&&r>0?c[c.length-1].elements=c[c.length-1].elements.concat(l):(c=c.concat(t.slice(u,a.pathIndex))).push(new He.Selector(l)),u=a.endPathIndex,(h=a.endPathElementIndex)>=t[u].elements.length&&(h=0,u++);return u0&&(c[c.length-1].elements=c[c.length-1].elements.concat(t[u].elements.slice(h)),u++),c=(c=c.concat(t.slice(u,t.length))).map((function(e){var t=e.createDerived(e.elements);return n?t.ensureVisibility():t.ensureInvisibility(),t}))},e.prototype.visitMedia=function(e,t){var i=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);i=i.concat(this.doExtendChaining(i,e.allExtends)),this.allExtendsStack.push(i)},e.prototype.visitMediaOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e.prototype.visitAtRule=function(e,t){var i=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);i=i.concat(this.doExtendChaining(i,e.allExtends)),this.allExtendsStack.push(i)},e.prototype.visitAtRuleOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e}(),K=function(){function e(){this.contexts=[[]],this._visitor=new N(this)}return e.prototype.run=function(e){return this._visitor.visit(e)},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){var i,n=this.contexts[this.contexts.length-1],r=[];this.contexts.push(r),e.root||((i=e.selectors)&&(i=i.filter((function(e){return e.getIsOutput()})),e.selectors=i.length?i:i=null,i&&e.joinSelectors(r,n,i)),i||(e.rules=null),e.paths=r)},e.prototype.visitRulesetOut=function(e){this.contexts.length=this.contexts.length-1},e.prototype.visitMedia=function(e,t){var i=this.contexts[this.contexts.length-1];e.rules[0].root=0===i.length||i[0].multiMedia},e.prototype.visitAtRule=function(e,t){var i=this.contexts[this.contexts.length-1];e.rules&&e.rules.length&&(e.rules[0].root=e.isRooted||0===i.length||null)},e}(),Z=function(){function e(e){this._visitor=new N(this),this._context=e}return e.prototype.containsSilentNonBlockedChild=function(e){var t;if(!e)return!1;for(var i=0;i0},e.prototype.resolveVisibility=function(e){if(!e.blocksVisibility()){if(this.isEmpty(e))return;return e}var t=e.rules[0];if(this.keepOnlyVisibleChilds(t),!this.isEmpty(t))return e.ensureVisibility(),e.removeVisibilityBlock(),e},e.prototype.isVisibleRuleset=function(e){return!!e.firstRoot||!this.isEmpty(e)&&!(!e.root&&!this.hasVisibleSelector(e))},e}(),X=function(e){this._visitor=new N(this),this._context=e,this.utils=new Z(e)};X.prototype={isReplacing:!0,run:function(e){return this._visitor.visit(e)},visitDeclaration:function(e,t){if(!e.blocksVisibility()&&!e.variable)return e},visitMixinDefinition:function(e,t){e.frames=[]},visitExtend:function(e,t){},visitComment:function(e,t){if(!e.blocksVisibility()&&!e.isSilent(this._context))return e},visitMedia:function(e,t){var i=e.rules[0].rules;return e.accept(this._visitor),t.visitDeeper=!1,this.utils.resolveVisibility(e,i)},visitImport:function(e,t){if(!e.blocksVisibility())return e},visitAtRule:function(e,t){return e.rules&&e.rules.length?this.visitAtRuleWithBody(e,t):this.visitAtRuleWithoutBody(e,t)},visitAnonymous:function(e,t){if(!e.blocksVisibility())return e.accept(this._visitor),e},visitAtRuleWithBody:function(e,t){var i=function(e){var t=e.rules;return function(e){var t=e.rules;return 1===t.length&&(!t[0].paths||0===t[0].paths.length)}(e)?t[0].rules:t}(e);return e.accept(this._visitor),t.visitDeeper=!1,this.utils.isEmpty(e)||this._mergeRules(e.rules[0].rules),this.utils.resolveVisibility(e,i)},visitAtRuleWithoutBody:function(e,t){if(!e.blocksVisibility()){if("@charset"===e.name){if(this.charset){if(e.debugInfo){var i=new He.Comment("/* "+e.toCSS(this._context).replace(/\n/g,"")+" */\n");return i.debugInfo=e.debugInfo,this._visitor.visit(i)}return}this.charset=!0}return e}},checkValidNodes:function(e,t){if(e)for(var i=0;i0?e.accept(this._visitor):e.rules=null,t.visitDeeper=!1}return e.rules&&(this._mergeRules(e.rules),this._removeDuplicateRules(e.rules)),this.utils.isVisibleRuleset(e)&&(e.ensureVisibility(),n.splice(0,0,e)),1===n.length?n[0]:n},_compileRulesetPaths:function(e){e.paths&&(e.paths=e.paths.filter((function(e){var t;for(" "===e[0].elements[0].combinator.value&&(e[0].elements[0].combinator=new He.Combinator("")),t=0;t=0;n--)if((i=e[n])instanceof He.Declaration)if(r[i.name]){(t=r[i.name])instanceof He.Declaration&&(t=r[i.name]=[r[i.name].toCSS(this._context)]);var s=i.toCSS(this._context);-1!==t.indexOf(s)?e.splice(n,1):t.push(s)}else r[i.name]=i}},_mergeRules:function(e){if(e){for(var t={},i=[],n=0;n0){var t=e[0],i=[],n=[new He.Expression(i)];e.forEach((function(e){"+"===e.merge&&i.length>0&&n.push(new He.Expression(i=[])),i.push(e.value),t.important=t.important||e.important})),t.value=new He.Value(n)}}))}}};var Y={Visitor:N,ImportVisitor:W,MarkVisibleSelectorsVisitor:J,ExtendVisitor:Q,JoinSelectorVisitor:K,ToCSSVisitor:X};var ee=function(){var e,t,i,n,r,s,o,a=[],l={};function u(i){for(var n,a,h,c=l.i,f=t,p=l.i-o,v=l.i+s.length-p,d=l.i+=i,m=e;l.i=0){h={index:l.i,text:m.substr(l.i,y+2-l.i),isLineComment:!1},l.i+=h.text.length-1,l.commentStore.push(h);continue}}break}if(32!==n&&10!==n&&9!==n&&13!==n)break}if(s=s.slice(i+l.i-d+p),o=l.i,!s.length){if(ti||l.i===i&&e&&!n)&&(i=l.i,n=e);var r=a.pop();s=r.current,o=l.i=r.i,t=r.j},l.forget=function(){a.pop()},l.isWhitespace=function(t){var i=l.i+(t||0),n=e.charCodeAt(i);return 32===n||13===n||9===n||10===n},l.$re=function(e){l.i>o&&(s=s.slice(l.i-o),o=l.i);var t=e.exec(s);return t?(u(t[0].length),"string"==typeof t?t:1===t.length?t[0]:t):null},l.$char=function(t){return e.charAt(l.i)!==t?null:(u(1),t)},l.$peekChar=function(t){return e.charAt(l.i)!==t?null:t},l.$str=function(t){for(var i=t.length,n=0;nc&&(d=!1)}}while(d);return r||null},l.autoCommentAbsorb=!0,l.commentStore=[],l.finished=!1,l.peek=function(t){if("string"==typeof t){for(var i=0;i57||t<43||47===t||44===t},l.start=function(n,a,h){e=n,l.i=t=o=i=0,r=a?function(e,t){var i,n,r,s,o,a,l,u,h,c=e.length,f=0,p=0,v=[],d=0;function m(t){var i=o-d;i<512&&!t||!i||(v.push(e.slice(d,o+1)),d=o+1)}for(o=0;o=97&&l<=122||l<34))switch(l){case 40:p++,n=o;continue;case 41:if(--p<0)return t("missing opening `(`",o);continue;case 59:p||m();continue;case 123:f++,i=o;continue;case 125:if(--f<0)return t("missing opening `{`",o);f||p||m();continue;case 92:if(o96)){if(u==l){h=1;break}if(92==u){if(o==c-1)return t("unescaped `\\`",o);o++}}if(h)continue;return t("unmatched `"+String.fromCharCode(l)+"`",a);case 47:if(p||o==c-1)continue;if(47==(u=e.charCodeAt(o+1)))for(o+=2;oi&&s>r?"missing closing `}` or `*/`":"missing closing `}`",i):0!==p?t("missing closing `)`",n):(m(!0),v)}(n,h):[n],s=r[0],u(0)},l.end=function(){var t,r=l.i>=e.length;return l.i=e.length-1,furthestChar:e[l.i]}},l};var te=function e(t){return{_data:{},add:function(e,t){e=e.toLowerCase(),this._data.hasOwnProperty(e),this._data[e]=t},addMultiple:function(e){var t=this;Object.keys(e).forEach((function(i){t.add(i,e[i])}))},get:function(e){return this._data[e]||t&&t.get(e)},getLocalFunctions:function(){return this._data},inherit:function(){return e(this)},create:function(t){return e(t)}}}(null),ie={queryInParens:!0},ne={queryInParens:!0},re=function e(t,i,n,r){var s;r=r||0;var o=ee();function a(e,t){throw new V({index:o.i,filename:n.filename,type:t||"Syntax",message:e},i)}function l(e,t){var i=e instanceof Function?e.call(s):o.$re(e);if(i)return i;a(t||("string"==typeof e?"expected '"+e+"' got '"+o.currentChar()+"'":"unexpected token"))}function u(e,t){if(o.$char(e))return e;a(t||"expected '"+e+"' got '"+o.currentChar()+"'")}function h(e){var t=n.filename;return{lineNumber:C(e,o.getInput()).line+1,fileName:t}}return{parserInput:o,imports:i,fileInfo:n,parseNode:function(e,t,a){var l,u=[],h=o;try{h.start(e,!1,(function(e,t){a({message:e,index:t+r})}));for(var c=0,f=void 0;f=t[c];c++)l=s[f](),u.push(l||null);h.end().isFinished?a(null,u):a(!0,null)}catch(e){throw new V({index:e.index+r,message:e.message},i,n.filename)}},parse:function(r,l,u){var h,c,f,p,v=null,d="";if(u&&u.disablePluginRule&&(s.plugin=function(){o.$re(/^@plugin?\s+/)&&a("@plugin statements are not allowed when disablePluginRule is set to true")}),c=u&&u.globalVars?e.serializeVars(u.globalVars)+"\n":"",f=u&&u.modifyVars?"\n"+e.serializeVars(u.modifyVars):"",t.pluginManager)for(var m=t.pluginManager.getPreProcessors(),g=0;g");return e},args:function(e){var t,i,n,r,l,u,h,c=s.entities,f={args:null,variadic:!1},p=[],v=[],d=[],m=!0;for(o.save();;){if(e)u=s.detachedRuleset()||s.expression();else{if(o.commentStore.length=0,o.$str("...")){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({variadic:!0});break}u=c.variable()||c.property()||c.literal()||c.keyword()||this.call(!0)}if(!u||!m)break;r=null,u.throwAwayComments&&u.throwAwayComments(),l=u;var g=null;if(e?u.value&&1==u.value.length&&(g=u.value[0]):g=u,g&&(g instanceof He.Variable||g instanceof He.Property))if(o.$char(":")){if(p.length>0&&(t&&a("Cannot mix ; and , as delimiter types"),i=!0),!(l=s.detachedRuleset()||s.expression())){if(!e)return o.restore(),f.args=[],f;a("could not understand value for named argument")}r=n=g.name}else if(o.$str("...")){if(!e){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({name:u.name,variadic:!0});break}h=!0}else e||(n=r=g.name,l=null);l&&p.push(l),d.push({name:r,value:l,expand:h}),o.$char(",")?m=!0:((m=";"===o.$char(";"))||t)&&(i&&a("Cannot mix ; and , as delimiter types"),t=!0,p.length>1&&(l=new He.Value(p)),v.push({name:n,value:l,expand:h}),n=null,p=[],i=!1)}return o.forget(),f.args=t?v:d,f},definition:function(){var e,t,i,n,r=[],a=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),t=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){e=t[1];var u=this.args(!1);if(r=u.args,a=u.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(n=l(s.conditions,"expected condition")),i=s.block())return o.forget(),new He.mixin.Definition(e,r,i,n,a);o.restore()}else o.restore()},ruleLookups:function(){var e,t=[];if("["===o.currentChar()){for(;;){if(o.save(),!(e=this.lookupValue())&&""!==e){o.restore();break}t.push(e),o.forget()}return t.length>0?t:void 0}},lookupValue:function(){if(o.save(),o.$char("[")){var e=o.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);if(o.$char("]"))return e||""===e?(o.forget(),e):void o.restore();o.restore()}else o.restore()}},entity:function(){var e=this.entities;return this.comment()||e.literal()||e.variable()||e.url()||e.property()||e.call()||e.keyword()||this.mixin.call(!0)||e.javascript()},end:function(){return o.$char(";")||o.peek("}")},ieAlpha:function(){var e;if(o.$re(/^opacity=/i))return(e=o.$re(/^\d+/))||(e="@{"+(e=l(s.entities.variable,"Could not parse alpha")).name.slice(1)+"}"),u(")"),new He.Quoted("","alpha(opacity="+e+")")},element:function(){var e,t,i,s=o.i;if(t=this.combinator(),(e=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[.#:](?=@)/)||this.entities.variableCurly())||(o.save(),o.$char("(")?(i=this.selector(!1))&&o.$char(")")?(e=new He.Paren(i),o.forget()):o.restore("Missing closing ')'"):o.forget()),e)return new He.Element(t,e,e instanceof He.Variable,s+r,n)},combinator:function(){var e=o.currentChar();if("/"===e){o.save();var t=o.$re(/^\/[a-z]+\//i);if(t)return o.forget(),new He.Combinator(t);o.restore()}if(">"===e||"+"===e||"~"===e||"|"===e||"^"===e){for(o.i++,"^"===e&&"^"===o.currentChar()&&(e="^^",o.i++);o.isWhitespace();)o.i++;return new He.Combinator(e)}return o.isWhitespace(-1)?new He.Combinator(" "):new He.Combinator(null)},selector:function(e){var t,i,s,u,h,c,f,p=o.i;for(e=!1!==e;(e&&(i=this.extend())||e&&(c=o.$str("when"))||(u=this.element()))&&(c?f=l(this.conditions,"expected condition"):f?a("CSS guard can only be used at the end of selector"):i?h=h?h.concat(i):i:(h&&a("Extend can only be used at the end of selector"),s=o.currentChar(),t?t.push(u):t=[u],u=null),"{"!==s&&"}"!==s&&";"!==s&&","!==s&&")"!==s););if(t)return new He.Selector(t,h,f,p+r,n);h&&a("Extend must be used to extend a selector, it cannot be used on its own")},selectors:function(){for(var e,t;(e=this.selector())&&(t?t.push(e):t=[e],o.commentStore.length=0,e.condition&&t.length>1&&a("Guards are only currently allowed on a single selector."),o.$char(","));)e.condition&&a("Guards are only currently allowed on a single selector."),o.commentStore.length=0;return t},attribute:function(){if(o.$char("[")){var e,t,i,n,r=this.entities;return(e=r.variableCurly())||(e=l(/^(?:[_A-Za-z0-9-*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),(i=o.$re(/^[|~*$^]?=/))&&(t=r.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||r.variableCurly())&&(n=o.$re(/^[iIsS]/)),u("]"),new He.Attribute(e,i,t,n)}},block:function(){var e;if(o.$char("{")&&(e=this.primary())&&o.$char("}"))return e},blockRuleset:function(){var e=this.block();return e&&(e=new He.Ruleset(null,e)),e},detachedRuleset:function(){var e,t,i;if(o.save(),!o.$re(/^[.#]\(/)||(t=(e=this.mixin.args(!1)).args,i=e.variadic,o.$char(")"))){var n=this.blockRuleset();if(n)return o.forget(),t?new He.mixin.Definition(null,t,n,null,i):new He.DetachedRuleset(n);o.restore()}else o.restore()},ruleset:function(){var e,i,n;if(o.save(),t.dumpLineNumbers&&(n=h(o.i)),(e=this.selectors())&&(i=this.block())){o.forget();var r=new He.Ruleset(e,i,t.strictImports);return t.dumpLineNumbers&&(r.debugInfo=n),r}o.restore()},declaration:function(){var e,t,i,s,a,l,u=o.i,h=o.currentChar();if("."!==h&&"#"!==h&&"&"!==h&&":"!==h)if(o.save(),e=this.variable()||this.ruleProperty()){if((l="string"==typeof e)&&(t=this.detachedRuleset())&&(i=!0),o.commentStore.length=0,!t){if(a=!l&&e.length>1&&e.pop().value,t=e[0].value&&"--"===e[0].value.slice(0,2)?this.permissiveValue(/[;}]/):this.anonymousValue())return o.forget(),new He.Declaration(e,t,!1,a,u+r,n);t||(t=this.value()),t?s=this.important():l&&(t=this.permissiveValue())}if(t&&(this.end()||i))return o.forget(),new He.Declaration(e,t,s,a,u+r,n);o.restore()}else o.restore()},anonymousValue:function(){var e=o.i,t=o.$re(/^([^.#@$+/'"*`(;{}-]*);/);if(t)return new He.Anonymous(t[1],e+r)},permissiveValue:function(e){var t,i,r,s,l=e||";",u=o.i,h=[];function c(){var e=o.currentChar();return"string"==typeof l?e===l:l.test(e)}if(!c()){s=[];do{(i=this.comment())?s.push(i):((i=this.entity())&&s.push(i),o.peek(",")&&(s.push(new He.Anonymous(",",o.i)),o.$char(",")))}while(i);if(r=c(),s.length>0){if(s=new He.Expression(s),r)return s;h.push(s)," "===o.prevChar()&&h.push(new He.Anonymous(" ",u))}if(o.save(),s=o.$parseUntil(l)){if("string"==typeof s&&a("Expected '"+s+"'","Parse"),1===s.length&&" "===s[0])return o.forget(),new He.Anonymous("",u);var f=void 0;for(t=0;t]=|<=|>=|[<>]|=)/)?(o.restore(),i=this.condition(),o.save(),(s=this.atomicCondition(null,i.rvalue))||o.restore()):(o.restore(),t=this.value()),o.$char(")")?i&&!t?(u.push(new He.Paren(new He.QueryInParens(i.op,i.lvalue,i.rvalue,s?s.op:null,s?s.rvalue:null,i._index))),t=i):i&&t?u.push(new He.Paren(new He.Declaration(i,t,null,null,o.i+r,n,!0))):t?u.push(new He.Paren(t)):a("badly formed media feature definition"):a("Missing closing ')'","Parse"))}while(t);if(o.forget(),u.length>0)return new He.Expression(u)},mediaFeatures:function(e){var t,i=this.entities,n=[];do{if(t=this.mediaFeature(e)){if(n.push(t),!o.$char(","))break}else if((t=i.variable()||i.mixinLookup())&&(n.push(t),!o.$char(",")))break}while(t);return n.length>0?n:null},prepareAndGetNestableAtRule:function(e,i,s,l){var u=this.mediaFeatures(l),h=this.block();h||a("media definitions require block statements after any features"),o.forget();var c=new e(h,u,i+r,n);return t.dumpLineNumbers&&(c.debugInfo=s),c},nestableAtRule:function(){var e,i=o.i;if(t.dumpLineNumbers&&(e=h(i)),o.save(),o.$peekChar("@")){if(o.$str("@media"))return this.prepareAndGetNestableAtRule(He.Media,i,e,ie);if(o.$str("@container"))return this.prepareAndGetNestableAtRule(He.Container,i,e,ne)}o.restore()},plugin:function(){var e,t,i,s=o.i;if(o.$re(/^@plugin\s+/)){if(i=(t=this.pluginArgs())?{pluginArgs:t,isPlugin:!0}:{isPlugin:!0},e=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=s,a("missing semi-colon on @plugin")),new He.Import(e,null,i,s+r,n);o.i=s,a("malformed @plugin statement")}},pluginArgs:function(){if(o.save(),!o.$char("("))return o.restore(),null;var e=o.$re(/^\s*([^);]+)\)\s*/);return e[1]?(o.forget(),e[1].trim()):(o.restore(),null)},atrule:function(){var e,i,s,l,u,c,f,p=o.i,v=!0,d=!0;if("@"===o.currentChar()){if(i=this.import()||this.plugin()||this.nestableAtRule())return i;if(o.save(),e=o.$re(/^@[a-z-]+/)){switch(l=e,"-"==e.charAt(1)&&e.indexOf("-",2)>0&&(l="@"+e.slice(e.indexOf("-",2)+1)),l){case"@charset":u=!0,v=!1;break;case"@namespace":c=!0,v=!1;break;case"@keyframes":case"@counter-style":u=!0;break;case"@document":case"@supports":f=!0,d=!1;break;default:f=!0}if(o.commentStore.length=0,u?(i=this.entity())||a("expected "+e+" identifier"):c?(i=this.expression())||a("expected "+e+" expression"):f&&(i=this.permissiveValue(/^[{;]/),v="{"===o.currentChar(),i?i.value||(i=null):v||";"===o.currentChar()||a(e+" rule is missing block or ending semi-colon")),v&&(s=this.blockRuleset()),s||!v&&i&&o.$char(";"))return o.forget(),new He.AtRule(e,i,s,p+r,n,t.dumpLineNumbers?h(p):null,d);o.restore("at-rule options not recognised")}}},value:function(){var e,t=[],i=o.i;do{if((e=this.expression())&&(t.push(e),!o.$char(",")))break}while(e);if(t.length>0)return new He.Value(t,i+r)},important:function(){if("!"===o.currentChar())return o.$re(/^! *important/)},sub:function(){var e,t;if(o.save(),o.$char("("))return(e=this.addition())&&o.$char(")")?(o.forget(),(t=new He.Expression([e])).parens=!0,t):void o.restore("Expected ')'");o.restore()},multiplication:function(){var e,t,i,n,r;if(e=this.operand()){for(r=o.isWhitespace(-1);!o.peek(/^\/[*/]/);){if(o.save(),!(i=o.$char("/")||o.$char("*")||o.$str("./"))){o.forget();break}if(!(t=this.operand())){o.restore();break}o.forget(),e.parensInOp=!0,t.parensInOp=!0,n=new He.Operation(i,[n||e,t],r),r=o.isWhitespace(-1)}return n||e}},addition:function(){var e,t,i,n,r;if(e=this.multiplication()){for(r=o.isWhitespace(-1);(i=o.$re(/^[-+]\s+/)||!r&&(o.$char("+")||o.$char("-")))&&(t=this.multiplication());)e.parensInOp=!0,t.parensInOp=!0,n=new He.Operation(i,[n||e,t],r),r=o.isWhitespace(-1);return n||e}},conditions:function(){var e,t,i,n=o.i;if(e=this.condition(!0)){for(;o.peek(/^,\s*(not\s*)?\(/)&&o.$char(",")&&(t=this.condition(!0));)i=new He.Condition("or",i||e,t,n+r);return i||e}},condition:function(e){var t,i,n;if(t=this.conditionAnd(e)){if(i=o.$str("or")){if(!(n=this.condition(e)))return;t=new He.Condition(i,t,n)}return t}},conditionAnd:function(e){var t,i,n,r,s=this;if(t=(r=s.negatedCondition(e)||s.parenthesisCondition(e))||e?r:s.atomicCondition(e)){if(i=o.$str("and")){if(!(n=this.conditionAnd(e)))return;t=new He.Condition(i,t,n)}return t}},negatedCondition:function(e){if(o.$str("not")){var t=this.parenthesisCondition(e);return t&&(t.negate=!t.negate),t}},parenthesisCondition:function(e){var t;if(o.save(),o.$str("(")){if(t=function(t){var i;if(o.save(),i=t.condition(e)){if(o.$char(")"))return o.forget(),i;o.restore()}else o.restore()}(this))return o.forget(),t;if(t=this.atomicCondition(e)){if(o.$char(")"))return o.forget(),t;o.restore("expected ')' got '"+o.currentChar()+"'")}else o.restore()}else o.restore()},atomicCondition:function(e,t){var i,n,s,l,u=this.entities,h=o.i,c=function(){return this.addition()||u.keyword()||u.quoted()||u.mixinLookup()}.bind(this);if(i=t||c())return o.$char(">")?l=o.$char("=")?">=":">":o.$char("<")?l=o.$char("=")?"<=":"<":o.$char("=")&&(l=o.$char(">")?"=>":o.$char("<")?"=<":"="),l?(n=c())?s=new He.Condition(l,i,n,h+r,!1):a("expected expression"):t||(s=new He.Condition("=",i,new He.Keyword("true"),h+r,!1)),s},operand:function(){var e,t=this.entities;o.peek(/^-[@$(]/)&&(e=o.$char("-"));var i=this.sub()||t.dimension()||t.color()||t.variable()||t.property()||t.call()||t.quoted(!0)||t.colorKeyword()||t.mixinLookup();return e&&(i.parensInOp=!0,i=new He.Negative(i)),i},expression:function(){var e,t,i=[],n=o.i;do{(e=this.comment())?i.push(e):((e=this.addition()||this.entity())instanceof He.Comment&&(e=null),e&&(i.push(e),o.peek(/^\/[/*]/)||(t=o.$char("/"))&&i.push(new He.Anonymous(t,n+r))))}while(e);if(i.length>0)return new He.Expression(i)},property:function(){var e=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(e)return e[1]},ruleProperty:function(){var e,t,i=[],s=[];o.save();var a=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(a)return i=[new He.Keyword(a[1])],o.forget(),i;function l(e){var t=o.i,n=o.$re(e);if(n)return s.push(t),i.push(n[1])}for(l(/^(\*?)/);l(/^((?:[\w-]+)|(?:[@$]\{[\w-]+\}))/););if(i.length>1&&l(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===i[0]&&(i.shift(),s.shift()),t=0;t0;e--){var t=this.rules[e-1];if(t instanceof he)return this.parseValue(t)}},parseValue:function(e){var t=this;function i(e){return e.value instanceof le&&!e.parsed?("string"==typeof e.value.value?new re(this.parse.context,this.parse.importManager,e.fileInfo(),e.value.getIndex()).parseNode(e.value.value,["value","important"],(function(t,i){t&&(e.parsed=!0),i&&(e.value=i[0],e.important=i[1]||"",e.parsed=!0)})):e.parsed=!0,e):e}if(Array.isArray(e)){var n=[];return e.forEach((function(e){n.push(i.call(t,e))})),n}return i.call(t,e)},rulesets:function(){if(!this.rules)return[];var e,t,i=[],n=this.rules;for(e=0;t=n[e];e++)t.isRuleset&&i.push(t);return i},prependRule:function(e){var t=this.rules;t?t.unshift(e):this.rules=[e],this.setParent(e,this)},find:function(e,t,i){t=t||this;var n,r,s=[],o=e.toCSS();return o in this._lookups?this._lookups[o]:(this.rulesets().forEach((function(o){if(o!==t)for(var a=0;an){if(!i||i(o)){r=o.find(new se(e.elements.slice(n)),t,i);for(var l=0;l0&&t.add(l),e.firstSelector=!0,o[0].genCSS(e,t),e.firstSelector=!1,n=1;n0?(s=(r=k(e)).pop(),o=n.createDerived(k(s.elements))):o=n.createDerived([]),t.length>0){var a=i.combinator,l=t[0].elements[0];a.emptyOrWhitespace&&!l.combinator.emptyOrWhitespace&&(a=l.combinator),o.elements.push(new m(a,l.value,i.isVariable,i._index,i._fileInfo)),o.elements=o.elements.concat(t[0].elements.slice(1))}if(0!==o.elements.length&&r.push(o),t.length>1){var u=t.slice(1);u=u.map((function(e){return e.createDerived(e.elements,[])})),r=r.concat(u)}return r}function o(e,t,i,n,r){var o;for(o=0;o0?n[n.length-1]=n[n.length-1].createDerived(n[n.length-1].elements.concat(e)):n.push(new se(e));else t.push([new se(e)])}function l(e,t){var i=t.createDerived(t.elements,t.extendList,t.evaldCondition);return i.copyVisibilityInfo(e),i}var u,h;if(!function e(t,i,l){var u,h,c,f,v,d,g,y,b,w,x,S,I=!1;for(f=[],v=[[]],u=0;y=l.elements[u];u++)if("&"!==y.value){var C=(S=void 0,(x=y).value instanceof p&&(S=x.value.value)instanceof se?S:null);if(null!==C){a(f,v);var k,_=[],A=[];for(k=e(_,i,C),I=I||k,c=0;c<_.length;c++){o(v,[r(n(_[c],y),y)],y,l,A)}v=A,f=[]}else f.push(y)}else{for(I=!0,d=[],a(f,v),h=0;h0&&g[0].elements.push(new m(y.combinator,"",y.isVariable,y._index,y._fileInfo)),d.push(g);else for(c=0;c0&&(t.push(v[u]),w=v[u][b-1],v[u][b-1]=w.createDerived(w.elements,l.extendList));return I}(h=[],t,i))if(t.length>0)for(h=[],u=0;u0)for(t=0;t-1e-6&&(n=i.toFixed(20).replace(/0+$/,"")),e&&e.compress){if(0===i&&this.unit.isLength())return void t.add(n);i>0&&i<1&&(n=n.substr(1))}t.add(n),this.unit.genCSS(e,t)},operate:function(e,t,i){var n=this._operate(e,t,this.value,i.value),r=this.unit.clone();if("+"===t||"-"===t)if(0===r.numerator.length&&0===r.denominator.length)r=i.unit.clone(),this.unit.backupUnit&&(r.backupUnit=this.unit.backupUnit);else if(0===i.unit.numerator.length&&0===r.denominator.length);else{if(i=i.convertTo(this.unit.usedUnits()),e.strictUnits&&i.unit.toString()!==r.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+r.toString()+"' and '"+i.unit.toString()+"'.");n=this._operate(e,t,this.value,i.value)}else"*"===t?(r.numerator=r.numerator.concat(i.unit.numerator).sort(),r.denominator=r.denominator.concat(i.unit.denominator).sort(),r.cancel()):"/"===t&&(r.numerator=r.numerator.concat(i.unit.denominator).sort(),r.denominator=r.denominator.concat(i.unit.numerator).sort(),r.cancel());return new we(n,r)},compare:function(e){var t,i;if(e instanceof we){if(this.unit.isEmpty()||e.unit.isEmpty())t=this,i=e;else if(t=this.unify(),i=e.unify(),0!==t.unit.compare(i.unit))return;return u.numericCompare(t.value,i.value)}},unify:function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},convertTo:function(e){var t,i,n,r,s,o=this.value,l=this.unit.clone(),u={};if("string"==typeof e){for(t in a)a[t].hasOwnProperty(e)&&((u={})[t]=e);e=u}for(i in s=function(e,t){return n.hasOwnProperty(e)?(t?o/=n[e]/n[r]:o*=n[e]/n[r],r):e},e)e.hasOwnProperty(i)&&(r=e[i],n=a[i],l.map(s));return l.cancel(),new we(o,l)}});var xe=g,Se=function(e,t,i){this.op=e.trim(),this.operands=t,this.isSpaced=i};Se.prototype=Object.assign(new u,{type:"Operation",accept:function(e){this.operands=e.visitArray(this.operands)},eval:function(e){var t,i=this.operands[0].eval(e),n=this.operands[1].eval(e);if(e.isMathOn(this.op)){if(t="./"===this.op?"/":this.op,i instanceof we&&n instanceof h&&(i=i.toColor()),n instanceof we&&i instanceof h&&(n=n.toColor()),!i.operate||!n.operate){if((i instanceof Se||n instanceof Se)&&"/"===i.op&&e.math===xe.PARENS_DIVISION)return new Se(this.op,[i,n],this.isSpaced);throw{type:"Operation",message:"Operation on an invalid type"}}return i.operate(e,t,n)}return new Se(this.op,[i,n],this.isSpaced)},genCSS:function(e,t){this.operands[0].genCSS(e,t),this.isSpaced&&t.add(" "),t.add(this.op),this.isSpaced&&t.add(" "),this.operands[1].genCSS(e,t)}});var Ie=function(){return(Ie=Object.assign||function(e){for(var t,i=1,n=arguments.length;i1?t=new Ce(this.value.map((function(t){return t.eval?t.eval(e):t})),this.noSpacing):1===this.value.length?(!this.value[0].parens||this.value[0].parensInOp||e.inCalc||(r=!0),t=this.value[0].eval(e)):t=this,n&&e.outOfParenthesis(),!this.parens||!this.parensInOp||i||r||t instanceof we||(t=new p(t)),t},genCSS:function(e,t){for(var i=0;i1){var i=new se([],null,null,this.getIndex(),this.fileInfo()).createEmptySelectors();(t=new me(i,e.mediaBlocks)).multiMedia=!0,t.copyVisibilityInfo(this.visibilityInfo()),this.setParent(t,this)}return delete e.mediaBlocks,delete e.mediaPath,t},evalNested:function(e){var t,i,n=e.mediaPath.concat([this]);for(t=0;t0;t--)e.splice(t,0,new le("and"));return new Ce(e)}))),this.setParent(this.features,this),new me([],[])},permute:function(e){if(0===e.length)return[];if(1===e.length)return e[0];for(var t=[],i=this.permute(e.slice(1)),n=0;n1?"["+e.value.map((function(e){return e.toCSS()})).join(", ")+"]":e.toCSS()}});var Le=function(e,t,i,n){this.escaped=t,this.expression=e,this._index=i,this._fileInfo=n};Le.prototype=Object.assign(new $e,{type:"JavaScript",eval:function(e){var t=this.evaluateJavaScript(this.expression,e),i=typeof t;return"number"!==i||isNaN(t)?"string"===i?new Ee('"'+t+'"',t,this.escaped,this._index):Array.isArray(t)?new le(t.join(", ")):new le(t):new we(t)}});var je=function(e,t){this.key=e,this.value=t};je.prototype=Object.assign(new u,{type:"Assignment",accept:function(e){this.value=e.visit(this.value)},eval:function(e){return this.value.eval?new je(this.key,this.value.eval(e)):this},genCSS:function(e,t){t.add(this.key+"="),this.value.genCSS?this.value.genCSS(e,t):t.add(this.value)}});var Ne=function(e,t,i,n,r){this.op=e.trim(),this.lvalue=t,this.rvalue=i,this._index=n,this.negate=r};Ne.prototype=Object.assign(new u,{type:"Condition",accept:function(e){this.lvalue=e.visit(this.lvalue),this.rvalue=e.visit(this.rvalue)},eval:function(e){var t=function(e,t,i){switch(e){case"and":return t&&i;case"or":return t||i;default:switch(u.compare(t,i)){case-1:return"<"===e||"=<"===e||"<="===e;case 0:return"="===e||">="===e||"=<"===e||"<="===e;case 1:return">"===e||">="===e;default:return!1}}}(this.op,this.lvalue.eval(e),this.rvalue.eval(e));return this.negate?!t:t}});var De=function(e,t,i,n,r,s){this.op=e.trim(),this.lvalue=t,this.mvalue=i,this.op2=n?n.trim():null,this.rvalue=r,this._index=s};De.prototype=Object.assign(new u,{type:"QueryInParens",accept:function(e){this.lvalue=e.visit(this.lvalue),this.mvalue=e.visit(this.mvalue),this.rvalue&&(this.rvalue=e.visit(this.rvalue))},eval:function(e){return this.lvalue=this.lvalue.eval(e),this.mvalue=this.mvalue.eval(e),this.rvalue&&(this.rvalue=this.rvalue.eval(e)),this},genCSS:function(e,t){this.lvalue.genCSS(e,t),t.add(" "+this.op+" "),this.mvalue.genCSS(e,t),this.rvalue&&(t.add(" "+this.op2+" "),this.rvalue.genCSS(e,t))}});var Be=function(e,t,i,n,r){this._index=i,this._fileInfo=n;var s=new se([],null,null,this._index,this._fileInfo).createEmptySelectors();this.features=new oe(t),this.rules=[new me(s,e)],this.rules[0].allowImports=!0,this.copyVisibilityInfo(r),this.allowRoot=!0,this.setParent(s,this),this.setParent(this.features,this),this.setParent(this.rules,this)};Be.prototype=Object.assign(new ge,Ie(Ie({type:"Container"},Oe),{genCSS:function(e,t){t.add("@container ",this._fileInfo,this._index),this.features.genCSS(e,t),this.outputRuleset(e,t,this.rules)},eval:function(e){e.mediaBlocks||(e.mediaBlocks=[],e.mediaPath=[]);var t=new Be(null,[],this._index,this._fileInfo,this.visibilityInfo());return this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,t.debugInfo=this.debugInfo),t.features=this.features.eval(e),e.mediaPath.push(t),e.mediaBlocks.push(t),this.rules[0].functionRegistry=e.frames[0].functionRegistry.inherit(),e.frames.unshift(this.rules[0]),t.rules=[this.rules[0].eval(e)],e.frames.shift(),e.mediaPath.pop(),0===e.mediaPath.length?t.evalTop(e):t.evalNested(e)}}));var Ue=function(e){this.value=e};Ue.prototype=Object.assign(new u,{type:"UnicodeDescriptor"});var qe=function(e){this.value=e};qe.prototype=Object.assign(new u,{type:"Negative",genCSS:function(e,t){t.add("-"),this.value.genCSS(e,t)},eval:function(e){return e.isMathOn()?new Se("*",[new we(-1),this.value]).eval(e):new qe(this.value.eval(e))}});var Te=function(e,t,i,n,r){switch(this.selector=e,this.option=t,this.object_id=Te.next_id++,this.parent_ids=[this.object_id],this._index=i,this._fileInfo=n,this.copyVisibilityInfo(r),this.allowRoot=!0,t){case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}this.setParent(this.selector,this)};Te.prototype=Object.assign(new u,{type:"Extend",accept:function(e){this.selector=e.visit(this.selector)},eval:function(e){return new Te(this.selector.eval(e),this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},clone:function(e){return new Te(this.selector,this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},findSelfSelectors:function(e){var t,i,n=[];for(t=0;t0&&i.length&&""===i[0].combinator.value&&(i[0].combinator.value=" "),n=n.concat(e[t].elements);this.selfSelectors=[new se(n)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())}}),Te.next_id=0;var ze=function(e,t,i){this.variable=e,this._index=t,this._fileInfo=i,this.allowRoot=!0};ze.prototype=Object.assign(new u,{type:"VariableCall",eval:function(e){var t,i=new Ae(this.variable,this.getIndex(),this.fileInfo()).eval(e),n=new V({message:"Could not evaluate variable call "+this.variable});if(!i.ruleset){if(i.rules)t=i;else if(Array.isArray(i))t=new me("",i);else{if(!Array.isArray(i.value))throw n;t=new me("",i.value)}i=new ye(t)}if(i.ruleset)return i.callEval(e);throw n}});var Ge=function(e,t,i,n){this.value=e,this.lookups=t,this._index=i,this._fileInfo=n};Ge.prototype=Object.assign(new u,{type:"NamespaceValue",eval:function(e){var t,i,n=this.value.eval(e);for(t=0;tthis.params.length)return!1}i=Math.min(s,this.arity);for(var o=0;o0){for(h=!0,a=0;a0)f=2;else if(f=1,p[1]+p[2]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(m)+"`",index:this.getIndex(),filename:this.fileInfo().filename};for(a=0;a0&&(e=e.slice(0,t)),(t=e.lastIndexOf("/"))<0&&(t=e.lastIndexOf("\\")),t<0?"":e.slice(0,t+1)},e.prototype.tryAppendExtension=function(e,t){return/(\.[a-z]*$)|([?;].*)$/.test(e)?e:e+t},e.prototype.tryAppendLessExtension=function(e){return this.tryAppendExtension(e,".less")},e.prototype.supportsSync=function(){return!1},e.prototype.alwaysMakePathsAbsolute=function(){return!1},e.prototype.isPathAbsolute=function(e){return/^(?:[a-z-]+:|\/|\\|#)/i.test(e)},e.prototype.join=function(e,t){return e?e+t:t},e.prototype.pathDiff=function(e,t){var i,n,r,s,o=this.extractUrlParts(e),a=this.extractUrlParts(t),l="";if(o.hostPart!==a.hostPart)return"";for(n=Math.max(a.directories.length,o.directories.length),i=0;iparseInt(t[i])?-1:1;return 0},e.prototype.versionToString=function(e){for(var t="",i=0;i1?e-1:e)<1?r+(s-r)*e*6:2*e<1?s:3*e<2?r+(s-r)*(2/3-e)*6:r}try{if(e instanceof h)return n=t?st(t):e.alpha,new h(e.rgb,n,"hsla");e=st(e)%360/360,t=tt(st(t)),i=tt(st(i)),n=tt(st(n)),r=2*i-(s=i<=.5?i*(t+1):i+t-i*t);var a=[255*o(e+1/3),255*o(e),255*o(e-1/3)];return n=st(n),new h(a,n,"hsla")}catch(e){}},hsv:function(e,t,i){return Ye.hsva(e,t,i,1)},hsva:function(e,t,i,n){var r,s;e=st(e)%360/360*360,t=st(t),i=st(i),n=st(n);var o=[i,i*(1-t),i*(1-(s=e/60-(r=Math.floor(e/60%6)))*t),i*(1-(1-s)*t)],a=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return Ye.rgba(255*o[a[r][0]],255*o[a[r][1]],255*o[a[r][2]],n)},hue:function(e){return new we(nt(e).h)},saturation:function(e){return new we(100*nt(e).s,"%")},lightness:function(e){return new we(100*nt(e).l,"%")},hsvhue:function(e){return new we(rt(e).h)},hsvsaturation:function(e){return new we(100*rt(e).s,"%")},hsvvalue:function(e){return new we(100*rt(e).v,"%")},red:function(e){return new we(e.rgb[0])},green:function(e){return new we(e.rgb[1])},blue:function(e){return new we(e.rgb[2])},alpha:function(e){return new we(nt(e).a)},luma:function(e){return new we(e.luma()*e.alpha*100,"%")},luminance:function(e){var t=.2126*e.rgb[0]/255+.7152*e.rgb[1]/255+.0722*e.rgb[2]/255;return new we(t*e.alpha*100,"%")},saturate:function(e,t,i){if(!e.rgb)return null;var n=nt(e);return void 0!==i&&"relative"===i.value?n.s+=n.s*t.value/100:n.s+=t.value/100,n.s=tt(n.s),it(e,n)},desaturate:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.s-=n.s*t.value/100:n.s-=t.value/100,n.s=tt(n.s),it(e,n)},lighten:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.l+=n.l*t.value/100:n.l+=t.value/100,n.l=tt(n.l),it(e,n)},darken:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.l-=n.l*t.value/100:n.l-=t.value/100,n.l=tt(n.l),it(e,n)},fadein:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.a+=n.a*t.value/100:n.a+=t.value/100,n.a=tt(n.a),it(e,n)},fadeout:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.a-=n.a*t.value/100:n.a-=t.value/100,n.a=tt(n.a),it(e,n)},fade:function(e,t){var i=nt(e);return i.a=t.value/100,i.a=tt(i.a),it(e,i)},spin:function(e,t){var i=nt(e),n=(i.h+t.value)%360;return i.h=n<0?360+n:n,it(e,i)},mix:function(e,t,i){i||(i=new we(50));var n=i.value/100,r=2*n-1,s=nt(e).a-nt(t).a,o=((r*s==-1?r:(r+s)/(1+r*s))+1)/2,a=1-o,l=[e.rgb[0]*o+t.rgb[0]*a,e.rgb[1]*o+t.rgb[1]*a,e.rgb[2]*o+t.rgb[2]*a],u=e.alpha*n+t.alpha*(1-n);return new h(l,u)},greyscale:function(e){return Ye.desaturate(e,new we(100))},contrast:function(e,t,i,n){if(!e.rgb)return null;if(void 0===i&&(i=Ye.rgba(255,255,255,1)),void 0===t&&(t=Ye.rgba(0,0,0,1)),t.luma()>i.luma()){var r=i;i=t,t=r}return n=void 0===n?.43:st(n),e.luma().5&&(n=1,i=e>.25?Math.sqrt(e):((16*e-12)*e+4)*e),e-(1-2*t)*n*(i-e)},hardlight:function(e,t){return lt.overlay(t,e)},difference:function(e,t){return Math.abs(e-t)},exclusion:function(e,t){return e+t-2*e*t},average:function(e,t){return(e+t)/2},negation:function(e,t){return 1-Math.abs(e+t-1)}};for(var ut in lt)lt.hasOwnProperty(ut)&&(at[ut]=at.bind(null,lt[ut]));var ht=function(e){return Array.isArray(e.value)?e.value:Array(e)},ct={_SELF:function(e){return e},"~":function(){for(var e=[],t=0;to.value)&&(c[n]=r);else{if(void 0!==l&&a!==l)throw{type:"Argument",message:"incompatible types"};f[a]=c.length,c.push(r)}else Array.isArray(t[i].value)&&Array.prototype.push.apply(t,Array.prototype.slice.call(t[i].value));return 1==c.length?c[0]:(t=c.map((function(e){return e.toCSS(h.context)})).join(this.context.compress?",":", "),new le((e?"min":"max")+"("+t+")"))},mt={min:function(){for(var e=[],t=0;t<'+u+'Gradient id="g" '+i+">",r=0;r";return n+=""+u+"Gradient>',n=encodeURIComponent(n),new Re(new Ee("'"+(n="data:image/svg+xml,"+n)+"'",n,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)}}),te.addMultiple(wt),t};function St(e,t){var i,n=(t=t||{}).variables,r=new D.Eval(t);"object"!=typeof n||Array.isArray(n)||(n=Object.keys(n).map((function(e){var t=n[e];return t instanceof He.Value||(t instanceof He.Expression||(t=new He.Expression([t])),t=new He.Value([t])),new He.Declaration("@"+e,t,!1,null,0)})),r.frames=[new He.Ruleset(null,n)]);var s,o,a=[new Y.JoinSelectorVisitor,new Y.MarkVisibleSelectorsVisitor(!0),new Y.ExtendVisitor,new Y.ToCSSVisitor({compress:Boolean(t.compress)})],l=[];if(t.pluginManager){o=t.pluginManager.visitor();for(var u=0;u<2;u++)for(o.first();s=o.get();)s.isPreEvalVisitor?0!==u&&-1!==l.indexOf(s)||(l.push(s),s.run(e)):0!==u&&-1!==a.indexOf(s)||(s.isPreVisitor?a.unshift(s):a.push(s))}i=e.eval(r);for(var h=0;h=t);i++);this.preProcessors.splice(i,0,{preProcessor:e,priority:t})},e.prototype.addPostProcessor=function(e,t){var i;for(i=0;i=t);i++);this.postProcessors.splice(i,0,{postProcessor:e,priority:t})},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.getPreProcessors=function(){for(var e=[],t=0;t0){var n=void 0,r=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?n=this.sourceMapURL:this._sourceMapFilename&&(n=this._sourceMapFilename),this.sourceMapURL=n,this.sourceMap=r}return this._css.join("")},t}()}(e=new s(e,t)),e)),a=function(e){return function(){function t(e,t,i){this.less=e,this.rootFilename=i.filename,this.paths=t.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=t.mime,this.error=null,this.context=t,this.queue=[],this.files={}}return t.prototype.push=function(t,i,n,s,o){var a=this,l=this.context.pluginManager.Loader;this.queue.push(t);var u=function(e,i,n){a.queue.splice(a.queue.indexOf(t),1);var l=n===a.rootFilename;s.optional&&e?(o(null,{rules:[]},!1,null),r.info("The file "+n+" was skipped because it was not found and the import was marked optional.")):(a.files[n]||s.inline||(a.files[n]={root:i,options:s}),e&&!a.error&&(a.error=e),o(e,i,l,n))},h={rewriteUrls:this.context.rewriteUrls,entryPath:n.entryPath,rootpath:n.rootpath,rootFilename:n.rootFilename},c=e.getFileManager(t,n.currentDirectory,this.context,e);if(c){var f,p,v=function(e){var t,i=e.filename,r=e.contents.replace(/^\uFEFF/,"");h.currentDirectory=c.getPath(i),h.rewriteUrls&&(h.rootpath=c.join(a.context.rootpath||"",c.pathDiff(h.currentDirectory,h.entryPath)),!c.isPathAbsolute(h.rootpath)&&c.alwaysMakePathsAbsolute()&&(h.rootpath=c.join(h.entryPath,h.rootpath))),h.filename=i;var o=new D.Parse(a.context);o.processImports=!1,a.contents[i]=r,(n.reference||s.reference)&&(h.reference=!0),s.isPlugin?(t=l.evalPlugin(r,o,a,s.pluginArgs,h))instanceof V?u(t,null,i):u(null,t,i):s.inline?u(null,r,i):!a.files[i]||a.files[i].options.multiple||s.multiple?new re(o,a,h).parse(r,(function(e,t){u(e,t,i)})):u(null,a.files[i].root,i)},d=_(this.context);i&&(d.ext=s.isPlugin?".js":".less"),s.isPlugin?(d.mime="application/javascript",d.syncImport?f=l.loadPluginSync(t,n.currentDirectory,d,e,c):p=l.loadPlugin(t,n.currentDirectory,d,e,c)):d.syncImport?f=c.loadFileSync(t,n.currentDirectory,d,e):p=c.loadFile(t,n.currentDirectory,d,e,(function(e,t){e?u(e):v(t)})),f?f.filename?v(f):u(f):p&&p.then(v,u)}else u({message:"Could not find a file-manager for "+t})},t}()}(e);var u,h=function(e,t){var i=function(e,n,r){if("function"==typeof n?(r=n,n=P(this.options,{})):n=P(this.options,n||{}),!r){var s=this;return new Promise((function(t,r){i.call(s,e,n,(function(e,i){e?r(e):t(i)}))}))}this.parse(e,n,(function(e,i,n,s){if(e)return r(e);var o;try{o=new t(i,n).toCSS(s)}catch(e){return r(e)}r(null,o)}))};return i}(0,o),c=function(e,t,i){var n=function(e,t,r){if("function"==typeof t?(r=t,t=P(this.options,{})):t=P(this.options,t||{}),!r){var s=this;return new Promise((function(i,r){n.call(s,e,t,(function(e,t){e?r(e):i(t)}))}))}var o,a=void 0,l=new kt(this,!t.reUsePluginManager);if(t.pluginManager=l,o=new D.Parse(t),t.rootFileInfo)a=t.rootFileInfo;else{var u=t.filename||"input",h=u.replace(/[^/\\]*$/,"");(a={filename:u,rewriteUrls:o.rewriteUrls,rootpath:o.rootpath||"",currentDirectory:h,entryPath:h,rootFilename:u}).rootpath&&"/"!==a.rootpath.slice(-1)&&(a.rootpath+="/")}var c=new i(this,o,a);this.importManager=c,t.plugins&&t.plugins.forEach((function(e){var t,i;if(e.fileContent){if(i=e.fileContent.replace(/^\uFEFF/,""),(t=l.Loader.evalPlugin(i,o,c,e.options,e.filename))instanceof V)return r(t)}else l.addPlugin(e)})),new re(o,c,a).parse(e,(function(e,i){if(e)return r(e);r(null,i,c,t)}),t)};return n}(0,0,a),f=Pt("v4.2.0"),p={version:[f.major,f.minor,f.patch],data:l,tree:He,Environment:s,AbstractFileManager:Qe,AbstractPluginLoader:Ke,environment:e,visitors:Y,Parser:re,functions:xt(e),contexts:D,SourceMapOutput:i,SourceMapBuilder:n,ParseTree:o,ImportManager:a,render:h,parse:c,LessError:V,transformTree:St,utils:R,PluginManager:kt,logger:r},v=function(e){return function(){var t=Object.create(e.prototype);return e.apply(t,Array.prototype.slice.call(arguments,0)),t}},d=Object.create(p);for(var m in p.tree)if("function"==typeof(u=p.tree[m]))d[m.toLowerCase()]=v(u);else for(var g in d[m]=Object.create(null),u)d[m][g.toLowerCase()]=v(u[g]);return p.parse=p.parse.bind(d),p.render=p.render.bind(d),d}var Et={},Rt=function(){};Rt.prototype=Object.assign(new Qe,{alwaysMakePathsAbsolute:function(){return!0},join:function(e,t){return e?this.extractUrlParts(t,e).path:t},doXHR:function(e,t,i,n){var r=new XMLHttpRequest,s=!_t.isFileProtocol||_t.fileAsync;function o(t,i,n){t.status>=200&&t.status<300?i(t.responseText,t.getResponseHeader("Last-Modified")):"function"==typeof n&&n(t.status,e)}"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/css"),At.debug("XHR: Getting '"+e+"'"),r.open("GET",e,s),r.setRequestHeader("Accept",t||"text/x-less, text/css; q=0.9, */*; q=0.5"),r.send(null),_t.isFileProtocol&&!_t.fileAsync?0===r.status||r.status>=200&&r.status<300?i(r.responseText):n(r.status,e):s?r.onreadystatechange=function(){4==r.readyState&&o(r,i,n)}:o(r,i,n)},supports:function(){return!0},clearFileCache:function(){Et={}},loadFile:function(e,t,i){t&&!this.isPathAbsolute(e)&&(e=t+e),e=i.ext?this.tryAppendExtension(e,i.ext):e,i=i||{};var n=this.extractUrlParts(e,window.location.href).url,r=this;return new Promise((function(e,t){if(i.useFileCache&&Et[n])try{var s=Et[n];return e({contents:s,filename:n,webInfo:{lastModified:new Date}})}catch(e){return t({filename:n,message:"Error loading file "+n+" error was "+e.message})}r.doXHR(n,i.mime,(function(t,i){Et[n]=t,e({contents:t,filename:n,webInfo:{lastModified:i}})}),(function(e,i){t({type:"File",message:"'"+i+"' wasn't found ("+e+")",href:n})}))}))}});var Ot=function(e,t){return _t=e,At=t,Rt},Vt=function(e){this.less=e};Vt.prototype=Object.assign(new Ke,{loadPlugin:function(e,t,i,n,r){return new Promise((function(s,o){r.loadFile(e,t,i,n).then(s).catch(o)}))}});var Ft=function(t,n,r){return{add:function(s,o){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting?function(e,t){var i=e.filename||t,s=[],o=(e.type||"Syntax")+"Error: "+(e.message||"There is an error in your .less file")+" in "+i,a=function(e,t,i){void 0!==e.extract[t]&&s.push("{line} {content}".replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,i).replace(/\{content\}/,e.extract[t]))};e.line&&(a(e,0,""),a(e,1,"line"),a(e,2,""),o+=" on line "+e.line+", column "+(e.column+1)+":\n"+s.join("\n")),e.stack&&(e.extract||r.logLevel>=4)&&(o+="\nStack Trace\n"+e.stack),n.logger.error(o)}(s,o):"function"==typeof r.errorReporting&&r.errorReporting("add",s,o):function(n,s){var o,a,l="less-error-message:"+e(s||""),u=t.document.createElement("div"),h=[],c=n.filename||s,f=c.match(/([^/]+(\?.*)?)$/)[1];u.id=l,u.className="less-error-message",a=""+(n.type||"Syntax")+"Error: "+(n.message||"There is an error in your .less file")+'
in '+f+" ";var p=function(e,t,i){void 0!==e.extract[t]&&h.push('
{content}
'.replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,i).replace(/\{content\}/,e.extract[t]))};n.line&&(p(n,0,""),p(n,1,"line"),p(n,2,""),a+="on line "+n.line+", column "+(n.column+1)+":"),n.stack&&(n.extract||r.logLevel>=4)&&(a+="
Stack Trace"+n.stack.split("\n").slice(1).join("
")),u.innerHTML=a,i(t.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),u.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===r.env&&(o=setInterval((function(){var e=t.document,i=e.body;i&&(e.getElementById(l)?i.replaceChild(u,e.getElementById(l)):i.insertBefore(u,i.firstChild),clearInterval(o))}),10))}(s,o)},remove:function(i){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting||"function"==typeof r.errorReporting&&r.errorReporting("remove",i):function(i){var n=t.document.getElementById("less-error-message:"+e(i));n&&n.parentNode.removeChild(n)}(i)}}},$t={javascriptEnabled:!1,depends:!1,compress:!1,lint:!1,paths:[],color:!0,strictImports:!1,insecure:!1,rootpath:"",rewriteUrls:!1,math:1,strictUnits:!1,globalVars:null,modifyVars:null,urlArgs:""};if(window.less)for(var Lt in window.less)Object.prototype.hasOwnProperty.call(window.less,Lt)&&($t[Lt]=window.less[Lt]);!function(e,i){t(i,n(e)),void 0===i.isFileProtocol&&(i.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(e.location.protocol)),i.async=i.async||!1,i.fileAsync=i.fileAsync||!1,i.poll=i.poll||(i.isFileProtocol?1e3:1500),i.env=i.env||("127.0.0.1"==e.location.hostname||"0.0.0.0"==e.location.hostname||"localhost"==e.location.hostname||e.location.port&&e.location.port.length>0||i.isFileProtocol?"development":"production");var r=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(e.location.hash);r&&(i.dumpLineNumbers=r[1]),void 0===i.useFileCache&&(i.useFileCache=!0),void 0===i.onReady&&(i.onReady=!0),i.relativeUrls&&(i.rewriteUrls="all")}(window,$t),$t.plugins=$t.plugins||[],window.LESS_PLUGINS&&($t.plugins=$t.plugins.concat(window.LESS_PLUGINS));var jt,Nt,Dt,Bt=function(e,n){var r=e.document,s=Mt();s.options=n;var o=s.environment,a=Ot(n,s.logger),l=new a;o.addFileManager(l),s.FileManager=a,s.PluginLoader=Vt,function(e,t){t.logLevel=void 0!==t.logLevel?t.logLevel:"development"===t.env?3:1,t.loggers||(t.loggers=[{debug:function(e){t.logLevel>=4&&console.log(e)},info:function(e){t.logLevel>=3&&console.log(e)},warn:function(e){t.logLevel>=2&&console.warn(e)},error:function(e){t.logLevel>=1&&console.error(e)}}]);for(var i=0;i 0 && styleNode.childNodes.length > 0 &&\n oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue);\n }\n\n const head = document.getElementsByTagName('head')[0];\n\n // If there is no oldStyleNode, just append; otherwise, only append if we need\n // to replace oldStyleNode with an updated stylesheet\n if (oldStyleNode === null || keepOldStyleNode === false) {\n const nextEl = sheet && sheet.nextSibling || null;\n if (nextEl) {\n nextEl.parentNode.insertBefore(styleNode, nextEl);\n } else {\n head.appendChild(styleNode);\n }\n }\n if (oldStyleNode && keepOldStyleNode === false) {\n oldStyleNode.parentNode.removeChild(oldStyleNode);\n }\n\n // For IE.\n // This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash.\n // See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head\n if (styleNode.styleSheet) {\n try {\n styleNode.styleSheet.cssText = styles;\n } catch (e) {\n throw new Error('Couldn\\'t reassign styleSheet.cssText.');\n }\n }\n },\n currentScript: function(window) {\n const document = window.document;\n return document.currentScript || (() => {\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n })();\n }\n};\n","export default {\n error: function(msg) {\n this._fireEvent('error', msg);\n },\n warn: function(msg) {\n this._fireEvent('warn', msg);\n },\n info: function(msg) {\n this._fireEvent('info', msg);\n },\n debug: function(msg) {\n this._fireEvent('debug', msg);\n },\n addListener: function(listener) {\n this._listeners.push(listener);\n },\n removeListener: function(listener) {\n for (let i = 0; i < this._listeners.length; i++) {\n if (this._listeners[i] === listener) {\n this._listeners.splice(i, 1);\n return;\n }\n }\n },\n _fireEvent: function(type, msg) {\n for (let i = 0; i < this._listeners.length; i++) {\n const logFunction = this._listeners[i][type];\n if (logFunction) {\n logFunction(msg);\n }\n }\n },\n _listeners: []\n};\n","/**\n * @todo Document why this abstraction exists, and the relationship between\n * environment, file managers, and plugin manager\n */\n\nimport logger from '../logger';\n\nclass Environment {\n constructor(externalEnvironment, fileManagers) {\n this.fileManagers = fileManagers || [];\n externalEnvironment = externalEnvironment || {};\n\n const optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator'];\n const requiredFunctions = [];\n const functions = requiredFunctions.concat(optionalFunctions);\n\n for (let i = 0; i < functions.length; i++) {\n const propName = functions[i];\n const environmentFunc = externalEnvironment[propName];\n if (environmentFunc) {\n this[propName] = environmentFunc.bind(externalEnvironment);\n } else if (i < requiredFunctions.length) {\n this.warn(`missing required function in environment - ${propName}`);\n }\n }\n }\n\n getFileManager(filename, currentDirectory, options, environment, isSync) {\n\n if (!filename) {\n logger.warn('getFileManager called with no filename.. Please report this issue. continuing.');\n }\n if (currentDirectory === undefined) {\n logger.warn('getFileManager called with null directory.. Please report this issue. continuing.');\n }\n\n let fileManagers = this.fileManagers;\n if (options.pluginManager) {\n fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers());\n }\n for (let i = fileManagers.length - 1; i >= 0 ; i--) {\n const fileManager = fileManagers[i];\n if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) {\n return fileManager;\n }\n }\n return null;\n }\n\n addFileManager(fileManager) {\n this.fileManagers.push(fileManager);\n }\n\n clearFileManagers() {\n this.fileManagers = [];\n }\n}\n\nexport default Environment;\n","export default {\n 'aliceblue':'#f0f8ff',\n 'antiquewhite':'#faebd7',\n 'aqua':'#00ffff',\n 'aquamarine':'#7fffd4',\n 'azure':'#f0ffff',\n 'beige':'#f5f5dc',\n 'bisque':'#ffe4c4',\n 'black':'#000000',\n 'blanchedalmond':'#ffebcd',\n 'blue':'#0000ff',\n 'blueviolet':'#8a2be2',\n 'brown':'#a52a2a',\n 'burlywood':'#deb887',\n 'cadetblue':'#5f9ea0',\n 'chartreuse':'#7fff00',\n 'chocolate':'#d2691e',\n 'coral':'#ff7f50',\n 'cornflowerblue':'#6495ed',\n 'cornsilk':'#fff8dc',\n 'crimson':'#dc143c',\n 'cyan':'#00ffff',\n 'darkblue':'#00008b',\n 'darkcyan':'#008b8b',\n 'darkgoldenrod':'#b8860b',\n 'darkgray':'#a9a9a9',\n 'darkgrey':'#a9a9a9',\n 'darkgreen':'#006400',\n 'darkkhaki':'#bdb76b',\n 'darkmagenta':'#8b008b',\n 'darkolivegreen':'#556b2f',\n 'darkorange':'#ff8c00',\n 'darkorchid':'#9932cc',\n 'darkred':'#8b0000',\n 'darksalmon':'#e9967a',\n 'darkseagreen':'#8fbc8f',\n 'darkslateblue':'#483d8b',\n 'darkslategray':'#2f4f4f',\n 'darkslategrey':'#2f4f4f',\n 'darkturquoise':'#00ced1',\n 'darkviolet':'#9400d3',\n 'deeppink':'#ff1493',\n 'deepskyblue':'#00bfff',\n 'dimgray':'#696969',\n 'dimgrey':'#696969',\n 'dodgerblue':'#1e90ff',\n 'firebrick':'#b22222',\n 'floralwhite':'#fffaf0',\n 'forestgreen':'#228b22',\n 'fuchsia':'#ff00ff',\n 'gainsboro':'#dcdcdc',\n 'ghostwhite':'#f8f8ff',\n 'gold':'#ffd700',\n 'goldenrod':'#daa520',\n 'gray':'#808080',\n 'grey':'#808080',\n 'green':'#008000',\n 'greenyellow':'#adff2f',\n 'honeydew':'#f0fff0',\n 'hotpink':'#ff69b4',\n 'indianred':'#cd5c5c',\n 'indigo':'#4b0082',\n 'ivory':'#fffff0',\n 'khaki':'#f0e68c',\n 'lavender':'#e6e6fa',\n 'lavenderblush':'#fff0f5',\n 'lawngreen':'#7cfc00',\n 'lemonchiffon':'#fffacd',\n 'lightblue':'#add8e6',\n 'lightcoral':'#f08080',\n 'lightcyan':'#e0ffff',\n 'lightgoldenrodyellow':'#fafad2',\n 'lightgray':'#d3d3d3',\n 'lightgrey':'#d3d3d3',\n 'lightgreen':'#90ee90',\n 'lightpink':'#ffb6c1',\n 'lightsalmon':'#ffa07a',\n 'lightseagreen':'#20b2aa',\n 'lightskyblue':'#87cefa',\n 'lightslategray':'#778899',\n 'lightslategrey':'#778899',\n 'lightsteelblue':'#b0c4de',\n 'lightyellow':'#ffffe0',\n 'lime':'#00ff00',\n 'limegreen':'#32cd32',\n 'linen':'#faf0e6',\n 'magenta':'#ff00ff',\n 'maroon':'#800000',\n 'mediumaquamarine':'#66cdaa',\n 'mediumblue':'#0000cd',\n 'mediumorchid':'#ba55d3',\n 'mediumpurple':'#9370d8',\n 'mediumseagreen':'#3cb371',\n 'mediumslateblue':'#7b68ee',\n 'mediumspringgreen':'#00fa9a',\n 'mediumturquoise':'#48d1cc',\n 'mediumvioletred':'#c71585',\n 'midnightblue':'#191970',\n 'mintcream':'#f5fffa',\n 'mistyrose':'#ffe4e1',\n 'moccasin':'#ffe4b5',\n 'navajowhite':'#ffdead',\n 'navy':'#000080',\n 'oldlace':'#fdf5e6',\n 'olive':'#808000',\n 'olivedrab':'#6b8e23',\n 'orange':'#ffa500',\n 'orangered':'#ff4500',\n 'orchid':'#da70d6',\n 'palegoldenrod':'#eee8aa',\n 'palegreen':'#98fb98',\n 'paleturquoise':'#afeeee',\n 'palevioletred':'#d87093',\n 'papayawhip':'#ffefd5',\n 'peachpuff':'#ffdab9',\n 'peru':'#cd853f',\n 'pink':'#ffc0cb',\n 'plum':'#dda0dd',\n 'powderblue':'#b0e0e6',\n 'purple':'#800080',\n 'rebeccapurple':'#663399',\n 'red':'#ff0000',\n 'rosybrown':'#bc8f8f',\n 'royalblue':'#4169e1',\n 'saddlebrown':'#8b4513',\n 'salmon':'#fa8072',\n 'sandybrown':'#f4a460',\n 'seagreen':'#2e8b57',\n 'seashell':'#fff5ee',\n 'sienna':'#a0522d',\n 'silver':'#c0c0c0',\n 'skyblue':'#87ceeb',\n 'slateblue':'#6a5acd',\n 'slategray':'#708090',\n 'slategrey':'#708090',\n 'snow':'#fffafa',\n 'springgreen':'#00ff7f',\n 'steelblue':'#4682b4',\n 'tan':'#d2b48c',\n 'teal':'#008080',\n 'thistle':'#d8bfd8',\n 'tomato':'#ff6347',\n 'turquoise':'#40e0d0',\n 'violet':'#ee82ee',\n 'wheat':'#f5deb3',\n 'white':'#ffffff',\n 'whitesmoke':'#f5f5f5',\n 'yellow':'#ffff00',\n 'yellowgreen':'#9acd32'\n};","export default {\n length: {\n 'm': 1,\n 'cm': 0.01,\n 'mm': 0.001,\n 'in': 0.0254,\n 'px': 0.0254 / 96,\n 'pt': 0.0254 / 72,\n 'pc': 0.0254 / 72 * 12\n },\n duration: {\n 's': 1,\n 'ms': 0.001\n },\n angle: {\n 'rad': 1 / (2 * Math.PI),\n 'deg': 1 / 360,\n 'grad': 1 / 400,\n 'turn': 1\n }\n};","import colors from './colors';\nimport unitConversions from './unit-conversions';\n\nexport default { colors, unitConversions };\n","/**\n * The reason why Node is a class and other nodes simply do not extend\n * from Node (since we're transpiling) is due to this issue:\n * \n * @see https://github.com/less/less.js/issues/3434\n */\nclass Node {\n constructor() {\n this.parent = null;\n this.visibilityBlocks = undefined;\n this.nodeVisible = undefined;\n this.rootNode = null;\n this.parsed = null;\n }\n\n get currentFileInfo() {\n return this.fileInfo();\n }\n\n get index() {\n return this.getIndex();\n }\n\n setParent(nodes, parent) {\n function set(node) {\n if (node && node instanceof Node) {\n node.parent = parent;\n }\n }\n if (Array.isArray(nodes)) {\n nodes.forEach(set);\n }\n else {\n set(nodes);\n }\n }\n\n getIndex() {\n return this._index || (this.parent && this.parent.getIndex()) || 0;\n }\n\n fileInfo() {\n return this._fileInfo || (this.parent && this.parent.fileInfo()) || {};\n }\n\n isRulesetLike() { return false; }\n\n toCSS(context) {\n const strs = [];\n this.genCSS(context, {\n // remove when genCSS has JSDoc types\n // eslint-disable-next-line no-unused-vars\n add: function(chunk, fileInfo, index) {\n strs.push(chunk);\n },\n isEmpty: function () {\n return strs.length === 0;\n }\n });\n return strs.join('');\n }\n\n genCSS(context, output) {\n output.add(this.value);\n }\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n }\n\n eval() { return this; }\n\n _operate(context, op, a, b) {\n switch (op) {\n case '+': return a + b;\n case '-': return a - b;\n case '*': return a * b;\n case '/': return a / b;\n }\n }\n\n fround(context, value) {\n const precision = context && context.numPrecision;\n // add \"epsilon\" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded:\n return (precision) ? Number((value + 2e-16).toFixed(precision)) : value;\n }\n\n static compare(a, b) {\n /* returns:\n -1: a < b\n 0: a = b\n 1: a > b\n and *any* other value for a != b (e.g. undefined, NaN, -2 etc.) */\n\n if ((a.compare) &&\n // for \"symmetric results\" force toCSS-based comparison\n // of Quoted or Anonymous if either value is one of those\n !(b.type === 'Quoted' || b.type === 'Anonymous')) {\n return a.compare(b);\n } else if (b.compare) {\n return -b.compare(a);\n } else if (a.type !== b.type) {\n return undefined;\n }\n\n a = a.value;\n b = b.value;\n if (!Array.isArray(a)) {\n return a === b ? 0 : undefined;\n }\n if (a.length !== b.length) {\n return undefined;\n }\n for (let i = 0; i < a.length; i++) {\n if (Node.compare(a[i], b[i]) !== 0) {\n return undefined;\n }\n }\n return 0;\n }\n\n static numericCompare(a, b) {\n return a < b ? -1\n : a === b ? 0\n : a > b ? 1 : undefined;\n }\n\n // Returns true if this node represents root of ast imported by reference\n blocksVisibility() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n return this.visibilityBlocks !== 0;\n }\n\n addVisibilityBlock() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks + 1;\n }\n\n removeVisibilityBlock() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks - 1;\n }\n\n // Turns on node visibility - if called node will be shown in output regardless\n // of whether it comes from import by reference or not\n ensureVisibility() {\n this.nodeVisible = true;\n }\n\n // Turns off node visibility - if called node will NOT be shown in output regardless\n // of whether it comes from import by reference or not\n ensureInvisibility() {\n this.nodeVisible = false;\n }\n\n // return values:\n // false - the node must not be visible\n // true - the node must be visible\n // undefined or null - the node has the same visibility as its parent\n isVisible() {\n return this.nodeVisible;\n }\n\n visibilityInfo() {\n return {\n visibilityBlocks: this.visibilityBlocks,\n nodeVisible: this.nodeVisible\n };\n }\n\n copyVisibilityInfo(info) {\n if (!info) {\n return;\n }\n this.visibilityBlocks = info.visibilityBlocks;\n this.nodeVisible = info.nodeVisible;\n }\n}\n\nexport default Node;\n","import Node from './node';\nimport colors from '../data/colors';\n\n//\n// RGB Colors - #ff0014, #eee\n//\nconst Color = function(rgb, a, originalForm) {\n const self = this;\n //\n // The end goal here, is to parse the arguments\n // into an integer triplet, such as `128, 255, 0`\n //\n // This facilitates operations and conversions.\n //\n if (Array.isArray(rgb)) {\n this.rgb = rgb;\n } else if (rgb.length >= 6) {\n this.rgb = [];\n rgb.match(/.{2}/g).map(function (c, i) {\n if (i < 3) {\n self.rgb.push(parseInt(c, 16));\n } else {\n self.alpha = (parseInt(c, 16)) / 255;\n }\n });\n } else {\n this.rgb = [];\n rgb.split('').map(function (c, i) {\n if (i < 3) {\n self.rgb.push(parseInt(c + c, 16));\n } else {\n self.alpha = (parseInt(c + c, 16)) / 255;\n }\n });\n }\n this.alpha = this.alpha || (typeof a === 'number' ? a : 1);\n if (typeof originalForm !== 'undefined') {\n this.value = originalForm;\n }\n}\n\nColor.prototype = Object.assign(new Node(), {\n type: 'Color',\n\n luma() {\n let r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255;\n\n r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4);\n g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4);\n b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4);\n\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n },\n\n toCSS(context, doNotCompress) {\n const compress = context && context.compress && !doNotCompress;\n let color;\n let alpha;\n let colorFunction;\n let args = [];\n\n // `value` is set if this color was originally\n // converted from a named color string so we need\n // to respect this and try to output named color too.\n alpha = this.fround(context, this.alpha);\n\n if (this.value) {\n if (this.value.indexOf('rgb') === 0) {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n } else if (this.value.indexOf('hsl') === 0) {\n if (alpha < 1) {\n colorFunction = 'hsla';\n } else {\n colorFunction = 'hsl';\n }\n } else {\n return this.value;\n }\n } else {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n }\n\n switch (colorFunction) {\n case 'rgba':\n args = this.rgb.map(function (c) {\n return clamp(Math.round(c), 255);\n }).concat(clamp(alpha, 1));\n break;\n case 'hsla':\n args.push(clamp(alpha, 1));\n // eslint-disable-next-line no-fallthrough\n case 'hsl':\n color = this.toHSL();\n args = [\n this.fround(context, color.h),\n `${this.fround(context, color.s * 100)}%`,\n `${this.fround(context, color.l * 100)}%`\n ].concat(args);\n }\n\n if (colorFunction) {\n // Values are capped between `0` and `255`, rounded and zero-padded.\n return `${colorFunction}(${args.join(`,${compress ? '' : ' '}`)})`;\n }\n\n color = this.toRGB();\n\n if (compress) {\n const splitcolor = color.split('');\n\n // Convert color to short format\n if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) {\n color = `#${splitcolor[1]}${splitcolor[3]}${splitcolor[5]}`;\n }\n }\n\n return color;\n },\n\n //\n // Operations have to be done per-channel, if not,\n // channels will spill onto each other. Once we have\n // our result, in the form of an integer triplet,\n // we create a new Color node to hold the result.\n //\n operate(context, op, other) {\n const rgb = new Array(3);\n const alpha = this.alpha * (1 - other.alpha) + other.alpha;\n for (let c = 0; c < 3; c++) {\n rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]);\n }\n return new Color(rgb, alpha);\n },\n\n toRGB() {\n return toHex(this.rgb);\n },\n\n toHSL() {\n const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;\n\n const max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h;\n let s;\n const l = (max + min) / 2;\n const d = max - min;\n\n if (max === min) {\n h = s = 0;\n } else {\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, l, a };\n },\n\n // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript\n toHSV() {\n const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;\n\n const max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h;\n let s;\n const v = max;\n\n const d = max - min;\n if (max === 0) {\n s = 0;\n } else {\n s = d / max;\n }\n\n if (max === min) {\n h = 0;\n } else {\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, v, a };\n },\n\n toARGB() {\n return toHex([this.alpha * 255].concat(this.rgb));\n },\n\n compare(x) {\n return (x.rgb &&\n x.rgb[0] === this.rgb[0] &&\n x.rgb[1] === this.rgb[1] &&\n x.rgb[2] === this.rgb[2] &&\n x.alpha === this.alpha) ? 0 : undefined;\n }\n});\n\nColor.fromKeyword = function(keyword) {\n let c;\n const key = keyword.toLowerCase();\n // eslint-disable-next-line no-prototype-builtins\n if (colors.hasOwnProperty(key)) {\n c = new Color(colors[key].slice(1));\n }\n else if (key === 'transparent') {\n c = new Color([0, 0, 0], 0);\n }\n\n if (c) {\n c.value = keyword;\n return c;\n }\n};\n\nfunction clamp(v, max) {\n return Math.min(Math.max(v, 0), max);\n}\n\nfunction toHex(v) {\n return `#${v.map(function (c) {\n c = clamp(Math.round(c), 255);\n return (c < 16 ? '0' : '') + c.toString(16);\n }).join('')}`;\n}\n\nexport default Color;\n","import Node from './node';\n\nconst Paren = function(node) {\n this.value = node;\n};\n\nParen.prototype = Object.assign(new Node(), {\n type: 'Paren',\n\n genCSS(context, output) {\n output.add('(');\n this.value.genCSS(context, output);\n output.add(')');\n },\n\n eval(context) {\n return new Paren(this.value.eval(context));\n }\n});\n\nexport default Paren;\n","import Node from './node';\nconst _noSpaceCombinators = {\n '': true,\n ' ': true,\n '|': true\n};\n\nconst Combinator = function(value) {\n if (value === ' ') {\n this.value = ' ';\n this.emptyOrWhitespace = true;\n } else {\n this.value = value ? value.trim() : '';\n this.emptyOrWhitespace = this.value === '';\n }\n}\n\nCombinator.prototype = Object.assign(new Node(), {\n type: 'Combinator',\n\n genCSS(context, output) {\n const spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' ';\n output.add(spaceOrEmpty + this.value + spaceOrEmpty);\n }\n});\n\nexport default Combinator;\n","import Node from './node';\nimport Paren from './paren';\nimport Combinator from './combinator';\n\nconst Element = function(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) {\n this.combinator = combinator instanceof Combinator ?\n combinator : new Combinator(combinator);\n\n if (typeof value === 'string') {\n this.value = value.trim();\n } else if (value) {\n this.value = value;\n } else {\n this.value = '';\n }\n this.isVariable = isVariable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.combinator, this);\n}\n\nElement.prototype = Object.assign(new Node(), {\n type: 'Element',\n\n accept(visitor) {\n const value = this.value;\n this.combinator = visitor.visit(this.combinator);\n if (typeof value === 'object') {\n this.value = visitor.visit(value);\n }\n },\n\n eval(context) {\n return new Element(this.combinator,\n this.value.eval ? this.value.eval(context) : this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n clone() {\n return new Element(this.combinator,\n this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context), this.fileInfo(), this.getIndex());\n },\n\n toCSS(context) {\n context = context || {};\n let value = this.value;\n const firstSelector = context.firstSelector;\n if (value instanceof Paren) {\n // selector in parens should not be affected by outer selector\n // flags (breaks only interpolated selectors - see #1973)\n context.firstSelector = true;\n }\n value = value.toCSS ? value.toCSS(context) : value;\n context.firstSelector = firstSelector;\n if (value === '' && this.combinator.value.charAt(0) === '&') {\n return '';\n } else {\n return this.combinator.toCSS(context) + value;\n }\n }\n});\n\nexport default Element;\n","\nexport const Math = {\n ALWAYS: 0,\n PARENS_DIVISION: 1,\n PARENS: 2\n // removed - STRICT_LEGACY: 3\n};\n\nexport const RewriteUrls = {\n OFF: 0,\n LOCAL: 1,\n ALL: 2\n};","/**\r\n * Returns the object type of the given payload\r\n *\r\n * @param {*} payload\r\n * @returns {string}\r\n */\r\nfunction getType(payload) {\r\n return Object.prototype.toString.call(payload).slice(8, -1);\r\n}\r\n/**\r\n * Returns whether the payload is undefined\r\n *\r\n * @param {*} payload\r\n * @returns {payload is undefined}\r\n */\r\nfunction isUndefined(payload) {\r\n return getType(payload) === 'Undefined';\r\n}\r\n/**\r\n * Returns whether the payload is null\r\n *\r\n * @param {*} payload\r\n * @returns {payload is null}\r\n */\r\nfunction isNull(payload) {\r\n return getType(payload) === 'Null';\r\n}\r\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Record}\r\n */\r\nfunction isPlainObject(payload) {\r\n if (getType(payload) !== 'Object')\r\n return false;\r\n return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;\r\n}\r\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Record}\r\n */\r\nfunction isObject(payload) {\r\n return isPlainObject(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is { [K in any]: never }}\r\n */\r\nfunction isEmptyObject(payload) {\r\n return isPlainObject(payload) && Object.keys(payload).length === 0;\r\n}\r\n/**\r\n * Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Record}\r\n */\r\nfunction isAnyObject(payload) {\r\n return getType(payload) === 'Object';\r\n}\r\n/**\r\n * Returns whether the payload is an object like a type passed in < >\r\n *\r\n * Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.\r\n *\r\n * @template T this must be passed in < >\r\n * @param {*} payload\r\n * @returns {payload is T}\r\n */\r\nfunction isObjectLike(payload) {\r\n return isAnyObject(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a function (regular or async)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is AnyFunction}\r\n */\r\nfunction isFunction(payload) {\r\n return typeof payload === \"function\";\r\n}\r\n/**\r\n * Returns whether the payload is an array\r\n *\r\n * @param {any} payload\r\n * @returns {payload is any[]}\r\n */\r\nfunction isArray(payload) {\r\n return getType(payload) === 'Array';\r\n}\r\n/**\r\n * Returns whether the payload is a an array with at least 1 item\r\n *\r\n * @param {*} payload\r\n * @returns {payload is any[]}\r\n */\r\nfunction isFullArray(payload) {\r\n return isArray(payload) && payload.length > 0;\r\n}\r\n/**\r\n * Returns whether the payload is a an empty array\r\n *\r\n * @param {*} payload\r\n * @returns {payload is []}\r\n */\r\nfunction isEmptyArray(payload) {\r\n return isArray(payload) && payload.length === 0;\r\n}\r\n/**\r\n * Returns whether the payload is a string\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isString(payload) {\r\n return getType(payload) === 'String';\r\n}\r\n/**\r\n * Returns whether the payload is a string, BUT returns false for ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isFullString(payload) {\r\n return isString(payload) && payload !== '';\r\n}\r\n/**\r\n * Returns whether the payload is ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isEmptyString(payload) {\r\n return payload === '';\r\n}\r\n/**\r\n * Returns whether the payload is a number (but not NaN)\r\n *\r\n * This will return `false` for `NaN`!!\r\n *\r\n * @param {*} payload\r\n * @returns {payload is number}\r\n */\r\nfunction isNumber(payload) {\r\n return getType(payload) === 'Number' && !isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a boolean\r\n *\r\n * @param {*} payload\r\n * @returns {payload is boolean}\r\n */\r\nfunction isBoolean(payload) {\r\n return getType(payload) === 'Boolean';\r\n}\r\n/**\r\n * Returns whether the payload is a regular expression (RegExp)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is RegExp}\r\n */\r\nfunction isRegExp(payload) {\r\n return getType(payload) === 'RegExp';\r\n}\r\n/**\r\n * Returns whether the payload is a Map\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Map}\r\n */\r\nfunction isMap(payload) {\r\n return getType(payload) === 'Map';\r\n}\r\n/**\r\n * Returns whether the payload is a WeakMap\r\n *\r\n * @param {*} payload\r\n * @returns {payload is WeakMap}\r\n */\r\nfunction isWeakMap(payload) {\r\n return getType(payload) === 'WeakMap';\r\n}\r\n/**\r\n * Returns whether the payload is a Set\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Set}\r\n */\r\nfunction isSet(payload) {\r\n return getType(payload) === 'Set';\r\n}\r\n/**\r\n * Returns whether the payload is a WeakSet\r\n *\r\n * @param {*} payload\r\n * @returns {payload is WeakSet}\r\n */\r\nfunction isWeakSet(payload) {\r\n return getType(payload) === 'WeakSet';\r\n}\r\n/**\r\n * Returns whether the payload is a Symbol\r\n *\r\n * @param {*} payload\r\n * @returns {payload is symbol}\r\n */\r\nfunction isSymbol(payload) {\r\n return getType(payload) === 'Symbol';\r\n}\r\n/**\r\n * Returns whether the payload is a Date, and that the date is valid\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Date}\r\n */\r\nfunction isDate(payload) {\r\n return getType(payload) === 'Date' && !isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a Blob\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Blob}\r\n */\r\nfunction isBlob(payload) {\r\n return getType(payload) === 'Blob';\r\n}\r\n/**\r\n * Returns whether the payload is a File\r\n *\r\n * @param {*} payload\r\n * @returns {payload is File}\r\n */\r\nfunction isFile(payload) {\r\n return getType(payload) === 'File';\r\n}\r\n/**\r\n * Returns whether the payload is a Promise\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Promise}\r\n */\r\nfunction isPromise(payload) {\r\n return getType(payload) === 'Promise';\r\n}\r\n/**\r\n * Returns whether the payload is an Error\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Error}\r\n */\r\nfunction isError(payload) {\r\n return getType(payload) === 'Error';\r\n}\r\n/**\r\n * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is typeof NaN}\r\n */\r\nfunction isNaNValue(payload) {\r\n return getType(payload) === 'Number' && isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is boolean | null | undefined | number | string | symbol)}\r\n */\r\nfunction isPrimitive(payload) {\r\n return (isBoolean(payload) ||\r\n isNull(payload) ||\r\n isUndefined(payload) ||\r\n isNumber(payload) ||\r\n isString(payload) ||\r\n isSymbol(payload));\r\n}\r\n/**\r\n * Returns true whether the payload is null or undefined\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is null | undefined)}\r\n */\r\nfunction isNullOrUndefined(payload) {\r\n return isNull(payload) || isUndefined(payload);\r\n}\r\n/**\r\n * Does a generic check to check that the given payload is of a given type.\r\n * In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!);\r\n * It will, however, differentiate between object and null\r\n *\r\n * @template T\r\n * @param {*} payload\r\n * @param {T} type\r\n * @throws {TypeError} Will throw type error if type is an invalid type\r\n * @returns {payload is T}\r\n */\r\nfunction isType(payload, type) {\r\n if (!(type instanceof Function)) {\r\n throw new TypeError('Type must be a function');\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {\r\n throw new TypeError('Type is not a class');\r\n }\r\n // Classes usually have names (as functions usually have names)\r\n var name = type.name;\r\n return getType(payload) === name || Boolean(payload && payload.constructor === type);\r\n}\n\nexport { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyArray, isEmptyObject, isEmptyString, isError, isFile, isFullArray, isFullString, isFunction, isMap, isNaNValue, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isType, isUndefined, isWeakMap, isWeakSet };\n","import { isArray, isPlainObject } from 'is-what';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\n\nfunction assignProp(carry, key, newVal, originalObject, includeNonenumerable) {\r\n var propType = {}.propertyIsEnumerable.call(originalObject, key)\r\n ? 'enumerable'\r\n : 'nonenumerable';\r\n if (propType === 'enumerable')\r\n carry[key] = newVal;\r\n if (includeNonenumerable && propType === 'nonenumerable') {\r\n Object.defineProperty(carry, key, {\r\n value: newVal,\r\n enumerable: false,\r\n writable: true,\r\n configurable: true,\r\n });\r\n }\r\n}\r\n/**\r\n * Copy (clone) an object and all its props recursively to get rid of any prop referenced of the original object. Arrays are also cloned, however objects inside arrays are still linked.\r\n *\r\n * @export\r\n * @template T\r\n * @param {T} target Target can be anything\r\n * @param {Options} [options={}] Options can be `props` or `nonenumerable`\r\n * @returns {T} the target with replaced values\r\n * @export\r\n */\r\nfunction copy(target, options) {\r\n if (options === void 0) { options = {}; }\r\n if (isArray(target))\r\n return target.map(function (i) { return copy(i, options); });\r\n if (!isPlainObject(target))\r\n return target;\r\n var props = Object.getOwnPropertyNames(target);\r\n var symbols = Object.getOwnPropertySymbols(target);\r\n return __spreadArrays(props, symbols).reduce(function (carry, key) {\r\n if (isArray(options.props) && !options.props.includes(key)) {\r\n return carry;\r\n }\r\n var val = target[key];\r\n var newVal = copy(val, options);\r\n assignProp(carry, key, newVal, target, options.nonenumerable);\r\n return carry;\r\n }, {});\r\n}\n\nexport { copy };\n","/* jshint proto: true */\nimport * as Constants from './constants';\nimport { copy } from 'copy-anything';\n\nexport function getLocation(index, inputStream) {\n let n = index + 1;\n let line = null;\n let column = -1;\n\n while (--n >= 0 && inputStream.charAt(n) !== '\\n') {\n column++;\n }\n\n if (typeof index === 'number') {\n line = (inputStream.slice(0, index).match(/\\n/g) || '').length;\n }\n\n return {\n line,\n column\n };\n}\n\nexport function copyArray(arr) {\n let i;\n const length = arr.length;\n const copy = new Array(length);\n\n for (i = 0; i < length; i++) {\n copy[i] = arr[i];\n }\n return copy;\n}\n\nexport function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n}\n\nexport function defaults(obj1, obj2) {\n let newObj = obj2 || {};\n if (!obj2._defaults) {\n newObj = {};\n const defaults = copy(obj1);\n newObj._defaults = defaults;\n const cloned = obj2 ? copy(obj2) : {};\n Object.assign(newObj, defaults, cloned);\n }\n return newObj;\n}\n\nexport function copyOptions(obj1, obj2) {\n if (obj2 && obj2._defaults) {\n return obj2;\n }\n const opts = defaults(obj1, obj2);\n if (opts.strictMath) {\n opts.math = Constants.Math.PARENS;\n }\n // Back compat with changed relativeUrls option\n if (opts.relativeUrls) {\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n }\n if (typeof opts.math === 'string') {\n switch (opts.math.toLowerCase()) {\n case 'always':\n opts.math = Constants.Math.ALWAYS;\n break;\n case 'parens-division':\n opts.math = Constants.Math.PARENS_DIVISION;\n break;\n case 'strict':\n case 'parens':\n opts.math = Constants.Math.PARENS;\n break;\n default:\n opts.math = Constants.Math.PARENS;\n }\n }\n if (typeof opts.rewriteUrls === 'string') {\n switch (opts.rewriteUrls.toLowerCase()) {\n case 'off':\n opts.rewriteUrls = Constants.RewriteUrls.OFF;\n break;\n case 'local':\n opts.rewriteUrls = Constants.RewriteUrls.LOCAL;\n break;\n case 'all':\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n break;\n }\n }\n return opts;\n}\n\nexport function merge(obj1, obj2) {\n for (const prop in obj2) {\n if (Object.prototype.hasOwnProperty.call(obj2, prop)) {\n obj1[prop] = obj2[prop];\n }\n }\n return obj1;\n}\n\nexport function flattenArray(arr, result = []) {\n for (let i = 0, length = arr.length; i < length; i++) {\n const value = arr[i];\n if (Array.isArray(value)) {\n flattenArray(value, result);\n } else {\n if (value !== undefined) {\n result.push(value);\n }\n }\n }\n return result;\n}\n\nexport function isNullOrUndefined(val) {\n return val === null || val === undefined\n}","import * as utils from './utils';\n\nconst anonymousFunc = /(|Function):(\\d+):(\\d+)/;\n\n/**\n * This is a centralized class of any error that could be thrown internally (mostly by the parser).\n * Besides standard .message it keeps some additional data like a path to the file where the error\n * occurred along with line and column numbers.\n *\n * @class\n * @extends Error\n * @type {module.LessError}\n *\n * @prop {string} type\n * @prop {string} filename\n * @prop {number} index\n * @prop {number} line\n * @prop {number} column\n * @prop {number} callLine\n * @prop {number} callExtract\n * @prop {string[]} extract\n *\n * @param {Object} e - An error object to wrap around or just a descriptive object\n * @param {Object} fileContentMap - An object with file contents in 'contents' property (like importManager) @todo - move to fileManager?\n * @param {string} [currentFilename]\n */\nconst LessError = function(e, fileContentMap, currentFilename) {\n Error.call(this);\n\n const filename = e.filename || currentFilename;\n\n this.message = e.message;\n this.stack = e.stack;\n\n if (fileContentMap && filename) {\n const input = fileContentMap.contents[filename];\n const loc = utils.getLocation(e.index, input);\n var line = loc.line;\n const col = loc.column;\n const callLine = e.call && utils.getLocation(e.call, input).line;\n const lines = input ? input.split('\\n') : '';\n\n this.type = e.type || 'Syntax';\n this.filename = filename;\n this.index = e.index;\n this.line = typeof line === 'number' ? line + 1 : null;\n this.column = col;\n\n if (!this.line && this.stack) {\n const found = this.stack.match(anonymousFunc);\n\n /**\n * We have to figure out how this environment stringifies anonymous functions\n * so we can correctly map plugin errors.\n * \n * Note, in Node 8, the output of anonymous funcs varied based on parameters\n * being present or not, so we inject dummy params.\n */\n const func = new Function('a', 'throw new Error()');\n let lineAdjust = 0;\n try {\n func();\n } catch (e) {\n const match = e.stack.match(anonymousFunc);\n lineAdjust = 1 - parseInt(match[2]);\n }\n\n if (found) {\n if (found[2]) {\n this.line = parseInt(found[2]) + lineAdjust;\n }\n if (found[3]) {\n this.column = parseInt(found[3]);\n }\n }\n }\n\n this.callLine = callLine + 1;\n this.callExtract = lines[callLine];\n\n this.extract = [\n lines[this.line - 2],\n lines[this.line - 1],\n lines[this.line]\n ];\n }\n\n};\n\nif (typeof Object.create === 'undefined') {\n const F = function () {};\n F.prototype = Error.prototype;\n LessError.prototype = new F();\n} else {\n LessError.prototype = Object.create(Error.prototype);\n}\n\nLessError.prototype.constructor = LessError;\n\n/**\n * An overridden version of the default Object.prototype.toString\n * which uses additional information to create a helpful message.\n *\n * @param {Object} options\n * @returns {string}\n */\nLessError.prototype.toString = function(options) {\n options = options || {};\n\n let message = '';\n const extract = this.extract || [];\n let error = [];\n let stylize = function (str) { return str; };\n if (options.stylize) {\n const type = typeof options.stylize;\n if (type !== 'function') {\n throw Error(`options.stylize should be a function, got a ${type}!`);\n }\n stylize = options.stylize;\n }\n\n if (this.line !== null) {\n if (typeof extract[0] === 'string') {\n error.push(stylize(`${this.line - 1} ${extract[0]}`, 'grey'));\n }\n\n if (typeof extract[1] === 'string') {\n let errorTxt = `${this.line} `;\n if (extract[1]) {\n errorTxt += extract[1].slice(0, this.column) +\n stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') +\n extract[1].slice(this.column + 1), 'red'), 'inverse');\n }\n error.push(errorTxt);\n }\n\n if (typeof extract[2] === 'string') {\n error.push(stylize(`${this.line + 1} ${extract[2]}`, 'grey'));\n }\n error = `${error.join('\\n') + stylize('', 'reset')}\\n`;\n }\n\n message += stylize(`${this.type}Error: ${this.message}`, 'red');\n if (this.filename) {\n message += stylize(' in ', 'red') + this.filename;\n }\n if (this.line) {\n message += stylize(` on line ${this.line}, column ${this.column + 1}:`, 'grey');\n }\n\n message += `\\n${error}`;\n\n if (this.callLine) {\n message += `${stylize('from ', 'red') + (this.filename || '')}/n`;\n message += `${stylize(this.callLine, 'grey')} ${this.callExtract}/n`;\n }\n\n return message;\n};\n\nexport default LessError;","import tree from '../tree';\n\nconst _visitArgs = { visitDeeper: true };\nlet _hasIndexed = false;\n\nfunction _noop(node) {\n return node;\n}\n\nfunction indexNodeTypes(parent, ticker) {\n // add .typeIndex to tree node types for lookup table\n let key, child;\n for (key in parent) { \n /* eslint guard-for-in: 0 */\n child = parent[key];\n switch (typeof child) {\n case 'function':\n // ignore bound functions directly on tree which do not have a prototype\n // or aren't nodes\n if (child.prototype && child.prototype.type) {\n child.prototype.typeIndex = ticker++;\n }\n break;\n case 'object':\n ticker = indexNodeTypes(child, ticker);\n break;\n \n }\n }\n return ticker;\n}\n\nclass Visitor {\n constructor(implementation) {\n this._implementation = implementation;\n this._visitInCache = {};\n this._visitOutCache = {};\n\n if (!_hasIndexed) {\n indexNodeTypes(tree, 1);\n _hasIndexed = true;\n }\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n\n const nodeTypeIndex = node.typeIndex;\n if (!nodeTypeIndex) {\n // MixinCall args aren't a node type?\n if (node.value && node.value.typeIndex) {\n this.visit(node.value);\n }\n return node;\n }\n\n const impl = this._implementation;\n let func = this._visitInCache[nodeTypeIndex];\n let funcOut = this._visitOutCache[nodeTypeIndex];\n const visitArgs = _visitArgs;\n let fnName;\n\n visitArgs.visitDeeper = true;\n\n if (!func) {\n fnName = `visit${node.type}`;\n func = impl[fnName] || _noop;\n funcOut = impl[`${fnName}Out`] || _noop;\n this._visitInCache[nodeTypeIndex] = func;\n this._visitOutCache[nodeTypeIndex] = funcOut;\n }\n\n if (func !== _noop) {\n const newNode = func.call(impl, node, visitArgs);\n if (node && impl.isReplacing) {\n node = newNode;\n }\n }\n\n if (visitArgs.visitDeeper && node) {\n if (node.length) {\n for (let i = 0, cnt = node.length; i < cnt; i++) {\n if (node[i].accept) {\n node[i].accept(this);\n }\n }\n } else if (node.accept) {\n node.accept(this);\n }\n }\n\n if (funcOut != _noop) {\n funcOut.call(impl, node);\n }\n\n return node;\n }\n\n visitArray(nodes, nonReplacing) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n\n // Non-replacing\n if (nonReplacing || !this._implementation.isReplacing) {\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n // Replacing\n const out = [];\n for (i = 0; i < cnt; i++) {\n const evald = this.visit(nodes[i]);\n if (evald === undefined) { continue; }\n if (!evald.splice) {\n out.push(evald);\n } else if (evald.length) {\n this.flatten(evald, out);\n }\n }\n return out;\n }\n\n flatten(arr, out) {\n if (!out) {\n out = [];\n }\n\n let cnt, i, item, nestedCnt, j, nestedItem;\n\n for (i = 0, cnt = arr.length; i < cnt; i++) {\n item = arr[i];\n if (item === undefined) {\n continue;\n }\n if (!item.splice) {\n out.push(item);\n continue;\n }\n\n for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) {\n nestedItem = item[j];\n if (nestedItem === undefined) {\n continue;\n }\n if (!nestedItem.splice) {\n out.push(nestedItem);\n } else if (nestedItem.length) {\n this.flatten(nestedItem, out);\n }\n }\n }\n\n return out;\n }\n}\n\nexport default Visitor;\n","const contexts = {};\nexport default contexts;\nimport * as Constants from './constants';\n\nconst copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) {\n if (!original) { return; }\n\n for (let i = 0; i < propertiesToCopy.length; i++) {\n if (Object.prototype.hasOwnProperty.call(original, propertiesToCopy[i])) {\n destination[propertiesToCopy[i]] = original[propertiesToCopy[i]];\n }\n }\n};\n\n/*\n parse is used whilst parsing\n */\nconst parseCopyProperties = [\n // options\n 'paths', // option - unmodified - paths to search for imports on\n 'rewriteUrls', // option - whether to adjust URL's to be relative\n 'rootpath', // option - rootpath to append to URL's\n 'strictImports', // option -\n 'insecure', // option - whether to allow imports from insecure ssl hosts\n 'dumpLineNumbers', // option - whether to dump line numbers\n 'compress', // option - whether to compress\n 'syncImport', // option - whether to import synchronously\n 'chunkInput', // option - whether to chunk input. more performant but causes parse issues.\n 'mime', // browser only - mime type for sheet import\n 'useFileCache', // browser only - whether to use the per file session cache\n // context\n 'processImports', // option & context - whether to process imports. if false then imports will not be imported.\n // Used by the import manager to stop multiple import visitors being created.\n 'pluginManager' // Used as the plugin manager for the session\n];\n\ncontexts.Parse = function(options) {\n copyFromOriginal(options, this, parseCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n};\n\nconst evalCopyProperties = [\n 'paths', // additional include paths\n 'compress', // whether to compress\n 'math', // whether math has to be within parenthesis\n 'strictUnits', // whether units need to evaluate correctly\n 'sourceMap', // whether to output a source map\n 'importMultiple', // whether we are currently importing multiple copies\n 'urlArgs', // whether to add args into url tokens\n 'javascriptEnabled', // option - whether Inline JavaScript is enabled. if undefined, defaults to false\n 'pluginManager', // Used as the plugin manager for the session\n 'importantScope', // used to bubble up !important statements\n 'rewriteUrls' // option - whether to adjust URL's to be relative\n];\n\ncontexts.Eval = function(options, frames) {\n copyFromOriginal(options, this, evalCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n\n this.frames = frames || [];\n this.importantScope = this.importantScope || [];\n};\n\ncontexts.Eval.prototype.enterCalc = function () {\n if (!this.calcStack) {\n this.calcStack = [];\n }\n this.calcStack.push(true);\n this.inCalc = true;\n};\n\ncontexts.Eval.prototype.exitCalc = function () {\n this.calcStack.pop();\n if (!this.calcStack.length) {\n this.inCalc = false;\n }\n};\n\ncontexts.Eval.prototype.inParenthesis = function () {\n if (!this.parensStack) {\n this.parensStack = [];\n }\n this.parensStack.push(true);\n};\n\ncontexts.Eval.prototype.outOfParenthesis = function () {\n this.parensStack.pop();\n};\n\ncontexts.Eval.prototype.inCalc = false;\ncontexts.Eval.prototype.mathOn = true;\ncontexts.Eval.prototype.isMathOn = function (op) {\n if (!this.mathOn) {\n return false;\n }\n if (op === '/' && this.math !== Constants.Math.ALWAYS && (!this.parensStack || !this.parensStack.length)) {\n return false;\n }\n if (this.math > Constants.Math.PARENS_DIVISION) {\n return this.parensStack && this.parensStack.length;\n }\n return true;\n};\n\ncontexts.Eval.prototype.pathRequiresRewrite = function (path) {\n const isRelative = this.rewriteUrls === Constants.RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative;\n\n return isRelative(path);\n};\n\ncontexts.Eval.prototype.rewritePath = function (path, rootpath) {\n let newPath;\n\n rootpath = rootpath || '';\n newPath = this.normalizePath(rootpath + path);\n\n // If a path was explicit relative and the rootpath was not an absolute path\n // we must ensure that the new path is also explicit relative.\n if (isPathLocalRelative(path) &&\n isPathRelative(rootpath) &&\n isPathLocalRelative(newPath) === false) {\n newPath = `./${newPath}`;\n }\n\n return newPath;\n};\n\ncontexts.Eval.prototype.normalizePath = function (path) {\n const segments = path.split('/').reverse();\n let segment;\n\n path = [];\n while (segments.length !== 0) {\n segment = segments.pop();\n switch ( segment ) {\n case '.':\n break;\n case '..':\n if ((path.length === 0) || (path[path.length - 1] === '..')) {\n path.push( segment );\n } else {\n path.pop();\n }\n break;\n default:\n path.push(segment);\n break;\n }\n }\n\n return path.join('/');\n};\n\nfunction isPathRelative(path) {\n return !/^(?:[a-z-]+:|\\/|#)/i.test(path);\n}\n\nfunction isPathLocalRelative(path) {\n return path.charAt(0) === '.';\n}\n\n// todo - do the same for the toCSS ?\n","class ImportSequencer {\n constructor(onSequencerEmpty) {\n this.imports = [];\n this.variableImports = [];\n this._onSequencerEmpty = onSequencerEmpty;\n this._currentDepth = 0;\n }\n\n addImport(callback) {\n const importSequencer = this,\n importItem = {\n callback,\n args: null,\n isReady: false\n };\n this.imports.push(importItem);\n return function() {\n importItem.args = Array.prototype.slice.call(arguments, 0);\n importItem.isReady = true;\n importSequencer.tryRun();\n };\n }\n\n addVariableImport(callback) {\n this.variableImports.push(callback);\n }\n\n tryRun() {\n this._currentDepth++;\n try {\n while (true) {\n while (this.imports.length > 0) {\n const importItem = this.imports[0];\n if (!importItem.isReady) {\n return;\n }\n this.imports = this.imports.slice(1);\n importItem.callback.apply(null, importItem.args);\n }\n if (this.variableImports.length === 0) {\n break;\n }\n const variableImport = this.variableImports[0];\n this.variableImports = this.variableImports.slice(1);\n variableImport();\n }\n } finally {\n this._currentDepth--;\n }\n if (this._currentDepth === 0 && this._onSequencerEmpty) {\n this._onSequencerEmpty();\n }\n }\n}\n\nexport default ImportSequencer;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport contexts from '../contexts';\nimport Visitor from './visitor';\nimport ImportSequencer from './import-sequencer';\nimport * as utils from '../utils';\n\nconst ImportVisitor = function(importer, finish) {\n\n this._visitor = new Visitor(this);\n this._importer = importer;\n this._finish = finish;\n this.context = new contexts.Eval();\n this.importCount = 0;\n this.onceFileDetectionMap = {};\n this.recursionDetector = {};\n this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this));\n};\n\nImportVisitor.prototype = {\n isReplacing: false,\n run: function (root) {\n try {\n // process the contents\n this._visitor.visit(root);\n }\n catch (e) {\n this.error = e;\n }\n\n this.isFinished = true;\n this._sequencer.tryRun();\n },\n _onSequencerEmpty: function() {\n if (!this.isFinished) {\n return;\n }\n this._finish(this.error);\n },\n visitImport: function (importNode, visitArgs) {\n const inlineCSS = importNode.options.inline;\n\n if (!importNode.css || inlineCSS) {\n\n const context = new contexts.Eval(this.context, utils.copyArray(this.context.frames));\n const importParent = context.frames[0];\n\n this.importCount++;\n if (importNode.isVariableImport()) {\n this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent));\n } else {\n this.processImportNode(importNode, context, importParent);\n }\n }\n visitArgs.visitDeeper = false;\n },\n processImportNode: function(importNode, context, importParent) {\n let evaldImportNode;\n const inlineCSS = importNode.options.inline;\n\n try {\n evaldImportNode = importNode.evalForImport(context);\n } catch (e) {\n if (!e.filename) { e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename; }\n // attempt to eval properly and treat as css\n importNode.css = true;\n // if that fails, this error will be thrown\n importNode.error = e;\n }\n\n if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) {\n\n if (evaldImportNode.options.multiple) {\n context.importMultiple = true;\n }\n\n // try appending if we haven't determined if it is css or not\n const tryAppendLessExtension = evaldImportNode.css === undefined;\n\n for (let i = 0; i < importParent.rules.length; i++) {\n if (importParent.rules[i] === importNode) {\n importParent.rules[i] = evaldImportNode;\n break;\n }\n }\n\n const onImported = this.onImported.bind(this, evaldImportNode, context), sequencedOnImported = this._sequencer.addImport(onImported);\n\n this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(),\n evaldImportNode.options, sequencedOnImported);\n } else {\n this.importCount--;\n if (this.isFinished) {\n this._sequencer.tryRun();\n }\n }\n },\n onImported: function (importNode, context, e, root, importedAtRoot, fullPath) {\n if (e) {\n if (!e.filename) {\n e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename;\n }\n this.error = e;\n }\n\n const importVisitor = this,\n inlineCSS = importNode.options.inline,\n isPlugin = importNode.options.isPlugin,\n isOptional = importNode.options.optional,\n duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector;\n\n if (!context.importMultiple) {\n if (duplicateImport) {\n importNode.skip = true;\n } else {\n importNode.skip = function() {\n if (fullPath in importVisitor.onceFileDetectionMap) {\n return true;\n }\n importVisitor.onceFileDetectionMap[fullPath] = true;\n return false;\n };\n }\n }\n\n if (!fullPath && isOptional) {\n importNode.skip = true;\n }\n\n if (root) {\n importNode.root = root;\n importNode.importedFilename = fullPath;\n\n if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) {\n importVisitor.recursionDetector[fullPath] = true;\n\n const oldContext = this.context;\n this.context = context;\n try {\n this._visitor.visit(root);\n } catch (e) {\n this.error = e;\n }\n this.context = oldContext;\n }\n }\n\n importVisitor.importCount--;\n\n if (importVisitor.isFinished) {\n importVisitor._sequencer.tryRun();\n }\n },\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.unshift(declNode);\n } else {\n visitArgs.visitDeeper = false;\n }\n },\n visitDeclarationOut: function(declNode) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.shift();\n }\n },\n visitAtRule: function (atRuleNode, visitArgs) {\n this.context.frames.unshift(atRuleNode);\n },\n visitAtRuleOut: function (atRuleNode) {\n this.context.frames.shift();\n },\n visitMixinDefinition: function (mixinDefinitionNode, visitArgs) {\n this.context.frames.unshift(mixinDefinitionNode);\n },\n visitMixinDefinitionOut: function (mixinDefinitionNode) {\n this.context.frames.shift();\n },\n visitRuleset: function (rulesetNode, visitArgs) {\n this.context.frames.unshift(rulesetNode);\n },\n visitRulesetOut: function (rulesetNode) {\n this.context.frames.shift();\n },\n visitMedia: function (mediaNode, visitArgs) {\n this.context.frames.unshift(mediaNode.rules[0]);\n },\n visitMediaOut: function (mediaNode) {\n this.context.frames.shift();\n }\n};\nexport default ImportVisitor;\n","class SetTreeVisibilityVisitor {\n constructor(visible) {\n this.visible = visible;\n }\n\n run(root) {\n this.visit(root);\n }\n\n visitArray(nodes) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n if (node.constructor === Array) {\n return this.visitArray(node);\n }\n\n if (!node.blocksVisibility || node.blocksVisibility()) {\n return node;\n }\n if (this.visible) {\n node.ensureVisibility();\n } else {\n node.ensureInvisibility();\n }\n\n node.accept(this);\n return node;\n }\n}\n\nexport default SetTreeVisibilityVisitor;","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport tree from '../tree';\nimport Visitor from './visitor';\nimport logger from '../logger';\nimport * as utils from '../utils';\n\n/* jshint loopfunc:true */\n\nclass ExtendFinderVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n this.contexts = [];\n this.allExtendsStack = [[]];\n }\n\n run(root) {\n root = this._visitor.visit(root);\n root.allExtends = this.allExtendsStack[0];\n return root;\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n\n let i;\n let j;\n let extend;\n const allSelectorsExtendList = [];\n let extendList;\n\n // get &:extend(.a); rules which apply to all selectors in this ruleset\n const rules = rulesetNode.rules, ruleCnt = rules ? rules.length : 0;\n for (i = 0; i < ruleCnt; i++) {\n if (rulesetNode.rules[i] instanceof tree.Extend) {\n allSelectorsExtendList.push(rules[i]);\n rulesetNode.extendOnEveryPath = true;\n }\n }\n\n // now find every selector and apply the extends that apply to all extends\n // and the ones which apply to an individual extend\n const paths = rulesetNode.paths;\n for (i = 0; i < paths.length; i++) {\n const selectorPath = paths[i], selector = selectorPath[selectorPath.length - 1], selExtendList = selector.extendList;\n\n extendList = selExtendList ? utils.copyArray(selExtendList).concat(allSelectorsExtendList)\n : allSelectorsExtendList;\n\n if (extendList) {\n extendList = extendList.map(function(allSelectorsExtend) {\n return allSelectorsExtend.clone();\n });\n }\n\n for (j = 0; j < extendList.length; j++) {\n this.foundExtends = true;\n extend = extendList[j];\n extend.findSelfSelectors(selectorPath);\n extend.ruleset = rulesetNode;\n if (j === 0) { extend.firstExtendOnThisSelectorPath = true; }\n this.allExtendsStack[this.allExtendsStack.length - 1].push(extend);\n }\n }\n\n this.contexts.push(rulesetNode.selectors);\n }\n\n visitRulesetOut(rulesetNode) {\n if (!rulesetNode.root) {\n this.contexts.length = this.contexts.length - 1;\n }\n }\n\n visitMedia(mediaNode, visitArgs) {\n mediaNode.allExtends = [];\n this.allExtendsStack.push(mediaNode.allExtends);\n }\n\n visitMediaOut(mediaNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n atRuleNode.allExtends = [];\n this.allExtendsStack.push(atRuleNode.allExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n}\n\nclass ProcessExtendsVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n const extendFinder = new ExtendFinderVisitor();\n this.extendIndices = {};\n extendFinder.run(root);\n if (!extendFinder.foundExtends) { return root; }\n root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends));\n this.allExtendsStack = [root.allExtends];\n const newRoot = this._visitor.visit(root);\n this.checkExtendsForNonMatched(root.allExtends);\n return newRoot;\n }\n\n checkExtendsForNonMatched(extendList) {\n const indices = this.extendIndices;\n extendList.filter(function(extend) {\n return !extend.hasFoundMatches && extend.parent_ids.length == 1;\n }).forEach(function(extend) {\n let selector = '_unknown_';\n try {\n selector = extend.selector.toCSS({});\n }\n catch (_) {}\n\n if (!indices[`${extend.index} ${selector}`]) {\n indices[`${extend.index} ${selector}`] = true;\n logger.warn(`extend '${selector}' has no matches`);\n }\n });\n }\n\n doExtendChaining(extendsList, extendsListTarget, iterationCount) {\n //\n // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering\n // and pasting the selector we would do normally, but we are also adding an extend with the same target selector\n // this means this new extend can then go and alter other extends\n //\n // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors\n // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already\n // processed if we look at each selector at a time, as is done in visitRuleset\n\n let extendIndex;\n\n let targetExtendIndex;\n let matches;\n const extendsToAdd = [];\n let newSelector;\n const extendVisitor = this;\n let selectorPath;\n let extend;\n let targetExtend;\n let newExtend;\n\n iterationCount = iterationCount || 0;\n\n // loop through comparing every extend with every target extend.\n // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place\n // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one\n // and the second is the target.\n // the separation into two lists allows us to process a subset of chains with a bigger set, as is the\n // case when processing media queries\n for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) {\n for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) {\n\n extend = extendsList[extendIndex];\n targetExtend = extendsListTarget[targetExtendIndex];\n\n // look for circular references\n if ( extend.parent_ids.indexOf( targetExtend.object_id ) >= 0 ) { continue; }\n\n // find a match in the target extends self selector (the bit before :extend)\n selectorPath = [targetExtend.selfSelectors[0]];\n matches = extendVisitor.findMatch(extend, selectorPath);\n\n if (matches.length) {\n extend.hasFoundMatches = true;\n\n // we found a match, so for each self selector..\n extend.selfSelectors.forEach(function(selfSelector) {\n const info = targetExtend.visibilityInfo();\n\n // process the extend as usual\n newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible());\n\n // but now we create a new extend from it\n newExtend = new(tree.Extend)(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info);\n newExtend.selfSelectors = newSelector;\n\n // add the extend onto the list of extends for that selector\n newSelector[newSelector.length - 1].extendList = [newExtend];\n\n // record that we need to add it.\n extendsToAdd.push(newExtend);\n newExtend.ruleset = targetExtend.ruleset;\n\n // remember its parents for circular references\n newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids);\n\n // only process the selector once.. if we have :extend(.a,.b) then multiple\n // extends will look at the same selector path, so when extending\n // we know that any others will be duplicates in terms of what is added to the css\n if (targetExtend.firstExtendOnThisSelectorPath) {\n newExtend.firstExtendOnThisSelectorPath = true;\n targetExtend.ruleset.paths.push(newSelector);\n }\n });\n }\n }\n }\n\n if (extendsToAdd.length) {\n // try to detect circular references to stop a stack overflow.\n // may no longer be needed.\n this.extendChainCount++;\n if (iterationCount > 100) {\n let selectorOne = '{unable to calculate}';\n let selectorTwo = '{unable to calculate}';\n try {\n selectorOne = extendsToAdd[0].selfSelectors[0].toCSS();\n selectorTwo = extendsToAdd[0].selector.toCSS();\n }\n catch (e) {}\n throw { message: `extend circular reference detected. One of the circular extends is currently:${selectorOne}:extend(${selectorTwo})`};\n }\n\n // now process the new extends on the existing rules so that we can handle a extending b extending c extending\n // d extending e...\n return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1));\n } else {\n return extendsToAdd;\n }\n }\n\n visitDeclaration(ruleNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitSelector(selectorNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n let matches;\n let pathIndex;\n let extendIndex;\n const allExtends = this.allExtendsStack[this.allExtendsStack.length - 1];\n const selectorsToAdd = [];\n const extendVisitor = this;\n let selectorPath;\n\n // look at each selector path in the ruleset, find any extend matches and then copy, find and replace\n\n for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) {\n for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) {\n selectorPath = rulesetNode.paths[pathIndex];\n\n // extending extends happens initially, before the main pass\n if (rulesetNode.extendOnEveryPath) { continue; }\n const extendList = selectorPath[selectorPath.length - 1].extendList;\n if (extendList && extendList.length) { continue; }\n\n matches = this.findMatch(allExtends[extendIndex], selectorPath);\n\n if (matches.length) {\n allExtends[extendIndex].hasFoundMatches = true;\n\n allExtends[extendIndex].selfSelectors.forEach(function(selfSelector) {\n let extendedSelectors;\n extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible());\n selectorsToAdd.push(extendedSelectors);\n });\n }\n }\n }\n rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd);\n }\n\n findMatch(extend, haystackSelectorPath) {\n //\n // look through the haystack selector path to try and find the needle - extend.selector\n // returns an array of selector matches that can then be replaced\n //\n let haystackSelectorIndex;\n\n let hackstackSelector;\n let hackstackElementIndex;\n let haystackElement;\n let targetCombinator;\n let i;\n const extendVisitor = this;\n const needleElements = extend.selector.elements;\n const potentialMatches = [];\n let potentialMatch;\n const matches = [];\n\n // loop through the haystack elements\n for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) {\n hackstackSelector = haystackSelectorPath[haystackSelectorIndex];\n\n for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) {\n\n haystackElement = hackstackSelector.elements[hackstackElementIndex];\n\n // if we allow elements before our match we can add a potential match every time. otherwise only at the first element.\n if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) {\n potentialMatches.push({pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0,\n initialCombinator: haystackElement.combinator});\n }\n\n for (i = 0; i < potentialMatches.length; i++) {\n potentialMatch = potentialMatches[i];\n\n // selectors add \" \" onto the first element. When we use & it joins the selectors together, but if we don't\n // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to\n // work out what the resulting combinator will be\n targetCombinator = haystackElement.combinator.value;\n if (targetCombinator === '' && hackstackElementIndex === 0) {\n targetCombinator = ' ';\n }\n\n // if we don't match, null our match to indicate failure\n if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) ||\n (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) {\n potentialMatch = null;\n } else {\n potentialMatch.matched++;\n }\n\n // if we are still valid and have finished, test whether we have elements after and whether these are allowed\n if (potentialMatch) {\n potentialMatch.finished = potentialMatch.matched === needleElements.length;\n if (potentialMatch.finished &&\n (!extend.allowAfter &&\n (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) {\n potentialMatch = null;\n }\n }\n // if null we remove, if not, we are still valid, so either push as a valid match or continue\n if (potentialMatch) {\n if (potentialMatch.finished) {\n potentialMatch.length = needleElements.length;\n potentialMatch.endPathIndex = haystackSelectorIndex;\n potentialMatch.endPathElementIndex = hackstackElementIndex + 1; // index after end of match\n potentialMatches.length = 0; // we don't allow matches to overlap, so start matching again\n matches.push(potentialMatch);\n }\n } else {\n potentialMatches.splice(i, 1);\n i--;\n }\n }\n }\n }\n return matches;\n }\n\n isElementValuesEqual(elementValue1, elementValue2) {\n if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') {\n return elementValue1 === elementValue2;\n }\n if (elementValue1 instanceof tree.Attribute) {\n if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) {\n return false;\n }\n if (!elementValue1.value || !elementValue2.value) {\n if (elementValue1.value || elementValue2.value) {\n return false;\n }\n return true;\n }\n elementValue1 = elementValue1.value.value || elementValue1.value;\n elementValue2 = elementValue2.value.value || elementValue2.value;\n return elementValue1 === elementValue2;\n }\n elementValue1 = elementValue1.value;\n elementValue2 = elementValue2.value;\n if (elementValue1 instanceof tree.Selector) {\n if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) {\n return false;\n }\n for (let i = 0; i < elementValue1.elements.length; i++) {\n if (elementValue1.elements[i].combinator.value !== elementValue2.elements[i].combinator.value) {\n if (i !== 0 || (elementValue1.elements[i].combinator.value || ' ') !== (elementValue2.elements[i].combinator.value || ' ')) {\n return false;\n }\n }\n if (!this.isElementValuesEqual(elementValue1.elements[i].value, elementValue2.elements[i].value)) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n\n extendSelector(matches, selectorPath, replacementSelector, isVisible) {\n\n // for a set of matches, replace each match with the replacement selector\n\n let currentSelectorPathIndex = 0, currentSelectorPathElementIndex = 0, path = [], matchIndex, selector, firstElement, match, newElements;\n\n for (matchIndex = 0; matchIndex < matches.length; matchIndex++) {\n match = matches[matchIndex];\n selector = selectorPath[match.pathIndex];\n firstElement = new tree.Element(\n match.initialCombinator,\n replacementSelector.elements[0].value,\n replacementSelector.elements[0].isVariable,\n replacementSelector.elements[0].getIndex(),\n replacementSelector.elements[0].fileInfo()\n );\n\n if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n\n newElements = selector.elements\n .slice(currentSelectorPathElementIndex, match.index)\n .concat([firstElement])\n .concat(replacementSelector.elements.slice(1));\n\n if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) {\n path[path.length - 1].elements =\n path[path.length - 1].elements.concat(newElements);\n } else {\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex));\n\n path.push(new tree.Selector(\n newElements\n ));\n }\n currentSelectorPathIndex = match.endPathIndex;\n currentSelectorPathElementIndex = match.endPathElementIndex;\n if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) {\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n }\n\n if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathIndex++;\n }\n\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length));\n path = path.map(function (currentValue) {\n // we can re-use elements here, because the visibility property matters only for selectors\n const derived = currentValue.createDerived(currentValue.elements);\n if (isVisible) {\n derived.ensureVisibility();\n } else {\n derived.ensureInvisibility();\n }\n return derived;\n });\n return path;\n }\n\n visitMedia(mediaNode, visitArgs) {\n let newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitMediaOut(mediaNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n let newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n}\n\nexport default ProcessExtendsVisitor;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport Visitor from './visitor';\n\nclass JoinSelectorVisitor {\n constructor() {\n this.contexts = [[]];\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n return this._visitor.visit(root);\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n const paths = [];\n let selectors;\n\n this.contexts.push(paths);\n\n if (!rulesetNode.root) {\n selectors = rulesetNode.selectors;\n if (selectors) {\n selectors = selectors.filter(function(selector) { return selector.getIsOutput(); });\n rulesetNode.selectors = selectors.length ? selectors : (selectors = null);\n if (selectors) { rulesetNode.joinSelectors(paths, context, selectors); }\n }\n if (!selectors) { rulesetNode.rules = null; }\n rulesetNode.paths = paths;\n }\n }\n\n visitRulesetOut(rulesetNode) {\n this.contexts.length = this.contexts.length - 1;\n }\n\n visitMedia(mediaNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia);\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n if (atRuleNode.rules && atRuleNode.rules.length) {\n atRuleNode.rules[0].root = (atRuleNode.isRooted || context.length === 0 || null);\n }\n }\n}\n\nexport default JoinSelectorVisitor;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport tree from '../tree';\nimport Visitor from './visitor';\n\nclass CSSVisitorUtils {\n constructor(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n }\n\n containsSilentNonBlockedChild(bodyRules) {\n let rule;\n if (!bodyRules) {\n return false;\n }\n for (let r = 0; r < bodyRules.length; r++) {\n rule = bodyRules[r];\n if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) {\n // the atrule contains something that was referenced (likely by extend)\n // therefore it needs to be shown in output too\n return true;\n }\n }\n return false;\n }\n\n keepOnlyVisibleChilds(owner) {\n if (owner && owner.rules) {\n owner.rules = owner.rules.filter(thing => thing.isVisible());\n }\n }\n\n isEmpty(owner) {\n return (owner && owner.rules) \n ? (owner.rules.length === 0) : true;\n }\n\n hasVisibleSelector(rulesetNode) {\n return (rulesetNode && rulesetNode.paths)\n ? (rulesetNode.paths.length > 0) : false;\n }\n\n resolveVisibility(node) {\n if (!node.blocksVisibility()) {\n if (this.isEmpty(node)) {\n return ;\n }\n\n return node;\n }\n\n const compiledRulesBody = node.rules[0];\n this.keepOnlyVisibleChilds(compiledRulesBody);\n\n if (this.isEmpty(compiledRulesBody)) {\n return ;\n }\n\n node.ensureVisibility();\n node.removeVisibilityBlock();\n\n return node;\n }\n\n isVisibleRuleset(rulesetNode) {\n if (rulesetNode.firstRoot) {\n return true;\n }\n\n if (this.isEmpty(rulesetNode)) {\n return false;\n }\n\n if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) {\n return false;\n }\n\n return true;\n }\n}\n\nconst ToCSSVisitor = function(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n this.utils = new CSSVisitorUtils(context);\n};\n\nToCSSVisitor.prototype = {\n isReplacing: true,\n run: function (root) {\n return this._visitor.visit(root);\n },\n\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.blocksVisibility() || declNode.variable) {\n return;\n }\n return declNode;\n },\n\n visitMixinDefinition: function (mixinNode, visitArgs) {\n // mixin definitions do not get eval'd - this means they keep state\n // so we have to clear that state here so it isn't used if toCSS is called twice\n mixinNode.frames = [];\n },\n\n visitExtend: function (extendNode, visitArgs) {\n },\n\n visitComment: function (commentNode, visitArgs) {\n if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) {\n return;\n }\n return commentNode;\n },\n\n visitMedia: function(mediaNode, visitArgs) {\n const originalRules = mediaNode.rules[0].rules;\n mediaNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n return this.utils.resolveVisibility(mediaNode, originalRules);\n },\n\n visitImport: function (importNode, visitArgs) {\n if (importNode.blocksVisibility()) {\n return ;\n }\n return importNode;\n },\n\n visitAtRule: function(atRuleNode, visitArgs) {\n if (atRuleNode.rules && atRuleNode.rules.length) {\n return this.visitAtRuleWithBody(atRuleNode, visitArgs);\n } else {\n return this.visitAtRuleWithoutBody(atRuleNode, visitArgs);\n }\n },\n\n visitAnonymous: function(anonymousNode, visitArgs) {\n if (!anonymousNode.blocksVisibility()) {\n anonymousNode.accept(this._visitor);\n return anonymousNode;\n }\n },\n\n visitAtRuleWithBody: function(atRuleNode, visitArgs) {\n // if there is only one nested ruleset and that one has no path, then it is\n // just fake ruleset\n function hasFakeRuleset(atRuleNode) {\n const bodyRules = atRuleNode.rules;\n return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0);\n }\n function getBodyRules(atRuleNode) {\n const nodeRules = atRuleNode.rules;\n if (hasFakeRuleset(atRuleNode)) {\n return nodeRules[0].rules;\n }\n\n return nodeRules;\n }\n // it is still true that it is only one ruleset in array\n // this is last such moment\n // process childs\n const originalRules = getBodyRules(atRuleNode);\n atRuleNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n if (!this.utils.isEmpty(atRuleNode)) {\n this._mergeRules(atRuleNode.rules[0].rules);\n }\n\n return this.utils.resolveVisibility(atRuleNode, originalRules);\n },\n\n visitAtRuleWithoutBody: function(atRuleNode, visitArgs) {\n if (atRuleNode.blocksVisibility()) {\n return;\n }\n\n if (atRuleNode.name === '@charset') {\n // Only output the debug info together with subsequent @charset definitions\n // a comment (or @media statement) before the actual @charset atrule would\n // be considered illegal css as it has to be on the first line\n if (this.charset) {\n if (atRuleNode.debugInfo) {\n const comment = new tree.Comment(`/* ${atRuleNode.toCSS(this._context).replace(/\\n/g, '')} */\\n`);\n comment.debugInfo = atRuleNode.debugInfo;\n return this._visitor.visit(comment);\n }\n return;\n }\n this.charset = true;\n }\n\n return atRuleNode;\n },\n\n checkValidNodes: function(rules, isRoot) {\n if (!rules) {\n return;\n }\n\n for (let i = 0; i < rules.length; i++) {\n const ruleNode = rules[i];\n if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) {\n throw { message: 'Properties must be inside selector blocks. They cannot be in the root',\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode instanceof tree.Call) {\n throw { message: `Function '${ruleNode.name}' did not return a root node`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode.type && !ruleNode.allowRoot) {\n throw { message: `${ruleNode.type} node returned by a function is not valid here`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n }\n },\n\n visitRuleset: function (rulesetNode, visitArgs) {\n // at this point rulesets are nested into each other\n let rule;\n\n const rulesets = [];\n\n this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot);\n\n if (!rulesetNode.root) {\n // remove invisible paths\n this._compileRulesetPaths(rulesetNode);\n\n // remove rulesets from this ruleset body and compile them separately\n const nodeRules = rulesetNode.rules;\n\n let nodeRuleCnt = nodeRules ? nodeRules.length : 0;\n for (let i = 0; i < nodeRuleCnt; ) {\n rule = nodeRules[i];\n if (rule && rule.rules) {\n // visit because we are moving them out from being a child\n rulesets.push(this._visitor.visit(rule));\n nodeRules.splice(i, 1);\n nodeRuleCnt--;\n continue;\n }\n i++;\n }\n // accept the visitor to remove rules and refactor itself\n // then we can decide nogw whether we want it or not\n // compile body\n if (nodeRuleCnt > 0) {\n rulesetNode.accept(this._visitor);\n } else {\n rulesetNode.rules = null;\n }\n visitArgs.visitDeeper = false;\n } else { // if (! rulesetNode.root) {\n rulesetNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n }\n\n if (rulesetNode.rules) {\n this._mergeRules(rulesetNode.rules);\n this._removeDuplicateRules(rulesetNode.rules);\n }\n\n // now decide whether we keep the ruleset\n if (this.utils.isVisibleRuleset(rulesetNode)) {\n rulesetNode.ensureVisibility();\n rulesets.splice(0, 0, rulesetNode);\n }\n\n if (rulesets.length === 1) {\n return rulesets[0];\n }\n return rulesets;\n },\n\n _compileRulesetPaths: function(rulesetNode) {\n if (rulesetNode.paths) {\n rulesetNode.paths = rulesetNode.paths\n .filter(p => {\n let i;\n if (p[0].elements[0].combinator.value === ' ') {\n p[0].elements[0].combinator = new(tree.Combinator)('');\n }\n for (i = 0; i < p.length; i++) {\n if (p[i].isVisible() && p[i].getIsOutput()) {\n return true;\n }\n }\n return false;\n });\n }\n },\n\n _removeDuplicateRules: function(rules) {\n if (!rules) { return; }\n\n // remove duplicates\n const ruleCache = {};\n\n let ruleList;\n let rule;\n let i;\n\n for (i = rules.length - 1; i >= 0 ; i--) {\n rule = rules[i];\n if (rule instanceof tree.Declaration) {\n if (!ruleCache[rule.name]) {\n ruleCache[rule.name] = rule;\n } else {\n ruleList = ruleCache[rule.name];\n if (ruleList instanceof tree.Declaration) {\n ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)];\n }\n const ruleCSS = rule.toCSS(this._context);\n if (ruleList.indexOf(ruleCSS) !== -1) {\n rules.splice(i, 1);\n } else {\n ruleList.push(ruleCSS);\n }\n }\n }\n }\n },\n\n _mergeRules: function(rules) {\n if (!rules) {\n return; \n }\n\n const groups = {};\n const groupsArr = [];\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n if (rule.merge) {\n const key = rule.name;\n groups[key] ? rules.splice(i--, 1) : \n groupsArr.push(groups[key] = []);\n groups[key].push(rule);\n }\n }\n\n groupsArr.forEach(group => {\n if (group.length > 0) {\n const result = group[0];\n let space = [];\n const comma = [new tree.Expression(space)];\n group.forEach(rule => {\n if ((rule.merge === '+') && (space.length > 0)) {\n comma.push(new tree.Expression(space = []));\n }\n space.push(rule.value);\n result.important = result.important || rule.important;\n });\n result.value = new tree.Value(comma);\n }\n });\n }\n};\n\nexport default ToCSSVisitor;\n","import Visitor from './visitor';\nimport ImportVisitor from './import-visitor';\nimport MarkVisibleSelectorsVisitor from './set-tree-visibility-visitor';\nimport ExtendVisitor from './extend-visitor';\nimport JoinSelectorVisitor from './join-selector-visitor';\nimport ToCSSVisitor from './to-css-visitor';\n\nexport default {\n Visitor,\n ImportVisitor,\n MarkVisibleSelectorsVisitor,\n ExtendVisitor,\n JoinSelectorVisitor,\n ToCSSVisitor\n};\n","import chunker from './chunker';\n\nexport default () => {\n let // Less input string\n input;\n\n let // current chunk\n j;\n\n const // holds state for backtracking\n saveStack = [];\n\n let // furthest index the parser has gone to\n furthest;\n\n let // if this is furthest we got to, this is the probably cause\n furthestPossibleErrorMessage;\n\n let // chunkified input\n chunks;\n\n let // current chunk\n current;\n\n let // index of current chunk, in `input`\n currentPos;\n\n const parserInput = {};\n const CHARCODE_SPACE = 32;\n const CHARCODE_TAB = 9;\n const CHARCODE_LF = 10;\n const CHARCODE_CR = 13;\n const CHARCODE_PLUS = 43;\n const CHARCODE_COMMA = 44;\n const CHARCODE_FORWARD_SLASH = 47;\n const CHARCODE_9 = 57;\n\n function skipWhitespace(length) {\n const oldi = parserInput.i;\n const oldj = j;\n const curr = parserInput.i - currentPos;\n const endIndex = parserInput.i + current.length - curr;\n const mem = (parserInput.i += length);\n const inp = input;\n let c;\n let nextChar;\n let comment;\n\n for (; parserInput.i < endIndex; parserInput.i++) {\n c = inp.charCodeAt(parserInput.i);\n\n if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) {\n nextChar = inp.charAt(parserInput.i + 1);\n if (nextChar === '/') {\n comment = {index: parserInput.i, isLineComment: true};\n let nextNewLine = inp.indexOf('\\n', parserInput.i + 2);\n if (nextNewLine < 0) {\n nextNewLine = endIndex;\n }\n parserInput.i = nextNewLine;\n comment.text = inp.substr(comment.index, parserInput.i - comment.index);\n parserInput.commentStore.push(comment);\n continue;\n } else if (nextChar === '*') {\n const nextStarSlash = inp.indexOf('*/', parserInput.i + 2);\n if (nextStarSlash >= 0) {\n comment = {\n index: parserInput.i,\n text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i),\n isLineComment: false\n };\n parserInput.i += comment.text.length - 1;\n parserInput.commentStore.push(comment);\n continue;\n }\n }\n break;\n }\n\n if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) {\n break;\n }\n }\n\n current = current.slice(length + parserInput.i - mem + curr);\n currentPos = parserInput.i;\n\n if (!current.length) {\n if (j < chunks.length - 1) {\n current = chunks[++j];\n skipWhitespace(0); // skip space at the beginning of a chunk\n return true; // things changed\n }\n parserInput.finished = true;\n }\n\n return oldi !== parserInput.i || oldj !== j;\n }\n\n parserInput.save = () => {\n currentPos = parserInput.i;\n saveStack.push( { current, i: parserInput.i, j });\n };\n parserInput.restore = possibleErrorMessage => {\n\n if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) {\n furthest = parserInput.i;\n furthestPossibleErrorMessage = possibleErrorMessage;\n }\n const state = saveStack.pop();\n current = state.current;\n currentPos = parserInput.i = state.i;\n j = state.j;\n };\n parserInput.forget = () => {\n saveStack.pop();\n };\n parserInput.isWhitespace = offset => {\n const pos = parserInput.i + (offset || 0);\n const code = input.charCodeAt(pos);\n return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF);\n };\n\n // Specialization of $(tok)\n parserInput.$re = tok => {\n if (parserInput.i > currentPos) {\n current = current.slice(parserInput.i - currentPos);\n currentPos = parserInput.i;\n }\n\n const m = tok.exec(current);\n if (!m) {\n return null;\n }\n\n skipWhitespace(m[0].length);\n if (typeof m === 'string') {\n return m;\n }\n\n return m.length === 1 ? m[0] : m;\n };\n\n parserInput.$char = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n skipWhitespace(1);\n return tok;\n };\n\n parserInput.$peekChar = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n return tok;\n };\n\n parserInput.$str = tok => {\n const tokLength = tok.length;\n\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tokLength; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return null;\n }\n }\n\n skipWhitespace(tokLength);\n return tok;\n };\n\n parserInput.$quoted = loc => {\n const pos = loc || parserInput.i;\n const startChar = input.charAt(pos);\n\n if (startChar !== '\\'' && startChar !== '\"') {\n return;\n }\n const length = input.length;\n const currentPosition = pos;\n\n for (let i = 1; i + currentPosition < length; i++) {\n const nextChar = input.charAt(i + currentPosition);\n switch (nextChar) {\n case '\\\\':\n i++;\n continue;\n case '\\r':\n case '\\n':\n break;\n case startChar: {\n const str = input.substr(currentPosition, i + 1);\n if (!loc && loc !== 0) {\n skipWhitespace(i + 1);\n return str\n }\n return [startChar, str];\n }\n default:\n }\n }\n return null;\n };\n\n /**\n * Permissive parsing. Ignores everything except matching {} [] () and quotes\n * until matching token (outside of blocks)\n */\n parserInput.$parseUntil = tok => {\n let quote = '';\n let returnVal = null;\n let inComment = false;\n let blockDepth = 0;\n const blockStack = [];\n const parseGroups = [];\n const length = input.length;\n const startPos = parserInput.i;\n let lastPos = parserInput.i;\n let i = parserInput.i;\n let loop = true;\n let testChar;\n\n if (typeof tok === 'string') {\n testChar = char => char === tok\n } else {\n testChar = char => tok.test(char)\n }\n\n do {\n let nextChar = input.charAt(i);\n if (blockDepth === 0 && testChar(nextChar)) {\n returnVal = input.substr(lastPos, i - lastPos);\n if (returnVal) {\n parseGroups.push(returnVal);\n }\n else {\n parseGroups.push(' ');\n }\n returnVal = parseGroups;\n skipWhitespace(i - startPos);\n loop = false\n } else {\n if (inComment) {\n if (nextChar === '*' && \n input.charAt(i + 1) === '/') {\n i++;\n blockDepth--;\n inComment = false;\n }\n i++;\n continue;\n }\n switch (nextChar) {\n case '\\\\':\n i++;\n nextChar = input.charAt(i);\n parseGroups.push(input.substr(lastPos, i - lastPos + 1));\n lastPos = i + 1;\n break;\n case '/':\n if (input.charAt(i + 1) === '*') {\n i++;\n inComment = true;\n blockDepth++;\n }\n break;\n case '\\'':\n case '\"':\n quote = parserInput.$quoted(i);\n if (quote) {\n parseGroups.push(input.substr(lastPos, i - lastPos), quote);\n i += quote[1].length - 1;\n lastPos = i + 1;\n }\n else {\n skipWhitespace(i - startPos);\n returnVal = nextChar;\n loop = false;\n }\n break;\n case '{':\n blockStack.push('}');\n blockDepth++;\n break;\n case '(':\n blockStack.push(')');\n blockDepth++;\n break;\n case '[':\n blockStack.push(']');\n blockDepth++;\n break;\n case '}':\n case ')':\n case ']': {\n const expected = blockStack.pop();\n if (nextChar === expected) {\n blockDepth--;\n } else {\n // move the parser to the error and return expected\n skipWhitespace(i - startPos);\n returnVal = expected;\n loop = false;\n }\n }\n }\n i++;\n if (i > length) {\n loop = false;\n }\n }\n } while (loop);\n\n return returnVal ? returnVal : null;\n }\n\n parserInput.autoCommentAbsorb = true;\n parserInput.commentStore = [];\n parserInput.finished = false;\n\n // Same as $(), but don't change the state of the parser,\n // just return the match.\n parserInput.peek = tok => {\n if (typeof tok === 'string') {\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tok.length; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return false;\n }\n }\n return true;\n } else {\n return tok.test(current);\n }\n };\n\n // Specialization of peek()\n // TODO remove or change some currentChar calls to peekChar\n parserInput.peekChar = tok => input.charAt(parserInput.i) === tok;\n\n parserInput.currentChar = () => input.charAt(parserInput.i);\n\n parserInput.prevChar = () => input.charAt(parserInput.i - 1);\n\n parserInput.getInput = () => input;\n\n parserInput.peekNotNumeric = () => {\n const c = input.charCodeAt(parserInput.i);\n // Is the first char of the dimension 0-9, '.', '+' or '-'\n return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA;\n };\n\n parserInput.start = (str, chunkInput, failFunction) => {\n input = str;\n parserInput.i = j = currentPos = furthest = 0;\n\n // chunking apparently makes things quicker (but my tests indicate\n // it might actually make things slower in node at least)\n // and it is a non-perfect parse - it can't recognise\n // unquoted urls, meaning it can't distinguish comments\n // meaning comments with quotes or {}() in them get 'counted'\n // and then lead to parse errors.\n // In addition if the chunking chunks in the wrong place we might\n // not be able to parse a parser statement in one go\n // this is officially deprecated but can be switched on via an option\n // in the case it causes too much performance issues.\n if (chunkInput) {\n chunks = chunker(str, failFunction);\n } else {\n chunks = [str];\n }\n\n current = chunks[0];\n\n skipWhitespace(0);\n };\n\n parserInput.end = () => {\n let message;\n const isFinished = parserInput.i >= input.length;\n\n if (parserInput.i < furthest) {\n message = furthestPossibleErrorMessage;\n parserInput.i = furthest;\n }\n return {\n isFinished,\n furthest: parserInput.i,\n furthestPossibleErrorMessage: message,\n furthestReachedEnd: parserInput.i >= input.length - 1,\n furthestChar: input[parserInput.i]\n };\n };\n\n return parserInput;\n};\n","// Split the input into chunks.\nexport default function (input, fail) {\n const len = input.length;\n let level = 0;\n let parenLevel = 0;\n let lastOpening;\n let lastOpeningParen;\n let lastMultiComment;\n let lastMultiCommentEndBrace;\n const chunks = [];\n let emitFrom = 0;\n let chunkerCurrentIndex;\n let currentChunkStartIndex;\n let cc;\n let cc2;\n let matched;\n\n function emitChunk(force) {\n const len = chunkerCurrentIndex - emitFrom;\n if (((len < 512) && !force) || !len) {\n return;\n }\n chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1));\n emitFrom = chunkerCurrentIndex + 1;\n }\n\n for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc = input.charCodeAt(chunkerCurrentIndex);\n if (((cc >= 97) && (cc <= 122)) || (cc < 34)) {\n // a-z or whitespace\n continue;\n }\n\n switch (cc) {\n case 40: // (\n parenLevel++;\n lastOpeningParen = chunkerCurrentIndex;\n continue;\n case 41: // )\n if (--parenLevel < 0) {\n return fail('missing opening `(`', chunkerCurrentIndex);\n }\n continue;\n case 59: // ;\n if (!parenLevel) { emitChunk(); }\n continue;\n case 123: // {\n level++;\n lastOpening = chunkerCurrentIndex;\n continue;\n case 125: // }\n if (--level < 0) {\n return fail('missing opening `{`', chunkerCurrentIndex);\n }\n if (!level && !parenLevel) { emitChunk(); }\n continue;\n case 92: // \\\n if (chunkerCurrentIndex < len - 1) { chunkerCurrentIndex++; continue; }\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n case 34:\n case 39:\n case 96: // \", ' and `\n matched = 0;\n currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 > 96) { continue; }\n if (cc2 == cc) { matched = 1; break; }\n if (cc2 == 92) { // \\\n if (chunkerCurrentIndex == len - 1) {\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n }\n chunkerCurrentIndex++;\n }\n }\n if (matched) { continue; }\n return fail(`unmatched \\`${String.fromCharCode(cc)}\\``, currentChunkStartIndex);\n case 47: // /, check for comment\n if (parenLevel || (chunkerCurrentIndex == len - 1)) { continue; }\n cc2 = input.charCodeAt(chunkerCurrentIndex + 1);\n if (cc2 == 47) {\n // //, find lnfeed\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) { break; }\n }\n } else if (cc2 == 42) {\n // /*, find */\n lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 == 125) { lastMultiCommentEndBrace = chunkerCurrentIndex; }\n if (cc2 != 42) { continue; }\n if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) { break; }\n }\n if (chunkerCurrentIndex == len - 1) {\n return fail('missing closing `*/`', currentChunkStartIndex);\n }\n chunkerCurrentIndex++;\n }\n continue;\n case 42: // *, check for unmatched */\n if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) {\n return fail('unmatched `/*`', chunkerCurrentIndex);\n }\n continue;\n }\n }\n\n if (level !== 0) {\n if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) {\n return fail('missing closing `}` or `*/`', lastOpening);\n } else {\n return fail('missing closing `}`', lastOpening);\n }\n } else if (parenLevel !== 0) {\n return fail('missing closing `)`', lastOpeningParen);\n }\n\n emitChunk(true);\n return chunks;\n}\n","function makeRegistry( base ) {\n return {\n _data: {},\n add: function(name, func) {\n // precautionary case conversion, as later querying of\n // the registry by function-caller uses lower case as well.\n name = name.toLowerCase();\n\n // eslint-disable-next-line no-prototype-builtins\n if (this._data.hasOwnProperty(name)) {\n // TODO warn\n }\n this._data[name] = func;\n },\n addMultiple: function(functions) {\n Object.keys(functions).forEach(\n name => {\n this.add(name, functions[name]);\n });\n },\n get: function(name) {\n return this._data[name] || ( base && base.get( name ));\n },\n getLocalFunctions: function() {\n return this._data;\n },\n inherit: function() {\n return makeRegistry( this );\n },\n create: function(base) {\n return makeRegistry(base);\n }\n };\n}\n\nexport default makeRegistry( null );","export const MediaSyntaxOptions = {\n queryInParens: true\n};\n\nexport const ContainerSyntaxOptions = {\n queryInParens: true\n};\n","import LessError from '../less-error';\nimport tree from '../tree';\nimport visitors from '../visitors';\nimport getParserInput from './parser-input';\nimport * as utils from '../utils';\nimport functionRegistry from '../functions/function-registry';\nimport { ContainerSyntaxOptions, MediaSyntaxOptions } from '../tree/atrule-syntax';\n\n//\n// less.js - parser\n//\n// A relatively straight-forward predictive parser.\n// There is no tokenization/lexing stage, the input is parsed\n// in one sweep.\n//\n// To make the parser fast enough to run in the browser, several\n// optimization had to be made:\n//\n// - Matching and slicing on a huge input is often cause of slowdowns.\n// The solution is to chunkify the input into smaller strings.\n// The chunks are stored in the `chunks` var,\n// `j` holds the current chunk index, and `currentPos` holds\n// the index of the current chunk in relation to `input`.\n// This gives us an almost 4x speed-up.\n//\n// - In many cases, we don't need to match individual tokens;\n// for example, if a value doesn't hold any variables, operations\n// or dynamic references, the parser can effectively 'skip' it,\n// treating it as a literal.\n// An example would be '1px solid #000' - which evaluates to itself,\n// we don't need to know what the individual components are.\n// The drawback, of course is that you don't get the benefits of\n// syntax-checking on the CSS. This gives us a 50% speed-up in the parser,\n// and a smaller speed-up in the code-gen.\n//\n//\n// Token matching is done with the `$` function, which either takes\n// a terminal string or regexp, or a non-terminal function to call.\n// It also takes care of moving all the indices forwards.\n//\n\nconst Parser = function Parser(context, imports, fileInfo, currentIndex) {\n currentIndex = currentIndex || 0;\n let parsers;\n const parserInput = getParserInput();\n\n function error(msg, type) {\n throw new LessError(\n {\n index: parserInput.i,\n filename: fileInfo.filename,\n type: type || 'Syntax',\n message: msg\n },\n imports\n );\n }\n\n function expect(arg, msg) {\n // some older browsers return typeof 'function' for RegExp\n const result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg);\n if (result) {\n return result;\n }\n\n error(msg || (typeof arg === 'string'\n ? `expected '${arg}' got '${parserInput.currentChar()}'`\n : 'unexpected token'));\n }\n\n // Specialization of expect()\n function expectChar(arg, msg) {\n if (parserInput.$char(arg)) {\n return arg;\n }\n error(msg || `expected '${arg}' got '${parserInput.currentChar()}'`);\n }\n\n function getDebugInfo(index) {\n const filename = fileInfo.filename;\n\n return {\n lineNumber: utils.getLocation(index, parserInput.getInput()).line + 1,\n fileName: filename\n };\n }\n\n /**\n * Used after initial parsing to create nodes on the fly\n *\n * @param {String} str - string to parse\n * @param {Array} parseList - array of parsers to run input through e.g. [\"value\", \"important\"]\n * @param {Number} currentIndex - start number to begin indexing\n * @param {Object} fileInfo - fileInfo to attach to created nodes\n */\n function parseNode(str, parseList, callback) {\n let result;\n const returnNodes = [];\n const parser = parserInput;\n\n try {\n parser.start(str, false, function fail(msg, index) {\n callback({\n message: msg,\n index: index + currentIndex\n });\n });\n for (let x = 0, p; (p = parseList[x]); x++) {\n result = parsers[p]();\n returnNodes.push(result || null);\n }\n\n const endInfo = parser.end();\n if (endInfo.isFinished) {\n callback(null, returnNodes);\n }\n else {\n callback(true, null);\n }\n } catch (e) {\n throw new LessError({\n index: e.index + currentIndex,\n message: e.message\n }, imports, fileInfo.filename);\n }\n }\n\n //\n // The Parser\n //\n return {\n parserInput,\n imports,\n fileInfo,\n parseNode,\n //\n // Parse an input string into an abstract syntax tree,\n // @param str A string containing 'less' markup\n // @param callback call `callback` when done.\n // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply\n //\n parse: function (str, callback, additionalData) {\n let root;\n let err = null;\n let globalVars;\n let modifyVars;\n let ignored;\n let preText = '';\n\n // Optionally disable @plugin parsing\n if (additionalData && additionalData.disablePluginRule) {\n parsers.plugin = function() {\n var dir = parserInput.$re(/^@plugin?\\s+/);\n if (dir) {\n error('@plugin statements are not allowed when disablePluginRule is set to true');\n }\n }\n }\n\n globalVars = (additionalData && additionalData.globalVars) ? `${Parser.serializeVars(additionalData.globalVars)}\\n` : '';\n modifyVars = (additionalData && additionalData.modifyVars) ? `\\n${Parser.serializeVars(additionalData.modifyVars)}` : '';\n\n if (context.pluginManager) {\n const preProcessors = context.pluginManager.getPreProcessors();\n for (let i = 0; i < preProcessors.length; i++) {\n str = preProcessors[i].process(str, { context, imports, fileInfo });\n }\n }\n\n if (globalVars || (additionalData && additionalData.banner)) {\n preText = ((additionalData && additionalData.banner) ? additionalData.banner : '') + globalVars;\n ignored = imports.contentsIgnoredChars;\n ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0;\n ignored[fileInfo.filename] += preText.length;\n }\n\n str = str.replace(/\\r\\n?/g, '\\n');\n // Remove potential UTF Byte Order Mark\n str = preText + str.replace(/^\\uFEFF/, '') + modifyVars;\n imports.contents[fileInfo.filename] = str;\n\n // Start with the primary rule.\n // The whole syntax tree is held under a Ruleset node,\n // with the `root` property set to true, so no `{}` are\n // output. The callback is called when the input is parsed.\n try {\n parserInput.start(str, context.chunkInput, function fail(msg, index) {\n throw new LessError({\n index,\n type: 'Parse',\n message: msg,\n filename: fileInfo.filename\n }, imports);\n });\n\n tree.Node.prototype.parse = this;\n root = new tree.Ruleset(null, this.parsers.primary());\n tree.Node.prototype.rootNode = root;\n root.root = true;\n root.firstRoot = true;\n root.functionRegistry = functionRegistry.inherit();\n\n } catch (e) {\n return callback(new LessError(e, imports, fileInfo.filename));\n }\n\n // If `i` is smaller than the `input.length - 1`,\n // it means the parser wasn't able to parse the whole\n // string, so we've got a parsing error.\n //\n // We try to extract a \\n delimited string,\n // showing the line where the parse error occurred.\n // We split it up into two parts (the part which parsed,\n // and the part which didn't), so we can color them differently.\n const endInfo = parserInput.end();\n if (!endInfo.isFinished) {\n\n let message = endInfo.furthestPossibleErrorMessage;\n\n if (!message) {\n message = 'Unrecognised input';\n if (endInfo.furthestChar === '}') {\n message += '. Possibly missing opening \\'{\\'';\n } else if (endInfo.furthestChar === ')') {\n message += '. Possibly missing opening \\'(\\'';\n } else if (endInfo.furthestReachedEnd) {\n message += '. Possibly missing something';\n }\n }\n\n err = new LessError({\n type: 'Parse',\n message,\n index: endInfo.furthest,\n filename: fileInfo.filename\n }, imports);\n }\n\n const finish = e => {\n e = err || e || imports.error;\n\n if (e) {\n if (!(e instanceof LessError)) {\n e = new LessError(e, imports, fileInfo.filename);\n }\n\n return callback(e);\n }\n else {\n return callback(null, root);\n }\n };\n\n if (context.processImports !== false) {\n new visitors.ImportVisitor(imports, finish)\n .run(root);\n } else {\n return finish();\n }\n },\n\n //\n // Here in, the parsing rules/functions\n //\n // The basic structure of the syntax tree generated is as follows:\n //\n // Ruleset -> Declaration -> Value -> Expression -> Entity\n //\n // Here's some Less code:\n //\n // .class {\n // color: #fff;\n // border: 1px solid #000;\n // width: @w + 4px;\n // > .child {...}\n // }\n //\n // And here's what the parse tree might look like:\n //\n // Ruleset (Selector '.class', [\n // Declaration (\"color\", Value ([Expression [Color #fff]]))\n // Declaration (\"border\", Value ([Expression [Dimension 1px][Keyword \"solid\"][Color #000]]))\n // Declaration (\"width\", Value ([Expression [Operation \" + \" [Variable \"@w\"][Dimension 4px]]]))\n // Ruleset (Selector [Element '>', '.child'], [...])\n // ])\n //\n // In general, most rules will try to parse a token with the `$re()` function, and if the return\n // value is truly, will return a new node, of the relevant type. Sometimes, we need to check\n // first, before parsing, that's when we use `peek()`.\n //\n parsers: parsers = {\n //\n // The `primary` rule is the *entry* and *exit* point of the parser.\n // The rules here can appear at any level of the parse tree.\n //\n // The recursive nature of the grammar is an interplay between the `block`\n // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,\n // as represented by this simplified grammar:\n //\n // primary → (ruleset | declaration)+\n // ruleset → selector+ block\n // block → '{' primary '}'\n //\n // Only at one point is the primary rule not called from the\n // block rule: at the root level.\n //\n primary: function () {\n const mixin = this.mixin;\n let root = [];\n let node;\n\n while (true) {\n while (true) {\n node = this.comment();\n if (!node) { break; }\n root.push(node);\n }\n // always process comments before deciding if finished\n if (parserInput.finished) {\n break;\n }\n if (parserInput.peek('}')) {\n break;\n }\n\n node = this.extendRule();\n if (node) {\n root = root.concat(node);\n continue;\n }\n\n node = mixin.definition() || this.declaration() || mixin.call(false, false) ||\n this.ruleset() || this.variableCall() || this.entities.call() || this.atrule();\n if (node) {\n root.push(node);\n } else {\n let foundSemiColon = false;\n while (parserInput.$char(';')) {\n foundSemiColon = true;\n }\n if (!foundSemiColon) {\n break;\n }\n }\n }\n\n return root;\n },\n\n // comments are collected by the main parsing mechanism and then assigned to nodes\n // where the current structure allows it\n comment: function () {\n if (parserInput.commentStore.length) {\n const comment = parserInput.commentStore.shift();\n return new(tree.Comment)(comment.text, comment.isLineComment, comment.index + currentIndex, fileInfo);\n }\n },\n\n //\n // Entities are tokens which can be found inside an Expression\n //\n entities: {\n mixinLookup: function() {\n return parsers.mixin.call(true, true);\n },\n //\n // A string, which supports escaping \" and '\n //\n // \"milky way\" 'he\\'s the one!'\n //\n quoted: function (forceEscaped) {\n let str;\n const index = parserInput.i;\n let isEscaped = false;\n\n parserInput.save();\n if (parserInput.$char('~')) {\n isEscaped = true;\n } else if (forceEscaped) {\n parserInput.restore();\n return;\n }\n\n str = parserInput.$quoted();\n if (!str) {\n parserInput.restore();\n return;\n }\n parserInput.forget();\n\n return new(tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index + currentIndex, fileInfo);\n },\n\n //\n // A catch-all word, such as:\n //\n // black border-collapse\n //\n keyword: function () {\n const k = parserInput.$char('%') || parserInput.$re(/^\\[?(?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\\]?/);\n if (k) {\n return tree.Color.fromKeyword(k) || new(tree.Keyword)(k);\n }\n },\n\n //\n // A function call\n //\n // rgb(255, 0, 255)\n //\n // The arguments are parsed with the `entities.arguments` parser.\n //\n call: function () {\n let name;\n let args;\n let func;\n const index = parserInput.i;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (parserInput.peek(/^url\\(/i)) {\n return;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^([\\w-]+|%|~|progid:[\\w.]+)\\(/);\n if (!name) {\n parserInput.forget();\n return;\n }\n\n name = name[1];\n func = this.customFuncCall(name);\n if (func) {\n args = func.parse();\n if (args && func.stop) {\n parserInput.forget();\n return args;\n }\n }\n\n args = this.arguments(args);\n\n if (!parserInput.$char(')')) {\n parserInput.restore('Could not parse call arguments or missing \\')\\'');\n return;\n }\n\n parserInput.forget();\n\n return new(tree.Call)(name, args, index + currentIndex, fileInfo);\n },\n\n //\n // Parsing rules for functions with non-standard args, e.g.:\n //\n // boolean(not(2 > 1))\n //\n // This is a quick prototype, to be modified/improved when\n // more custom-parsed funcs come (e.g. `selector(...)`)\n //\n\n customFuncCall: function (name) {\n /* Ideally the table is to be moved out of here for faster perf.,\n but it's quite tricky since it relies on all these `parsers`\n and `expect` available only here */\n return {\n alpha: f(parsers.ieAlpha, true),\n boolean: f(condition),\n 'if': f(condition)\n }[name.toLowerCase()];\n\n function f(parse, stop) {\n return {\n parse, // parsing function\n stop // when true - stop after parse() and return its result,\n // otherwise continue for plain args\n };\n }\n\n function condition() {\n return [expect(parsers.condition, 'expected condition')];\n }\n },\n\n arguments: function (prevArgs) {\n let argsComma = prevArgs || [];\n const argsSemiColon = [];\n let isSemiColonSeparated;\n let value;\n\n parserInput.save();\n\n while (true) {\n if (prevArgs) {\n prevArgs = false;\n } else {\n value = parsers.detachedRuleset() || this.assignment() || parsers.expression();\n if (!value) {\n break;\n }\n\n if (value.value && value.value.length == 1) {\n value = value.value[0];\n }\n\n argsComma.push(value);\n }\n\n if (parserInput.$char(',')) {\n continue;\n }\n\n if (parserInput.$char(';') || isSemiColonSeparated) {\n isSemiColonSeparated = true;\n value = (argsComma.length < 1) ? argsComma[0]\n : new tree.Value(argsComma);\n argsSemiColon.push(value);\n argsComma = [];\n }\n }\n\n parserInput.forget();\n return isSemiColonSeparated ? argsSemiColon : argsComma;\n },\n literal: function () {\n return this.dimension() ||\n this.color() ||\n this.quoted() ||\n this.unicodeDescriptor();\n },\n\n // Assignments are argument entities for calls.\n // They are present in ie filter properties as shown below.\n //\n // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* )\n //\n\n assignment: function () {\n let key;\n let value;\n parserInput.save();\n key = parserInput.$re(/^\\w+(?=\\s?=)/i);\n if (!key) {\n parserInput.restore();\n return;\n }\n if (!parserInput.$char('=')) {\n parserInput.restore();\n return;\n }\n value = parsers.entity();\n if (value) {\n parserInput.forget();\n return new(tree.Assignment)(key, value);\n } else {\n parserInput.restore();\n }\n },\n\n //\n // Parse url() tokens\n //\n // We use a specific rule for urls, because they don't really behave like\n // standard function calls. The difference is that the argument doesn't have\n // to be enclosed within a string, so it can't be parsed as an Expression.\n //\n url: function () {\n let value;\n const index = parserInput.i;\n\n parserInput.autoCommentAbsorb = false;\n\n if (!parserInput.$str('url(')) {\n parserInput.autoCommentAbsorb = true;\n return;\n }\n\n value = this.quoted() || this.variable() || this.property() ||\n parserInput.$re(/^(?:(?:\\\\[()'\"])|[^()'\"])+/) || '';\n\n parserInput.autoCommentAbsorb = true;\n\n expectChar(')');\n\n return new(tree.URL)((value.value !== undefined ||\n value instanceof tree.Variable ||\n value instanceof tree.Property) ?\n value : new(tree.Anonymous)(value, index), index + currentIndex, fileInfo);\n },\n\n //\n // A Variable entity, such as `@fink`, in\n //\n // width: @fink + 2px\n //\n // We use a different parser for variable definitions,\n // see `parsers.variable`.\n //\n variable: function () {\n let ch;\n let name;\n const index = parserInput.i;\n\n parserInput.save();\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\\w-]+/))) {\n ch = parserInput.currentChar();\n if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\\s/)) {\n // this may be a VariableCall lookup\n const result = parsers.variableCall(name);\n if (result) {\n parserInput.forget();\n return result;\n }\n }\n parserInput.forget();\n return new(tree.Variable)(name, index + currentIndex, fileInfo);\n }\n parserInput.restore();\n },\n\n // A variable entity using the protective {} e.g. @{var}\n variableCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\\{([\\w-]+)\\}/))) {\n return new(tree.Variable)(`@${curly[1]}`, index + currentIndex, fileInfo);\n }\n },\n //\n // A Property accessor, such as `$color`, in\n //\n // background-color: $color\n //\n property: function () {\n let name;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (name = parserInput.$re(/^\\$[\\w-]+/))) {\n return new(tree.Property)(name, index + currentIndex, fileInfo);\n }\n },\n\n // A property entity useing the protective {} e.g. ${prop}\n propertyCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\\$\\{([\\w-]+)\\}/))) {\n return new(tree.Property)(`$${curly[1]}`, index + currentIndex, fileInfo);\n }\n },\n //\n // A Hexadecimal color\n //\n // #4F3C2F\n //\n // `rgb` and `hsl` colors are parsed through the `entities.call` parser.\n //\n color: function () {\n let rgb;\n parserInput.save();\n\n if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})([\\w.#[])?/))) {\n if (!rgb[2]) {\n parserInput.forget();\n return new(tree.Color)(rgb[1], undefined, rgb[0]);\n }\n }\n parserInput.restore();\n },\n\n colorKeyword: function () {\n parserInput.save();\n const autoCommentAbsorb = parserInput.autoCommentAbsorb;\n parserInput.autoCommentAbsorb = false;\n const k = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/);\n parserInput.autoCommentAbsorb = autoCommentAbsorb;\n if (!k) {\n parserInput.forget();\n return;\n }\n parserInput.restore();\n const color = tree.Color.fromKeyword(k);\n if (color) {\n parserInput.$str(k);\n return color;\n }\n },\n\n //\n // A Dimension, that is, a number and a unit\n //\n // 0.5em 95%\n //\n dimension: function () {\n if (parserInput.peekNotNumeric()) {\n return;\n }\n\n const value = parserInput.$re(/^([+-]?\\d*\\.?\\d+)(%|[a-z_]+)?/i);\n if (value) {\n return new(tree.Dimension)(value[1], value[2]);\n }\n },\n\n //\n // A unicode descriptor, as is used in unicode-range\n //\n // U+0?? or U+00A1-00A9\n //\n unicodeDescriptor: function () {\n let ud;\n\n ud = parserInput.$re(/^U\\+[0-9a-fA-F?]+(-[0-9a-fA-F?]+)?/);\n if (ud) {\n return new(tree.UnicodeDescriptor)(ud[0]);\n }\n },\n\n //\n // JavaScript code to be evaluated\n //\n // `window.location.href`\n //\n javascript: function () {\n let js;\n const index = parserInput.i;\n\n parserInput.save();\n\n const escape = parserInput.$char('~');\n const jsQuote = parserInput.$char('`');\n\n if (!jsQuote) {\n parserInput.restore();\n return;\n }\n\n js = parserInput.$re(/^[^`]*`/);\n if (js) {\n parserInput.forget();\n return new(tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index + currentIndex, fileInfo);\n }\n parserInput.restore('invalid javascript definition');\n }\n },\n\n //\n // The variable part of a variable definition. Used in the `rule` parser\n //\n // @fink:\n //\n variable: function () {\n let name;\n\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\\w-]+)\\s*:/))) { return name[1]; }\n },\n\n //\n // Call a variable value to retrieve a detached ruleset\n // or a value from a detached ruleset's rules.\n //\n // @fink();\n // @fink;\n // color: @fink[@color];\n //\n variableCall: function (parsedName) {\n let lookups;\n const i = parserInput.i;\n const inValue = !!parsedName;\n let name = parsedName;\n\n parserInput.save();\n\n if (name || (parserInput.currentChar() === '@'\n && (name = parserInput.$re(/^(@[\\w-]+)(\\(\\s*\\))?/)))) {\n\n lookups = this.mixin.ruleLookups();\n\n if (!lookups && ((inValue && parserInput.$str('()') !== '()') || (name[2] !== '()'))) {\n parserInput.restore('Missing \\'[...]\\' lookup in variable call');\n return;\n }\n\n if (!inValue) {\n name = name[1];\n }\n\n const call = new tree.VariableCall(name, i, fileInfo);\n if (!inValue && parsers.end()) {\n parserInput.forget();\n return call;\n }\n else {\n parserInput.forget();\n return new tree.NamespaceValue(call, lookups, i, fileInfo);\n }\n }\n\n parserInput.restore();\n },\n\n //\n // extend syntax - used to extend selectors\n //\n extend: function(isRule) {\n let elements;\n let e;\n const index = parserInput.i;\n let option;\n let extendList;\n let extend;\n\n if (!parserInput.$str(isRule ? '&:extend(' : ':extend(')) {\n return;\n }\n\n do {\n option = null;\n elements = null;\n while (!(option = parserInput.$re(/^(all)(?=\\s*(\\)|,))/))) {\n e = this.element();\n if (!e) {\n break;\n }\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n }\n\n option = option && option[1];\n if (!elements) {\n error('Missing target selector for :extend().');\n }\n extend = new(tree.Extend)(new(tree.Selector)(elements), option, index + currentIndex, fileInfo);\n if (extendList) {\n extendList.push(extend);\n } else {\n extendList = [ extend ];\n }\n } while (parserInput.$char(','));\n\n expect(/^\\)/);\n\n if (isRule) {\n expect(/^;/);\n }\n\n return extendList;\n },\n\n //\n // extendRule - used in a rule to extend all the parent selectors\n //\n extendRule: function() {\n return this.extend(true);\n },\n\n //\n // Mixins\n //\n mixin: {\n //\n // A Mixin call, with an optional argument list\n //\n // #mixins > .square(#fff);\n // #mixins.square(#fff);\n // .rounded(4px, black);\n // .button;\n //\n // We can lookup / return a value using the lookup syntax:\n //\n // color: #mixin.square(#fff)[@color];\n //\n // The `while` loop is there because mixins can be\n // namespaced, but we only support the child and descendant\n // selector for now.\n //\n call: function (inValue, getLookup) {\n const s = parserInput.currentChar();\n let important = false;\n let lookups;\n const index = parserInput.i;\n let elements;\n let args;\n let hasParens;\n\n if (s !== '.' && s !== '#') { return; }\n\n parserInput.save(); // stop us absorbing part of an invalid selector\n\n elements = this.elements();\n\n if (elements) {\n if (parserInput.$char('(')) {\n args = this.args(true).args;\n expectChar(')');\n hasParens = true;\n }\n\n if (getLookup !== false) {\n lookups = this.ruleLookups();\n }\n if (getLookup === true && !lookups) {\n parserInput.restore();\n return;\n }\n\n if (inValue && !lookups && !hasParens) {\n // This isn't a valid in-value mixin call\n parserInput.restore();\n return;\n }\n\n if (!inValue && parsers.important()) {\n important = true;\n }\n\n if (inValue || parsers.end()) {\n parserInput.forget();\n const mixin = new(tree.mixin.Call)(elements, args, index + currentIndex, fileInfo, !lookups && important);\n if (lookups) {\n return new tree.NamespaceValue(mixin, lookups);\n }\n else {\n return mixin;\n }\n }\n }\n\n parserInput.restore();\n },\n /**\n * Matching elements for mixins\n * (Start with . or # and can have > )\n */\n elements: function() {\n let elements;\n let e;\n let c;\n let elem;\n let elemIndex;\n const re = /^[#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/;\n while (true) {\n elemIndex = parserInput.i;\n e = parserInput.$re(re);\n\n if (!e) {\n break;\n }\n elem = new(tree.Element)(c, e, false, elemIndex + currentIndex, fileInfo);\n if (elements) {\n elements.push(elem);\n } else {\n elements = [ elem ];\n }\n c = parserInput.$char('>');\n }\n return elements;\n },\n args: function (isCall) {\n const entities = parsers.entities;\n const returner = { args:null, variadic: false };\n let expressions = [];\n const argsSemiColon = [];\n const argsComma = [];\n let isSemiColonSeparated;\n let expressionContainsNamed;\n let name;\n let nameLoop;\n let value;\n let arg;\n let expand;\n let hasSep = true;\n\n parserInput.save();\n\n while (true) {\n if (isCall) {\n arg = parsers.detachedRuleset() || parsers.expression();\n } else {\n parserInput.commentStore.length = 0;\n if (parserInput.$str('...')) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ variadic: true });\n break;\n }\n arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true);\n }\n\n if (!arg || !hasSep) {\n break;\n }\n\n nameLoop = null;\n if (arg.throwAwayComments) {\n arg.throwAwayComments();\n }\n value = arg;\n let val = null;\n\n if (isCall) {\n // Variable\n if (arg.value && arg.value.length == 1) {\n val = arg.value[0];\n }\n } else {\n val = arg;\n }\n\n if (val && (val instanceof tree.Variable || val instanceof tree.Property)) {\n if (parserInput.$char(':')) {\n if (expressions.length > 0) {\n if (isSemiColonSeparated) {\n error('Cannot mix ; and , as delimiter types');\n }\n expressionContainsNamed = true;\n }\n\n value = parsers.detachedRuleset() || parsers.expression();\n\n if (!value) {\n if (isCall) {\n error('could not understand value for named argument');\n } else {\n parserInput.restore();\n returner.args = [];\n return returner;\n }\n }\n nameLoop = (name = val.name);\n } else if (parserInput.$str('...')) {\n if (!isCall) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ name: arg.name, variadic: true });\n break;\n } else {\n expand = true;\n }\n } else if (!isCall) {\n name = nameLoop = val.name;\n value = null;\n }\n }\n\n if (value) {\n expressions.push(value);\n }\n\n argsComma.push({ name:nameLoop, value, expand });\n\n if (parserInput.$char(',')) {\n hasSep = true;\n continue;\n }\n hasSep = parserInput.$char(';') === ';';\n\n if (hasSep || isSemiColonSeparated) {\n\n if (expressionContainsNamed) {\n error('Cannot mix ; and , as delimiter types');\n }\n\n isSemiColonSeparated = true;\n\n if (expressions.length > 1) {\n value = new(tree.Value)(expressions);\n }\n argsSemiColon.push({ name, value, expand });\n\n name = null;\n expressions = [];\n expressionContainsNamed = false;\n }\n }\n\n parserInput.forget();\n returner.args = isSemiColonSeparated ? argsSemiColon : argsComma;\n return returner;\n },\n //\n // A Mixin definition, with a list of parameters\n //\n // .rounded (@radius: 2px, @color) {\n // ...\n // }\n //\n // Until we have a finer grained state-machine, we have to\n // do a look-ahead, to make sure we don't have a mixin call.\n // See the `rule` function for more information.\n //\n // We start by matching `.rounded (`, and then proceed on to\n // the argument list, which has optional default values.\n // We store the parameters in `params`, with a `value` key,\n // if there is a value, such as in the case of `@radius`.\n //\n // Once we've got our params list, and a closing `)`, we parse\n // the `{...}` block.\n //\n definition: function () {\n let name;\n let params = [];\n let match;\n let ruleset;\n let cond;\n let variadic = false;\n if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') ||\n parserInput.peek(/^[^{]*\\}/)) {\n return;\n }\n\n parserInput.save();\n\n match = parserInput.$re(/^([#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\\s*\\(/);\n if (match) {\n name = match[1];\n\n const argInfo = this.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n\n // .mixincall(\"@{a}\");\n // looks a bit like a mixin definition..\n // also\n // .mixincall(@a: {rule: set;});\n // so we have to be nice and restore\n if (!parserInput.$char(')')) {\n parserInput.restore('Missing closing \\')\\'');\n return;\n }\n\n parserInput.commentStore.length = 0;\n\n if (parserInput.$str('when')) { // Guard\n cond = expect(parsers.conditions, 'expected condition');\n }\n\n ruleset = parsers.block();\n\n if (ruleset) {\n parserInput.forget();\n return new(tree.mixin.Definition)(name, params, ruleset, cond, variadic);\n } else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n\n ruleLookups: function() {\n let rule;\n const lookups = [];\n\n if (parserInput.currentChar() !== '[') {\n return;\n }\n\n while (true) {\n parserInput.save();\n rule = this.lookupValue();\n if (!rule && rule !== '') {\n parserInput.restore();\n break;\n }\n lookups.push(rule);\n parserInput.forget();\n }\n if (lookups.length > 0) {\n return lookups;\n }\n },\n\n lookupValue: function() {\n parserInput.save();\n\n if (!parserInput.$char('[')) {\n parserInput.restore();\n return;\n }\n\n const name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);\n\n if (!parserInput.$char(']')) {\n parserInput.restore();\n return;\n }\n\n if (name || name === '') {\n parserInput.forget();\n return name;\n }\n\n parserInput.restore();\n }\n },\n //\n // Entities are the smallest recognized token,\n // and can be found inside a rule's value.\n //\n entity: function () {\n const entities = this.entities;\n\n return this.comment() || entities.literal() || entities.variable() || entities.url() ||\n entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) ||\n entities.javascript();\n },\n\n //\n // A Declaration terminator. Note that we use `peek()` to check for '}',\n // because the `block` rule will be expecting it, but we still need to make sure\n // it's there, if ';' was omitted.\n //\n end: function () {\n return parserInput.$char(';') || parserInput.peek('}');\n },\n\n //\n // IE's alpha function\n //\n // alpha(opacity=88)\n //\n ieAlpha: function () {\n let value;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (!parserInput.$re(/^opacity=/i)) { return; }\n value = parserInput.$re(/^\\d+/);\n if (!value) {\n value = expect(parsers.entities.variable, 'Could not parse alpha');\n value = `@{${value.name.slice(1)}}`;\n }\n expectChar(')');\n return new tree.Quoted('', `alpha(opacity=${value})`);\n },\n\n //\n // A Selector Element\n //\n // div\n // + h1\n // #socks\n // input[type=\"text\"]\n //\n // Elements are the building blocks for Selectors,\n // they are made out of a `Combinator` (see combinator rule),\n // and an element name, such as a tag a class, or `*`.\n //\n element: function () {\n let e;\n let c;\n let v;\n const index = parserInput.i;\n\n c = this.combinator();\n\n e = parserInput.$re(/^(?:\\d+\\.\\d+|\\d+)%/) ||\n // eslint-disable-next-line no-control-regex\n parserInput.$re(/^(?:[.#]?|:*)(?:[\\w-]|[^\\x00-\\x9f]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||\n parserInput.$char('*') || parserInput.$char('&') || this.attribute() ||\n parserInput.$re(/^\\([^&()@]+\\)/) || parserInput.$re(/^[.#:](?=@)/) ||\n this.entities.variableCurly();\n\n if (!e) {\n parserInput.save();\n if (parserInput.$char('(')) {\n if ((v = this.selector(false)) && parserInput.$char(')')) {\n e = new(tree.Paren)(v);\n parserInput.forget();\n } else {\n parserInput.restore('Missing closing \\')\\'');\n }\n } else {\n parserInput.forget();\n }\n }\n\n if (e) { return new(tree.Element)(c, e, e instanceof tree.Variable, index + currentIndex, fileInfo); }\n },\n\n //\n // Combinators combine elements together, in a Selector.\n //\n // Because our parser isn't white-space sensitive, special care\n // has to be taken, when parsing the descendant combinator, ` `,\n // as it's an empty space. We have to check the previous character\n // in the input, to see if it's a ` ` character. More info on how\n // we deal with this in *combinator.js*.\n //\n combinator: function () {\n let c = parserInput.currentChar();\n\n if (c === '/') {\n parserInput.save();\n const slashedCombinator = parserInput.$re(/^\\/[a-z]+\\//i);\n if (slashedCombinator) {\n parserInput.forget();\n return new(tree.Combinator)(slashedCombinator);\n }\n parserInput.restore();\n }\n\n if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') {\n parserInput.i++;\n if (c === '^' && parserInput.currentChar() === '^') {\n c = '^^';\n parserInput.i++;\n }\n while (parserInput.isWhitespace()) { parserInput.i++; }\n return new(tree.Combinator)(c);\n } else if (parserInput.isWhitespace(-1)) {\n return new(tree.Combinator)(' ');\n } else {\n return new(tree.Combinator)(null);\n }\n },\n //\n // A CSS Selector\n // with less extensions e.g. the ability to extend and guard\n //\n // .class > div + h1\n // li a:hover\n //\n // Selectors are made out of one or more Elements, see above.\n //\n selector: function (isLess) {\n const index = parserInput.i;\n let elements;\n let extendList;\n let c;\n let e;\n let allExtends;\n let when;\n let condition;\n isLess = isLess !== false;\n while ((isLess && (extendList = this.extend())) || (isLess && (when = parserInput.$str('when'))) || (e = this.element())) {\n if (when) {\n condition = expect(this.conditions, 'expected condition');\n } else if (condition) {\n error('CSS guard can only be used at the end of selector');\n } else if (extendList) {\n if (allExtends) {\n allExtends = allExtends.concat(extendList);\n } else {\n allExtends = extendList;\n }\n } else {\n if (allExtends) { error('Extend can only be used at the end of selector'); }\n c = parserInput.currentChar();\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n e = null;\n }\n if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') {\n break;\n }\n }\n\n if (elements) { return new(tree.Selector)(elements, allExtends, condition, index + currentIndex, fileInfo); }\n if (allExtends) { error('Extend must be used to extend a selector, it cannot be used on its own'); }\n },\n selectors: function () {\n let s;\n let selectors;\n while (true) {\n s = this.selector();\n if (!s) {\n break;\n }\n if (selectors) {\n selectors.push(s);\n } else {\n selectors = [ s ];\n }\n parserInput.commentStore.length = 0;\n if (s.condition && selectors.length > 1) {\n error('Guards are only currently allowed on a single selector.');\n }\n if (!parserInput.$char(',')) { break; }\n if (s.condition) {\n error('Guards are only currently allowed on a single selector.');\n }\n parserInput.commentStore.length = 0;\n }\n return selectors;\n },\n attribute: function () {\n if (!parserInput.$char('[')) { return; }\n\n const entities = this.entities;\n let key;\n let val;\n let op;\n //\n // case-insensitive flag\n // e.g. [attr operator value i]\n //\n let cif;\n\n if (!(key = entities.variableCurly())) {\n key = expect(/^(?:[_A-Za-z0-9-*]*\\|)?(?:[_A-Za-z0-9-]|\\\\.)+/);\n }\n\n op = parserInput.$re(/^[|~*$^]?=/);\n if (op) {\n val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\\w-]+/) || entities.variableCurly();\n if (val) {\n cif = parserInput.$re(/^[iIsS]/);\n }\n }\n\n expectChar(']');\n\n return new(tree.Attribute)(key, op, val, cif);\n },\n\n //\n // The `block` rule is used by `ruleset` and `mixin.definition`.\n // It's a wrapper around the `primary` rule, with added `{}`.\n //\n block: function () {\n let content;\n if (parserInput.$char('{') && (content = this.primary()) && parserInput.$char('}')) {\n return content;\n }\n },\n\n blockRuleset: function() {\n let block = this.block();\n\n if (block) {\n block = new tree.Ruleset(null, block);\n }\n return block;\n },\n\n detachedRuleset: function() {\n let argInfo;\n let params;\n let variadic;\n\n parserInput.save();\n if (parserInput.$re(/^[.#]\\(/)) {\n /**\n * DR args currently only implemented for each() function, and not\n * yet settable as `@dr: #(@arg) {}`\n * This should be done when DRs are merged with mixins.\n * See: https://github.com/less/less-meta/issues/16\n */\n argInfo = this.mixin.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return;\n }\n }\n const blockRuleset = this.blockRuleset();\n if (blockRuleset) {\n parserInput.forget();\n if (params) {\n return new tree.mixin.Definition(null, params, blockRuleset, null, variadic);\n }\n return new tree.DetachedRuleset(blockRuleset);\n }\n parserInput.restore();\n },\n\n //\n // div, .class, body > p {...}\n //\n ruleset: function () {\n let selectors;\n let rules;\n let debugInfo;\n\n parserInput.save();\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(parserInput.i);\n }\n\n selectors = this.selectors();\n\n if (selectors && (rules = this.block())) {\n parserInput.forget();\n const ruleset = new(tree.Ruleset)(selectors, rules, context.strictImports);\n if (context.dumpLineNumbers) {\n ruleset.debugInfo = debugInfo;\n }\n return ruleset;\n } else {\n parserInput.restore();\n }\n },\n declaration: function () {\n let name;\n let value;\n const index = parserInput.i;\n let hasDR;\n const c = parserInput.currentChar();\n let important;\n let merge;\n let isVariable;\n\n if (c === '.' || c === '#' || c === '&' || c === ':') { return; }\n\n parserInput.save();\n\n name = this.variable() || this.ruleProperty();\n if (name) {\n isVariable = typeof name === 'string';\n\n if (isVariable) {\n value = this.detachedRuleset();\n if (value) {\n hasDR = true;\n }\n }\n\n parserInput.commentStore.length = 0;\n if (!value) {\n // a name returned by this.ruleProperty() is always an array of the form:\n // [string-1, ..., string-n, \"\"] or [string-1, ..., string-n, \"+\"]\n // where each item is a tree.Keyword or tree.Variable\n merge = !isVariable && name.length > 1 && name.pop().value;\n\n // Custom property values get permissive parsing\n if (name[0].value && name[0].value.slice(0, 2) === '--') {\n value = this.permissiveValue(/[;}]/);\n }\n // Try to store values as anonymous\n // If we need the value later we'll re-parse it in ruleset.parseValue\n else {\n value = this.anonymousValue();\n }\n if (value) {\n parserInput.forget();\n // anonymous values absorb the end ';' which is required for them to work\n return new(tree.Declaration)(name, value, false, merge, index + currentIndex, fileInfo);\n }\n\n if (!value) {\n value = this.value();\n }\n\n if (value) {\n important = this.important();\n } else if (isVariable) {\n // As a last resort, try permissiveValue\n value = this.permissiveValue();\n }\n }\n\n if (value && (this.end() || hasDR)) {\n parserInput.forget();\n return new(tree.Declaration)(name, value, important, merge, index + currentIndex, fileInfo);\n }\n else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n anonymousValue: function () {\n const index = parserInput.i;\n const match = parserInput.$re(/^([^.#@$+/'\"*`(;{}-]*);/);\n if (match) {\n return new(tree.Anonymous)(match[1], index + currentIndex);\n }\n },\n /**\n * Used for custom properties, at-rules, and variables (as fallback)\n * Parses almost anything inside of {} [] () \"\" blocks\n * until it reaches outer-most tokens.\n *\n * First, it will try to parse comments and entities to reach\n * the end. This is mostly like the Expression parser except no\n * math is allowed.\n */\n permissiveValue: function (untilTokens) {\n let i;\n let e;\n let done;\n let value;\n const tok = untilTokens || ';';\n const index = parserInput.i;\n const result = [];\n\n function testCurrentChar() {\n const char = parserInput.currentChar();\n if (typeof tok === 'string') {\n return char === tok;\n } else {\n return tok.test(char);\n }\n }\n if (testCurrentChar()) {\n return;\n }\n value = [];\n do {\n e = this.comment();\n if (e) {\n value.push(e);\n continue;\n }\n e = this.entity();\n if (e) {\n value.push(e);\n }\n } while (e);\n\n done = testCurrentChar();\n\n if (value.length > 0) {\n value = new(tree.Expression)(value);\n if (done) {\n return value;\n }\n else {\n result.push(value);\n }\n // Preserve space before $parseUntil as it will not\n if (parserInput.prevChar() === ' ') {\n result.push(new tree.Anonymous(' ', index));\n }\n }\n parserInput.save();\n\n value = parserInput.$parseUntil(tok);\n\n if (value) {\n if (typeof value === 'string') {\n error(`Expected '${value}'`, 'Parse');\n }\n if (value.length === 1 && value[0] === ' ') {\n parserInput.forget();\n return new tree.Anonymous('', index);\n }\n let item;\n for (i = 0; i < value.length; i++) {\n item = value[i];\n if (Array.isArray(item)) {\n // Treat actual quotes as normal quoted values\n result.push(new tree.Quoted(item[0], item[1], true, index, fileInfo));\n }\n else {\n if (i === value.length - 1) {\n item = item.trim();\n }\n // Treat like quoted values, but replace vars like unquoted expressions\n const quote = new tree.Quoted('\\'', item, true, index, fileInfo);\n quote.variableRegex = /@([\\w-]+)/g;\n quote.propRegex = /\\$([\\w-]+)/g;\n result.push(quote);\n }\n }\n parserInput.forget();\n return new tree.Expression(result, true);\n }\n parserInput.restore();\n },\n\n //\n // An @import atrule\n //\n // @import \"lib\";\n //\n // Depending on our environment, importing is done differently:\n // In the browser, it's an XHR request, in Node, it would be a\n // file-system operation. The function used for importing is\n // stored in `import`, which we pass to the Import constructor.\n //\n 'import': function () {\n let path;\n let features;\n const index = parserInput.i;\n\n const dir = parserInput.$re(/^@import\\s+/);\n\n if (dir) {\n const options = (dir ? this.importOptions() : null) || {};\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n features = this.mediaFeatures({});\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon or unrecognised media features on import');\n }\n features = features && new(tree.Value)(features);\n return new(tree.Import)(path, features, options, index + currentIndex, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed import statement');\n }\n }\n },\n\n importOptions: function() {\n let o;\n const options = {};\n let optionName;\n let value;\n\n // list of options, surrounded by parens\n if (!parserInput.$char('(')) { return null; }\n do {\n o = this.importOption();\n if (o) {\n optionName = o;\n value = true;\n switch (optionName) {\n case 'css':\n optionName = 'less';\n value = false;\n break;\n case 'once':\n optionName = 'multiple';\n value = false;\n break;\n }\n options[optionName] = value;\n if (!parserInput.$char(',')) { break; }\n }\n } while (o);\n expectChar(')');\n return options;\n },\n\n importOption: function() {\n const opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/);\n if (opt) {\n return opt[1];\n }\n },\n\n mediaFeature: function (syntaxOptions) {\n const entities = this.entities;\n const nodes = [];\n let e;\n let p;\n let rangeP;\n parserInput.save();\n do {\n e = entities.keyword() || entities.variable() || entities.mixinLookup();\n if (e) {\n nodes.push(e);\n } else if (parserInput.$char('(')) {\n p = this.property();\n parserInput.save();\n if (!p && syntaxOptions.queryInParens && parserInput.$re(/^[0-9a-z-]*\\s*([<>]=|<=|>=|[<>]|=)/)) {\n parserInput.restore();\n p = this.condition();\n\n parserInput.save();\n rangeP = this.atomicCondition(null, p.rvalue);\n if (!rangeP) {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n e = this.value();\n }\n if (parserInput.$char(')')) {\n if (p && !e) {\n nodes.push(new (tree.Paren)(new (tree.QueryInParens)(p.op, p.lvalue, p.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p._index)));\t\t\t\t \n e = p;\n } else if (p && e) {\n nodes.push(new (tree.Paren)(new (tree.Declaration)(p, e, null, null, parserInput.i + currentIndex, fileInfo, true)));\n } else if (e) {\n nodes.push(new(tree.Paren)(e));\n } else {\n error('badly formed media feature definition');\n }\n } else {\n error('Missing closing \\')\\'', 'Parse');\n }\n }\n } while (e);\n\n parserInput.forget();\n if (nodes.length > 0) {\n return new(tree.Expression)(nodes);\n }\n },\n\n mediaFeatures: function (syntaxOptions) {\n const entities = this.entities;\n const features = [];\n let e;\n do {\n e = this.mediaFeature(syntaxOptions);\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n } else {\n e = entities.variable() || entities.mixinLookup();\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n }\n } while (e);\n\n return features.length > 0 ? features : null;\n },\n\n prepareAndGetNestableAtRule: function (treeType, index, debugInfo, syntaxOptions) {\n const features = this.mediaFeatures(syntaxOptions);\n\n const rules = this.block();\n\n if (!rules) {\n error('media definitions require block statements after any features');\n }\n\n parserInput.forget();\n\n const atRule = new (treeType)(rules, features, index + currentIndex, fileInfo);\n if (context.dumpLineNumbers) {\n atRule.debugInfo = debugInfo;\n }\n\n return atRule;\n },\n\n nestableAtRule: function () {\n let debugInfo;\n const index = parserInput.i;\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(index);\n }\n parserInput.save();\n\n if (parserInput.$peekChar('@')) {\n if (parserInput.$str('@media')) {\n return this.prepareAndGetNestableAtRule(tree.Media, index, debugInfo, MediaSyntaxOptions);\n }\n \n if (parserInput.$str('@container')) {\n return this.prepareAndGetNestableAtRule(tree.Container, index, debugInfo, ContainerSyntaxOptions);\n }\n }\n \n parserInput.restore();\n },\n\n //\n\n // A @plugin directive, used to import plugins dynamically.\n //\n // @plugin (args) \"lib\";\n //\n plugin: function () {\n let path;\n let args;\n let options;\n const index = parserInput.i;\n const dir = parserInput.$re(/^@plugin\\s+/);\n\n if (dir) {\n args = this.pluginArgs();\n\n if (args) {\n options = {\n pluginArgs: args,\n isPlugin: true\n };\n }\n else {\n options = { isPlugin: true };\n }\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon on @plugin');\n }\n return new(tree.Import)(path, null, options, index + currentIndex, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed @plugin statement');\n }\n }\n },\n\n pluginArgs: function() {\n // list of options, surrounded by parens\n parserInput.save();\n if (!parserInput.$char('(')) {\n parserInput.restore();\n return null;\n }\n const args = parserInput.$re(/^\\s*([^);]+)\\)\\s*/);\n if (args[1]) {\n parserInput.forget();\n return args[1].trim();\n }\n else {\n parserInput.restore();\n return null;\n }\n },\n\n //\n // A CSS AtRule\n //\n // @charset \"utf-8\";\n //\n atrule: function () {\n const index = parserInput.i;\n let name;\n let value;\n let rules;\n let nonVendorSpecificName;\n let hasIdentifier;\n let hasExpression;\n let hasUnknown;\n let hasBlock = true;\n let isRooted = true;\n\n if (parserInput.currentChar() !== '@') { return; }\n\n value = this['import']() || this.plugin() || this.nestableAtRule();\n if (value) {\n return value;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^@[a-z-]+/);\n\n if (!name) { return; }\n\n nonVendorSpecificName = name;\n if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {\n nonVendorSpecificName = `@${name.slice(name.indexOf('-', 2) + 1)}`;\n }\n\n switch (nonVendorSpecificName) {\n case '@charset':\n hasIdentifier = true;\n hasBlock = false;\n break;\n case '@namespace':\n hasExpression = true;\n hasBlock = false;\n break;\n case '@keyframes':\n case '@counter-style':\n hasIdentifier = true;\n break;\n case '@document':\n case '@supports':\n hasUnknown = true;\n isRooted = false;\n break;\n default:\n hasUnknown = true;\n break;\n }\n\n parserInput.commentStore.length = 0;\n\n if (hasIdentifier) {\n value = this.entity();\n if (!value) {\n error(`expected ${name} identifier`);\n }\n } else if (hasExpression) {\n value = this.expression();\n if (!value) {\n error(`expected ${name} expression`);\n }\n } else if (hasUnknown) {\n value = this.permissiveValue(/^[{;]/);\n hasBlock = (parserInput.currentChar() === '{');\n if (!value) {\n if (!hasBlock && parserInput.currentChar() !== ';') {\n error(`${name} rule is missing block or ending semi-colon`);\n }\n }\n else if (!value.value) {\n value = null;\n }\n }\n\n if (hasBlock) {\n rules = this.blockRuleset();\n }\n\n if (rules || (!hasBlock && value && parserInput.$char(';'))) {\n parserInput.forget();\n return new(tree.AtRule)(name, value, rules, index + currentIndex, fileInfo,\n context.dumpLineNumbers ? getDebugInfo(index) : null,\n isRooted\n );\n }\n\n parserInput.restore('at-rule options not recognised');\n },\n\n //\n // A Value is a comma-delimited list of Expressions\n //\n // font-family: Baskerville, Georgia, serif;\n //\n // In a Rule, a Value represents everything after the `:`,\n // and before the `;`.\n //\n value: function () {\n let e;\n const expressions = [];\n const index = parserInput.i;\n\n do {\n e = this.expression();\n if (e) {\n expressions.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n } while (e);\n\n if (expressions.length > 0) {\n return new(tree.Value)(expressions, index + currentIndex);\n }\n },\n important: function () {\n if (parserInput.currentChar() === '!') {\n return parserInput.$re(/^! *important/);\n }\n },\n sub: function () {\n let a;\n let e;\n\n parserInput.save();\n if (parserInput.$char('(')) {\n a = this.addition();\n if (a && parserInput.$char(')')) {\n parserInput.forget();\n e = new(tree.Expression)([a]);\n e.parens = true;\n return e;\n }\n parserInput.restore('Expected \\')\\'');\n return;\n }\n parserInput.restore();\n },\n multiplication: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.operand();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n if (parserInput.peek(/^\\/[*/]/)) {\n break;\n }\n\n parserInput.save();\n\n op = parserInput.$char('/') || parserInput.$char('*') || parserInput.$str('./');\n\n if (!op) { parserInput.forget(); break; }\n\n a = this.operand();\n\n if (!a) { parserInput.restore(); break; }\n parserInput.forget();\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n addition: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.multiplication();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n op = parserInput.$re(/^[-+]\\s+/) || (!isSpaced && (parserInput.$char('+') || parserInput.$char('-')));\n if (!op) {\n break;\n }\n a = this.multiplication();\n if (!a) {\n break;\n }\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n conditions: function () {\n let a;\n let b;\n const index = parserInput.i;\n let condition;\n\n a = this.condition(true);\n if (a) {\n while (true) {\n if (!parserInput.peek(/^,\\s*(not\\s*)?\\(/) || !parserInput.$char(',')) {\n break;\n }\n b = this.condition(true);\n if (!b) {\n break;\n }\n condition = new(tree.Condition)('or', condition || a, b, index + currentIndex);\n }\n return condition || a;\n }\n },\n condition: function (needsParens) {\n let result;\n let logical;\n let next;\n function or() {\n return parserInput.$str('or');\n }\n\n result = this.conditionAnd(needsParens);\n if (!result) {\n return ;\n }\n logical = or();\n if (logical) {\n next = this.condition(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n conditionAnd: function (needsParens) {\n let result;\n let logical;\n let next;\n const self = this;\n function insideCondition() {\n const cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens);\n if (!cond && !needsParens) {\n return self.atomicCondition(needsParens);\n }\n return cond;\n }\n function and() {\n return parserInput.$str('and');\n }\n\n result = insideCondition();\n if (!result) {\n return ;\n }\n logical = and();\n if (logical) {\n next = this.conditionAnd(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n negatedCondition: function (needsParens) {\n if (parserInput.$str('not')) {\n const result = this.parenthesisCondition(needsParens);\n if (result) {\n result.negate = !result.negate;\n }\n return result;\n }\n },\n parenthesisCondition: function (needsParens) {\n function tryConditionFollowedByParenthesis(me) {\n let body;\n parserInput.save();\n body = me.condition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return ;\n }\n parserInput.forget();\n return body;\n }\n\n let body;\n parserInput.save();\n if (!parserInput.$str('(')) {\n parserInput.restore();\n return ;\n }\n body = tryConditionFollowedByParenthesis(this);\n if (body) {\n parserInput.forget();\n return body;\n }\n\n body = this.atomicCondition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore(`expected ')' got '${parserInput.currentChar()}'`);\n return ;\n }\n parserInput.forget();\n return body;\n },\n atomicCondition: function (needsParens, preparsedCond) {\n const entities = this.entities;\n const index = parserInput.i;\n let a;\n let b;\n let c;\n let op;\n\n const cond = (function() {\n return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup();\n }).bind(this)\n\n if (preparsedCond) {\n a = preparsedCond;\n } else {\n a = cond();\n }\n\n if (a) {\n if (parserInput.$char('>')) {\n if (parserInput.$char('=')) {\n op = '>=';\n } else {\n op = '>';\n }\n } else\n if (parserInput.$char('<')) {\n if (parserInput.$char('=')) {\n op = '<=';\n } else {\n op = '<';\n }\n } else\n if (parserInput.$char('=')) {\n if (parserInput.$char('>')) {\n op = '=>';\n } else if (parserInput.$char('<')) {\n op = '=<';\n } else {\n op = '=';\n }\n }\n if (op) {\n b = cond();\n if (b) {\n c = new(tree.Condition)(op, a, b, index + currentIndex, false);\n } else {\n error('expected expression');\n }\n } else if (!preparsedCond) {\n c = new(tree.Condition)('=', a, new(tree.Keyword)('true'), index + currentIndex, false);\n }\n return c;\n }\n },\n\n //\n // An operand is anything that can be part of an operation,\n // such as a Color, or a Variable\n //\n operand: function () {\n const entities = this.entities;\n let negate;\n\n if (parserInput.peek(/^-[@$(]/)) {\n negate = parserInput.$char('-');\n }\n\n let o = this.sub() || entities.dimension() ||\n entities.color() || entities.variable() ||\n entities.property() || entities.call() ||\n entities.quoted(true) || entities.colorKeyword() ||\n entities.mixinLookup();\n\n if (negate) {\n o.parensInOp = true;\n o = new(tree.Negative)(o);\n }\n\n return o;\n },\n\n //\n // Expressions either represent mathematical operations,\n // or white-space delimited Entities.\n //\n // 1px solid black\n // @var * 2\n //\n expression: function () {\n const entities = [];\n let e;\n let delim;\n const index = parserInput.i;\n\n do {\n e = this.comment();\n if (e) {\n entities.push(e);\n continue;\n }\n e = this.addition() || this.entity();\n\n if (e instanceof tree.Comment) {\n e = null;\n }\n\n if (e) {\n entities.push(e);\n // operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n if (!parserInput.peek(/^\\/[/*]/)) {\n delim = parserInput.$char('/');\n if (delim) {\n entities.push(new(tree.Anonymous)(delim, index + currentIndex));\n }\n }\n }\n } while (e);\n if (entities.length > 0) {\n return new(tree.Expression)(entities);\n }\n },\n property: function () {\n const name = parserInput.$re(/^(\\*?-?[_a-zA-Z0-9-]+)\\s*:/);\n if (name) {\n return name[1];\n }\n },\n ruleProperty: function () {\n let name = [];\n const index = [];\n let s;\n let k;\n\n parserInput.save();\n\n const simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\\s*:/);\n if (simpleProperty) {\n name = [new(tree.Keyword)(simpleProperty[1])];\n parserInput.forget();\n return name;\n }\n\n function match(re) {\n const i = parserInput.i;\n const chunk = parserInput.$re(re);\n if (chunk) {\n index.push(i);\n return name.push(chunk[1]);\n }\n }\n\n match(/^(\\*?)/);\n while (true) {\n if (!match(/^((?:[\\w-]+)|(?:[@$]\\{[\\w-]+\\}))/)) {\n break;\n }\n }\n\n if ((name.length > 1) && match(/^((?:\\+_|\\+)?)\\s*:/)) {\n parserInput.forget();\n\n // at last, we have the complete match now. move forward,\n // convert name particles to tree objects and return:\n if (name[0] === '') {\n name.shift();\n index.shift();\n }\n for (k = 0; k < name.length; k++) {\n s = name[k];\n name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ?\n new(tree.Keyword)(s) :\n (s.charAt(0) === '@' ?\n new(tree.Variable)(`@${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo) :\n new(tree.Property)(`$${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo));\n }\n return name;\n }\n parserInput.restore();\n }\n }\n };\n};\nParser.serializeVars = vars => {\n let s = '';\n\n for (const name in vars) {\n if (Object.hasOwnProperty.call(vars, name)) {\n const value = vars[name];\n s += `${((name[0] === '@') ? '' : '@') + name}: ${value}${(String(value).slice(-1) === ';') ? '' : ';'}`;\n }\n }\n\n return s;\n};\n\nexport default Parser;","import Node from './node';\nimport Element from './element';\nimport LessError from '../less-error';\nimport * as utils from '../utils';\nimport Parser from '../parser/parser';\n\nconst Selector = function(elements, extendList, condition, index, currentFileInfo, visibilityInfo) {\n this.extendList = extendList;\n this.condition = condition;\n this.evaldCondition = !condition;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.elements = this.getElements(elements);\n this.mixinElements_ = undefined;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.elements, this);\n};\n\nSelector.prototype = Object.assign(new Node(), {\n type: 'Selector',\n\n accept(visitor) {\n if (this.elements) {\n this.elements = visitor.visitArray(this.elements);\n }\n if (this.extendList) {\n this.extendList = visitor.visitArray(this.extendList);\n }\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n },\n\n createDerived(elements, extendList, evaldCondition) {\n elements = this.getElements(elements);\n const newSelector = new Selector(elements, extendList || this.extendList,\n null, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n newSelector.evaldCondition = (!utils.isNullOrUndefined(evaldCondition)) ? evaldCondition : this.evaldCondition;\n newSelector.mediaEmpty = this.mediaEmpty;\n return newSelector;\n },\n\n getElements(els) {\n if (!els) {\n return [new Element('', '&', false, this._index, this._fileInfo)];\n }\n if (typeof els === 'string') {\n new Parser(this.parse.context, this.parse.importManager, this._fileInfo, this._index).parseNode(\n els,\n ['selector'],\n function(err, result) {\n if (err) {\n throw new LessError({\n index: err.index,\n message: err.message\n }, this.parse.imports, this._fileInfo.filename);\n }\n els = result[0].elements;\n });\n }\n return els;\n },\n\n createEmptySelectors() {\n const el = new Element('', '&', false, this._index, this._fileInfo), sels = [new Selector([el], null, null, this._index, this._fileInfo)];\n sels[0].mediaEmpty = true;\n return sels;\n },\n\n match(other) {\n const elements = this.elements;\n const len = elements.length;\n let olen;\n let i;\n\n other = other.mixinElements();\n olen = other.length;\n if (olen === 0 || len < olen) {\n return 0;\n } else {\n for (i = 0; i < olen; i++) {\n if (elements[i].value !== other[i]) {\n return 0;\n }\n }\n }\n\n return olen; // return number of matched elements\n },\n\n mixinElements() {\n if (this.mixinElements_) {\n return this.mixinElements_;\n }\n\n let elements = this.elements.map( function(v) {\n return v.combinator.value + (v.value.value || v.value);\n }).join('').match(/[,*.\\w-]([\\w-]|(\\\\.))*/g);\n\n if (elements) {\n if (elements[0] === '&') {\n elements.shift();\n }\n } else {\n elements = [];\n }\n\n return (this.mixinElements_ = elements);\n },\n\n isJustParentSelector() {\n return !this.mediaEmpty &&\n this.elements.length === 1 &&\n this.elements[0].value === '&' &&\n (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === '');\n },\n\n eval(context) {\n const evaldCondition = this.condition && this.condition.eval(context);\n let elements = this.elements;\n let extendList = this.extendList;\n\n elements = elements && elements.map(function (e) { return e.eval(context); });\n extendList = extendList && extendList.map(function(extend) { return extend.eval(context); });\n\n return this.createDerived(elements, extendList, evaldCondition);\n },\n\n genCSS(context, output) {\n let i, element;\n if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') {\n output.add(' ', this.fileInfo(), this.getIndex());\n }\n for (i = 0; i < this.elements.length; i++) {\n element = this.elements[i];\n element.genCSS(context, output);\n }\n },\n\n getIsOutput() {\n return this.evaldCondition;\n }\n});\n\nexport default Selector;\n","import Node from './node';\n\nconst Value = function(value) {\n if (!value) {\n throw new Error('Value requires an array argument');\n }\n if (!Array.isArray(value)) {\n this.value = [ value ];\n }\n else {\n this.value = value;\n }\n};\n\nValue.prototype = Object.assign(new Node(), {\n type: 'Value',\n\n accept(visitor) {\n if (this.value) {\n this.value = visitor.visitArray(this.value);\n }\n },\n\n eval(context) {\n if (this.value.length === 1) {\n return this.value[0].eval(context);\n } else {\n return new Value(this.value.map(function (v) {\n return v.eval(context);\n }));\n }\n },\n\n genCSS(context, output) {\n let i;\n for (i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (i + 1 < this.value.length) {\n output.add((context && context.compress) ? ',' : ', ');\n }\n }\n }\n});\n\nexport default Value;\n","import Node from './node';\n\nconst Keyword = function(value) {\n this.value = value;\n};\n\nKeyword.prototype = Object.assign(new Node(), {\n type: 'Keyword',\n\n genCSS(context, output) {\n if (this.value === '%') { throw { type: 'Syntax', message: 'Invalid % without number' }; }\n output.add(this.value);\n }\n});\n\nKeyword.True = new Keyword('true');\nKeyword.False = new Keyword('false');\n\nexport default Keyword;\n","import Node from './node';\n\nconst Anonymous = function(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {\n this.value = value;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.mapLines = mapLines;\n this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;\n this.allowRoot = true;\n this.copyVisibilityInfo(visibilityInfo);\n}\n\nAnonymous.prototype = Object.assign(new Node(), {\n type: 'Anonymous',\n eval() {\n return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());\n },\n compare(other) {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n },\n isRulesetLike() {\n return this.rulesetLike;\n },\n genCSS(context, output) {\n this.nodeVisible = Boolean(this.value);\n if (this.nodeVisible) {\n output.add(this.value, this._fileInfo, this._index, this.mapLines);\n }\n }\n})\n\nexport default Anonymous;\n","import Node from './node';\nimport Value from './value';\nimport Keyword from './keyword';\nimport Anonymous from './anonymous';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\nfunction evalName(context, name) {\n let value = '';\n let i;\n const n = name.length;\n const output = {add: function (s) {value += s;}};\n for (i = 0; i < n; i++) {\n name[i].eval(context).genCSS(context, output);\n }\n return value;\n}\n\nconst Declaration = function(name, value, important, merge, index, currentFileInfo, inline, variable) {\n this.name = name;\n this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]);\n this.important = important ? ` ${important.trim()}` : '';\n this.merge = merge;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.inline = inline || false;\n this.variable = (variable !== undefined) ? variable\n : (name.charAt && (name.charAt(0) === '@'));\n this.allowRoot = true;\n this.setParent(this.value, this);\n};\n\nDeclaration.prototype = Object.assign(new Node(), {\n type: 'Declaration',\n\n genCSS(context, output) {\n output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex());\n try {\n this.value.genCSS(context, output);\n }\n catch (e) {\n e.index = this._index;\n e.filename = this._fileInfo.filename;\n throw e;\n }\n output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index);\n },\n\n eval(context) {\n let mathBypass = false, prevMath, name = this.name, evaldValue, variable = this.variable;\n if (typeof name !== 'string') {\n // expand 'primitive' name directly to get\n // things faster (~10% for benchmark.less):\n name = (name.length === 1) && (name[0] instanceof Keyword) ?\n name[0].value : evalName(context, name);\n variable = false; // never treat expanded interpolation as new variable name\n }\n\n // @todo remove when parens-division is default\n if (name === 'font' && context.math === MATH.ALWAYS) {\n mathBypass = true;\n prevMath = context.math;\n context.math = MATH.PARENS_DIVISION;\n }\n try {\n context.importantScope.push({});\n evaldValue = this.value.eval(context);\n\n if (!this.variable && evaldValue.type === 'DetachedRuleset') {\n throw { message: 'Rulesets cannot be evaluated on a property.',\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n let important = this.important;\n const importantResult = context.importantScope.pop();\n if (!important && importantResult.important) {\n important = importantResult.important;\n }\n\n return new Declaration(name,\n evaldValue,\n important,\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline,\n variable);\n }\n catch (e) {\n if (typeof e.index !== 'number') {\n e.index = this.getIndex();\n e.filename = this.fileInfo().filename;\n }\n throw e;\n }\n finally {\n if (mathBypass) {\n context.math = prevMath;\n }\n }\n },\n\n makeImportant() {\n return new Declaration(this.name,\n this.value,\n '!important',\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline);\n }\n});\n\nexport default Declaration;","function asComment(ctx) {\n return `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\\n`;\n}\n\nfunction asMediaQuery(ctx) {\n let filenameWithProtocol = ctx.debugInfo.fileName;\n if (!/^[a-z]+:\\/\\//i.test(filenameWithProtocol)) {\n filenameWithProtocol = `file://${filenameWithProtocol}`;\n }\n return `@media -sass-debug-info{filename{font-family:${filenameWithProtocol.replace(/([.:/\\\\])/g, function (a) {\n if (a == '\\\\') {\n a = '/';\n }\n return `\\\\${a}`;\n })}}line{font-family:\\\\00003${ctx.debugInfo.lineNumber}}}\\n`;\n}\n\nfunction debugInfo(context, ctx, lineSeparator) {\n let result = '';\n if (context.dumpLineNumbers && !context.compress) {\n switch (context.dumpLineNumbers) {\n case 'comments':\n result = asComment(ctx);\n break;\n case 'mediaquery':\n result = asMediaQuery(ctx);\n break;\n case 'all':\n result = asComment(ctx) + (lineSeparator || '') + asMediaQuery(ctx);\n break;\n }\n }\n return result;\n}\n\nexport default debugInfo;\n\n","import Node from './node';\nimport getDebugInfo from './debug-info';\n\nconst Comment = function(value, isLineComment, index, currentFileInfo) {\n this.value = value;\n this.isLineComment = isLineComment;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n}\n\nComment.prototype = Object.assign(new Node(), {\n type: 'Comment',\n\n genCSS(context, output) {\n if (this.debugInfo) {\n output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n },\n\n isSilent(context) {\n const isCompressed = context.compress && this.value[2] !== '!';\n return this.isLineComment || isCompressed;\n }\n});\n\nexport default Comment;\n","import Keyword from '../tree/keyword';\nimport * as utils from '../utils';\n\nconst defaultFunc = {\n eval: function () {\n const v = this.value_;\n const e = this.error_;\n if (e) {\n throw e;\n }\n if (!utils.isNullOrUndefined(v)) {\n return v ? Keyword.True : Keyword.False;\n }\n },\n value: function (v) {\n this.value_ = v;\n },\n error: function (e) {\n this.error_ = e;\n },\n reset: function () {\n this.value_ = this.error_ = null;\n }\n};\n\nexport default defaultFunc;\n","import Node from './node';\nimport Declaration from './declaration';\nimport Keyword from './keyword';\nimport Comment from './comment';\nimport Paren from './paren';\nimport Selector from './selector';\nimport Element from './element';\nimport Anonymous from './anonymous';\nimport contexts from '../contexts';\nimport globalFunctionRegistry from '../functions/function-registry';\nimport defaultFunc from '../functions/default';\nimport getDebugInfo from './debug-info';\nimport * as utils from '../utils';\nimport Parser from '../parser/parser';\n\nconst Ruleset = function(selectors, rules, strictImports, visibilityInfo) {\n this.selectors = selectors;\n this.rules = rules;\n this._lookups = {};\n this._variables = null;\n this._properties = null;\n this.strictImports = strictImports;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n this.setParent(this.selectors, this);\n this.setParent(this.rules, this);\n}\n\nRuleset.prototype = Object.assign(new Node(), {\n type: 'Ruleset',\n isRuleset: true,\n\n isRulesetLike() { return true; },\n\n accept(visitor) {\n if (this.paths) {\n this.paths = visitor.visitArray(this.paths, true);\n } else if (this.selectors) {\n this.selectors = visitor.visitArray(this.selectors);\n }\n if (this.rules && this.rules.length) {\n this.rules = visitor.visitArray(this.rules);\n }\n },\n\n eval(context) {\n let selectors;\n let selCnt;\n let selector;\n let i;\n let hasVariable;\n let hasOnePassingSelector = false;\n\n if (this.selectors && (selCnt = this.selectors.length)) {\n selectors = new Array(selCnt);\n defaultFunc.error({\n type: 'Syntax',\n message: 'it is currently only allowed in parametric mixin guards,'\n });\n\n for (i = 0; i < selCnt; i++) {\n selector = this.selectors[i].eval(context);\n for (let j = 0; j < selector.elements.length; j++) {\n if (selector.elements[j].isVariable) {\n hasVariable = true;\n break;\n }\n }\n selectors[i] = selector;\n if (selector.evaldCondition) {\n hasOnePassingSelector = true;\n }\n }\n\n if (hasVariable) {\n const toParseSelectors = new Array(selCnt);\n for (i = 0; i < selCnt; i++) {\n selector = selectors[i];\n toParseSelectors[i] = selector.toCSS(context);\n }\n const startingIndex = selectors[0].getIndex();\n const selectorFileInfo = selectors[0].fileInfo();\n new Parser(context, this.parse.importManager, selectorFileInfo, startingIndex).parseNode(\n toParseSelectors.join(','),\n ['selectors'],\n function(err, result) {\n if (result) {\n selectors = utils.flattenArray(result);\n }\n });\n }\n\n defaultFunc.reset();\n } else {\n hasOnePassingSelector = true;\n }\n\n let rules = this.rules ? utils.copyArray(this.rules) : null;\n const ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo());\n let rule;\n let subRule;\n\n ruleset.originalRuleset = this;\n ruleset.root = this.root;\n ruleset.firstRoot = this.firstRoot;\n ruleset.allowImports = this.allowImports;\n\n if (this.debugInfo) {\n ruleset.debugInfo = this.debugInfo;\n }\n\n if (!hasOnePassingSelector) {\n rules.length = 0;\n }\n\n // inherit a function registry from the frames stack when possible;\n // otherwise from the global registry\n ruleset.functionRegistry = (function (frames) {\n let i = 0;\n const n = frames.length;\n let found;\n for ( ; i !== n ; ++i ) {\n found = frames[ i ].functionRegistry;\n if ( found ) { return found; }\n }\n return globalFunctionRegistry;\n }(context.frames)).inherit();\n\n // push the current ruleset to the frames stack\n const ctxFrames = context.frames;\n ctxFrames.unshift(ruleset);\n\n // currrent selectors\n let ctxSelectors = context.selectors;\n if (!ctxSelectors) {\n context.selectors = ctxSelectors = [];\n }\n ctxSelectors.unshift(this.selectors);\n\n // Evaluate imports\n if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) {\n ruleset.evalImports(context);\n }\n\n // Store the frames around mixin definitions,\n // so they can be evaluated like closures when the time comes.\n const rsRules = ruleset.rules;\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.evalFirst) {\n rsRules[i] = rule.eval(context);\n }\n }\n\n const mediaBlockCount = (context.mediaBlocks && context.mediaBlocks.length) || 0;\n\n // Evaluate mixin calls.\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.type === 'MixinCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).filter(function(r) {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope if the variable is\n // already there. consider returning false here\n // but we need a way to \"return\" variable from mixins\n return !(ruleset.variable(r.name));\n }\n return true;\n });\n rsRules.splice.apply(rsRules, [i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n } else if (rule.type === 'VariableCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).rules.filter(function(r) {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope at all\n return false;\n }\n return true;\n });\n rsRules.splice.apply(rsRules, [i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n if (!rule.evalFirst) {\n rsRules[i] = rule = rule.eval ? rule.eval(context) : rule;\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n // for rulesets, check if it is a css guard and can be removed\n if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) {\n // check if it can be folded in (e.g. & where)\n if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) {\n rsRules.splice(i--, 1);\n\n for (let j = 0; (subRule = rule.rules[j]); j++) {\n if (subRule instanceof Node) {\n subRule.copyVisibilityInfo(rule.visibilityInfo());\n if (!(subRule instanceof Declaration) || !subRule.variable) {\n rsRules.splice(++i, 0, subRule);\n }\n }\n }\n }\n }\n }\n\n // Pop the stack\n ctxFrames.shift();\n ctxSelectors.shift();\n\n if (context.mediaBlocks) {\n for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) {\n context.mediaBlocks[i].bubbleSelectors(selectors);\n }\n }\n\n return ruleset;\n },\n\n evalImports(context) {\n const rules = this.rules;\n let i;\n let importRules;\n if (!rules) { return; }\n\n for (i = 0; i < rules.length; i++) {\n if (rules[i].type === 'Import') {\n importRules = rules[i].eval(context);\n if (importRules && (importRules.length || importRules.length === 0)) {\n rules.splice.apply(rules, [i, 1].concat(importRules));\n i += importRules.length - 1;\n } else {\n rules.splice(i, 1, importRules);\n }\n this.resetCache();\n }\n }\n },\n\n makeImportant() {\n const result = new Ruleset(this.selectors, this.rules.map(function (r) {\n if (r.makeImportant) {\n return r.makeImportant();\n } else {\n return r;\n }\n }), this.strictImports, this.visibilityInfo());\n\n return result;\n },\n\n matchArgs(args) {\n return !args || args.length === 0;\n },\n\n // lets you call a css selector with a guard\n matchCondition(args, context) {\n const lastSelector = this.selectors[this.selectors.length - 1];\n if (!lastSelector.evaldCondition) {\n return false;\n }\n if (lastSelector.condition &&\n !lastSelector.condition.eval(\n new contexts.Eval(context,\n context.frames))) {\n return false;\n }\n return true;\n },\n\n resetCache() {\n this._rulesets = null;\n this._variables = null;\n this._properties = null;\n this._lookups = {};\n },\n\n variables() {\n if (!this._variables) {\n this._variables = !this.rules ? {} : this.rules.reduce(function (hash, r) {\n if (r instanceof Declaration && r.variable === true) {\n hash[r.name] = r;\n }\n // when evaluating variables in an import statement, imports have not been eval'd\n // so we need to go inside import statements.\n // guard against root being a string (in the case of inlined less)\n if (r.type === 'Import' && r.root && r.root.variables) {\n const vars = r.root.variables();\n for (const name in vars) {\n // eslint-disable-next-line no-prototype-builtins\n if (vars.hasOwnProperty(name)) {\n hash[name] = r.root.variable(name);\n }\n }\n }\n return hash;\n }, {});\n }\n return this._variables;\n },\n\n properties() {\n if (!this._properties) {\n this._properties = !this.rules ? {} : this.rules.reduce(function (hash, r) {\n if (r instanceof Declaration && r.variable !== true) {\n const name = (r.name.length === 1) && (r.name[0] instanceof Keyword) ?\n r.name[0].value : r.name;\n // Properties don't overwrite as they can merge\n if (!hash[`$${name}`]) {\n hash[`$${name}`] = [ r ];\n }\n else {\n hash[`$${name}`].push(r);\n }\n }\n return hash;\n }, {});\n }\n return this._properties;\n },\n\n variable(name) {\n const decl = this.variables()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n },\n\n property(name) {\n const decl = this.properties()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n },\n\n lastDeclaration() {\n for (let i = this.rules.length; i > 0; i--) {\n const decl = this.rules[i - 1];\n if (decl instanceof Declaration) {\n return this.parseValue(decl);\n }\n }\n },\n\n parseValue(toParse) {\n const self = this;\n function transformDeclaration(decl) {\n if (decl.value instanceof Anonymous && !decl.parsed) {\n if (typeof decl.value.value === 'string') {\n new Parser(this.parse.context, this.parse.importManager, decl.fileInfo(), decl.value.getIndex()).parseNode(\n decl.value.value,\n ['value', 'important'],\n function(err, result) {\n if (err) {\n decl.parsed = true;\n }\n if (result) {\n decl.value = result[0];\n decl.important = result[1] || '';\n decl.parsed = true;\n }\n });\n } else {\n decl.parsed = true;\n }\n\n return decl;\n }\n else {\n return decl;\n }\n }\n if (!Array.isArray(toParse)) {\n return transformDeclaration.call(self, toParse);\n }\n else {\n const nodes = [];\n toParse.forEach(function(n) {\n nodes.push(transformDeclaration.call(self, n));\n });\n return nodes;\n }\n },\n\n rulesets() {\n if (!this.rules) { return []; }\n\n const filtRules = [];\n const rules = this.rules;\n let i;\n let rule;\n\n for (i = 0; (rule = rules[i]); i++) {\n if (rule.isRuleset) {\n filtRules.push(rule);\n }\n }\n\n return filtRules;\n },\n\n prependRule(rule) {\n const rules = this.rules;\n if (rules) {\n rules.unshift(rule);\n } else {\n this.rules = [ rule ];\n }\n this.setParent(rule, this);\n },\n\n find(selector, self, filter) {\n self = self || this;\n const rules = [];\n let match;\n let foundMixins;\n const key = selector.toCSS();\n\n if (key in this._lookups) { return this._lookups[key]; }\n\n this.rulesets().forEach(function (rule) {\n if (rule !== self) {\n for (let j = 0; j < rule.selectors.length; j++) {\n match = selector.match(rule.selectors[j]);\n if (match) {\n if (selector.elements.length > match) {\n if (!filter || filter(rule)) {\n foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter);\n for (let i = 0; i < foundMixins.length; ++i) {\n foundMixins[i].path.push(rule);\n }\n Array.prototype.push.apply(rules, foundMixins);\n }\n } else {\n rules.push({ rule, path: []});\n }\n break;\n }\n }\n }\n });\n this._lookups[key] = rules;\n return rules;\n },\n\n genCSS(context, output) {\n let i;\n let j;\n const charsetRuleNodes = [];\n let ruleNodes = [];\n\n let // Line number debugging\n debugInfo;\n\n let rule;\n let path;\n\n context.tabLevel = (context.tabLevel || 0);\n\n if (!this.root) {\n context.tabLevel++;\n }\n\n const tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' ');\n const tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' ');\n let sep;\n\n let charsetNodeIndex = 0;\n let importNodeIndex = 0;\n for (i = 0; (rule = this.rules[i]); i++) {\n if (rule instanceof Comment) {\n if (importNodeIndex === i) {\n importNodeIndex++;\n }\n ruleNodes.push(rule);\n } else if (rule.isCharset && rule.isCharset()) {\n ruleNodes.splice(charsetNodeIndex, 0, rule);\n charsetNodeIndex++;\n importNodeIndex++;\n } else if (rule.type === 'Import') {\n ruleNodes.splice(importNodeIndex, 0, rule);\n importNodeIndex++;\n } else {\n ruleNodes.push(rule);\n }\n }\n ruleNodes = charsetRuleNodes.concat(ruleNodes);\n\n // If this is the root node, we don't render\n // a selector, or {}.\n if (!this.root) {\n debugInfo = getDebugInfo(context, this, tabSetStr);\n\n if (debugInfo) {\n output.add(debugInfo);\n output.add(tabSetStr);\n }\n\n const paths = this.paths;\n const pathCnt = paths.length;\n let pathSubCnt;\n\n sep = context.compress ? ',' : (`,\\n${tabSetStr}`);\n\n for (i = 0; i < pathCnt; i++) {\n path = paths[i];\n if (!(pathSubCnt = path.length)) { continue; }\n if (i > 0) { output.add(sep); }\n\n context.firstSelector = true;\n path[0].genCSS(context, output);\n\n context.firstSelector = false;\n for (j = 1; j < pathSubCnt; j++) {\n path[j].genCSS(context, output);\n }\n }\n\n output.add((context.compress ? '{' : ' {\\n') + tabRuleStr);\n }\n\n // Compile rules and rulesets\n for (i = 0; (rule = ruleNodes[i]); i++) {\n\n if (i + 1 === ruleNodes.length) {\n context.lastRule = true;\n }\n\n const currentLastRule = context.lastRule;\n if (rule.isRulesetLike(rule)) {\n context.lastRule = false;\n }\n\n if (rule.genCSS) {\n rule.genCSS(context, output);\n } else if (rule.value) {\n output.add(rule.value.toString());\n }\n\n context.lastRule = currentLastRule;\n\n if (!context.lastRule && rule.isVisible()) {\n output.add(context.compress ? '' : (`\\n${tabRuleStr}`));\n } else {\n context.lastRule = false;\n }\n }\n\n if (!this.root) {\n output.add((context.compress ? '}' : `\\n${tabSetStr}}`));\n context.tabLevel--;\n }\n\n if (!output.isEmpty() && !context.compress && this.firstRoot) {\n output.add('\\n');\n }\n },\n\n joinSelectors(paths, context, selectors) {\n for (let s = 0; s < selectors.length; s++) {\n this.joinSelector(paths, context, selectors[s]);\n }\n },\n\n joinSelector(paths, context, selector) {\n\n function createParenthesis(elementsToPak, originalElement) {\n let replacementParen, j;\n if (elementsToPak.length === 0) {\n replacementParen = new Paren(elementsToPak[0]);\n } else {\n const insideParent = new Array(elementsToPak.length);\n for (j = 0; j < elementsToPak.length; j++) {\n insideParent[j] = new Element(\n null,\n elementsToPak[j],\n originalElement.isVariable,\n originalElement._index,\n originalElement._fileInfo\n );\n }\n replacementParen = new Paren(new Selector(insideParent));\n }\n return replacementParen;\n }\n\n function createSelector(containedElement, originalElement) {\n let element, selector;\n element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo);\n selector = new Selector([element]);\n return selector;\n }\n\n // joins selector path from `beginningPath` with selector path in `addPath`\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns concatenated path\n function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) {\n let newSelectorPath, lastSelector, newJoinedSelector;\n // our new selector path\n newSelectorPath = [];\n\n // construct the joined selector - if & is the first thing this will be empty,\n // if not newJoinedSelector will be the last set of elements in the selector\n if (beginningPath.length > 0) {\n newSelectorPath = utils.copyArray(beginningPath);\n lastSelector = newSelectorPath.pop();\n newJoinedSelector = originalSelector.createDerived(utils.copyArray(lastSelector.elements));\n }\n else {\n newJoinedSelector = originalSelector.createDerived([]);\n }\n\n if (addPath.length > 0) {\n // /deep/ is a CSS4 selector - (removed, so should deprecate)\n // that is valid without anything in front of it\n // so if the & does not have a combinator that is \"\" or \" \" then\n // and there is a combinator on the parent, then grab that.\n // this also allows + a { & .b { .a & { ... though not sure why you would want to do that\n let combinator = replacedElement.combinator;\n\n const parentEl = addPath[0].elements[0];\n if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) {\n combinator = parentEl.combinator;\n }\n // join the elements so far with the first part of the parent\n newJoinedSelector.elements.push(new Element(\n combinator,\n parentEl.value,\n replacedElement.isVariable,\n replacedElement._index,\n replacedElement._fileInfo\n ));\n newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1));\n }\n\n // now add the joined selector - but only if it is not empty\n if (newJoinedSelector.elements.length !== 0) {\n newSelectorPath.push(newJoinedSelector);\n }\n\n // put together the parent selectors after the join (e.g. the rest of the parent)\n if (addPath.length > 1) {\n let restOfPath = addPath.slice(1);\n restOfPath = restOfPath.map(function (selector) {\n return selector.createDerived(selector.elements, []);\n });\n newSelectorPath = newSelectorPath.concat(restOfPath);\n }\n return newSelectorPath;\n }\n\n // joins selector path from `beginningPath` with every selector path in `addPaths` array\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns array with all concatenated paths\n function addAllReplacementsIntoPath( beginningPath, addPaths, replacedElement, originalSelector, result) {\n let j;\n for (j = 0; j < beginningPath.length; j++) {\n const newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector);\n result.push(newSelectorPath);\n }\n return result;\n }\n\n function mergeElementsOnToSelectors(elements, selectors) {\n let i, sel;\n\n if (elements.length === 0) {\n return ;\n }\n if (selectors.length === 0) {\n selectors.push([ new Selector(elements) ]);\n return;\n }\n\n for (i = 0; (sel = selectors[i]); i++) {\n // if the previous thing in sel is a parent this needs to join on to it\n if (sel.length > 0) {\n sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements));\n }\n else {\n sel.push(new Selector(elements));\n }\n }\n }\n\n // replace all parent selectors inside `inSelector` by content of `context` array\n // resulting selectors are returned inside `paths` array\n // returns true if `inSelector` contained at least one parent selector\n function replaceParentSelector(paths, context, inSelector) {\n // The paths are [[Selector]]\n // The first list is a list of comma separated selectors\n // The inner list is a list of inheritance separated selectors\n // e.g.\n // .a, .b {\n // .c {\n // }\n // }\n // == [[.a] [.c]] [[.b] [.c]]\n //\n let i, j, k, currentElements, newSelectors, selectorsMultiplied, sel, el, hadParentSelector = false, length, lastSelector;\n function findNestedSelector(element) {\n let maybeSelector;\n if (!(element.value instanceof Paren)) {\n return null;\n }\n\n maybeSelector = element.value.value;\n if (!(maybeSelector instanceof Selector)) {\n return null;\n }\n\n return maybeSelector;\n }\n\n // the elements from the current selector so far\n currentElements = [];\n // the current list of new selectors to add to the path.\n // We will build it up. We initiate it with one empty selector as we \"multiply\" the new selectors\n // by the parents\n newSelectors = [\n []\n ];\n\n for (i = 0; (el = inSelector.elements[i]); i++) {\n // non parent reference elements just get added\n if (el.value !== '&') {\n const nestedSelector = findNestedSelector(el);\n if (nestedSelector !== null) {\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n const nestedPaths = [];\n let replaced;\n const replacedNewSelectors = [];\n replaced = replaceParentSelector(nestedPaths, context, nestedSelector);\n hadParentSelector = hadParentSelector || replaced;\n // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors\n for (k = 0; k < nestedPaths.length; k++) {\n const replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el);\n addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors);\n }\n newSelectors = replacedNewSelectors;\n currentElements = [];\n } else {\n currentElements.push(el);\n }\n\n } else {\n hadParentSelector = true;\n // the new list of selectors to add\n selectorsMultiplied = [];\n\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n // loop through our current selectors\n for (j = 0; j < newSelectors.length; j++) {\n sel = newSelectors[j];\n // if we don't have any parent paths, the & might be in a mixin so that it can be used\n // whether there are parents or not\n if (context.length === 0) {\n // the combinator used on el should now be applied to the next element instead so that\n // it is not lost\n if (sel.length > 0) {\n sel[0].elements.push(new Element(el.combinator, '', el.isVariable, el._index, el._fileInfo));\n }\n selectorsMultiplied.push(sel);\n }\n else {\n // and the parent selectors\n for (k = 0; k < context.length; k++) {\n // We need to put the current selectors\n // then join the last selector's elements on to the parents selectors\n const newSelectorPath = addReplacementIntoPath(sel, context[k], el, inSelector);\n // add that to our new set of selectors\n selectorsMultiplied.push(newSelectorPath);\n }\n }\n }\n\n // our new selectors has been multiplied, so reset the state\n newSelectors = selectorsMultiplied;\n currentElements = [];\n }\n }\n\n // if we have any elements left over (e.g. .a& .b == .b)\n // add them on to all the current selectors\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n for (i = 0; i < newSelectors.length; i++) {\n length = newSelectors[i].length;\n if (length > 0) {\n paths.push(newSelectors[i]);\n lastSelector = newSelectors[i][length - 1];\n newSelectors[i][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList);\n }\n }\n\n return hadParentSelector;\n }\n\n function deriveSelector(visibilityInfo, deriveFrom) {\n const newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition);\n newSelector.copyVisibilityInfo(visibilityInfo);\n return newSelector;\n }\n\n // joinSelector code follows\n let i, newPaths, hadParentSelector;\n\n newPaths = [];\n hadParentSelector = replaceParentSelector(newPaths, context, selector);\n\n if (!hadParentSelector) {\n if (context.length > 0) {\n newPaths = [];\n for (i = 0; i < context.length; i++) {\n\n const concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo()));\n\n concatenated.push(selector);\n newPaths.push(concatenated);\n }\n }\n else {\n newPaths = [[selector]];\n }\n }\n\n for (i = 0; i < newPaths.length; i++) {\n paths.push(newPaths[i]);\n }\n\n }\n});\n\nexport default Ruleset;\n","import Node from './node';\nimport Selector from './selector';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\n\nconst AtRule = function(\n name,\n value,\n rules,\n index,\n currentFileInfo,\n debugInfo,\n isRooted,\n visibilityInfo\n) {\n let i;\n\n this.name = name;\n this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value);\n if (rules) {\n if (Array.isArray(rules)) {\n this.rules = rules;\n } else {\n this.rules = [rules];\n this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors();\n }\n for (i = 0; i < this.rules.length; i++) {\n this.rules[i].allowImports = true;\n }\n this.setParent(this.rules, this);\n }\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.debugInfo = debugInfo;\n this.isRooted = isRooted || false;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n}\n\nAtRule.prototype = Object.assign(new Node(), {\n type: 'AtRule',\n accept(visitor) {\n const value = this.value, rules = this.rules;\n if (rules) {\n this.rules = visitor.visitArray(rules);\n }\n if (value) {\n this.value = visitor.visit(value);\n }\n },\n\n isRulesetLike() {\n return this.rules || !this.isCharset();\n },\n\n isCharset() {\n return '@charset' === this.name;\n },\n\n genCSS(context, output) {\n const value = this.value, rules = this.rules;\n output.add(this.name, this.fileInfo(), this.getIndex());\n if (value) {\n output.add(' ');\n value.genCSS(context, output);\n }\n if (rules) {\n this.outputRuleset(context, output, rules);\n } else {\n output.add(';');\n }\n },\n\n eval(context) {\n let mediaPathBackup, mediaBlocksBackup, value = this.value, rules = this.rules;\n\n // media stored inside other atrule should not bubble over it\n // backpup media bubbling information\n mediaPathBackup = context.mediaPath;\n mediaBlocksBackup = context.mediaBlocks;\n // deleted media bubbling information\n context.mediaPath = [];\n context.mediaBlocks = [];\n\n if (value) {\n value = value.eval(context);\n }\n if (rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n rules = [rules[0].eval(context)];\n rules[0].root = true;\n }\n // restore media bubbling information\n context.mediaPath = mediaPathBackup;\n context.mediaBlocks = mediaBlocksBackup;\n\n return new AtRule(this.name, value, rules,\n this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo());\n },\n\n variable(name) {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.variable.call(this.rules[0], name);\n }\n },\n\n find() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.find.apply(this.rules[0], arguments);\n }\n },\n\n rulesets() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.rulesets.apply(this.rules[0]);\n }\n },\n\n outputRuleset(context, output, rules) {\n const ruleCnt = rules.length;\n let i;\n context.tabLevel = (context.tabLevel | 0) + 1;\n\n // Compressed\n if (context.compress) {\n output.add('{');\n for (i = 0; i < ruleCnt; i++) {\n rules[i].genCSS(context, output);\n }\n output.add('}');\n context.tabLevel--;\n return;\n }\n\n // Non-compressed\n const tabSetStr = `\\n${Array(context.tabLevel).join(' ')}`, tabRuleStr = `${tabSetStr} `;\n if (!ruleCnt) {\n output.add(` {${tabSetStr}}`);\n } else {\n output.add(` {${tabRuleStr}`);\n rules[0].genCSS(context, output);\n for (i = 1; i < ruleCnt; i++) {\n output.add(tabRuleStr);\n rules[i].genCSS(context, output);\n }\n output.add(`${tabSetStr}}`);\n }\n\n context.tabLevel--;\n }\n});\n\nexport default AtRule;\n","import Node from './node';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nconst DetachedRuleset = function(ruleset, frames) {\n this.ruleset = ruleset;\n this.frames = frames;\n this.setParent(this.ruleset, this);\n};\n\nDetachedRuleset.prototype = Object.assign(new Node(), {\n type: 'DetachedRuleset',\n evalFirst: true,\n\n accept(visitor) {\n this.ruleset = visitor.visit(this.ruleset);\n },\n\n eval(context) {\n const frames = this.frames || utils.copyArray(context.frames);\n return new DetachedRuleset(this.ruleset, frames);\n },\n\n callEval(context) {\n return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context);\n }\n});\n\nexport default DetachedRuleset;\n","import Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport * as utils from '../utils';\n\nconst Unit = function(numerator, denominator, backupUnit) {\n this.numerator = numerator ? utils.copyArray(numerator).sort() : [];\n this.denominator = denominator ? utils.copyArray(denominator).sort() : [];\n if (backupUnit) {\n this.backupUnit = backupUnit;\n } else if (numerator && numerator.length) {\n this.backupUnit = numerator[0];\n }\n};\n\nUnit.prototype = Object.assign(new Node(), {\n type: 'Unit',\n\n clone() {\n return new Unit(utils.copyArray(this.numerator), utils.copyArray(this.denominator), this.backupUnit);\n },\n\n genCSS(context, output) {\n // Dimension checks the unit is singular and throws an error if in strict math mode.\n const strictUnits = context && context.strictUnits;\n if (this.numerator.length === 1) {\n output.add(this.numerator[0]); // the ideal situation\n } else if (!strictUnits && this.backupUnit) {\n output.add(this.backupUnit);\n } else if (!strictUnits && this.denominator.length) {\n output.add(this.denominator[0]);\n }\n },\n\n toString() {\n let i, returnStr = this.numerator.join('*');\n for (i = 0; i < this.denominator.length; i++) {\n returnStr += `/${this.denominator[i]}`;\n }\n return returnStr;\n },\n\n compare(other) {\n return this.is(other.toString()) ? 0 : undefined;\n },\n\n is(unitString) {\n return this.toString().toUpperCase() === unitString.toUpperCase();\n },\n\n isLength() {\n return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS());\n },\n\n isEmpty() {\n return this.numerator.length === 0 && this.denominator.length === 0;\n },\n\n isSingular() {\n return this.numerator.length <= 1 && this.denominator.length === 0;\n },\n\n map(callback) {\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n this.numerator[i] = callback(this.numerator[i], false);\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n this.denominator[i] = callback(this.denominator[i], true);\n }\n },\n\n usedUnits() {\n let group;\n const result = {};\n let mapUnit;\n let groupName;\n\n mapUnit = function (atomicUnit) {\n // eslint-disable-next-line no-prototype-builtins\n if (group.hasOwnProperty(atomicUnit) && !result[groupName]) {\n result[groupName] = atomicUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in unitConversions) {\n // eslint-disable-next-line no-prototype-builtins\n if (unitConversions.hasOwnProperty(groupName)) {\n group = unitConversions[groupName];\n\n this.map(mapUnit);\n }\n }\n\n return result;\n },\n\n cancel() {\n const counter = {};\n let atomicUnit;\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n atomicUnit = this.numerator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) + 1;\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n atomicUnit = this.denominator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) - 1;\n }\n\n this.numerator = [];\n this.denominator = [];\n\n for (atomicUnit in counter) {\n // eslint-disable-next-line no-prototype-builtins\n if (counter.hasOwnProperty(atomicUnit)) {\n const count = counter[atomicUnit];\n\n if (count > 0) {\n for (i = 0; i < count; i++) {\n this.numerator.push(atomicUnit);\n }\n } else if (count < 0) {\n for (i = 0; i < -count; i++) {\n this.denominator.push(atomicUnit);\n }\n }\n }\n }\n\n this.numerator.sort();\n this.denominator.sort();\n }\n});\n\nexport default Unit;\n","/* eslint-disable no-prototype-builtins */\nimport Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport Unit from './unit';\nimport Color from './color';\n\n//\n// A number with a unit\n//\nconst Dimension = function(value, unit) {\n this.value = parseFloat(value);\n if (isNaN(this.value)) {\n throw new Error('Dimension is not a number.');\n }\n this.unit = (unit && unit instanceof Unit) ? unit :\n new Unit(unit ? [unit] : undefined);\n this.setParent(this.unit, this);\n};\n\nDimension.prototype = Object.assign(new Node(), {\n type: 'Dimension',\n\n accept(visitor) {\n this.unit = visitor.visit(this.unit);\n },\n\n // remove when Nodes have JSDoc types\n // eslint-disable-next-line no-unused-vars\n eval(context) {\n return this;\n },\n\n toColor() {\n return new Color([this.value, this.value, this.value]);\n },\n\n genCSS(context, output) {\n if ((context && context.strictUnits) && !this.unit.isSingular()) {\n throw new Error(`Multiple units in dimension. Correct the units or use the unit function. Bad unit: ${this.unit.toString()}`);\n }\n\n const value = this.fround(context, this.value);\n let strValue = String(value);\n\n if (value !== 0 && value < 0.000001 && value > -0.000001) {\n // would be output 1e-6 etc.\n strValue = value.toFixed(20).replace(/0+$/, '');\n }\n\n if (context && context.compress) {\n // Zero values doesn't need a unit\n if (value === 0 && this.unit.isLength()) {\n output.add(strValue);\n return;\n }\n\n // Float values doesn't need a leading zero\n if (value > 0 && value < 1) {\n strValue = (strValue).substr(1);\n }\n }\n\n output.add(strValue);\n this.unit.genCSS(context, output);\n },\n\n // In an operation between two Dimensions,\n // we default to the first Dimension's unit,\n // so `1px + 2` will yield `3px`.\n operate(context, op, other) {\n /* jshint noempty:false */\n let value = this._operate(context, op, this.value, other.value);\n let unit = this.unit.clone();\n\n if (op === '+' || op === '-') {\n if (unit.numerator.length === 0 && unit.denominator.length === 0) {\n unit = other.unit.clone();\n if (this.unit.backupUnit) {\n unit.backupUnit = this.unit.backupUnit;\n }\n } else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) {\n // do nothing\n } else {\n other = other.convertTo(this.unit.usedUnits());\n\n if (context.strictUnits && other.unit.toString() !== unit.toString()) {\n throw new Error('Incompatible units. Change the units or use the unit function. '\n + `Bad units: '${unit.toString()}' and '${other.unit.toString()}'.`);\n }\n\n value = this._operate(context, op, this.value, other.value);\n }\n } else if (op === '*') {\n unit.numerator = unit.numerator.concat(other.unit.numerator).sort();\n unit.denominator = unit.denominator.concat(other.unit.denominator).sort();\n unit.cancel();\n } else if (op === '/') {\n unit.numerator = unit.numerator.concat(other.unit.denominator).sort();\n unit.denominator = unit.denominator.concat(other.unit.numerator).sort();\n unit.cancel();\n }\n return new Dimension(value, unit);\n },\n\n compare(other) {\n let a, b;\n\n if (!(other instanceof Dimension)) {\n return undefined;\n }\n\n if (this.unit.isEmpty() || other.unit.isEmpty()) {\n a = this;\n b = other;\n } else {\n a = this.unify();\n b = other.unify();\n if (a.unit.compare(b.unit) !== 0) {\n return undefined;\n }\n }\n\n return Node.numericCompare(a.value, b.value);\n },\n\n unify() {\n return this.convertTo({ length: 'px', duration: 's', angle: 'rad' });\n },\n\n convertTo(conversions) {\n let value = this.value;\n const unit = this.unit.clone();\n let i;\n let groupName;\n let group;\n let targetUnit;\n let derivedConversions = {};\n let applyUnit;\n\n if (typeof conversions === 'string') {\n for (i in unitConversions) {\n if (unitConversions[i].hasOwnProperty(conversions)) {\n derivedConversions = {};\n derivedConversions[i] = conversions;\n }\n }\n conversions = derivedConversions;\n }\n applyUnit = function (atomicUnit, denominator) {\n if (group.hasOwnProperty(atomicUnit)) {\n if (denominator) {\n value = value / (group[atomicUnit] / group[targetUnit]);\n } else {\n value = value * (group[atomicUnit] / group[targetUnit]);\n }\n\n return targetUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in conversions) {\n if (conversions.hasOwnProperty(groupName)) {\n targetUnit = conversions[groupName];\n group = unitConversions[groupName];\n\n unit.map(applyUnit);\n }\n }\n\n unit.cancel();\n\n return new Dimension(value, unit);\n }\n});\n\nexport default Dimension;\n","import Node from './node';\nimport Color from './color';\nimport Dimension from './dimension';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\n\nconst Operation = function(op, operands, isSpaced) {\n this.op = op.trim();\n this.operands = operands;\n this.isSpaced = isSpaced;\n};\n\nOperation.prototype = Object.assign(new Node(), {\n type: 'Operation',\n\n accept(visitor) {\n this.operands = visitor.visitArray(this.operands);\n },\n\n eval(context) {\n let a = this.operands[0].eval(context), b = this.operands[1].eval(context), op;\n\n if (context.isMathOn(this.op)) {\n op = this.op === './' ? '/' : this.op;\n if (a instanceof Dimension && b instanceof Color) {\n a = a.toColor();\n }\n if (b instanceof Dimension && a instanceof Color) {\n b = b.toColor();\n }\n if (!a.operate || !b.operate) {\n if (\n (a instanceof Operation || b instanceof Operation)\n && a.op === '/' && context.math === MATH.PARENS_DIVISION\n ) {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n throw { type: 'Operation',\n message: 'Operation on an invalid type' };\n }\n\n return a.operate(context, op, b);\n } else {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n },\n\n genCSS(context, output) {\n this.operands[0].genCSS(context, output);\n if (this.isSpaced) {\n output.add(' ');\n }\n output.add(this.op);\n if (this.isSpaced) {\n output.add(' ');\n }\n this.operands[1].genCSS(context, output);\n }\n});\n\nexport default Operation;\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import Node from './node';\nimport Paren from './paren';\nimport Comment from './comment';\nimport Dimension from './dimension';\n\nconst Expression = function(value, noSpacing) {\n this.value = value;\n this.noSpacing = noSpacing;\n if (!value) {\n throw new Error('Expression requires an array parameter');\n }\n};\n\nExpression.prototype = Object.assign(new Node(), {\n type: 'Expression',\n\n accept(visitor) {\n this.value = visitor.visitArray(this.value);\n },\n\n eval(context) {\n let returnValue;\n const mathOn = context.isMathOn();\n const inParenthesis = this.parens;\n\n let doubleParen = false;\n if (inParenthesis) {\n context.inParenthesis();\n }\n if (this.value.length > 1) {\n returnValue = new Expression(this.value.map(function (e) {\n if (!e.eval) {\n return e;\n }\n return e.eval(context);\n }), this.noSpacing);\n } else if (this.value.length === 1) {\n if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) {\n doubleParen = true;\n }\n returnValue = this.value[0].eval(context);\n } else {\n returnValue = this;\n }\n if (inParenthesis) {\n context.outOfParenthesis();\n }\n if (this.parens && this.parensInOp && !mathOn && !doubleParen \n && (!(returnValue instanceof Dimension))) {\n returnValue = new Paren(returnValue);\n }\n return returnValue;\n },\n\n genCSS(context, output) {\n for (let i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (!this.noSpacing && i + 1 < this.value.length) {\n output.add(' ');\n }\n }\n },\n\n throwAwayComments() {\n this.value = this.value.filter(function(v) {\n return !(v instanceof Comment);\n });\n }\n});\n\nexport default Expression;\n","import Expression from '../tree/expression';\n\nclass functionCaller {\n constructor(name, context, index, currentFileInfo) {\n this.name = name.toLowerCase();\n this.index = index;\n this.context = context;\n this.currentFileInfo = currentFileInfo;\n\n this.func = context.frames[0].functionRegistry.get(this.name);\n }\n\n isValid() {\n return Boolean(this.func);\n }\n\n call(args) {\n if (!(Array.isArray(args))) {\n args = [args];\n }\n const evalArgs = this.func.evalArgs;\n if (evalArgs !== false) {\n args = args.map(a => a.eval(this.context));\n }\n const commentFilter = item => !(item.type === 'Comment');\n\n // This code is terrible and should be replaced as per this issue...\n // https://github.com/less/less.js/issues/2477\n args = args\n .filter(commentFilter)\n .map(item => {\n if (item.type === 'Expression') {\n const subNodes = item.value.filter(commentFilter);\n if (subNodes.length === 1) {\n // https://github.com/less/less.js/issues/3616\n if (item.parens && subNodes[0].op === '/') {\n return item;\n }\n return subNodes[0];\n } else {\n return new Expression(subNodes);\n }\n }\n return item;\n });\n\n if (evalArgs === false) {\n return this.func(this.context, ...args);\n }\n\n return this.func(...args);\n }\n}\n\nexport default functionCaller;\n","import Node from './node';\nimport Anonymous from './anonymous';\nimport FunctionCaller from '../functions/function-caller';\n\n//\n// A function call node.\n//\nconst Call = function(name, args, index, currentFileInfo) {\n this.name = name;\n this.args = args;\n this.calc = name === 'calc';\n this._index = index;\n this._fileInfo = currentFileInfo;\n}\n\nCall.prototype = Object.assign(new Node(), {\n type: 'Call',\n\n accept(visitor) {\n if (this.args) {\n this.args = visitor.visitArray(this.args);\n }\n },\n\n //\n // When evaluating a function call,\n // we either find the function in the functionRegistry,\n // in which case we call it, passing the evaluated arguments,\n // if this returns null or we cannot find the function, we\n // simply print it out as it appeared originally [2].\n //\n // The reason why we evaluate the arguments, is in the case where\n // we try to pass a variable to a function, like: `saturate(@color)`.\n // The function should receive the value, not the variable.\n //\n eval(context) {\n /**\n * Turn off math for calc(), and switch back on for evaluating nested functions\n */\n const currentMathContext = context.mathOn;\n context.mathOn = !this.calc;\n if (this.calc || context.inCalc) {\n context.enterCalc();\n }\n\n const exitCalc = () => {\n if (this.calc || context.inCalc) {\n context.exitCalc();\n }\n context.mathOn = currentMathContext;\n };\n\n let result;\n const funcCaller = new FunctionCaller(this.name, context, this.getIndex(), this.fileInfo());\n\n if (funcCaller.isValid()) {\n try {\n result = funcCaller.call(this.args);\n exitCalc();\n } catch (e) {\n // eslint-disable-next-line no-prototype-builtins\n if (e.hasOwnProperty('line') && e.hasOwnProperty('column')) {\n throw e;\n }\n throw { \n type: e.type || 'Runtime',\n message: `Error evaluating function \\`${this.name}\\`${e.message ? `: ${e.message}` : ''}`,\n index: this.getIndex(), \n filename: this.fileInfo().filename,\n line: e.lineNumber,\n column: e.columnNumber\n };\n }\n }\n\n if (result !== null && result !== undefined) {\n // Results that that are not nodes are cast as Anonymous nodes\n // Falsy values or booleans are returned as empty nodes\n if (!(result instanceof Node)) {\n if (!result || result === true) {\n result = new Anonymous(null); \n }\n else {\n result = new Anonymous(result.toString()); \n }\n \n }\n result._index = this._index;\n result._fileInfo = this._fileInfo;\n return result;\n }\n\n const args = this.args.map(a => a.eval(context));\n exitCalc();\n\n return new Call(this.name, args, this.getIndex(), this.fileInfo());\n },\n\n genCSS(context, output) {\n output.add(`${this.name}(`, this.fileInfo(), this.getIndex());\n\n for (let i = 0; i < this.args.length; i++) {\n this.args[i].genCSS(context, output);\n if (i + 1 < this.args.length) {\n output.add(', ');\n }\n }\n\n output.add(')');\n }\n});\n\nexport default Call;\n","import Node from './node';\nimport Call from './call';\n\nconst Variable = function(name, index, currentFileInfo) {\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n};\n\nVariable.prototype = Object.assign(new Node(), {\n type: 'Variable',\n\n eval(context) {\n let variable, name = this.name;\n\n if (name.indexOf('@@') === 0) {\n name = `@${new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value}`;\n }\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive variable definition for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n variable = this.find(context.frames, function (frame) {\n const v = frame.variable(name);\n if (v) {\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n // If in calc, wrap vars in a function call to cascade evaluate args first\n if (context.inCalc) {\n return (new Call('_SELF', [v.value])).eval(context);\n }\n else {\n return v.value.eval(context);\n }\n }\n });\n if (variable) {\n this.evaluating = false;\n return variable;\n } else {\n throw { type: 'Name',\n message: `variable ${name} is undefined`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n },\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n});\n\nexport default Variable;\n","import Node from './node';\nimport Declaration from './declaration';\n\nconst Property = function(name, index, currentFileInfo) {\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n};\n\nProperty.prototype = Object.assign(new Node(), {\n type: 'Property',\n\n eval(context) {\n let property;\n const name = this.name;\n // TODO: shorten this reference\n const mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive property reference for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n property = this.find(context.frames, function (frame) {\n let v;\n const vArr = frame.property(name);\n if (vArr) {\n for (let i = 0; i < vArr.length; i++) {\n v = vArr[i];\n\n vArr[i] = new Declaration(v.name,\n v.value,\n v.important,\n v.merge,\n v.index,\n v.currentFileInfo,\n v.inline,\n v.variable\n );\n }\n mergeRules(vArr);\n\n v = vArr[vArr.length - 1];\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n v = v.value.eval(context);\n return v;\n }\n });\n if (property) {\n this.evaluating = false;\n return property;\n } else {\n throw { type: 'Name',\n message: `Property '${name}' is undefined`,\n filename: this.currentFileInfo.filename,\n index: this.index };\n }\n },\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n});\n\nexport default Property;\n","import Node from './node';\n\nconst Attribute = function(key, op, value, cif) {\n this.key = key;\n this.op = op;\n this.value = value;\n this.cif = cif;\n}\n\nAttribute.prototype = Object.assign(new Node(), {\n type: 'Attribute',\n\n eval(context) {\n return new Attribute(\n this.key.eval ? this.key.eval(context) : this.key,\n this.op,\n (this.value && this.value.eval) ? this.value.eval(context) : this.value,\n this.cif\n );\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n },\n\n toCSS(context) {\n let value = this.key.toCSS ? this.key.toCSS(context) : this.key;\n\n if (this.op) {\n value += this.op;\n value += (this.value.toCSS ? this.value.toCSS(context) : this.value);\n }\n\n if (this.cif) {\n value = value + ' ' + this.cif;\n }\n\n return `[${value}]`;\n }\n});\n\nexport default Attribute;\n","import Node from './node';\nimport Variable from './variable';\nimport Property from './property';\n\nconst Quoted = function(str, content, escaped, index, currentFileInfo) {\n this.escaped = (escaped === undefined) ? true : escaped;\n this.value = content || '';\n this.quote = str.charAt(0);\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.variableRegex = /@\\{([\\w-]+)\\}/g;\n this.propRegex = /\\$\\{([\\w-]+)\\}/g;\n this.allowRoot = escaped;\n};\n\nQuoted.prototype = Object.assign(new Node(), {\n type: 'Quoted',\n\n genCSS(context, output) {\n if (!this.escaped) {\n output.add(this.quote, this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n if (!this.escaped) {\n output.add(this.quote);\n }\n },\n\n containsVariables() {\n return this.value.match(this.variableRegex);\n },\n\n eval(context) {\n const that = this;\n let value = this.value;\n const variableReplacement = function (_, name) {\n const v = new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n const propertyReplacement = function (_, name) {\n const v = new Property(`$${name}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n function iterativeReplace(value, regexp, replacementFnc) {\n let evaluatedValue = value;\n do {\n value = evaluatedValue.toString();\n evaluatedValue = value.replace(regexp, replacementFnc);\n } while (value !== evaluatedValue);\n return evaluatedValue;\n }\n value = iterativeReplace(value, this.variableRegex, variableReplacement);\n value = iterativeReplace(value, this.propRegex, propertyReplacement);\n return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo());\n },\n\n compare(other) {\n // when comparing quoted strings allow the quote to differ\n if (other.type === 'Quoted' && !this.escaped && !other.escaped) {\n return Node.numericCompare(this.value, other.value);\n } else {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n }\n }\n});\n\nexport default Quoted;\n","import Node from './node';\n\nfunction escapePath(path) {\n return path.replace(/[()'\"\\s]/g, function(match) { return `\\\\${match}`; });\n}\n\nconst URL = function(val, index, currentFileInfo, isEvald) {\n this.value = val;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.isEvald = isEvald;\n};\n\nURL.prototype = Object.assign(new Node(), {\n type: 'Url',\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n },\n\n genCSS(context, output) {\n output.add('url(');\n this.value.genCSS(context, output);\n output.add(')');\n },\n\n eval(context) {\n const val = this.value.eval(context);\n let rootpath;\n\n if (!this.isEvald) {\n // Add the rootpath if the URL requires a rewrite\n rootpath = this.fileInfo() && this.fileInfo().rootpath;\n if (typeof rootpath === 'string' &&\n typeof val.value === 'string' &&\n context.pathRequiresRewrite(val.value)) {\n if (!val.quote) {\n rootpath = escapePath(rootpath);\n }\n val.value = context.rewritePath(val.value, rootpath);\n } else {\n val.value = context.normalizePath(val.value);\n }\n\n // Add url args if enabled\n if (context.urlArgs) {\n if (!val.value.match(/^\\s*data:/)) {\n const delimiter = val.value.indexOf('?') === -1 ? '?' : '&';\n const urlArgs = delimiter + context.urlArgs;\n if (val.value.indexOf('#') !== -1) {\n val.value = val.value.replace('#', `${urlArgs}#`);\n } else {\n val.value += urlArgs;\n }\n }\n }\n }\n\n return new URL(val, this.getIndex(), this.fileInfo(), true);\n }\n});\n\nexport default URL;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport Anonymous from './anonymous';\nimport Expression from './expression';\nimport * as utils from '../utils';\n\nconst NestableAtRulePrototype = {\n\n isRulesetLike() {\n return true;\n },\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n if (this.rules) {\n this.rules = visitor.visitArray(this.rules);\n }\n },\n\n evalTop(context) {\n let result = this;\n\n // Render all dependent Media blocks.\n if (context.mediaBlocks.length > 1) {\n const selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors();\n result = new Ruleset(selectors, context.mediaBlocks);\n result.multiMedia = true;\n result.copyVisibilityInfo(this.visibilityInfo());\n this.setParent(result, this);\n }\n\n delete context.mediaBlocks;\n delete context.mediaPath;\n\n return result;\n },\n\n evalNested(context) {\n let i;\n let value;\n const path = context.mediaPath.concat([this]);\n\n // Extract the media-query conditions separated with `,` (OR).\n for (i = 0; i < path.length; i++) {\n value = path[i].features instanceof Value ?\n path[i].features.value : path[i].features;\n path[i] = Array.isArray(value) ? value : [value];\n }\n\n // Trace all permutations to generate the resulting media-query.\n //\n // (a, b and c) with nested (d, e) ->\n // a and d\n // a and e\n // b and c and d\n // b and c and e\n this.features = new Value(this.permute(path).map(path => {\n path = path.map(fragment => fragment.toCSS ? fragment : new Anonymous(fragment));\n\n for (i = path.length - 1; i > 0; i--) {\n path.splice(i, 0, new Anonymous('and'));\n }\n\n return new Expression(path);\n }));\n this.setParent(this.features, this);\n\n // Fake a tree-node that doesn't output anything.\n return new Ruleset([], []);\n },\n\n permute(arr) {\n if (arr.length === 0) {\n return [];\n } else if (arr.length === 1) {\n return arr[0];\n } else {\n const result = [];\n const rest = this.permute(arr.slice(1));\n for (let i = 0; i < rest.length; i++) {\n for (let j = 0; j < arr[0].length; j++) {\n result.push([arr[0][j]].concat(rest[i]));\n }\n }\n return result;\n }\n },\n\n bubbleSelectors(selectors) {\n if (!selectors) {\n return;\n }\n this.rules = [new Ruleset(utils.copyArray(selectors), [this.rules[0]])];\n this.setParent(this.rules, this);\n }\n};\n\nexport default NestableAtRulePrototype;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport AtRule from './atrule';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst Media = function(value, features, index, currentFileInfo, visibilityInfo) {\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n};\n\nMedia.prototype = Object.assign(new AtRule(), {\n type: 'Media',\n\n ...NestableAtRulePrototype,\n\n genCSS(context, output) {\n output.add('@media ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n },\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n});\n\nexport default Media;\n","import Node from './node';\nimport Media from './media';\nimport URL from './url';\nimport Quoted from './quoted';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\nimport * as utils from '../utils';\nimport LessError from '../less-error';\n\n//\n// CSS @import node\n//\n// The general strategy here is that we don't want to wait\n// for the parsing to be completed, before we start importing\n// the file. That's because in the context of a browser,\n// most of the time will be spent waiting for the server to respond.\n//\n// On creation, we push the import path to our import queue, though\n// `import,push`, we also pass it a callback, which it'll call once\n// the file has been fetched, and parsed.\n//\nconst Import = function(path, features, options, index, currentFileInfo, visibilityInfo) {\n this.options = options;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.path = path;\n this.features = features;\n this.allowRoot = true;\n\n if (this.options.less !== undefined || this.options.inline) {\n this.css = !this.options.less || this.options.inline;\n } else {\n const pathValue = this.getPath();\n if (pathValue && /[#.&?]css([?;].*)?$/.test(pathValue)) {\n this.css = true;\n }\n }\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.features, this);\n this.setParent(this.path, this);\n};\n\nImport.prototype = Object.assign(new Node(), {\n type: 'Import',\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n this.path = visitor.visit(this.path);\n if (!this.options.isPlugin && !this.options.inline && this.root) {\n this.root = visitor.visit(this.root);\n }\n },\n\n genCSS(context, output) {\n if (this.css && this.path._fileInfo.reference === undefined) {\n output.add('@import ', this._fileInfo, this._index);\n this.path.genCSS(context, output);\n if (this.features) {\n output.add(' ');\n this.features.genCSS(context, output);\n }\n output.add(';');\n }\n },\n\n getPath() {\n return (this.path instanceof URL) ?\n this.path.value.value : this.path.value;\n },\n\n isVariableImport() {\n let path = this.path;\n if (path instanceof URL) {\n path = path.value;\n }\n if (path instanceof Quoted) {\n return path.containsVariables();\n }\n\n return true;\n },\n\n evalForImport(context) {\n let path = this.path;\n\n if (path instanceof URL) {\n path = path.value;\n }\n\n return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo());\n },\n\n evalPath(context) {\n const path = this.path.eval(context);\n const fileInfo = this._fileInfo;\n\n if (!(path instanceof URL)) {\n // Add the rootpath if the URL requires a rewrite\n const pathValue = path.value;\n if (fileInfo &&\n pathValue &&\n context.pathRequiresRewrite(pathValue)) {\n path.value = context.rewritePath(pathValue, fileInfo.rootpath);\n } else {\n path.value = context.normalizePath(path.value);\n }\n }\n\n return path;\n },\n\n eval(context) {\n const result = this.doEval(context);\n if (this.options.reference || this.blocksVisibility()) {\n if (result.length || result.length === 0) {\n result.forEach(function (node) {\n node.addVisibilityBlock();\n }\n );\n } else {\n result.addVisibilityBlock();\n }\n }\n return result;\n },\n\n doEval(context) {\n let ruleset;\n let registry;\n const features = this.features && this.features.eval(context);\n\n if (this.options.isPlugin) {\n if (this.root && this.root.eval) {\n try {\n this.root.eval(context);\n }\n catch (e) {\n e.message = 'Plugin error during evaluation';\n throw new LessError(e, this.root.imports, this.root.filename);\n }\n }\n registry = context.frames[0] && context.frames[0].functionRegistry;\n if ( registry && this.root && this.root.functions ) {\n registry.addMultiple( this.root.functions );\n }\n\n return [];\n }\n\n if (this.skip) {\n if (typeof this.skip === 'function') {\n this.skip = this.skip();\n }\n if (this.skip) {\n return [];\n }\n }\n if (this.options.inline) {\n const contents = new Anonymous(this.root, 0,\n {\n filename: this.importedFilename,\n reference: this.path._fileInfo && this.path._fileInfo.reference\n }, true, true);\n\n return this.features ? new Media([contents], this.features.value) : [contents];\n } else if (this.css) {\n const newImport = new Import(this.evalPath(context), features, this.options, this._index);\n if (!newImport.css && this.error) {\n throw this.error;\n }\n return newImport;\n } else if (this.root) {\n ruleset = new Ruleset(null, utils.copyArray(this.root.rules));\n ruleset.evalImports(context);\n\n return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules;\n } else {\n return [];\n }\n }\n});\n\nexport default Import;\n","import Node from './node';\nimport Variable from './variable';\n\nconst JsEvalNode = function() {};\n\nJsEvalNode.prototype = Object.assign(new Node(), {\n evaluateJavaScript(expression, context) {\n let result;\n const that = this;\n const evalContext = {};\n\n if (!context.javascriptEnabled) {\n throw { message: 'Inline JavaScript is not enabled. Is it set in your options?',\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n expression = expression.replace(/@\\{([\\w-]+)\\}/g, function (_, name) {\n return that.jsify(new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context));\n });\n\n try {\n expression = new Function(`return (${expression})`);\n } catch (e) {\n throw { message: `JavaScript evaluation error: ${e.message} from \\`${expression}\\`` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n const variables = context.frames[0].variables();\n for (const k in variables) {\n // eslint-disable-next-line no-prototype-builtins\n if (variables.hasOwnProperty(k)) {\n evalContext[k.slice(1)] = {\n value: variables[k].value,\n toJS: function () {\n return this.value.eval(context).toCSS();\n }\n };\n }\n }\n\n try {\n result = expression.call(evalContext);\n } catch (e) {\n throw { message: `JavaScript evaluation error: '${e.name}: ${e.message.replace(/[\"]/g, '\\'')}'` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n return result;\n },\n\n jsify(obj) {\n if (Array.isArray(obj.value) && (obj.value.length > 1)) {\n return `[${obj.value.map(function (v) { return v.toCSS(); }).join(', ')}]`;\n } else {\n return obj.toCSS();\n }\n }\n});\n\nexport default JsEvalNode;\n","import JsEvalNode from './js-eval-node';\nimport Dimension from './dimension';\nimport Quoted from './quoted';\nimport Anonymous from './anonymous';\n\nconst JavaScript = function(string, escaped, index, currentFileInfo) {\n this.escaped = escaped;\n this.expression = string;\n this._index = index;\n this._fileInfo = currentFileInfo;\n}\n\nJavaScript.prototype = Object.assign(new JsEvalNode(), {\n type: 'JavaScript',\n\n eval(context) {\n const result = this.evaluateJavaScript(this.expression, context);\n const type = typeof result;\n\n if (type === 'number' && !isNaN(result)) {\n return new Dimension(result);\n } else if (type === 'string') {\n return new Quoted(`\"${result}\"`, result, this.escaped, this._index);\n } else if (Array.isArray(result)) {\n return new Anonymous(result.join(', '));\n } else {\n return new Anonymous(result);\n }\n }\n});\n\nexport default JavaScript;\n","import Node from './node';\n\nconst Assignment = function(key, val) {\n this.key = key;\n this.value = val;\n}\n\nAssignment.prototype = Object.assign(new Node(), {\n type: 'Assignment',\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n },\n\n eval(context) {\n if (this.value.eval) {\n return new Assignment(this.key, this.value.eval(context));\n }\n return this;\n },\n\n genCSS(context, output) {\n output.add(`${this.key}=`);\n if (this.value.genCSS) {\n this.value.genCSS(context, output);\n } else {\n output.add(this.value);\n }\n }\n});\n\nexport default Assignment;\n","import Node from './node';\n\nconst Condition = function(op, l, r, i, negate) {\n this.op = op.trim();\n this.lvalue = l;\n this.rvalue = r;\n this._index = i;\n this.negate = negate;\n};\n\nCondition.prototype = Object.assign(new Node(), {\n type: 'Condition',\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.rvalue = visitor.visit(this.rvalue);\n },\n\n eval(context) {\n const result = (function (op, a, b) {\n switch (op) {\n case 'and': return a && b;\n case 'or': return a || b;\n default:\n switch (Node.compare(a, b)) {\n case -1:\n return op === '<' || op === '=<' || op === '<=';\n case 0:\n return op === '=' || op === '>=' || op === '=<' || op === '<=';\n case 1:\n return op === '>' || op === '>=';\n default:\n return false;\n }\n }\n })(this.op, this.lvalue.eval(context), this.rvalue.eval(context));\n\n return this.negate ? !result : result;\n }\n});\n\nexport default Condition;\n","import Node from './node';\n\nconst QueryInParens = function (op, l, m, op2, r, i) {\n this.op = op.trim();\n this.lvalue = l;\n this.mvalue = m;\n this.op2 = op2 ? op2.trim() : null;\n this.rvalue = r;\n this._index = i;\n};\n\nQueryInParens.prototype = Object.assign(new Node(), {\n type: 'QueryInParens',\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.mvalue = visitor.visit(this.mvalue);\n if (this.rvalue) {\n this.rvalue = visitor.visit(this.rvalue);\n }\n },\n\n eval(context) {\n this.lvalue = this.lvalue.eval(context);\n this.mvalue = this.mvalue.eval(context);\n if (this.rvalue) {\n this.rvalue = this.rvalue.eval(context);\n }\n return this;\n },\n\n genCSS(context, output) {\n this.lvalue.genCSS(context, output);\n output.add(' ' + this.op + ' ');\n this.mvalue.genCSS(context, output);\n if (this.rvalue) {\n output.add(' ' + this.op2 + ' ');\n this.rvalue.genCSS(context, output);\n }\n },\n});\n\nexport default QueryInParens;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport AtRule from './atrule';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst Container = function(value, features, index, currentFileInfo, visibilityInfo) {\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n};\n\nContainer.prototype = Object.assign(new AtRule(), {\n type: 'Container',\n\n ...NestableAtRulePrototype,\n\n genCSS(context, output) {\n output.add('@container ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n },\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Container(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n});\n\nexport default Container;\n","import Node from './node';\n\nconst UnicodeDescriptor = function(value) {\n this.value = value;\n}\n\nUnicodeDescriptor.prototype = Object.assign(new Node(), {\n type: 'UnicodeDescriptor'\n})\n\nexport default UnicodeDescriptor;\n","import Node from './node';\nimport Operation from './operation';\nimport Dimension from './dimension';\n\nconst Negative = function(node) {\n this.value = node;\n};\n\nNegative.prototype = Object.assign(new Node(), {\n type: 'Negative',\n\n genCSS(context, output) {\n output.add('-');\n this.value.genCSS(context, output);\n },\n\n eval(context) {\n if (context.isMathOn()) {\n return (new Operation('*', [new Dimension(-1), this.value])).eval(context);\n }\n return new Negative(this.value.eval(context));\n }\n});\n\nexport default Negative;\n","import Node from './node';\nimport Selector from './selector';\n\nconst Extend = function(selector, option, index, currentFileInfo, visibilityInfo) {\n this.selector = selector;\n this.option = option;\n this.object_id = Extend.next_id++;\n this.parent_ids = [this.object_id];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n switch (option) {\n case 'all':\n this.allowBefore = true;\n this.allowAfter = true;\n break;\n default:\n this.allowBefore = false;\n this.allowAfter = false;\n break;\n }\n this.setParent(this.selector, this);\n};\n\nExtend.prototype = Object.assign(new Node(), {\n type: 'Extend',\n\n accept(visitor) {\n this.selector = visitor.visit(this.selector);\n },\n\n eval(context) {\n return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n // remove when Nodes have JSDoc types\n // eslint-disable-next-line no-unused-vars\n clone(context) {\n return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n // it concatenates (joins) all selectors in selector array\n findSelfSelectors(selectors) {\n let selfElements = [], i, selectorElements;\n\n for (i = 0; i < selectors.length; i++) {\n selectorElements = selectors[i].elements;\n // duplicate the logic in genCSS function inside the selector node.\n // future TODO - move both logics into the selector joiner visitor\n if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') {\n selectorElements[0].combinator.value = ' ';\n }\n selfElements = selfElements.concat(selectors[i].elements);\n }\n\n this.selfSelectors = [new Selector(selfElements)];\n this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo());\n }\n});\n\nExtend.next_id = 0;\nexport default Extend;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport DetachedRuleset from './detached-ruleset';\nimport LessError from '../less-error';\n\nconst VariableCall = function(variable, index, currentFileInfo) {\n this.variable = variable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n};\n\nVariableCall.prototype = Object.assign(new Node(), {\n type: 'VariableCall',\n\n eval(context) {\n let rules;\n let detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context);\n const error = new LessError({message: `Could not evaluate variable call ${this.variable}`});\n\n if (!detachedRuleset.ruleset) {\n if (detachedRuleset.rules) {\n rules = detachedRuleset;\n }\n else if (Array.isArray(detachedRuleset)) {\n rules = new Ruleset('', detachedRuleset);\n }\n else if (Array.isArray(detachedRuleset.value)) {\n rules = new Ruleset('', detachedRuleset.value);\n }\n else {\n throw error;\n }\n detachedRuleset = new DetachedRuleset(rules);\n }\n\n if (detachedRuleset.ruleset) {\n return detachedRuleset.callEval(context);\n }\n throw error;\n }\n});\n\nexport default VariableCall;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport Selector from './selector';\n\nconst NamespaceValue = function(ruleCall, lookups, index, fileInfo) {\n this.value = ruleCall;\n this.lookups = lookups;\n this._index = index;\n this._fileInfo = fileInfo;\n};\n\nNamespaceValue.prototype = Object.assign(new Node(), {\n type: 'NamespaceValue',\n\n eval(context) {\n let i, name, rules = this.value.eval(context);\n \n for (i = 0; i < this.lookups.length; i++) {\n name = this.lookups[i];\n\n /**\n * Eval'd DRs return rulesets.\n * Eval'd mixins return rules, so let's make a ruleset if we need it.\n * We need to do this because of late parsing of values\n */\n if (Array.isArray(rules)) {\n rules = new Ruleset([new Selector()], rules);\n }\n\n if (name === '') {\n rules = rules.lastDeclaration();\n }\n else if (name.charAt(0) === '@') {\n if (name.charAt(1) === '@') {\n name = `@${new Variable(name.substr(1)).eval(context).value}`;\n }\n if (rules.variables) {\n rules = rules.variable(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `variable ${name} not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n }\n else {\n if (name.substring(0, 2) === '$@') {\n name = `$${new Variable(name.substr(1)).eval(context).value}`;\n }\n else {\n name = name.charAt(0) === '$' ? name : `$${name}`;\n }\n if (rules.properties) {\n rules = rules.property(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `property \"${name.substr(1)}\" not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n // Properties are an array of values, since a ruleset can have multiple props.\n // We pick the last one (the \"cascaded\" value)\n rules = rules[rules.length - 1];\n }\n\n if (rules.value) {\n rules = rules.eval(context).value;\n }\n if (rules.ruleset) {\n rules = rules.ruleset.eval(context);\n }\n }\n return rules;\n }\n});\n\nexport default NamespaceValue;\n","import Selector from './selector';\nimport Element from './element';\nimport Ruleset from './ruleset';\nimport Declaration from './declaration';\nimport DetachedRuleset from './detached-ruleset';\nimport Expression from './expression';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nconst Definition = function(name, params, rules, condition, variadic, frames, visibilityInfo) {\n this.name = name || 'anonymous mixin';\n this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])];\n this.params = params;\n this.condition = condition;\n this.variadic = variadic;\n this.arity = params.length;\n this.rules = rules;\n this._lookups = {};\n const optionalParameters = [];\n this.required = params.reduce(function (count, p) {\n if (!p.name || (p.name && !p.value)) {\n return count + 1;\n }\n else {\n optionalParameters.push(p.name);\n return count;\n }\n }, 0);\n this.optionalParameters = optionalParameters;\n this.frames = frames;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n}\n\nDefinition.prototype = Object.assign(new Ruleset(), {\n type: 'MixinDefinition',\n evalFirst: true,\n\n accept(visitor) {\n if (this.params && this.params.length) {\n this.params = visitor.visitArray(this.params);\n }\n this.rules = visitor.visitArray(this.rules);\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n },\n\n evalParams(context, mixinEnv, args, evaldArguments) {\n /* jshint boss:true */\n const frame = new Ruleset(null, null);\n\n let varargs;\n let arg;\n const params = utils.copyArray(this.params);\n let i;\n let j;\n let val;\n let name;\n let isNamedFound;\n let argIndex;\n let argsLength = 0;\n\n if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) {\n frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit();\n }\n mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames));\n\n if (args) {\n args = utils.copyArray(args);\n argsLength = args.length;\n\n for (i = 0; i < argsLength; i++) {\n arg = args[i];\n if (name = (arg && arg.name)) {\n isNamedFound = false;\n for (j = 0; j < params.length; j++) {\n if (!evaldArguments[j] && name === params[j].name) {\n evaldArguments[j] = arg.value.eval(context);\n frame.prependRule(new Declaration(name, arg.value.eval(context)));\n isNamedFound = true;\n break;\n }\n }\n if (isNamedFound) {\n args.splice(i, 1);\n i--;\n continue;\n } else {\n throw { type: 'Runtime', message: `Named argument for ${this.name} ${args[i].name} not found` };\n }\n }\n }\n }\n argIndex = 0;\n for (i = 0; i < params.length; i++) {\n if (evaldArguments[i]) { continue; }\n\n arg = args && args[argIndex];\n\n if (name = params[i].name) {\n if (params[i].variadic) {\n varargs = [];\n for (j = argIndex; j < argsLength; j++) {\n varargs.push(args[j].value.eval(context));\n }\n frame.prependRule(new Declaration(name, new Expression(varargs).eval(context)));\n } else {\n val = arg && arg.value;\n if (val) {\n // This was a mixin call, pass in a detached ruleset of it's eval'd rules\n if (Array.isArray(val)) {\n val = new DetachedRuleset(new Ruleset('', val));\n }\n else {\n val = val.eval(context);\n }\n } else if (params[i].value) {\n val = params[i].value.eval(mixinEnv);\n frame.resetCache();\n } else {\n throw { type: 'Runtime', message: `wrong number of arguments for ${this.name} (${argsLength} for ${this.arity})` };\n }\n\n frame.prependRule(new Declaration(name, val));\n evaldArguments[i] = val;\n }\n }\n\n if (params[i].variadic && args) {\n for (j = argIndex; j < argsLength; j++) {\n evaldArguments[j] = args[j].value.eval(context);\n }\n }\n argIndex++;\n }\n\n return frame;\n },\n\n makeImportant() {\n const rules = !this.rules ? this.rules : this.rules.map(function (r) {\n if (r.makeImportant) {\n return r.makeImportant(true);\n } else {\n return r;\n }\n });\n const result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames);\n return result;\n },\n\n eval(context) {\n return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || utils.copyArray(context.frames));\n },\n\n evalCall(context, args, important) {\n const _arguments = [];\n const mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames;\n const frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments);\n let rules;\n let ruleset;\n\n frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context)));\n\n rules = utils.copyArray(this.rules);\n\n ruleset = new Ruleset(null, rules);\n ruleset.originalRuleset = this;\n ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames)));\n if (important) {\n ruleset = ruleset.makeImportant();\n }\n return ruleset;\n },\n\n matchCondition(args, context) {\n if (this.condition && !this.condition.eval(\n new contexts.Eval(context,\n [this.evalParams(context, /* the parameter variables */\n new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])]\n .concat(this.frames || []) // the parent namespace/mixin frames\n .concat(context.frames)))) { // the current environment frames\n return false;\n }\n return true;\n },\n\n matchArgs(args, context) {\n const allArgsCnt = (args && args.length) || 0;\n let len;\n const optionalParameters = this.optionalParameters;\n const requiredArgsCnt = !args ? 0 : args.reduce(function (count, p) {\n if (optionalParameters.indexOf(p.name) < 0) {\n return count + 1;\n } else {\n return count;\n }\n }, 0);\n\n if (!this.variadic) {\n if (requiredArgsCnt < this.required) {\n return false;\n }\n if (allArgsCnt > this.params.length) {\n return false;\n }\n } else {\n if (requiredArgsCnt < (this.required - 1)) {\n return false;\n }\n }\n\n // check patterns\n len = Math.min(requiredArgsCnt, this.arity);\n\n for (let i = 0; i < len; i++) {\n if (!this.params[i].name && !this.params[i].variadic) {\n if (args[i].value.eval(context).toCSS() != this.params[i].value.eval(context).toCSS()) {\n return false;\n }\n }\n }\n return true;\n }\n});\n\nexport default Definition;\n","import Node from './node';\nimport Selector from './selector';\nimport MixinDefinition from './mixin-definition';\nimport defaultFunc from '../functions/default';\n\nconst MixinCall = function(elements, args, index, currentFileInfo, important) {\n this.selector = new Selector(elements);\n this.arguments = args || [];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.important = important;\n this.allowRoot = true;\n this.setParent(this.selector, this);\n};\n\nMixinCall.prototype = Object.assign(new Node(), {\n type: 'MixinCall',\n\n accept(visitor) {\n if (this.selector) {\n this.selector = visitor.visit(this.selector);\n }\n if (this.arguments.length) {\n this.arguments = visitor.visitArray(this.arguments);\n }\n },\n\n eval(context) {\n let mixins;\n let mixin;\n let mixinPath;\n const args = [];\n let arg;\n let argValue;\n const rules = [];\n let match = false;\n let i;\n let m;\n let f;\n let isRecursive;\n let isOneFound;\n const candidates = [];\n let candidate;\n const conditionResult = [];\n let defaultResult;\n const defFalseEitherCase = -1;\n const defNone = 0;\n const defTrue = 1;\n const defFalse = 2;\n let count;\n let originalRuleset;\n let noArgumentsFilter;\n\n this.selector = this.selector.eval(context);\n\n function calcDefGroup(mixin, mixinPath) {\n let f, p, namespace;\n\n for (f = 0; f < 2; f++) {\n conditionResult[f] = true;\n defaultFunc.value(f);\n for (p = 0; p < mixinPath.length && conditionResult[f]; p++) {\n namespace = mixinPath[p];\n if (namespace.matchCondition) {\n conditionResult[f] = conditionResult[f] && namespace.matchCondition(null, context);\n }\n }\n if (mixin.matchCondition) {\n conditionResult[f] = conditionResult[f] && mixin.matchCondition(args, context);\n }\n }\n if (conditionResult[0] || conditionResult[1]) {\n if (conditionResult[0] != conditionResult[1]) {\n return conditionResult[1] ?\n defTrue : defFalse;\n }\n\n return defNone;\n }\n return defFalseEitherCase;\n }\n\n for (i = 0; i < this.arguments.length; i++) {\n arg = this.arguments[i];\n argValue = arg.value.eval(context);\n if (arg.expand && Array.isArray(argValue.value)) {\n argValue = argValue.value;\n for (m = 0; m < argValue.length; m++) {\n args.push({value: argValue[m]});\n }\n } else {\n args.push({name: arg.name, value: argValue});\n }\n }\n\n noArgumentsFilter = function(rule) {return rule.matchArgs(null, context);};\n\n for (i = 0; i < context.frames.length; i++) {\n if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) {\n isOneFound = true;\n\n // To make `default()` function independent of definition order we have two \"subpasses\" here.\n // At first we evaluate each guard *twice* (with `default() == true` and `default() == false`),\n // and build candidate list with corresponding flags. Then, when we know all possible matches,\n // we make a final decision.\n\n for (m = 0; m < mixins.length; m++) {\n mixin = mixins[m].rule;\n mixinPath = mixins[m].path;\n isRecursive = false;\n for (f = 0; f < context.frames.length; f++) {\n if ((!(mixin instanceof MixinDefinition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) {\n isRecursive = true;\n break;\n }\n }\n if (isRecursive) {\n continue;\n }\n\n if (mixin.matchArgs(args, context)) {\n candidate = {mixin, group: calcDefGroup(mixin, mixinPath)};\n\n if (candidate.group !== defFalseEitherCase) {\n candidates.push(candidate);\n }\n\n match = true;\n }\n }\n\n defaultFunc.reset();\n\n count = [0, 0, 0];\n for (m = 0; m < candidates.length; m++) {\n count[candidates[m].group]++;\n }\n\n if (count[defNone] > 0) {\n defaultResult = defFalse;\n } else {\n defaultResult = defTrue;\n if ((count[defTrue] + count[defFalse]) > 1) {\n throw { type: 'Runtime',\n message: `Ambiguous use of \\`default()\\` found when matching for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n }\n\n for (m = 0; m < candidates.length; m++) {\n candidate = candidates[m].group;\n if ((candidate === defNone) || (candidate === defaultResult)) {\n try {\n mixin = candidates[m].mixin;\n if (!(mixin instanceof MixinDefinition)) {\n originalRuleset = mixin.originalRuleset || mixin;\n mixin = new MixinDefinition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo());\n mixin.originalRuleset = originalRuleset;\n }\n const newRules = mixin.evalCall(context, args, this.important).rules;\n this._setVisibilityToReplacement(newRules);\n Array.prototype.push.apply(rules, newRules);\n } catch (e) {\n throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack };\n }\n }\n }\n\n if (match) {\n return rules;\n }\n }\n }\n if (isOneFound) {\n throw { type: 'Runtime',\n message: `No matching definition was found for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n } else {\n throw { type: 'Name',\n message: `${this.selector.toCSS().trim()} is undefined`,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n },\n\n _setVisibilityToReplacement(replacement) {\n let i, rule;\n if (this.blocksVisibility()) {\n for (i = 0; i < replacement.length; i++) {\n rule = replacement[i];\n rule.addVisibilityBlock();\n }\n }\n },\n\n format(args) {\n return `${this.selector.toCSS().trim()}(${args ? args.map(function (a) {\n let argValue = '';\n if (a.name) {\n argValue += `${a.name}:`;\n }\n if (a.value.toCSS) {\n argValue += a.value.toCSS();\n } else {\n argValue += '???';\n }\n return argValue;\n }).join(', ') : ''})`;\n }\n});\n\nexport default MixinCall;\n","import Node from './node';\nimport Color from './color';\nimport AtRule from './atrule';\nimport DetachedRuleset from './detached-ruleset';\nimport Operation from './operation';\nimport Dimension from './dimension';\nimport Unit from './unit';\nimport Keyword from './keyword';\nimport Variable from './variable';\nimport Property from './property';\nimport Ruleset from './ruleset';\nimport Element from './element';\nimport Attribute from './attribute';\nimport Combinator from './combinator';\nimport Selector from './selector';\nimport Quoted from './quoted';\nimport Expression from './expression';\nimport Declaration from './declaration';\nimport Call from './call';\nimport URL from './url';\nimport Import from './import';\nimport Comment from './comment';\nimport Anonymous from './anonymous';\nimport Value from './value';\nimport JavaScript from './javascript';\nimport Assignment from './assignment';\nimport Condition from './condition';\nimport QueryInParens from './query-in-parens';\nimport Paren from './paren';\nimport Media from './media';\nimport Container from './container';\nimport UnicodeDescriptor from './unicode-descriptor';\nimport Negative from './negative';\nimport Extend from './extend';\nimport VariableCall from './variable-call';\nimport NamespaceValue from './namespace-value';\n\n// mixins\nimport MixinCall from './mixin-call';\nimport MixinDefinition from './mixin-definition';\n\nexport default {\n Node, Color, AtRule, DetachedRuleset, Operation,\n Dimension, Unit, Keyword, Variable, Property,\n Ruleset, Element, Attribute, Combinator, Selector,\n Quoted, Expression, Declaration, Call, URL, Import,\n Comment, Anonymous, Value, JavaScript, Assignment,\n Condition, Paren, Media, Container, QueryInParens, \n UnicodeDescriptor, Negative, Extend, VariableCall, \n NamespaceValue,\n mixin: {\n Call: MixinCall,\n Definition: MixinDefinition\n }\n};","class AbstractFileManager {\n getPath(filename) {\n let j = filename.lastIndexOf('?');\n if (j > 0) {\n filename = filename.slice(0, j);\n }\n j = filename.lastIndexOf('/');\n if (j < 0) {\n j = filename.lastIndexOf('\\\\');\n }\n if (j < 0) {\n return '';\n }\n return filename.slice(0, j + 1);\n }\n\n tryAppendExtension(path, ext) {\n return /(\\.[a-z]*$)|([?;].*)$/.test(path) ? path : path + ext;\n }\n\n tryAppendLessExtension(path) {\n return this.tryAppendExtension(path, '.less');\n }\n\n supportsSync() {\n return false;\n }\n\n alwaysMakePathsAbsolute() {\n return false;\n }\n\n isPathAbsolute(filename) {\n return (/^(?:[a-z-]+:|\\/|\\\\|#)/i).test(filename);\n }\n\n // TODO: pull out / replace?\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return basePath + laterPath;\n }\n\n pathDiff(url, baseUrl) {\n // diff between two paths to create a relative path\n\n const urlParts = this.extractUrlParts(url);\n\n const baseUrlParts = this.extractUrlParts(baseUrl);\n let i;\n let max;\n let urlDirectories;\n let baseUrlDirectories;\n let diff = '';\n if (urlParts.hostPart !== baseUrlParts.hostPart) {\n return '';\n }\n max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);\n for (i = 0; i < max; i++) {\n if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; }\n }\n baseUrlDirectories = baseUrlParts.directories.slice(i);\n urlDirectories = urlParts.directories.slice(i);\n for (i = 0; i < baseUrlDirectories.length - 1; i++) {\n diff += '../';\n }\n for (i = 0; i < urlDirectories.length - 1; i++) {\n diff += `${urlDirectories[i]}/`;\n }\n return diff;\n }\n\n /**\n * Helper function, not part of API.\n * This should be replaceable by newer Node / Browser APIs\n * \n * @param {string} url \n * @param {string} baseUrl\n */\n extractUrlParts(url, baseUrl) {\n // urlParts[1] = protocol://hostname/ OR /\n // urlParts[2] = / if path relative to host base\n // urlParts[3] = directories\n // urlParts[4] = filename\n // urlParts[5] = parameters\n\n const urlPartsRegex = /^((?:[a-z-]+:)?\\/{2}(?:[^/?#]*\\/)|([/\\\\]))?((?:[^/\\\\?#]*[/\\\\])*)([^/\\\\?#]*)([#?].*)?$/i;\n\n const urlParts = url.match(urlPartsRegex);\n const returner = {};\n let rawDirectories = [];\n const directories = [];\n let i;\n let baseUrlParts;\n\n if (!urlParts) {\n throw new Error(`Could not parse sheet href - '${url}'`);\n }\n\n // Stylesheets in IE don't always return the full path\n if (baseUrl && (!urlParts[1] || urlParts[2])) {\n baseUrlParts = baseUrl.match(urlPartsRegex);\n if (!baseUrlParts) {\n throw new Error(`Could not parse page url - '${baseUrl}'`);\n }\n urlParts[1] = urlParts[1] || baseUrlParts[1] || '';\n if (!urlParts[2]) {\n urlParts[3] = baseUrlParts[3] + urlParts[3];\n }\n }\n\n if (urlParts[3]) {\n rawDirectories = urlParts[3].replace(/\\\\/g, '/').split('/');\n\n // collapse '..' and skip '.'\n for (i = 0; i < rawDirectories.length; i++) {\n\n if (rawDirectories[i] === '..') {\n directories.pop();\n }\n else if (rawDirectories[i] !== '.') {\n directories.push(rawDirectories[i]);\n }\n \n }\n }\n\n returner.hostPart = urlParts[1];\n returner.directories = directories;\n returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/');\n returner.path = (urlParts[1] || '') + directories.join('/');\n returner.filename = urlParts[4];\n returner.fileUrl = returner.path + (urlParts[4] || '');\n returner.url = returner.fileUrl + (urlParts[5] || '');\n return returner;\n }\n}\n\nexport default AbstractFileManager;\n","import functionRegistry from '../functions/function-registry';\nimport LessError from '../less-error';\n\nclass AbstractPluginLoader {\n constructor() {\n // Implemented by Node.js plugin loader\n this.require = function() {\n return null;\n }\n }\n\n evalPlugin(contents, context, imports, pluginOptions, fileInfo) {\n\n let loader, registry, pluginObj, localModule, pluginManager, filename, result;\n\n pluginManager = context.pluginManager;\n\n if (fileInfo) {\n if (typeof fileInfo === 'string') {\n filename = fileInfo;\n }\n else {\n filename = fileInfo.filename;\n }\n }\n const shortname = (new this.less.FileManager()).extractUrlParts(filename).filename;\n\n if (filename) {\n pluginObj = pluginManager.get(filename);\n\n if (pluginObj) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n return pluginObj;\n }\n }\n localModule = {\n exports: {},\n pluginManager,\n fileInfo\n };\n registry = functionRegistry.create();\n\n const registerPlugin = function(obj) {\n pluginObj = obj;\n };\n\n try {\n loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents);\n loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo);\n }\n catch (e) {\n return new LessError(e, imports, filename);\n }\n\n if (!pluginObj) {\n pluginObj = localModule.exports;\n }\n pluginObj = this.validatePlugin(pluginObj, filename, shortname);\n\n if (pluginObj instanceof LessError) {\n return pluginObj;\n }\n\n if (pluginObj) {\n pluginObj.imports = imports;\n pluginObj.filename = filename;\n\n // For < 3.x (or unspecified minVersion) - setOptions() before install()\n if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n\n if (result) {\n return result;\n }\n }\n\n // Run on first load\n pluginManager.addPlugin(pluginObj, fileInfo.filename, registry);\n pluginObj.functions = registry.getLocalFunctions();\n\n // Need to call setOptions again because the pluginObj might have functions\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n\n // Run every @plugin call\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n\n }\n else {\n return new LessError({ message: 'Not a valid plugin' }, imports, filename);\n }\n\n return pluginObj;\n\n }\n\n trySetOptions(plugin, filename, name, options) {\n if (options && !plugin.setOptions) {\n return new LessError({\n message: `Options have been provided but the plugin ${name} does not support any options.`\n });\n }\n try {\n plugin.setOptions && plugin.setOptions(options);\n }\n catch (e) {\n return new LessError(e);\n }\n }\n\n validatePlugin(plugin, filename, name) {\n if (plugin) {\n // support plugins being a function\n // so that the plugin can be more usable programmatically\n if (typeof plugin === 'function') {\n plugin = new plugin();\n }\n\n if (plugin.minVersion) {\n if (this.compareVersion(plugin.minVersion, this.less.version) < 0) {\n return new LessError({\n message: `Plugin ${name} requires version ${this.versionToString(plugin.minVersion)}`\n });\n }\n }\n return plugin;\n }\n return null;\n }\n\n compareVersion(aVersion, bVersion) {\n if (typeof aVersion === 'string') {\n aVersion = aVersion.match(/^(\\d+)\\.?(\\d+)?\\.?(\\d+)?/);\n aVersion.shift();\n }\n for (let i = 0; i < aVersion.length; i++) {\n if (aVersion[i] !== bVersion[i]) {\n return parseInt(aVersion[i]) > parseInt(bVersion[i]) ? -1 : 1;\n }\n }\n return 0;\n }\n\n versionToString(version) {\n let versionString = '';\n for (let i = 0; i < version.length; i++) {\n versionString += (versionString ? '.' : '') + version[i];\n }\n return versionString;\n }\n\n printUsage(plugins) {\n for (let i = 0; i < plugins.length; i++) {\n const plugin = plugins[i];\n if (plugin.printUsage) {\n plugin.printUsage();\n }\n }\n }\n}\n\nexport default AbstractPluginLoader;\n\n","import Anonymous from '../tree/anonymous';\nimport Keyword from '../tree/keyword';\n\nfunction boolean(condition) {\n return condition ? Keyword.True : Keyword.False;\n}\n\n/**\n * Functions with evalArgs set to false are sent context\n * as the first argument.\n */\nfunction If(context, condition, trueValue, falseValue) {\n return condition.eval(context) ? trueValue.eval(context)\n : (falseValue ? falseValue.eval(context) : new Anonymous);\n}\nIf.evalArgs = false;\n\nfunction isdefined(context, variable) {\n try {\n variable.eval(context);\n return Keyword.True;\n } catch (e) {\n return Keyword.False;\n }\n}\n\nisdefined.evalArgs = false;\n\nexport default { isdefined, boolean, 'if': If };\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport Expression from '../tree/expression';\nimport Operation from '../tree/operation';\nlet colorFunctions;\n\nfunction clamp(val) {\n return Math.min(1, Math.max(0, val));\n}\nfunction hsla(origColor, hsl) {\n const color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a);\n if (color) {\n if (origColor.value && \n /^(rgb|hsl)/.test(origColor.value)) {\n color.value = origColor.value;\n } else {\n color.value = 'rgb';\n }\n return color;\n }\n}\nfunction toHSL(color) {\n if (color.toHSL) {\n return color.toHSL();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction toHSV(color) {\n if (color.toHSV) {\n return color.toHSV();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction number(n) {\n if (n instanceof Dimension) {\n return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);\n } else if (typeof n === 'number') {\n return n;\n } else {\n throw {\n type: 'Argument',\n message: 'color functions take numbers as parameters'\n };\n }\n}\nfunction scaled(n, size) {\n if (n instanceof Dimension && n.unit.is('%')) {\n return parseFloat(n.value * size / 100);\n } else {\n return number(n);\n }\n}\ncolorFunctions = {\n rgb: function (r, g, b) {\n let a = 1\n /**\n * Comma-less syntax\n * e.g. rgb(0 128 255 / 50%)\n */\n if (r instanceof Expression) {\n const val = r.value\n r = val[0]\n g = val[1]\n b = val[2]\n /** \n * @todo - should this be normalized in\n * function caller? Or parsed differently?\n */\n if (b instanceof Operation) {\n const op = b\n b = op.operands[0]\n a = op.operands[1]\n }\n }\n const color = colorFunctions.rgba(r, g, b, a);\n if (color) {\n color.value = 'rgb';\n return color;\n }\n },\n rgba: function (r, g, b, a) {\n try {\n if (r instanceof Color) {\n if (g) {\n a = number(g);\n } else {\n a = r.alpha;\n }\n return new Color(r.rgb, a, 'rgba');\n }\n const rgb = [r, g, b].map(c => scaled(c, 255));\n a = number(a);\n return new Color(rgb, a, 'rgba');\n }\n catch (e) {}\n },\n hsl: function (h, s, l) {\n let a = 1\n if (h instanceof Expression) {\n const val = h.value\n h = val[0]\n s = val[1]\n l = val[2]\n\n if (l instanceof Operation) {\n const op = l\n l = op.operands[0]\n a = op.operands[1]\n }\n }\n const color = colorFunctions.hsla(h, s, l, a);\n if (color) {\n color.value = 'hsl';\n return color;\n }\n },\n hsla: function (h, s, l, a) {\n let m1;\n let m2;\n\n function hue(h) {\n h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n else if (h * 2 < 1) {\n return m2;\n }\n else if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n else {\n return m1;\n }\n }\n\n try {\n if (h instanceof Color) {\n if (s) {\n a = number(s);\n } else {\n a = h.alpha;\n }\n return new Color(h.rgb, a, 'hsla');\n }\n\n h = (number(h) % 360) / 360;\n s = clamp(number(s));l = clamp(number(l));a = clamp(number(a));\n\n m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n m1 = l * 2 - m2;\n\n const rgb = [\n hue(h + 1 / 3) * 255,\n hue(h) * 255,\n hue(h - 1 / 3) * 255\n ];\n a = number(a);\n return new Color(rgb, a, 'hsla');\n }\n catch (e) {}\n },\n\n hsv: function(h, s, v) {\n return colorFunctions.hsva(h, s, v, 1.0);\n },\n\n hsva: function(h, s, v, a) {\n h = ((number(h) % 360) / 360) * 360;\n s = number(s);v = number(v);a = number(a);\n\n let i;\n let f;\n i = Math.floor((h / 60) % 6);\n f = (h / 60) - i;\n\n const vs = [v,\n v * (1 - s),\n v * (1 - f * s),\n v * (1 - (1 - f) * s)];\n const perm = [[0, 3, 1],\n [2, 0, 1],\n [1, 0, 3],\n [1, 2, 0],\n [3, 1, 0],\n [0, 1, 2]];\n\n return colorFunctions.rgba(vs[perm[i][0]] * 255,\n vs[perm[i][1]] * 255,\n vs[perm[i][2]] * 255,\n a);\n },\n\n hue: function (color) {\n return new Dimension(toHSL(color).h);\n },\n saturation: function (color) {\n return new Dimension(toHSL(color).s * 100, '%');\n },\n lightness: function (color) {\n return new Dimension(toHSL(color).l * 100, '%');\n },\n hsvhue: function(color) {\n return new Dimension(toHSV(color).h);\n },\n hsvsaturation: function (color) {\n return new Dimension(toHSV(color).s * 100, '%');\n },\n hsvvalue: function (color) {\n return new Dimension(toHSV(color).v * 100, '%');\n },\n red: function (color) {\n return new Dimension(color.rgb[0]);\n },\n green: function (color) {\n return new Dimension(color.rgb[1]);\n },\n blue: function (color) {\n return new Dimension(color.rgb[2]);\n },\n alpha: function (color) {\n return new Dimension(toHSL(color).a);\n },\n luma: function (color) {\n return new Dimension(color.luma() * color.alpha * 100, '%');\n },\n luminance: function (color) {\n const luminance =\n (0.2126 * color.rgb[0] / 255) +\n (0.7152 * color.rgb[1] / 255) +\n (0.0722 * color.rgb[2] / 255);\n\n return new Dimension(luminance * color.alpha * 100, '%');\n },\n saturate: function (color, amount, method) {\n // filter: saturate(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s += hsl.s * amount.value / 100;\n }\n else {\n hsl.s += amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n desaturate: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s -= hsl.s * amount.value / 100;\n }\n else {\n hsl.s -= amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n lighten: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l += hsl.l * amount.value / 100;\n }\n else {\n hsl.l += amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n darken: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l -= hsl.l * amount.value / 100;\n }\n else {\n hsl.l -= amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n fadein: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a += hsl.a * amount.value / 100;\n }\n else {\n hsl.a += amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fadeout: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a -= hsl.a * amount.value / 100;\n }\n else {\n hsl.a -= amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fade: function (color, amount) {\n const hsl = toHSL(color);\n\n hsl.a = amount.value / 100;\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n spin: function (color, amount) {\n const hsl = toHSL(color);\n const hue = (hsl.h + amount.value) % 360;\n\n hsl.h = hue < 0 ? 360 + hue : hue;\n\n return hsla(color, hsl);\n },\n //\n // Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein\n // http://sass-lang.com\n //\n mix: function (color1, color2, weight) {\n if (!weight) {\n weight = new Dimension(50);\n }\n const p = weight.value / 100.0;\n const w = p * 2 - 1;\n const a = toHSL(color1).a - toHSL(color2).a;\n\n const w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n const w2 = 1 - w1;\n\n const rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,\n color1.rgb[1] * w1 + color2.rgb[1] * w2,\n color1.rgb[2] * w1 + color2.rgb[2] * w2];\n\n const alpha = color1.alpha * p + color2.alpha * (1 - p);\n\n return new Color(rgb, alpha);\n },\n greyscale: function (color) {\n return colorFunctions.desaturate(color, new Dimension(100));\n },\n contrast: function (color, dark, light, threshold) {\n // filter: contrast(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n if (typeof light === 'undefined') {\n light = colorFunctions.rgba(255, 255, 255, 1.0);\n }\n if (typeof dark === 'undefined') {\n dark = colorFunctions.rgba(0, 0, 0, 1.0);\n }\n // Figure out which is actually light and dark:\n if (dark.luma() > light.luma()) {\n const t = light;\n light = dark;\n dark = t;\n }\n if (typeof threshold === 'undefined') {\n threshold = 0.43;\n } else {\n threshold = number(threshold);\n }\n if (color.luma() < threshold) {\n return light;\n } else {\n return dark;\n }\n },\n // Changes made in 2.7.0 - Reverted in 3.0.0\n // contrast: function (color, color1, color2, threshold) {\n // // Return which of `color1` and `color2` has the greatest contrast with `color`\n // // according to the standard WCAG contrast ratio calculation.\n // // http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n // // The threshold param is no longer used, in line with SASS.\n // // filter: contrast(3.2);\n // // should be kept as is, so check for color\n // if (!color.rgb) {\n // return null;\n // }\n // if (typeof color1 === 'undefined') {\n // color1 = colorFunctions.rgba(0, 0, 0, 1.0);\n // }\n // if (typeof color2 === 'undefined') {\n // color2 = colorFunctions.rgba(255, 255, 255, 1.0);\n // }\n // var contrast1, contrast2;\n // var luma = color.luma();\n // var luma1 = color1.luma();\n // var luma2 = color2.luma();\n // // Calculate contrast ratios for each color\n // if (luma > luma1) {\n // contrast1 = (luma + 0.05) / (luma1 + 0.05);\n // } else {\n // contrast1 = (luma1 + 0.05) / (luma + 0.05);\n // }\n // if (luma > luma2) {\n // contrast2 = (luma + 0.05) / (luma2 + 0.05);\n // } else {\n // contrast2 = (luma2 + 0.05) / (luma + 0.05);\n // }\n // if (contrast1 > contrast2) {\n // return color1;\n // } else {\n // return color2;\n // }\n // },\n argb: function (color) {\n return new Anonymous(color.toARGB());\n },\n color: function(c) {\n if ((c instanceof Quoted) &&\n (/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) {\n const val = c.value.slice(1);\n return new Color(val, undefined, `#${val}`);\n }\n if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) {\n c.value = undefined;\n return c;\n }\n throw {\n type: 'Argument',\n message: 'argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF'\n };\n },\n tint: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount);\n },\n shade: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount);\n }\n};\n\nexport default colorFunctions;\n","import Color from '../tree/color';\n\n// Color Blending\n// ref: http://www.w3.org/TR/compositing-1\n\nfunction colorBlend(mode, color1, color2) {\n const ab = color1.alpha; // result\n\n let // backdrop\n cb;\n\n const as = color2.alpha;\n\n let // source\n cs;\n\n let ar;\n let cr;\n const r = [];\n\n ar = as + ab * (1 - as);\n for (let i = 0; i < 3; i++) {\n cb = color1.rgb[i] / 255;\n cs = color2.rgb[i] / 255;\n cr = mode(cb, cs);\n if (ar) {\n cr = (as * cs + ab * (cb -\n as * (cb + cs - cr))) / ar;\n }\n r[i] = cr * 255;\n }\n\n return new Color(r, ar);\n}\n\nconst colorBlendModeFunctions = {\n multiply: function(cb, cs) {\n return cb * cs;\n },\n screen: function(cb, cs) {\n return cb + cs - cb * cs;\n },\n overlay: function(cb, cs) {\n cb *= 2;\n return (cb <= 1) ?\n colorBlendModeFunctions.multiply(cb, cs) :\n colorBlendModeFunctions.screen(cb - 1, cs);\n },\n softlight: function(cb, cs) {\n let d = 1;\n let e = cb;\n if (cs > 0.5) {\n e = 1;\n d = (cb > 0.25) ? Math.sqrt(cb)\n : ((16 * cb - 12) * cb + 4) * cb;\n }\n return cb - (1 - 2 * cs) * e * (d - cb);\n },\n hardlight: function(cb, cs) {\n return colorBlendModeFunctions.overlay(cs, cb);\n },\n difference: function(cb, cs) {\n return Math.abs(cb - cs);\n },\n exclusion: function(cb, cs) {\n return cb + cs - 2 * cb * cs;\n },\n\n // non-w3c functions:\n average: function(cb, cs) {\n return (cb + cs) / 2;\n },\n negation: function(cb, cs) {\n return 1 - Math.abs(cb + cs - 1);\n }\n};\n\nfor (const f in colorBlendModeFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (colorBlendModeFunctions.hasOwnProperty(f)) {\n colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]);\n }\n}\n\nexport default colorBlend;\n","import Comment from '../tree/comment';\nimport Node from '../tree/node';\nimport Dimension from '../tree/dimension';\nimport Declaration from '../tree/declaration';\nimport Expression from '../tree/expression';\nimport Ruleset from '../tree/ruleset';\nimport Selector from '../tree/selector';\nimport Element from '../tree/element';\nimport Quote from '../tree/quoted';\nimport Value from '../tree/value';\n\nconst getItemsFromNode = node => {\n // handle non-array values as an array of length 1\n // return 'undefined' if index is invalid\n const items = Array.isArray(node.value) ?\n node.value : Array(node);\n\n return items;\n};\n\nexport default {\n _SELF: function(n) {\n return n;\n },\n '~': function(...expr) {\n if (expr.length === 1) {\n return expr[0];\n }\n return new Value(expr);\n },\n extract: function(values, index) {\n // (1-based index)\n index = index.value - 1;\n\n return getItemsFromNode(values)[index];\n },\n length: function(values) {\n return new Dimension(getItemsFromNode(values).length);\n },\n /**\n * Creates a Less list of incremental values.\n * Modeled after Lodash's range function, also exists natively in PHP\n * \n * @param {Dimension} [start=1]\n * @param {Dimension} end - e.g. 10 or 10px - unit is added to output\n * @param {Dimension} [step=1] \n */\n range: function(start, end, step) {\n let from;\n let to;\n let stepValue = 1;\n const list = [];\n if (end) {\n to = end;\n from = start.value;\n if (step) {\n stepValue = step.value;\n }\n }\n else {\n from = 1;\n to = start;\n }\n\n for (let i = from; i <= to.value; i += stepValue) {\n list.push(new Dimension(i, to.unit));\n }\n\n return new Expression(list);\n },\n each: function(list, rs) {\n const rules = [];\n let newRules;\n let iterator;\n\n const tryEval = val => {\n if (val instanceof Node) {\n return val.eval(this.context);\n }\n return val;\n };\n\n if (list.value && !(list instanceof Quote)) {\n if (Array.isArray(list.value)) {\n iterator = list.value.map(tryEval);\n } else {\n iterator = [tryEval(list.value)];\n }\n } else if (list.ruleset) {\n iterator = tryEval(list.ruleset).rules;\n } else if (list.rules) {\n iterator = list.rules.map(tryEval);\n } else if (Array.isArray(list)) {\n iterator = list.map(tryEval);\n } else {\n iterator = [tryEval(list)];\n }\n\n let valueName = '@value';\n let keyName = '@key';\n let indexName = '@index';\n\n if (rs.params) {\n valueName = rs.params[0] && rs.params[0].name;\n keyName = rs.params[1] && rs.params[1].name;\n indexName = rs.params[2] && rs.params[2].name;\n rs = rs.rules;\n } else {\n rs = rs.ruleset;\n }\n\n for (let i = 0; i < iterator.length; i++) {\n let key;\n let value;\n const item = iterator[i];\n if (item instanceof Declaration) {\n key = typeof item.name === 'string' ? item.name : item.name[0].value;\n value = item.value;\n } else {\n key = new Dimension(i + 1);\n value = item;\n }\n\n if (item instanceof Comment) {\n continue;\n }\n\n newRules = rs.rules.slice(0);\n if (valueName) {\n newRules.push(new Declaration(valueName,\n value,\n false, false, this.index, this.currentFileInfo));\n }\n if (indexName) {\n newRules.push(new Declaration(indexName,\n new Dimension(i + 1),\n false, false, this.index, this.currentFileInfo));\n }\n if (keyName) {\n newRules.push(new Declaration(keyName,\n key,\n false, false, this.index, this.currentFileInfo));\n }\n\n rules.push(new Ruleset([ new(Selector)([ new Element('', '&') ]) ],\n newRules,\n rs.strictImports,\n rs.visibilityInfo()\n ));\n }\n\n return new Ruleset([ new(Selector)([ new Element('', '&') ]) ],\n rules,\n rs.strictImports,\n rs.visibilityInfo()\n ).eval(this.context);\n }\n};\n","import Dimension from '../tree/dimension';\n\nconst MathHelper = (fn, unit, n) => {\n if (!(n instanceof Dimension)) {\n throw { type: 'Argument', message: 'argument must be a number' };\n }\n if (unit === null) {\n unit = n.unit;\n } else {\n n = n.unify();\n }\n return new Dimension(fn(parseFloat(n.value)), unit);\n};\n\nexport default MathHelper;","import mathHelper from './math-helper.js';\n\nconst mathFunctions = {\n // name, unit\n ceil: null,\n floor: null,\n sqrt: null,\n abs: null,\n tan: '',\n sin: '',\n cos: '',\n atan: 'rad',\n asin: 'rad',\n acos: 'rad'\n};\n\nfor (const f in mathFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (mathFunctions.hasOwnProperty(f)) {\n mathFunctions[f] = mathHelper.bind(null, Math[f], mathFunctions[f]);\n }\n}\n\nmathFunctions.round = (n, f) => {\n const fraction = typeof f === 'undefined' ? 0 : f.value;\n return mathHelper(num => num.toFixed(fraction), null, n);\n};\n\nexport default mathFunctions;\n","import Dimension from '../tree/dimension';\nimport Anonymous from '../tree/anonymous';\nimport mathHelper from './math-helper.js';\n\nconst minMax = function (isMin, args) {\n args = Array.prototype.slice.call(args);\n switch (args.length) {\n case 0: throw { type: 'Argument', message: 'one or more arguments required' };\n }\n let i; // key is the unit.toString() for unified Dimension values,\n let j;\n let current;\n let currentUnified;\n let referenceUnified;\n let unit;\n let unitStatic;\n let unitClone;\n\n const // elems only contains original argument values.\n order = [];\n\n const values = {};\n // value is the index into the order array.\n for (i = 0; i < args.length; i++) {\n current = args[i];\n if (!(current instanceof Dimension)) {\n if (Array.isArray(args[i].value)) {\n Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));\n }\n continue;\n }\n currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();\n unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();\n unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic;\n unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone;\n j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit];\n if (j === undefined) {\n if (unitStatic !== undefined && unit !== unitStatic) {\n throw { type: 'Argument', message: 'incompatible types' };\n }\n values[unit] = order.length;\n order.push(current);\n continue;\n }\n referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify();\n if ( isMin && currentUnified.value < referenceUnified.value ||\n !isMin && currentUnified.value > referenceUnified.value) {\n order[j] = current;\n }\n }\n if (order.length == 1) {\n return order[0];\n }\n args = order.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');\n return new Anonymous(`${isMin ? 'min' : 'max'}(${args})`);\n};\n\nexport default {\n min: function(...args) {\n try {\n return minMax.call(this, true, args);\n } catch (e) {}\n },\n max: function(...args) {\n try {\n return minMax.call(this, false, args);\n } catch (e) {}\n },\n convert: function (val, unit) {\n return val.convertTo(unit.value);\n },\n pi: function () {\n return new Dimension(Math.PI);\n },\n mod: function(a, b) {\n return new Dimension(a.value % b.value, a.unit);\n },\n pow: function(x, y) {\n if (typeof x === 'number' && typeof y === 'number') {\n x = new Dimension(x);\n y = new Dimension(y);\n } else if (!(x instanceof Dimension) || !(y instanceof Dimension)) {\n throw { type: 'Argument', message: 'arguments must be numbers' };\n }\n\n return new Dimension(Math.pow(x.value, y.value), x.unit);\n },\n percentage: function (n) {\n const result = mathHelper(num => num * 100, '%', n);\n\n return result;\n }\n};\n","import Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport JavaScript from '../tree/javascript';\n\nexport default {\n e: function (str) {\n return new Quoted('\"', str instanceof JavaScript ? str.evaluated : str.value, true);\n },\n escape: function (str) {\n return new Anonymous(\n encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B')\n .replace(/\\(/g, '%28').replace(/\\)/g, '%29'));\n },\n replace: function (string, pattern, replacement, flags) {\n let result = string.value;\n replacement = (replacement.type === 'Quoted') ?\n replacement.value : replacement.toCSS();\n result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement);\n return new Quoted(string.quote || '', result, string.escaped);\n },\n '%': function (string /* arg, arg, ... */) {\n const args = Array.prototype.slice.call(arguments, 1);\n let result = string.value;\n\n for (let i = 0; i < args.length; i++) {\n /* jshint loopfunc:true */\n result = result.replace(/%[sda]/i, token => {\n const value = ((args[i].type === 'Quoted') &&\n token.match(/s/i)) ? args[i].value : args[i].toCSS();\n return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;\n });\n }\n result = result.replace(/%%/g, '%');\n return new Quoted(string.quote || '', result, string.escaped);\n }\n};\n","import Keyword from '../tree/keyword';\nimport DetachedRuleset from '../tree/detached-ruleset';\nimport Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport URL from '../tree/url';\nimport Operation from '../tree/operation';\n\nconst isa = (n, Type) => (n instanceof Type) ? Keyword.True : Keyword.False;\nconst isunit = (n, unit) => {\n if (unit === undefined) {\n throw { type: 'Argument', message: 'missing the required second argument to isunit.' };\n }\n unit = typeof unit.value === 'string' ? unit.value : unit;\n if (typeof unit !== 'string') {\n throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' };\n }\n return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False;\n};\n\nexport default {\n isruleset: function (n) {\n return isa(n, DetachedRuleset);\n },\n iscolor: function (n) {\n return isa(n, Color);\n },\n isnumber: function (n) {\n return isa(n, Dimension);\n },\n isstring: function (n) {\n return isa(n, Quoted);\n },\n iskeyword: function (n) {\n return isa(n, Keyword);\n },\n isurl: function (n) {\n return isa(n, URL);\n },\n ispixel: function (n) {\n return isunit(n, 'px');\n },\n ispercentage: function (n) {\n return isunit(n, '%');\n },\n isem: function (n) {\n return isunit(n, 'em');\n },\n isunit,\n unit: function (val, unit) {\n if (!(val instanceof Dimension)) {\n throw { type: 'Argument',\n message: `the first argument to unit must be a number${val instanceof Operation ? '. Have you forgotten parenthesis?' : ''}` };\n }\n if (unit) {\n if (unit instanceof Keyword) {\n unit = unit.value;\n } else {\n unit = unit.toCSS();\n }\n } else {\n unit = '';\n }\n return new Dimension(val.value, unit);\n },\n 'get-unit': function (n) {\n return new Anonymous(n.unit);\n }\n};\n","import functionRegistry from './function-registry';\nimport functionCaller from './function-caller';\n\nimport boolean from './boolean';\nimport defaultFunc from './default';\nimport color from './color';\nimport colorBlending from './color-blending';\nimport dataUri from './data-uri';\nimport list from './list';\nimport math from './math';\nimport number from './number';\nimport string from './string';\nimport svg from './svg';\nimport types from './types';\n\nexport default environment => {\n const functions = { functionRegistry, functionCaller };\n\n // register functions\n functionRegistry.addMultiple(boolean);\n functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc));\n functionRegistry.addMultiple(color);\n functionRegistry.addMultiple(colorBlending);\n functionRegistry.addMultiple(dataUri(environment));\n functionRegistry.addMultiple(list);\n functionRegistry.addMultiple(math);\n functionRegistry.addMultiple(number);\n functionRegistry.addMultiple(string);\n functionRegistry.addMultiple(svg(environment));\n functionRegistry.addMultiple(types);\n\n return functions;\n};\n","import Quoted from '../tree/quoted';\nimport URL from '../tree/url';\nimport * as utils from '../utils';\nimport logger from '../logger';\n\nexport default environment => {\n \n const fallback = (functionThis, node) => new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); \n\n return { 'data-uri': function(mimetypeNode, filePathNode) {\n\n if (!filePathNode) {\n filePathNode = mimetypeNode;\n mimetypeNode = null;\n }\n\n let mimetype = mimetypeNode && mimetypeNode.value;\n let filePath = filePathNode.value;\n const currentFileInfo = this.currentFileInfo;\n const currentDirectory = currentFileInfo.rewriteUrls ?\n currentFileInfo.currentDirectory : currentFileInfo.entryPath;\n\n const fragmentStart = filePath.indexOf('#');\n let fragment = '';\n if (fragmentStart !== -1) {\n fragment = filePath.slice(fragmentStart);\n filePath = filePath.slice(0, fragmentStart);\n }\n const context = utils.clone(this.context);\n context.rawBuffer = true;\n\n const fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true);\n\n if (!fileManager) {\n return fallback(this, filePathNode);\n }\n\n let useBase64 = false;\n\n // detect the mimetype if not given\n if (!mimetypeNode) {\n\n mimetype = environment.mimeLookup(filePath);\n\n if (mimetype === 'image/svg+xml') {\n useBase64 = false;\n } else {\n // use base 64 unless it's an ASCII or UTF-8 format\n const charset = environment.charsetLookup(mimetype);\n useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0;\n }\n if (useBase64) { mimetype += ';base64'; }\n }\n else {\n useBase64 = /;base64$/.test(mimetype);\n }\n\n const fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment);\n if (!fileSync.contents) {\n logger.warn(`Skipped data-uri embedding of ${filePath} because file not found`);\n return fallback(this, filePathNode || mimetypeNode);\n }\n let buf = fileSync.contents;\n if (useBase64 && !environment.encodeBase64) {\n return fallback(this, filePathNode);\n }\n\n buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);\n\n const uri = `data:${mimetype},${buf}${fragment}`;\n\n return new URL(new Quoted(`\"${uri}\"`, uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Expression from '../tree/expression';\nimport Quoted from '../tree/quoted';\nimport URL from '../tree/url';\n\nexport default () => {\n return { 'svg-gradient': function(direction) {\n let stops;\n let gradientDirectionSvg;\n let gradientType = 'linear';\n let rectangleDimension = 'x=\"0\" y=\"0\" width=\"1\" height=\"1\"';\n const renderEnv = {compress: false};\n let returner;\n const directionValue = direction.toCSS(renderEnv);\n let i;\n let color;\n let position;\n let positionValue;\n let alpha;\n\n function throwArgumentDescriptor() {\n throw { type: 'Argument',\n message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' +\n ' end_color [end_position] or direction, color list' };\n }\n\n if (arguments.length == 2) {\n if (arguments[1].value.length < 2) {\n throwArgumentDescriptor();\n }\n stops = arguments[1].value;\n } else if (arguments.length < 3) {\n throwArgumentDescriptor();\n } else {\n stops = Array.prototype.slice.call(arguments, 1);\n }\n\n switch (directionValue) {\n case 'to bottom':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\"';\n break;\n case 'to right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'to bottom right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\"';\n break;\n case 'to top right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"100%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'ellipse':\n case 'ellipse at center':\n gradientType = 'radial';\n gradientDirectionSvg = 'cx=\"50%\" cy=\"50%\" r=\"75%\"';\n rectangleDimension = 'x=\"-50\" y=\"-50\" width=\"101\" height=\"101\"';\n break;\n default:\n throw { type: 'Argument', message: 'svg-gradient direction must be \\'to bottom\\', \\'to right\\',' +\n ' \\'to bottom right\\', \\'to top right\\' or \\'ellipse at center\\'' };\n }\n returner = ``;\n\n returner = encodeURIComponent(returner);\n\n returner = `data:image/svg+xml,${returner}`;\n return new URL(new Quoted(`'${returner}'`, returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import contexts from './contexts';\nimport visitor from './visitors';\nimport tree from './tree';\n\nexport default function(root, options) {\n options = options || {};\n let evaldRoot;\n let variables = options.variables;\n const evalEnv = new contexts.Eval(options);\n\n //\n // Allows setting variables with a hash, so:\n //\n // `{ color: new tree.Color('#f01') }` will become:\n //\n // new tree.Declaration('@color',\n // new tree.Value([\n // new tree.Expression([\n // new tree.Color('#f01')\n // ])\n // ])\n // )\n //\n if (typeof variables === 'object' && !Array.isArray(variables)) {\n variables = Object.keys(variables).map(function (k) {\n let value = variables[k];\n\n if (!(value instanceof tree.Value)) {\n if (!(value instanceof tree.Expression)) {\n value = new tree.Expression([value]);\n }\n value = new tree.Value([value]);\n }\n return new tree.Declaration(`@${k}`, value, false, null, 0);\n });\n evalEnv.frames = [new tree.Ruleset(null, variables)];\n }\n\n const visitors = [\n new visitor.JoinSelectorVisitor(),\n new visitor.MarkVisibleSelectorsVisitor(true),\n new visitor.ExtendVisitor(),\n new visitor.ToCSSVisitor({compress: Boolean(options.compress)})\n ];\n\n const preEvalVisitors = [];\n let v;\n let visitorIterator;\n\n /**\n * first() / get() allows visitors to be added while visiting\n * \n * @todo Add scoping for visitors just like functions for @plugin; right now they're global\n */\n if (options.pluginManager) {\n visitorIterator = options.pluginManager.visitor();\n for (let i = 0; i < 2; i++) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (v.isPreEvalVisitor) {\n if (i === 0 || preEvalVisitors.indexOf(v) === -1) {\n preEvalVisitors.push(v);\n v.run(root);\n }\n }\n else {\n if (i === 0 || visitors.indexOf(v) === -1) {\n if (v.isPreVisitor) {\n visitors.unshift(v);\n }\n else {\n visitors.push(v);\n }\n }\n }\n }\n }\n }\n\n evaldRoot = root.eval(evalEnv);\n\n for (let i = 0; i < visitors.length; i++) {\n visitors[i].run(evaldRoot);\n }\n\n // Run any remaining visitors added after eval pass\n if (options.pluginManager) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (visitors.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) {\n v.run(evaldRoot);\n }\n }\n }\n\n return evaldRoot;\n}\n","/**\n * Plugin Manager\n */\nclass PluginManager {\n constructor(less) {\n this.less = less;\n this.visitors = [];\n this.preProcessors = [];\n this.postProcessors = [];\n this.installedPlugins = [];\n this.fileManagers = [];\n this.iterator = -1;\n this.pluginCache = {};\n this.Loader = new less.PluginLoader(less);\n }\n\n /**\n * Adds all the plugins in the array\n * @param {Array} plugins\n */\n addPlugins(plugins) {\n if (plugins) {\n for (let i = 0; i < plugins.length; i++) {\n this.addPlugin(plugins[i]);\n }\n }\n }\n\n /**\n *\n * @param plugin\n * @param {String} filename\n */\n addPlugin(plugin, filename, functionRegistry) {\n this.installedPlugins.push(plugin);\n if (filename) {\n this.pluginCache[filename] = plugin;\n }\n if (plugin.install) {\n plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry);\n }\n }\n\n /**\n *\n * @param filename\n */\n get(filename) {\n return this.pluginCache[filename];\n }\n\n /**\n * Adds a visitor. The visitor object has options on itself to determine\n * when it should run.\n * @param visitor\n */\n addVisitor(visitor) {\n this.visitors.push(visitor);\n }\n\n /**\n * Adds a pre processor object\n * @param {object} preProcessor\n * @param {number} priority - guidelines 1 = before import, 1000 = import, 2000 = after import\n */\n addPreProcessor(preProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) {\n if (this.preProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.preProcessors.splice(indexToInsertAt, 0, {preProcessor, priority});\n }\n\n /**\n * Adds a post processor object\n * @param {object} postProcessor\n * @param {number} priority - guidelines 1 = before compression, 1000 = compression, 2000 = after compression\n */\n addPostProcessor(postProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) {\n if (this.postProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.postProcessors.splice(indexToInsertAt, 0, {postProcessor, priority});\n }\n\n /**\n *\n * @param manager\n */\n addFileManager(manager) {\n this.fileManagers.push(manager);\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPreProcessors() {\n const preProcessors = [];\n for (let i = 0; i < this.preProcessors.length; i++) {\n preProcessors.push(this.preProcessors[i].preProcessor);\n }\n return preProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPostProcessors() {\n const postProcessors = [];\n for (let i = 0; i < this.postProcessors.length; i++) {\n postProcessors.push(this.postProcessors[i].postProcessor);\n }\n return postProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getVisitors() {\n return this.visitors;\n }\n\n visitor() {\n const self = this;\n return {\n first: function() {\n self.iterator = -1;\n return self.visitors[self.iterator];\n },\n get: function() {\n self.iterator += 1;\n return self.visitors[self.iterator];\n }\n };\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getFileManagers() {\n return this.fileManagers;\n }\n}\n\nlet pm;\n\nconst PluginManagerFactory = function(less, newFactory) {\n if (newFactory || !pm) {\n pm = new PluginManager(less);\n }\n return pm;\n};\n\n//\nexport default PluginManagerFactory;\n","'use strict';\n\nfunction parseNodeVersion(version) {\n var match = version.match(/^v(\\d{1,2})\\.(\\d{1,2})\\.(\\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\\+([0-9A-Za-z-.]+))?$/); // eslint-disable-line max-len\n if (!match) {\n throw new Error('Unable to parse: ' + version);\n }\n\n var res = {\n major: parseInt(match[1], 10),\n minor: parseInt(match[2], 10),\n patch: parseInt(match[3], 10),\n pre: match[4] || '',\n build: match[5] || '',\n };\n\n return res;\n}\n\nmodule.exports = parseNodeVersion;\n","import AbstractFileManager from '../less/environment/abstract-file-manager.js';\n\nlet options;\nlet logger;\nlet fileCache = {};\n\n// TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load\nconst FileManager = function() {}\nFileManager.prototype = Object.assign(new AbstractFileManager(), {\n alwaysMakePathsAbsolute() {\n return true;\n },\n\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return this.extractUrlParts(laterPath, basePath).path;\n },\n\n doXHR(url, type, callback, errback) {\n const xhr = new XMLHttpRequest();\n const async = options.isFileProtocol ? options.fileAsync : true;\n\n if (typeof xhr.overrideMimeType === 'function') {\n xhr.overrideMimeType('text/css');\n }\n logger.debug(`XHR: Getting '${url}'`);\n xhr.open('GET', url, async);\n xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');\n xhr.send(null);\n\n function handleResponse(xhr, callback, errback) {\n if (xhr.status >= 200 && xhr.status < 300) {\n callback(xhr.responseText,\n xhr.getResponseHeader('Last-Modified'));\n } else if (typeof errback === 'function') {\n errback(xhr.status, url);\n }\n }\n\n if (options.isFileProtocol && !options.fileAsync) {\n if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) {\n callback(xhr.responseText);\n } else {\n errback(xhr.status, url);\n }\n } else if (async) {\n xhr.onreadystatechange = () => {\n if (xhr.readyState == 4) {\n handleResponse(xhr, callback, errback);\n }\n };\n } else {\n handleResponse(xhr, callback, errback);\n }\n },\n\n supports() {\n return true;\n },\n\n clearFileCache() {\n fileCache = {};\n },\n\n loadFile(filename, currentDirectory, options) {\n // TODO: Add prefix support like less-node?\n // What about multiple paths?\n\n if (currentDirectory && !this.isPathAbsolute(filename)) {\n filename = currentDirectory + filename;\n }\n\n filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename;\n\n options = options || {};\n\n // sheet may be set to the stylesheet for the initial load or a collection of properties including\n // some context variables for imports\n const hrefParts = this.extractUrlParts(filename, window.location.href);\n const href = hrefParts.url;\n const self = this;\n \n return new Promise((resolve, reject) => {\n if (options.useFileCache && fileCache[href]) {\n try {\n const lessText = fileCache[href];\n return resolve({ contents: lessText, filename: href, webInfo: { lastModified: new Date() }});\n } catch (e) {\n return reject({ filename: href, message: `Error loading file ${href} error was ${e.message}` });\n }\n }\n\n self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) {\n // per file cache\n fileCache[href] = data;\n\n // Use remote copy (re-parse)\n resolve({ contents: data, filename: href, webInfo: { lastModified }});\n }, function doXHRError(status, url) {\n reject({ type: 'File', message: `'${url}' wasn't found (${status})`, href });\n });\n });\n }\n});\n\nexport default (opts, log) => {\n options = opts;\n logger = log;\n return FileManager;\n}\n","import Environment from './environment/environment';\nimport data from './data';\nimport tree from './tree';\nimport AbstractFileManager from './environment/abstract-file-manager';\nimport AbstractPluginLoader from './environment/abstract-plugin-loader';\nimport visitors from './visitors';\nimport Parser from './parser/parser';\nimport functions from './functions';\nimport contexts from './contexts';\nimport LessError from './less-error';\nimport transformTree from './transform-tree';\nimport * as utils from './utils';\nimport PluginManager from './plugin-manager';\nimport logger from './logger';\nimport SourceMapOutput from './source-map-output';\nimport SourceMapBuilder from './source-map-builder';\nimport ParseTree from './parse-tree';\nimport ImportManager from './import-manager';\nimport Parse from './parse';\nimport Render from './render';\nimport { version } from '../../package.json';\nimport parseVersion from 'parse-node-version';\n\nexport default function(environment, fileManagers) {\n let sourceMapOutput, sourceMapBuilder, parseTree, importManager;\n\n environment = new Environment(environment, fileManagers);\n sourceMapOutput = SourceMapOutput(environment);\n sourceMapBuilder = SourceMapBuilder(sourceMapOutput, environment);\n parseTree = ParseTree(sourceMapBuilder);\n importManager = ImportManager(environment);\n\n const render = Render(environment, parseTree, importManager);\n const parse = Parse(environment, parseTree, importManager);\n\n const v = parseVersion(`v${version}`);\n const initial = {\n version: [v.major, v.minor, v.patch],\n data,\n tree,\n Environment,\n AbstractFileManager,\n AbstractPluginLoader,\n environment,\n visitors,\n Parser,\n functions: functions(environment),\n contexts,\n SourceMapOutput: sourceMapOutput,\n SourceMapBuilder: sourceMapBuilder,\n ParseTree: parseTree,\n ImportManager: importManager,\n render,\n parse,\n LessError,\n transformTree,\n utils,\n PluginManager,\n logger\n };\n\n // Create a public API\n\n const ctor = function(t) {\n return function() {\n const obj = Object.create(t.prototype);\n t.apply(obj, Array.prototype.slice.call(arguments, 0));\n return obj;\n };\n };\n let t;\n const api = Object.create(initial);\n for (const n in initial.tree) {\n /* eslint guard-for-in: 0 */\n t = initial.tree[n];\n if (typeof t === 'function') {\n api[n.toLowerCase()] = ctor(t);\n }\n else {\n api[n] = Object.create(null);\n for (const o in t) {\n /* eslint guard-for-in: 0 */\n api[n][o.toLowerCase()] = ctor(t[o]);\n }\n }\n }\n\n /**\n * Some of the functions assume a `this` context of the API object,\n * which causes it to fail when wrapped for ES6 imports.\n * \n * An assumed `this` should be removed in the future.\n */\n initial.parse = initial.parse.bind(api);\n initial.render = initial.render.bind(api);\n\n return api;\n}\n","import LessError from './less-error';\nimport transformTree from './transform-tree';\nimport logger from './logger';\n\nexport default function(SourceMapBuilder) {\n class ParseTree {\n constructor(root, imports) {\n this.root = root;\n this.imports = imports;\n }\n\n toCSS(options) {\n let evaldRoot;\n const result = {};\n let sourceMapBuilder;\n try {\n evaldRoot = transformTree(this.root, options);\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n try {\n const compress = Boolean(options.compress);\n if (compress) {\n logger.warn('The compress option has been deprecated. ' + \n 'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');\n }\n\n const toCSSOptions = {\n compress,\n dumpLineNumbers: options.dumpLineNumbers,\n strictUnits: Boolean(options.strictUnits),\n numPrecision: 8};\n\n if (options.sourceMap) {\n sourceMapBuilder = new SourceMapBuilder(options.sourceMap);\n result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports);\n } else {\n result.css = evaldRoot.toCSS(toCSSOptions);\n }\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n if (options.pluginManager) {\n const postProcessors = options.pluginManager.getPostProcessors();\n for (let i = 0; i < postProcessors.length; i++) {\n result.css = postProcessors[i].process(result.css, { sourceMap: sourceMapBuilder, options, imports: this.imports });\n }\n }\n if (options.sourceMap) {\n result.map = sourceMapBuilder.getExternalSourceMap();\n }\n\n result.imports = [];\n for (const file in this.imports.files) {\n if (Object.prototype.hasOwnProperty.call(this.imports.files, file) && file !== this.imports.rootFilename) {\n result.imports.push(file);\n }\n }\n return result;\n }\n }\n\n return ParseTree;\n}\n","export default function (SourceMapOutput, environment) {\n class SourceMapBuilder {\n constructor(options) {\n this.options = options;\n }\n\n toCSS(rootNode, options, imports) {\n const sourceMapOutput = new SourceMapOutput(\n {\n contentsIgnoredCharsMap: imports.contentsIgnoredChars,\n rootNode,\n contentsMap: imports.contents,\n sourceMapFilename: this.options.sourceMapFilename,\n sourceMapURL: this.options.sourceMapURL,\n outputFilename: this.options.sourceMapOutputFilename,\n sourceMapBasepath: this.options.sourceMapBasepath,\n sourceMapRootpath: this.options.sourceMapRootpath,\n outputSourceFiles: this.options.outputSourceFiles,\n sourceMapGenerator: this.options.sourceMapGenerator,\n sourceMapFileInline: this.options.sourceMapFileInline, \n disableSourcemapAnnotation: this.options.disableSourcemapAnnotation\n });\n\n const css = sourceMapOutput.toCSS(options);\n this.sourceMap = sourceMapOutput.sourceMap;\n this.sourceMapURL = sourceMapOutput.sourceMapURL;\n if (this.options.sourceMapInputFilename) {\n this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename);\n }\n if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) {\n this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL);\n }\n return css + this.getCSSAppendage();\n }\n\n getCSSAppendage() {\n\n let sourceMapURL = this.sourceMapURL;\n if (this.options.sourceMapFileInline) {\n if (this.sourceMap === undefined) {\n return '';\n }\n sourceMapURL = `data:application/json;base64,${environment.encodeBase64(this.sourceMap)}`;\n }\n\n if (this.options.disableSourcemapAnnotation) {\n return '';\n }\n\n if (sourceMapURL) {\n return `/*# sourceMappingURL=${sourceMapURL} */`;\n }\n return '';\n }\n\n getExternalSourceMap() {\n return this.sourceMap;\n }\n\n setExternalSourceMap(sourceMap) {\n this.sourceMap = sourceMap;\n }\n\n isInline() {\n return this.options.sourceMapFileInline;\n }\n\n getSourceMapURL() {\n return this.sourceMapURL;\n }\n\n getOutputFilename() {\n return this.options.sourceMapOutputFilename;\n }\n\n getInputFilename() {\n return this.sourceMapInputFilename;\n }\n }\n\n return SourceMapBuilder;\n}\n","export default function (environment) {\n class SourceMapOutput {\n constructor(options) {\n this._css = [];\n this._rootNode = options.rootNode;\n this._contentsMap = options.contentsMap;\n this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;\n if (options.sourceMapFilename) {\n this._sourceMapFilename = options.sourceMapFilename.replace(/\\\\/g, '/');\n }\n this._outputFilename = options.outputFilename;\n this.sourceMapURL = options.sourceMapURL;\n if (options.sourceMapBasepath) {\n this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\\\/g, '/');\n }\n if (options.sourceMapRootpath) {\n this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\\\/g, '/');\n if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') {\n this._sourceMapRootpath += '/';\n }\n } else {\n this._sourceMapRootpath = '';\n }\n this._outputSourceFiles = options.outputSourceFiles;\n this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();\n\n this._lineNumber = 0;\n this._column = 0;\n }\n\n removeBasepath(path) {\n if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) {\n path = path.substring(this._sourceMapBasepath.length);\n if (path.charAt(0) === '\\\\' || path.charAt(0) === '/') {\n path = path.substring(1);\n }\n }\n\n return path;\n }\n\n normalizeFilename(filename) {\n filename = filename.replace(/\\\\/g, '/');\n filename = this.removeBasepath(filename);\n return (this._sourceMapRootpath || '') + filename;\n }\n\n add(chunk, fileInfo, index, mapLines) {\n\n // ignore adding empty strings\n if (!chunk) {\n return;\n }\n\n let lines, sourceLines, columns, sourceColumns, i;\n\n if (fileInfo && fileInfo.filename) {\n let inputSource = this._contentsMap[fileInfo.filename];\n\n // remove vars/banner added to the top of the file\n if (this._contentsIgnoredCharsMap[fileInfo.filename]) {\n // adjust the index\n index -= this._contentsIgnoredCharsMap[fileInfo.filename];\n if (index < 0) { index = 0; }\n // adjust the source\n inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);\n }\n\n /** \n * ignore empty content, or failsafe\n * if contents map is incorrect\n */\n if (inputSource === undefined) {\n this._css.push(chunk);\n return;\n }\n\n inputSource = inputSource.substring(0, index);\n sourceLines = inputSource.split('\\n');\n sourceColumns = sourceLines[sourceLines.length - 1];\n }\n\n lines = chunk.split('\\n');\n columns = lines[lines.length - 1];\n\n if (fileInfo && fileInfo.filename) {\n if (!mapLines) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column},\n original: { line: sourceLines.length, column: sourceColumns.length},\n source: this.normalizeFilename(fileInfo.filename)});\n } else {\n for (i = 0; i < lines.length; i++) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0},\n original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0},\n source: this.normalizeFilename(fileInfo.filename)});\n }\n }\n }\n\n if (lines.length === 1) {\n this._column += columns.length;\n } else {\n this._lineNumber += lines.length - 1;\n this._column = columns.length;\n }\n\n this._css.push(chunk);\n }\n\n isEmpty() {\n return this._css.length === 0;\n }\n\n toCSS(context) {\n this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });\n\n if (this._outputSourceFiles) {\n for (const filename in this._contentsMap) {\n // eslint-disable-next-line no-prototype-builtins\n if (this._contentsMap.hasOwnProperty(filename)) {\n let source = this._contentsMap[filename];\n if (this._contentsIgnoredCharsMap[filename]) {\n source = source.slice(this._contentsIgnoredCharsMap[filename]);\n }\n this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source);\n }\n }\n }\n\n this._rootNode.genCSS(context, this);\n\n if (this._css.length > 0) {\n let sourceMapURL;\n const sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());\n\n if (this.sourceMapURL) {\n sourceMapURL = this.sourceMapURL;\n } else if (this._sourceMapFilename) {\n sourceMapURL = this._sourceMapFilename;\n }\n this.sourceMapURL = sourceMapURL;\n\n this.sourceMap = sourceMapContent;\n }\n\n return this._css.join('');\n }\n }\n\n return SourceMapOutput;\n}\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport LessError from './less-error';\nimport * as utils from './utils';\nimport logger from './logger';\n\nexport default function(environment) {\n // FileInfo = {\n // 'rewriteUrls' - option - whether to adjust URL's to be relative\n // 'filename' - full resolved filename of current file\n // 'rootpath' - path to append to normal URLs for this node\n // 'currentDirectory' - path to the current file, absolute\n // 'rootFilename' - filename of the base file\n // 'entryPath' - absolute path to the entry file\n // 'reference' - whether the file should not be output and only output parts that are referenced\n\n class ImportManager {\n constructor(less, context, rootFileInfo) {\n this.less = less;\n this.rootFilename = rootFileInfo.filename;\n this.paths = context.paths || []; // Search paths, when importing\n this.contents = {}; // map - filename to contents of all the files\n this.contentsIgnoredChars = {}; // map - filename to lines at the beginning of each file to ignore\n this.mime = context.mime;\n this.error = null;\n this.context = context;\n // Deprecated? Unused outside of here, could be useful.\n this.queue = []; // Files which haven't been imported yet\n this.files = {}; // Holds the imported parse trees.\n }\n\n /**\n * Add an import to be imported\n * @param path - the raw path\n * @param tryAppendExtension - whether to try appending a file extension (.less or .js if the path has no extension)\n * @param currentFileInfo - the current file info (used for instance to work out relative paths)\n * @param importOptions - import options\n * @param callback - callback for when it is imported\n */\n push(path, tryAppendExtension, currentFileInfo, importOptions, callback) {\n const importManager = this, pluginLoader = this.context.pluginManager.Loader;\n\n this.queue.push(path);\n\n const fileParsedFunc = function (e, root, fullPath) {\n importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue\n\n const importedEqualsRoot = fullPath === importManager.rootFilename;\n if (importOptions.optional && e) {\n callback(null, {rules:[]}, false, null);\n logger.info(`The file ${fullPath} was skipped because it was not found and the import was marked optional.`);\n }\n else {\n // Inline imports aren't cached here.\n // If we start to cache them, please make sure they won't conflict with non-inline imports of the\n // same name as they used to do before this comment and the condition below have been added.\n if (!importManager.files[fullPath] && !importOptions.inline) {\n importManager.files[fullPath] = { root, options: importOptions };\n }\n if (e && !importManager.error) { importManager.error = e; }\n callback(e, root, importedEqualsRoot, fullPath);\n }\n };\n\n const newFileInfo = {\n rewriteUrls: this.context.rewriteUrls,\n entryPath: currentFileInfo.entryPath,\n rootpath: currentFileInfo.rootpath,\n rootFilename: currentFileInfo.rootFilename\n };\n\n const fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment);\n\n if (!fileManager) {\n fileParsedFunc({ message: `Could not find a file-manager for ${path}` });\n return;\n }\n\n const loadFileCallback = function(loadedFile) {\n let plugin;\n const resolvedFilename = loadedFile.filename;\n const contents = loadedFile.contents.replace(/^\\uFEFF/, '');\n\n // Pass on an updated rootpath if path of imported file is relative and file\n // is in a (sub|sup) directory\n //\n // Examples:\n // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/',\n // then rootpath should become 'less/module/nav/'\n // - If path of imported file is '../mixins.less' and rootpath is 'less/',\n // then rootpath should become 'less/../'\n newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename);\n if (newFileInfo.rewriteUrls) {\n newFileInfo.rootpath = fileManager.join(\n (importManager.context.rootpath || ''),\n fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath));\n\n if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) {\n newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath);\n }\n }\n newFileInfo.filename = resolvedFilename;\n\n const newEnv = new contexts.Parse(importManager.context);\n\n newEnv.processImports = false;\n importManager.contents[resolvedFilename] = contents;\n\n if (currentFileInfo.reference || importOptions.reference) {\n newFileInfo.reference = true;\n }\n\n if (importOptions.isPlugin) {\n plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo);\n if (plugin instanceof LessError) {\n fileParsedFunc(plugin, null, resolvedFilename);\n }\n else {\n fileParsedFunc(null, plugin, resolvedFilename);\n }\n } else if (importOptions.inline) {\n fileParsedFunc(null, contents, resolvedFilename);\n } else {\n // import (multiple) parse trees apparently get altered and can't be cached.\n // TODO: investigate why this is\n if (importManager.files[resolvedFilename]\n && !importManager.files[resolvedFilename].options.multiple\n && !importOptions.multiple) {\n\n fileParsedFunc(null, importManager.files[resolvedFilename].root, resolvedFilename);\n }\n else {\n new Parser(newEnv, importManager, newFileInfo).parse(contents, function (e, root) {\n fileParsedFunc(e, root, resolvedFilename);\n });\n }\n }\n };\n let loadedFile;\n let promise;\n const context = utils.clone(this.context);\n\n if (tryAppendExtension) {\n context.ext = importOptions.isPlugin ? '.js' : '.less';\n }\n\n if (importOptions.isPlugin) {\n context.mime = 'application/javascript';\n\n if (context.syncImport) {\n loadedFile = pluginLoader.loadPluginSync(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n } else {\n promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n }\n }\n else {\n if (context.syncImport) {\n loadedFile = fileManager.loadFileSync(path, currentFileInfo.currentDirectory, context, environment);\n } else {\n promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment,\n (err, loadedFile) => {\n if (err) {\n fileParsedFunc(err);\n } else {\n loadFileCallback(loadedFile);\n }\n });\n }\n }\n if (loadedFile) {\n if (!loadedFile.filename) {\n fileParsedFunc(loadedFile);\n } else {\n loadFileCallback(loadedFile);\n }\n } else if (promise) {\n promise.then(loadFileCallback, fileParsedFunc);\n }\n }\n }\n\n return ImportManager;\n}\n","import * as utils from './utils';\n\nexport default function(environment, ParseTree) {\n const render = function (input, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise(function (resolve, reject) {\n render.call(self, input, options, function(err, output) {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n this.parse(input, options, function(err, root, imports, options) {\n if (err) { return callback(err); }\n\n let result;\n try {\n const parseTree = new ParseTree(root, imports);\n result = parseTree.toCSS(options);\n }\n catch (err) { return callback(err); }\n\n callback(null, result);\n });\n }\n };\n\n return render;\n}\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport PluginManager from './plugin-manager';\nimport LessError from './less-error';\nimport * as utils from './utils';\n\nexport default function(environment, ParseTree, ImportManager) {\n const parse = function (input, options, callback) {\n\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise(function (resolve, reject) {\n parse.call(self, input, options, function(err, output) {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n let context;\n let rootFileInfo;\n const pluginManager = new PluginManager(this, !options.reUsePluginManager);\n\n options.pluginManager = pluginManager;\n\n context = new contexts.Parse(options);\n\n if (options.rootFileInfo) {\n rootFileInfo = options.rootFileInfo;\n } else {\n const filename = options.filename || 'input';\n const entryPath = filename.replace(/[^/\\\\]*$/, '');\n rootFileInfo = {\n filename,\n rewriteUrls: context.rewriteUrls,\n rootpath: context.rootpath || '',\n currentDirectory: entryPath,\n entryPath,\n rootFilename: filename\n };\n // add in a missing trailing slash\n if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') {\n rootFileInfo.rootpath += '/';\n }\n }\n\n const imports = new ImportManager(this, context, rootFileInfo);\n this.importManager = imports;\n\n // TODO: allow the plugins to be just a list of paths or names\n // Do an async plugin queue like lessc\n\n if (options.plugins) {\n options.plugins.forEach(function(plugin) {\n let evalResult, contents;\n if (plugin.fileContent) {\n contents = plugin.fileContent.replace(/^\\uFEFF/, '');\n evalResult = pluginManager.Loader.evalPlugin(contents, context, imports, plugin.options, plugin.filename);\n if (evalResult instanceof LessError) {\n return callback(evalResult);\n }\n }\n else {\n pluginManager.addPlugin(plugin);\n }\n });\n }\n\n new Parser(context, imports, rootFileInfo)\n .parse(input, function (e, root) {\n if (e) { return callback(e); }\n callback(null, root, imports, options);\n }, options);\n }\n };\n return parse;\n}\n","/**\n * @todo Add tests for browser `@plugin`\n */\nimport AbstractPluginLoader from '../less/environment/abstract-plugin-loader.js';\n\n/**\n * Browser Plugin Loader\n */\nconst PluginLoader = function(less) {\n this.less = less;\n // Should we shim this.require for browser? Probably not?\n};\n\nPluginLoader.prototype = Object.assign(new AbstractPluginLoader(), {\n loadPlugin(filename, basePath, context, environment, fileManager) {\n return new Promise((fulfill, reject) => {\n fileManager.loadFile(filename, basePath, context, environment)\n .then(fulfill).catch(reject);\n });\n }\n});\n\nexport default PluginLoader;\n\n","import * as utils from './utils';\nimport browser from './browser';\n\nexport default (window, less, options) => {\n\n function errorHTML(e, rootHref) {\n const id = `less-error-message:${utils.extractId(rootHref || '')}`;\n const template = '{content}
';\n const elem = window.document.createElement('div');\n let timer;\n let content;\n const errors = [];\n const filename = e.filename || rootHref;\n const filenameNoPath = filename.match(/([^/]+(\\?.*)?)$/)[1];\n\n elem.id = id;\n elem.className = 'less-error-message';\n\n content = `${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'}` + \n `
in ${filenameNoPath} `;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += `on line ${e.line}, column ${e.column + 1}:
`;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `
Stack Trace${e.stack.split('\\n').slice(1).join('
')}`;\n }\n elem.innerHTML = content;\n\n // CSS for error messages\n browser.createCSS(window.document, [\n '.less-error-message ul, .less-error-message li {',\n 'list-style-type: none;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message label {',\n 'font-size: 12px;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'color: #cc7777;',\n '}',\n '.less-error-message pre {',\n 'color: #dd6666;',\n 'padding: 4px 0;',\n 'margin: 0;',\n 'display: inline-block;',\n '}',\n '.less-error-message pre.line {',\n 'color: #ff0000;',\n '}',\n '.less-error-message h3 {',\n 'font-size: 20px;',\n 'font-weight: bold;',\n 'padding: 15px 0 5px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message a {',\n 'color: #10a',\n '}',\n '.less-error-message .error {',\n 'color: red;',\n 'font-weight: bold;',\n 'padding-bottom: 2px;',\n 'border-bottom: 1px dashed red;',\n '}'\n ].join('\\n'), { title: 'error-message' });\n\n elem.style.cssText = [\n 'font-family: Arial, sans-serif',\n 'border: 1px solid #e00',\n 'background-color: #eee',\n 'border-radius: 5px',\n '-webkit-border-radius: 5px',\n '-moz-border-radius: 5px',\n 'color: #e00',\n 'padding: 15px',\n 'margin-bottom: 15px'\n ].join(';');\n\n if (options.env === 'development') {\n timer = setInterval(() => {\n const document = window.document;\n const body = document.body;\n if (body) {\n if (document.getElementById(id)) {\n body.replaceChild(elem, document.getElementById(id));\n } else {\n body.insertBefore(elem, body.firstChild);\n }\n clearInterval(timer);\n }\n }, 10);\n }\n }\n\n function removeErrorHTML(path) {\n const node = window.document.getElementById(`less-error-message:${utils.extractId(path)}`);\n if (node) {\n node.parentNode.removeChild(node);\n }\n }\n\n function removeErrorConsole() {\n // no action\n }\n\n function removeError(path) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n removeErrorHTML(path);\n } else if (options.errorReporting === 'console') {\n removeErrorConsole(path);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('remove', path);\n }\n }\n\n function errorConsole(e, rootHref) {\n const template = '{line} {content}';\n const filename = e.filename || rootHref;\n const errors = [];\n let content = `${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'} in ${filename}`;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += ` on line ${e.line}, column ${e.column + 1}:\\n${errors.join('\\n')}`;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `\\nStack Trace\\n${e.stack}`;\n }\n less.logger.error(content);\n }\n\n function error(e, rootHref) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n errorHTML(e, rootHref);\n } else if (options.errorReporting === 'console') {\n errorConsole(e, rootHref);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('add', e, rootHref);\n }\n }\n\n return {\n add: error,\n remove: removeError\n };\n};\n","/**\n * Kicks off less and compiles any stylesheets\n * used in the browser distributed version of less\n * to kick-start less using the browser api\n */\nimport defaultOptions from '../less/default-options';\nimport addDefaultOptions from './add-default-options';\nimport root from './index';\n\nconst options = defaultOptions();\n\nif (window.less) {\n for (const key in window.less) {\n if (Object.prototype.hasOwnProperty.call(window.less, key)) {\n options[key] = window.less[key];\n }\n }\n}\naddDefaultOptions(window, options);\n\noptions.plugins = options.plugins || [];\n\nif (window.LESS_PLUGINS) {\n options.plugins = options.plugins.concat(window.LESS_PLUGINS);\n}\n\nconst less = root(window, options);\nexport default less;\n\nwindow.less = less;\n\nlet css;\nlet head;\nlet style;\n\n// Always restore page visibility\nfunction resolveOrReject(data) {\n if (data.filename) {\n console.warn(data);\n }\n if (!options.async) {\n head.removeChild(style);\n }\n}\n\nif (options.onReady) {\n if (/!watch/.test(window.location.hash)) {\n less.watch();\n }\n // Simulate synchronous stylesheet loading by hiding page rendering\n if (!options.async) {\n css = 'body { display: none !important }';\n head = document.head || document.getElementsByTagName('head')[0];\n style = document.createElement('style');\n\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n less.registerStylesheetsImmediately();\n less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject);\n}\n","// Export a new default each time\nexport default function() {\n return {\n /* Inline Javascript - @plugin still allowed */\n javascriptEnabled: false,\n\n /* Outputs a makefile import dependency list to stdout. */\n depends: false,\n\n /* (DEPRECATED) Compress using less built-in compression. \n * This does an okay job but does not utilise all the tricks of \n * dedicated css compression. */\n compress: false,\n\n /* Runs the less parser and just reports errors without any output. */\n lint: false,\n\n /* Sets available include paths.\n * If the file in an @import rule does not exist at that exact location, \n * less will look for it at the location(s) passed to this option. \n * You might use this for instance to specify a path to a library which \n * you want to be referenced simply and relatively in the less files. */\n paths: [],\n\n /* color output in the terminal */\n color: true,\n\n /* The strictImports controls whether the compiler will allow an @import inside of either \n * @media blocks or (a later addition) other selector blocks.\n * See: https://github.com/less/less.js/issues/656 */\n strictImports: false,\n\n /* Allow Imports from Insecure HTTPS Hosts */\n insecure: false,\n\n /* Allows you to add a path to every generated import and url in your css. \n * This does not affect less import statements that are processed, just ones \n * that are left in the output css. */\n rootpath: '',\n\n /* By default URLs are kept as-is, so if you import a file in a sub-directory \n * that references an image, exactly the same URL will be output in the css. \n * This option allows you to re-write URL's in imported files so that the \n * URL is always relative to the base imported file */\n rewriteUrls: false,\n\n /* How to process math \n * 0 always - eagerly try to solve all operations\n * 1 parens-division - require parens for division \"/\"\n * 2 parens | strict - require parens for all operations\n * 3 strict-legacy - legacy strict behavior (super-strict)\n */\n math: 1,\n\n /* Without this option, less attempts to guess at the output unit when it does maths. */\n strictUnits: false,\n\n /* Effectively the declaration is put at the top of your base Less file, \n * meaning it can be used but it also can be overridden if this variable \n * is defined in the file. */\n globalVars: null,\n\n /* As opposed to the global variable option, this puts the declaration at the\n * end of your base file, meaning it will override anything defined in your Less file. */\n modifyVars: null,\n\n /* This option allows you to specify a argument to go on to every URL. */\n urlArgs: ''\n }\n}","import {addDataAttr} from './utils';\nimport browser from './browser';\n\nexport default (window, options) => {\n\n // use options from the current script tag data attribues\n addDataAttr(options, browser.currentScript(window));\n\n if (options.isFileProtocol === undefined) {\n options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol);\n }\n\n // Load styles asynchronously (default: false)\n //\n // This is set to `false` by default, so that the body\n // doesn't start loading before the stylesheets are parsed.\n // Setting this to `true` can result in flickering.\n //\n options.async = options.async || false;\n options.fileAsync = options.fileAsync || false;\n\n // Interval between watch polls\n options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500);\n\n options.env = options.env || (window.location.hostname == '127.0.0.1' ||\n window.location.hostname == '0.0.0.0' ||\n window.location.hostname == 'localhost' ||\n (window.location.port &&\n window.location.port.length > 0) ||\n options.isFileProtocol ? 'development'\n : 'production');\n\n const dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash);\n if (dumpLineNumbers) {\n options.dumpLineNumbers = dumpLineNumbers[1];\n }\n\n if (options.useFileCache === undefined) {\n options.useFileCache = true;\n }\n\n if (options.onReady === undefined) {\n options.onReady = true;\n }\n\n if (options.relativeUrls) {\n options.rewriteUrls = 'all';\n }\n};\n","//\n// index.js\n// Should expose the additional browser functions on to the less object\n//\nimport {addDataAttr} from './utils';\nimport lessRoot from '../less';\nimport browser from './browser';\nimport FM from './file-manager';\nimport PluginLoader from './plugin-loader';\nimport LogListener from './log-listener';\nimport ErrorReporting from './error-reporting';\nimport Cache from './cache';\nimport ImageSize from './image-size';\n\nexport default (window, options) => {\n const document = window.document;\n const less = lessRoot();\n\n less.options = options;\n const environment = less.environment;\n const FileManager = FM(options, less.logger);\n const fileManager = new FileManager();\n environment.addFileManager(fileManager);\n less.FileManager = FileManager;\n less.PluginLoader = PluginLoader;\n\n LogListener(less, options);\n const errors = ErrorReporting(window, less, options);\n const cache = less.cache = options.cache || Cache(window, options, less.logger);\n ImageSize(less.environment);\n\n // Setup user functions - Deprecate?\n if (options.functions) {\n less.functions.functionRegistry.addMultiple(options.functions);\n }\n\n const typePattern = /^text\\/(x-)?less$/;\n\n function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n }\n\n // only really needed for phantom\n function bind(func, thisArg) {\n const curryArgs = Array.prototype.slice.call(arguments, 2);\n return function() {\n const args = curryArgs.concat(Array.prototype.slice.call(arguments, 0));\n return func.apply(thisArg, args);\n };\n }\n\n function loadStyles(modifyVars) {\n const styles = document.getElementsByTagName('style');\n let style;\n\n for (let i = 0; i < styles.length; i++) {\n style = styles[i];\n if (style.type.match(typePattern)) {\n const instanceOptions = clone(options);\n instanceOptions.modifyVars = modifyVars;\n const lessText = style.innerHTML || '';\n instanceOptions.filename = document.location.href.replace(/#.*$/, '');\n\n /* jshint loopfunc:true */\n // use closure to store current style\n less.render(lessText, instanceOptions,\n bind((style, e, result) => {\n if (e) {\n errors.add(e, 'inline');\n } else {\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = result.css;\n } else {\n style.innerHTML = result.css;\n }\n }\n }, null, style));\n }\n }\n }\n\n function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {\n\n const instanceOptions = clone(options);\n addDataAttr(instanceOptions, sheet);\n instanceOptions.mime = sheet.type;\n\n if (modifyVars) {\n instanceOptions.modifyVars = modifyVars;\n }\n\n function loadInitialFileCallback(loadedFile) {\n const data = loadedFile.contents;\n const path = loadedFile.filename;\n const webInfo = loadedFile.webInfo;\n\n const newFileInfo = {\n currentDirectory: fileManager.getPath(path),\n filename: path,\n rootFilename: path,\n rewriteUrls: instanceOptions.rewriteUrls\n };\n\n newFileInfo.entryPath = newFileInfo.currentDirectory;\n newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory;\n\n if (webInfo) {\n webInfo.remaining = remaining;\n\n const css = cache.getCSS(path, webInfo, instanceOptions.modifyVars);\n if (!reload && css) {\n webInfo.local = true;\n callback(null, css, data, sheet, webInfo, path);\n return;\n }\n\n }\n\n // TODO add tests around how this behaves when reloading\n errors.remove(path);\n\n instanceOptions.rootFileInfo = newFileInfo;\n less.render(data, instanceOptions, (e, result) => {\n if (e) {\n e.href = path;\n callback(e);\n } else {\n cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css);\n callback(null, result.css, data, sheet, webInfo, path);\n }\n });\n }\n\n fileManager.loadFile(sheet.href, null, instanceOptions, environment)\n .then(loadedFile => {\n loadInitialFileCallback(loadedFile);\n }).catch(err => {\n console.log(err);\n callback(err);\n });\n\n }\n\n function loadStyleSheets(callback, reload, modifyVars) {\n for (let i = 0; i < less.sheets.length; i++) {\n loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1), modifyVars);\n }\n }\n\n function initRunningMode() {\n if (less.env === 'development') {\n less.watchTimer = setInterval(() => {\n if (less.watchMode) {\n fileManager.clearFileCache();\n /**\n * @todo remove when this is typed with JSDoc\n */\n // eslint-disable-next-line no-unused-vars\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n } else if (css) {\n browser.createCSS(window.document, css, sheet);\n }\n });\n }\n }, options.poll);\n }\n }\n\n //\n // Watch mode\n //\n less.watch = function () {\n if (!less.watchMode ) {\n less.env = 'development';\n initRunningMode();\n }\n this.watchMode = true;\n return true;\n };\n\n less.unwatch = function () {clearInterval(less.watchTimer); this.watchMode = false; return false; };\n\n //\n // Synchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\".\n //\n less.registerStylesheetsImmediately = () => {\n const links = document.getElementsByTagName('link');\n less.sheets = [];\n\n for (let i = 0; i < links.length; i++) {\n if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&\n (links[i].type.match(typePattern)))) {\n less.sheets.push(links[i]);\n }\n }\n };\n\n //\n // Asynchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\", returning a Promise.\n //\n less.registerStylesheets = () => new Promise((resolve) => {\n less.registerStylesheetsImmediately();\n resolve();\n });\n\n //\n // With this function, it's possible to alter variables and re-render\n // CSS without reloading less-files\n //\n less.modifyVars = record => less.refresh(true, record, false);\n\n less.refresh = (reload, modifyVars, clearFileCache) => {\n if ((reload || clearFileCache) && clearFileCache !== false) {\n fileManager.clearFileCache();\n }\n return new Promise((resolve, reject) => {\n let startTime;\n let endTime;\n let totalMilliseconds;\n let remainingSheets;\n startTime = endTime = new Date();\n\n // Set counter for remaining unprocessed sheets\n remainingSheets = less.sheets.length;\n\n if (remainingSheets === 0) {\n\n endTime = new Date();\n totalMilliseconds = endTime - startTime;\n less.logger.info('Less has finished and no sheets were loaded.');\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n\n } else {\n // Relies on less.sheets array, callback seems to be guaranteed to be called for every element of the array\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n reject(e);\n return;\n }\n if (webInfo.local) {\n less.logger.info(`Loading ${sheet.href} from cache.`);\n } else {\n less.logger.info(`Rendered ${sheet.href} successfully.`);\n }\n browser.createCSS(window.document, css, sheet);\n less.logger.info(`CSS for ${sheet.href} generated in ${new Date() - endTime}ms`);\n\n // Count completed sheet\n remainingSheets--;\n\n // Check if the last remaining sheet was processed and then call the promise\n if (remainingSheets === 0) {\n totalMilliseconds = new Date() - startTime;\n less.logger.info(`Less has finished. CSS generated in ${totalMilliseconds}ms`);\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n }\n endTime = new Date();\n }, reload, modifyVars);\n }\n\n loadStyles(modifyVars);\n });\n };\n\n less.refreshStyles = loadStyles;\n return less;\n};\n","export default (less, options) => {\n const logLevel_debug = 4;\n const logLevel_info = 3;\n const logLevel_warn = 2;\n const logLevel_error = 1;\n\n // The amount of logging in the javascript console.\n // 3 - Debug, information and errors\n // 2 - Information and errors\n // 1 - Errors\n // 0 - None\n // Defaults to 2\n options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error);\n\n if (!options.loggers) {\n options.loggers = [{\n debug: function(msg) {\n if (options.logLevel >= logLevel_debug) {\n console.log(msg);\n }\n },\n info: function(msg) {\n if (options.logLevel >= logLevel_info) {\n console.log(msg);\n }\n },\n warn: function(msg) {\n if (options.logLevel >= logLevel_warn) {\n console.warn(msg);\n }\n },\n error: function(msg) {\n if (options.logLevel >= logLevel_error) {\n console.error(msg);\n }\n }\n }];\n }\n for (let i = 0; i < options.loggers.length; i++) {\n less.logger.addListener(options.loggers[i]);\n }\n};\n","// Cache system is a bit outdated and could do with work\n\nexport default (window, options, logger) => {\n let cache = null;\n if (options.env !== 'development') {\n try {\n cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage;\n } catch (_) {}\n }\n return {\n setCSS: function(path, lastModified, modifyVars, styles) {\n if (cache) {\n logger.info(`saving ${path} to cache.`);\n try {\n cache.setItem(path, styles);\n cache.setItem(`${path}:timestamp`, lastModified);\n if (modifyVars) {\n cache.setItem(`${path}:vars`, JSON.stringify(modifyVars));\n }\n } catch (e) {\n // TODO - could do with adding more robust error handling\n logger.error(`failed to save \"${path}\" to local storage for caching.`);\n }\n }\n },\n getCSS: function(path, webInfo, modifyVars) {\n const css = cache && cache.getItem(path);\n const timestamp = cache && cache.getItem(`${path}:timestamp`);\n let vars = cache && cache.getItem(`${path}:vars`);\n\n modifyVars = modifyVars || {};\n vars = vars || '{}'; // if not set, treat as the JSON representation of an empty object\n\n if (timestamp && webInfo.lastModified &&\n (new Date(webInfo.lastModified).valueOf() ===\n new Date(timestamp).valueOf()) &&\n JSON.stringify(modifyVars) === vars) {\n // Use local copy\n return css;\n }\n }\n };\n};\n","\nimport functionRegistry from './../less/functions/function-registry';\n\nexport default () => {\n function imageSize() {\n throw {\n type: 'Runtime',\n message: 'Image size functions are not supported in browser version of less'\n };\n }\n\n const imageFunctions = {\n 'image-size': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-width': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-height': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n }\n };\n\n functionRegistry.addMultiple(imageFunctions);\n};\n"],"names":["extractId","href","replace","addDataAttr","options","tag","opt","dataset","Object","prototype","hasOwnProperty","call","JSON","parse","_","document","styles","sheet","id","title","utils.extractId","oldStyleNode","getElementById","keepOldStyleNode","styleNode","createElement","setAttribute","media","styleSheet","appendChild","createTextNode","childNodes","length","firstChild","nodeValue","head","getElementsByTagName","nextEl","nextSibling","parentNode","insertBefore","removeChild","cssText","e","Error","window","scripts","currentScript","error","msg","this","_fireEvent","warn","info","debug","addListener","listener","_listeners","push","removeListener","i_1","splice","type","i_2","logFunction","externalEnvironment","fileManagers","requiredFunctions","functions","concat","propName","environmentFunc","bind","Environment","filename","currentDirectory","environment","isSync","logger","undefined","pluginManager","getFileManagers","fileManager","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","darkgrey","darkgreen","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","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","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","m","cm","mm","in","px","pt","pc","duration","s","ms","angle","rad","Math","PI","deg","grad","turn","colors","unitConversions","parent","visibilityBlocks","nodeVisible","rootNode","parsed","Node","fileInfo","getIndex","nodes","set","node","Array","isArray","forEach","_index","_fileInfo","context","strs","genCSS","add","chunk","index","isEmpty","join","output","value","visitor","visit","op","a","b","precision","numPrecision","Number","toFixed","compare","Color","rgb","originalForm","self","match","map","c","i","parseInt","alpha","split","clamp","v","max","min","toHex","round","toString","assign","luma","r","g","pow","toCSS","doNotCompress","color","colorFunction","compress","args","fround","indexOf","toHSL","h","l","toRGB","splitcolor","operate","other","_operate","d","toHSV","toARGB","x","fromKeyword","keyword","key","toLowerCase","slice","Paren","eval","_noSpaceCombinators"," ","|","Combinator","emptyOrWhitespace","trim","spaceOrEmpty","Element","combinator","isVariable","currentFileInfo","visibilityInfo","copyVisibilityInfo","setParent","accept","clone","firstSelector","charAt","ALWAYS","PARENS_DIVISION","PARENS","RewriteUrls","getType","payload","copy","target","constructor","getPrototypeOf","il","arguments","k","j","jl","__spreadArrays","getOwnPropertyNames","getOwnPropertySymbols","reduce","carry","props","includes","newVal","originalObject","includeNonenumerable","propType","propertyIsEnumerable","defineProperty","enumerable","writable","configurable","assignProp","nonenumerable","getLocation","inputStream","n","line","column","copyArray","arr","obj","cloned","prop","defaults","obj1","obj2","newObj","_defaults","defaults_1","copyOptions","opts","strictMath","math","Constants.Math","relativeUrls","rewriteUrls","Constants.RewriteUrls","flattenArray","result","length_1","isNullOrUndefined","val","anonymousFunc","LessError","fileContentMap","currentFilename","message","stack","input","contents","loc","utils.getLocation","col","callLine","lines","found","func","Function","lineAdjust","callExtract","extract","create","F","stylize","str","errorTxt","substr","_visitArgs","visitDeeper","_hasIndexed","_noop","implementation","_implementation","_visitInCache","_visitOutCache","indexNodeTypes","ticker","child","typeIndex","tree","Visitor","nodeTypeIndex","fnName","impl","funcOut","visitArgs","newNode","isReplacing","cnt","nonReplacing","out","evald","flatten","item","nestedCnt","nestedItem","contexts","copyFromOriginal","original","destination","propertiesToCopy","parseCopyProperties","Parse","paths","evalCopyProperties","isPathRelative","path","test","isPathLocalRelative","Eval","frames","importantScope","enterCalc","calcStack","inCalc","exitCalc","pop","inParenthesis","parensStack","outOfParenthesis","mathOn","isMathOn","pathRequiresRewrite","rewritePath","rootpath","newPath","normalizePath","segment","segments","reverse","onSequencerEmpty","imports","variableImports","_onSequencerEmpty","_currentDepth","ImportSequencer","callback","importSequencer","importItem","isReady","tryRun","apply","variableImport","ImportVisitor","importer","finish","_visitor","_importer","_finish","importCount","onceFileDetectionMap","recursionDetector","_sequencer","run","root","isFinished","visitImport","importNode","inlineCSS","inline","css","utils.copyArray","importParent","isVariableImport","addVariableImport","processImportNode","evaldImportNode","evalForImport","multiple","importMultiple","tryAppendLessExtension","rules","onImported","sequencedOnImported","addImport","getPath","importedAtRoot","fullPath","importVisitor","isPlugin","isOptional","optional","duplicateImport","skip","importedFilename","oldContext","visitDeclaration","declNode","unshift","visitDeclarationOut","shift","visitAtRule","atRuleNode","visitAtRuleOut","visitMixinDefinition","mixinDefinitionNode","visitMixinDefinitionOut","visitRuleset","rulesetNode","visitRulesetOut","visitMedia","mediaNode","visitMediaOut","visible","SetTreeVisibilityVisitor","visitArray","blocksVisibility","ensureVisibility","ensureInvisibility","allExtendsStack","ExtendFinderVisitor","allExtends","extend","extendList","allSelectorsExtendList","ruleCnt","Extend","extendOnEveryPath","selectorPath","selExtendList","allSelectorsExtend","foundExtends","findSelfSelectors","ruleset","firstExtendOnThisSelectorPath","selectors","ProcessExtendsVisitor","extendFinder","extendIndices","doExtendChaining","newRoot","checkExtendsForNonMatched","indices","filter","hasFoundMatches","parent_ids","selector","extendsList","extendsListTarget","iterationCount","extendIndex","targetExtendIndex","matches","newSelector","targetExtend","newExtend","extendsToAdd","extendVisitor","object_id","selfSelectors","findMatch","selfSelector","extendSelector","isVisible","option","extendChainCount","selectorOne","selectorTwo","ruleNode","selectorNode","pathIndex","selectorsToAdd","extendedSelectors","haystackSelectorPath","haystackSelectorIndex","hackstackSelector","hackstackElementIndex","haystackElement","targetCombinator","potentialMatch","needleElements","elements","potentialMatches","allowBefore","matched","initialCombinator","isElementValuesEqual","finished","allowAfter","endPathIndex","endPathElementIndex","elementValue1","elementValue2","Attribute","Selector","replacementSelector","matchIndex","firstElement","newElements","currentSelectorPathIndex","currentSelectorPathElementIndex","currentValue","derived","createDerived","newAllExtends","lastIndex","JoinSelectorVisitor","getIsOutput","joinSelectors","multiMedia","isRooted","_context","CSSVisitorUtils","bodyRules","rule","isSilent","owner","thing","compiledRulesBody","keepOnlyVisibleChilds","removeVisibilityBlock","firstRoot","hasVisibleSelector","ToCSSVisitor","utils","variable","mixinNode","visitExtend","extendNode","visitComment","commentNode","originalRules","resolveVisibility","visitAtRuleWithBody","visitAtRuleWithoutBody","visitAnonymous","anonymousNode","nodeRules","hasFakeRuleset","getBodyRules","_mergeRules","name","charset","debugInfo","comment","Comment","checkValidNodes","isRoot","Declaration","Call","allowRoot","rulesets","_compileRulesetPaths","nodeRuleCnt","_removeDuplicateRules","isVisibleRuleset","p","ruleList","ruleCache","ruleCSS","groups","groupsArr","i_3","merge","group","result_1","space_1","comma_1","Expression","important","Value","MarkVisibleSelectorsVisitor","ExtendVisitor","furthest","furthestPossibleErrorMessage","chunks","current","currentPos","saveStack","parserInput","skipWhitespace","nextChar","oldi","oldj","curr","endIndex","mem","inp","charCodeAt","autoCommentAbsorb","isLineComment","nextNewLine","text","commentStore","nextStarSlash","save","restore","possibleErrorMessage","state","forget","isWhitespace","offset","pos","code","$re","tok","exec","$char","$peekChar","$str","tokLength","$quoted","startChar","currentPosition","$parseUntil","testChar","quote","returnVal","inComment","blockDepth","blockStack","parseGroups","startPos","lastPos","loop","char","expected","peek","peekChar","currentChar","prevChar","getInput","peekNotNumeric","start","chunkInput","failFunction","fail","lastOpening","lastOpeningParen","lastMultiComment","lastMultiCommentEndBrace","chunkerCurrentIndex","currentChunkStartIndex","cc","cc2","len","level","parenLevel","emitFrom","emitChunk","force","String","fromCharCode","chunker","end","furthestReachedEnd","furthestChar","makeRegistry","base","_data","addMultiple","keys","_this","get","getLocalFunctions","inherit","MediaSyntaxOptions","queryInParens","ContainerSyntaxOptions","Parser","currentIndex","parsers","getParserInput","expect","arg","expectChar","getDebugInfo","lineNumber","fileName","parseNode","parseList","returnNodes","parser","additionalData","globalVars","modifyVars","ignored","err","preText","disablePluginRule","plugin","serializeVars","preProcessors","getPreProcessors","process","banner","contentsIgnoredChars","Ruleset","primary","functionRegistry","endInfo","processImports","visitors","mixin","extendRule","definition","declaration","variableCall","entities","atrule","foundSemiColon","mixinLookup","quoted","forceEscaped","isEscaped","customFuncCall","stop","f","ieAlpha","boolean","condition","if","prevArgs","isSemiColonSeparated","argsComma","argsSemiColon","detachedRuleset","assignment","expression","literal","dimension","unicodeDescriptor","entity","url","property","Variable","Property","ch","variableCurly","curly","propertyCurly","colorKeyword","ud","javascript","js","escape","Boolean","parsedName","lookups","inValue","ruleLookups","VariableCall","NamespaceValue","isRule","element","getLookup","hasParens","elem","elemIndex","re","isCall","expressionContainsNamed","nameLoop","expand","returner","variadic","expressions","hasSep","throwAwayComments","cond","params","argInfo","conditions","block","lookupValue","Quoted","attribute","slashedCombinator","isLess","when","cif","content","blockRuleset","Definition","DetachedRuleset","dumpLineNumbers","strictImports","hasDR","ruleProperty","permissiveValue","anonymousValue","untilTokens","done","testCurrentChar","Anonymous","variableRegex","propRegex","import","features","dir","importOptions","mediaFeatures","o","optionName","importOption","mediaFeature","syntaxOptions","rangeP","atomicCondition","rvalue","lvalue","prepareAndGetNestableAtRule","treeType","atRule","nestableAtRule","Media","Container","pluginArgs","nonVendorSpecificName","hasIdentifier","hasExpression","hasUnknown","hasBlock","sub","addition","parens","multiplication","operation","isSpaced","operand","parensInOp","needsParens","logical","next","conditionAnd","negatedCondition","parenthesisCondition","negate","body","me","tryConditionFollowedByParenthesis","preparsedCond","delim","simpleProperty","vars","name_1","evaldCondition","getElements","mixinElements_","utils.isNullOrUndefined","mediaEmpty","els","importManager","createEmptySelectors","el","sels","olen","mixinElements","isJustParentSelector","Keyword","True","False","mapLines","rulesetLike","isRulesetLike","MATH","asComment","ctx","asMediaQuery","filenameWithProtocol","lineSeparator","lastRule","prevMath","evaldValue","mathBypass","evalName","importantResult","makeImportant","isCompressed","defaultFunc","value_","error_","reset","_lookups","_variables","_properties","isRuleset","selCnt","hasVariable","hasOnePassingSelector","toParseSelectors","startingIndex","selectorFileInfo","utils.flattenArray","subRule","originalRuleset","allowImports","globalFunctionRegistry","ctxFrames","ctxSelectors","evalImports","rsRules","evalFirst","mediaBlockCount","mediaBlocks","resetCache","bubbleSelectors","importRules","matchArgs","matchCondition","lastSelector","_rulesets","variables","hash","properties","name_2","decl","parseValue","lastDeclaration","toParse","transformDeclaration","nodes_1","filtRules","prependRule","find","foundMixins","ruleNodes","tabLevel","sep","tabRuleStr","tabSetStr","charsetNodeIndex","importNodeIndex","isCharset","pathCnt","pathSubCnt","currentLastRule","joinSelector","createParenthesis","elementsToPak","originalElement","replacementParen","insideParent","createSelector","containedElement","addReplacementIntoPath","beginningPath","addPath","replacedElement","originalSelector","newSelectorPath","newJoinedSelector","parentEl","restOfPath","addAllReplacementsIntoPath","addPaths","mergeElementsOnToSelectors","sel","deriveSelector","deriveFrom","newPaths","replaceParentSelector","inSelector","currentElements","newSelectors","selectorsMultiplied","maybeSelector","hadParentSelector","nestedSelector","replaced","nestedPaths","replacedNewSelectors","concatenated","AtRule","outputRuleset","mediaPathBackup","mediaBlocksBackup","mediaPath","callEval","Unit","numerator","denominator","backupUnit","sort","strictUnits","returnStr","is","unitString","toUpperCase","isLength","RegExp","isSingular","usedUnits","mapUnit","groupName","atomicUnit","cancel","counter","count","Dimension","unit","parseFloat","isNaN","toColor","strValue","convertTo","unify","numericCompare","conversions","targetUnit","applyUnit","derivedConversions","Operation","operands","__assign","t","noSpacing","returnValue","doubleParen","functionCaller","evalArgs","commentFilter","subNodes","to","from","pack","ar","calc","currentMathContext","funcCaller","FunctionCaller","isValid","columnNumber","evaluating","frame","fun","mergeRules","less","vArr","escaped","containsVariables","that","iterativeReplace","regexp","replacementFnc","evaluatedValue","URL","isEvald","urlArgs","NestableAtRulePrototype","evalTop","evalNested","permute","fragment","rest","Import","pathValue","reference","evalPath","doEval","addVisibilityBlock","registry","newImport","JsEvalNode","evaluateJavaScript","evalContext","javascriptEnabled","jsify","toJS","JavaScript","string","Assignment","Condition","QueryInParens","op2","mvalue","UnicodeDescriptor","Negative","next_id","selectorElements","selfElements","ruleCall","substring","arity","optionalParameters","required","evalParams","mixinEnv","evaldArguments","varargs","isNamedFound","argIndex","argsLength","evalCall","_arguments","mixinFrames","allArgsCnt","requiredArgsCnt","MixinCall","mixins","mixinPath","argValue","isRecursive","isOneFound","candidate","defaultResult","noArgumentsFilter","candidates","conditionResult","calcDefGroup","namespace","MixinDefinition","format","newRules","_setVisibilityToReplacement","replacement","AbstractFileManager","lastIndexOf","ext","tryAppendExtension","basePath","laterPath","baseUrl","urlDirectories","baseUrlDirectories","urlParts","extractUrlParts","baseUrlParts","diff","hostPart","directories","urlPartsRegex","rawDirectories","rawPath","fileUrl","require","AbstractPluginLoader","pluginOptions","pluginObj","localModule","shortname","FileManager","trySetOptions","use","exports","loader","validatePlugin","minVersion","compareVersion","addPlugin","setOptions","version","versionToString","aVersion","bVersion","versionString","plugins","printUsage","If","trueValue","falseValue","isdefined","colorFunctions","hsla","origColor","hsl","number","rgba","size","m1","m2","hue","hsv","hsva","vs","floor","perm","saturation","lightness","hsvhue","hsvsaturation","hsvvalue","luminance","saturate","amount","method","desaturate","lighten","darken","fadein","fadeout","fade","spin","mix","color1","color2","weight","w","w1","w2","greyscale","contrast","dark","light","threshold","argb","tint","shade","colorBlend","mode","cb","cs","cr","ab","as","colorBlendModeFunctions","multiply","screen","overlay","softlight","sqrt","hardlight","difference","abs","exclusion","average","negation","getItemsFromNode","_SELF","~","_i","expr","values","range","step","stepValue","list","each","rs","iterator","tryEval","Quote","valueName","keyName","indexName","MathHelper","fn","mathFunctions","ceil","sin","cos","atan","asin","acos","mathHelper","fraction","num","minMax","isMin","currentUnified","referenceUnified","unitStatic","unitClone","order","convert","pi","mod","y","percentage","evaluated","encodeURI","pattern","flags","%","token","encodeURIComponent","isa","Type","isunit","isruleset","iscolor","isnumber","isstring","iskeyword","isurl","ispixel","ispercentage","isem","get-unit","colorBlending","fallback","functionThis","data-uri","mimetypeNode","filePathNode","mimetype","filePath","entryPath","fragmentStart","utils.clone","rawBuffer","getFileManager","useBase64","mimeLookup","charsetLookup","fileSync","loadFileSync","buf","encodeBase64","uri","dataUri","svg-gradient","direction","stops","gradientDirectionSvg","position","positionValue","gradientType","rectangleDimension","renderEnv","directionValue","throwArgumentDescriptor","types","evaldRoot","evalEnv","visitorIterator","preEvalVisitors","first","isPreEvalVisitor","isPreVisitor","pm","postProcessors","installedPlugins","pluginCache","Loader","PluginLoader","PluginManager","install","preProcessor","priority","indexToInsertAt","postProcessor","manager","PluginManagerFactory","newFactory","major","minor","patch","pre","build","sourceMapOutput","sourceMapBuilder","parseTree","SourceMapBuilder","ParseTree","transformTree","toCSSOptions","sourceMap","getPostProcessors","file_1","getExternalSourceMap","files","rootFilename","SourceMapOutput","contentsIgnoredCharsMap","contentsMap","sourceMapFilename","sourceMapURL","outputFilename","sourceMapOutputFilename","sourceMapBasepath","sourceMapRootpath","outputSourceFiles","sourceMapGenerator","sourceMapFileInline","disableSourcemapAnnotation","sourceMapInputFilename","normalizeFilename","removeBasepath","getCSSAppendage","_css","_rootNode","_contentsMap","_contentsIgnoredCharsMap","_sourceMapFilename","_outputFilename","_sourceMapBasepath","_sourceMapRootpath","_outputSourceFiles","_sourceMapGeneratorConstructor","getSourceMapGenerator","_lineNumber","_column","sourceLines","columns","sourceColumns","inputSource","_sourceMapGenerator","addMapping","generated","source","file","sourceRoot","setSourceContent","sourceMapContent","stringify","toJSON","rootFileInfo","mime","queue","ImportManager","pluginLoader","fileParsedFunc","importedEqualsRoot","newFileInfo","loadedFile","promise","loadFileCallback","resolvedFilename","pathDiff","isPathAbsolute","alwaysMakePathsAbsolute","newEnv","evalPlugin","syncImport","loadPluginSync","loadPlugin","loadFile","then","render","utils.copyOptions","self_1","Promise","resolve","reject","Render","context_1","pluginManager_1","reUsePluginManager","imports_1","evalResult","fileContent","parseVersion","initial","data","ctor","api","fileCache","doXHR","errback","xhr","XMLHttpRequest","async","isFileProtocol","fileAsync","handleResponse","status","responseText","getResponseHeader","overrideMimeType","open","setRequestHeader","send","onreadystatechange","readyState","supports","clearFileCache","location","useFileCache","lessText_1","webInfo","lastModified","Date","log","fulfill","catch","rootHref","errorReporting","errors","errorline","classname","logLevel","errorConsole","timer","filenameNoPath","className","innerHTML","browser","style","env","setInterval","replaceChild","clearInterval","errorHTML","remove","removeErrorHTML","depends","lint","insecure","protocol","poll","hostname","port","onReady","addDefaultOptions","LESS_PLUGINS","lessRoot","FM","addFileManager","loggers","console","LogListener","ErrorReporting","cache","localStorage","setCSS","setItem","getCSS","getItem","timestamp","valueOf","Cache","imageSize","imageFunctions","image-size","image-width","image-height","ImageSize","typePattern","thisArg","curryArgs","loadStyles","instanceOptions","loadStyleSheet","reload","remaining","local","loadInitialFileCallback","loadStyleSheets","sheets","watch","watchMode","watchTimer","unwatch","registerStylesheetsImmediately","links","rel","registerStylesheets","record","refresh","startTime","endTime","totalMilliseconds","remainingSheets","refreshStyles","resolveOrReject","pageLoadFinished"],"mappings":";;;;;;;;;8OACgBA,EAAUC,GACtB,OAAOA,EAAKC,QAAQ,qBAAsB,IACrCA,QAAQ,qBAAsB,IAC9BA,QAAQ,MAAO,IACfA,QAAQ,eAAgB,IACxBA,QA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xDvH,EAAQ,CACJqH,YACAC,UACAC,oBACAb,OAAQtf,EAAKsf,OAAOvoD,UAG5BmpD,EAAU,IAAI/E,OACf8D,EAAQj1B,GAGf80B,EAAW90B,OAInBgW,EAAKqgB,cAAgBvB,EACd9e,EHrQEjqB,CAAKne,OAAQzC,IAU1B,SAASmrD,GAAgB/G,GACjBA,EAAK9/C,UACLgkD,QAAQtlD,KAAKohD,GAEZpkD,GAAQ4kD,OACT7iD,GAAKM,YAAY2kD,WAZzBvkD,OAAOooC,KAAOA,GAgBV7qC,GAAQ+nD,UACJ,SAASlqC,KAAKpb,OAAOkjD,SAAS1iB,OAC9B4H,GAAKuf,QAGJpqD,GAAQ4kD,QACT1jC,GAAM,oCACNnf,GAAOpB,SAASoB,MAAQpB,SAASqB,qBAAqB,QAAQ,IAC9DglD,GAAQrmD,SAASU,cAAc,UAEzBqC,KAAO,WACTsjD,GAAMxlD,WACNwlD,GAAMxlD,WAAWc,QAAU4e,GAE3B8lC,GAAMvlD,YAAYd,SAASe,eAAewf,KAG9Cnf,GAAKN,YAAYulD,KAErBnc,GAAK2f,iCACL3f,GAAKugB,iBAAmBvgB,GAAKggB,QAAqB,gBAAbhgB,GAAKoc,KAAuB7D,KAAK+H,GAAiBA"}
\ No newline at end of file
+{"version":3,"file":"less.min.js","sources":["../src/less-browser/utils.js","../src/less-browser/browser.js","../src/less/logger.js","../src/less/environment/environment.js","../src/less/data/colors.js","../src/less/data/unit-conversions.js","../src/less/data/index.js","../src/less/tree/node.js","../src/less/tree/color.js","../src/less/tree/paren.js","../src/less/tree/combinator.js","../src/less/tree/element.js","../src/less/constants.js","../node_modules/is-what/dist/index.esm.js","../node_modules/copy-anything/dist/index.esm.js","../src/less/utils.js","../src/less/less-error.js","../src/less/visitors/visitor.js","../src/less/contexts.js","../src/less/visitors/import-sequencer.js","../src/less/visitors/import-visitor.js","../src/less/visitors/set-tree-visibility-visitor.js","../src/less/visitors/extend-visitor.js","../src/less/visitors/join-selector-visitor.js","../src/less/visitors/to-css-visitor.js","../src/less/visitors/index.js","../src/less/parser/parser-input.js","../src/less/parser/chunker.js","../src/less/functions/function-registry.js","../src/less/tree/atrule-syntax.js","../src/less/parser/parser.js","../src/less/tree/selector.js","../src/less/tree/value.js","../src/less/tree/keyword.js","../src/less/tree/anonymous.js","../src/less/tree/declaration.js","../src/less/tree/debug-info.js","../src/less/tree/comment.js","../src/less/functions/default.js","../src/less/tree/ruleset.js","../src/less/tree/atrule.js","../src/less/tree/detached-ruleset.js","../src/less/tree/unit.js","../src/less/tree/dimension.js","../src/less/tree/operation.js","../node_modules/tslib/tslib.es6.js","../src/less/tree/expression.js","../src/less/functions/function-caller.js","../src/less/tree/call.js","../src/less/tree/variable.js","../src/less/tree/property.js","../src/less/tree/attribute.js","../src/less/tree/quoted.js","../src/less/tree/url.js","../src/less/tree/nested-at-rule.js","../src/less/tree/media.js","../src/less/tree/import.js","../src/less/tree/js-eval-node.js","../src/less/tree/javascript.js","../src/less/tree/assignment.js","../src/less/tree/condition.js","../src/less/tree/query-in-parens.js","../src/less/tree/container.js","../src/less/tree/unicode-descriptor.js","../src/less/tree/negative.js","../src/less/tree/extend.js","../src/less/tree/variable-call.js","../src/less/tree/namespace-value.js","../src/less/tree/mixin-definition.js","../src/less/tree/mixin-call.js","../src/less/tree/index.js","../src/less/environment/abstract-file-manager.js","../src/less/environment/abstract-plugin-loader.js","../src/less/functions/boolean.js","../src/less/functions/color.js","../src/less/functions/color-blending.js","../src/less/functions/list.js","../src/less/functions/math-helper.js","../src/less/functions/math.js","../src/less/functions/number.js","../src/less/functions/string.js","../src/less/functions/types.js","../src/less/functions/index.js","../src/less/functions/data-uri.js","../src/less/functions/svg.js","../src/less/transform-tree.js","../src/less/plugin-manager.js","../node_modules/parse-node-version/index.js","../src/less-browser/file-manager.js","../src/less/index.js","../src/less/parse-tree.js","../src/less/source-map-builder.js","../src/less/source-map-output.js","../src/less/import-manager.js","../src/less/render.js","../src/less/parse.js","../src/less-browser/plugin-loader.js","../src/less-browser/error-reporting.js","../src/less-browser/bootstrap.js","../src/less/default-options.js","../src/less-browser/add-default-options.js","../src/less-browser/index.js","../src/less-browser/log-listener.js","../src/less-browser/cache.js","../src/less-browser/image-size.js"],"sourcesContent":["\nexport function extractId(href) {\n return href.replace(/^[a-z-]+:\\/+?[^/]+/, '') // Remove protocol & domain\n .replace(/[?&]livereload=\\w+/, '') // Remove LiveReload cachebuster\n .replace(/^\\//, '') // Remove root /\n .replace(/\\.[a-zA-Z]+$/, '') // Remove simple extension\n .replace(/[^.\\w-]+/g, '-') // Replace illegal characters\n .replace(/\\./g, ':'); // Replace dots with colons(for valid id)\n}\n\nexport function addDataAttr(options, tag) {\n if (!tag) {return;} // in case of tag is null or undefined\n for (const opt in tag.dataset) {\n if (Object.prototype.hasOwnProperty.call(tag.dataset, opt)) {\n if (opt === 'env' || opt === 'dumpLineNumbers' || opt === 'rootpath' || opt === 'errorReporting') {\n options[opt] = tag.dataset[opt];\n } else {\n try {\n options[opt] = JSON.parse(tag.dataset[opt]);\n }\n catch (_) {}\n }\n }\n }\n}\n","import * as utils from './utils';\n\nexport default {\n createCSS: function (document, styles, sheet) {\n // Strip the query-string\n const href = sheet.href || '';\n\n // If there is no title set, use the filename, minus the extension\n const id = `less:${sheet.title || utils.extractId(href)}`;\n\n // If this has already been inserted into the DOM, we may need to replace it\n const oldStyleNode = document.getElementById(id);\n let keepOldStyleNode = false;\n\n // Create a new stylesheet node for insertion or (if necessary) replacement\n const styleNode = document.createElement('style');\n styleNode.setAttribute('type', 'text/css');\n if (sheet.media) {\n styleNode.setAttribute('media', sheet.media);\n }\n styleNode.id = id;\n\n if (!styleNode.styleSheet) {\n styleNode.appendChild(document.createTextNode(styles));\n\n // If new contents match contents of oldStyleNode, don't replace oldStyleNode\n keepOldStyleNode = (oldStyleNode !== null && oldStyleNode.childNodes.length > 0 && styleNode.childNodes.length > 0 &&\n oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue);\n }\n\n const head = document.getElementsByTagName('head')[0];\n\n // If there is no oldStyleNode, just append; otherwise, only append if we need\n // to replace oldStyleNode with an updated stylesheet\n if (oldStyleNode === null || keepOldStyleNode === false) {\n const nextEl = sheet && sheet.nextSibling || null;\n if (nextEl) {\n nextEl.parentNode.insertBefore(styleNode, nextEl);\n } else {\n head.appendChild(styleNode);\n }\n }\n if (oldStyleNode && keepOldStyleNode === false) {\n oldStyleNode.parentNode.removeChild(oldStyleNode);\n }\n\n // For IE.\n // This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash.\n // See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head\n if (styleNode.styleSheet) {\n try {\n styleNode.styleSheet.cssText = styles;\n } catch (e) {\n throw new Error('Couldn\\'t reassign styleSheet.cssText.');\n }\n }\n },\n currentScript: function(window) {\n const document = window.document;\n return document.currentScript || (() => {\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n })();\n }\n};\n","export default {\n error: function(msg) {\n this._fireEvent('error', msg);\n },\n warn: function(msg) {\n this._fireEvent('warn', msg);\n },\n info: function(msg) {\n this._fireEvent('info', msg);\n },\n debug: function(msg) {\n this._fireEvent('debug', msg);\n },\n addListener: function(listener) {\n this._listeners.push(listener);\n },\n removeListener: function(listener) {\n for (let i = 0; i < this._listeners.length; i++) {\n if (this._listeners[i] === listener) {\n this._listeners.splice(i, 1);\n return;\n }\n }\n },\n _fireEvent: function(type, msg) {\n for (let i = 0; i < this._listeners.length; i++) {\n const logFunction = this._listeners[i][type];\n if (logFunction) {\n logFunction(msg);\n }\n }\n },\n _listeners: []\n};\n","/**\n * @todo Document why this abstraction exists, and the relationship between\n * environment, file managers, and plugin manager\n */\n\nimport logger from '../logger';\n\nclass Environment {\n constructor(externalEnvironment, fileManagers) {\n this.fileManagers = fileManagers || [];\n externalEnvironment = externalEnvironment || {};\n\n const optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator'];\n const requiredFunctions = [];\n const functions = requiredFunctions.concat(optionalFunctions);\n\n for (let i = 0; i < functions.length; i++) {\n const propName = functions[i];\n const environmentFunc = externalEnvironment[propName];\n if (environmentFunc) {\n this[propName] = environmentFunc.bind(externalEnvironment);\n } else if (i < requiredFunctions.length) {\n this.warn(`missing required function in environment - ${propName}`);\n }\n }\n }\n\n getFileManager(filename, currentDirectory, options, environment, isSync) {\n\n if (!filename) {\n logger.warn('getFileManager called with no filename.. Please report this issue. continuing.');\n }\n if (currentDirectory === undefined) {\n logger.warn('getFileManager called with null directory.. Please report this issue. continuing.');\n }\n\n let fileManagers = this.fileManagers;\n if (options.pluginManager) {\n fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers());\n }\n for (let i = fileManagers.length - 1; i >= 0 ; i--) {\n const fileManager = fileManagers[i];\n if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) {\n return fileManager;\n }\n }\n return null;\n }\n\n addFileManager(fileManager) {\n this.fileManagers.push(fileManager);\n }\n\n clearFileManagers() {\n this.fileManagers = [];\n }\n}\n\nexport default Environment;\n","export default {\n 'aliceblue':'#f0f8ff',\n 'antiquewhite':'#faebd7',\n 'aqua':'#00ffff',\n 'aquamarine':'#7fffd4',\n 'azure':'#f0ffff',\n 'beige':'#f5f5dc',\n 'bisque':'#ffe4c4',\n 'black':'#000000',\n 'blanchedalmond':'#ffebcd',\n 'blue':'#0000ff',\n 'blueviolet':'#8a2be2',\n 'brown':'#a52a2a',\n 'burlywood':'#deb887',\n 'cadetblue':'#5f9ea0',\n 'chartreuse':'#7fff00',\n 'chocolate':'#d2691e',\n 'coral':'#ff7f50',\n 'cornflowerblue':'#6495ed',\n 'cornsilk':'#fff8dc',\n 'crimson':'#dc143c',\n 'cyan':'#00ffff',\n 'darkblue':'#00008b',\n 'darkcyan':'#008b8b',\n 'darkgoldenrod':'#b8860b',\n 'darkgray':'#a9a9a9',\n 'darkgrey':'#a9a9a9',\n 'darkgreen':'#006400',\n 'darkkhaki':'#bdb76b',\n 'darkmagenta':'#8b008b',\n 'darkolivegreen':'#556b2f',\n 'darkorange':'#ff8c00',\n 'darkorchid':'#9932cc',\n 'darkred':'#8b0000',\n 'darksalmon':'#e9967a',\n 'darkseagreen':'#8fbc8f',\n 'darkslateblue':'#483d8b',\n 'darkslategray':'#2f4f4f',\n 'darkslategrey':'#2f4f4f',\n 'darkturquoise':'#00ced1',\n 'darkviolet':'#9400d3',\n 'deeppink':'#ff1493',\n 'deepskyblue':'#00bfff',\n 'dimgray':'#696969',\n 'dimgrey':'#696969',\n 'dodgerblue':'#1e90ff',\n 'firebrick':'#b22222',\n 'floralwhite':'#fffaf0',\n 'forestgreen':'#228b22',\n 'fuchsia':'#ff00ff',\n 'gainsboro':'#dcdcdc',\n 'ghostwhite':'#f8f8ff',\n 'gold':'#ffd700',\n 'goldenrod':'#daa520',\n 'gray':'#808080',\n 'grey':'#808080',\n 'green':'#008000',\n 'greenyellow':'#adff2f',\n 'honeydew':'#f0fff0',\n 'hotpink':'#ff69b4',\n 'indianred':'#cd5c5c',\n 'indigo':'#4b0082',\n 'ivory':'#fffff0',\n 'khaki':'#f0e68c',\n 'lavender':'#e6e6fa',\n 'lavenderblush':'#fff0f5',\n 'lawngreen':'#7cfc00',\n 'lemonchiffon':'#fffacd',\n 'lightblue':'#add8e6',\n 'lightcoral':'#f08080',\n 'lightcyan':'#e0ffff',\n 'lightgoldenrodyellow':'#fafad2',\n 'lightgray':'#d3d3d3',\n 'lightgrey':'#d3d3d3',\n 'lightgreen':'#90ee90',\n 'lightpink':'#ffb6c1',\n 'lightsalmon':'#ffa07a',\n 'lightseagreen':'#20b2aa',\n 'lightskyblue':'#87cefa',\n 'lightslategray':'#778899',\n 'lightslategrey':'#778899',\n 'lightsteelblue':'#b0c4de',\n 'lightyellow':'#ffffe0',\n 'lime':'#00ff00',\n 'limegreen':'#32cd32',\n 'linen':'#faf0e6',\n 'magenta':'#ff00ff',\n 'maroon':'#800000',\n 'mediumaquamarine':'#66cdaa',\n 'mediumblue':'#0000cd',\n 'mediumorchid':'#ba55d3',\n 'mediumpurple':'#9370d8',\n 'mediumseagreen':'#3cb371',\n 'mediumslateblue':'#7b68ee',\n 'mediumspringgreen':'#00fa9a',\n 'mediumturquoise':'#48d1cc',\n 'mediumvioletred':'#c71585',\n 'midnightblue':'#191970',\n 'mintcream':'#f5fffa',\n 'mistyrose':'#ffe4e1',\n 'moccasin':'#ffe4b5',\n 'navajowhite':'#ffdead',\n 'navy':'#000080',\n 'oldlace':'#fdf5e6',\n 'olive':'#808000',\n 'olivedrab':'#6b8e23',\n 'orange':'#ffa500',\n 'orangered':'#ff4500',\n 'orchid':'#da70d6',\n 'palegoldenrod':'#eee8aa',\n 'palegreen':'#98fb98',\n 'paleturquoise':'#afeeee',\n 'palevioletred':'#d87093',\n 'papayawhip':'#ffefd5',\n 'peachpuff':'#ffdab9',\n 'peru':'#cd853f',\n 'pink':'#ffc0cb',\n 'plum':'#dda0dd',\n 'powderblue':'#b0e0e6',\n 'purple':'#800080',\n 'rebeccapurple':'#663399',\n 'red':'#ff0000',\n 'rosybrown':'#bc8f8f',\n 'royalblue':'#4169e1',\n 'saddlebrown':'#8b4513',\n 'salmon':'#fa8072',\n 'sandybrown':'#f4a460',\n 'seagreen':'#2e8b57',\n 'seashell':'#fff5ee',\n 'sienna':'#a0522d',\n 'silver':'#c0c0c0',\n 'skyblue':'#87ceeb',\n 'slateblue':'#6a5acd',\n 'slategray':'#708090',\n 'slategrey':'#708090',\n 'snow':'#fffafa',\n 'springgreen':'#00ff7f',\n 'steelblue':'#4682b4',\n 'tan':'#d2b48c',\n 'teal':'#008080',\n 'thistle':'#d8bfd8',\n 'tomato':'#ff6347',\n 'turquoise':'#40e0d0',\n 'violet':'#ee82ee',\n 'wheat':'#f5deb3',\n 'white':'#ffffff',\n 'whitesmoke':'#f5f5f5',\n 'yellow':'#ffff00',\n 'yellowgreen':'#9acd32'\n};","export default {\n length: {\n 'm': 1,\n 'cm': 0.01,\n 'mm': 0.001,\n 'in': 0.0254,\n 'px': 0.0254 / 96,\n 'pt': 0.0254 / 72,\n 'pc': 0.0254 / 72 * 12\n },\n duration: {\n 's': 1,\n 'ms': 0.001\n },\n angle: {\n 'rad': 1 / (2 * Math.PI),\n 'deg': 1 / 360,\n 'grad': 1 / 400,\n 'turn': 1\n }\n};","import colors from './colors';\nimport unitConversions from './unit-conversions';\n\nexport default { colors, unitConversions };\n","/**\n * The reason why Node is a class and other nodes simply do not extend\n * from Node (since we're transpiling) is due to this issue:\n * \n * @see https://github.com/less/less.js/issues/3434\n */\nclass Node {\n constructor() {\n this.parent = null;\n this.visibilityBlocks = undefined;\n this.nodeVisible = undefined;\n this.rootNode = null;\n this.parsed = null;\n }\n\n get currentFileInfo() {\n return this.fileInfo();\n }\n\n get index() {\n return this.getIndex();\n }\n\n setParent(nodes, parent) {\n function set(node) {\n if (node && node instanceof Node) {\n node.parent = parent;\n }\n }\n if (Array.isArray(nodes)) {\n nodes.forEach(set);\n }\n else {\n set(nodes);\n }\n }\n\n getIndex() {\n return this._index || (this.parent && this.parent.getIndex()) || 0;\n }\n\n fileInfo() {\n return this._fileInfo || (this.parent && this.parent.fileInfo()) || {};\n }\n\n isRulesetLike() { return false; }\n\n toCSS(context) {\n const strs = [];\n this.genCSS(context, {\n // remove when genCSS has JSDoc types\n // eslint-disable-next-line no-unused-vars\n add: function(chunk, fileInfo, index) {\n strs.push(chunk);\n },\n isEmpty: function () {\n return strs.length === 0;\n }\n });\n return strs.join('');\n }\n\n genCSS(context, output) {\n output.add(this.value);\n }\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n }\n\n eval() { return this; }\n\n _operate(context, op, a, b) {\n switch (op) {\n case '+': return a + b;\n case '-': return a - b;\n case '*': return a * b;\n case '/': return a / b;\n }\n }\n\n fround(context, value) {\n const precision = context && context.numPrecision;\n // add \"epsilon\" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded:\n return (precision) ? Number((value + 2e-16).toFixed(precision)) : value;\n }\n\n static compare(a, b) {\n /* returns:\n -1: a < b\n 0: a = b\n 1: a > b\n and *any* other value for a != b (e.g. undefined, NaN, -2 etc.) */\n\n if ((a.compare) &&\n // for \"symmetric results\" force toCSS-based comparison\n // of Quoted or Anonymous if either value is one of those\n !(b.type === 'Quoted' || b.type === 'Anonymous')) {\n return a.compare(b);\n } else if (b.compare) {\n return -b.compare(a);\n } else if (a.type !== b.type) {\n return undefined;\n }\n\n a = a.value;\n b = b.value;\n if (!Array.isArray(a)) {\n return a === b ? 0 : undefined;\n }\n if (a.length !== b.length) {\n return undefined;\n }\n for (let i = 0; i < a.length; i++) {\n if (Node.compare(a[i], b[i]) !== 0) {\n return undefined;\n }\n }\n return 0;\n }\n\n static numericCompare(a, b) {\n return a < b ? -1\n : a === b ? 0\n : a > b ? 1 : undefined;\n }\n\n // Returns true if this node represents root of ast imported by reference\n blocksVisibility() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n return this.visibilityBlocks !== 0;\n }\n\n addVisibilityBlock() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks + 1;\n }\n\n removeVisibilityBlock() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks - 1;\n }\n\n // Turns on node visibility - if called node will be shown in output regardless\n // of whether it comes from import by reference or not\n ensureVisibility() {\n this.nodeVisible = true;\n }\n\n // Turns off node visibility - if called node will NOT be shown in output regardless\n // of whether it comes from import by reference or not\n ensureInvisibility() {\n this.nodeVisible = false;\n }\n\n // return values:\n // false - the node must not be visible\n // true - the node must be visible\n // undefined or null - the node has the same visibility as its parent\n isVisible() {\n return this.nodeVisible;\n }\n\n visibilityInfo() {\n return {\n visibilityBlocks: this.visibilityBlocks,\n nodeVisible: this.nodeVisible\n };\n }\n\n copyVisibilityInfo(info) {\n if (!info) {\n return;\n }\n this.visibilityBlocks = info.visibilityBlocks;\n this.nodeVisible = info.nodeVisible;\n }\n}\n\nexport default Node;\n","import Node from './node';\nimport colors from '../data/colors';\n\n//\n// RGB Colors - #ff0014, #eee\n//\nconst Color = function(rgb, a, originalForm) {\n const self = this;\n //\n // The end goal here, is to parse the arguments\n // into an integer triplet, such as `128, 255, 0`\n //\n // This facilitates operations and conversions.\n //\n if (Array.isArray(rgb)) {\n this.rgb = rgb;\n } else if (rgb.length >= 6) {\n this.rgb = [];\n rgb.match(/.{2}/g).map(function (c, i) {\n if (i < 3) {\n self.rgb.push(parseInt(c, 16));\n } else {\n self.alpha = (parseInt(c, 16)) / 255;\n }\n });\n } else {\n this.rgb = [];\n rgb.split('').map(function (c, i) {\n if (i < 3) {\n self.rgb.push(parseInt(c + c, 16));\n } else {\n self.alpha = (parseInt(c + c, 16)) / 255;\n }\n });\n }\n this.alpha = this.alpha || (typeof a === 'number' ? a : 1);\n if (typeof originalForm !== 'undefined') {\n this.value = originalForm;\n }\n}\n\nColor.prototype = Object.assign(new Node(), {\n type: 'Color',\n\n luma() {\n let r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255;\n\n r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4);\n g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4);\n b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4);\n\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n },\n\n toCSS(context, doNotCompress) {\n const compress = context && context.compress && !doNotCompress;\n let color;\n let alpha;\n let colorFunction;\n let args = [];\n\n // `value` is set if this color was originally\n // converted from a named color string so we need\n // to respect this and try to output named color too.\n alpha = this.fround(context, this.alpha);\n\n if (this.value) {\n if (this.value.indexOf('rgb') === 0) {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n } else if (this.value.indexOf('hsl') === 0) {\n if (alpha < 1) {\n colorFunction = 'hsla';\n } else {\n colorFunction = 'hsl';\n }\n } else {\n return this.value;\n }\n } else {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n }\n\n switch (colorFunction) {\n case 'rgba':\n args = this.rgb.map(function (c) {\n return clamp(Math.round(c), 255);\n }).concat(clamp(alpha, 1));\n break;\n case 'hsla':\n args.push(clamp(alpha, 1));\n // eslint-disable-next-line no-fallthrough\n case 'hsl':\n color = this.toHSL();\n args = [\n this.fround(context, color.h),\n `${this.fround(context, color.s * 100)}%`,\n `${this.fround(context, color.l * 100)}%`\n ].concat(args);\n }\n\n if (colorFunction) {\n // Values are capped between `0` and `255`, rounded and zero-padded.\n return `${colorFunction}(${args.join(`,${compress ? '' : ' '}`)})`;\n }\n\n color = this.toRGB();\n\n if (compress) {\n const splitcolor = color.split('');\n\n // Convert color to short format\n if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) {\n color = `#${splitcolor[1]}${splitcolor[3]}${splitcolor[5]}`;\n }\n }\n\n return color;\n },\n\n //\n // Operations have to be done per-channel, if not,\n // channels will spill onto each other. Once we have\n // our result, in the form of an integer triplet,\n // we create a new Color node to hold the result.\n //\n operate(context, op, other) {\n const rgb = new Array(3);\n const alpha = this.alpha * (1 - other.alpha) + other.alpha;\n for (let c = 0; c < 3; c++) {\n rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]);\n }\n return new Color(rgb, alpha);\n },\n\n toRGB() {\n return toHex(this.rgb);\n },\n\n toHSL() {\n const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;\n\n const max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h;\n let s;\n const l = (max + min) / 2;\n const d = max - min;\n\n if (max === min) {\n h = s = 0;\n } else {\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, l, a };\n },\n\n // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript\n toHSV() {\n const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;\n\n const max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h;\n let s;\n const v = max;\n\n const d = max - min;\n if (max === 0) {\n s = 0;\n } else {\n s = d / max;\n }\n\n if (max === min) {\n h = 0;\n } else {\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, v, a };\n },\n\n toARGB() {\n return toHex([this.alpha * 255].concat(this.rgb));\n },\n\n compare(x) {\n return (x.rgb &&\n x.rgb[0] === this.rgb[0] &&\n x.rgb[1] === this.rgb[1] &&\n x.rgb[2] === this.rgb[2] &&\n x.alpha === this.alpha) ? 0 : undefined;\n }\n});\n\nColor.fromKeyword = function(keyword) {\n let c;\n const key = keyword.toLowerCase();\n // eslint-disable-next-line no-prototype-builtins\n if (colors.hasOwnProperty(key)) {\n c = new Color(colors[key].slice(1));\n }\n else if (key === 'transparent') {\n c = new Color([0, 0, 0], 0);\n }\n\n if (c) {\n c.value = keyword;\n return c;\n }\n};\n\nfunction clamp(v, max) {\n return Math.min(Math.max(v, 0), max);\n}\n\nfunction toHex(v) {\n return `#${v.map(function (c) {\n c = clamp(Math.round(c), 255);\n return (c < 16 ? '0' : '') + c.toString(16);\n }).join('')}`;\n}\n\nexport default Color;\n","import Node from './node';\n\nconst Paren = function(node) {\n this.value = node;\n};\n\nParen.prototype = Object.assign(new Node(), {\n type: 'Paren',\n\n genCSS(context, output) {\n output.add('(');\n this.value.genCSS(context, output);\n output.add(')');\n },\n\n eval(context) {\n return new Paren(this.value.eval(context));\n }\n});\n\nexport default Paren;\n","import Node from './node';\nconst _noSpaceCombinators = {\n '': true,\n ' ': true,\n '|': true\n};\n\nconst Combinator = function(value) {\n if (value === ' ') {\n this.value = ' ';\n this.emptyOrWhitespace = true;\n } else {\n this.value = value ? value.trim() : '';\n this.emptyOrWhitespace = this.value === '';\n }\n}\n\nCombinator.prototype = Object.assign(new Node(), {\n type: 'Combinator',\n\n genCSS(context, output) {\n const spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' ';\n output.add(spaceOrEmpty + this.value + spaceOrEmpty);\n }\n});\n\nexport default Combinator;\n","import Node from './node';\nimport Paren from './paren';\nimport Combinator from './combinator';\n\nconst Element = function(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) {\n this.combinator = combinator instanceof Combinator ?\n combinator : new Combinator(combinator);\n\n if (typeof value === 'string') {\n this.value = value.trim();\n } else if (value) {\n this.value = value;\n } else {\n this.value = '';\n }\n this.isVariable = isVariable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.combinator, this);\n}\n\nElement.prototype = Object.assign(new Node(), {\n type: 'Element',\n\n accept(visitor) {\n const value = this.value;\n this.combinator = visitor.visit(this.combinator);\n if (typeof value === 'object') {\n this.value = visitor.visit(value);\n }\n },\n\n eval(context) {\n return new Element(this.combinator,\n this.value.eval ? this.value.eval(context) : this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n clone() {\n return new Element(this.combinator,\n this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context), this.fileInfo(), this.getIndex());\n },\n\n toCSS(context) {\n context = context || {};\n let value = this.value;\n const firstSelector = context.firstSelector;\n if (value instanceof Paren) {\n // selector in parens should not be affected by outer selector\n // flags (breaks only interpolated selectors - see #1973)\n context.firstSelector = true;\n }\n value = value.toCSS ? value.toCSS(context) : value;\n context.firstSelector = firstSelector;\n if (value === '' && this.combinator.value.charAt(0) === '&') {\n return '';\n } else {\n return this.combinator.toCSS(context) + value;\n }\n }\n});\n\nexport default Element;\n","\nexport const Math = {\n ALWAYS: 0,\n PARENS_DIVISION: 1,\n PARENS: 2\n // removed - STRICT_LEGACY: 3\n};\n\nexport const RewriteUrls = {\n OFF: 0,\n LOCAL: 1,\n ALL: 2\n};","/**\r\n * Returns the object type of the given payload\r\n *\r\n * @param {*} payload\r\n * @returns {string}\r\n */\r\nfunction getType(payload) {\r\n return Object.prototype.toString.call(payload).slice(8, -1);\r\n}\r\n/**\r\n * Returns whether the payload is undefined\r\n *\r\n * @param {*} payload\r\n * @returns {payload is undefined}\r\n */\r\nfunction isUndefined(payload) {\r\n return getType(payload) === 'Undefined';\r\n}\r\n/**\r\n * Returns whether the payload is null\r\n *\r\n * @param {*} payload\r\n * @returns {payload is null}\r\n */\r\nfunction isNull(payload) {\r\n return getType(payload) === 'Null';\r\n}\r\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Record}\r\n */\r\nfunction isPlainObject(payload) {\r\n if (getType(payload) !== 'Object')\r\n return false;\r\n return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;\r\n}\r\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Record}\r\n */\r\nfunction isObject(payload) {\r\n return isPlainObject(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is { [K in any]: never }}\r\n */\r\nfunction isEmptyObject(payload) {\r\n return isPlainObject(payload) && Object.keys(payload).length === 0;\r\n}\r\n/**\r\n * Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Record}\r\n */\r\nfunction isAnyObject(payload) {\r\n return getType(payload) === 'Object';\r\n}\r\n/**\r\n * Returns whether the payload is an object like a type passed in < >\r\n *\r\n * Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.\r\n *\r\n * @template T this must be passed in < >\r\n * @param {*} payload\r\n * @returns {payload is T}\r\n */\r\nfunction isObjectLike(payload) {\r\n return isAnyObject(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a function (regular or async)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is AnyFunction}\r\n */\r\nfunction isFunction(payload) {\r\n return typeof payload === \"function\";\r\n}\r\n/**\r\n * Returns whether the payload is an array\r\n *\r\n * @param {any} payload\r\n * @returns {payload is any[]}\r\n */\r\nfunction isArray(payload) {\r\n return getType(payload) === 'Array';\r\n}\r\n/**\r\n * Returns whether the payload is a an array with at least 1 item\r\n *\r\n * @param {*} payload\r\n * @returns {payload is any[]}\r\n */\r\nfunction isFullArray(payload) {\r\n return isArray(payload) && payload.length > 0;\r\n}\r\n/**\r\n * Returns whether the payload is a an empty array\r\n *\r\n * @param {*} payload\r\n * @returns {payload is []}\r\n */\r\nfunction isEmptyArray(payload) {\r\n return isArray(payload) && payload.length === 0;\r\n}\r\n/**\r\n * Returns whether the payload is a string\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isString(payload) {\r\n return getType(payload) === 'String';\r\n}\r\n/**\r\n * Returns whether the payload is a string, BUT returns false for ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isFullString(payload) {\r\n return isString(payload) && payload !== '';\r\n}\r\n/**\r\n * Returns whether the payload is ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isEmptyString(payload) {\r\n return payload === '';\r\n}\r\n/**\r\n * Returns whether the payload is a number (but not NaN)\r\n *\r\n * This will return `false` for `NaN`!!\r\n *\r\n * @param {*} payload\r\n * @returns {payload is number}\r\n */\r\nfunction isNumber(payload) {\r\n return getType(payload) === 'Number' && !isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a boolean\r\n *\r\n * @param {*} payload\r\n * @returns {payload is boolean}\r\n */\r\nfunction isBoolean(payload) {\r\n return getType(payload) === 'Boolean';\r\n}\r\n/**\r\n * Returns whether the payload is a regular expression (RegExp)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is RegExp}\r\n */\r\nfunction isRegExp(payload) {\r\n return getType(payload) === 'RegExp';\r\n}\r\n/**\r\n * Returns whether the payload is a Map\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Map}\r\n */\r\nfunction isMap(payload) {\r\n return getType(payload) === 'Map';\r\n}\r\n/**\r\n * Returns whether the payload is a WeakMap\r\n *\r\n * @param {*} payload\r\n * @returns {payload is WeakMap}\r\n */\r\nfunction isWeakMap(payload) {\r\n return getType(payload) === 'WeakMap';\r\n}\r\n/**\r\n * Returns whether the payload is a Set\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Set}\r\n */\r\nfunction isSet(payload) {\r\n return getType(payload) === 'Set';\r\n}\r\n/**\r\n * Returns whether the payload is a WeakSet\r\n *\r\n * @param {*} payload\r\n * @returns {payload is WeakSet}\r\n */\r\nfunction isWeakSet(payload) {\r\n return getType(payload) === 'WeakSet';\r\n}\r\n/**\r\n * Returns whether the payload is a Symbol\r\n *\r\n * @param {*} payload\r\n * @returns {payload is symbol}\r\n */\r\nfunction isSymbol(payload) {\r\n return getType(payload) === 'Symbol';\r\n}\r\n/**\r\n * Returns whether the payload is a Date, and that the date is valid\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Date}\r\n */\r\nfunction isDate(payload) {\r\n return getType(payload) === 'Date' && !isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a Blob\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Blob}\r\n */\r\nfunction isBlob(payload) {\r\n return getType(payload) === 'Blob';\r\n}\r\n/**\r\n * Returns whether the payload is a File\r\n *\r\n * @param {*} payload\r\n * @returns {payload is File}\r\n */\r\nfunction isFile(payload) {\r\n return getType(payload) === 'File';\r\n}\r\n/**\r\n * Returns whether the payload is a Promise\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Promise}\r\n */\r\nfunction isPromise(payload) {\r\n return getType(payload) === 'Promise';\r\n}\r\n/**\r\n * Returns whether the payload is an Error\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Error}\r\n */\r\nfunction isError(payload) {\r\n return getType(payload) === 'Error';\r\n}\r\n/**\r\n * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is typeof NaN}\r\n */\r\nfunction isNaNValue(payload) {\r\n return getType(payload) === 'Number' && isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is boolean | null | undefined | number | string | symbol)}\r\n */\r\nfunction isPrimitive(payload) {\r\n return (isBoolean(payload) ||\r\n isNull(payload) ||\r\n isUndefined(payload) ||\r\n isNumber(payload) ||\r\n isString(payload) ||\r\n isSymbol(payload));\r\n}\r\n/**\r\n * Returns true whether the payload is null or undefined\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is null | undefined)}\r\n */\r\nfunction isNullOrUndefined(payload) {\r\n return isNull(payload) || isUndefined(payload);\r\n}\r\n/**\r\n * Does a generic check to check that the given payload is of a given type.\r\n * In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!);\r\n * It will, however, differentiate between object and null\r\n *\r\n * @template T\r\n * @param {*} payload\r\n * @param {T} type\r\n * @throws {TypeError} Will throw type error if type is an invalid type\r\n * @returns {payload is T}\r\n */\r\nfunction isType(payload, type) {\r\n if (!(type instanceof Function)) {\r\n throw new TypeError('Type must be a function');\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {\r\n throw new TypeError('Type is not a class');\r\n }\r\n // Classes usually have names (as functions usually have names)\r\n var name = type.name;\r\n return getType(payload) === name || Boolean(payload && payload.constructor === type);\r\n}\n\nexport { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyArray, isEmptyObject, isEmptyString, isError, isFile, isFullArray, isFullString, isFunction, isMap, isNaNValue, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isType, isUndefined, isWeakMap, isWeakSet };\n","import { isArray, isPlainObject } from 'is-what';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\n\nfunction assignProp(carry, key, newVal, originalObject, includeNonenumerable) {\r\n var propType = {}.propertyIsEnumerable.call(originalObject, key)\r\n ? 'enumerable'\r\n : 'nonenumerable';\r\n if (propType === 'enumerable')\r\n carry[key] = newVal;\r\n if (includeNonenumerable && propType === 'nonenumerable') {\r\n Object.defineProperty(carry, key, {\r\n value: newVal,\r\n enumerable: false,\r\n writable: true,\r\n configurable: true,\r\n });\r\n }\r\n}\r\n/**\r\n * Copy (clone) an object and all its props recursively to get rid of any prop referenced of the original object. Arrays are also cloned, however objects inside arrays are still linked.\r\n *\r\n * @export\r\n * @template T\r\n * @param {T} target Target can be anything\r\n * @param {Options} [options={}] Options can be `props` or `nonenumerable`\r\n * @returns {T} the target with replaced values\r\n * @export\r\n */\r\nfunction copy(target, options) {\r\n if (options === void 0) { options = {}; }\r\n if (isArray(target))\r\n return target.map(function (i) { return copy(i, options); });\r\n if (!isPlainObject(target))\r\n return target;\r\n var props = Object.getOwnPropertyNames(target);\r\n var symbols = Object.getOwnPropertySymbols(target);\r\n return __spreadArrays(props, symbols).reduce(function (carry, key) {\r\n if (isArray(options.props) && !options.props.includes(key)) {\r\n return carry;\r\n }\r\n var val = target[key];\r\n var newVal = copy(val, options);\r\n assignProp(carry, key, newVal, target, options.nonenumerable);\r\n return carry;\r\n }, {});\r\n}\n\nexport { copy };\n","/* jshint proto: true */\nimport * as Constants from './constants';\nimport { copy } from 'copy-anything';\n\nexport function getLocation(index, inputStream) {\n let n = index + 1;\n let line = null;\n let column = -1;\n\n while (--n >= 0 && inputStream.charAt(n) !== '\\n') {\n column++;\n }\n\n if (typeof index === 'number') {\n line = (inputStream.slice(0, index).match(/\\n/g) || '').length;\n }\n\n return {\n line,\n column\n };\n}\n\nexport function copyArray(arr) {\n let i;\n const length = arr.length;\n const copy = new Array(length);\n\n for (i = 0; i < length; i++) {\n copy[i] = arr[i];\n }\n return copy;\n}\n\nexport function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n}\n\nexport function defaults(obj1, obj2) {\n let newObj = obj2 || {};\n if (!obj2._defaults) {\n newObj = {};\n const defaults = copy(obj1);\n newObj._defaults = defaults;\n const cloned = obj2 ? copy(obj2) : {};\n Object.assign(newObj, defaults, cloned);\n }\n return newObj;\n}\n\nexport function copyOptions(obj1, obj2) {\n if (obj2 && obj2._defaults) {\n return obj2;\n }\n const opts = defaults(obj1, obj2);\n if (opts.strictMath) {\n opts.math = Constants.Math.PARENS;\n }\n // Back compat with changed relativeUrls option\n if (opts.relativeUrls) {\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n }\n if (typeof opts.math === 'string') {\n switch (opts.math.toLowerCase()) {\n case 'always':\n opts.math = Constants.Math.ALWAYS;\n break;\n case 'parens-division':\n opts.math = Constants.Math.PARENS_DIVISION;\n break;\n case 'strict':\n case 'parens':\n opts.math = Constants.Math.PARENS;\n break;\n default:\n opts.math = Constants.Math.PARENS;\n }\n }\n if (typeof opts.rewriteUrls === 'string') {\n switch (opts.rewriteUrls.toLowerCase()) {\n case 'off':\n opts.rewriteUrls = Constants.RewriteUrls.OFF;\n break;\n case 'local':\n opts.rewriteUrls = Constants.RewriteUrls.LOCAL;\n break;\n case 'all':\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n break;\n }\n }\n return opts;\n}\n\nexport function merge(obj1, obj2) {\n for (const prop in obj2) {\n if (Object.prototype.hasOwnProperty.call(obj2, prop)) {\n obj1[prop] = obj2[prop];\n }\n }\n return obj1;\n}\n\nexport function flattenArray(arr, result = []) {\n for (let i = 0, length = arr.length; i < length; i++) {\n const value = arr[i];\n if (Array.isArray(value)) {\n flattenArray(value, result);\n } else {\n if (value !== undefined) {\n result.push(value);\n }\n }\n }\n return result;\n}\n\nexport function isNullOrUndefined(val) {\n return val === null || val === undefined\n}","import * as utils from './utils';\n\nconst anonymousFunc = /(|Function):(\\d+):(\\d+)/;\n\n/**\n * This is a centralized class of any error that could be thrown internally (mostly by the parser).\n * Besides standard .message it keeps some additional data like a path to the file where the error\n * occurred along with line and column numbers.\n *\n * @class\n * @extends Error\n * @type {module.LessError}\n *\n * @prop {string} type\n * @prop {string} filename\n * @prop {number} index\n * @prop {number} line\n * @prop {number} column\n * @prop {number} callLine\n * @prop {number} callExtract\n * @prop {string[]} extract\n *\n * @param {Object} e - An error object to wrap around or just a descriptive object\n * @param {Object} fileContentMap - An object with file contents in 'contents' property (like importManager) @todo - move to fileManager?\n * @param {string} [currentFilename]\n */\nconst LessError = function(e, fileContentMap, currentFilename) {\n Error.call(this);\n\n const filename = e.filename || currentFilename;\n\n this.message = e.message;\n this.stack = e.stack;\n\n if (fileContentMap && filename) {\n const input = fileContentMap.contents[filename];\n const loc = utils.getLocation(e.index, input);\n var line = loc.line;\n const col = loc.column;\n const callLine = e.call && utils.getLocation(e.call, input).line;\n const lines = input ? input.split('\\n') : '';\n\n this.type = e.type || 'Syntax';\n this.filename = filename;\n this.index = e.index;\n this.line = typeof line === 'number' ? line + 1 : null;\n this.column = col;\n\n if (!this.line && this.stack) {\n const found = this.stack.match(anonymousFunc);\n\n /**\n * We have to figure out how this environment stringifies anonymous functions\n * so we can correctly map plugin errors.\n * \n * Note, in Node 8, the output of anonymous funcs varied based on parameters\n * being present or not, so we inject dummy params.\n */\n const func = new Function('a', 'throw new Error()');\n let lineAdjust = 0;\n try {\n func();\n } catch (e) {\n const match = e.stack.match(anonymousFunc);\n lineAdjust = 1 - parseInt(match[2]);\n }\n\n if (found) {\n if (found[2]) {\n this.line = parseInt(found[2]) + lineAdjust;\n }\n if (found[3]) {\n this.column = parseInt(found[3]);\n }\n }\n }\n\n this.callLine = callLine + 1;\n this.callExtract = lines[callLine];\n\n this.extract = [\n lines[this.line - 2],\n lines[this.line - 1],\n lines[this.line]\n ];\n }\n\n};\n\nif (typeof Object.create === 'undefined') {\n const F = function () {};\n F.prototype = Error.prototype;\n LessError.prototype = new F();\n} else {\n LessError.prototype = Object.create(Error.prototype);\n}\n\nLessError.prototype.constructor = LessError;\n\n/**\n * An overridden version of the default Object.prototype.toString\n * which uses additional information to create a helpful message.\n *\n * @param {Object} options\n * @returns {string}\n */\nLessError.prototype.toString = function(options) {\n options = options || {};\n\n let message = '';\n const extract = this.extract || [];\n let error = [];\n let stylize = function (str) { return str; };\n if (options.stylize) {\n const type = typeof options.stylize;\n if (type !== 'function') {\n throw Error(`options.stylize should be a function, got a ${type}!`);\n }\n stylize = options.stylize;\n }\n\n if (this.line !== null) {\n if (typeof extract[0] === 'string') {\n error.push(stylize(`${this.line - 1} ${extract[0]}`, 'grey'));\n }\n\n if (typeof extract[1] === 'string') {\n let errorTxt = `${this.line} `;\n if (extract[1]) {\n errorTxt += extract[1].slice(0, this.column) +\n stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') +\n extract[1].slice(this.column + 1), 'red'), 'inverse');\n }\n error.push(errorTxt);\n }\n\n if (typeof extract[2] === 'string') {\n error.push(stylize(`${this.line + 1} ${extract[2]}`, 'grey'));\n }\n error = `${error.join('\\n') + stylize('', 'reset')}\\n`;\n }\n\n message += stylize(`${this.type}Error: ${this.message}`, 'red');\n if (this.filename) {\n message += stylize(' in ', 'red') + this.filename;\n }\n if (this.line) {\n message += stylize(` on line ${this.line}, column ${this.column + 1}:`, 'grey');\n }\n\n message += `\\n${error}`;\n\n if (this.callLine) {\n message += `${stylize('from ', 'red') + (this.filename || '')}/n`;\n message += `${stylize(this.callLine, 'grey')} ${this.callExtract}/n`;\n }\n\n return message;\n};\n\nexport default LessError;","import tree from '../tree';\n\nconst _visitArgs = { visitDeeper: true };\nlet _hasIndexed = false;\n\nfunction _noop(node) {\n return node;\n}\n\nfunction indexNodeTypes(parent, ticker) {\n // add .typeIndex to tree node types for lookup table\n let key, child;\n for (key in parent) { \n /* eslint guard-for-in: 0 */\n child = parent[key];\n switch (typeof child) {\n case 'function':\n // ignore bound functions directly on tree which do not have a prototype\n // or aren't nodes\n if (child.prototype && child.prototype.type) {\n child.prototype.typeIndex = ticker++;\n }\n break;\n case 'object':\n ticker = indexNodeTypes(child, ticker);\n break;\n \n }\n }\n return ticker;\n}\n\nclass Visitor {\n constructor(implementation) {\n this._implementation = implementation;\n this._visitInCache = {};\n this._visitOutCache = {};\n\n if (!_hasIndexed) {\n indexNodeTypes(tree, 1);\n _hasIndexed = true;\n }\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n\n const nodeTypeIndex = node.typeIndex;\n if (!nodeTypeIndex) {\n // MixinCall args aren't a node type?\n if (node.value && node.value.typeIndex) {\n this.visit(node.value);\n }\n return node;\n }\n\n const impl = this._implementation;\n let func = this._visitInCache[nodeTypeIndex];\n let funcOut = this._visitOutCache[nodeTypeIndex];\n const visitArgs = _visitArgs;\n let fnName;\n\n visitArgs.visitDeeper = true;\n\n if (!func) {\n fnName = `visit${node.type}`;\n func = impl[fnName] || _noop;\n funcOut = impl[`${fnName}Out`] || _noop;\n this._visitInCache[nodeTypeIndex] = func;\n this._visitOutCache[nodeTypeIndex] = funcOut;\n }\n\n if (func !== _noop) {\n const newNode = func.call(impl, node, visitArgs);\n if (node && impl.isReplacing) {\n node = newNode;\n }\n }\n\n if (visitArgs.visitDeeper && node) {\n if (node.length) {\n for (let i = 0, cnt = node.length; i < cnt; i++) {\n if (node[i].accept) {\n node[i].accept(this);\n }\n }\n } else if (node.accept) {\n node.accept(this);\n }\n }\n\n if (funcOut != _noop) {\n funcOut.call(impl, node);\n }\n\n return node;\n }\n\n visitArray(nodes, nonReplacing) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n\n // Non-replacing\n if (nonReplacing || !this._implementation.isReplacing) {\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n // Replacing\n const out = [];\n for (i = 0; i < cnt; i++) {\n const evald = this.visit(nodes[i]);\n if (evald === undefined) { continue; }\n if (!evald.splice) {\n out.push(evald);\n } else if (evald.length) {\n this.flatten(evald, out);\n }\n }\n return out;\n }\n\n flatten(arr, out) {\n if (!out) {\n out = [];\n }\n\n let cnt, i, item, nestedCnt, j, nestedItem;\n\n for (i = 0, cnt = arr.length; i < cnt; i++) {\n item = arr[i];\n if (item === undefined) {\n continue;\n }\n if (!item.splice) {\n out.push(item);\n continue;\n }\n\n for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) {\n nestedItem = item[j];\n if (nestedItem === undefined) {\n continue;\n }\n if (!nestedItem.splice) {\n out.push(nestedItem);\n } else if (nestedItem.length) {\n this.flatten(nestedItem, out);\n }\n }\n }\n\n return out;\n }\n}\n\nexport default Visitor;\n","const contexts = {};\nexport default contexts;\nimport * as Constants from './constants';\n\nconst copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) {\n if (!original) { return; }\n\n for (let i = 0; i < propertiesToCopy.length; i++) {\n if (Object.prototype.hasOwnProperty.call(original, propertiesToCopy[i])) {\n destination[propertiesToCopy[i]] = original[propertiesToCopy[i]];\n }\n }\n};\n\n/*\n parse is used whilst parsing\n */\nconst parseCopyProperties = [\n // options\n 'paths', // option - unmodified - paths to search for imports on\n 'rewriteUrls', // option - whether to adjust URL's to be relative\n 'rootpath', // option - rootpath to append to URL's\n 'strictImports', // option -\n 'insecure', // option - whether to allow imports from insecure ssl hosts\n 'dumpLineNumbers', // option - whether to dump line numbers\n 'compress', // option - whether to compress\n 'syncImport', // option - whether to import synchronously\n 'chunkInput', // option - whether to chunk input. more performant but causes parse issues.\n 'mime', // browser only - mime type for sheet import\n 'useFileCache', // browser only - whether to use the per file session cache\n // context\n 'processImports', // option & context - whether to process imports. if false then imports will not be imported.\n // Used by the import manager to stop multiple import visitors being created.\n 'pluginManager' // Used as the plugin manager for the session\n];\n\ncontexts.Parse = function(options) {\n copyFromOriginal(options, this, parseCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n};\n\nconst evalCopyProperties = [\n 'paths', // additional include paths\n 'compress', // whether to compress\n 'math', // whether math has to be within parenthesis\n 'strictUnits', // whether units need to evaluate correctly\n 'sourceMap', // whether to output a source map\n 'importMultiple', // whether we are currently importing multiple copies\n 'urlArgs', // whether to add args into url tokens\n 'javascriptEnabled', // option - whether Inline JavaScript is enabled. if undefined, defaults to false\n 'pluginManager', // Used as the plugin manager for the session\n 'importantScope', // used to bubble up !important statements\n 'rewriteUrls' // option - whether to adjust URL's to be relative\n];\n\ncontexts.Eval = function(options, frames) {\n copyFromOriginal(options, this, evalCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n\n this.frames = frames || [];\n this.importantScope = this.importantScope || [];\n};\n\ncontexts.Eval.prototype.enterCalc = function () {\n if (!this.calcStack) {\n this.calcStack = [];\n }\n this.calcStack.push(true);\n this.inCalc = true;\n};\n\ncontexts.Eval.prototype.exitCalc = function () {\n this.calcStack.pop();\n if (!this.calcStack.length) {\n this.inCalc = false;\n }\n};\n\ncontexts.Eval.prototype.inParenthesis = function () {\n if (!this.parensStack) {\n this.parensStack = [];\n }\n this.parensStack.push(true);\n};\n\ncontexts.Eval.prototype.outOfParenthesis = function () {\n this.parensStack.pop();\n};\n\ncontexts.Eval.prototype.inCalc = false;\ncontexts.Eval.prototype.mathOn = true;\ncontexts.Eval.prototype.isMathOn = function (op) {\n if (!this.mathOn) {\n return false;\n }\n if (op === '/' && this.math !== Constants.Math.ALWAYS && (!this.parensStack || !this.parensStack.length)) {\n return false;\n }\n if (this.math > Constants.Math.PARENS_DIVISION) {\n return this.parensStack && this.parensStack.length;\n }\n return true;\n};\n\ncontexts.Eval.prototype.pathRequiresRewrite = function (path) {\n const isRelative = this.rewriteUrls === Constants.RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative;\n\n return isRelative(path);\n};\n\ncontexts.Eval.prototype.rewritePath = function (path, rootpath) {\n let newPath;\n\n rootpath = rootpath || '';\n newPath = this.normalizePath(rootpath + path);\n\n // If a path was explicit relative and the rootpath was not an absolute path\n // we must ensure that the new path is also explicit relative.\n if (isPathLocalRelative(path) &&\n isPathRelative(rootpath) &&\n isPathLocalRelative(newPath) === false) {\n newPath = `./${newPath}`;\n }\n\n return newPath;\n};\n\ncontexts.Eval.prototype.normalizePath = function (path) {\n const segments = path.split('/').reverse();\n let segment;\n\n path = [];\n while (segments.length !== 0) {\n segment = segments.pop();\n switch ( segment ) {\n case '.':\n break;\n case '..':\n if ((path.length === 0) || (path[path.length - 1] === '..')) {\n path.push( segment );\n } else {\n path.pop();\n }\n break;\n default:\n path.push(segment);\n break;\n }\n }\n\n return path.join('/');\n};\n\nfunction isPathRelative(path) {\n return !/^(?:[a-z-]+:|\\/|#)/i.test(path);\n}\n\nfunction isPathLocalRelative(path) {\n return path.charAt(0) === '.';\n}\n\n// todo - do the same for the toCSS ?\n","class ImportSequencer {\n constructor(onSequencerEmpty) {\n this.imports = [];\n this.variableImports = [];\n this._onSequencerEmpty = onSequencerEmpty;\n this._currentDepth = 0;\n }\n\n addImport(callback) {\n const importSequencer = this,\n importItem = {\n callback,\n args: null,\n isReady: false\n };\n this.imports.push(importItem);\n return function() {\n importItem.args = Array.prototype.slice.call(arguments, 0);\n importItem.isReady = true;\n importSequencer.tryRun();\n };\n }\n\n addVariableImport(callback) {\n this.variableImports.push(callback);\n }\n\n tryRun() {\n this._currentDepth++;\n try {\n while (true) {\n while (this.imports.length > 0) {\n const importItem = this.imports[0];\n if (!importItem.isReady) {\n return;\n }\n this.imports = this.imports.slice(1);\n importItem.callback.apply(null, importItem.args);\n }\n if (this.variableImports.length === 0) {\n break;\n }\n const variableImport = this.variableImports[0];\n this.variableImports = this.variableImports.slice(1);\n variableImport();\n }\n } finally {\n this._currentDepth--;\n }\n if (this._currentDepth === 0 && this._onSequencerEmpty) {\n this._onSequencerEmpty();\n }\n }\n}\n\nexport default ImportSequencer;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport contexts from '../contexts';\nimport Visitor from './visitor';\nimport ImportSequencer from './import-sequencer';\nimport * as utils from '../utils';\n\nconst ImportVisitor = function(importer, finish) {\n\n this._visitor = new Visitor(this);\n this._importer = importer;\n this._finish = finish;\n this.context = new contexts.Eval();\n this.importCount = 0;\n this.onceFileDetectionMap = {};\n this.recursionDetector = {};\n this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this));\n};\n\nImportVisitor.prototype = {\n isReplacing: false,\n run: function (root) {\n try {\n // process the contents\n this._visitor.visit(root);\n }\n catch (e) {\n this.error = e;\n }\n\n this.isFinished = true;\n this._sequencer.tryRun();\n },\n _onSequencerEmpty: function() {\n if (!this.isFinished) {\n return;\n }\n this._finish(this.error);\n },\n visitImport: function (importNode, visitArgs) {\n const inlineCSS = importNode.options.inline;\n\n if (!importNode.css || inlineCSS) {\n\n const context = new contexts.Eval(this.context, utils.copyArray(this.context.frames));\n const importParent = context.frames[0];\n\n this.importCount++;\n if (importNode.isVariableImport()) {\n this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent));\n } else {\n this.processImportNode(importNode, context, importParent);\n }\n }\n visitArgs.visitDeeper = false;\n },\n processImportNode: function(importNode, context, importParent) {\n let evaldImportNode;\n const inlineCSS = importNode.options.inline;\n\n try {\n evaldImportNode = importNode.evalForImport(context);\n } catch (e) {\n if (!e.filename) { e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename; }\n // attempt to eval properly and treat as css\n importNode.css = true;\n // if that fails, this error will be thrown\n importNode.error = e;\n }\n\n if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) {\n\n if (evaldImportNode.options.multiple) {\n context.importMultiple = true;\n }\n\n // try appending if we haven't determined if it is css or not\n const tryAppendLessExtension = evaldImportNode.css === undefined;\n\n for (let i = 0; i < importParent.rules.length; i++) {\n if (importParent.rules[i] === importNode) {\n importParent.rules[i] = evaldImportNode;\n break;\n }\n }\n\n const onImported = this.onImported.bind(this, evaldImportNode, context), sequencedOnImported = this._sequencer.addImport(onImported);\n\n this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(),\n evaldImportNode.options, sequencedOnImported);\n } else {\n this.importCount--;\n if (this.isFinished) {\n this._sequencer.tryRun();\n }\n }\n },\n onImported: function (importNode, context, e, root, importedAtRoot, fullPath) {\n if (e) {\n if (!e.filename) {\n e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename;\n }\n this.error = e;\n }\n\n const importVisitor = this,\n inlineCSS = importNode.options.inline,\n isPlugin = importNode.options.isPlugin,\n isOptional = importNode.options.optional,\n duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector;\n\n if (!context.importMultiple) {\n if (duplicateImport) {\n importNode.skip = true;\n } else {\n importNode.skip = function() {\n if (fullPath in importVisitor.onceFileDetectionMap) {\n return true;\n }\n importVisitor.onceFileDetectionMap[fullPath] = true;\n return false;\n };\n }\n }\n\n if (!fullPath && isOptional) {\n importNode.skip = true;\n }\n\n if (root) {\n importNode.root = root;\n importNode.importedFilename = fullPath;\n\n if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) {\n importVisitor.recursionDetector[fullPath] = true;\n\n const oldContext = this.context;\n this.context = context;\n try {\n this._visitor.visit(root);\n } catch (e) {\n this.error = e;\n }\n this.context = oldContext;\n }\n }\n\n importVisitor.importCount--;\n\n if (importVisitor.isFinished) {\n importVisitor._sequencer.tryRun();\n }\n },\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.unshift(declNode);\n } else {\n visitArgs.visitDeeper = false;\n }\n },\n visitDeclarationOut: function(declNode) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.shift();\n }\n },\n visitAtRule: function (atRuleNode, visitArgs) {\n this.context.frames.unshift(atRuleNode);\n },\n visitAtRuleOut: function (atRuleNode) {\n this.context.frames.shift();\n },\n visitMixinDefinition: function (mixinDefinitionNode, visitArgs) {\n this.context.frames.unshift(mixinDefinitionNode);\n },\n visitMixinDefinitionOut: function (mixinDefinitionNode) {\n this.context.frames.shift();\n },\n visitRuleset: function (rulesetNode, visitArgs) {\n this.context.frames.unshift(rulesetNode);\n },\n visitRulesetOut: function (rulesetNode) {\n this.context.frames.shift();\n },\n visitMedia: function (mediaNode, visitArgs) {\n this.context.frames.unshift(mediaNode.rules[0]);\n },\n visitMediaOut: function (mediaNode) {\n this.context.frames.shift();\n }\n};\nexport default ImportVisitor;\n","class SetTreeVisibilityVisitor {\n constructor(visible) {\n this.visible = visible;\n }\n\n run(root) {\n this.visit(root);\n }\n\n visitArray(nodes) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n if (node.constructor === Array) {\n return this.visitArray(node);\n }\n\n if (!node.blocksVisibility || node.blocksVisibility()) {\n return node;\n }\n if (this.visible) {\n node.ensureVisibility();\n } else {\n node.ensureInvisibility();\n }\n\n node.accept(this);\n return node;\n }\n}\n\nexport default SetTreeVisibilityVisitor;","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport tree from '../tree';\nimport Visitor from './visitor';\nimport logger from '../logger';\nimport * as utils from '../utils';\n\n/* jshint loopfunc:true */\n\nclass ExtendFinderVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n this.contexts = [];\n this.allExtendsStack = [[]];\n }\n\n run(root) {\n root = this._visitor.visit(root);\n root.allExtends = this.allExtendsStack[0];\n return root;\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n\n let i;\n let j;\n let extend;\n const allSelectorsExtendList = [];\n let extendList;\n\n // get &:extend(.a); rules which apply to all selectors in this ruleset\n const rules = rulesetNode.rules, ruleCnt = rules ? rules.length : 0;\n for (i = 0; i < ruleCnt; i++) {\n if (rulesetNode.rules[i] instanceof tree.Extend) {\n allSelectorsExtendList.push(rules[i]);\n rulesetNode.extendOnEveryPath = true;\n }\n }\n\n // now find every selector and apply the extends that apply to all extends\n // and the ones which apply to an individual extend\n const paths = rulesetNode.paths;\n for (i = 0; i < paths.length; i++) {\n const selectorPath = paths[i], selector = selectorPath[selectorPath.length - 1], selExtendList = selector.extendList;\n\n extendList = selExtendList ? utils.copyArray(selExtendList).concat(allSelectorsExtendList)\n : allSelectorsExtendList;\n\n if (extendList) {\n extendList = extendList.map(function(allSelectorsExtend) {\n return allSelectorsExtend.clone();\n });\n }\n\n for (j = 0; j < extendList.length; j++) {\n this.foundExtends = true;\n extend = extendList[j];\n extend.findSelfSelectors(selectorPath);\n extend.ruleset = rulesetNode;\n if (j === 0) { extend.firstExtendOnThisSelectorPath = true; }\n this.allExtendsStack[this.allExtendsStack.length - 1].push(extend);\n }\n }\n\n this.contexts.push(rulesetNode.selectors);\n }\n\n visitRulesetOut(rulesetNode) {\n if (!rulesetNode.root) {\n this.contexts.length = this.contexts.length - 1;\n }\n }\n\n visitMedia(mediaNode, visitArgs) {\n mediaNode.allExtends = [];\n this.allExtendsStack.push(mediaNode.allExtends);\n }\n\n visitMediaOut(mediaNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n atRuleNode.allExtends = [];\n this.allExtendsStack.push(atRuleNode.allExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n}\n\nclass ProcessExtendsVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n const extendFinder = new ExtendFinderVisitor();\n this.extendIndices = {};\n extendFinder.run(root);\n if (!extendFinder.foundExtends) { return root; }\n root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends));\n this.allExtendsStack = [root.allExtends];\n const newRoot = this._visitor.visit(root);\n this.checkExtendsForNonMatched(root.allExtends);\n return newRoot;\n }\n\n checkExtendsForNonMatched(extendList) {\n const indices = this.extendIndices;\n extendList.filter(function(extend) {\n return !extend.hasFoundMatches && extend.parent_ids.length == 1;\n }).forEach(function(extend) {\n let selector = '_unknown_';\n try {\n selector = extend.selector.toCSS({});\n }\n catch (_) {}\n\n if (!indices[`${extend.index} ${selector}`]) {\n indices[`${extend.index} ${selector}`] = true;\n logger.warn(`extend '${selector}' has no matches`);\n }\n });\n }\n\n doExtendChaining(extendsList, extendsListTarget, iterationCount) {\n //\n // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering\n // and pasting the selector we would do normally, but we are also adding an extend with the same target selector\n // this means this new extend can then go and alter other extends\n //\n // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors\n // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already\n // processed if we look at each selector at a time, as is done in visitRuleset\n\n let extendIndex;\n\n let targetExtendIndex;\n let matches;\n const extendsToAdd = [];\n let newSelector;\n const extendVisitor = this;\n let selectorPath;\n let extend;\n let targetExtend;\n let newExtend;\n\n iterationCount = iterationCount || 0;\n\n // loop through comparing every extend with every target extend.\n // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place\n // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one\n // and the second is the target.\n // the separation into two lists allows us to process a subset of chains with a bigger set, as is the\n // case when processing media queries\n for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) {\n for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) {\n\n extend = extendsList[extendIndex];\n targetExtend = extendsListTarget[targetExtendIndex];\n\n // look for circular references\n if ( extend.parent_ids.indexOf( targetExtend.object_id ) >= 0 ) { continue; }\n\n // find a match in the target extends self selector (the bit before :extend)\n selectorPath = [targetExtend.selfSelectors[0]];\n matches = extendVisitor.findMatch(extend, selectorPath);\n\n if (matches.length) {\n extend.hasFoundMatches = true;\n\n // we found a match, so for each self selector..\n extend.selfSelectors.forEach(function(selfSelector) {\n const info = targetExtend.visibilityInfo();\n\n // process the extend as usual\n newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible());\n\n // but now we create a new extend from it\n newExtend = new(tree.Extend)(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info);\n newExtend.selfSelectors = newSelector;\n\n // add the extend onto the list of extends for that selector\n newSelector[newSelector.length - 1].extendList = [newExtend];\n\n // record that we need to add it.\n extendsToAdd.push(newExtend);\n newExtend.ruleset = targetExtend.ruleset;\n\n // remember its parents for circular references\n newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids);\n\n // only process the selector once.. if we have :extend(.a,.b) then multiple\n // extends will look at the same selector path, so when extending\n // we know that any others will be duplicates in terms of what is added to the css\n if (targetExtend.firstExtendOnThisSelectorPath) {\n newExtend.firstExtendOnThisSelectorPath = true;\n targetExtend.ruleset.paths.push(newSelector);\n }\n });\n }\n }\n }\n\n if (extendsToAdd.length) {\n // try to detect circular references to stop a stack overflow.\n // may no longer be needed.\n this.extendChainCount++;\n if (iterationCount > 100) {\n let selectorOne = '{unable to calculate}';\n let selectorTwo = '{unable to calculate}';\n try {\n selectorOne = extendsToAdd[0].selfSelectors[0].toCSS();\n selectorTwo = extendsToAdd[0].selector.toCSS();\n }\n catch (e) {}\n throw { message: `extend circular reference detected. One of the circular extends is currently:${selectorOne}:extend(${selectorTwo})`};\n }\n\n // now process the new extends on the existing rules so that we can handle a extending b extending c extending\n // d extending e...\n return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1));\n } else {\n return extendsToAdd;\n }\n }\n\n visitDeclaration(ruleNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitSelector(selectorNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n let matches;\n let pathIndex;\n let extendIndex;\n const allExtends = this.allExtendsStack[this.allExtendsStack.length - 1];\n const selectorsToAdd = [];\n const extendVisitor = this;\n let selectorPath;\n\n // look at each selector path in the ruleset, find any extend matches and then copy, find and replace\n\n for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) {\n for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) {\n selectorPath = rulesetNode.paths[pathIndex];\n\n // extending extends happens initially, before the main pass\n if (rulesetNode.extendOnEveryPath) { continue; }\n const extendList = selectorPath[selectorPath.length - 1].extendList;\n if (extendList && extendList.length) { continue; }\n\n matches = this.findMatch(allExtends[extendIndex], selectorPath);\n\n if (matches.length) {\n allExtends[extendIndex].hasFoundMatches = true;\n\n allExtends[extendIndex].selfSelectors.forEach(function(selfSelector) {\n let extendedSelectors;\n extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible());\n selectorsToAdd.push(extendedSelectors);\n });\n }\n }\n }\n rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd);\n }\n\n findMatch(extend, haystackSelectorPath) {\n //\n // look through the haystack selector path to try and find the needle - extend.selector\n // returns an array of selector matches that can then be replaced\n //\n let haystackSelectorIndex;\n\n let hackstackSelector;\n let hackstackElementIndex;\n let haystackElement;\n let targetCombinator;\n let i;\n const extendVisitor = this;\n const needleElements = extend.selector.elements;\n const potentialMatches = [];\n let potentialMatch;\n const matches = [];\n\n // loop through the haystack elements\n for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) {\n hackstackSelector = haystackSelectorPath[haystackSelectorIndex];\n\n for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) {\n\n haystackElement = hackstackSelector.elements[hackstackElementIndex];\n\n // if we allow elements before our match we can add a potential match every time. otherwise only at the first element.\n if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) {\n potentialMatches.push({pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0,\n initialCombinator: haystackElement.combinator});\n }\n\n for (i = 0; i < potentialMatches.length; i++) {\n potentialMatch = potentialMatches[i];\n\n // selectors add \" \" onto the first element. When we use & it joins the selectors together, but if we don't\n // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to\n // work out what the resulting combinator will be\n targetCombinator = haystackElement.combinator.value;\n if (targetCombinator === '' && hackstackElementIndex === 0) {\n targetCombinator = ' ';\n }\n\n // if we don't match, null our match to indicate failure\n if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) ||\n (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) {\n potentialMatch = null;\n } else {\n potentialMatch.matched++;\n }\n\n // if we are still valid and have finished, test whether we have elements after and whether these are allowed\n if (potentialMatch) {\n potentialMatch.finished = potentialMatch.matched === needleElements.length;\n if (potentialMatch.finished &&\n (!extend.allowAfter &&\n (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) {\n potentialMatch = null;\n }\n }\n // if null we remove, if not, we are still valid, so either push as a valid match or continue\n if (potentialMatch) {\n if (potentialMatch.finished) {\n potentialMatch.length = needleElements.length;\n potentialMatch.endPathIndex = haystackSelectorIndex;\n potentialMatch.endPathElementIndex = hackstackElementIndex + 1; // index after end of match\n potentialMatches.length = 0; // we don't allow matches to overlap, so start matching again\n matches.push(potentialMatch);\n }\n } else {\n potentialMatches.splice(i, 1);\n i--;\n }\n }\n }\n }\n return matches;\n }\n\n isElementValuesEqual(elementValue1, elementValue2) {\n if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') {\n return elementValue1 === elementValue2;\n }\n if (elementValue1 instanceof tree.Attribute) {\n if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) {\n return false;\n }\n if (!elementValue1.value || !elementValue2.value) {\n if (elementValue1.value || elementValue2.value) {\n return false;\n }\n return true;\n }\n elementValue1 = elementValue1.value.value || elementValue1.value;\n elementValue2 = elementValue2.value.value || elementValue2.value;\n return elementValue1 === elementValue2;\n }\n elementValue1 = elementValue1.value;\n elementValue2 = elementValue2.value;\n if (elementValue1 instanceof tree.Selector) {\n if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) {\n return false;\n }\n for (let i = 0; i < elementValue1.elements.length; i++) {\n if (elementValue1.elements[i].combinator.value !== elementValue2.elements[i].combinator.value) {\n if (i !== 0 || (elementValue1.elements[i].combinator.value || ' ') !== (elementValue2.elements[i].combinator.value || ' ')) {\n return false;\n }\n }\n if (!this.isElementValuesEqual(elementValue1.elements[i].value, elementValue2.elements[i].value)) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n\n extendSelector(matches, selectorPath, replacementSelector, isVisible) {\n\n // for a set of matches, replace each match with the replacement selector\n\n let currentSelectorPathIndex = 0, currentSelectorPathElementIndex = 0, path = [], matchIndex, selector, firstElement, match, newElements;\n\n for (matchIndex = 0; matchIndex < matches.length; matchIndex++) {\n match = matches[matchIndex];\n selector = selectorPath[match.pathIndex];\n firstElement = new tree.Element(\n match.initialCombinator,\n replacementSelector.elements[0].value,\n replacementSelector.elements[0].isVariable,\n replacementSelector.elements[0].getIndex(),\n replacementSelector.elements[0].fileInfo()\n );\n\n if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n\n newElements = selector.elements\n .slice(currentSelectorPathElementIndex, match.index)\n .concat([firstElement])\n .concat(replacementSelector.elements.slice(1));\n\n if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) {\n path[path.length - 1].elements =\n path[path.length - 1].elements.concat(newElements);\n } else {\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex));\n\n path.push(new tree.Selector(\n newElements\n ));\n }\n currentSelectorPathIndex = match.endPathIndex;\n currentSelectorPathElementIndex = match.endPathElementIndex;\n if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) {\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n }\n\n if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathIndex++;\n }\n\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length));\n path = path.map(function (currentValue) {\n // we can re-use elements here, because the visibility property matters only for selectors\n const derived = currentValue.createDerived(currentValue.elements);\n if (isVisible) {\n derived.ensureVisibility();\n } else {\n derived.ensureInvisibility();\n }\n return derived;\n });\n return path;\n }\n\n visitMedia(mediaNode, visitArgs) {\n let newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitMediaOut(mediaNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n let newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n}\n\nexport default ProcessExtendsVisitor;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport Visitor from './visitor';\n\nclass JoinSelectorVisitor {\n constructor() {\n this.contexts = [[]];\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n return this._visitor.visit(root);\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n const paths = [];\n let selectors;\n\n this.contexts.push(paths);\n\n if (!rulesetNode.root) {\n selectors = rulesetNode.selectors;\n if (selectors) {\n selectors = selectors.filter(function(selector) { return selector.getIsOutput(); });\n rulesetNode.selectors = selectors.length ? selectors : (selectors = null);\n if (selectors) { rulesetNode.joinSelectors(paths, context, selectors); }\n }\n if (!selectors) { rulesetNode.rules = null; }\n rulesetNode.paths = paths;\n }\n }\n\n visitRulesetOut(rulesetNode) {\n this.contexts.length = this.contexts.length - 1;\n }\n\n visitMedia(mediaNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia);\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n if (atRuleNode.rules && atRuleNode.rules.length) {\n atRuleNode.rules[0].root = (atRuleNode.isRooted || context.length === 0 || null);\n }\n }\n}\n\nexport default JoinSelectorVisitor;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport tree from '../tree';\nimport Visitor from './visitor';\n\nclass CSSVisitorUtils {\n constructor(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n }\n\n containsSilentNonBlockedChild(bodyRules) {\n let rule;\n if (!bodyRules) {\n return false;\n }\n for (let r = 0; r < bodyRules.length; r++) {\n rule = bodyRules[r];\n if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) {\n // the atrule contains something that was referenced (likely by extend)\n // therefore it needs to be shown in output too\n return true;\n }\n }\n return false;\n }\n\n keepOnlyVisibleChilds(owner) {\n if (owner && owner.rules) {\n owner.rules = owner.rules.filter(thing => thing.isVisible());\n }\n }\n\n isEmpty(owner) {\n return (owner && owner.rules) \n ? (owner.rules.length === 0) : true;\n }\n\n hasVisibleSelector(rulesetNode) {\n return (rulesetNode && rulesetNode.paths)\n ? (rulesetNode.paths.length > 0) : false;\n }\n\n resolveVisibility(node) {\n if (!node.blocksVisibility()) {\n if (this.isEmpty(node)) {\n return ;\n }\n\n return node;\n }\n\n const compiledRulesBody = node.rules[0];\n this.keepOnlyVisibleChilds(compiledRulesBody);\n\n if (this.isEmpty(compiledRulesBody)) {\n return ;\n }\n\n node.ensureVisibility();\n node.removeVisibilityBlock();\n\n return node;\n }\n\n isVisibleRuleset(rulesetNode) {\n if (rulesetNode.firstRoot) {\n return true;\n }\n\n if (this.isEmpty(rulesetNode)) {\n return false;\n }\n\n if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) {\n return false;\n }\n\n return true;\n }\n}\n\nconst ToCSSVisitor = function(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n this.utils = new CSSVisitorUtils(context);\n};\n\nToCSSVisitor.prototype = {\n isReplacing: true,\n run: function (root) {\n return this._visitor.visit(root);\n },\n\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.blocksVisibility() || declNode.variable) {\n return;\n }\n return declNode;\n },\n\n visitMixinDefinition: function (mixinNode, visitArgs) {\n // mixin definitions do not get eval'd - this means they keep state\n // so we have to clear that state here so it isn't used if toCSS is called twice\n mixinNode.frames = [];\n },\n\n visitExtend: function (extendNode, visitArgs) {\n },\n\n visitComment: function (commentNode, visitArgs) {\n if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) {\n return;\n }\n return commentNode;\n },\n\n visitMedia: function(mediaNode, visitArgs) {\n const originalRules = mediaNode.rules[0].rules;\n mediaNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n return this.utils.resolveVisibility(mediaNode, originalRules);\n },\n\n visitImport: function (importNode, visitArgs) {\n if (importNode.blocksVisibility()) {\n return ;\n }\n return importNode;\n },\n\n visitAtRule: function(atRuleNode, visitArgs) {\n if (atRuleNode.rules && atRuleNode.rules.length) {\n return this.visitAtRuleWithBody(atRuleNode, visitArgs);\n } else {\n return this.visitAtRuleWithoutBody(atRuleNode, visitArgs);\n }\n },\n\n visitAnonymous: function(anonymousNode, visitArgs) {\n if (!anonymousNode.blocksVisibility()) {\n anonymousNode.accept(this._visitor);\n return anonymousNode;\n }\n },\n\n visitAtRuleWithBody: function(atRuleNode, visitArgs) {\n // if there is only one nested ruleset and that one has no path, then it is\n // just fake ruleset\n function hasFakeRuleset(atRuleNode) {\n const bodyRules = atRuleNode.rules;\n return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0);\n }\n function getBodyRules(atRuleNode) {\n const nodeRules = atRuleNode.rules;\n if (hasFakeRuleset(atRuleNode)) {\n return nodeRules[0].rules;\n }\n\n return nodeRules;\n }\n // it is still true that it is only one ruleset in array\n // this is last such moment\n // process childs\n const originalRules = getBodyRules(atRuleNode);\n atRuleNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n if (!this.utils.isEmpty(atRuleNode)) {\n this._mergeRules(atRuleNode.rules[0].rules);\n }\n\n return this.utils.resolveVisibility(atRuleNode, originalRules);\n },\n\n visitAtRuleWithoutBody: function(atRuleNode, visitArgs) {\n if (atRuleNode.blocksVisibility()) {\n return;\n }\n\n if (atRuleNode.name === '@charset') {\n // Only output the debug info together with subsequent @charset definitions\n // a comment (or @media statement) before the actual @charset atrule would\n // be considered illegal css as it has to be on the first line\n if (this.charset) {\n if (atRuleNode.debugInfo) {\n const comment = new tree.Comment(`/* ${atRuleNode.toCSS(this._context).replace(/\\n/g, '')} */\\n`);\n comment.debugInfo = atRuleNode.debugInfo;\n return this._visitor.visit(comment);\n }\n return;\n }\n this.charset = true;\n }\n\n return atRuleNode;\n },\n\n checkValidNodes: function(rules, isRoot) {\n if (!rules) {\n return;\n }\n\n for (let i = 0; i < rules.length; i++) {\n const ruleNode = rules[i];\n if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) {\n throw { message: 'Properties must be inside selector blocks. They cannot be in the root',\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode instanceof tree.Call) {\n throw { message: `Function '${ruleNode.name}' did not return a root node`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode.type && !ruleNode.allowRoot) {\n throw { message: `${ruleNode.type} node returned by a function is not valid here`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n }\n },\n\n visitRuleset: function (rulesetNode, visitArgs) {\n // at this point rulesets are nested into each other\n let rule;\n\n const rulesets = [];\n\n this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot);\n\n if (!rulesetNode.root) {\n // remove invisible paths\n this._compileRulesetPaths(rulesetNode);\n\n // remove rulesets from this ruleset body and compile them separately\n const nodeRules = rulesetNode.rules;\n\n let nodeRuleCnt = nodeRules ? nodeRules.length : 0;\n for (let i = 0; i < nodeRuleCnt; ) {\n rule = nodeRules[i];\n if (rule && rule.rules) {\n // visit because we are moving them out from being a child\n rulesets.push(this._visitor.visit(rule));\n nodeRules.splice(i, 1);\n nodeRuleCnt--;\n continue;\n }\n i++;\n }\n // accept the visitor to remove rules and refactor itself\n // then we can decide nogw whether we want it or not\n // compile body\n if (nodeRuleCnt > 0) {\n rulesetNode.accept(this._visitor);\n } else {\n rulesetNode.rules = null;\n }\n visitArgs.visitDeeper = false;\n } else { // if (! rulesetNode.root) {\n rulesetNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n }\n\n if (rulesetNode.rules) {\n this._mergeRules(rulesetNode.rules);\n this._removeDuplicateRules(rulesetNode.rules);\n }\n\n // now decide whether we keep the ruleset\n if (this.utils.isVisibleRuleset(rulesetNode)) {\n rulesetNode.ensureVisibility();\n rulesets.splice(0, 0, rulesetNode);\n }\n\n if (rulesets.length === 1) {\n return rulesets[0];\n }\n return rulesets;\n },\n\n _compileRulesetPaths: function(rulesetNode) {\n if (rulesetNode.paths) {\n rulesetNode.paths = rulesetNode.paths\n .filter(p => {\n let i;\n if (p[0].elements[0].combinator.value === ' ') {\n p[0].elements[0].combinator = new(tree.Combinator)('');\n }\n for (i = 0; i < p.length; i++) {\n if (p[i].isVisible() && p[i].getIsOutput()) {\n return true;\n }\n }\n return false;\n });\n }\n },\n\n _removeDuplicateRules: function(rules) {\n if (!rules) { return; }\n\n // remove duplicates\n const ruleCache = {};\n\n let ruleList;\n let rule;\n let i;\n\n for (i = rules.length - 1; i >= 0 ; i--) {\n rule = rules[i];\n if (rule instanceof tree.Declaration) {\n if (!ruleCache[rule.name]) {\n ruleCache[rule.name] = rule;\n } else {\n ruleList = ruleCache[rule.name];\n if (ruleList instanceof tree.Declaration) {\n ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)];\n }\n const ruleCSS = rule.toCSS(this._context);\n if (ruleList.indexOf(ruleCSS) !== -1) {\n rules.splice(i, 1);\n } else {\n ruleList.push(ruleCSS);\n }\n }\n }\n }\n },\n\n _mergeRules: function(rules) {\n if (!rules) {\n return; \n }\n\n const groups = {};\n const groupsArr = [];\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n if (rule.merge) {\n const key = rule.name;\n groups[key] ? rules.splice(i--, 1) : \n groupsArr.push(groups[key] = []);\n groups[key].push(rule);\n }\n }\n\n groupsArr.forEach(group => {\n if (group.length > 0) {\n const result = group[0];\n let space = [];\n const comma = [new tree.Expression(space)];\n group.forEach(rule => {\n if ((rule.merge === '+') && (space.length > 0)) {\n comma.push(new tree.Expression(space = []));\n }\n space.push(rule.value);\n result.important = result.important || rule.important;\n });\n result.value = new tree.Value(comma);\n }\n });\n }\n};\n\nexport default ToCSSVisitor;\n","import Visitor from './visitor';\nimport ImportVisitor from './import-visitor';\nimport MarkVisibleSelectorsVisitor from './set-tree-visibility-visitor';\nimport ExtendVisitor from './extend-visitor';\nimport JoinSelectorVisitor from './join-selector-visitor';\nimport ToCSSVisitor from './to-css-visitor';\n\nexport default {\n Visitor,\n ImportVisitor,\n MarkVisibleSelectorsVisitor,\n ExtendVisitor,\n JoinSelectorVisitor,\n ToCSSVisitor\n};\n","import chunker from './chunker';\n\nexport default () => {\n let // Less input string\n input;\n\n let // current chunk\n j;\n\n const // holds state for backtracking\n saveStack = [];\n\n let // furthest index the parser has gone to\n furthest;\n\n let // if this is furthest we got to, this is the probably cause\n furthestPossibleErrorMessage;\n\n let // chunkified input\n chunks;\n\n let // current chunk\n current;\n\n let // index of current chunk, in `input`\n currentPos;\n\n const parserInput = {};\n const CHARCODE_SPACE = 32;\n const CHARCODE_TAB = 9;\n const CHARCODE_LF = 10;\n const CHARCODE_CR = 13;\n const CHARCODE_PLUS = 43;\n const CHARCODE_COMMA = 44;\n const CHARCODE_FORWARD_SLASH = 47;\n const CHARCODE_9 = 57;\n\n function skipWhitespace(length) {\n const oldi = parserInput.i;\n const oldj = j;\n const curr = parserInput.i - currentPos;\n const endIndex = parserInput.i + current.length - curr;\n const mem = (parserInput.i += length);\n const inp = input;\n let c;\n let nextChar;\n let comment;\n\n for (; parserInput.i < endIndex; parserInput.i++) {\n c = inp.charCodeAt(parserInput.i);\n\n if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) {\n nextChar = inp.charAt(parserInput.i + 1);\n if (nextChar === '/') {\n comment = {index: parserInput.i, isLineComment: true};\n let nextNewLine = inp.indexOf('\\n', parserInput.i + 2);\n if (nextNewLine < 0) {\n nextNewLine = endIndex;\n }\n parserInput.i = nextNewLine;\n comment.text = inp.substr(comment.index, parserInput.i - comment.index);\n parserInput.commentStore.push(comment);\n continue;\n } else if (nextChar === '*') {\n const nextStarSlash = inp.indexOf('*/', parserInput.i + 2);\n if (nextStarSlash >= 0) {\n comment = {\n index: parserInput.i,\n text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i),\n isLineComment: false\n };\n parserInput.i += comment.text.length - 1;\n parserInput.commentStore.push(comment);\n continue;\n }\n }\n break;\n }\n\n if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) {\n break;\n }\n }\n\n current = current.slice(length + parserInput.i - mem + curr);\n currentPos = parserInput.i;\n\n if (!current.length) {\n if (j < chunks.length - 1) {\n current = chunks[++j];\n skipWhitespace(0); // skip space at the beginning of a chunk\n return true; // things changed\n }\n parserInput.finished = true;\n }\n\n return oldi !== parserInput.i || oldj !== j;\n }\n\n parserInput.save = () => {\n currentPos = parserInput.i;\n saveStack.push( { current, i: parserInput.i, j });\n };\n parserInput.restore = possibleErrorMessage => {\n\n if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) {\n furthest = parserInput.i;\n furthestPossibleErrorMessage = possibleErrorMessage;\n }\n const state = saveStack.pop();\n current = state.current;\n currentPos = parserInput.i = state.i;\n j = state.j;\n };\n parserInput.forget = () => {\n saveStack.pop();\n };\n parserInput.isWhitespace = offset => {\n const pos = parserInput.i + (offset || 0);\n const code = input.charCodeAt(pos);\n return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF);\n };\n\n // Specialization of $(tok)\n parserInput.$re = tok => {\n if (parserInput.i > currentPos) {\n current = current.slice(parserInput.i - currentPos);\n currentPos = parserInput.i;\n }\n\n const m = tok.exec(current);\n if (!m) {\n return null;\n }\n\n skipWhitespace(m[0].length);\n if (typeof m === 'string') {\n return m;\n }\n\n return m.length === 1 ? m[0] : m;\n };\n\n parserInput.$char = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n skipWhitespace(1);\n return tok;\n };\n\n parserInput.$peekChar = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n return tok;\n };\n\n parserInput.$str = tok => {\n const tokLength = tok.length;\n\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tokLength; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return null;\n }\n }\n\n skipWhitespace(tokLength);\n return tok;\n };\n\n parserInput.$quoted = loc => {\n const pos = loc || parserInput.i;\n const startChar = input.charAt(pos);\n\n if (startChar !== '\\'' && startChar !== '\"') {\n return;\n }\n const length = input.length;\n const currentPosition = pos;\n\n for (let i = 1; i + currentPosition < length; i++) {\n const nextChar = input.charAt(i + currentPosition);\n switch (nextChar) {\n case '\\\\':\n i++;\n continue;\n case '\\r':\n case '\\n':\n break;\n case startChar: {\n const str = input.substr(currentPosition, i + 1);\n if (!loc && loc !== 0) {\n skipWhitespace(i + 1);\n return str\n }\n return [startChar, str];\n }\n default:\n }\n }\n return null;\n };\n\n /**\n * Permissive parsing. Ignores everything except matching {} [] () and quotes\n * until matching token (outside of blocks)\n */\n parserInput.$parseUntil = tok => {\n let quote = '';\n let returnVal = null;\n let inComment = false;\n let blockDepth = 0;\n const blockStack = [];\n const parseGroups = [];\n const length = input.length;\n const startPos = parserInput.i;\n let lastPos = parserInput.i;\n let i = parserInput.i;\n let loop = true;\n let testChar;\n\n if (typeof tok === 'string') {\n testChar = char => char === tok\n } else {\n testChar = char => tok.test(char)\n }\n\n do {\n let nextChar = input.charAt(i);\n if (blockDepth === 0 && testChar(nextChar)) {\n returnVal = input.substr(lastPos, i - lastPos);\n if (returnVal) {\n parseGroups.push(returnVal);\n }\n else {\n parseGroups.push(' ');\n }\n returnVal = parseGroups;\n skipWhitespace(i - startPos);\n loop = false\n } else {\n if (inComment) {\n if (nextChar === '*' && \n input.charAt(i + 1) === '/') {\n i++;\n blockDepth--;\n inComment = false;\n }\n i++;\n continue;\n }\n switch (nextChar) {\n case '\\\\':\n i++;\n nextChar = input.charAt(i);\n parseGroups.push(input.substr(lastPos, i - lastPos + 1));\n lastPos = i + 1;\n break;\n case '/':\n if (input.charAt(i + 1) === '*') {\n i++;\n inComment = true;\n blockDepth++;\n }\n break;\n case '\\'':\n case '\"':\n quote = parserInput.$quoted(i);\n if (quote) {\n parseGroups.push(input.substr(lastPos, i - lastPos), quote);\n i += quote[1].length - 1;\n lastPos = i + 1;\n }\n else {\n skipWhitespace(i - startPos);\n returnVal = nextChar;\n loop = false;\n }\n break;\n case '{':\n blockStack.push('}');\n blockDepth++;\n break;\n case '(':\n blockStack.push(')');\n blockDepth++;\n break;\n case '[':\n blockStack.push(']');\n blockDepth++;\n break;\n case '}':\n case ')':\n case ']': {\n const expected = blockStack.pop();\n if (nextChar === expected) {\n blockDepth--;\n } else {\n // move the parser to the error and return expected\n skipWhitespace(i - startPos);\n returnVal = expected;\n loop = false;\n }\n }\n }\n i++;\n if (i > length) {\n loop = false;\n }\n }\n } while (loop);\n\n return returnVal ? returnVal : null;\n }\n\n parserInput.autoCommentAbsorb = true;\n parserInput.commentStore = [];\n parserInput.finished = false;\n\n // Same as $(), but don't change the state of the parser,\n // just return the match.\n parserInput.peek = tok => {\n if (typeof tok === 'string') {\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tok.length; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return false;\n }\n }\n return true;\n } else {\n return tok.test(current);\n }\n };\n\n // Specialization of peek()\n // TODO remove or change some currentChar calls to peekChar\n parserInput.peekChar = tok => input.charAt(parserInput.i) === tok;\n\n parserInput.currentChar = () => input.charAt(parserInput.i);\n\n parserInput.prevChar = () => input.charAt(parserInput.i - 1);\n\n parserInput.getInput = () => input;\n\n parserInput.peekNotNumeric = () => {\n const c = input.charCodeAt(parserInput.i);\n // Is the first char of the dimension 0-9, '.', '+' or '-'\n return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA;\n };\n\n parserInput.start = (str, chunkInput, failFunction) => {\n input = str;\n parserInput.i = j = currentPos = furthest = 0;\n\n // chunking apparently makes things quicker (but my tests indicate\n // it might actually make things slower in node at least)\n // and it is a non-perfect parse - it can't recognise\n // unquoted urls, meaning it can't distinguish comments\n // meaning comments with quotes or {}() in them get 'counted'\n // and then lead to parse errors.\n // In addition if the chunking chunks in the wrong place we might\n // not be able to parse a parser statement in one go\n // this is officially deprecated but can be switched on via an option\n // in the case it causes too much performance issues.\n if (chunkInput) {\n chunks = chunker(str, failFunction);\n } else {\n chunks = [str];\n }\n\n current = chunks[0];\n\n skipWhitespace(0);\n };\n\n parserInput.end = () => {\n let message;\n const isFinished = parserInput.i >= input.length;\n\n if (parserInput.i < furthest) {\n message = furthestPossibleErrorMessage;\n parserInput.i = furthest;\n }\n return {\n isFinished,\n furthest: parserInput.i,\n furthestPossibleErrorMessage: message,\n furthestReachedEnd: parserInput.i >= input.length - 1,\n furthestChar: input[parserInput.i]\n };\n };\n\n return parserInput;\n};\n","// Split the input into chunks.\nexport default function (input, fail) {\n const len = input.length;\n let level = 0;\n let parenLevel = 0;\n let lastOpening;\n let lastOpeningParen;\n let lastMultiComment;\n let lastMultiCommentEndBrace;\n const chunks = [];\n let emitFrom = 0;\n let chunkerCurrentIndex;\n let currentChunkStartIndex;\n let cc;\n let cc2;\n let matched;\n\n function emitChunk(force) {\n const len = chunkerCurrentIndex - emitFrom;\n if (((len < 512) && !force) || !len) {\n return;\n }\n chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1));\n emitFrom = chunkerCurrentIndex + 1;\n }\n\n for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc = input.charCodeAt(chunkerCurrentIndex);\n if (((cc >= 97) && (cc <= 122)) || (cc < 34)) {\n // a-z or whitespace\n continue;\n }\n\n switch (cc) {\n case 40: // (\n parenLevel++;\n lastOpeningParen = chunkerCurrentIndex;\n continue;\n case 41: // )\n if (--parenLevel < 0) {\n return fail('missing opening `(`', chunkerCurrentIndex);\n }\n continue;\n case 59: // ;\n if (!parenLevel) { emitChunk(); }\n continue;\n case 123: // {\n level++;\n lastOpening = chunkerCurrentIndex;\n continue;\n case 125: // }\n if (--level < 0) {\n return fail('missing opening `{`', chunkerCurrentIndex);\n }\n if (!level && !parenLevel) { emitChunk(); }\n continue;\n case 92: // \\\n if (chunkerCurrentIndex < len - 1) { chunkerCurrentIndex++; continue; }\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n case 34:\n case 39:\n case 96: // \", ' and `\n matched = 0;\n currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 > 96) { continue; }\n if (cc2 == cc) { matched = 1; break; }\n if (cc2 == 92) { // \\\n if (chunkerCurrentIndex == len - 1) {\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n }\n chunkerCurrentIndex++;\n }\n }\n if (matched) { continue; }\n return fail(`unmatched \\`${String.fromCharCode(cc)}\\``, currentChunkStartIndex);\n case 47: // /, check for comment\n if (parenLevel || (chunkerCurrentIndex == len - 1)) { continue; }\n cc2 = input.charCodeAt(chunkerCurrentIndex + 1);\n if (cc2 == 47) {\n // //, find lnfeed\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) { break; }\n }\n } else if (cc2 == 42) {\n // /*, find */\n lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 == 125) { lastMultiCommentEndBrace = chunkerCurrentIndex; }\n if (cc2 != 42) { continue; }\n if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) { break; }\n }\n if (chunkerCurrentIndex == len - 1) {\n return fail('missing closing `*/`', currentChunkStartIndex);\n }\n chunkerCurrentIndex++;\n }\n continue;\n case 42: // *, check for unmatched */\n if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) {\n return fail('unmatched `/*`', chunkerCurrentIndex);\n }\n continue;\n }\n }\n\n if (level !== 0) {\n if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) {\n return fail('missing closing `}` or `*/`', lastOpening);\n } else {\n return fail('missing closing `}`', lastOpening);\n }\n } else if (parenLevel !== 0) {\n return fail('missing closing `)`', lastOpeningParen);\n }\n\n emitChunk(true);\n return chunks;\n}\n","function makeRegistry( base ) {\n return {\n _data: {},\n add: function(name, func) {\n // precautionary case conversion, as later querying of\n // the registry by function-caller uses lower case as well.\n name = name.toLowerCase();\n\n // eslint-disable-next-line no-prototype-builtins\n if (this._data.hasOwnProperty(name)) {\n // TODO warn\n }\n this._data[name] = func;\n },\n addMultiple: function(functions) {\n Object.keys(functions).forEach(\n name => {\n this.add(name, functions[name]);\n });\n },\n get: function(name) {\n return this._data[name] || ( base && base.get( name ));\n },\n getLocalFunctions: function() {\n return this._data;\n },\n inherit: function() {\n return makeRegistry( this );\n },\n create: function(base) {\n return makeRegistry(base);\n }\n };\n}\n\nexport default makeRegistry( null );","export const MediaSyntaxOptions = {\n queryInParens: true\n};\n\nexport const ContainerSyntaxOptions = {\n queryInParens: true\n};\n","import LessError from '../less-error';\nimport tree from '../tree';\nimport visitors from '../visitors';\nimport getParserInput from './parser-input';\nimport * as utils from '../utils';\nimport functionRegistry from '../functions/function-registry';\nimport { ContainerSyntaxOptions, MediaSyntaxOptions } from '../tree/atrule-syntax';\n\n//\n// less.js - parser\n//\n// A relatively straight-forward predictive parser.\n// There is no tokenization/lexing stage, the input is parsed\n// in one sweep.\n//\n// To make the parser fast enough to run in the browser, several\n// optimization had to be made:\n//\n// - Matching and slicing on a huge input is often cause of slowdowns.\n// The solution is to chunkify the input into smaller strings.\n// The chunks are stored in the `chunks` var,\n// `j` holds the current chunk index, and `currentPos` holds\n// the index of the current chunk in relation to `input`.\n// This gives us an almost 4x speed-up.\n//\n// - In many cases, we don't need to match individual tokens;\n// for example, if a value doesn't hold any variables, operations\n// or dynamic references, the parser can effectively 'skip' it,\n// treating it as a literal.\n// An example would be '1px solid #000' - which evaluates to itself,\n// we don't need to know what the individual components are.\n// The drawback, of course is that you don't get the benefits of\n// syntax-checking on the CSS. This gives us a 50% speed-up in the parser,\n// and a smaller speed-up in the code-gen.\n//\n//\n// Token matching is done with the `$` function, which either takes\n// a terminal string or regexp, or a non-terminal function to call.\n// It also takes care of moving all the indices forwards.\n//\n\nconst Parser = function Parser(context, imports, fileInfo, currentIndex) {\n currentIndex = currentIndex || 0;\n let parsers;\n const parserInput = getParserInput();\n\n function error(msg, type) {\n throw new LessError(\n {\n index: parserInput.i,\n filename: fileInfo.filename,\n type: type || 'Syntax',\n message: msg\n },\n imports\n );\n }\n\n function expect(arg, msg) {\n // some older browsers return typeof 'function' for RegExp\n const result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg);\n if (result) {\n return result;\n }\n\n error(msg || (typeof arg === 'string'\n ? `expected '${arg}' got '${parserInput.currentChar()}'`\n : 'unexpected token'));\n }\n\n // Specialization of expect()\n function expectChar(arg, msg) {\n if (parserInput.$char(arg)) {\n return arg;\n }\n error(msg || `expected '${arg}' got '${parserInput.currentChar()}'`);\n }\n\n function getDebugInfo(index) {\n const filename = fileInfo.filename;\n\n return {\n lineNumber: utils.getLocation(index, parserInput.getInput()).line + 1,\n fileName: filename\n };\n }\n\n /**\n * Used after initial parsing to create nodes on the fly\n *\n * @param {String} str - string to parse\n * @param {Array} parseList - array of parsers to run input through e.g. [\"value\", \"important\"]\n * @param {Number} currentIndex - start number to begin indexing\n * @param {Object} fileInfo - fileInfo to attach to created nodes\n */\n function parseNode(str, parseList, callback) {\n let result;\n const returnNodes = [];\n const parser = parserInput;\n\n try {\n parser.start(str, false, function fail(msg, index) {\n callback({\n message: msg,\n index: index + currentIndex\n });\n });\n for (let x = 0, p; (p = parseList[x]); x++) {\n result = parsers[p]();\n returnNodes.push(result || null);\n }\n\n const endInfo = parser.end();\n if (endInfo.isFinished) {\n callback(null, returnNodes);\n }\n else {\n callback(true, null);\n }\n } catch (e) {\n throw new LessError({\n index: e.index + currentIndex,\n message: e.message\n }, imports, fileInfo.filename);\n }\n }\n\n //\n // The Parser\n //\n return {\n parserInput,\n imports,\n fileInfo,\n parseNode,\n //\n // Parse an input string into an abstract syntax tree,\n // @param str A string containing 'less' markup\n // @param callback call `callback` when done.\n // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply\n //\n parse: function (str, callback, additionalData) {\n let root;\n let err = null;\n let globalVars;\n let modifyVars;\n let ignored;\n let preText = '';\n\n // Optionally disable @plugin parsing\n if (additionalData && additionalData.disablePluginRule) {\n parsers.plugin = function() {\n var dir = parserInput.$re(/^@plugin?\\s+/);\n if (dir) {\n error('@plugin statements are not allowed when disablePluginRule is set to true');\n }\n }\n }\n\n globalVars = (additionalData && additionalData.globalVars) ? `${Parser.serializeVars(additionalData.globalVars)}\\n` : '';\n modifyVars = (additionalData && additionalData.modifyVars) ? `\\n${Parser.serializeVars(additionalData.modifyVars)}` : '';\n\n if (context.pluginManager) {\n const preProcessors = context.pluginManager.getPreProcessors();\n for (let i = 0; i < preProcessors.length; i++) {\n str = preProcessors[i].process(str, { context, imports, fileInfo });\n }\n }\n\n if (globalVars || (additionalData && additionalData.banner)) {\n preText = ((additionalData && additionalData.banner) ? additionalData.banner : '') + globalVars;\n ignored = imports.contentsIgnoredChars;\n ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0;\n ignored[fileInfo.filename] += preText.length;\n }\n\n str = str.replace(/\\r\\n?/g, '\\n');\n // Remove potential UTF Byte Order Mark\n str = preText + str.replace(/^\\uFEFF/, '') + modifyVars;\n imports.contents[fileInfo.filename] = str;\n\n // Start with the primary rule.\n // The whole syntax tree is held under a Ruleset node,\n // with the `root` property set to true, so no `{}` are\n // output. The callback is called when the input is parsed.\n try {\n parserInput.start(str, context.chunkInput, function fail(msg, index) {\n throw new LessError({\n index,\n type: 'Parse',\n message: msg,\n filename: fileInfo.filename\n }, imports);\n });\n\n tree.Node.prototype.parse = this;\n root = new tree.Ruleset(null, this.parsers.primary());\n tree.Node.prototype.rootNode = root;\n root.root = true;\n root.firstRoot = true;\n root.functionRegistry = functionRegistry.inherit();\n\n } catch (e) {\n return callback(new LessError(e, imports, fileInfo.filename));\n }\n\n // If `i` is smaller than the `input.length - 1`,\n // it means the parser wasn't able to parse the whole\n // string, so we've got a parsing error.\n //\n // We try to extract a \\n delimited string,\n // showing the line where the parse error occurred.\n // We split it up into two parts (the part which parsed,\n // and the part which didn't), so we can color them differently.\n const endInfo = parserInput.end();\n if (!endInfo.isFinished) {\n\n let message = endInfo.furthestPossibleErrorMessage;\n\n if (!message) {\n message = 'Unrecognised input';\n if (endInfo.furthestChar === '}') {\n message += '. Possibly missing opening \\'{\\'';\n } else if (endInfo.furthestChar === ')') {\n message += '. Possibly missing opening \\'(\\'';\n } else if (endInfo.furthestReachedEnd) {\n message += '. Possibly missing something';\n }\n }\n\n err = new LessError({\n type: 'Parse',\n message,\n index: endInfo.furthest,\n filename: fileInfo.filename\n }, imports);\n }\n\n const finish = e => {\n e = err || e || imports.error;\n\n if (e) {\n if (!(e instanceof LessError)) {\n e = new LessError(e, imports, fileInfo.filename);\n }\n\n return callback(e);\n }\n else {\n return callback(null, root);\n }\n };\n\n if (context.processImports !== false) {\n new visitors.ImportVisitor(imports, finish)\n .run(root);\n } else {\n return finish();\n }\n },\n\n //\n // Here in, the parsing rules/functions\n //\n // The basic structure of the syntax tree generated is as follows:\n //\n // Ruleset -> Declaration -> Value -> Expression -> Entity\n //\n // Here's some Less code:\n //\n // .class {\n // color: #fff;\n // border: 1px solid #000;\n // width: @w + 4px;\n // > .child {...}\n // }\n //\n // And here's what the parse tree might look like:\n //\n // Ruleset (Selector '.class', [\n // Declaration (\"color\", Value ([Expression [Color #fff]]))\n // Declaration (\"border\", Value ([Expression [Dimension 1px][Keyword \"solid\"][Color #000]]))\n // Declaration (\"width\", Value ([Expression [Operation \" + \" [Variable \"@w\"][Dimension 4px]]]))\n // Ruleset (Selector [Element '>', '.child'], [...])\n // ])\n //\n // In general, most rules will try to parse a token with the `$re()` function, and if the return\n // value is truly, will return a new node, of the relevant type. Sometimes, we need to check\n // first, before parsing, that's when we use `peek()`.\n //\n parsers: parsers = {\n //\n // The `primary` rule is the *entry* and *exit* point of the parser.\n // The rules here can appear at any level of the parse tree.\n //\n // The recursive nature of the grammar is an interplay between the `block`\n // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,\n // as represented by this simplified grammar:\n //\n // primary → (ruleset | declaration)+\n // ruleset → selector+ block\n // block → '{' primary '}'\n //\n // Only at one point is the primary rule not called from the\n // block rule: at the root level.\n //\n primary: function () {\n const mixin = this.mixin;\n let root = [];\n let node;\n\n while (true) {\n while (true) {\n node = this.comment();\n if (!node) { break; }\n root.push(node);\n }\n // always process comments before deciding if finished\n if (parserInput.finished) {\n break;\n }\n if (parserInput.peek('}')) {\n break;\n }\n\n node = this.extendRule();\n if (node) {\n root = root.concat(node);\n continue;\n }\n\n node = mixin.definition() || this.declaration() || mixin.call(false, false) ||\n this.ruleset() || this.variableCall() || this.entities.call() || this.atrule();\n if (node) {\n root.push(node);\n } else {\n let foundSemiColon = false;\n while (parserInput.$char(';')) {\n foundSemiColon = true;\n }\n if (!foundSemiColon) {\n break;\n }\n }\n }\n\n return root;\n },\n\n // comments are collected by the main parsing mechanism and then assigned to nodes\n // where the current structure allows it\n comment: function () {\n if (parserInput.commentStore.length) {\n const comment = parserInput.commentStore.shift();\n return new(tree.Comment)(comment.text, comment.isLineComment, comment.index + currentIndex, fileInfo);\n }\n },\n\n //\n // Entities are tokens which can be found inside an Expression\n //\n entities: {\n mixinLookup: function() {\n return parsers.mixin.call(true, true);\n },\n //\n // A string, which supports escaping \" and '\n //\n // \"milky way\" 'he\\'s the one!'\n //\n quoted: function (forceEscaped) {\n let str;\n const index = parserInput.i;\n let isEscaped = false;\n\n parserInput.save();\n if (parserInput.$char('~')) {\n isEscaped = true;\n } else if (forceEscaped) {\n parserInput.restore();\n return;\n }\n\n str = parserInput.$quoted();\n if (!str) {\n parserInput.restore();\n return;\n }\n parserInput.forget();\n\n return new(tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index + currentIndex, fileInfo);\n },\n\n //\n // A catch-all word, such as:\n //\n // black border-collapse\n //\n keyword: function () {\n const k = parserInput.$char('%') || parserInput.$re(/^\\[?(?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\\]?/);\n if (k) {\n return tree.Color.fromKeyword(k) || new(tree.Keyword)(k);\n }\n },\n\n //\n // A function call\n //\n // rgb(255, 0, 255)\n //\n // The arguments are parsed with the `entities.arguments` parser.\n //\n call: function () {\n let name;\n let args;\n let func;\n const index = parserInput.i;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (parserInput.peek(/^url\\(/i)) {\n return;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^([\\w-]+|%|~|progid:[\\w.]+)\\(/);\n if (!name) {\n parserInput.forget();\n return;\n }\n\n name = name[1];\n func = this.customFuncCall(name);\n if (func) {\n args = func.parse();\n if (args && func.stop) {\n parserInput.forget();\n return args;\n }\n }\n\n args = this.arguments(args);\n\n if (!parserInput.$char(')')) {\n parserInput.restore('Could not parse call arguments or missing \\')\\'');\n return;\n }\n\n parserInput.forget();\n\n return new(tree.Call)(name, args, index + currentIndex, fileInfo);\n },\n\n //\n // Parsing rules for functions with non-standard args, e.g.:\n //\n // boolean(not(2 > 1))\n //\n // This is a quick prototype, to be modified/improved when\n // more custom-parsed funcs come (e.g. `selector(...)`)\n //\n\n customFuncCall: function (name) {\n /* Ideally the table is to be moved out of here for faster perf.,\n but it's quite tricky since it relies on all these `parsers`\n and `expect` available only here */\n return {\n alpha: f(parsers.ieAlpha, true),\n boolean: f(condition),\n 'if': f(condition)\n }[name.toLowerCase()];\n\n function f(parse, stop) {\n return {\n parse, // parsing function\n stop // when true - stop after parse() and return its result,\n // otherwise continue for plain args\n };\n }\n\n function condition() {\n return [expect(parsers.condition, 'expected condition')];\n }\n },\n\n arguments: function (prevArgs) {\n let argsComma = prevArgs || [];\n const argsSemiColon = [];\n let isSemiColonSeparated;\n let value;\n\n parserInput.save();\n\n while (true) {\n if (prevArgs) {\n prevArgs = false;\n } else {\n value = parsers.detachedRuleset() || this.assignment() || parsers.expression();\n if (!value) {\n break;\n }\n\n if (value.value && value.value.length == 1) {\n value = value.value[0];\n }\n\n argsComma.push(value);\n }\n\n if (parserInput.$char(',')) {\n continue;\n }\n\n if (parserInput.$char(';') || isSemiColonSeparated) {\n isSemiColonSeparated = true;\n value = (argsComma.length < 1) ? argsComma[0]\n : new tree.Value(argsComma);\n argsSemiColon.push(value);\n argsComma = [];\n }\n }\n\n parserInput.forget();\n return isSemiColonSeparated ? argsSemiColon : argsComma;\n },\n literal: function () {\n return this.dimension() ||\n this.color() ||\n this.quoted() ||\n this.unicodeDescriptor();\n },\n\n // Assignments are argument entities for calls.\n // They are present in ie filter properties as shown below.\n //\n // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* )\n //\n\n assignment: function () {\n let key;\n let value;\n parserInput.save();\n key = parserInput.$re(/^\\w+(?=\\s?=)/i);\n if (!key) {\n parserInput.restore();\n return;\n }\n if (!parserInput.$char('=')) {\n parserInput.restore();\n return;\n }\n value = parsers.entity();\n if (value) {\n parserInput.forget();\n return new(tree.Assignment)(key, value);\n } else {\n parserInput.restore();\n }\n },\n\n //\n // Parse url() tokens\n //\n // We use a specific rule for urls, because they don't really behave like\n // standard function calls. The difference is that the argument doesn't have\n // to be enclosed within a string, so it can't be parsed as an Expression.\n //\n url: function () {\n let value;\n const index = parserInput.i;\n\n parserInput.autoCommentAbsorb = false;\n\n if (!parserInput.$str('url(')) {\n parserInput.autoCommentAbsorb = true;\n return;\n }\n\n value = this.quoted() || this.variable() || this.property() ||\n parserInput.$re(/^(?:(?:\\\\[()'\"])|[^()'\"])+/) || '';\n\n parserInput.autoCommentAbsorb = true;\n\n expectChar(')');\n\n return new(tree.URL)((value.value !== undefined ||\n value instanceof tree.Variable ||\n value instanceof tree.Property) ?\n value : new(tree.Anonymous)(value, index), index + currentIndex, fileInfo);\n },\n\n //\n // A Variable entity, such as `@fink`, in\n //\n // width: @fink + 2px\n //\n // We use a different parser for variable definitions,\n // see `parsers.variable`.\n //\n variable: function () {\n let ch;\n let name;\n const index = parserInput.i;\n\n parserInput.save();\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\\w-]+/))) {\n ch = parserInput.currentChar();\n if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\\s/)) {\n // this may be a VariableCall lookup\n const result = parsers.variableCall(name);\n if (result) {\n parserInput.forget();\n return result;\n }\n }\n parserInput.forget();\n return new(tree.Variable)(name, index + currentIndex, fileInfo);\n }\n parserInput.restore();\n },\n\n // A variable entity using the protective {} e.g. @{var}\n variableCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\\{([\\w-]+)\\}/))) {\n return new(tree.Variable)(`@${curly[1]}`, index + currentIndex, fileInfo);\n }\n },\n //\n // A Property accessor, such as `$color`, in\n //\n // background-color: $color\n //\n property: function () {\n let name;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (name = parserInput.$re(/^\\$[\\w-]+/))) {\n return new(tree.Property)(name, index + currentIndex, fileInfo);\n }\n },\n\n // A property entity useing the protective {} e.g. ${prop}\n propertyCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\\$\\{([\\w-]+)\\}/))) {\n return new(tree.Property)(`$${curly[1]}`, index + currentIndex, fileInfo);\n }\n },\n //\n // A Hexadecimal color\n //\n // #4F3C2F\n //\n // `rgb` and `hsl` colors are parsed through the `entities.call` parser.\n //\n color: function () {\n let rgb;\n parserInput.save();\n\n if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})([\\w.#[])?/))) {\n if (!rgb[2]) {\n parserInput.forget();\n return new(tree.Color)(rgb[1], undefined, rgb[0]);\n }\n }\n parserInput.restore();\n },\n\n colorKeyword: function () {\n parserInput.save();\n const autoCommentAbsorb = parserInput.autoCommentAbsorb;\n parserInput.autoCommentAbsorb = false;\n const k = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/);\n parserInput.autoCommentAbsorb = autoCommentAbsorb;\n if (!k) {\n parserInput.forget();\n return;\n }\n parserInput.restore();\n const color = tree.Color.fromKeyword(k);\n if (color) {\n parserInput.$str(k);\n return color;\n }\n },\n\n //\n // A Dimension, that is, a number and a unit\n //\n // 0.5em 95%\n //\n dimension: function () {\n if (parserInput.peekNotNumeric()) {\n return;\n }\n\n const value = parserInput.$re(/^([+-]?\\d*\\.?\\d+)(%|[a-z_]+)?/i);\n if (value) {\n return new(tree.Dimension)(value[1], value[2]);\n }\n },\n\n //\n // A unicode descriptor, as is used in unicode-range\n //\n // U+0?? or U+00A1-00A9\n //\n unicodeDescriptor: function () {\n let ud;\n\n ud = parserInput.$re(/^U\\+[0-9a-fA-F?]+(-[0-9a-fA-F?]+)?/);\n if (ud) {\n return new(tree.UnicodeDescriptor)(ud[0]);\n }\n },\n\n //\n // JavaScript code to be evaluated\n //\n // `window.location.href`\n //\n javascript: function () {\n let js;\n const index = parserInput.i;\n\n parserInput.save();\n\n const escape = parserInput.$char('~');\n const jsQuote = parserInput.$char('`');\n\n if (!jsQuote) {\n parserInput.restore();\n return;\n }\n\n js = parserInput.$re(/^[^`]*`/);\n if (js) {\n parserInput.forget();\n return new(tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index + currentIndex, fileInfo);\n }\n parserInput.restore('invalid javascript definition');\n }\n },\n\n //\n // The variable part of a variable definition. Used in the `rule` parser\n //\n // @fink:\n //\n variable: function () {\n let name;\n\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\\w-]+)\\s*:/))) { return name[1]; }\n },\n\n //\n // Call a variable value to retrieve a detached ruleset\n // or a value from a detached ruleset's rules.\n //\n // @fink();\n // @fink;\n // color: @fink[@color];\n //\n variableCall: function (parsedName) {\n let lookups;\n const i = parserInput.i;\n const inValue = !!parsedName;\n let name = parsedName;\n\n parserInput.save();\n\n if (name || (parserInput.currentChar() === '@'\n && (name = parserInput.$re(/^(@[\\w-]+)(\\(\\s*\\))?/)))) {\n\n lookups = this.mixin.ruleLookups();\n\n if (!lookups && ((inValue && parserInput.$str('()') !== '()') || (name[2] !== '()'))) {\n parserInput.restore('Missing \\'[...]\\' lookup in variable call');\n return;\n }\n\n if (!inValue) {\n name = name[1];\n }\n\n const call = new tree.VariableCall(name, i, fileInfo);\n if (!inValue && parsers.end()) {\n parserInput.forget();\n return call;\n }\n else {\n parserInput.forget();\n return new tree.NamespaceValue(call, lookups, i, fileInfo);\n }\n }\n\n parserInput.restore();\n },\n\n //\n // extend syntax - used to extend selectors\n //\n extend: function(isRule) {\n let elements;\n let e;\n const index = parserInput.i;\n let option;\n let extendList;\n let extend;\n\n if (!parserInput.$str(isRule ? '&:extend(' : ':extend(')) {\n return;\n }\n\n do {\n option = null;\n elements = null;\n while (!(option = parserInput.$re(/^(all)(?=\\s*(\\)|,))/))) {\n e = this.element();\n if (!e) {\n break;\n }\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n }\n\n option = option && option[1];\n if (!elements) {\n error('Missing target selector for :extend().');\n }\n extend = new(tree.Extend)(new(tree.Selector)(elements), option, index + currentIndex, fileInfo);\n if (extendList) {\n extendList.push(extend);\n } else {\n extendList = [ extend ];\n }\n } while (parserInput.$char(','));\n\n expect(/^\\)/);\n\n if (isRule) {\n expect(/^;/);\n }\n\n return extendList;\n },\n\n //\n // extendRule - used in a rule to extend all the parent selectors\n //\n extendRule: function() {\n return this.extend(true);\n },\n\n //\n // Mixins\n //\n mixin: {\n //\n // A Mixin call, with an optional argument list\n //\n // #mixins > .square(#fff);\n // #mixins.square(#fff);\n // .rounded(4px, black);\n // .button;\n //\n // We can lookup / return a value using the lookup syntax:\n //\n // color: #mixin.square(#fff)[@color];\n //\n // The `while` loop is there because mixins can be\n // namespaced, but we only support the child and descendant\n // selector for now.\n //\n call: function (inValue, getLookup) {\n const s = parserInput.currentChar();\n let important = false;\n let lookups;\n const index = parserInput.i;\n let elements;\n let args;\n let hasParens;\n\n if (s !== '.' && s !== '#') { return; }\n\n parserInput.save(); // stop us absorbing part of an invalid selector\n\n elements = this.elements();\n\n if (elements) {\n if (parserInput.$char('(')) {\n args = this.args(true).args;\n expectChar(')');\n hasParens = true;\n }\n\n if (getLookup !== false) {\n lookups = this.ruleLookups();\n }\n if (getLookup === true && !lookups) {\n parserInput.restore();\n return;\n }\n\n if (inValue && !lookups && !hasParens) {\n // This isn't a valid in-value mixin call\n parserInput.restore();\n return;\n }\n\n if (!inValue && parsers.important()) {\n important = true;\n }\n\n if (inValue || parsers.end()) {\n parserInput.forget();\n const mixin = new(tree.mixin.Call)(elements, args, index + currentIndex, fileInfo, !lookups && important);\n if (lookups) {\n return new tree.NamespaceValue(mixin, lookups);\n }\n else {\n return mixin;\n }\n }\n }\n\n parserInput.restore();\n },\n /**\n * Matching elements for mixins\n * (Start with . or # and can have > )\n */\n elements: function() {\n let elements;\n let e;\n let c;\n let elem;\n let elemIndex;\n const re = /^[#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/;\n while (true) {\n elemIndex = parserInput.i;\n e = parserInput.$re(re);\n\n if (!e) {\n break;\n }\n elem = new(tree.Element)(c, e, false, elemIndex + currentIndex, fileInfo);\n if (elements) {\n elements.push(elem);\n } else {\n elements = [ elem ];\n }\n c = parserInput.$char('>');\n }\n return elements;\n },\n args: function (isCall) {\n const entities = parsers.entities;\n const returner = { args:null, variadic: false };\n let expressions = [];\n const argsSemiColon = [];\n const argsComma = [];\n let isSemiColonSeparated;\n let expressionContainsNamed;\n let name;\n let nameLoop;\n let value;\n let arg;\n let expand;\n let hasSep = true;\n\n parserInput.save();\n\n while (true) {\n if (isCall) {\n arg = parsers.detachedRuleset() || parsers.expression();\n } else {\n parserInput.commentStore.length = 0;\n if (parserInput.$str('...')) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ variadic: true });\n break;\n }\n arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true);\n }\n\n if (!arg || !hasSep) {\n break;\n }\n\n nameLoop = null;\n if (arg.throwAwayComments) {\n arg.throwAwayComments();\n }\n value = arg;\n let val = null;\n\n if (isCall) {\n // Variable\n if (arg.value && arg.value.length == 1) {\n val = arg.value[0];\n }\n } else {\n val = arg;\n }\n\n if (val && (val instanceof tree.Variable || val instanceof tree.Property)) {\n if (parserInput.$char(':')) {\n if (expressions.length > 0) {\n if (isSemiColonSeparated) {\n error('Cannot mix ; and , as delimiter types');\n }\n expressionContainsNamed = true;\n }\n\n value = parsers.detachedRuleset() || parsers.expression();\n\n if (!value) {\n if (isCall) {\n error('could not understand value for named argument');\n } else {\n parserInput.restore();\n returner.args = [];\n return returner;\n }\n }\n nameLoop = (name = val.name);\n } else if (parserInput.$str('...')) {\n if (!isCall) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ name: arg.name, variadic: true });\n break;\n } else {\n expand = true;\n }\n } else if (!isCall) {\n name = nameLoop = val.name;\n value = null;\n }\n }\n\n if (value) {\n expressions.push(value);\n }\n\n argsComma.push({ name:nameLoop, value, expand });\n\n if (parserInput.$char(',')) {\n hasSep = true;\n continue;\n }\n hasSep = parserInput.$char(';') === ';';\n\n if (hasSep || isSemiColonSeparated) {\n\n if (expressionContainsNamed) {\n error('Cannot mix ; and , as delimiter types');\n }\n\n isSemiColonSeparated = true;\n\n if (expressions.length > 1) {\n value = new(tree.Value)(expressions);\n }\n argsSemiColon.push({ name, value, expand });\n\n name = null;\n expressions = [];\n expressionContainsNamed = false;\n }\n }\n\n parserInput.forget();\n returner.args = isSemiColonSeparated ? argsSemiColon : argsComma;\n return returner;\n },\n //\n // A Mixin definition, with a list of parameters\n //\n // .rounded (@radius: 2px, @color) {\n // ...\n // }\n //\n // Until we have a finer grained state-machine, we have to\n // do a look-ahead, to make sure we don't have a mixin call.\n // See the `rule` function for more information.\n //\n // We start by matching `.rounded (`, and then proceed on to\n // the argument list, which has optional default values.\n // We store the parameters in `params`, with a `value` key,\n // if there is a value, such as in the case of `@radius`.\n //\n // Once we've got our params list, and a closing `)`, we parse\n // the `{...}` block.\n //\n definition: function () {\n let name;\n let params = [];\n let match;\n let ruleset;\n let cond;\n let variadic = false;\n if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') ||\n parserInput.peek(/^[^{]*\\}/)) {\n return;\n }\n\n parserInput.save();\n\n match = parserInput.$re(/^([#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\\s*\\(/);\n if (match) {\n name = match[1];\n\n const argInfo = this.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n\n // .mixincall(\"@{a}\");\n // looks a bit like a mixin definition..\n // also\n // .mixincall(@a: {rule: set;});\n // so we have to be nice and restore\n if (!parserInput.$char(')')) {\n parserInput.restore('Missing closing \\')\\'');\n return;\n }\n\n parserInput.commentStore.length = 0;\n\n if (parserInput.$str('when')) { // Guard\n cond = expect(parsers.conditions, 'expected condition');\n }\n\n ruleset = parsers.block();\n\n if (ruleset) {\n parserInput.forget();\n return new(tree.mixin.Definition)(name, params, ruleset, cond, variadic);\n } else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n\n ruleLookups: function() {\n let rule;\n const lookups = [];\n\n if (parserInput.currentChar() !== '[') {\n return;\n }\n\n while (true) {\n parserInput.save();\n rule = this.lookupValue();\n if (!rule && rule !== '') {\n parserInput.restore();\n break;\n }\n lookups.push(rule);\n parserInput.forget();\n }\n if (lookups.length > 0) {\n return lookups;\n }\n },\n\n lookupValue: function() {\n parserInput.save();\n\n if (!parserInput.$char('[')) {\n parserInput.restore();\n return;\n }\n\n const name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);\n\n if (!parserInput.$char(']')) {\n parserInput.restore();\n return;\n }\n\n if (name || name === '') {\n parserInput.forget();\n return name;\n }\n\n parserInput.restore();\n }\n },\n //\n // Entities are the smallest recognized token,\n // and can be found inside a rule's value.\n //\n entity: function () {\n const entities = this.entities;\n\n return this.comment() || entities.literal() || entities.variable() || entities.url() ||\n entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) ||\n entities.javascript();\n },\n\n //\n // A Declaration terminator. Note that we use `peek()` to check for '}',\n // because the `block` rule will be expecting it, but we still need to make sure\n // it's there, if ';' was omitted.\n //\n end: function () {\n return parserInput.$char(';') || parserInput.peek('}');\n },\n\n //\n // IE's alpha function\n //\n // alpha(opacity=88)\n //\n ieAlpha: function () {\n let value;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (!parserInput.$re(/^opacity=/i)) { return; }\n value = parserInput.$re(/^\\d+/);\n if (!value) {\n value = expect(parsers.entities.variable, 'Could not parse alpha');\n value = `@{${value.name.slice(1)}}`;\n }\n expectChar(')');\n return new tree.Quoted('', `alpha(opacity=${value})`);\n },\n\n //\n // A Selector Element\n //\n // div\n // + h1\n // #socks\n // input[type=\"text\"]\n //\n // Elements are the building blocks for Selectors,\n // they are made out of a `Combinator` (see combinator rule),\n // and an element name, such as a tag a class, or `*`.\n //\n element: function () {\n let e;\n let c;\n let v;\n const index = parserInput.i;\n\n c = this.combinator();\n\n e = parserInput.$re(/^(?:\\d+\\.\\d+|\\d+)%/) ||\n // eslint-disable-next-line no-control-regex\n parserInput.$re(/^(?:[.#]?|:*)(?:[\\w-]|[^\\x00-\\x9f]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||\n parserInput.$char('*') || parserInput.$char('&') || this.attribute() ||\n parserInput.$re(/^\\([^&()@]+\\)/) || parserInput.$re(/^[.#:](?=@)/) ||\n this.entities.variableCurly();\n\n if (!e) {\n parserInput.save();\n if (parserInput.$char('(')) {\n if ((v = this.selector(false)) && parserInput.$char(')')) {\n e = new(tree.Paren)(v);\n parserInput.forget();\n } else {\n parserInput.restore('Missing closing \\')\\'');\n }\n } else {\n parserInput.forget();\n }\n }\n\n if (e) { return new(tree.Element)(c, e, e instanceof tree.Variable, index + currentIndex, fileInfo); }\n },\n\n //\n // Combinators combine elements together, in a Selector.\n //\n // Because our parser isn't white-space sensitive, special care\n // has to be taken, when parsing the descendant combinator, ` `,\n // as it's an empty space. We have to check the previous character\n // in the input, to see if it's a ` ` character. More info on how\n // we deal with this in *combinator.js*.\n //\n combinator: function () {\n let c = parserInput.currentChar();\n\n if (c === '/') {\n parserInput.save();\n const slashedCombinator = parserInput.$re(/^\\/[a-z]+\\//i);\n if (slashedCombinator) {\n parserInput.forget();\n return new(tree.Combinator)(slashedCombinator);\n }\n parserInput.restore();\n }\n\n if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') {\n parserInput.i++;\n if (c === '^' && parserInput.currentChar() === '^') {\n c = '^^';\n parserInput.i++;\n }\n while (parserInput.isWhitespace()) { parserInput.i++; }\n return new(tree.Combinator)(c);\n } else if (parserInput.isWhitespace(-1)) {\n return new(tree.Combinator)(' ');\n } else {\n return new(tree.Combinator)(null);\n }\n },\n //\n // A CSS Selector\n // with less extensions e.g. the ability to extend and guard\n //\n // .class > div + h1\n // li a:hover\n //\n // Selectors are made out of one or more Elements, see above.\n //\n selector: function (isLess) {\n const index = parserInput.i;\n let elements;\n let extendList;\n let c;\n let e;\n let allExtends;\n let when;\n let condition;\n isLess = isLess !== false;\n while ((isLess && (extendList = this.extend())) || (isLess && (when = parserInput.$str('when'))) || (e = this.element())) {\n if (when) {\n condition = expect(this.conditions, 'expected condition');\n } else if (condition) {\n error('CSS guard can only be used at the end of selector');\n } else if (extendList) {\n if (allExtends) {\n allExtends = allExtends.concat(extendList);\n } else {\n allExtends = extendList;\n }\n } else {\n if (allExtends) { error('Extend can only be used at the end of selector'); }\n c = parserInput.currentChar();\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n e = null;\n }\n if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') {\n break;\n }\n }\n\n if (elements) { return new(tree.Selector)(elements, allExtends, condition, index + currentIndex, fileInfo); }\n if (allExtends) { error('Extend must be used to extend a selector, it cannot be used on its own'); }\n },\n selectors: function () {\n let s;\n let selectors;\n while (true) {\n s = this.selector();\n if (!s) {\n break;\n }\n if (selectors) {\n selectors.push(s);\n } else {\n selectors = [ s ];\n }\n parserInput.commentStore.length = 0;\n if (s.condition && selectors.length > 1) {\n error('Guards are only currently allowed on a single selector.');\n }\n if (!parserInput.$char(',')) { break; }\n if (s.condition) {\n error('Guards are only currently allowed on a single selector.');\n }\n parserInput.commentStore.length = 0;\n }\n return selectors;\n },\n attribute: function () {\n if (!parserInput.$char('[')) { return; }\n\n const entities = this.entities;\n let key;\n let val;\n let op;\n //\n // case-insensitive flag\n // e.g. [attr operator value i]\n //\n let cif;\n\n if (!(key = entities.variableCurly())) {\n key = expect(/^(?:[_A-Za-z0-9-*]*\\|)?(?:[_A-Za-z0-9-]|\\\\.)+/);\n }\n\n op = parserInput.$re(/^[|~*$^]?=/);\n if (op) {\n val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\\w-]+/) || entities.variableCurly();\n if (val) {\n cif = parserInput.$re(/^[iIsS]/);\n }\n }\n\n expectChar(']');\n\n return new(tree.Attribute)(key, op, val, cif);\n },\n\n //\n // The `block` rule is used by `ruleset` and `mixin.definition`.\n // It's a wrapper around the `primary` rule, with added `{}`.\n //\n block: function () {\n let content;\n if (parserInput.$char('{') && (content = this.primary()) && parserInput.$char('}')) {\n return content;\n }\n },\n\n blockRuleset: function() {\n let block = this.block();\n\n if (block) {\n block = new tree.Ruleset(null, block);\n }\n return block;\n },\n\n detachedRuleset: function() {\n let argInfo;\n let params;\n let variadic;\n\n parserInput.save();\n if (parserInput.$re(/^[.#]\\(/)) {\n /**\n * DR args currently only implemented for each() function, and not\n * yet settable as `@dr: #(@arg) {}`\n * This should be done when DRs are merged with mixins.\n * See: https://github.com/less/less-meta/issues/16\n */\n argInfo = this.mixin.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return;\n }\n }\n const blockRuleset = this.blockRuleset();\n if (blockRuleset) {\n parserInput.forget();\n if (params) {\n return new tree.mixin.Definition(null, params, blockRuleset, null, variadic);\n }\n return new tree.DetachedRuleset(blockRuleset);\n }\n parserInput.restore();\n },\n\n //\n // div, .class, body > p {...}\n //\n ruleset: function () {\n let selectors;\n let rules;\n let debugInfo;\n\n parserInput.save();\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(parserInput.i);\n }\n\n selectors = this.selectors();\n\n if (selectors && (rules = this.block())) {\n parserInput.forget();\n const ruleset = new(tree.Ruleset)(selectors, rules, context.strictImports);\n if (context.dumpLineNumbers) {\n ruleset.debugInfo = debugInfo;\n }\n return ruleset;\n } else {\n parserInput.restore();\n }\n },\n declaration: function () {\n let name;\n let value;\n const index = parserInput.i;\n let hasDR;\n const c = parserInput.currentChar();\n let important;\n let merge;\n let isVariable;\n\n if (c === '.' || c === '#' || c === '&' || c === ':') { return; }\n\n parserInput.save();\n\n name = this.variable() || this.ruleProperty();\n if (name) {\n isVariable = typeof name === 'string';\n\n if (isVariable) {\n value = this.detachedRuleset();\n if (value) {\n hasDR = true;\n }\n }\n\n parserInput.commentStore.length = 0;\n if (!value) {\n // a name returned by this.ruleProperty() is always an array of the form:\n // [string-1, ..., string-n, \"\"] or [string-1, ..., string-n, \"+\"]\n // where each item is a tree.Keyword or tree.Variable\n merge = !isVariable && name.length > 1 && name.pop().value;\n\n // Custom property values get permissive parsing\n if (name[0].value && name[0].value.slice(0, 2) === '--') {\n value = this.permissiveValue(/[;}]/);\n }\n // Try to store values as anonymous\n // If we need the value later we'll re-parse it in ruleset.parseValue\n else {\n value = this.anonymousValue();\n }\n if (value) {\n parserInput.forget();\n // anonymous values absorb the end ';' which is required for them to work\n return new(tree.Declaration)(name, value, false, merge, index + currentIndex, fileInfo);\n }\n\n if (!value) {\n value = this.value();\n }\n\n if (value) {\n important = this.important();\n } else if (isVariable) {\n // As a last resort, try permissiveValue\n value = this.permissiveValue();\n }\n }\n\n if (value && (this.end() || hasDR)) {\n parserInput.forget();\n return new(tree.Declaration)(name, value, important, merge, index + currentIndex, fileInfo);\n }\n else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n anonymousValue: function () {\n const index = parserInput.i;\n const match = parserInput.$re(/^([^.#@$+/'\"*`(;{}-]*);/);\n if (match) {\n return new(tree.Anonymous)(match[1], index + currentIndex);\n }\n },\n /**\n * Used for custom properties, at-rules, and variables (as fallback)\n * Parses almost anything inside of {} [] () \"\" blocks\n * until it reaches outer-most tokens.\n *\n * First, it will try to parse comments and entities to reach\n * the end. This is mostly like the Expression parser except no\n * math is allowed.\n */\n permissiveValue: function (untilTokens) {\n let i;\n let e;\n let done;\n let value;\n const tok = untilTokens || ';';\n const index = parserInput.i;\n const result = [];\n\n function testCurrentChar() {\n const char = parserInput.currentChar();\n if (typeof tok === 'string') {\n return char === tok;\n } else {\n return tok.test(char);\n }\n }\n if (testCurrentChar()) {\n return;\n }\n value = [];\n do {\n e = this.comment();\n if (e) {\n value.push(e);\n continue;\n }\n e = this.entity();\n if (e) {\n value.push(e);\n }\n if (parserInput.peek(',')) {\n value.push(new (tree.Anonymous)(',', parserInput.i));\n parserInput.$char(',');\n }\n } while (e);\n\n done = testCurrentChar();\n\n if (value.length > 0) {\n value = new(tree.Expression)(value);\n if (done) {\n return value;\n }\n else {\n result.push(value);\n }\n // Preserve space before $parseUntil as it will not\n if (parserInput.prevChar() === ' ') {\n result.push(new tree.Anonymous(' ', index));\n }\n }\n parserInput.save();\n\n value = parserInput.$parseUntil(tok);\n\n if (value) {\n if (typeof value === 'string') {\n error(`Expected '${value}'`, 'Parse');\n }\n if (value.length === 1 && value[0] === ' ') {\n parserInput.forget();\n return new tree.Anonymous('', index);\n }\n let item;\n for (i = 0; i < value.length; i++) {\n item = value[i];\n if (Array.isArray(item)) {\n // Treat actual quotes as normal quoted values\n result.push(new tree.Quoted(item[0], item[1], true, index, fileInfo));\n }\n else {\n if (i === value.length - 1) {\n item = item.trim();\n }\n // Treat like quoted values, but replace vars like unquoted expressions\n const quote = new tree.Quoted('\\'', item, true, index, fileInfo);\n quote.variableRegex = /@([\\w-]+)/g;\n quote.propRegex = /\\$([\\w-]+)/g;\n result.push(quote);\n }\n }\n parserInput.forget();\n return new tree.Expression(result, true);\n }\n parserInput.restore();\n },\n\n //\n // An @import atrule\n //\n // @import \"lib\";\n //\n // Depending on our environment, importing is done differently:\n // In the browser, it's an XHR request, in Node, it would be a\n // file-system operation. The function used for importing is\n // stored in `import`, which we pass to the Import constructor.\n //\n 'import': function () {\n let path;\n let features;\n const index = parserInput.i;\n\n const dir = parserInput.$re(/^@import\\s+/);\n\n if (dir) {\n const options = (dir ? this.importOptions() : null) || {};\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n features = this.mediaFeatures({});\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon or unrecognised media features on import');\n }\n features = features && new(tree.Value)(features);\n return new(tree.Import)(path, features, options, index + currentIndex, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed import statement');\n }\n }\n },\n\n importOptions: function() {\n let o;\n const options = {};\n let optionName;\n let value;\n\n // list of options, surrounded by parens\n if (!parserInput.$char('(')) { return null; }\n do {\n o = this.importOption();\n if (o) {\n optionName = o;\n value = true;\n switch (optionName) {\n case 'css':\n optionName = 'less';\n value = false;\n break;\n case 'once':\n optionName = 'multiple';\n value = false;\n break;\n }\n options[optionName] = value;\n if (!parserInput.$char(',')) { break; }\n }\n } while (o);\n expectChar(')');\n return options;\n },\n\n importOption: function() {\n const opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/);\n if (opt) {\n return opt[1];\n }\n },\n\n mediaFeature: function (syntaxOptions) {\n const entities = this.entities;\n const nodes = [];\n let e;\n let p;\n let rangeP;\n parserInput.save();\n do {\n e = entities.keyword() || entities.variable() || entities.mixinLookup();\n if (e) {\n nodes.push(e);\n } else if (parserInput.$char('(')) {\n p = this.property();\n parserInput.save();\n if (!p && syntaxOptions.queryInParens && parserInput.$re(/^[0-9a-z-]*\\s*([<>]=|<=|>=|[<>]|=)/)) {\n parserInput.restore();\n p = this.condition();\n\n parserInput.save();\n rangeP = this.atomicCondition(null, p.rvalue);\n if (!rangeP) {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n e = this.value();\n }\n if (parserInput.$char(')')) {\n if (p && !e) {\n nodes.push(new (tree.Paren)(new (tree.QueryInParens)(p.op, p.lvalue, p.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p._index)));\t\t\t\t \n e = p;\n } else if (p && e) {\n nodes.push(new (tree.Paren)(new (tree.Declaration)(p, e, null, null, parserInput.i + currentIndex, fileInfo, true)));\n } else if (e) {\n nodes.push(new(tree.Paren)(e));\n } else {\n error('badly formed media feature definition');\n }\n } else {\n error('Missing closing \\')\\'', 'Parse');\n }\n }\n } while (e);\n\n parserInput.forget();\n if (nodes.length > 0) {\n return new(tree.Expression)(nodes);\n }\n },\n\n mediaFeatures: function (syntaxOptions) {\n const entities = this.entities;\n const features = [];\n let e;\n do {\n e = this.mediaFeature(syntaxOptions);\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n } else {\n e = entities.variable() || entities.mixinLookup();\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n }\n } while (e);\n\n return features.length > 0 ? features : null;\n },\n\n prepareAndGetNestableAtRule: function (treeType, index, debugInfo, syntaxOptions) {\n const features = this.mediaFeatures(syntaxOptions);\n\n const rules = this.block();\n\n if (!rules) {\n error('media definitions require block statements after any features');\n }\n\n parserInput.forget();\n\n const atRule = new (treeType)(rules, features, index + currentIndex, fileInfo);\n if (context.dumpLineNumbers) {\n atRule.debugInfo = debugInfo;\n }\n\n return atRule;\n },\n\n nestableAtRule: function () {\n let debugInfo;\n const index = parserInput.i;\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(index);\n }\n parserInput.save();\n\n if (parserInput.$peekChar('@')) {\n if (parserInput.$str('@media')) {\n return this.prepareAndGetNestableAtRule(tree.Media, index, debugInfo, MediaSyntaxOptions);\n }\n \n if (parserInput.$str('@container')) {\n return this.prepareAndGetNestableAtRule(tree.Container, index, debugInfo, ContainerSyntaxOptions);\n }\n }\n \n parserInput.restore();\n },\n\n //\n\n // A @plugin directive, used to import plugins dynamically.\n //\n // @plugin (args) \"lib\";\n //\n plugin: function () {\n let path;\n let args;\n let options;\n const index = parserInput.i;\n const dir = parserInput.$re(/^@plugin\\s+/);\n\n if (dir) {\n args = this.pluginArgs();\n\n if (args) {\n options = {\n pluginArgs: args,\n isPlugin: true\n };\n }\n else {\n options = { isPlugin: true };\n }\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon on @plugin');\n }\n return new(tree.Import)(path, null, options, index + currentIndex, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed @plugin statement');\n }\n }\n },\n\n pluginArgs: function() {\n // list of options, surrounded by parens\n parserInput.save();\n if (!parserInput.$char('(')) {\n parserInput.restore();\n return null;\n }\n const args = parserInput.$re(/^\\s*([^);]+)\\)\\s*/);\n if (args[1]) {\n parserInput.forget();\n return args[1].trim();\n }\n else {\n parserInput.restore();\n return null;\n }\n },\n\n //\n // A CSS AtRule\n //\n // @charset \"utf-8\";\n //\n atrule: function () {\n const index = parserInput.i;\n let name;\n let value;\n let rules;\n let nonVendorSpecificName;\n let hasIdentifier;\n let hasExpression;\n let hasUnknown;\n let hasBlock = true;\n let isRooted = true;\n\n if (parserInput.currentChar() !== '@') { return; }\n\n value = this['import']() || this.plugin() || this.nestableAtRule();\n if (value) {\n return value;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^@[a-z-]+/);\n\n if (!name) { return; }\n\n nonVendorSpecificName = name;\n if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {\n nonVendorSpecificName = `@${name.slice(name.indexOf('-', 2) + 1)}`;\n }\n\n switch (nonVendorSpecificName) {\n case '@charset':\n hasIdentifier = true;\n hasBlock = false;\n break;\n case '@namespace':\n hasExpression = true;\n hasBlock = false;\n break;\n case '@keyframes':\n case '@counter-style':\n hasIdentifier = true;\n break;\n case '@document':\n case '@supports':\n hasUnknown = true;\n isRooted = false;\n break;\n default:\n hasUnknown = true;\n break;\n }\n\n parserInput.commentStore.length = 0;\n\n if (hasIdentifier) {\n value = this.entity();\n if (!value) {\n error(`expected ${name} identifier`);\n }\n } else if (hasExpression) {\n value = this.expression();\n if (!value) {\n error(`expected ${name} expression`);\n }\n } else if (hasUnknown) {\n value = this.permissiveValue(/^[{;]/);\n hasBlock = (parserInput.currentChar() === '{');\n if (!value) {\n if (!hasBlock && parserInput.currentChar() !== ';') {\n error(`${name} rule is missing block or ending semi-colon`);\n }\n }\n else if (!value.value) {\n value = null;\n }\n }\n\n if (hasBlock) {\n rules = this.blockRuleset();\n }\n\n if (rules || (!hasBlock && value && parserInput.$char(';'))) {\n parserInput.forget();\n return new(tree.AtRule)(name, value, rules, index + currentIndex, fileInfo,\n context.dumpLineNumbers ? getDebugInfo(index) : null,\n isRooted\n );\n }\n\n parserInput.restore('at-rule options not recognised');\n },\n\n //\n // A Value is a comma-delimited list of Expressions\n //\n // font-family: Baskerville, Georgia, serif;\n //\n // In a Rule, a Value represents everything after the `:`,\n // and before the `;`.\n //\n value: function () {\n let e;\n const expressions = [];\n const index = parserInput.i;\n\n do {\n e = this.expression();\n if (e) {\n expressions.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n } while (e);\n\n if (expressions.length > 0) {\n return new(tree.Value)(expressions, index + currentIndex);\n }\n },\n important: function () {\n if (parserInput.currentChar() === '!') {\n return parserInput.$re(/^! *important/);\n }\n },\n sub: function () {\n let a;\n let e;\n\n parserInput.save();\n if (parserInput.$char('(')) {\n a = this.addition();\n if (a && parserInput.$char(')')) {\n parserInput.forget();\n e = new(tree.Expression)([a]);\n e.parens = true;\n return e;\n }\n parserInput.restore('Expected \\')\\'');\n return;\n }\n parserInput.restore();\n },\n multiplication: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.operand();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n if (parserInput.peek(/^\\/[*/]/)) {\n break;\n }\n\n parserInput.save();\n\n op = parserInput.$char('/') || parserInput.$char('*') || parserInput.$str('./');\n\n if (!op) { parserInput.forget(); break; }\n\n a = this.operand();\n\n if (!a) { parserInput.restore(); break; }\n parserInput.forget();\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n addition: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.multiplication();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n op = parserInput.$re(/^[-+]\\s+/) || (!isSpaced && (parserInput.$char('+') || parserInput.$char('-')));\n if (!op) {\n break;\n }\n a = this.multiplication();\n if (!a) {\n break;\n }\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n conditions: function () {\n let a;\n let b;\n const index = parserInput.i;\n let condition;\n\n a = this.condition(true);\n if (a) {\n while (true) {\n if (!parserInput.peek(/^,\\s*(not\\s*)?\\(/) || !parserInput.$char(',')) {\n break;\n }\n b = this.condition(true);\n if (!b) {\n break;\n }\n condition = new(tree.Condition)('or', condition || a, b, index + currentIndex);\n }\n return condition || a;\n }\n },\n condition: function (needsParens) {\n let result;\n let logical;\n let next;\n function or() {\n return parserInput.$str('or');\n }\n\n result = this.conditionAnd(needsParens);\n if (!result) {\n return ;\n }\n logical = or();\n if (logical) {\n next = this.condition(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n conditionAnd: function (needsParens) {\n let result;\n let logical;\n let next;\n const self = this;\n function insideCondition() {\n const cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens);\n if (!cond && !needsParens) {\n return self.atomicCondition(needsParens);\n }\n return cond;\n }\n function and() {\n return parserInput.$str('and');\n }\n\n result = insideCondition();\n if (!result) {\n return ;\n }\n logical = and();\n if (logical) {\n next = this.conditionAnd(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n negatedCondition: function (needsParens) {\n if (parserInput.$str('not')) {\n const result = this.parenthesisCondition(needsParens);\n if (result) {\n result.negate = !result.negate;\n }\n return result;\n }\n },\n parenthesisCondition: function (needsParens) {\n function tryConditionFollowedByParenthesis(me) {\n let body;\n parserInput.save();\n body = me.condition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return ;\n }\n parserInput.forget();\n return body;\n }\n\n let body;\n parserInput.save();\n if (!parserInput.$str('(')) {\n parserInput.restore();\n return ;\n }\n body = tryConditionFollowedByParenthesis(this);\n if (body) {\n parserInput.forget();\n return body;\n }\n\n body = this.atomicCondition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore(`expected ')' got '${parserInput.currentChar()}'`);\n return ;\n }\n parserInput.forget();\n return body;\n },\n atomicCondition: function (needsParens, preparsedCond) {\n const entities = this.entities;\n const index = parserInput.i;\n let a;\n let b;\n let c;\n let op;\n\n const cond = (function() {\n return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup();\n }).bind(this)\n\n if (preparsedCond) {\n a = preparsedCond;\n } else {\n a = cond();\n }\n\n if (a) {\n if (parserInput.$char('>')) {\n if (parserInput.$char('=')) {\n op = '>=';\n } else {\n op = '>';\n }\n } else\n if (parserInput.$char('<')) {\n if (parserInput.$char('=')) {\n op = '<=';\n } else {\n op = '<';\n }\n } else\n if (parserInput.$char('=')) {\n if (parserInput.$char('>')) {\n op = '=>';\n } else if (parserInput.$char('<')) {\n op = '=<';\n } else {\n op = '=';\n }\n }\n if (op) {\n b = cond();\n if (b) {\n c = new(tree.Condition)(op, a, b, index + currentIndex, false);\n } else {\n error('expected expression');\n }\n } else if (!preparsedCond) {\n c = new(tree.Condition)('=', a, new(tree.Keyword)('true'), index + currentIndex, false);\n }\n return c;\n }\n },\n\n //\n // An operand is anything that can be part of an operation,\n // such as a Color, or a Variable\n //\n operand: function () {\n const entities = this.entities;\n let negate;\n\n if (parserInput.peek(/^-[@$(]/)) {\n negate = parserInput.$char('-');\n }\n\n let o = this.sub() || entities.dimension() ||\n entities.color() || entities.variable() ||\n entities.property() || entities.call() ||\n entities.quoted(true) || entities.colorKeyword() ||\n entities.mixinLookup();\n\n if (negate) {\n o.parensInOp = true;\n o = new(tree.Negative)(o);\n }\n\n return o;\n },\n\n //\n // Expressions either represent mathematical operations,\n // or white-space delimited Entities.\n //\n // 1px solid black\n // @var * 2\n //\n expression: function () {\n const entities = [];\n let e;\n let delim;\n const index = parserInput.i;\n\n do {\n e = this.comment();\n if (e) {\n entities.push(e);\n continue;\n }\n e = this.addition() || this.entity();\n\n if (e instanceof tree.Comment) {\n e = null;\n }\n\n if (e) {\n entities.push(e);\n // operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n if (!parserInput.peek(/^\\/[/*]/)) {\n delim = parserInput.$char('/');\n if (delim) {\n entities.push(new(tree.Anonymous)(delim, index + currentIndex));\n }\n }\n }\n } while (e);\n if (entities.length > 0) {\n return new(tree.Expression)(entities);\n }\n },\n property: function () {\n const name = parserInput.$re(/^(\\*?-?[_a-zA-Z0-9-]+)\\s*:/);\n if (name) {\n return name[1];\n }\n },\n ruleProperty: function () {\n let name = [];\n const index = [];\n let s;\n let k;\n\n parserInput.save();\n\n const simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\\s*:/);\n if (simpleProperty) {\n name = [new(tree.Keyword)(simpleProperty[1])];\n parserInput.forget();\n return name;\n }\n\n function match(re) {\n const i = parserInput.i;\n const chunk = parserInput.$re(re);\n if (chunk) {\n index.push(i);\n return name.push(chunk[1]);\n }\n }\n\n match(/^(\\*?)/);\n while (true) {\n if (!match(/^((?:[\\w-]+)|(?:[@$]\\{[\\w-]+\\}))/)) {\n break;\n }\n }\n\n if ((name.length > 1) && match(/^((?:\\+_|\\+)?)\\s*:/)) {\n parserInput.forget();\n\n // at last, we have the complete match now. move forward,\n // convert name particles to tree objects and return:\n if (name[0] === '') {\n name.shift();\n index.shift();\n }\n for (k = 0; k < name.length; k++) {\n s = name[k];\n name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ?\n new(tree.Keyword)(s) :\n (s.charAt(0) === '@' ?\n new(tree.Variable)(`@${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo) :\n new(tree.Property)(`$${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo));\n }\n return name;\n }\n parserInput.restore();\n }\n }\n };\n};\nParser.serializeVars = vars => {\n let s = '';\n\n for (const name in vars) {\n if (Object.hasOwnProperty.call(vars, name)) {\n const value = vars[name];\n s += `${((name[0] === '@') ? '' : '@') + name}: ${value}${(String(value).slice(-1) === ';') ? '' : ';'}`;\n }\n }\n\n return s;\n};\n\nexport default Parser;","import Node from './node';\nimport Element from './element';\nimport LessError from '../less-error';\nimport * as utils from '../utils';\nimport Parser from '../parser/parser';\n\nconst Selector = function(elements, extendList, condition, index, currentFileInfo, visibilityInfo) {\n this.extendList = extendList;\n this.condition = condition;\n this.evaldCondition = !condition;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.elements = this.getElements(elements);\n this.mixinElements_ = undefined;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.elements, this);\n};\n\nSelector.prototype = Object.assign(new Node(), {\n type: 'Selector',\n\n accept(visitor) {\n if (this.elements) {\n this.elements = visitor.visitArray(this.elements);\n }\n if (this.extendList) {\n this.extendList = visitor.visitArray(this.extendList);\n }\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n },\n\n createDerived(elements, extendList, evaldCondition) {\n elements = this.getElements(elements);\n const newSelector = new Selector(elements, extendList || this.extendList,\n null, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n newSelector.evaldCondition = (!utils.isNullOrUndefined(evaldCondition)) ? evaldCondition : this.evaldCondition;\n newSelector.mediaEmpty = this.mediaEmpty;\n return newSelector;\n },\n\n getElements(els) {\n if (!els) {\n return [new Element('', '&', false, this._index, this._fileInfo)];\n }\n if (typeof els === 'string') {\n new Parser(this.parse.context, this.parse.importManager, this._fileInfo, this._index).parseNode(\n els,\n ['selector'],\n function(err, result) {\n if (err) {\n throw new LessError({\n index: err.index,\n message: err.message\n }, this.parse.imports, this._fileInfo.filename);\n }\n els = result[0].elements;\n });\n }\n return els;\n },\n\n createEmptySelectors() {\n const el = new Element('', '&', false, this._index, this._fileInfo), sels = [new Selector([el], null, null, this._index, this._fileInfo)];\n sels[0].mediaEmpty = true;\n return sels;\n },\n\n match(other) {\n const elements = this.elements;\n const len = elements.length;\n let olen;\n let i;\n\n other = other.mixinElements();\n olen = other.length;\n if (olen === 0 || len < olen) {\n return 0;\n } else {\n for (i = 0; i < olen; i++) {\n if (elements[i].value !== other[i]) {\n return 0;\n }\n }\n }\n\n return olen; // return number of matched elements\n },\n\n mixinElements() {\n if (this.mixinElements_) {\n return this.mixinElements_;\n }\n\n let elements = this.elements.map( function(v) {\n return v.combinator.value + (v.value.value || v.value);\n }).join('').match(/[,*.\\w-]([\\w-]|(\\\\.))*/g);\n\n if (elements) {\n if (elements[0] === '&') {\n elements.shift();\n }\n } else {\n elements = [];\n }\n\n return (this.mixinElements_ = elements);\n },\n\n isJustParentSelector() {\n return !this.mediaEmpty &&\n this.elements.length === 1 &&\n this.elements[0].value === '&' &&\n (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === '');\n },\n\n eval(context) {\n const evaldCondition = this.condition && this.condition.eval(context);\n let elements = this.elements;\n let extendList = this.extendList;\n\n elements = elements && elements.map(function (e) { return e.eval(context); });\n extendList = extendList && extendList.map(function(extend) { return extend.eval(context); });\n\n return this.createDerived(elements, extendList, evaldCondition);\n },\n\n genCSS(context, output) {\n let i, element;\n if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') {\n output.add(' ', this.fileInfo(), this.getIndex());\n }\n for (i = 0; i < this.elements.length; i++) {\n element = this.elements[i];\n element.genCSS(context, output);\n }\n },\n\n getIsOutput() {\n return this.evaldCondition;\n }\n});\n\nexport default Selector;\n","import Node from './node';\n\nconst Value = function(value) {\n if (!value) {\n throw new Error('Value requires an array argument');\n }\n if (!Array.isArray(value)) {\n this.value = [ value ];\n }\n else {\n this.value = value;\n }\n};\n\nValue.prototype = Object.assign(new Node(), {\n type: 'Value',\n\n accept(visitor) {\n if (this.value) {\n this.value = visitor.visitArray(this.value);\n }\n },\n\n eval(context) {\n if (this.value.length === 1) {\n return this.value[0].eval(context);\n } else {\n return new Value(this.value.map(function (v) {\n return v.eval(context);\n }));\n }\n },\n\n genCSS(context, output) {\n let i;\n for (i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (i + 1 < this.value.length) {\n output.add((context && context.compress) ? ',' : ', ');\n }\n }\n }\n});\n\nexport default Value;\n","import Node from './node';\n\nconst Keyword = function(value) {\n this.value = value;\n};\n\nKeyword.prototype = Object.assign(new Node(), {\n type: 'Keyword',\n\n genCSS(context, output) {\n if (this.value === '%') { throw { type: 'Syntax', message: 'Invalid % without number' }; }\n output.add(this.value);\n }\n});\n\nKeyword.True = new Keyword('true');\nKeyword.False = new Keyword('false');\n\nexport default Keyword;\n","import Node from './node';\n\nconst Anonymous = function(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {\n this.value = value;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.mapLines = mapLines;\n this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;\n this.allowRoot = true;\n this.copyVisibilityInfo(visibilityInfo);\n}\n\nAnonymous.prototype = Object.assign(new Node(), {\n type: 'Anonymous',\n eval() {\n return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());\n },\n compare(other) {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n },\n isRulesetLike() {\n return this.rulesetLike;\n },\n genCSS(context, output) {\n this.nodeVisible = Boolean(this.value);\n if (this.nodeVisible) {\n output.add(this.value, this._fileInfo, this._index, this.mapLines);\n }\n }\n})\n\nexport default Anonymous;\n","import Node from './node';\nimport Value from './value';\nimport Keyword from './keyword';\nimport Anonymous from './anonymous';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\nfunction evalName(context, name) {\n let value = '';\n let i;\n const n = name.length;\n const output = {add: function (s) {value += s;}};\n for (i = 0; i < n; i++) {\n name[i].eval(context).genCSS(context, output);\n }\n return value;\n}\n\nconst Declaration = function(name, value, important, merge, index, currentFileInfo, inline, variable) {\n this.name = name;\n this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]);\n this.important = important ? ` ${important.trim()}` : '';\n this.merge = merge;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.inline = inline || false;\n this.variable = (variable !== undefined) ? variable\n : (name.charAt && (name.charAt(0) === '@'));\n this.allowRoot = true;\n this.setParent(this.value, this);\n};\n\nDeclaration.prototype = Object.assign(new Node(), {\n type: 'Declaration',\n\n genCSS(context, output) {\n output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex());\n try {\n this.value.genCSS(context, output);\n }\n catch (e) {\n e.index = this._index;\n e.filename = this._fileInfo.filename;\n throw e;\n }\n output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index);\n },\n\n eval(context) {\n let mathBypass = false, prevMath, name = this.name, evaldValue, variable = this.variable;\n if (typeof name !== 'string') {\n // expand 'primitive' name directly to get\n // things faster (~10% for benchmark.less):\n name = (name.length === 1) && (name[0] instanceof Keyword) ?\n name[0].value : evalName(context, name);\n variable = false; // never treat expanded interpolation as new variable name\n }\n\n // @todo remove when parens-division is default\n if (name === 'font' && context.math === MATH.ALWAYS) {\n mathBypass = true;\n prevMath = context.math;\n context.math = MATH.PARENS_DIVISION;\n }\n try {\n context.importantScope.push({});\n evaldValue = this.value.eval(context);\n\n if (!this.variable && evaldValue.type === 'DetachedRuleset') {\n throw { message: 'Rulesets cannot be evaluated on a property.',\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n let important = this.important;\n const importantResult = context.importantScope.pop();\n if (!important && importantResult.important) {\n important = importantResult.important;\n }\n\n return new Declaration(name,\n evaldValue,\n important,\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline,\n variable);\n }\n catch (e) {\n if (typeof e.index !== 'number') {\n e.index = this.getIndex();\n e.filename = this.fileInfo().filename;\n }\n throw e;\n }\n finally {\n if (mathBypass) {\n context.math = prevMath;\n }\n }\n },\n\n makeImportant() {\n return new Declaration(this.name,\n this.value,\n '!important',\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline);\n }\n});\n\nexport default Declaration;","function asComment(ctx) {\n return `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\\n`;\n}\n\nfunction asMediaQuery(ctx) {\n let filenameWithProtocol = ctx.debugInfo.fileName;\n if (!/^[a-z]+:\\/\\//i.test(filenameWithProtocol)) {\n filenameWithProtocol = `file://${filenameWithProtocol}`;\n }\n return `@media -sass-debug-info{filename{font-family:${filenameWithProtocol.replace(/([.:/\\\\])/g, function (a) {\n if (a == '\\\\') {\n a = '/';\n }\n return `\\\\${a}`;\n })}}line{font-family:\\\\00003${ctx.debugInfo.lineNumber}}}\\n`;\n}\n\nfunction debugInfo(context, ctx, lineSeparator) {\n let result = '';\n if (context.dumpLineNumbers && !context.compress) {\n switch (context.dumpLineNumbers) {\n case 'comments':\n result = asComment(ctx);\n break;\n case 'mediaquery':\n result = asMediaQuery(ctx);\n break;\n case 'all':\n result = asComment(ctx) + (lineSeparator || '') + asMediaQuery(ctx);\n break;\n }\n }\n return result;\n}\n\nexport default debugInfo;\n\n","import Node from './node';\nimport getDebugInfo from './debug-info';\n\nconst Comment = function(value, isLineComment, index, currentFileInfo) {\n this.value = value;\n this.isLineComment = isLineComment;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n}\n\nComment.prototype = Object.assign(new Node(), {\n type: 'Comment',\n\n genCSS(context, output) {\n if (this.debugInfo) {\n output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n },\n\n isSilent(context) {\n const isCompressed = context.compress && this.value[2] !== '!';\n return this.isLineComment || isCompressed;\n }\n});\n\nexport default Comment;\n","import Keyword from '../tree/keyword';\nimport * as utils from '../utils';\n\nconst defaultFunc = {\n eval: function () {\n const v = this.value_;\n const e = this.error_;\n if (e) {\n throw e;\n }\n if (!utils.isNullOrUndefined(v)) {\n return v ? Keyword.True : Keyword.False;\n }\n },\n value: function (v) {\n this.value_ = v;\n },\n error: function (e) {\n this.error_ = e;\n },\n reset: function () {\n this.value_ = this.error_ = null;\n }\n};\n\nexport default defaultFunc;\n","import Node from './node';\nimport Declaration from './declaration';\nimport Keyword from './keyword';\nimport Comment from './comment';\nimport Paren from './paren';\nimport Selector from './selector';\nimport Element from './element';\nimport Anonymous from './anonymous';\nimport contexts from '../contexts';\nimport globalFunctionRegistry from '../functions/function-registry';\nimport defaultFunc from '../functions/default';\nimport getDebugInfo from './debug-info';\nimport * as utils from '../utils';\nimport Parser from '../parser/parser';\n\nconst Ruleset = function(selectors, rules, strictImports, visibilityInfo) {\n this.selectors = selectors;\n this.rules = rules;\n this._lookups = {};\n this._variables = null;\n this._properties = null;\n this.strictImports = strictImports;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n this.setParent(this.selectors, this);\n this.setParent(this.rules, this);\n}\n\nRuleset.prototype = Object.assign(new Node(), {\n type: 'Ruleset',\n isRuleset: true,\n\n isRulesetLike() { return true; },\n\n accept(visitor) {\n if (this.paths) {\n this.paths = visitor.visitArray(this.paths, true);\n } else if (this.selectors) {\n this.selectors = visitor.visitArray(this.selectors);\n }\n if (this.rules && this.rules.length) {\n this.rules = visitor.visitArray(this.rules);\n }\n },\n\n eval(context) {\n let selectors;\n let selCnt;\n let selector;\n let i;\n let hasVariable;\n let hasOnePassingSelector = false;\n\n if (this.selectors && (selCnt = this.selectors.length)) {\n selectors = new Array(selCnt);\n defaultFunc.error({\n type: 'Syntax',\n message: 'it is currently only allowed in parametric mixin guards,'\n });\n\n for (i = 0; i < selCnt; i++) {\n selector = this.selectors[i].eval(context);\n for (let j = 0; j < selector.elements.length; j++) {\n if (selector.elements[j].isVariable) {\n hasVariable = true;\n break;\n }\n }\n selectors[i] = selector;\n if (selector.evaldCondition) {\n hasOnePassingSelector = true;\n }\n }\n\n if (hasVariable) {\n const toParseSelectors = new Array(selCnt);\n for (i = 0; i < selCnt; i++) {\n selector = selectors[i];\n toParseSelectors[i] = selector.toCSS(context);\n }\n const startingIndex = selectors[0].getIndex();\n const selectorFileInfo = selectors[0].fileInfo();\n new Parser(context, this.parse.importManager, selectorFileInfo, startingIndex).parseNode(\n toParseSelectors.join(','),\n ['selectors'],\n function(err, result) {\n if (result) {\n selectors = utils.flattenArray(result);\n }\n });\n }\n\n defaultFunc.reset();\n } else {\n hasOnePassingSelector = true;\n }\n\n let rules = this.rules ? utils.copyArray(this.rules) : null;\n const ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo());\n let rule;\n let subRule;\n\n ruleset.originalRuleset = this;\n ruleset.root = this.root;\n ruleset.firstRoot = this.firstRoot;\n ruleset.allowImports = this.allowImports;\n\n if (this.debugInfo) {\n ruleset.debugInfo = this.debugInfo;\n }\n\n if (!hasOnePassingSelector) {\n rules.length = 0;\n }\n\n // inherit a function registry from the frames stack when possible;\n // otherwise from the global registry\n ruleset.functionRegistry = (function (frames) {\n let i = 0;\n const n = frames.length;\n let found;\n for ( ; i !== n ; ++i ) {\n found = frames[ i ].functionRegistry;\n if ( found ) { return found; }\n }\n return globalFunctionRegistry;\n }(context.frames)).inherit();\n\n // push the current ruleset to the frames stack\n const ctxFrames = context.frames;\n ctxFrames.unshift(ruleset);\n\n // currrent selectors\n let ctxSelectors = context.selectors;\n if (!ctxSelectors) {\n context.selectors = ctxSelectors = [];\n }\n ctxSelectors.unshift(this.selectors);\n\n // Evaluate imports\n if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) {\n ruleset.evalImports(context);\n }\n\n // Store the frames around mixin definitions,\n // so they can be evaluated like closures when the time comes.\n const rsRules = ruleset.rules;\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.evalFirst) {\n rsRules[i] = rule.eval(context);\n }\n }\n\n const mediaBlockCount = (context.mediaBlocks && context.mediaBlocks.length) || 0;\n\n // Evaluate mixin calls.\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.type === 'MixinCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).filter(function(r) {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope if the variable is\n // already there. consider returning false here\n // but we need a way to \"return\" variable from mixins\n return !(ruleset.variable(r.name));\n }\n return true;\n });\n rsRules.splice.apply(rsRules, [i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n } else if (rule.type === 'VariableCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).rules.filter(function(r) {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope at all\n return false;\n }\n return true;\n });\n rsRules.splice.apply(rsRules, [i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n if (!rule.evalFirst) {\n rsRules[i] = rule = rule.eval ? rule.eval(context) : rule;\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n // for rulesets, check if it is a css guard and can be removed\n if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) {\n // check if it can be folded in (e.g. & where)\n if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) {\n rsRules.splice(i--, 1);\n\n for (let j = 0; (subRule = rule.rules[j]); j++) {\n if (subRule instanceof Node) {\n subRule.copyVisibilityInfo(rule.visibilityInfo());\n if (!(subRule instanceof Declaration) || !subRule.variable) {\n rsRules.splice(++i, 0, subRule);\n }\n }\n }\n }\n }\n }\n\n // Pop the stack\n ctxFrames.shift();\n ctxSelectors.shift();\n\n if (context.mediaBlocks) {\n for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) {\n context.mediaBlocks[i].bubbleSelectors(selectors);\n }\n }\n\n return ruleset;\n },\n\n evalImports(context) {\n const rules = this.rules;\n let i;\n let importRules;\n if (!rules) { return; }\n\n for (i = 0; i < rules.length; i++) {\n if (rules[i].type === 'Import') {\n importRules = rules[i].eval(context);\n if (importRules && (importRules.length || importRules.length === 0)) {\n rules.splice.apply(rules, [i, 1].concat(importRules));\n i += importRules.length - 1;\n } else {\n rules.splice(i, 1, importRules);\n }\n this.resetCache();\n }\n }\n },\n\n makeImportant() {\n const result = new Ruleset(this.selectors, this.rules.map(function (r) {\n if (r.makeImportant) {\n return r.makeImportant();\n } else {\n return r;\n }\n }), this.strictImports, this.visibilityInfo());\n\n return result;\n },\n\n matchArgs(args) {\n return !args || args.length === 0;\n },\n\n // lets you call a css selector with a guard\n matchCondition(args, context) {\n const lastSelector = this.selectors[this.selectors.length - 1];\n if (!lastSelector.evaldCondition) {\n return false;\n }\n if (lastSelector.condition &&\n !lastSelector.condition.eval(\n new contexts.Eval(context,\n context.frames))) {\n return false;\n }\n return true;\n },\n\n resetCache() {\n this._rulesets = null;\n this._variables = null;\n this._properties = null;\n this._lookups = {};\n },\n\n variables() {\n if (!this._variables) {\n this._variables = !this.rules ? {} : this.rules.reduce(function (hash, r) {\n if (r instanceof Declaration && r.variable === true) {\n hash[r.name] = r;\n }\n // when evaluating variables in an import statement, imports have not been eval'd\n // so we need to go inside import statements.\n // guard against root being a string (in the case of inlined less)\n if (r.type === 'Import' && r.root && r.root.variables) {\n const vars = r.root.variables();\n for (const name in vars) {\n // eslint-disable-next-line no-prototype-builtins\n if (vars.hasOwnProperty(name)) {\n hash[name] = r.root.variable(name);\n }\n }\n }\n return hash;\n }, {});\n }\n return this._variables;\n },\n\n properties() {\n if (!this._properties) {\n this._properties = !this.rules ? {} : this.rules.reduce(function (hash, r) {\n if (r instanceof Declaration && r.variable !== true) {\n const name = (r.name.length === 1) && (r.name[0] instanceof Keyword) ?\n r.name[0].value : r.name;\n // Properties don't overwrite as they can merge\n if (!hash[`$${name}`]) {\n hash[`$${name}`] = [ r ];\n }\n else {\n hash[`$${name}`].push(r);\n }\n }\n return hash;\n }, {});\n }\n return this._properties;\n },\n\n variable(name) {\n const decl = this.variables()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n },\n\n property(name) {\n const decl = this.properties()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n },\n\n lastDeclaration() {\n for (let i = this.rules.length; i > 0; i--) {\n const decl = this.rules[i - 1];\n if (decl instanceof Declaration) {\n return this.parseValue(decl);\n }\n }\n },\n\n parseValue(toParse) {\n const self = this;\n function transformDeclaration(decl) {\n if (decl.value instanceof Anonymous && !decl.parsed) {\n if (typeof decl.value.value === 'string') {\n new Parser(this.parse.context, this.parse.importManager, decl.fileInfo(), decl.value.getIndex()).parseNode(\n decl.value.value,\n ['value', 'important'],\n function(err, result) {\n if (err) {\n decl.parsed = true;\n }\n if (result) {\n decl.value = result[0];\n decl.important = result[1] || '';\n decl.parsed = true;\n }\n });\n } else {\n decl.parsed = true;\n }\n\n return decl;\n }\n else {\n return decl;\n }\n }\n if (!Array.isArray(toParse)) {\n return transformDeclaration.call(self, toParse);\n }\n else {\n const nodes = [];\n toParse.forEach(function(n) {\n nodes.push(transformDeclaration.call(self, n));\n });\n return nodes;\n }\n },\n\n rulesets() {\n if (!this.rules) { return []; }\n\n const filtRules = [];\n const rules = this.rules;\n let i;\n let rule;\n\n for (i = 0; (rule = rules[i]); i++) {\n if (rule.isRuleset) {\n filtRules.push(rule);\n }\n }\n\n return filtRules;\n },\n\n prependRule(rule) {\n const rules = this.rules;\n if (rules) {\n rules.unshift(rule);\n } else {\n this.rules = [ rule ];\n }\n this.setParent(rule, this);\n },\n\n find(selector, self, filter) {\n self = self || this;\n const rules = [];\n let match;\n let foundMixins;\n const key = selector.toCSS();\n\n if (key in this._lookups) { return this._lookups[key]; }\n\n this.rulesets().forEach(function (rule) {\n if (rule !== self) {\n for (let j = 0; j < rule.selectors.length; j++) {\n match = selector.match(rule.selectors[j]);\n if (match) {\n if (selector.elements.length > match) {\n if (!filter || filter(rule)) {\n foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter);\n for (let i = 0; i < foundMixins.length; ++i) {\n foundMixins[i].path.push(rule);\n }\n Array.prototype.push.apply(rules, foundMixins);\n }\n } else {\n rules.push({ rule, path: []});\n }\n break;\n }\n }\n }\n });\n this._lookups[key] = rules;\n return rules;\n },\n\n genCSS(context, output) {\n let i;\n let j;\n const charsetRuleNodes = [];\n let ruleNodes = [];\n\n let // Line number debugging\n debugInfo;\n\n let rule;\n let path;\n\n context.tabLevel = (context.tabLevel || 0);\n\n if (!this.root) {\n context.tabLevel++;\n }\n\n const tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' ');\n const tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' ');\n let sep;\n\n let charsetNodeIndex = 0;\n let importNodeIndex = 0;\n for (i = 0; (rule = this.rules[i]); i++) {\n if (rule instanceof Comment) {\n if (importNodeIndex === i) {\n importNodeIndex++;\n }\n ruleNodes.push(rule);\n } else if (rule.isCharset && rule.isCharset()) {\n ruleNodes.splice(charsetNodeIndex, 0, rule);\n charsetNodeIndex++;\n importNodeIndex++;\n } else if (rule.type === 'Import') {\n ruleNodes.splice(importNodeIndex, 0, rule);\n importNodeIndex++;\n } else {\n ruleNodes.push(rule);\n }\n }\n ruleNodes = charsetRuleNodes.concat(ruleNodes);\n\n // If this is the root node, we don't render\n // a selector, or {}.\n if (!this.root) {\n debugInfo = getDebugInfo(context, this, tabSetStr);\n\n if (debugInfo) {\n output.add(debugInfo);\n output.add(tabSetStr);\n }\n\n const paths = this.paths;\n const pathCnt = paths.length;\n let pathSubCnt;\n\n sep = context.compress ? ',' : (`,\\n${tabSetStr}`);\n\n for (i = 0; i < pathCnt; i++) {\n path = paths[i];\n if (!(pathSubCnt = path.length)) { continue; }\n if (i > 0) { output.add(sep); }\n\n context.firstSelector = true;\n path[0].genCSS(context, output);\n\n context.firstSelector = false;\n for (j = 1; j < pathSubCnt; j++) {\n path[j].genCSS(context, output);\n }\n }\n\n output.add((context.compress ? '{' : ' {\\n') + tabRuleStr);\n }\n\n // Compile rules and rulesets\n for (i = 0; (rule = ruleNodes[i]); i++) {\n\n if (i + 1 === ruleNodes.length) {\n context.lastRule = true;\n }\n\n const currentLastRule = context.lastRule;\n if (rule.isRulesetLike(rule)) {\n context.lastRule = false;\n }\n\n if (rule.genCSS) {\n rule.genCSS(context, output);\n } else if (rule.value) {\n output.add(rule.value.toString());\n }\n\n context.lastRule = currentLastRule;\n\n if (!context.lastRule && rule.isVisible()) {\n output.add(context.compress ? '' : (`\\n${tabRuleStr}`));\n } else {\n context.lastRule = false;\n }\n }\n\n if (!this.root) {\n output.add((context.compress ? '}' : `\\n${tabSetStr}}`));\n context.tabLevel--;\n }\n\n if (!output.isEmpty() && !context.compress && this.firstRoot) {\n output.add('\\n');\n }\n },\n\n joinSelectors(paths, context, selectors) {\n for (let s = 0; s < selectors.length; s++) {\n this.joinSelector(paths, context, selectors[s]);\n }\n },\n\n joinSelector(paths, context, selector) {\n\n function createParenthesis(elementsToPak, originalElement) {\n let replacementParen, j;\n if (elementsToPak.length === 0) {\n replacementParen = new Paren(elementsToPak[0]);\n } else {\n const insideParent = new Array(elementsToPak.length);\n for (j = 0; j < elementsToPak.length; j++) {\n insideParent[j] = new Element(\n null,\n elementsToPak[j],\n originalElement.isVariable,\n originalElement._index,\n originalElement._fileInfo\n );\n }\n replacementParen = new Paren(new Selector(insideParent));\n }\n return replacementParen;\n }\n\n function createSelector(containedElement, originalElement) {\n let element, selector;\n element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo);\n selector = new Selector([element]);\n return selector;\n }\n\n // joins selector path from `beginningPath` with selector path in `addPath`\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns concatenated path\n function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) {\n let newSelectorPath, lastSelector, newJoinedSelector;\n // our new selector path\n newSelectorPath = [];\n\n // construct the joined selector - if & is the first thing this will be empty,\n // if not newJoinedSelector will be the last set of elements in the selector\n if (beginningPath.length > 0) {\n newSelectorPath = utils.copyArray(beginningPath);\n lastSelector = newSelectorPath.pop();\n newJoinedSelector = originalSelector.createDerived(utils.copyArray(lastSelector.elements));\n }\n else {\n newJoinedSelector = originalSelector.createDerived([]);\n }\n\n if (addPath.length > 0) {\n // /deep/ is a CSS4 selector - (removed, so should deprecate)\n // that is valid without anything in front of it\n // so if the & does not have a combinator that is \"\" or \" \" then\n // and there is a combinator on the parent, then grab that.\n // this also allows + a { & .b { .a & { ... though not sure why you would want to do that\n let combinator = replacedElement.combinator;\n\n const parentEl = addPath[0].elements[0];\n if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) {\n combinator = parentEl.combinator;\n }\n // join the elements so far with the first part of the parent\n newJoinedSelector.elements.push(new Element(\n combinator,\n parentEl.value,\n replacedElement.isVariable,\n replacedElement._index,\n replacedElement._fileInfo\n ));\n newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1));\n }\n\n // now add the joined selector - but only if it is not empty\n if (newJoinedSelector.elements.length !== 0) {\n newSelectorPath.push(newJoinedSelector);\n }\n\n // put together the parent selectors after the join (e.g. the rest of the parent)\n if (addPath.length > 1) {\n let restOfPath = addPath.slice(1);\n restOfPath = restOfPath.map(function (selector) {\n return selector.createDerived(selector.elements, []);\n });\n newSelectorPath = newSelectorPath.concat(restOfPath);\n }\n return newSelectorPath;\n }\n\n // joins selector path from `beginningPath` with every selector path in `addPaths` array\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns array with all concatenated paths\n function addAllReplacementsIntoPath( beginningPath, addPaths, replacedElement, originalSelector, result) {\n let j;\n for (j = 0; j < beginningPath.length; j++) {\n const newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector);\n result.push(newSelectorPath);\n }\n return result;\n }\n\n function mergeElementsOnToSelectors(elements, selectors) {\n let i, sel;\n\n if (elements.length === 0) {\n return ;\n }\n if (selectors.length === 0) {\n selectors.push([ new Selector(elements) ]);\n return;\n }\n\n for (i = 0; (sel = selectors[i]); i++) {\n // if the previous thing in sel is a parent this needs to join on to it\n if (sel.length > 0) {\n sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements));\n }\n else {\n sel.push(new Selector(elements));\n }\n }\n }\n\n // replace all parent selectors inside `inSelector` by content of `context` array\n // resulting selectors are returned inside `paths` array\n // returns true if `inSelector` contained at least one parent selector\n function replaceParentSelector(paths, context, inSelector) {\n // The paths are [[Selector]]\n // The first list is a list of comma separated selectors\n // The inner list is a list of inheritance separated selectors\n // e.g.\n // .a, .b {\n // .c {\n // }\n // }\n // == [[.a] [.c]] [[.b] [.c]]\n //\n let i, j, k, currentElements, newSelectors, selectorsMultiplied, sel, el, hadParentSelector = false, length, lastSelector;\n function findNestedSelector(element) {\n let maybeSelector;\n if (!(element.value instanceof Paren)) {\n return null;\n }\n\n maybeSelector = element.value.value;\n if (!(maybeSelector instanceof Selector)) {\n return null;\n }\n\n return maybeSelector;\n }\n\n // the elements from the current selector so far\n currentElements = [];\n // the current list of new selectors to add to the path.\n // We will build it up. We initiate it with one empty selector as we \"multiply\" the new selectors\n // by the parents\n newSelectors = [\n []\n ];\n\n for (i = 0; (el = inSelector.elements[i]); i++) {\n // non parent reference elements just get added\n if (el.value !== '&') {\n const nestedSelector = findNestedSelector(el);\n if (nestedSelector !== null) {\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n const nestedPaths = [];\n let replaced;\n const replacedNewSelectors = [];\n replaced = replaceParentSelector(nestedPaths, context, nestedSelector);\n hadParentSelector = hadParentSelector || replaced;\n // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors\n for (k = 0; k < nestedPaths.length; k++) {\n const replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el);\n addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors);\n }\n newSelectors = replacedNewSelectors;\n currentElements = [];\n } else {\n currentElements.push(el);\n }\n\n } else {\n hadParentSelector = true;\n // the new list of selectors to add\n selectorsMultiplied = [];\n\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n // loop through our current selectors\n for (j = 0; j < newSelectors.length; j++) {\n sel = newSelectors[j];\n // if we don't have any parent paths, the & might be in a mixin so that it can be used\n // whether there are parents or not\n if (context.length === 0) {\n // the combinator used on el should now be applied to the next element instead so that\n // it is not lost\n if (sel.length > 0) {\n sel[0].elements.push(new Element(el.combinator, '', el.isVariable, el._index, el._fileInfo));\n }\n selectorsMultiplied.push(sel);\n }\n else {\n // and the parent selectors\n for (k = 0; k < context.length; k++) {\n // We need to put the current selectors\n // then join the last selector's elements on to the parents selectors\n const newSelectorPath = addReplacementIntoPath(sel, context[k], el, inSelector);\n // add that to our new set of selectors\n selectorsMultiplied.push(newSelectorPath);\n }\n }\n }\n\n // our new selectors has been multiplied, so reset the state\n newSelectors = selectorsMultiplied;\n currentElements = [];\n }\n }\n\n // if we have any elements left over (e.g. .a& .b == .b)\n // add them on to all the current selectors\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n for (i = 0; i < newSelectors.length; i++) {\n length = newSelectors[i].length;\n if (length > 0) {\n paths.push(newSelectors[i]);\n lastSelector = newSelectors[i][length - 1];\n newSelectors[i][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList);\n }\n }\n\n return hadParentSelector;\n }\n\n function deriveSelector(visibilityInfo, deriveFrom) {\n const newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition);\n newSelector.copyVisibilityInfo(visibilityInfo);\n return newSelector;\n }\n\n // joinSelector code follows\n let i, newPaths, hadParentSelector;\n\n newPaths = [];\n hadParentSelector = replaceParentSelector(newPaths, context, selector);\n\n if (!hadParentSelector) {\n if (context.length > 0) {\n newPaths = [];\n for (i = 0; i < context.length; i++) {\n\n const concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo()));\n\n concatenated.push(selector);\n newPaths.push(concatenated);\n }\n }\n else {\n newPaths = [[selector]];\n }\n }\n\n for (i = 0; i < newPaths.length; i++) {\n paths.push(newPaths[i]);\n }\n\n }\n});\n\nexport default Ruleset;\n","import Node from './node';\nimport Selector from './selector';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\n\nconst AtRule = function(\n name,\n value,\n rules,\n index,\n currentFileInfo,\n debugInfo,\n isRooted,\n visibilityInfo\n) {\n let i;\n\n this.name = name;\n this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value);\n if (rules) {\n if (Array.isArray(rules)) {\n this.rules = rules;\n } else {\n this.rules = [rules];\n this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors();\n }\n for (i = 0; i < this.rules.length; i++) {\n this.rules[i].allowImports = true;\n }\n this.setParent(this.rules, this);\n }\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.debugInfo = debugInfo;\n this.isRooted = isRooted || false;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n}\n\nAtRule.prototype = Object.assign(new Node(), {\n type: 'AtRule',\n accept(visitor) {\n const value = this.value, rules = this.rules;\n if (rules) {\n this.rules = visitor.visitArray(rules);\n }\n if (value) {\n this.value = visitor.visit(value);\n }\n },\n\n isRulesetLike() {\n return this.rules || !this.isCharset();\n },\n\n isCharset() {\n return '@charset' === this.name;\n },\n\n genCSS(context, output) {\n const value = this.value, rules = this.rules;\n output.add(this.name, this.fileInfo(), this.getIndex());\n if (value) {\n output.add(' ');\n value.genCSS(context, output);\n }\n if (rules) {\n this.outputRuleset(context, output, rules);\n } else {\n output.add(';');\n }\n },\n\n eval(context) {\n let mediaPathBackup, mediaBlocksBackup, value = this.value, rules = this.rules;\n\n // media stored inside other atrule should not bubble over it\n // backpup media bubbling information\n mediaPathBackup = context.mediaPath;\n mediaBlocksBackup = context.mediaBlocks;\n // deleted media bubbling information\n context.mediaPath = [];\n context.mediaBlocks = [];\n\n if (value) {\n value = value.eval(context);\n }\n if (rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n rules = [rules[0].eval(context)];\n rules[0].root = true;\n }\n // restore media bubbling information\n context.mediaPath = mediaPathBackup;\n context.mediaBlocks = mediaBlocksBackup;\n\n return new AtRule(this.name, value, rules,\n this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo());\n },\n\n variable(name) {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.variable.call(this.rules[0], name);\n }\n },\n\n find() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.find.apply(this.rules[0], arguments);\n }\n },\n\n rulesets() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.rulesets.apply(this.rules[0]);\n }\n },\n\n outputRuleset(context, output, rules) {\n const ruleCnt = rules.length;\n let i;\n context.tabLevel = (context.tabLevel | 0) + 1;\n\n // Compressed\n if (context.compress) {\n output.add('{');\n for (i = 0; i < ruleCnt; i++) {\n rules[i].genCSS(context, output);\n }\n output.add('}');\n context.tabLevel--;\n return;\n }\n\n // Non-compressed\n const tabSetStr = `\\n${Array(context.tabLevel).join(' ')}`, tabRuleStr = `${tabSetStr} `;\n if (!ruleCnt) {\n output.add(` {${tabSetStr}}`);\n } else {\n output.add(` {${tabRuleStr}`);\n rules[0].genCSS(context, output);\n for (i = 1; i < ruleCnt; i++) {\n output.add(tabRuleStr);\n rules[i].genCSS(context, output);\n }\n output.add(`${tabSetStr}}`);\n }\n\n context.tabLevel--;\n }\n});\n\nexport default AtRule;\n","import Node from './node';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nconst DetachedRuleset = function(ruleset, frames) {\n this.ruleset = ruleset;\n this.frames = frames;\n this.setParent(this.ruleset, this);\n};\n\nDetachedRuleset.prototype = Object.assign(new Node(), {\n type: 'DetachedRuleset',\n evalFirst: true,\n\n accept(visitor) {\n this.ruleset = visitor.visit(this.ruleset);\n },\n\n eval(context) {\n const frames = this.frames || utils.copyArray(context.frames);\n return new DetachedRuleset(this.ruleset, frames);\n },\n\n callEval(context) {\n return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context);\n }\n});\n\nexport default DetachedRuleset;\n","import Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport * as utils from '../utils';\n\nconst Unit = function(numerator, denominator, backupUnit) {\n this.numerator = numerator ? utils.copyArray(numerator).sort() : [];\n this.denominator = denominator ? utils.copyArray(denominator).sort() : [];\n if (backupUnit) {\n this.backupUnit = backupUnit;\n } else if (numerator && numerator.length) {\n this.backupUnit = numerator[0];\n }\n};\n\nUnit.prototype = Object.assign(new Node(), {\n type: 'Unit',\n\n clone() {\n return new Unit(utils.copyArray(this.numerator), utils.copyArray(this.denominator), this.backupUnit);\n },\n\n genCSS(context, output) {\n // Dimension checks the unit is singular and throws an error if in strict math mode.\n const strictUnits = context && context.strictUnits;\n if (this.numerator.length === 1) {\n output.add(this.numerator[0]); // the ideal situation\n } else if (!strictUnits && this.backupUnit) {\n output.add(this.backupUnit);\n } else if (!strictUnits && this.denominator.length) {\n output.add(this.denominator[0]);\n }\n },\n\n toString() {\n let i, returnStr = this.numerator.join('*');\n for (i = 0; i < this.denominator.length; i++) {\n returnStr += `/${this.denominator[i]}`;\n }\n return returnStr;\n },\n\n compare(other) {\n return this.is(other.toString()) ? 0 : undefined;\n },\n\n is(unitString) {\n return this.toString().toUpperCase() === unitString.toUpperCase();\n },\n\n isLength() {\n return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS());\n },\n\n isEmpty() {\n return this.numerator.length === 0 && this.denominator.length === 0;\n },\n\n isSingular() {\n return this.numerator.length <= 1 && this.denominator.length === 0;\n },\n\n map(callback) {\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n this.numerator[i] = callback(this.numerator[i], false);\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n this.denominator[i] = callback(this.denominator[i], true);\n }\n },\n\n usedUnits() {\n let group;\n const result = {};\n let mapUnit;\n let groupName;\n\n mapUnit = function (atomicUnit) {\n // eslint-disable-next-line no-prototype-builtins\n if (group.hasOwnProperty(atomicUnit) && !result[groupName]) {\n result[groupName] = atomicUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in unitConversions) {\n // eslint-disable-next-line no-prototype-builtins\n if (unitConversions.hasOwnProperty(groupName)) {\n group = unitConversions[groupName];\n\n this.map(mapUnit);\n }\n }\n\n return result;\n },\n\n cancel() {\n const counter = {};\n let atomicUnit;\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n atomicUnit = this.numerator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) + 1;\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n atomicUnit = this.denominator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) - 1;\n }\n\n this.numerator = [];\n this.denominator = [];\n\n for (atomicUnit in counter) {\n // eslint-disable-next-line no-prototype-builtins\n if (counter.hasOwnProperty(atomicUnit)) {\n const count = counter[atomicUnit];\n\n if (count > 0) {\n for (i = 0; i < count; i++) {\n this.numerator.push(atomicUnit);\n }\n } else if (count < 0) {\n for (i = 0; i < -count; i++) {\n this.denominator.push(atomicUnit);\n }\n }\n }\n }\n\n this.numerator.sort();\n this.denominator.sort();\n }\n});\n\nexport default Unit;\n","/* eslint-disable no-prototype-builtins */\nimport Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport Unit from './unit';\nimport Color from './color';\n\n//\n// A number with a unit\n//\nconst Dimension = function(value, unit) {\n this.value = parseFloat(value);\n if (isNaN(this.value)) {\n throw new Error('Dimension is not a number.');\n }\n this.unit = (unit && unit instanceof Unit) ? unit :\n new Unit(unit ? [unit] : undefined);\n this.setParent(this.unit, this);\n};\n\nDimension.prototype = Object.assign(new Node(), {\n type: 'Dimension',\n\n accept(visitor) {\n this.unit = visitor.visit(this.unit);\n },\n\n // remove when Nodes have JSDoc types\n // eslint-disable-next-line no-unused-vars\n eval(context) {\n return this;\n },\n\n toColor() {\n return new Color([this.value, this.value, this.value]);\n },\n\n genCSS(context, output) {\n if ((context && context.strictUnits) && !this.unit.isSingular()) {\n throw new Error(`Multiple units in dimension. Correct the units or use the unit function. Bad unit: ${this.unit.toString()}`);\n }\n\n const value = this.fround(context, this.value);\n let strValue = String(value);\n\n if (value !== 0 && value < 0.000001 && value > -0.000001) {\n // would be output 1e-6 etc.\n strValue = value.toFixed(20).replace(/0+$/, '');\n }\n\n if (context && context.compress) {\n // Zero values doesn't need a unit\n if (value === 0 && this.unit.isLength()) {\n output.add(strValue);\n return;\n }\n\n // Float values doesn't need a leading zero\n if (value > 0 && value < 1) {\n strValue = (strValue).substr(1);\n }\n }\n\n output.add(strValue);\n this.unit.genCSS(context, output);\n },\n\n // In an operation between two Dimensions,\n // we default to the first Dimension's unit,\n // so `1px + 2` will yield `3px`.\n operate(context, op, other) {\n /* jshint noempty:false */\n let value = this._operate(context, op, this.value, other.value);\n let unit = this.unit.clone();\n\n if (op === '+' || op === '-') {\n if (unit.numerator.length === 0 && unit.denominator.length === 0) {\n unit = other.unit.clone();\n if (this.unit.backupUnit) {\n unit.backupUnit = this.unit.backupUnit;\n }\n } else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) {\n // do nothing\n } else {\n other = other.convertTo(this.unit.usedUnits());\n\n if (context.strictUnits && other.unit.toString() !== unit.toString()) {\n throw new Error('Incompatible units. Change the units or use the unit function. '\n + `Bad units: '${unit.toString()}' and '${other.unit.toString()}'.`);\n }\n\n value = this._operate(context, op, this.value, other.value);\n }\n } else if (op === '*') {\n unit.numerator = unit.numerator.concat(other.unit.numerator).sort();\n unit.denominator = unit.denominator.concat(other.unit.denominator).sort();\n unit.cancel();\n } else if (op === '/') {\n unit.numerator = unit.numerator.concat(other.unit.denominator).sort();\n unit.denominator = unit.denominator.concat(other.unit.numerator).sort();\n unit.cancel();\n }\n return new Dimension(value, unit);\n },\n\n compare(other) {\n let a, b;\n\n if (!(other instanceof Dimension)) {\n return undefined;\n }\n\n if (this.unit.isEmpty() || other.unit.isEmpty()) {\n a = this;\n b = other;\n } else {\n a = this.unify();\n b = other.unify();\n if (a.unit.compare(b.unit) !== 0) {\n return undefined;\n }\n }\n\n return Node.numericCompare(a.value, b.value);\n },\n\n unify() {\n return this.convertTo({ length: 'px', duration: 's', angle: 'rad' });\n },\n\n convertTo(conversions) {\n let value = this.value;\n const unit = this.unit.clone();\n let i;\n let groupName;\n let group;\n let targetUnit;\n let derivedConversions = {};\n let applyUnit;\n\n if (typeof conversions === 'string') {\n for (i in unitConversions) {\n if (unitConversions[i].hasOwnProperty(conversions)) {\n derivedConversions = {};\n derivedConversions[i] = conversions;\n }\n }\n conversions = derivedConversions;\n }\n applyUnit = function (atomicUnit, denominator) {\n if (group.hasOwnProperty(atomicUnit)) {\n if (denominator) {\n value = value / (group[atomicUnit] / group[targetUnit]);\n } else {\n value = value * (group[atomicUnit] / group[targetUnit]);\n }\n\n return targetUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in conversions) {\n if (conversions.hasOwnProperty(groupName)) {\n targetUnit = conversions[groupName];\n group = unitConversions[groupName];\n\n unit.map(applyUnit);\n }\n }\n\n unit.cancel();\n\n return new Dimension(value, unit);\n }\n});\n\nexport default Dimension;\n","import Node from './node';\nimport Color from './color';\nimport Dimension from './dimension';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\n\nconst Operation = function(op, operands, isSpaced) {\n this.op = op.trim();\n this.operands = operands;\n this.isSpaced = isSpaced;\n};\n\nOperation.prototype = Object.assign(new Node(), {\n type: 'Operation',\n\n accept(visitor) {\n this.operands = visitor.visitArray(this.operands);\n },\n\n eval(context) {\n let a = this.operands[0].eval(context), b = this.operands[1].eval(context), op;\n\n if (context.isMathOn(this.op)) {\n op = this.op === './' ? '/' : this.op;\n if (a instanceof Dimension && b instanceof Color) {\n a = a.toColor();\n }\n if (b instanceof Dimension && a instanceof Color) {\n b = b.toColor();\n }\n if (!a.operate || !b.operate) {\n if (\n (a instanceof Operation || b instanceof Operation)\n && a.op === '/' && context.math === MATH.PARENS_DIVISION\n ) {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n throw { type: 'Operation',\n message: 'Operation on an invalid type' };\n }\n\n return a.operate(context, op, b);\n } else {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n },\n\n genCSS(context, output) {\n this.operands[0].genCSS(context, output);\n if (this.isSpaced) {\n output.add(' ');\n }\n output.add(this.op);\n if (this.isSpaced) {\n output.add(' ');\n }\n this.operands[1].genCSS(context, output);\n }\n});\n\nexport default Operation;\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import Node from './node';\nimport Paren from './paren';\nimport Comment from './comment';\nimport Dimension from './dimension';\nimport Anonymous from './anonymous';\n\nconst Expression = function(value, noSpacing) {\n this.value = value;\n this.noSpacing = noSpacing;\n if (!value) {\n throw new Error('Expression requires an array parameter');\n }\n};\n\nExpression.prototype = Object.assign(new Node(), {\n type: 'Expression',\n\n accept(visitor) {\n this.value = visitor.visitArray(this.value);\n },\n\n eval(context) {\n let returnValue;\n const mathOn = context.isMathOn();\n const inParenthesis = this.parens;\n\n let doubleParen = false;\n if (inParenthesis) {\n context.inParenthesis();\n }\n if (this.value.length > 1) {\n returnValue = new Expression(this.value.map(function (e) {\n if (!e.eval) {\n return e;\n }\n return e.eval(context);\n }), this.noSpacing);\n } else if (this.value.length === 1) {\n if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) {\n doubleParen = true;\n }\n returnValue = this.value[0].eval(context);\n } else {\n returnValue = this;\n }\n if (inParenthesis) {\n context.outOfParenthesis();\n }\n if (this.parens && this.parensInOp && !mathOn && !doubleParen \n && (!(returnValue instanceof Dimension))) {\n returnValue = new Paren(returnValue);\n }\n return returnValue;\n },\n\n genCSS(context, output) {\n for (let i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (!this.noSpacing && i + 1 < this.value.length) {\n if (!this.noSpacing && i + 1 < this.value.length) {\n if (i + 1 < this.value.length && !(this.value[i + 1] instanceof Anonymous) ||\n this.value[i + 1] instanceof Anonymous && this.value[i + 1].value !== ',') {\n output.add(' ');\n }\n }\n }\n }\n },\n\n throwAwayComments() {\n this.value = this.value.filter(function(v) {\n return !(v instanceof Comment);\n });\n }\n});\n\nexport default Expression;\n","import Expression from '../tree/expression';\n\nclass functionCaller {\n constructor(name, context, index, currentFileInfo) {\n this.name = name.toLowerCase();\n this.index = index;\n this.context = context;\n this.currentFileInfo = currentFileInfo;\n\n this.func = context.frames[0].functionRegistry.get(this.name);\n }\n\n isValid() {\n return Boolean(this.func);\n }\n\n call(args) {\n if (!(Array.isArray(args))) {\n args = [args];\n }\n const evalArgs = this.func.evalArgs;\n if (evalArgs !== false) {\n args = args.map(a => a.eval(this.context));\n }\n const commentFilter = item => !(item.type === 'Comment');\n\n // This code is terrible and should be replaced as per this issue...\n // https://github.com/less/less.js/issues/2477\n args = args\n .filter(commentFilter)\n .map(item => {\n if (item.type === 'Expression') {\n const subNodes = item.value.filter(commentFilter);\n if (subNodes.length === 1) {\n // https://github.com/less/less.js/issues/3616\n if (item.parens && subNodes[0].op === '/') {\n return item;\n }\n return subNodes[0];\n } else {\n return new Expression(subNodes);\n }\n }\n return item;\n });\n\n if (evalArgs === false) {\n return this.func(this.context, ...args);\n }\n\n return this.func(...args);\n }\n}\n\nexport default functionCaller;\n","import Node from './node';\nimport Anonymous from './anonymous';\nimport FunctionCaller from '../functions/function-caller';\n\n//\n// A function call node.\n//\nconst Call = function(name, args, index, currentFileInfo) {\n this.name = name;\n this.args = args;\n this.calc = name === 'calc';\n this._index = index;\n this._fileInfo = currentFileInfo;\n}\n\nCall.prototype = Object.assign(new Node(), {\n type: 'Call',\n\n accept(visitor) {\n if (this.args) {\n this.args = visitor.visitArray(this.args);\n }\n },\n\n //\n // When evaluating a function call,\n // we either find the function in the functionRegistry,\n // in which case we call it, passing the evaluated arguments,\n // if this returns null or we cannot find the function, we\n // simply print it out as it appeared originally [2].\n //\n // The reason why we evaluate the arguments, is in the case where\n // we try to pass a variable to a function, like: `saturate(@color)`.\n // The function should receive the value, not the variable.\n //\n eval(context) {\n /**\n * Turn off math for calc(), and switch back on for evaluating nested functions\n */\n const currentMathContext = context.mathOn;\n context.mathOn = !this.calc;\n if (this.calc || context.inCalc) {\n context.enterCalc();\n }\n\n const exitCalc = () => {\n if (this.calc || context.inCalc) {\n context.exitCalc();\n }\n context.mathOn = currentMathContext;\n };\n\n let result;\n const funcCaller = new FunctionCaller(this.name, context, this.getIndex(), this.fileInfo());\n\n if (funcCaller.isValid()) {\n try {\n result = funcCaller.call(this.args);\n exitCalc();\n } catch (e) {\n // eslint-disable-next-line no-prototype-builtins\n if (e.hasOwnProperty('line') && e.hasOwnProperty('column')) {\n throw e;\n }\n throw { \n type: e.type || 'Runtime',\n message: `Error evaluating function \\`${this.name}\\`${e.message ? `: ${e.message}` : ''}`,\n index: this.getIndex(), \n filename: this.fileInfo().filename,\n line: e.lineNumber,\n column: e.columnNumber\n };\n }\n }\n\n if (result !== null && result !== undefined) {\n // Results that that are not nodes are cast as Anonymous nodes\n // Falsy values or booleans are returned as empty nodes\n if (!(result instanceof Node)) {\n if (!result || result === true) {\n result = new Anonymous(null); \n }\n else {\n result = new Anonymous(result.toString()); \n }\n \n }\n result._index = this._index;\n result._fileInfo = this._fileInfo;\n return result;\n }\n\n const args = this.args.map(a => a.eval(context));\n exitCalc();\n\n return new Call(this.name, args, this.getIndex(), this.fileInfo());\n },\n\n genCSS(context, output) {\n output.add(`${this.name}(`, this.fileInfo(), this.getIndex());\n\n for (let i = 0; i < this.args.length; i++) {\n this.args[i].genCSS(context, output);\n if (i + 1 < this.args.length) {\n output.add(', ');\n }\n }\n\n output.add(')');\n }\n});\n\nexport default Call;\n","import Node from './node';\nimport Call from './call';\n\nconst Variable = function(name, index, currentFileInfo) {\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n};\n\nVariable.prototype = Object.assign(new Node(), {\n type: 'Variable',\n\n eval(context) {\n let variable, name = this.name;\n\n if (name.indexOf('@@') === 0) {\n name = `@${new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value}`;\n }\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive variable definition for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n variable = this.find(context.frames, function (frame) {\n const v = frame.variable(name);\n if (v) {\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n // If in calc, wrap vars in a function call to cascade evaluate args first\n if (context.inCalc) {\n return (new Call('_SELF', [v.value])).eval(context);\n }\n else {\n return v.value.eval(context);\n }\n }\n });\n if (variable) {\n this.evaluating = false;\n return variable;\n } else {\n throw { type: 'Name',\n message: `variable ${name} is undefined`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n },\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n});\n\nexport default Variable;\n","import Node from './node';\nimport Declaration from './declaration';\n\nconst Property = function(name, index, currentFileInfo) {\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n};\n\nProperty.prototype = Object.assign(new Node(), {\n type: 'Property',\n\n eval(context) {\n let property;\n const name = this.name;\n // TODO: shorten this reference\n const mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive property reference for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n property = this.find(context.frames, function (frame) {\n let v;\n const vArr = frame.property(name);\n if (vArr) {\n for (let i = 0; i < vArr.length; i++) {\n v = vArr[i];\n\n vArr[i] = new Declaration(v.name,\n v.value,\n v.important,\n v.merge,\n v.index,\n v.currentFileInfo,\n v.inline,\n v.variable\n );\n }\n mergeRules(vArr);\n\n v = vArr[vArr.length - 1];\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n v = v.value.eval(context);\n return v;\n }\n });\n if (property) {\n this.evaluating = false;\n return property;\n } else {\n throw { type: 'Name',\n message: `Property '${name}' is undefined`,\n filename: this.currentFileInfo.filename,\n index: this.index };\n }\n },\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n});\n\nexport default Property;\n","import Node from './node';\n\nconst Attribute = function(key, op, value, cif) {\n this.key = key;\n this.op = op;\n this.value = value;\n this.cif = cif;\n}\n\nAttribute.prototype = Object.assign(new Node(), {\n type: 'Attribute',\n\n eval(context) {\n return new Attribute(\n this.key.eval ? this.key.eval(context) : this.key,\n this.op,\n (this.value && this.value.eval) ? this.value.eval(context) : this.value,\n this.cif\n );\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n },\n\n toCSS(context) {\n let value = this.key.toCSS ? this.key.toCSS(context) : this.key;\n\n if (this.op) {\n value += this.op;\n value += (this.value.toCSS ? this.value.toCSS(context) : this.value);\n }\n\n if (this.cif) {\n value = value + ' ' + this.cif;\n }\n\n return `[${value}]`;\n }\n});\n\nexport default Attribute;\n","import Node from './node';\nimport Variable from './variable';\nimport Property from './property';\n\nconst Quoted = function(str, content, escaped, index, currentFileInfo) {\n this.escaped = (escaped === undefined) ? true : escaped;\n this.value = content || '';\n this.quote = str.charAt(0);\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.variableRegex = /@\\{([\\w-]+)\\}/g;\n this.propRegex = /\\$\\{([\\w-]+)\\}/g;\n this.allowRoot = escaped;\n};\n\nQuoted.prototype = Object.assign(new Node(), {\n type: 'Quoted',\n\n genCSS(context, output) {\n if (!this.escaped) {\n output.add(this.quote, this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n if (!this.escaped) {\n output.add(this.quote);\n }\n },\n\n containsVariables() {\n return this.value.match(this.variableRegex);\n },\n\n eval(context) {\n const that = this;\n let value = this.value;\n const variableReplacement = function (_, name) {\n const v = new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n const propertyReplacement = function (_, name) {\n const v = new Property(`$${name}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n function iterativeReplace(value, regexp, replacementFnc) {\n let evaluatedValue = value;\n do {\n value = evaluatedValue.toString();\n evaluatedValue = value.replace(regexp, replacementFnc);\n } while (value !== evaluatedValue);\n return evaluatedValue;\n }\n value = iterativeReplace(value, this.variableRegex, variableReplacement);\n value = iterativeReplace(value, this.propRegex, propertyReplacement);\n return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo());\n },\n\n compare(other) {\n // when comparing quoted strings allow the quote to differ\n if (other.type === 'Quoted' && !this.escaped && !other.escaped) {\n return Node.numericCompare(this.value, other.value);\n } else {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n }\n }\n});\n\nexport default Quoted;\n","import Node from './node';\n\nfunction escapePath(path) {\n return path.replace(/[()'\"\\s]/g, function(match) { return `\\\\${match}`; });\n}\n\nconst URL = function(val, index, currentFileInfo, isEvald) {\n this.value = val;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.isEvald = isEvald;\n};\n\nURL.prototype = Object.assign(new Node(), {\n type: 'Url',\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n },\n\n genCSS(context, output) {\n output.add('url(');\n this.value.genCSS(context, output);\n output.add(')');\n },\n\n eval(context) {\n const val = this.value.eval(context);\n let rootpath;\n\n if (!this.isEvald) {\n // Add the rootpath if the URL requires a rewrite\n rootpath = this.fileInfo() && this.fileInfo().rootpath;\n if (typeof rootpath === 'string' &&\n typeof val.value === 'string' &&\n context.pathRequiresRewrite(val.value)) {\n if (!val.quote) {\n rootpath = escapePath(rootpath);\n }\n val.value = context.rewritePath(val.value, rootpath);\n } else {\n val.value = context.normalizePath(val.value);\n }\n\n // Add url args if enabled\n if (context.urlArgs) {\n if (!val.value.match(/^\\s*data:/)) {\n const delimiter = val.value.indexOf('?') === -1 ? '?' : '&';\n const urlArgs = delimiter + context.urlArgs;\n if (val.value.indexOf('#') !== -1) {\n val.value = val.value.replace('#', `${urlArgs}#`);\n } else {\n val.value += urlArgs;\n }\n }\n }\n }\n\n return new URL(val, this.getIndex(), this.fileInfo(), true);\n }\n});\n\nexport default URL;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport Anonymous from './anonymous';\nimport Expression from './expression';\nimport * as utils from '../utils';\n\nconst NestableAtRulePrototype = {\n\n isRulesetLike() {\n return true;\n },\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n if (this.rules) {\n this.rules = visitor.visitArray(this.rules);\n }\n },\n\n evalTop(context) {\n let result = this;\n\n // Render all dependent Media blocks.\n if (context.mediaBlocks.length > 1) {\n const selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors();\n result = new Ruleset(selectors, context.mediaBlocks);\n result.multiMedia = true;\n result.copyVisibilityInfo(this.visibilityInfo());\n this.setParent(result, this);\n }\n\n delete context.mediaBlocks;\n delete context.mediaPath;\n\n return result;\n },\n\n evalNested(context) {\n let i;\n let value;\n const path = context.mediaPath.concat([this]);\n\n // Extract the media-query conditions separated with `,` (OR).\n for (i = 0; i < path.length; i++) {\n value = path[i].features instanceof Value ?\n path[i].features.value : path[i].features;\n path[i] = Array.isArray(value) ? value : [value];\n }\n\n // Trace all permutations to generate the resulting media-query.\n //\n // (a, b and c) with nested (d, e) ->\n // a and d\n // a and e\n // b and c and d\n // b and c and e\n this.features = new Value(this.permute(path).map(path => {\n path = path.map(fragment => fragment.toCSS ? fragment : new Anonymous(fragment));\n\n for (i = path.length - 1; i > 0; i--) {\n path.splice(i, 0, new Anonymous('and'));\n }\n\n return new Expression(path);\n }));\n this.setParent(this.features, this);\n\n // Fake a tree-node that doesn't output anything.\n return new Ruleset([], []);\n },\n\n permute(arr) {\n if (arr.length === 0) {\n return [];\n } else if (arr.length === 1) {\n return arr[0];\n } else {\n const result = [];\n const rest = this.permute(arr.slice(1));\n for (let i = 0; i < rest.length; i++) {\n for (let j = 0; j < arr[0].length; j++) {\n result.push([arr[0][j]].concat(rest[i]));\n }\n }\n return result;\n }\n },\n\n bubbleSelectors(selectors) {\n if (!selectors) {\n return;\n }\n this.rules = [new Ruleset(utils.copyArray(selectors), [this.rules[0]])];\n this.setParent(this.rules, this);\n }\n};\n\nexport default NestableAtRulePrototype;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport AtRule from './atrule';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst Media = function(value, features, index, currentFileInfo, visibilityInfo) {\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n};\n\nMedia.prototype = Object.assign(new AtRule(), {\n type: 'Media',\n\n ...NestableAtRulePrototype,\n\n genCSS(context, output) {\n output.add('@media ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n },\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n});\n\nexport default Media;\n","import Node from './node';\nimport Media from './media';\nimport URL from './url';\nimport Quoted from './quoted';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\nimport * as utils from '../utils';\nimport LessError from '../less-error';\n\n//\n// CSS @import node\n//\n// The general strategy here is that we don't want to wait\n// for the parsing to be completed, before we start importing\n// the file. That's because in the context of a browser,\n// most of the time will be spent waiting for the server to respond.\n//\n// On creation, we push the import path to our import queue, though\n// `import,push`, we also pass it a callback, which it'll call once\n// the file has been fetched, and parsed.\n//\nconst Import = function(path, features, options, index, currentFileInfo, visibilityInfo) {\n this.options = options;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.path = path;\n this.features = features;\n this.allowRoot = true;\n\n if (this.options.less !== undefined || this.options.inline) {\n this.css = !this.options.less || this.options.inline;\n } else {\n const pathValue = this.getPath();\n if (pathValue && /[#.&?]css([?;].*)?$/.test(pathValue)) {\n this.css = true;\n }\n }\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.features, this);\n this.setParent(this.path, this);\n};\n\nImport.prototype = Object.assign(new Node(), {\n type: 'Import',\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n this.path = visitor.visit(this.path);\n if (!this.options.isPlugin && !this.options.inline && this.root) {\n this.root = visitor.visit(this.root);\n }\n },\n\n genCSS(context, output) {\n if (this.css && this.path._fileInfo.reference === undefined) {\n output.add('@import ', this._fileInfo, this._index);\n this.path.genCSS(context, output);\n if (this.features) {\n output.add(' ');\n this.features.genCSS(context, output);\n }\n output.add(';');\n }\n },\n\n getPath() {\n return (this.path instanceof URL) ?\n this.path.value.value : this.path.value;\n },\n\n isVariableImport() {\n let path = this.path;\n if (path instanceof URL) {\n path = path.value;\n }\n if (path instanceof Quoted) {\n return path.containsVariables();\n }\n\n return true;\n },\n\n evalForImport(context) {\n let path = this.path;\n\n if (path instanceof URL) {\n path = path.value;\n }\n\n return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo());\n },\n\n evalPath(context) {\n const path = this.path.eval(context);\n const fileInfo = this._fileInfo;\n\n if (!(path instanceof URL)) {\n // Add the rootpath if the URL requires a rewrite\n const pathValue = path.value;\n if (fileInfo &&\n pathValue &&\n context.pathRequiresRewrite(pathValue)) {\n path.value = context.rewritePath(pathValue, fileInfo.rootpath);\n } else {\n path.value = context.normalizePath(path.value);\n }\n }\n\n return path;\n },\n\n eval(context) {\n const result = this.doEval(context);\n if (this.options.reference || this.blocksVisibility()) {\n if (result.length || result.length === 0) {\n result.forEach(function (node) {\n node.addVisibilityBlock();\n }\n );\n } else {\n result.addVisibilityBlock();\n }\n }\n return result;\n },\n\n doEval(context) {\n let ruleset;\n let registry;\n const features = this.features && this.features.eval(context);\n\n if (this.options.isPlugin) {\n if (this.root && this.root.eval) {\n try {\n this.root.eval(context);\n }\n catch (e) {\n e.message = 'Plugin error during evaluation';\n throw new LessError(e, this.root.imports, this.root.filename);\n }\n }\n registry = context.frames[0] && context.frames[0].functionRegistry;\n if ( registry && this.root && this.root.functions ) {\n registry.addMultiple( this.root.functions );\n }\n\n return [];\n }\n\n if (this.skip) {\n if (typeof this.skip === 'function') {\n this.skip = this.skip();\n }\n if (this.skip) {\n return [];\n }\n }\n if (this.options.inline) {\n const contents = new Anonymous(this.root, 0,\n {\n filename: this.importedFilename,\n reference: this.path._fileInfo && this.path._fileInfo.reference\n }, true, true);\n\n return this.features ? new Media([contents], this.features.value) : [contents];\n } else if (this.css) {\n const newImport = new Import(this.evalPath(context), features, this.options, this._index);\n if (!newImport.css && this.error) {\n throw this.error;\n }\n return newImport;\n } else if (this.root) {\n ruleset = new Ruleset(null, utils.copyArray(this.root.rules));\n ruleset.evalImports(context);\n\n return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules;\n } else {\n return [];\n }\n }\n});\n\nexport default Import;\n","import Node from './node';\nimport Variable from './variable';\n\nconst JsEvalNode = function() {};\n\nJsEvalNode.prototype = Object.assign(new Node(), {\n evaluateJavaScript(expression, context) {\n let result;\n const that = this;\n const evalContext = {};\n\n if (!context.javascriptEnabled) {\n throw { message: 'Inline JavaScript is not enabled. Is it set in your options?',\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n expression = expression.replace(/@\\{([\\w-]+)\\}/g, function (_, name) {\n return that.jsify(new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context));\n });\n\n try {\n expression = new Function(`return (${expression})`);\n } catch (e) {\n throw { message: `JavaScript evaluation error: ${e.message} from \\`${expression}\\`` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n const variables = context.frames[0].variables();\n for (const k in variables) {\n // eslint-disable-next-line no-prototype-builtins\n if (variables.hasOwnProperty(k)) {\n evalContext[k.slice(1)] = {\n value: variables[k].value,\n toJS: function () {\n return this.value.eval(context).toCSS();\n }\n };\n }\n }\n\n try {\n result = expression.call(evalContext);\n } catch (e) {\n throw { message: `JavaScript evaluation error: '${e.name}: ${e.message.replace(/[\"]/g, '\\'')}'` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n return result;\n },\n\n jsify(obj) {\n if (Array.isArray(obj.value) && (obj.value.length > 1)) {\n return `[${obj.value.map(function (v) { return v.toCSS(); }).join(', ')}]`;\n } else {\n return obj.toCSS();\n }\n }\n});\n\nexport default JsEvalNode;\n","import JsEvalNode from './js-eval-node';\nimport Dimension from './dimension';\nimport Quoted from './quoted';\nimport Anonymous from './anonymous';\n\nconst JavaScript = function(string, escaped, index, currentFileInfo) {\n this.escaped = escaped;\n this.expression = string;\n this._index = index;\n this._fileInfo = currentFileInfo;\n}\n\nJavaScript.prototype = Object.assign(new JsEvalNode(), {\n type: 'JavaScript',\n\n eval(context) {\n const result = this.evaluateJavaScript(this.expression, context);\n const type = typeof result;\n\n if (type === 'number' && !isNaN(result)) {\n return new Dimension(result);\n } else if (type === 'string') {\n return new Quoted(`\"${result}\"`, result, this.escaped, this._index);\n } else if (Array.isArray(result)) {\n return new Anonymous(result.join(', '));\n } else {\n return new Anonymous(result);\n }\n }\n});\n\nexport default JavaScript;\n","import Node from './node';\n\nconst Assignment = function(key, val) {\n this.key = key;\n this.value = val;\n}\n\nAssignment.prototype = Object.assign(new Node(), {\n type: 'Assignment',\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n },\n\n eval(context) {\n if (this.value.eval) {\n return new Assignment(this.key, this.value.eval(context));\n }\n return this;\n },\n\n genCSS(context, output) {\n output.add(`${this.key}=`);\n if (this.value.genCSS) {\n this.value.genCSS(context, output);\n } else {\n output.add(this.value);\n }\n }\n});\n\nexport default Assignment;\n","import Node from './node';\n\nconst Condition = function(op, l, r, i, negate) {\n this.op = op.trim();\n this.lvalue = l;\n this.rvalue = r;\n this._index = i;\n this.negate = negate;\n};\n\nCondition.prototype = Object.assign(new Node(), {\n type: 'Condition',\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.rvalue = visitor.visit(this.rvalue);\n },\n\n eval(context) {\n const result = (function (op, a, b) {\n switch (op) {\n case 'and': return a && b;\n case 'or': return a || b;\n default:\n switch (Node.compare(a, b)) {\n case -1:\n return op === '<' || op === '=<' || op === '<=';\n case 0:\n return op === '=' || op === '>=' || op === '=<' || op === '<=';\n case 1:\n return op === '>' || op === '>=';\n default:\n return false;\n }\n }\n })(this.op, this.lvalue.eval(context), this.rvalue.eval(context));\n\n return this.negate ? !result : result;\n }\n});\n\nexport default Condition;\n","import Node from './node';\n\nconst QueryInParens = function (op, l, m, op2, r, i) {\n this.op = op.trim();\n this.lvalue = l;\n this.mvalue = m;\n this.op2 = op2 ? op2.trim() : null;\n this.rvalue = r;\n this._index = i;\n};\n\nQueryInParens.prototype = Object.assign(new Node(), {\n type: 'QueryInParens',\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.mvalue = visitor.visit(this.mvalue);\n if (this.rvalue) {\n this.rvalue = visitor.visit(this.rvalue);\n }\n },\n\n eval(context) {\n this.lvalue = this.lvalue.eval(context);\n this.mvalue = this.mvalue.eval(context);\n if (this.rvalue) {\n this.rvalue = this.rvalue.eval(context);\n }\n return this;\n },\n\n genCSS(context, output) {\n this.lvalue.genCSS(context, output);\n output.add(' ' + this.op + ' ');\n this.mvalue.genCSS(context, output);\n if (this.rvalue) {\n output.add(' ' + this.op2 + ' ');\n this.rvalue.genCSS(context, output);\n }\n },\n});\n\nexport default QueryInParens;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport AtRule from './atrule';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst Container = function(value, features, index, currentFileInfo, visibilityInfo) {\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n};\n\nContainer.prototype = Object.assign(new AtRule(), {\n type: 'Container',\n\n ...NestableAtRulePrototype,\n\n genCSS(context, output) {\n output.add('@container ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n },\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Container(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n});\n\nexport default Container;\n","import Node from './node';\n\nconst UnicodeDescriptor = function(value) {\n this.value = value;\n}\n\nUnicodeDescriptor.prototype = Object.assign(new Node(), {\n type: 'UnicodeDescriptor'\n})\n\nexport default UnicodeDescriptor;\n","import Node from './node';\nimport Operation from './operation';\nimport Dimension from './dimension';\n\nconst Negative = function(node) {\n this.value = node;\n};\n\nNegative.prototype = Object.assign(new Node(), {\n type: 'Negative',\n\n genCSS(context, output) {\n output.add('-');\n this.value.genCSS(context, output);\n },\n\n eval(context) {\n if (context.isMathOn()) {\n return (new Operation('*', [new Dimension(-1), this.value])).eval(context);\n }\n return new Negative(this.value.eval(context));\n }\n});\n\nexport default Negative;\n","import Node from './node';\nimport Selector from './selector';\n\nconst Extend = function(selector, option, index, currentFileInfo, visibilityInfo) {\n this.selector = selector;\n this.option = option;\n this.object_id = Extend.next_id++;\n this.parent_ids = [this.object_id];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n switch (option) {\n case 'all':\n this.allowBefore = true;\n this.allowAfter = true;\n break;\n default:\n this.allowBefore = false;\n this.allowAfter = false;\n break;\n }\n this.setParent(this.selector, this);\n};\n\nExtend.prototype = Object.assign(new Node(), {\n type: 'Extend',\n\n accept(visitor) {\n this.selector = visitor.visit(this.selector);\n },\n\n eval(context) {\n return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n // remove when Nodes have JSDoc types\n // eslint-disable-next-line no-unused-vars\n clone(context) {\n return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n // it concatenates (joins) all selectors in selector array\n findSelfSelectors(selectors) {\n let selfElements = [], i, selectorElements;\n\n for (i = 0; i < selectors.length; i++) {\n selectorElements = selectors[i].elements;\n // duplicate the logic in genCSS function inside the selector node.\n // future TODO - move both logics into the selector joiner visitor\n if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') {\n selectorElements[0].combinator.value = ' ';\n }\n selfElements = selfElements.concat(selectors[i].elements);\n }\n\n this.selfSelectors = [new Selector(selfElements)];\n this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo());\n }\n});\n\nExtend.next_id = 0;\nexport default Extend;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport DetachedRuleset from './detached-ruleset';\nimport LessError from '../less-error';\n\nconst VariableCall = function(variable, index, currentFileInfo) {\n this.variable = variable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n};\n\nVariableCall.prototype = Object.assign(new Node(), {\n type: 'VariableCall',\n\n eval(context) {\n let rules;\n let detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context);\n const error = new LessError({message: `Could not evaluate variable call ${this.variable}`});\n\n if (!detachedRuleset.ruleset) {\n if (detachedRuleset.rules) {\n rules = detachedRuleset;\n }\n else if (Array.isArray(detachedRuleset)) {\n rules = new Ruleset('', detachedRuleset);\n }\n else if (Array.isArray(detachedRuleset.value)) {\n rules = new Ruleset('', detachedRuleset.value);\n }\n else {\n throw error;\n }\n detachedRuleset = new DetachedRuleset(rules);\n }\n\n if (detachedRuleset.ruleset) {\n return detachedRuleset.callEval(context);\n }\n throw error;\n }\n});\n\nexport default VariableCall;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport Selector from './selector';\n\nconst NamespaceValue = function(ruleCall, lookups, index, fileInfo) {\n this.value = ruleCall;\n this.lookups = lookups;\n this._index = index;\n this._fileInfo = fileInfo;\n};\n\nNamespaceValue.prototype = Object.assign(new Node(), {\n type: 'NamespaceValue',\n\n eval(context) {\n let i, name, rules = this.value.eval(context);\n \n for (i = 0; i < this.lookups.length; i++) {\n name = this.lookups[i];\n\n /**\n * Eval'd DRs return rulesets.\n * Eval'd mixins return rules, so let's make a ruleset if we need it.\n * We need to do this because of late parsing of values\n */\n if (Array.isArray(rules)) {\n rules = new Ruleset([new Selector()], rules);\n }\n\n if (name === '') {\n rules = rules.lastDeclaration();\n }\n else if (name.charAt(0) === '@') {\n if (name.charAt(1) === '@') {\n name = `@${new Variable(name.substr(1)).eval(context).value}`;\n }\n if (rules.variables) {\n rules = rules.variable(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `variable ${name} not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n }\n else {\n if (name.substring(0, 2) === '$@') {\n name = `$${new Variable(name.substr(1)).eval(context).value}`;\n }\n else {\n name = name.charAt(0) === '$' ? name : `$${name}`;\n }\n if (rules.properties) {\n rules = rules.property(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `property \"${name.substr(1)}\" not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n // Properties are an array of values, since a ruleset can have multiple props.\n // We pick the last one (the \"cascaded\" value)\n rules = rules[rules.length - 1];\n }\n\n if (rules.value) {\n rules = rules.eval(context).value;\n }\n if (rules.ruleset) {\n rules = rules.ruleset.eval(context);\n }\n }\n return rules;\n }\n});\n\nexport default NamespaceValue;\n","import Selector from './selector';\nimport Element from './element';\nimport Ruleset from './ruleset';\nimport Declaration from './declaration';\nimport DetachedRuleset from './detached-ruleset';\nimport Expression from './expression';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nconst Definition = function(name, params, rules, condition, variadic, frames, visibilityInfo) {\n this.name = name || 'anonymous mixin';\n this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])];\n this.params = params;\n this.condition = condition;\n this.variadic = variadic;\n this.arity = params.length;\n this.rules = rules;\n this._lookups = {};\n const optionalParameters = [];\n this.required = params.reduce(function (count, p) {\n if (!p.name || (p.name && !p.value)) {\n return count + 1;\n }\n else {\n optionalParameters.push(p.name);\n return count;\n }\n }, 0);\n this.optionalParameters = optionalParameters;\n this.frames = frames;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n}\n\nDefinition.prototype = Object.assign(new Ruleset(), {\n type: 'MixinDefinition',\n evalFirst: true,\n\n accept(visitor) {\n if (this.params && this.params.length) {\n this.params = visitor.visitArray(this.params);\n }\n this.rules = visitor.visitArray(this.rules);\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n },\n\n evalParams(context, mixinEnv, args, evaldArguments) {\n /* jshint boss:true */\n const frame = new Ruleset(null, null);\n\n let varargs;\n let arg;\n const params = utils.copyArray(this.params);\n let i;\n let j;\n let val;\n let name;\n let isNamedFound;\n let argIndex;\n let argsLength = 0;\n\n if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) {\n frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit();\n }\n mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames));\n\n if (args) {\n args = utils.copyArray(args);\n argsLength = args.length;\n\n for (i = 0; i < argsLength; i++) {\n arg = args[i];\n if (name = (arg && arg.name)) {\n isNamedFound = false;\n for (j = 0; j < params.length; j++) {\n if (!evaldArguments[j] && name === params[j].name) {\n evaldArguments[j] = arg.value.eval(context);\n frame.prependRule(new Declaration(name, arg.value.eval(context)));\n isNamedFound = true;\n break;\n }\n }\n if (isNamedFound) {\n args.splice(i, 1);\n i--;\n continue;\n } else {\n throw { type: 'Runtime', message: `Named argument for ${this.name} ${args[i].name} not found` };\n }\n }\n }\n }\n argIndex = 0;\n for (i = 0; i < params.length; i++) {\n if (evaldArguments[i]) { continue; }\n\n arg = args && args[argIndex];\n\n if (name = params[i].name) {\n if (params[i].variadic) {\n varargs = [];\n for (j = argIndex; j < argsLength; j++) {\n varargs.push(args[j].value.eval(context));\n }\n frame.prependRule(new Declaration(name, new Expression(varargs).eval(context)));\n } else {\n val = arg && arg.value;\n if (val) {\n // This was a mixin call, pass in a detached ruleset of it's eval'd rules\n if (Array.isArray(val)) {\n val = new DetachedRuleset(new Ruleset('', val));\n }\n else {\n val = val.eval(context);\n }\n } else if (params[i].value) {\n val = params[i].value.eval(mixinEnv);\n frame.resetCache();\n } else {\n throw { type: 'Runtime', message: `wrong number of arguments for ${this.name} (${argsLength} for ${this.arity})` };\n }\n\n frame.prependRule(new Declaration(name, val));\n evaldArguments[i] = val;\n }\n }\n\n if (params[i].variadic && args) {\n for (j = argIndex; j < argsLength; j++) {\n evaldArguments[j] = args[j].value.eval(context);\n }\n }\n argIndex++;\n }\n\n return frame;\n },\n\n makeImportant() {\n const rules = !this.rules ? this.rules : this.rules.map(function (r) {\n if (r.makeImportant) {\n return r.makeImportant(true);\n } else {\n return r;\n }\n });\n const result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames);\n return result;\n },\n\n eval(context) {\n return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || utils.copyArray(context.frames));\n },\n\n evalCall(context, args, important) {\n const _arguments = [];\n const mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames;\n const frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments);\n let rules;\n let ruleset;\n\n frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context)));\n\n rules = utils.copyArray(this.rules);\n\n ruleset = new Ruleset(null, rules);\n ruleset.originalRuleset = this;\n ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames)));\n if (important) {\n ruleset = ruleset.makeImportant();\n }\n return ruleset;\n },\n\n matchCondition(args, context) {\n if (this.condition && !this.condition.eval(\n new contexts.Eval(context,\n [this.evalParams(context, /* the parameter variables */\n new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])]\n .concat(this.frames || []) // the parent namespace/mixin frames\n .concat(context.frames)))) { // the current environment frames\n return false;\n }\n return true;\n },\n\n matchArgs(args, context) {\n const allArgsCnt = (args && args.length) || 0;\n let len;\n const optionalParameters = this.optionalParameters;\n const requiredArgsCnt = !args ? 0 : args.reduce(function (count, p) {\n if (optionalParameters.indexOf(p.name) < 0) {\n return count + 1;\n } else {\n return count;\n }\n }, 0);\n\n if (!this.variadic) {\n if (requiredArgsCnt < this.required) {\n return false;\n }\n if (allArgsCnt > this.params.length) {\n return false;\n }\n } else {\n if (requiredArgsCnt < (this.required - 1)) {\n return false;\n }\n }\n\n // check patterns\n len = Math.min(requiredArgsCnt, this.arity);\n\n for (let i = 0; i < len; i++) {\n if (!this.params[i].name && !this.params[i].variadic) {\n if (args[i].value.eval(context).toCSS() != this.params[i].value.eval(context).toCSS()) {\n return false;\n }\n }\n }\n return true;\n }\n});\n\nexport default Definition;\n","import Node from './node';\nimport Selector from './selector';\nimport MixinDefinition from './mixin-definition';\nimport defaultFunc from '../functions/default';\n\nconst MixinCall = function(elements, args, index, currentFileInfo, important) {\n this.selector = new Selector(elements);\n this.arguments = args || [];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.important = important;\n this.allowRoot = true;\n this.setParent(this.selector, this);\n};\n\nMixinCall.prototype = Object.assign(new Node(), {\n type: 'MixinCall',\n\n accept(visitor) {\n if (this.selector) {\n this.selector = visitor.visit(this.selector);\n }\n if (this.arguments.length) {\n this.arguments = visitor.visitArray(this.arguments);\n }\n },\n\n eval(context) {\n let mixins;\n let mixin;\n let mixinPath;\n const args = [];\n let arg;\n let argValue;\n const rules = [];\n let match = false;\n let i;\n let m;\n let f;\n let isRecursive;\n let isOneFound;\n const candidates = [];\n let candidate;\n const conditionResult = [];\n let defaultResult;\n const defFalseEitherCase = -1;\n const defNone = 0;\n const defTrue = 1;\n const defFalse = 2;\n let count;\n let originalRuleset;\n let noArgumentsFilter;\n\n this.selector = this.selector.eval(context);\n\n function calcDefGroup(mixin, mixinPath) {\n let f, p, namespace;\n\n for (f = 0; f < 2; f++) {\n conditionResult[f] = true;\n defaultFunc.value(f);\n for (p = 0; p < mixinPath.length && conditionResult[f]; p++) {\n namespace = mixinPath[p];\n if (namespace.matchCondition) {\n conditionResult[f] = conditionResult[f] && namespace.matchCondition(null, context);\n }\n }\n if (mixin.matchCondition) {\n conditionResult[f] = conditionResult[f] && mixin.matchCondition(args, context);\n }\n }\n if (conditionResult[0] || conditionResult[1]) {\n if (conditionResult[0] != conditionResult[1]) {\n return conditionResult[1] ?\n defTrue : defFalse;\n }\n\n return defNone;\n }\n return defFalseEitherCase;\n }\n\n for (i = 0; i < this.arguments.length; i++) {\n arg = this.arguments[i];\n argValue = arg.value.eval(context);\n if (arg.expand && Array.isArray(argValue.value)) {\n argValue = argValue.value;\n for (m = 0; m < argValue.length; m++) {\n args.push({value: argValue[m]});\n }\n } else {\n args.push({name: arg.name, value: argValue});\n }\n }\n\n noArgumentsFilter = function(rule) {return rule.matchArgs(null, context);};\n\n for (i = 0; i < context.frames.length; i++) {\n if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) {\n isOneFound = true;\n\n // To make `default()` function independent of definition order we have two \"subpasses\" here.\n // At first we evaluate each guard *twice* (with `default() == true` and `default() == false`),\n // and build candidate list with corresponding flags. Then, when we know all possible matches,\n // we make a final decision.\n\n for (m = 0; m < mixins.length; m++) {\n mixin = mixins[m].rule;\n mixinPath = mixins[m].path;\n isRecursive = false;\n for (f = 0; f < context.frames.length; f++) {\n if ((!(mixin instanceof MixinDefinition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) {\n isRecursive = true;\n break;\n }\n }\n if (isRecursive) {\n continue;\n }\n\n if (mixin.matchArgs(args, context)) {\n candidate = {mixin, group: calcDefGroup(mixin, mixinPath)};\n\n if (candidate.group !== defFalseEitherCase) {\n candidates.push(candidate);\n }\n\n match = true;\n }\n }\n\n defaultFunc.reset();\n\n count = [0, 0, 0];\n for (m = 0; m < candidates.length; m++) {\n count[candidates[m].group]++;\n }\n\n if (count[defNone] > 0) {\n defaultResult = defFalse;\n } else {\n defaultResult = defTrue;\n if ((count[defTrue] + count[defFalse]) > 1) {\n throw { type: 'Runtime',\n message: `Ambiguous use of \\`default()\\` found when matching for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n }\n\n for (m = 0; m < candidates.length; m++) {\n candidate = candidates[m].group;\n if ((candidate === defNone) || (candidate === defaultResult)) {\n try {\n mixin = candidates[m].mixin;\n if (!(mixin instanceof MixinDefinition)) {\n originalRuleset = mixin.originalRuleset || mixin;\n mixin = new MixinDefinition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo());\n mixin.originalRuleset = originalRuleset;\n }\n const newRules = mixin.evalCall(context, args, this.important).rules;\n this._setVisibilityToReplacement(newRules);\n Array.prototype.push.apply(rules, newRules);\n } catch (e) {\n throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack };\n }\n }\n }\n\n if (match) {\n return rules;\n }\n }\n }\n if (isOneFound) {\n throw { type: 'Runtime',\n message: `No matching definition was found for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n } else {\n throw { type: 'Name',\n message: `${this.selector.toCSS().trim()} is undefined`,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n },\n\n _setVisibilityToReplacement(replacement) {\n let i, rule;\n if (this.blocksVisibility()) {\n for (i = 0; i < replacement.length; i++) {\n rule = replacement[i];\n rule.addVisibilityBlock();\n }\n }\n },\n\n format(args) {\n return `${this.selector.toCSS().trim()}(${args ? args.map(function (a) {\n let argValue = '';\n if (a.name) {\n argValue += `${a.name}:`;\n }\n if (a.value.toCSS) {\n argValue += a.value.toCSS();\n } else {\n argValue += '???';\n }\n return argValue;\n }).join(', ') : ''})`;\n }\n});\n\nexport default MixinCall;\n","import Node from './node';\nimport Color from './color';\nimport AtRule from './atrule';\nimport DetachedRuleset from './detached-ruleset';\nimport Operation from './operation';\nimport Dimension from './dimension';\nimport Unit from './unit';\nimport Keyword from './keyword';\nimport Variable from './variable';\nimport Property from './property';\nimport Ruleset from './ruleset';\nimport Element from './element';\nimport Attribute from './attribute';\nimport Combinator from './combinator';\nimport Selector from './selector';\nimport Quoted from './quoted';\nimport Expression from './expression';\nimport Declaration from './declaration';\nimport Call from './call';\nimport URL from './url';\nimport Import from './import';\nimport Comment from './comment';\nimport Anonymous from './anonymous';\nimport Value from './value';\nimport JavaScript from './javascript';\nimport Assignment from './assignment';\nimport Condition from './condition';\nimport QueryInParens from './query-in-parens';\nimport Paren from './paren';\nimport Media from './media';\nimport Container from './container';\nimport UnicodeDescriptor from './unicode-descriptor';\nimport Negative from './negative';\nimport Extend from './extend';\nimport VariableCall from './variable-call';\nimport NamespaceValue from './namespace-value';\n\n// mixins\nimport MixinCall from './mixin-call';\nimport MixinDefinition from './mixin-definition';\n\nexport default {\n Node, Color, AtRule, DetachedRuleset, Operation,\n Dimension, Unit, Keyword, Variable, Property,\n Ruleset, Element, Attribute, Combinator, Selector,\n Quoted, Expression, Declaration, Call, URL, Import,\n Comment, Anonymous, Value, JavaScript, Assignment,\n Condition, Paren, Media, Container, QueryInParens, \n UnicodeDescriptor, Negative, Extend, VariableCall, \n NamespaceValue,\n mixin: {\n Call: MixinCall,\n Definition: MixinDefinition\n }\n};","class AbstractFileManager {\n getPath(filename) {\n let j = filename.lastIndexOf('?');\n if (j > 0) {\n filename = filename.slice(0, j);\n }\n j = filename.lastIndexOf('/');\n if (j < 0) {\n j = filename.lastIndexOf('\\\\');\n }\n if (j < 0) {\n return '';\n }\n return filename.slice(0, j + 1);\n }\n\n tryAppendExtension(path, ext) {\n return /(\\.[a-z]*$)|([?;].*)$/.test(path) ? path : path + ext;\n }\n\n tryAppendLessExtension(path) {\n return this.tryAppendExtension(path, '.less');\n }\n\n supportsSync() {\n return false;\n }\n\n alwaysMakePathsAbsolute() {\n return false;\n }\n\n isPathAbsolute(filename) {\n return (/^(?:[a-z-]+:|\\/|\\\\|#)/i).test(filename);\n }\n\n // TODO: pull out / replace?\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return basePath + laterPath;\n }\n\n pathDiff(url, baseUrl) {\n // diff between two paths to create a relative path\n\n const urlParts = this.extractUrlParts(url);\n\n const baseUrlParts = this.extractUrlParts(baseUrl);\n let i;\n let max;\n let urlDirectories;\n let baseUrlDirectories;\n let diff = '';\n if (urlParts.hostPart !== baseUrlParts.hostPart) {\n return '';\n }\n max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);\n for (i = 0; i < max; i++) {\n if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; }\n }\n baseUrlDirectories = baseUrlParts.directories.slice(i);\n urlDirectories = urlParts.directories.slice(i);\n for (i = 0; i < baseUrlDirectories.length - 1; i++) {\n diff += '../';\n }\n for (i = 0; i < urlDirectories.length - 1; i++) {\n diff += `${urlDirectories[i]}/`;\n }\n return diff;\n }\n\n /**\n * Helper function, not part of API.\n * This should be replaceable by newer Node / Browser APIs\n * \n * @param {string} url \n * @param {string} baseUrl\n */\n extractUrlParts(url, baseUrl) {\n // urlParts[1] = protocol://hostname/ OR /\n // urlParts[2] = / if path relative to host base\n // urlParts[3] = directories\n // urlParts[4] = filename\n // urlParts[5] = parameters\n\n const urlPartsRegex = /^((?:[a-z-]+:)?\\/{2}(?:[^/?#]*\\/)|([/\\\\]))?((?:[^/\\\\?#]*[/\\\\])*)([^/\\\\?#]*)([#?].*)?$/i;\n\n const urlParts = url.match(urlPartsRegex);\n const returner = {};\n let rawDirectories = [];\n const directories = [];\n let i;\n let baseUrlParts;\n\n if (!urlParts) {\n throw new Error(`Could not parse sheet href - '${url}'`);\n }\n\n // Stylesheets in IE don't always return the full path\n if (baseUrl && (!urlParts[1] || urlParts[2])) {\n baseUrlParts = baseUrl.match(urlPartsRegex);\n if (!baseUrlParts) {\n throw new Error(`Could not parse page url - '${baseUrl}'`);\n }\n urlParts[1] = urlParts[1] || baseUrlParts[1] || '';\n if (!urlParts[2]) {\n urlParts[3] = baseUrlParts[3] + urlParts[3];\n }\n }\n\n if (urlParts[3]) {\n rawDirectories = urlParts[3].replace(/\\\\/g, '/').split('/');\n\n // collapse '..' and skip '.'\n for (i = 0; i < rawDirectories.length; i++) {\n\n if (rawDirectories[i] === '..') {\n directories.pop();\n }\n else if (rawDirectories[i] !== '.') {\n directories.push(rawDirectories[i]);\n }\n \n }\n }\n\n returner.hostPart = urlParts[1];\n returner.directories = directories;\n returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/');\n returner.path = (urlParts[1] || '') + directories.join('/');\n returner.filename = urlParts[4];\n returner.fileUrl = returner.path + (urlParts[4] || '');\n returner.url = returner.fileUrl + (urlParts[5] || '');\n return returner;\n }\n}\n\nexport default AbstractFileManager;\n","import functionRegistry from '../functions/function-registry';\nimport LessError from '../less-error';\n\nclass AbstractPluginLoader {\n constructor() {\n // Implemented by Node.js plugin loader\n this.require = function() {\n return null;\n }\n }\n\n evalPlugin(contents, context, imports, pluginOptions, fileInfo) {\n\n let loader, registry, pluginObj, localModule, pluginManager, filename, result;\n\n pluginManager = context.pluginManager;\n\n if (fileInfo) {\n if (typeof fileInfo === 'string') {\n filename = fileInfo;\n }\n else {\n filename = fileInfo.filename;\n }\n }\n const shortname = (new this.less.FileManager()).extractUrlParts(filename).filename;\n\n if (filename) {\n pluginObj = pluginManager.get(filename);\n\n if (pluginObj) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n return pluginObj;\n }\n }\n localModule = {\n exports: {},\n pluginManager,\n fileInfo\n };\n registry = functionRegistry.create();\n\n const registerPlugin = function(obj) {\n pluginObj = obj;\n };\n\n try {\n loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents);\n loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo);\n }\n catch (e) {\n return new LessError(e, imports, filename);\n }\n\n if (!pluginObj) {\n pluginObj = localModule.exports;\n }\n pluginObj = this.validatePlugin(pluginObj, filename, shortname);\n\n if (pluginObj instanceof LessError) {\n return pluginObj;\n }\n\n if (pluginObj) {\n pluginObj.imports = imports;\n pluginObj.filename = filename;\n\n // For < 3.x (or unspecified minVersion) - setOptions() before install()\n if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n\n if (result) {\n return result;\n }\n }\n\n // Run on first load\n pluginManager.addPlugin(pluginObj, fileInfo.filename, registry);\n pluginObj.functions = registry.getLocalFunctions();\n\n // Need to call setOptions again because the pluginObj might have functions\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n\n // Run every @plugin call\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n\n }\n else {\n return new LessError({ message: 'Not a valid plugin' }, imports, filename);\n }\n\n return pluginObj;\n\n }\n\n trySetOptions(plugin, filename, name, options) {\n if (options && !plugin.setOptions) {\n return new LessError({\n message: `Options have been provided but the plugin ${name} does not support any options.`\n });\n }\n try {\n plugin.setOptions && plugin.setOptions(options);\n }\n catch (e) {\n return new LessError(e);\n }\n }\n\n validatePlugin(plugin, filename, name) {\n if (plugin) {\n // support plugins being a function\n // so that the plugin can be more usable programmatically\n if (typeof plugin === 'function') {\n plugin = new plugin();\n }\n\n if (plugin.minVersion) {\n if (this.compareVersion(plugin.minVersion, this.less.version) < 0) {\n return new LessError({\n message: `Plugin ${name} requires version ${this.versionToString(plugin.minVersion)}`\n });\n }\n }\n return plugin;\n }\n return null;\n }\n\n compareVersion(aVersion, bVersion) {\n if (typeof aVersion === 'string') {\n aVersion = aVersion.match(/^(\\d+)\\.?(\\d+)?\\.?(\\d+)?/);\n aVersion.shift();\n }\n for (let i = 0; i < aVersion.length; i++) {\n if (aVersion[i] !== bVersion[i]) {\n return parseInt(aVersion[i]) > parseInt(bVersion[i]) ? -1 : 1;\n }\n }\n return 0;\n }\n\n versionToString(version) {\n let versionString = '';\n for (let i = 0; i < version.length; i++) {\n versionString += (versionString ? '.' : '') + version[i];\n }\n return versionString;\n }\n\n printUsage(plugins) {\n for (let i = 0; i < plugins.length; i++) {\n const plugin = plugins[i];\n if (plugin.printUsage) {\n plugin.printUsage();\n }\n }\n }\n}\n\nexport default AbstractPluginLoader;\n\n","import Anonymous from '../tree/anonymous';\nimport Keyword from '../tree/keyword';\n\nfunction boolean(condition) {\n return condition ? Keyword.True : Keyword.False;\n}\n\n/**\n * Functions with evalArgs set to false are sent context\n * as the first argument.\n */\nfunction If(context, condition, trueValue, falseValue) {\n return condition.eval(context) ? trueValue.eval(context)\n : (falseValue ? falseValue.eval(context) : new Anonymous);\n}\nIf.evalArgs = false;\n\nfunction isdefined(context, variable) {\n try {\n variable.eval(context);\n return Keyword.True;\n } catch (e) {\n return Keyword.False;\n }\n}\n\nisdefined.evalArgs = false;\n\nexport default { isdefined, boolean, 'if': If };\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport Expression from '../tree/expression';\nimport Operation from '../tree/operation';\nlet colorFunctions;\n\nfunction clamp(val) {\n return Math.min(1, Math.max(0, val));\n}\nfunction hsla(origColor, hsl) {\n const color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a);\n if (color) {\n if (origColor.value && \n /^(rgb|hsl)/.test(origColor.value)) {\n color.value = origColor.value;\n } else {\n color.value = 'rgb';\n }\n return color;\n }\n}\nfunction toHSL(color) {\n if (color.toHSL) {\n return color.toHSL();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction toHSV(color) {\n if (color.toHSV) {\n return color.toHSV();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction number(n) {\n if (n instanceof Dimension) {\n return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);\n } else if (typeof n === 'number') {\n return n;\n } else {\n throw {\n type: 'Argument',\n message: 'color functions take numbers as parameters'\n };\n }\n}\nfunction scaled(n, size) {\n if (n instanceof Dimension && n.unit.is('%')) {\n return parseFloat(n.value * size / 100);\n } else {\n return number(n);\n }\n}\ncolorFunctions = {\n rgb: function (r, g, b) {\n let a = 1\n /**\n * Comma-less syntax\n * e.g. rgb(0 128 255 / 50%)\n */\n if (r instanceof Expression) {\n const val = r.value\n r = val[0]\n g = val[1]\n b = val[2]\n /** \n * @todo - should this be normalized in\n * function caller? Or parsed differently?\n */\n if (b instanceof Operation) {\n const op = b\n b = op.operands[0]\n a = op.operands[1]\n }\n }\n const color = colorFunctions.rgba(r, g, b, a);\n if (color) {\n color.value = 'rgb';\n return color;\n }\n },\n rgba: function (r, g, b, a) {\n try {\n if (r instanceof Color) {\n if (g) {\n a = number(g);\n } else {\n a = r.alpha;\n }\n return new Color(r.rgb, a, 'rgba');\n }\n const rgb = [r, g, b].map(c => scaled(c, 255));\n a = number(a);\n return new Color(rgb, a, 'rgba');\n }\n catch (e) {}\n },\n hsl: function (h, s, l) {\n let a = 1\n if (h instanceof Expression) {\n const val = h.value\n h = val[0]\n s = val[1]\n l = val[2]\n\n if (l instanceof Operation) {\n const op = l\n l = op.operands[0]\n a = op.operands[1]\n }\n }\n const color = colorFunctions.hsla(h, s, l, a);\n if (color) {\n color.value = 'hsl';\n return color;\n }\n },\n hsla: function (h, s, l, a) {\n let m1;\n let m2;\n\n function hue(h) {\n h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n else if (h * 2 < 1) {\n return m2;\n }\n else if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n else {\n return m1;\n }\n }\n\n try {\n if (h instanceof Color) {\n if (s) {\n a = number(s);\n } else {\n a = h.alpha;\n }\n return new Color(h.rgb, a, 'hsla');\n }\n\n h = (number(h) % 360) / 360;\n s = clamp(number(s));l = clamp(number(l));a = clamp(number(a));\n\n m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n m1 = l * 2 - m2;\n\n const rgb = [\n hue(h + 1 / 3) * 255,\n hue(h) * 255,\n hue(h - 1 / 3) * 255\n ];\n a = number(a);\n return new Color(rgb, a, 'hsla');\n }\n catch (e) {}\n },\n\n hsv: function(h, s, v) {\n return colorFunctions.hsva(h, s, v, 1.0);\n },\n\n hsva: function(h, s, v, a) {\n h = ((number(h) % 360) / 360) * 360;\n s = number(s);v = number(v);a = number(a);\n\n let i;\n let f;\n i = Math.floor((h / 60) % 6);\n f = (h / 60) - i;\n\n const vs = [v,\n v * (1 - s),\n v * (1 - f * s),\n v * (1 - (1 - f) * s)];\n const perm = [[0, 3, 1],\n [2, 0, 1],\n [1, 0, 3],\n [1, 2, 0],\n [3, 1, 0],\n [0, 1, 2]];\n\n return colorFunctions.rgba(vs[perm[i][0]] * 255,\n vs[perm[i][1]] * 255,\n vs[perm[i][2]] * 255,\n a);\n },\n\n hue: function (color) {\n return new Dimension(toHSL(color).h);\n },\n saturation: function (color) {\n return new Dimension(toHSL(color).s * 100, '%');\n },\n lightness: function (color) {\n return new Dimension(toHSL(color).l * 100, '%');\n },\n hsvhue: function(color) {\n return new Dimension(toHSV(color).h);\n },\n hsvsaturation: function (color) {\n return new Dimension(toHSV(color).s * 100, '%');\n },\n hsvvalue: function (color) {\n return new Dimension(toHSV(color).v * 100, '%');\n },\n red: function (color) {\n return new Dimension(color.rgb[0]);\n },\n green: function (color) {\n return new Dimension(color.rgb[1]);\n },\n blue: function (color) {\n return new Dimension(color.rgb[2]);\n },\n alpha: function (color) {\n return new Dimension(toHSL(color).a);\n },\n luma: function (color) {\n return new Dimension(color.luma() * color.alpha * 100, '%');\n },\n luminance: function (color) {\n const luminance =\n (0.2126 * color.rgb[0] / 255) +\n (0.7152 * color.rgb[1] / 255) +\n (0.0722 * color.rgb[2] / 255);\n\n return new Dimension(luminance * color.alpha * 100, '%');\n },\n saturate: function (color, amount, method) {\n // filter: saturate(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s += hsl.s * amount.value / 100;\n }\n else {\n hsl.s += amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n desaturate: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s -= hsl.s * amount.value / 100;\n }\n else {\n hsl.s -= amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n lighten: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l += hsl.l * amount.value / 100;\n }\n else {\n hsl.l += amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n darken: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l -= hsl.l * amount.value / 100;\n }\n else {\n hsl.l -= amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n fadein: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a += hsl.a * amount.value / 100;\n }\n else {\n hsl.a += amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fadeout: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a -= hsl.a * amount.value / 100;\n }\n else {\n hsl.a -= amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fade: function (color, amount) {\n const hsl = toHSL(color);\n\n hsl.a = amount.value / 100;\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n spin: function (color, amount) {\n const hsl = toHSL(color);\n const hue = (hsl.h + amount.value) % 360;\n\n hsl.h = hue < 0 ? 360 + hue : hue;\n\n return hsla(color, hsl);\n },\n //\n // Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein\n // http://sass-lang.com\n //\n mix: function (color1, color2, weight) {\n if (!weight) {\n weight = new Dimension(50);\n }\n const p = weight.value / 100.0;\n const w = p * 2 - 1;\n const a = toHSL(color1).a - toHSL(color2).a;\n\n const w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n const w2 = 1 - w1;\n\n const rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,\n color1.rgb[1] * w1 + color2.rgb[1] * w2,\n color1.rgb[2] * w1 + color2.rgb[2] * w2];\n\n const alpha = color1.alpha * p + color2.alpha * (1 - p);\n\n return new Color(rgb, alpha);\n },\n greyscale: function (color) {\n return colorFunctions.desaturate(color, new Dimension(100));\n },\n contrast: function (color, dark, light, threshold) {\n // filter: contrast(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n if (typeof light === 'undefined') {\n light = colorFunctions.rgba(255, 255, 255, 1.0);\n }\n if (typeof dark === 'undefined') {\n dark = colorFunctions.rgba(0, 0, 0, 1.0);\n }\n // Figure out which is actually light and dark:\n if (dark.luma() > light.luma()) {\n const t = light;\n light = dark;\n dark = t;\n }\n if (typeof threshold === 'undefined') {\n threshold = 0.43;\n } else {\n threshold = number(threshold);\n }\n if (color.luma() < threshold) {\n return light;\n } else {\n return dark;\n }\n },\n // Changes made in 2.7.0 - Reverted in 3.0.0\n // contrast: function (color, color1, color2, threshold) {\n // // Return which of `color1` and `color2` has the greatest contrast with `color`\n // // according to the standard WCAG contrast ratio calculation.\n // // http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n // // The threshold param is no longer used, in line with SASS.\n // // filter: contrast(3.2);\n // // should be kept as is, so check for color\n // if (!color.rgb) {\n // return null;\n // }\n // if (typeof color1 === 'undefined') {\n // color1 = colorFunctions.rgba(0, 0, 0, 1.0);\n // }\n // if (typeof color2 === 'undefined') {\n // color2 = colorFunctions.rgba(255, 255, 255, 1.0);\n // }\n // var contrast1, contrast2;\n // var luma = color.luma();\n // var luma1 = color1.luma();\n // var luma2 = color2.luma();\n // // Calculate contrast ratios for each color\n // if (luma > luma1) {\n // contrast1 = (luma + 0.05) / (luma1 + 0.05);\n // } else {\n // contrast1 = (luma1 + 0.05) / (luma + 0.05);\n // }\n // if (luma > luma2) {\n // contrast2 = (luma + 0.05) / (luma2 + 0.05);\n // } else {\n // contrast2 = (luma2 + 0.05) / (luma + 0.05);\n // }\n // if (contrast1 > contrast2) {\n // return color1;\n // } else {\n // return color2;\n // }\n // },\n argb: function (color) {\n return new Anonymous(color.toARGB());\n },\n color: function(c) {\n if ((c instanceof Quoted) &&\n (/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) {\n const val = c.value.slice(1);\n return new Color(val, undefined, `#${val}`);\n }\n if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) {\n c.value = undefined;\n return c;\n }\n throw {\n type: 'Argument',\n message: 'argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF'\n };\n },\n tint: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount);\n },\n shade: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount);\n }\n};\n\nexport default colorFunctions;\n","import Color from '../tree/color';\n\n// Color Blending\n// ref: http://www.w3.org/TR/compositing-1\n\nfunction colorBlend(mode, color1, color2) {\n const ab = color1.alpha; // result\n\n let // backdrop\n cb;\n\n const as = color2.alpha;\n\n let // source\n cs;\n\n let ar;\n let cr;\n const r = [];\n\n ar = as + ab * (1 - as);\n for (let i = 0; i < 3; i++) {\n cb = color1.rgb[i] / 255;\n cs = color2.rgb[i] / 255;\n cr = mode(cb, cs);\n if (ar) {\n cr = (as * cs + ab * (cb -\n as * (cb + cs - cr))) / ar;\n }\n r[i] = cr * 255;\n }\n\n return new Color(r, ar);\n}\n\nconst colorBlendModeFunctions = {\n multiply: function(cb, cs) {\n return cb * cs;\n },\n screen: function(cb, cs) {\n return cb + cs - cb * cs;\n },\n overlay: function(cb, cs) {\n cb *= 2;\n return (cb <= 1) ?\n colorBlendModeFunctions.multiply(cb, cs) :\n colorBlendModeFunctions.screen(cb - 1, cs);\n },\n softlight: function(cb, cs) {\n let d = 1;\n let e = cb;\n if (cs > 0.5) {\n e = 1;\n d = (cb > 0.25) ? Math.sqrt(cb)\n : ((16 * cb - 12) * cb + 4) * cb;\n }\n return cb - (1 - 2 * cs) * e * (d - cb);\n },\n hardlight: function(cb, cs) {\n return colorBlendModeFunctions.overlay(cs, cb);\n },\n difference: function(cb, cs) {\n return Math.abs(cb - cs);\n },\n exclusion: function(cb, cs) {\n return cb + cs - 2 * cb * cs;\n },\n\n // non-w3c functions:\n average: function(cb, cs) {\n return (cb + cs) / 2;\n },\n negation: function(cb, cs) {\n return 1 - Math.abs(cb + cs - 1);\n }\n};\n\nfor (const f in colorBlendModeFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (colorBlendModeFunctions.hasOwnProperty(f)) {\n colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]);\n }\n}\n\nexport default colorBlend;\n","import Comment from '../tree/comment';\nimport Node from '../tree/node';\nimport Dimension from '../tree/dimension';\nimport Declaration from '../tree/declaration';\nimport Expression from '../tree/expression';\nimport Ruleset from '../tree/ruleset';\nimport Selector from '../tree/selector';\nimport Element from '../tree/element';\nimport Quote from '../tree/quoted';\nimport Value from '../tree/value';\n\nconst getItemsFromNode = node => {\n // handle non-array values as an array of length 1\n // return 'undefined' if index is invalid\n const items = Array.isArray(node.value) ?\n node.value : Array(node);\n\n return items;\n};\n\nexport default {\n _SELF: function(n) {\n return n;\n },\n '~': function(...expr) {\n if (expr.length === 1) {\n return expr[0];\n }\n return new Value(expr);\n },\n extract: function(values, index) {\n // (1-based index)\n index = index.value - 1;\n\n return getItemsFromNode(values)[index];\n },\n length: function(values) {\n return new Dimension(getItemsFromNode(values).length);\n },\n /**\n * Creates a Less list of incremental values.\n * Modeled after Lodash's range function, also exists natively in PHP\n * \n * @param {Dimension} [start=1]\n * @param {Dimension} end - e.g. 10 or 10px - unit is added to output\n * @param {Dimension} [step=1] \n */\n range: function(start, end, step) {\n let from;\n let to;\n let stepValue = 1;\n const list = [];\n if (end) {\n to = end;\n from = start.value;\n if (step) {\n stepValue = step.value;\n }\n }\n else {\n from = 1;\n to = start;\n }\n\n for (let i = from; i <= to.value; i += stepValue) {\n list.push(new Dimension(i, to.unit));\n }\n\n return new Expression(list);\n },\n each: function(list, rs) {\n const rules = [];\n let newRules;\n let iterator;\n\n const tryEval = val => {\n if (val instanceof Node) {\n return val.eval(this.context);\n }\n return val;\n };\n\n if (list.value && !(list instanceof Quote)) {\n if (Array.isArray(list.value)) {\n iterator = list.value.map(tryEval);\n } else {\n iterator = [tryEval(list.value)];\n }\n } else if (list.ruleset) {\n iterator = tryEval(list.ruleset).rules;\n } else if (list.rules) {\n iterator = list.rules.map(tryEval);\n } else if (Array.isArray(list)) {\n iterator = list.map(tryEval);\n } else {\n iterator = [tryEval(list)];\n }\n\n let valueName = '@value';\n let keyName = '@key';\n let indexName = '@index';\n\n if (rs.params) {\n valueName = rs.params[0] && rs.params[0].name;\n keyName = rs.params[1] && rs.params[1].name;\n indexName = rs.params[2] && rs.params[2].name;\n rs = rs.rules;\n } else {\n rs = rs.ruleset;\n }\n\n for (let i = 0; i < iterator.length; i++) {\n let key;\n let value;\n const item = iterator[i];\n if (item instanceof Declaration) {\n key = typeof item.name === 'string' ? item.name : item.name[0].value;\n value = item.value;\n } else {\n key = new Dimension(i + 1);\n value = item;\n }\n\n if (item instanceof Comment) {\n continue;\n }\n\n newRules = rs.rules.slice(0);\n if (valueName) {\n newRules.push(new Declaration(valueName,\n value,\n false, false, this.index, this.currentFileInfo));\n }\n if (indexName) {\n newRules.push(new Declaration(indexName,\n new Dimension(i + 1),\n false, false, this.index, this.currentFileInfo));\n }\n if (keyName) {\n newRules.push(new Declaration(keyName,\n key,\n false, false, this.index, this.currentFileInfo));\n }\n\n rules.push(new Ruleset([ new(Selector)([ new Element('', '&') ]) ],\n newRules,\n rs.strictImports,\n rs.visibilityInfo()\n ));\n }\n\n return new Ruleset([ new(Selector)([ new Element('', '&') ]) ],\n rules,\n rs.strictImports,\n rs.visibilityInfo()\n ).eval(this.context);\n }\n};\n","import Dimension from '../tree/dimension';\n\nconst MathHelper = (fn, unit, n) => {\n if (!(n instanceof Dimension)) {\n throw { type: 'Argument', message: 'argument must be a number' };\n }\n if (unit === null) {\n unit = n.unit;\n } else {\n n = n.unify();\n }\n return new Dimension(fn(parseFloat(n.value)), unit);\n};\n\nexport default MathHelper;","import mathHelper from './math-helper.js';\n\nconst mathFunctions = {\n // name, unit\n ceil: null,\n floor: null,\n sqrt: null,\n abs: null,\n tan: '',\n sin: '',\n cos: '',\n atan: 'rad',\n asin: 'rad',\n acos: 'rad'\n};\n\nfor (const f in mathFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (mathFunctions.hasOwnProperty(f)) {\n mathFunctions[f] = mathHelper.bind(null, Math[f], mathFunctions[f]);\n }\n}\n\nmathFunctions.round = (n, f) => {\n const fraction = typeof f === 'undefined' ? 0 : f.value;\n return mathHelper(num => num.toFixed(fraction), null, n);\n};\n\nexport default mathFunctions;\n","import Dimension from '../tree/dimension';\nimport Anonymous from '../tree/anonymous';\nimport mathHelper from './math-helper.js';\n\nconst minMax = function (isMin, args) {\n args = Array.prototype.slice.call(args);\n switch (args.length) {\n case 0: throw { type: 'Argument', message: 'one or more arguments required' };\n }\n let i; // key is the unit.toString() for unified Dimension values,\n let j;\n let current;\n let currentUnified;\n let referenceUnified;\n let unit;\n let unitStatic;\n let unitClone;\n\n const // elems only contains original argument values.\n order = [];\n\n const values = {};\n // value is the index into the order array.\n for (i = 0; i < args.length; i++) {\n current = args[i];\n if (!(current instanceof Dimension)) {\n if (Array.isArray(args[i].value)) {\n Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));\n }\n continue;\n }\n currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();\n unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();\n unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic;\n unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone;\n j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit];\n if (j === undefined) {\n if (unitStatic !== undefined && unit !== unitStatic) {\n throw { type: 'Argument', message: 'incompatible types' };\n }\n values[unit] = order.length;\n order.push(current);\n continue;\n }\n referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify();\n if ( isMin && currentUnified.value < referenceUnified.value ||\n !isMin && currentUnified.value > referenceUnified.value) {\n order[j] = current;\n }\n }\n if (order.length == 1) {\n return order[0];\n }\n args = order.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');\n return new Anonymous(`${isMin ? 'min' : 'max'}(${args})`);\n};\n\nexport default {\n min: function(...args) {\n try {\n return minMax.call(this, true, args);\n } catch (e) {}\n },\n max: function(...args) {\n try {\n return minMax.call(this, false, args);\n } catch (e) {}\n },\n convert: function (val, unit) {\n return val.convertTo(unit.value);\n },\n pi: function () {\n return new Dimension(Math.PI);\n },\n mod: function(a, b) {\n return new Dimension(a.value % b.value, a.unit);\n },\n pow: function(x, y) {\n if (typeof x === 'number' && typeof y === 'number') {\n x = new Dimension(x);\n y = new Dimension(y);\n } else if (!(x instanceof Dimension) || !(y instanceof Dimension)) {\n throw { type: 'Argument', message: 'arguments must be numbers' };\n }\n\n return new Dimension(Math.pow(x.value, y.value), x.unit);\n },\n percentage: function (n) {\n const result = mathHelper(num => num * 100, '%', n);\n\n return result;\n }\n};\n","import Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport JavaScript from '../tree/javascript';\n\nexport default {\n e: function (str) {\n return new Quoted('\"', str instanceof JavaScript ? str.evaluated : str.value, true);\n },\n escape: function (str) {\n return new Anonymous(\n encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B')\n .replace(/\\(/g, '%28').replace(/\\)/g, '%29'));\n },\n replace: function (string, pattern, replacement, flags) {\n let result = string.value;\n replacement = (replacement.type === 'Quoted') ?\n replacement.value : replacement.toCSS();\n result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement);\n return new Quoted(string.quote || '', result, string.escaped);\n },\n '%': function (string /* arg, arg, ... */) {\n const args = Array.prototype.slice.call(arguments, 1);\n let result = string.value;\n\n for (let i = 0; i < args.length; i++) {\n /* jshint loopfunc:true */\n result = result.replace(/%[sda]/i, token => {\n const value = ((args[i].type === 'Quoted') &&\n token.match(/s/i)) ? args[i].value : args[i].toCSS();\n return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;\n });\n }\n result = result.replace(/%%/g, '%');\n return new Quoted(string.quote || '', result, string.escaped);\n }\n};\n","import Keyword from '../tree/keyword';\nimport DetachedRuleset from '../tree/detached-ruleset';\nimport Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport URL from '../tree/url';\nimport Operation from '../tree/operation';\n\nconst isa = (n, Type) => (n instanceof Type) ? Keyword.True : Keyword.False;\nconst isunit = (n, unit) => {\n if (unit === undefined) {\n throw { type: 'Argument', message: 'missing the required second argument to isunit.' };\n }\n unit = typeof unit.value === 'string' ? unit.value : unit;\n if (typeof unit !== 'string') {\n throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' };\n }\n return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False;\n};\n\nexport default {\n isruleset: function (n) {\n return isa(n, DetachedRuleset);\n },\n iscolor: function (n) {\n return isa(n, Color);\n },\n isnumber: function (n) {\n return isa(n, Dimension);\n },\n isstring: function (n) {\n return isa(n, Quoted);\n },\n iskeyword: function (n) {\n return isa(n, Keyword);\n },\n isurl: function (n) {\n return isa(n, URL);\n },\n ispixel: function (n) {\n return isunit(n, 'px');\n },\n ispercentage: function (n) {\n return isunit(n, '%');\n },\n isem: function (n) {\n return isunit(n, 'em');\n },\n isunit,\n unit: function (val, unit) {\n if (!(val instanceof Dimension)) {\n throw { type: 'Argument',\n message: `the first argument to unit must be a number${val instanceof Operation ? '. Have you forgotten parenthesis?' : ''}` };\n }\n if (unit) {\n if (unit instanceof Keyword) {\n unit = unit.value;\n } else {\n unit = unit.toCSS();\n }\n } else {\n unit = '';\n }\n return new Dimension(val.value, unit);\n },\n 'get-unit': function (n) {\n return new Anonymous(n.unit);\n }\n};\n","import functionRegistry from './function-registry';\nimport functionCaller from './function-caller';\n\nimport boolean from './boolean';\nimport defaultFunc from './default';\nimport color from './color';\nimport colorBlending from './color-blending';\nimport dataUri from './data-uri';\nimport list from './list';\nimport math from './math';\nimport number from './number';\nimport string from './string';\nimport svg from './svg';\nimport types from './types';\n\nexport default environment => {\n const functions = { functionRegistry, functionCaller };\n\n // register functions\n functionRegistry.addMultiple(boolean);\n functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc));\n functionRegistry.addMultiple(color);\n functionRegistry.addMultiple(colorBlending);\n functionRegistry.addMultiple(dataUri(environment));\n functionRegistry.addMultiple(list);\n functionRegistry.addMultiple(math);\n functionRegistry.addMultiple(number);\n functionRegistry.addMultiple(string);\n functionRegistry.addMultiple(svg(environment));\n functionRegistry.addMultiple(types);\n\n return functions;\n};\n","import Quoted from '../tree/quoted';\nimport URL from '../tree/url';\nimport * as utils from '../utils';\nimport logger from '../logger';\n\nexport default environment => {\n \n const fallback = (functionThis, node) => new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); \n\n return { 'data-uri': function(mimetypeNode, filePathNode) {\n\n if (!filePathNode) {\n filePathNode = mimetypeNode;\n mimetypeNode = null;\n }\n\n let mimetype = mimetypeNode && mimetypeNode.value;\n let filePath = filePathNode.value;\n const currentFileInfo = this.currentFileInfo;\n const currentDirectory = currentFileInfo.rewriteUrls ?\n currentFileInfo.currentDirectory : currentFileInfo.entryPath;\n\n const fragmentStart = filePath.indexOf('#');\n let fragment = '';\n if (fragmentStart !== -1) {\n fragment = filePath.slice(fragmentStart);\n filePath = filePath.slice(0, fragmentStart);\n }\n const context = utils.clone(this.context);\n context.rawBuffer = true;\n\n const fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true);\n\n if (!fileManager) {\n return fallback(this, filePathNode);\n }\n\n let useBase64 = false;\n\n // detect the mimetype if not given\n if (!mimetypeNode) {\n\n mimetype = environment.mimeLookup(filePath);\n\n if (mimetype === 'image/svg+xml') {\n useBase64 = false;\n } else {\n // use base 64 unless it's an ASCII or UTF-8 format\n const charset = environment.charsetLookup(mimetype);\n useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0;\n }\n if (useBase64) { mimetype += ';base64'; }\n }\n else {\n useBase64 = /;base64$/.test(mimetype);\n }\n\n const fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment);\n if (!fileSync.contents) {\n logger.warn(`Skipped data-uri embedding of ${filePath} because file not found`);\n return fallback(this, filePathNode || mimetypeNode);\n }\n let buf = fileSync.contents;\n if (useBase64 && !environment.encodeBase64) {\n return fallback(this, filePathNode);\n }\n\n buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);\n\n const uri = `data:${mimetype},${buf}${fragment}`;\n\n return new URL(new Quoted(`\"${uri}\"`, uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Expression from '../tree/expression';\nimport Quoted from '../tree/quoted';\nimport URL from '../tree/url';\n\nexport default () => {\n return { 'svg-gradient': function(direction) {\n let stops;\n let gradientDirectionSvg;\n let gradientType = 'linear';\n let rectangleDimension = 'x=\"0\" y=\"0\" width=\"1\" height=\"1\"';\n const renderEnv = {compress: false};\n let returner;\n const directionValue = direction.toCSS(renderEnv);\n let i;\n let color;\n let position;\n let positionValue;\n let alpha;\n\n function throwArgumentDescriptor() {\n throw { type: 'Argument',\n message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' +\n ' end_color [end_position] or direction, color list' };\n }\n\n if (arguments.length == 2) {\n if (arguments[1].value.length < 2) {\n throwArgumentDescriptor();\n }\n stops = arguments[1].value;\n } else if (arguments.length < 3) {\n throwArgumentDescriptor();\n } else {\n stops = Array.prototype.slice.call(arguments, 1);\n }\n\n switch (directionValue) {\n case 'to bottom':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\"';\n break;\n case 'to right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'to bottom right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\"';\n break;\n case 'to top right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"100%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'ellipse':\n case 'ellipse at center':\n gradientType = 'radial';\n gradientDirectionSvg = 'cx=\"50%\" cy=\"50%\" r=\"75%\"';\n rectangleDimension = 'x=\"-50\" y=\"-50\" width=\"101\" height=\"101\"';\n break;\n default:\n throw { type: 'Argument', message: 'svg-gradient direction must be \\'to bottom\\', \\'to right\\',' +\n ' \\'to bottom right\\', \\'to top right\\' or \\'ellipse at center\\'' };\n }\n returner = ``;\n\n returner = encodeURIComponent(returner);\n\n returner = `data:image/svg+xml,${returner}`;\n return new URL(new Quoted(`'${returner}'`, returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import contexts from './contexts';\nimport visitor from './visitors';\nimport tree from './tree';\n\nexport default function(root, options) {\n options = options || {};\n let evaldRoot;\n let variables = options.variables;\n const evalEnv = new contexts.Eval(options);\n\n //\n // Allows setting variables with a hash, so:\n //\n // `{ color: new tree.Color('#f01') }` will become:\n //\n // new tree.Declaration('@color',\n // new tree.Value([\n // new tree.Expression([\n // new tree.Color('#f01')\n // ])\n // ])\n // )\n //\n if (typeof variables === 'object' && !Array.isArray(variables)) {\n variables = Object.keys(variables).map(function (k) {\n let value = variables[k];\n\n if (!(value instanceof tree.Value)) {\n if (!(value instanceof tree.Expression)) {\n value = new tree.Expression([value]);\n }\n value = new tree.Value([value]);\n }\n return new tree.Declaration(`@${k}`, value, false, null, 0);\n });\n evalEnv.frames = [new tree.Ruleset(null, variables)];\n }\n\n const visitors = [\n new visitor.JoinSelectorVisitor(),\n new visitor.MarkVisibleSelectorsVisitor(true),\n new visitor.ExtendVisitor(),\n new visitor.ToCSSVisitor({compress: Boolean(options.compress)})\n ];\n\n const preEvalVisitors = [];\n let v;\n let visitorIterator;\n\n /**\n * first() / get() allows visitors to be added while visiting\n * \n * @todo Add scoping for visitors just like functions for @plugin; right now they're global\n */\n if (options.pluginManager) {\n visitorIterator = options.pluginManager.visitor();\n for (let i = 0; i < 2; i++) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (v.isPreEvalVisitor) {\n if (i === 0 || preEvalVisitors.indexOf(v) === -1) {\n preEvalVisitors.push(v);\n v.run(root);\n }\n }\n else {\n if (i === 0 || visitors.indexOf(v) === -1) {\n if (v.isPreVisitor) {\n visitors.unshift(v);\n }\n else {\n visitors.push(v);\n }\n }\n }\n }\n }\n }\n\n evaldRoot = root.eval(evalEnv);\n\n for (let i = 0; i < visitors.length; i++) {\n visitors[i].run(evaldRoot);\n }\n\n // Run any remaining visitors added after eval pass\n if (options.pluginManager) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (visitors.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) {\n v.run(evaldRoot);\n }\n }\n }\n\n return evaldRoot;\n}\n","/**\n * Plugin Manager\n */\nclass PluginManager {\n constructor(less) {\n this.less = less;\n this.visitors = [];\n this.preProcessors = [];\n this.postProcessors = [];\n this.installedPlugins = [];\n this.fileManagers = [];\n this.iterator = -1;\n this.pluginCache = {};\n this.Loader = new less.PluginLoader(less);\n }\n\n /**\n * Adds all the plugins in the array\n * @param {Array} plugins\n */\n addPlugins(plugins) {\n if (plugins) {\n for (let i = 0; i < plugins.length; i++) {\n this.addPlugin(plugins[i]);\n }\n }\n }\n\n /**\n *\n * @param plugin\n * @param {String} filename\n */\n addPlugin(plugin, filename, functionRegistry) {\n this.installedPlugins.push(plugin);\n if (filename) {\n this.pluginCache[filename] = plugin;\n }\n if (plugin.install) {\n plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry);\n }\n }\n\n /**\n *\n * @param filename\n */\n get(filename) {\n return this.pluginCache[filename];\n }\n\n /**\n * Adds a visitor. The visitor object has options on itself to determine\n * when it should run.\n * @param visitor\n */\n addVisitor(visitor) {\n this.visitors.push(visitor);\n }\n\n /**\n * Adds a pre processor object\n * @param {object} preProcessor\n * @param {number} priority - guidelines 1 = before import, 1000 = import, 2000 = after import\n */\n addPreProcessor(preProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) {\n if (this.preProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.preProcessors.splice(indexToInsertAt, 0, {preProcessor, priority});\n }\n\n /**\n * Adds a post processor object\n * @param {object} postProcessor\n * @param {number} priority - guidelines 1 = before compression, 1000 = compression, 2000 = after compression\n */\n addPostProcessor(postProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) {\n if (this.postProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.postProcessors.splice(indexToInsertAt, 0, {postProcessor, priority});\n }\n\n /**\n *\n * @param manager\n */\n addFileManager(manager) {\n this.fileManagers.push(manager);\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPreProcessors() {\n const preProcessors = [];\n for (let i = 0; i < this.preProcessors.length; i++) {\n preProcessors.push(this.preProcessors[i].preProcessor);\n }\n return preProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPostProcessors() {\n const postProcessors = [];\n for (let i = 0; i < this.postProcessors.length; i++) {\n postProcessors.push(this.postProcessors[i].postProcessor);\n }\n return postProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getVisitors() {\n return this.visitors;\n }\n\n visitor() {\n const self = this;\n return {\n first: function() {\n self.iterator = -1;\n return self.visitors[self.iterator];\n },\n get: function() {\n self.iterator += 1;\n return self.visitors[self.iterator];\n }\n };\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getFileManagers() {\n return this.fileManagers;\n }\n}\n\nlet pm;\n\nconst PluginManagerFactory = function(less, newFactory) {\n if (newFactory || !pm) {\n pm = new PluginManager(less);\n }\n return pm;\n};\n\n//\nexport default PluginManagerFactory;\n","'use strict';\n\nfunction parseNodeVersion(version) {\n var match = version.match(/^v(\\d{1,2})\\.(\\d{1,2})\\.(\\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\\+([0-9A-Za-z-.]+))?$/); // eslint-disable-line max-len\n if (!match) {\n throw new Error('Unable to parse: ' + version);\n }\n\n var res = {\n major: parseInt(match[1], 10),\n minor: parseInt(match[2], 10),\n patch: parseInt(match[3], 10),\n pre: match[4] || '',\n build: match[5] || '',\n };\n\n return res;\n}\n\nmodule.exports = parseNodeVersion;\n","import AbstractFileManager from '../less/environment/abstract-file-manager.js';\n\nlet options;\nlet logger;\nlet fileCache = {};\n\n// TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load\nconst FileManager = function() {}\nFileManager.prototype = Object.assign(new AbstractFileManager(), {\n alwaysMakePathsAbsolute() {\n return true;\n },\n\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return this.extractUrlParts(laterPath, basePath).path;\n },\n\n doXHR(url, type, callback, errback) {\n const xhr = new XMLHttpRequest();\n const async = options.isFileProtocol ? options.fileAsync : true;\n\n if (typeof xhr.overrideMimeType === 'function') {\n xhr.overrideMimeType('text/css');\n }\n logger.debug(`XHR: Getting '${url}'`);\n xhr.open('GET', url, async);\n xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');\n xhr.send(null);\n\n function handleResponse(xhr, callback, errback) {\n if (xhr.status >= 200 && xhr.status < 300) {\n callback(xhr.responseText,\n xhr.getResponseHeader('Last-Modified'));\n } else if (typeof errback === 'function') {\n errback(xhr.status, url);\n }\n }\n\n if (options.isFileProtocol && !options.fileAsync) {\n if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) {\n callback(xhr.responseText);\n } else {\n errback(xhr.status, url);\n }\n } else if (async) {\n xhr.onreadystatechange = () => {\n if (xhr.readyState == 4) {\n handleResponse(xhr, callback, errback);\n }\n };\n } else {\n handleResponse(xhr, callback, errback);\n }\n },\n\n supports() {\n return true;\n },\n\n clearFileCache() {\n fileCache = {};\n },\n\n loadFile(filename, currentDirectory, options) {\n // TODO: Add prefix support like less-node?\n // What about multiple paths?\n\n if (currentDirectory && !this.isPathAbsolute(filename)) {\n filename = currentDirectory + filename;\n }\n\n filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename;\n\n options = options || {};\n\n // sheet may be set to the stylesheet for the initial load or a collection of properties including\n // some context variables for imports\n const hrefParts = this.extractUrlParts(filename, window.location.href);\n const href = hrefParts.url;\n const self = this;\n \n return new Promise((resolve, reject) => {\n if (options.useFileCache && fileCache[href]) {\n try {\n const lessText = fileCache[href];\n return resolve({ contents: lessText, filename: href, webInfo: { lastModified: new Date() }});\n } catch (e) {\n return reject({ filename: href, message: `Error loading file ${href} error was ${e.message}` });\n }\n }\n\n self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) {\n // per file cache\n fileCache[href] = data;\n\n // Use remote copy (re-parse)\n resolve({ contents: data, filename: href, webInfo: { lastModified }});\n }, function doXHRError(status, url) {\n reject({ type: 'File', message: `'${url}' wasn't found (${status})`, href });\n });\n });\n }\n});\n\nexport default (opts, log) => {\n options = opts;\n logger = log;\n return FileManager;\n}\n","import Environment from './environment/environment';\nimport data from './data';\nimport tree from './tree';\nimport AbstractFileManager from './environment/abstract-file-manager';\nimport AbstractPluginLoader from './environment/abstract-plugin-loader';\nimport visitors from './visitors';\nimport Parser from './parser/parser';\nimport functions from './functions';\nimport contexts from './contexts';\nimport LessError from './less-error';\nimport transformTree from './transform-tree';\nimport * as utils from './utils';\nimport PluginManager from './plugin-manager';\nimport logger from './logger';\nimport SourceMapOutput from './source-map-output';\nimport SourceMapBuilder from './source-map-builder';\nimport ParseTree from './parse-tree';\nimport ImportManager from './import-manager';\nimport Parse from './parse';\nimport Render from './render';\nimport { version } from '../../package.json';\nimport parseVersion from 'parse-node-version';\n\nexport default function(environment, fileManagers) {\n let sourceMapOutput, sourceMapBuilder, parseTree, importManager;\n\n environment = new Environment(environment, fileManagers);\n sourceMapOutput = SourceMapOutput(environment);\n sourceMapBuilder = SourceMapBuilder(sourceMapOutput, environment);\n parseTree = ParseTree(sourceMapBuilder);\n importManager = ImportManager(environment);\n\n const render = Render(environment, parseTree, importManager);\n const parse = Parse(environment, parseTree, importManager);\n\n const v = parseVersion(`v${version}`);\n const initial = {\n version: [v.major, v.minor, v.patch],\n data,\n tree,\n Environment,\n AbstractFileManager,\n AbstractPluginLoader,\n environment,\n visitors,\n Parser,\n functions: functions(environment),\n contexts,\n SourceMapOutput: sourceMapOutput,\n SourceMapBuilder: sourceMapBuilder,\n ParseTree: parseTree,\n ImportManager: importManager,\n render,\n parse,\n LessError,\n transformTree,\n utils,\n PluginManager,\n logger\n };\n\n // Create a public API\n\n const ctor = function(t) {\n return function() {\n const obj = Object.create(t.prototype);\n t.apply(obj, Array.prototype.slice.call(arguments, 0));\n return obj;\n };\n };\n let t;\n const api = Object.create(initial);\n for (const n in initial.tree) {\n /* eslint guard-for-in: 0 */\n t = initial.tree[n];\n if (typeof t === 'function') {\n api[n.toLowerCase()] = ctor(t);\n }\n else {\n api[n] = Object.create(null);\n for (const o in t) {\n /* eslint guard-for-in: 0 */\n api[n][o.toLowerCase()] = ctor(t[o]);\n }\n }\n }\n\n /**\n * Some of the functions assume a `this` context of the API object,\n * which causes it to fail when wrapped for ES6 imports.\n * \n * An assumed `this` should be removed in the future.\n */\n initial.parse = initial.parse.bind(api);\n initial.render = initial.render.bind(api);\n\n return api;\n}\n","import LessError from './less-error';\nimport transformTree from './transform-tree';\nimport logger from './logger';\n\nexport default function(SourceMapBuilder) {\n class ParseTree {\n constructor(root, imports) {\n this.root = root;\n this.imports = imports;\n }\n\n toCSS(options) {\n let evaldRoot;\n const result = {};\n let sourceMapBuilder;\n try {\n evaldRoot = transformTree(this.root, options);\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n try {\n const compress = Boolean(options.compress);\n if (compress) {\n logger.warn('The compress option has been deprecated. ' + \n 'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');\n }\n\n const toCSSOptions = {\n compress,\n dumpLineNumbers: options.dumpLineNumbers,\n strictUnits: Boolean(options.strictUnits),\n numPrecision: 8};\n\n if (options.sourceMap) {\n sourceMapBuilder = new SourceMapBuilder(options.sourceMap);\n result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports);\n } else {\n result.css = evaldRoot.toCSS(toCSSOptions);\n }\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n if (options.pluginManager) {\n const postProcessors = options.pluginManager.getPostProcessors();\n for (let i = 0; i < postProcessors.length; i++) {\n result.css = postProcessors[i].process(result.css, { sourceMap: sourceMapBuilder, options, imports: this.imports });\n }\n }\n if (options.sourceMap) {\n result.map = sourceMapBuilder.getExternalSourceMap();\n }\n\n result.imports = [];\n for (const file in this.imports.files) {\n if (Object.prototype.hasOwnProperty.call(this.imports.files, file) && file !== this.imports.rootFilename) {\n result.imports.push(file);\n }\n }\n return result;\n }\n }\n\n return ParseTree;\n}\n","export default function (SourceMapOutput, environment) {\n class SourceMapBuilder {\n constructor(options) {\n this.options = options;\n }\n\n toCSS(rootNode, options, imports) {\n const sourceMapOutput = new SourceMapOutput(\n {\n contentsIgnoredCharsMap: imports.contentsIgnoredChars,\n rootNode,\n contentsMap: imports.contents,\n sourceMapFilename: this.options.sourceMapFilename,\n sourceMapURL: this.options.sourceMapURL,\n outputFilename: this.options.sourceMapOutputFilename,\n sourceMapBasepath: this.options.sourceMapBasepath,\n sourceMapRootpath: this.options.sourceMapRootpath,\n outputSourceFiles: this.options.outputSourceFiles,\n sourceMapGenerator: this.options.sourceMapGenerator,\n sourceMapFileInline: this.options.sourceMapFileInline, \n disableSourcemapAnnotation: this.options.disableSourcemapAnnotation\n });\n\n const css = sourceMapOutput.toCSS(options);\n this.sourceMap = sourceMapOutput.sourceMap;\n this.sourceMapURL = sourceMapOutput.sourceMapURL;\n if (this.options.sourceMapInputFilename) {\n this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename);\n }\n if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) {\n this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL);\n }\n return css + this.getCSSAppendage();\n }\n\n getCSSAppendage() {\n\n let sourceMapURL = this.sourceMapURL;\n if (this.options.sourceMapFileInline) {\n if (this.sourceMap === undefined) {\n return '';\n }\n sourceMapURL = `data:application/json;base64,${environment.encodeBase64(this.sourceMap)}`;\n }\n\n if (this.options.disableSourcemapAnnotation) {\n return '';\n }\n\n if (sourceMapURL) {\n return `/*# sourceMappingURL=${sourceMapURL} */`;\n }\n return '';\n }\n\n getExternalSourceMap() {\n return this.sourceMap;\n }\n\n setExternalSourceMap(sourceMap) {\n this.sourceMap = sourceMap;\n }\n\n isInline() {\n return this.options.sourceMapFileInline;\n }\n\n getSourceMapURL() {\n return this.sourceMapURL;\n }\n\n getOutputFilename() {\n return this.options.sourceMapOutputFilename;\n }\n\n getInputFilename() {\n return this.sourceMapInputFilename;\n }\n }\n\n return SourceMapBuilder;\n}\n","export default function (environment) {\n class SourceMapOutput {\n constructor(options) {\n this._css = [];\n this._rootNode = options.rootNode;\n this._contentsMap = options.contentsMap;\n this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;\n if (options.sourceMapFilename) {\n this._sourceMapFilename = options.sourceMapFilename.replace(/\\\\/g, '/');\n }\n this._outputFilename = options.outputFilename;\n this.sourceMapURL = options.sourceMapURL;\n if (options.sourceMapBasepath) {\n this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\\\/g, '/');\n }\n if (options.sourceMapRootpath) {\n this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\\\/g, '/');\n if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') {\n this._sourceMapRootpath += '/';\n }\n } else {\n this._sourceMapRootpath = '';\n }\n this._outputSourceFiles = options.outputSourceFiles;\n this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();\n\n this._lineNumber = 0;\n this._column = 0;\n }\n\n removeBasepath(path) {\n if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) {\n path = path.substring(this._sourceMapBasepath.length);\n if (path.charAt(0) === '\\\\' || path.charAt(0) === '/') {\n path = path.substring(1);\n }\n }\n\n return path;\n }\n\n normalizeFilename(filename) {\n filename = filename.replace(/\\\\/g, '/');\n filename = this.removeBasepath(filename);\n return (this._sourceMapRootpath || '') + filename;\n }\n\n add(chunk, fileInfo, index, mapLines) {\n\n // ignore adding empty strings\n if (!chunk) {\n return;\n }\n\n let lines, sourceLines, columns, sourceColumns, i;\n\n if (fileInfo && fileInfo.filename) {\n let inputSource = this._contentsMap[fileInfo.filename];\n\n // remove vars/banner added to the top of the file\n if (this._contentsIgnoredCharsMap[fileInfo.filename]) {\n // adjust the index\n index -= this._contentsIgnoredCharsMap[fileInfo.filename];\n if (index < 0) { index = 0; }\n // adjust the source\n inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);\n }\n\n /** \n * ignore empty content, or failsafe\n * if contents map is incorrect\n */\n if (inputSource === undefined) {\n this._css.push(chunk);\n return;\n }\n\n inputSource = inputSource.substring(0, index);\n sourceLines = inputSource.split('\\n');\n sourceColumns = sourceLines[sourceLines.length - 1];\n }\n\n lines = chunk.split('\\n');\n columns = lines[lines.length - 1];\n\n if (fileInfo && fileInfo.filename) {\n if (!mapLines) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column},\n original: { line: sourceLines.length, column: sourceColumns.length},\n source: this.normalizeFilename(fileInfo.filename)});\n } else {\n for (i = 0; i < lines.length; i++) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0},\n original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0},\n source: this.normalizeFilename(fileInfo.filename)});\n }\n }\n }\n\n if (lines.length === 1) {\n this._column += columns.length;\n } else {\n this._lineNumber += lines.length - 1;\n this._column = columns.length;\n }\n\n this._css.push(chunk);\n }\n\n isEmpty() {\n return this._css.length === 0;\n }\n\n toCSS(context) {\n this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });\n\n if (this._outputSourceFiles) {\n for (const filename in this._contentsMap) {\n // eslint-disable-next-line no-prototype-builtins\n if (this._contentsMap.hasOwnProperty(filename)) {\n let source = this._contentsMap[filename];\n if (this._contentsIgnoredCharsMap[filename]) {\n source = source.slice(this._contentsIgnoredCharsMap[filename]);\n }\n this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source);\n }\n }\n }\n\n this._rootNode.genCSS(context, this);\n\n if (this._css.length > 0) {\n let sourceMapURL;\n const sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());\n\n if (this.sourceMapURL) {\n sourceMapURL = this.sourceMapURL;\n } else if (this._sourceMapFilename) {\n sourceMapURL = this._sourceMapFilename;\n }\n this.sourceMapURL = sourceMapURL;\n\n this.sourceMap = sourceMapContent;\n }\n\n return this._css.join('');\n }\n }\n\n return SourceMapOutput;\n}\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport LessError from './less-error';\nimport * as utils from './utils';\nimport logger from './logger';\n\nexport default function(environment) {\n // FileInfo = {\n // 'rewriteUrls' - option - whether to adjust URL's to be relative\n // 'filename' - full resolved filename of current file\n // 'rootpath' - path to append to normal URLs for this node\n // 'currentDirectory' - path to the current file, absolute\n // 'rootFilename' - filename of the base file\n // 'entryPath' - absolute path to the entry file\n // 'reference' - whether the file should not be output and only output parts that are referenced\n\n class ImportManager {\n constructor(less, context, rootFileInfo) {\n this.less = less;\n this.rootFilename = rootFileInfo.filename;\n this.paths = context.paths || []; // Search paths, when importing\n this.contents = {}; // map - filename to contents of all the files\n this.contentsIgnoredChars = {}; // map - filename to lines at the beginning of each file to ignore\n this.mime = context.mime;\n this.error = null;\n this.context = context;\n // Deprecated? Unused outside of here, could be useful.\n this.queue = []; // Files which haven't been imported yet\n this.files = {}; // Holds the imported parse trees.\n }\n\n /**\n * Add an import to be imported\n * @param path - the raw path\n * @param tryAppendExtension - whether to try appending a file extension (.less or .js if the path has no extension)\n * @param currentFileInfo - the current file info (used for instance to work out relative paths)\n * @param importOptions - import options\n * @param callback - callback for when it is imported\n */\n push(path, tryAppendExtension, currentFileInfo, importOptions, callback) {\n const importManager = this, pluginLoader = this.context.pluginManager.Loader;\n\n this.queue.push(path);\n\n const fileParsedFunc = function (e, root, fullPath) {\n importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue\n\n const importedEqualsRoot = fullPath === importManager.rootFilename;\n if (importOptions.optional && e) {\n callback(null, {rules:[]}, false, null);\n logger.info(`The file ${fullPath} was skipped because it was not found and the import was marked optional.`);\n }\n else {\n // Inline imports aren't cached here.\n // If we start to cache them, please make sure they won't conflict with non-inline imports of the\n // same name as they used to do before this comment and the condition below have been added.\n if (!importManager.files[fullPath] && !importOptions.inline) {\n importManager.files[fullPath] = { root, options: importOptions };\n }\n if (e && !importManager.error) { importManager.error = e; }\n callback(e, root, importedEqualsRoot, fullPath);\n }\n };\n\n const newFileInfo = {\n rewriteUrls: this.context.rewriteUrls,\n entryPath: currentFileInfo.entryPath,\n rootpath: currentFileInfo.rootpath,\n rootFilename: currentFileInfo.rootFilename\n };\n\n const fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment);\n\n if (!fileManager) {\n fileParsedFunc({ message: `Could not find a file-manager for ${path}` });\n return;\n }\n\n const loadFileCallback = function(loadedFile) {\n let plugin;\n const resolvedFilename = loadedFile.filename;\n const contents = loadedFile.contents.replace(/^\\uFEFF/, '');\n\n // Pass on an updated rootpath if path of imported file is relative and file\n // is in a (sub|sup) directory\n //\n // Examples:\n // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/',\n // then rootpath should become 'less/module/nav/'\n // - If path of imported file is '../mixins.less' and rootpath is 'less/',\n // then rootpath should become 'less/../'\n newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename);\n if (newFileInfo.rewriteUrls) {\n newFileInfo.rootpath = fileManager.join(\n (importManager.context.rootpath || ''),\n fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath));\n\n if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) {\n newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath);\n }\n }\n newFileInfo.filename = resolvedFilename;\n\n const newEnv = new contexts.Parse(importManager.context);\n\n newEnv.processImports = false;\n importManager.contents[resolvedFilename] = contents;\n\n if (currentFileInfo.reference || importOptions.reference) {\n newFileInfo.reference = true;\n }\n\n if (importOptions.isPlugin) {\n plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo);\n if (plugin instanceof LessError) {\n fileParsedFunc(plugin, null, resolvedFilename);\n }\n else {\n fileParsedFunc(null, plugin, resolvedFilename);\n }\n } else if (importOptions.inline) {\n fileParsedFunc(null, contents, resolvedFilename);\n } else {\n // import (multiple) parse trees apparently get altered and can't be cached.\n // TODO: investigate why this is\n if (importManager.files[resolvedFilename]\n && !importManager.files[resolvedFilename].options.multiple\n && !importOptions.multiple) {\n\n fileParsedFunc(null, importManager.files[resolvedFilename].root, resolvedFilename);\n }\n else {\n new Parser(newEnv, importManager, newFileInfo).parse(contents, function (e, root) {\n fileParsedFunc(e, root, resolvedFilename);\n });\n }\n }\n };\n let loadedFile;\n let promise;\n const context = utils.clone(this.context);\n\n if (tryAppendExtension) {\n context.ext = importOptions.isPlugin ? '.js' : '.less';\n }\n\n if (importOptions.isPlugin) {\n context.mime = 'application/javascript';\n\n if (context.syncImport) {\n loadedFile = pluginLoader.loadPluginSync(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n } else {\n promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n }\n }\n else {\n if (context.syncImport) {\n loadedFile = fileManager.loadFileSync(path, currentFileInfo.currentDirectory, context, environment);\n } else {\n promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment,\n (err, loadedFile) => {\n if (err) {\n fileParsedFunc(err);\n } else {\n loadFileCallback(loadedFile);\n }\n });\n }\n }\n if (loadedFile) {\n if (!loadedFile.filename) {\n fileParsedFunc(loadedFile);\n } else {\n loadFileCallback(loadedFile);\n }\n } else if (promise) {\n promise.then(loadFileCallback, fileParsedFunc);\n }\n }\n }\n\n return ImportManager;\n}\n","import * as utils from './utils';\n\nexport default function(environment, ParseTree) {\n const render = function (input, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise(function (resolve, reject) {\n render.call(self, input, options, function(err, output) {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n this.parse(input, options, function(err, root, imports, options) {\n if (err) { return callback(err); }\n\n let result;\n try {\n const parseTree = new ParseTree(root, imports);\n result = parseTree.toCSS(options);\n }\n catch (err) { return callback(err); }\n\n callback(null, result);\n });\n }\n };\n\n return render;\n}\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport PluginManager from './plugin-manager';\nimport LessError from './less-error';\nimport * as utils from './utils';\n\nexport default function(environment, ParseTree, ImportManager) {\n const parse = function (input, options, callback) {\n\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise(function (resolve, reject) {\n parse.call(self, input, options, function(err, output) {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n let context;\n let rootFileInfo;\n const pluginManager = new PluginManager(this, !options.reUsePluginManager);\n\n options.pluginManager = pluginManager;\n\n context = new contexts.Parse(options);\n\n if (options.rootFileInfo) {\n rootFileInfo = options.rootFileInfo;\n } else {\n const filename = options.filename || 'input';\n const entryPath = filename.replace(/[^/\\\\]*$/, '');\n rootFileInfo = {\n filename,\n rewriteUrls: context.rewriteUrls,\n rootpath: context.rootpath || '',\n currentDirectory: entryPath,\n entryPath,\n rootFilename: filename\n };\n // add in a missing trailing slash\n if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') {\n rootFileInfo.rootpath += '/';\n }\n }\n\n const imports = new ImportManager(this, context, rootFileInfo);\n this.importManager = imports;\n\n // TODO: allow the plugins to be just a list of paths or names\n // Do an async plugin queue like lessc\n\n if (options.plugins) {\n options.plugins.forEach(function(plugin) {\n let evalResult, contents;\n if (plugin.fileContent) {\n contents = plugin.fileContent.replace(/^\\uFEFF/, '');\n evalResult = pluginManager.Loader.evalPlugin(contents, context, imports, plugin.options, plugin.filename);\n if (evalResult instanceof LessError) {\n return callback(evalResult);\n }\n }\n else {\n pluginManager.addPlugin(plugin);\n }\n });\n }\n\n new Parser(context, imports, rootFileInfo)\n .parse(input, function (e, root) {\n if (e) { return callback(e); }\n callback(null, root, imports, options);\n }, options);\n }\n };\n return parse;\n}\n","/**\n * @todo Add tests for browser `@plugin`\n */\nimport AbstractPluginLoader from '../less/environment/abstract-plugin-loader.js';\n\n/**\n * Browser Plugin Loader\n */\nconst PluginLoader = function(less) {\n this.less = less;\n // Should we shim this.require for browser? Probably not?\n};\n\nPluginLoader.prototype = Object.assign(new AbstractPluginLoader(), {\n loadPlugin(filename, basePath, context, environment, fileManager) {\n return new Promise((fulfill, reject) => {\n fileManager.loadFile(filename, basePath, context, environment)\n .then(fulfill).catch(reject);\n });\n }\n});\n\nexport default PluginLoader;\n\n","import * as utils from './utils';\nimport browser from './browser';\n\nexport default (window, less, options) => {\n\n function errorHTML(e, rootHref) {\n const id = `less-error-message:${utils.extractId(rootHref || '')}`;\n const template = '{content}
';\n const elem = window.document.createElement('div');\n let timer;\n let content;\n const errors = [];\n const filename = e.filename || rootHref;\n const filenameNoPath = filename.match(/([^/]+(\\?.*)?)$/)[1];\n\n elem.id = id;\n elem.className = 'less-error-message';\n\n content = `${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'}` + \n `
in ${filenameNoPath} `;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += `on line ${e.line}, column ${e.column + 1}:
`;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `
Stack Trace${e.stack.split('\\n').slice(1).join('
')}`;\n }\n elem.innerHTML = content;\n\n // CSS for error messages\n browser.createCSS(window.document, [\n '.less-error-message ul, .less-error-message li {',\n 'list-style-type: none;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message label {',\n 'font-size: 12px;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'color: #cc7777;',\n '}',\n '.less-error-message pre {',\n 'color: #dd6666;',\n 'padding: 4px 0;',\n 'margin: 0;',\n 'display: inline-block;',\n '}',\n '.less-error-message pre.line {',\n 'color: #ff0000;',\n '}',\n '.less-error-message h3 {',\n 'font-size: 20px;',\n 'font-weight: bold;',\n 'padding: 15px 0 5px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message a {',\n 'color: #10a',\n '}',\n '.less-error-message .error {',\n 'color: red;',\n 'font-weight: bold;',\n 'padding-bottom: 2px;',\n 'border-bottom: 1px dashed red;',\n '}'\n ].join('\\n'), { title: 'error-message' });\n\n elem.style.cssText = [\n 'font-family: Arial, sans-serif',\n 'border: 1px solid #e00',\n 'background-color: #eee',\n 'border-radius: 5px',\n '-webkit-border-radius: 5px',\n '-moz-border-radius: 5px',\n 'color: #e00',\n 'padding: 15px',\n 'margin-bottom: 15px'\n ].join(';');\n\n if (options.env === 'development') {\n timer = setInterval(() => {\n const document = window.document;\n const body = document.body;\n if (body) {\n if (document.getElementById(id)) {\n body.replaceChild(elem, document.getElementById(id));\n } else {\n body.insertBefore(elem, body.firstChild);\n }\n clearInterval(timer);\n }\n }, 10);\n }\n }\n\n function removeErrorHTML(path) {\n const node = window.document.getElementById(`less-error-message:${utils.extractId(path)}`);\n if (node) {\n node.parentNode.removeChild(node);\n }\n }\n\n function removeErrorConsole() {\n // no action\n }\n\n function removeError(path) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n removeErrorHTML(path);\n } else if (options.errorReporting === 'console') {\n removeErrorConsole(path);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('remove', path);\n }\n }\n\n function errorConsole(e, rootHref) {\n const template = '{line} {content}';\n const filename = e.filename || rootHref;\n const errors = [];\n let content = `${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'} in ${filename}`;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += ` on line ${e.line}, column ${e.column + 1}:\\n${errors.join('\\n')}`;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `\\nStack Trace\\n${e.stack}`;\n }\n less.logger.error(content);\n }\n\n function error(e, rootHref) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n errorHTML(e, rootHref);\n } else if (options.errorReporting === 'console') {\n errorConsole(e, rootHref);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('add', e, rootHref);\n }\n }\n\n return {\n add: error,\n remove: removeError\n };\n};\n","/**\n * Kicks off less and compiles any stylesheets\n * used in the browser distributed version of less\n * to kick-start less using the browser api\n */\nimport defaultOptions from '../less/default-options';\nimport addDefaultOptions from './add-default-options';\nimport root from './index';\n\nconst options = defaultOptions();\n\nif (window.less) {\n for (const key in window.less) {\n if (Object.prototype.hasOwnProperty.call(window.less, key)) {\n options[key] = window.less[key];\n }\n }\n}\naddDefaultOptions(window, options);\n\noptions.plugins = options.plugins || [];\n\nif (window.LESS_PLUGINS) {\n options.plugins = options.plugins.concat(window.LESS_PLUGINS);\n}\n\nconst less = root(window, options);\nexport default less;\n\nwindow.less = less;\n\nlet css;\nlet head;\nlet style;\n\n// Always restore page visibility\nfunction resolveOrReject(data) {\n if (data.filename) {\n console.warn(data);\n }\n if (!options.async) {\n head.removeChild(style);\n }\n}\n\nif (options.onReady) {\n if (/!watch/.test(window.location.hash)) {\n less.watch();\n }\n // Simulate synchronous stylesheet loading by hiding page rendering\n if (!options.async) {\n css = 'body { display: none !important }';\n head = document.head || document.getElementsByTagName('head')[0];\n style = document.createElement('style');\n\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n less.registerStylesheetsImmediately();\n less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject);\n}\n","// Export a new default each time\nexport default function() {\n return {\n /* Inline Javascript - @plugin still allowed */\n javascriptEnabled: false,\n\n /* Outputs a makefile import dependency list to stdout. */\n depends: false,\n\n /* (DEPRECATED) Compress using less built-in compression. \n * This does an okay job but does not utilise all the tricks of \n * dedicated css compression. */\n compress: false,\n\n /* Runs the less parser and just reports errors without any output. */\n lint: false,\n\n /* Sets available include paths.\n * If the file in an @import rule does not exist at that exact location, \n * less will look for it at the location(s) passed to this option. \n * You might use this for instance to specify a path to a library which \n * you want to be referenced simply and relatively in the less files. */\n paths: [],\n\n /* color output in the terminal */\n color: true,\n\n /* The strictImports controls whether the compiler will allow an @import inside of either \n * @media blocks or (a later addition) other selector blocks.\n * See: https://github.com/less/less.js/issues/656 */\n strictImports: false,\n\n /* Allow Imports from Insecure HTTPS Hosts */\n insecure: false,\n\n /* Allows you to add a path to every generated import and url in your css. \n * This does not affect less import statements that are processed, just ones \n * that are left in the output css. */\n rootpath: '',\n\n /* By default URLs are kept as-is, so if you import a file in a sub-directory \n * that references an image, exactly the same URL will be output in the css. \n * This option allows you to re-write URL's in imported files so that the \n * URL is always relative to the base imported file */\n rewriteUrls: false,\n\n /* How to process math \n * 0 always - eagerly try to solve all operations\n * 1 parens-division - require parens for division \"/\"\n * 2 parens | strict - require parens for all operations\n * 3 strict-legacy - legacy strict behavior (super-strict)\n */\n math: 1,\n\n /* Without this option, less attempts to guess at the output unit when it does maths. */\n strictUnits: false,\n\n /* Effectively the declaration is put at the top of your base Less file, \n * meaning it can be used but it also can be overridden if this variable \n * is defined in the file. */\n globalVars: null,\n\n /* As opposed to the global variable option, this puts the declaration at the\n * end of your base file, meaning it will override anything defined in your Less file. */\n modifyVars: null,\n\n /* This option allows you to specify a argument to go on to every URL. */\n urlArgs: ''\n }\n}","import {addDataAttr} from './utils';\nimport browser from './browser';\n\nexport default (window, options) => {\n\n // use options from the current script tag data attribues\n addDataAttr(options, browser.currentScript(window));\n\n if (options.isFileProtocol === undefined) {\n options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol);\n }\n\n // Load styles asynchronously (default: false)\n //\n // This is set to `false` by default, so that the body\n // doesn't start loading before the stylesheets are parsed.\n // Setting this to `true` can result in flickering.\n //\n options.async = options.async || false;\n options.fileAsync = options.fileAsync || false;\n\n // Interval between watch polls\n options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500);\n\n options.env = options.env || (window.location.hostname == '127.0.0.1' ||\n window.location.hostname == '0.0.0.0' ||\n window.location.hostname == 'localhost' ||\n (window.location.port &&\n window.location.port.length > 0) ||\n options.isFileProtocol ? 'development'\n : 'production');\n\n const dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash);\n if (dumpLineNumbers) {\n options.dumpLineNumbers = dumpLineNumbers[1];\n }\n\n if (options.useFileCache === undefined) {\n options.useFileCache = true;\n }\n\n if (options.onReady === undefined) {\n options.onReady = true;\n }\n\n if (options.relativeUrls) {\n options.rewriteUrls = 'all';\n }\n};\n","//\n// index.js\n// Should expose the additional browser functions on to the less object\n//\nimport {addDataAttr} from './utils';\nimport lessRoot from '../less';\nimport browser from './browser';\nimport FM from './file-manager';\nimport PluginLoader from './plugin-loader';\nimport LogListener from './log-listener';\nimport ErrorReporting from './error-reporting';\nimport Cache from './cache';\nimport ImageSize from './image-size';\n\nexport default (window, options) => {\n const document = window.document;\n const less = lessRoot();\n\n less.options = options;\n const environment = less.environment;\n const FileManager = FM(options, less.logger);\n const fileManager = new FileManager();\n environment.addFileManager(fileManager);\n less.FileManager = FileManager;\n less.PluginLoader = PluginLoader;\n\n LogListener(less, options);\n const errors = ErrorReporting(window, less, options);\n const cache = less.cache = options.cache || Cache(window, options, less.logger);\n ImageSize(less.environment);\n\n // Setup user functions - Deprecate?\n if (options.functions) {\n less.functions.functionRegistry.addMultiple(options.functions);\n }\n\n const typePattern = /^text\\/(x-)?less$/;\n\n function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n }\n\n // only really needed for phantom\n function bind(func, thisArg) {\n const curryArgs = Array.prototype.slice.call(arguments, 2);\n return function() {\n const args = curryArgs.concat(Array.prototype.slice.call(arguments, 0));\n return func.apply(thisArg, args);\n };\n }\n\n function loadStyles(modifyVars) {\n const styles = document.getElementsByTagName('style');\n let style;\n\n for (let i = 0; i < styles.length; i++) {\n style = styles[i];\n if (style.type.match(typePattern)) {\n const instanceOptions = clone(options);\n instanceOptions.modifyVars = modifyVars;\n const lessText = style.innerHTML || '';\n instanceOptions.filename = document.location.href.replace(/#.*$/, '');\n\n /* jshint loopfunc:true */\n // use closure to store current style\n less.render(lessText, instanceOptions,\n bind((style, e, result) => {\n if (e) {\n errors.add(e, 'inline');\n } else {\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = result.css;\n } else {\n style.innerHTML = result.css;\n }\n }\n }, null, style));\n }\n }\n }\n\n function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {\n\n const instanceOptions = clone(options);\n addDataAttr(instanceOptions, sheet);\n instanceOptions.mime = sheet.type;\n\n if (modifyVars) {\n instanceOptions.modifyVars = modifyVars;\n }\n\n function loadInitialFileCallback(loadedFile) {\n const data = loadedFile.contents;\n const path = loadedFile.filename;\n const webInfo = loadedFile.webInfo;\n\n const newFileInfo = {\n currentDirectory: fileManager.getPath(path),\n filename: path,\n rootFilename: path,\n rewriteUrls: instanceOptions.rewriteUrls\n };\n\n newFileInfo.entryPath = newFileInfo.currentDirectory;\n newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory;\n\n if (webInfo) {\n webInfo.remaining = remaining;\n\n const css = cache.getCSS(path, webInfo, instanceOptions.modifyVars);\n if (!reload && css) {\n webInfo.local = true;\n callback(null, css, data, sheet, webInfo, path);\n return;\n }\n\n }\n\n // TODO add tests around how this behaves when reloading\n errors.remove(path);\n\n instanceOptions.rootFileInfo = newFileInfo;\n less.render(data, instanceOptions, (e, result) => {\n if (e) {\n e.href = path;\n callback(e);\n } else {\n cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css);\n callback(null, result.css, data, sheet, webInfo, path);\n }\n });\n }\n\n fileManager.loadFile(sheet.href, null, instanceOptions, environment)\n .then(loadedFile => {\n loadInitialFileCallback(loadedFile);\n }).catch(err => {\n console.log(err);\n callback(err);\n });\n\n }\n\n function loadStyleSheets(callback, reload, modifyVars) {\n for (let i = 0; i < less.sheets.length; i++) {\n loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1), modifyVars);\n }\n }\n\n function initRunningMode() {\n if (less.env === 'development') {\n less.watchTimer = setInterval(() => {\n if (less.watchMode) {\n fileManager.clearFileCache();\n /**\n * @todo remove when this is typed with JSDoc\n */\n // eslint-disable-next-line no-unused-vars\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n } else if (css) {\n browser.createCSS(window.document, css, sheet);\n }\n });\n }\n }, options.poll);\n }\n }\n\n //\n // Watch mode\n //\n less.watch = function () {\n if (!less.watchMode ) {\n less.env = 'development';\n initRunningMode();\n }\n this.watchMode = true;\n return true;\n };\n\n less.unwatch = function () {clearInterval(less.watchTimer); this.watchMode = false; return false; };\n\n //\n // Synchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\".\n //\n less.registerStylesheetsImmediately = () => {\n const links = document.getElementsByTagName('link');\n less.sheets = [];\n\n for (let i = 0; i < links.length; i++) {\n if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&\n (links[i].type.match(typePattern)))) {\n less.sheets.push(links[i]);\n }\n }\n };\n\n //\n // Asynchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\", returning a Promise.\n //\n less.registerStylesheets = () => new Promise((resolve) => {\n less.registerStylesheetsImmediately();\n resolve();\n });\n\n //\n // With this function, it's possible to alter variables and re-render\n // CSS without reloading less-files\n //\n less.modifyVars = record => less.refresh(true, record, false);\n\n less.refresh = (reload, modifyVars, clearFileCache) => {\n if ((reload || clearFileCache) && clearFileCache !== false) {\n fileManager.clearFileCache();\n }\n return new Promise((resolve, reject) => {\n let startTime;\n let endTime;\n let totalMilliseconds;\n let remainingSheets;\n startTime = endTime = new Date();\n\n // Set counter for remaining unprocessed sheets\n remainingSheets = less.sheets.length;\n\n if (remainingSheets === 0) {\n\n endTime = new Date();\n totalMilliseconds = endTime - startTime;\n less.logger.info('Less has finished and no sheets were loaded.');\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n\n } else {\n // Relies on less.sheets array, callback seems to be guaranteed to be called for every element of the array\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n reject(e);\n return;\n }\n if (webInfo.local) {\n less.logger.info(`Loading ${sheet.href} from cache.`);\n } else {\n less.logger.info(`Rendered ${sheet.href} successfully.`);\n }\n browser.createCSS(window.document, css, sheet);\n less.logger.info(`CSS for ${sheet.href} generated in ${new Date() - endTime}ms`);\n\n // Count completed sheet\n remainingSheets--;\n\n // Check if the last remaining sheet was processed and then call the promise\n if (remainingSheets === 0) {\n totalMilliseconds = new Date() - startTime;\n less.logger.info(`Less has finished. CSS generated in ${totalMilliseconds}ms`);\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n }\n endTime = new Date();\n }, reload, modifyVars);\n }\n\n loadStyles(modifyVars);\n });\n };\n\n less.refreshStyles = loadStyles;\n return less;\n};\n","export default (less, options) => {\n const logLevel_debug = 4;\n const logLevel_info = 3;\n const logLevel_warn = 2;\n const logLevel_error = 1;\n\n // The amount of logging in the javascript console.\n // 3 - Debug, information and errors\n // 2 - Information and errors\n // 1 - Errors\n // 0 - None\n // Defaults to 2\n options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error);\n\n if (!options.loggers) {\n options.loggers = [{\n debug: function(msg) {\n if (options.logLevel >= logLevel_debug) {\n console.log(msg);\n }\n },\n info: function(msg) {\n if (options.logLevel >= logLevel_info) {\n console.log(msg);\n }\n },\n warn: function(msg) {\n if (options.logLevel >= logLevel_warn) {\n console.warn(msg);\n }\n },\n error: function(msg) {\n if (options.logLevel >= logLevel_error) {\n console.error(msg);\n }\n }\n }];\n }\n for (let i = 0; i < options.loggers.length; i++) {\n less.logger.addListener(options.loggers[i]);\n }\n};\n","// Cache system is a bit outdated and could do with work\n\nexport default (window, options, logger) => {\n let cache = null;\n if (options.env !== 'development') {\n try {\n cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage;\n } catch (_) {}\n }\n return {\n setCSS: function(path, lastModified, modifyVars, styles) {\n if (cache) {\n logger.info(`saving ${path} to cache.`);\n try {\n cache.setItem(path, styles);\n cache.setItem(`${path}:timestamp`, lastModified);\n if (modifyVars) {\n cache.setItem(`${path}:vars`, JSON.stringify(modifyVars));\n }\n } catch (e) {\n // TODO - could do with adding more robust error handling\n logger.error(`failed to save \"${path}\" to local storage for caching.`);\n }\n }\n },\n getCSS: function(path, webInfo, modifyVars) {\n const css = cache && cache.getItem(path);\n const timestamp = cache && cache.getItem(`${path}:timestamp`);\n let vars = cache && cache.getItem(`${path}:vars`);\n\n modifyVars = modifyVars || {};\n vars = vars || '{}'; // if not set, treat as the JSON representation of an empty object\n\n if (timestamp && webInfo.lastModified &&\n (new Date(webInfo.lastModified).valueOf() ===\n new Date(timestamp).valueOf()) &&\n JSON.stringify(modifyVars) === vars) {\n // Use local copy\n return css;\n }\n }\n };\n};\n","\nimport functionRegistry from './../less/functions/function-registry';\n\nexport default () => {\n function imageSize() {\n throw {\n type: 'Runtime',\n message: 'Image size functions are not supported in browser version of less'\n };\n }\n\n const imageFunctions = {\n 'image-size': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-width': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-height': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n }\n };\n\n functionRegistry.addMultiple(imageFunctions);\n};\n"],"names":["extractId","href","replace","addDataAttr","options","tag","opt","dataset","Object","prototype","hasOwnProperty","call","JSON","parse","_","document","styles","sheet","id","title","utils.extractId","oldStyleNode","getElementById","keepOldStyleNode","styleNode","createElement","setAttribute","media","styleSheet","appendChild","createTextNode","childNodes","length","firstChild","nodeValue","head","getElementsByTagName","nextEl","nextSibling","parentNode","insertBefore","removeChild","cssText","e","Error","window","scripts","currentScript","error","msg","this","_fireEvent","warn","info","debug","addListener","listener","_listeners","push","removeListener","i_1","splice","type","i_2","logFunction","externalEnvironment","fileManagers","requiredFunctions","functions","concat","propName","environmentFunc","bind","Environment","filename","currentDirectory","environment","isSync","logger","undefined","pluginManager","getFileManagers","fileManager","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","darkgrey","darkgreen","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","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","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","m","cm","mm","in","px","pt","pc","duration","s","ms","angle","rad","Math","PI","deg","grad","turn","colors","unitConversions","parent","visibilityBlocks","nodeVisible","rootNode","parsed","Node","fileInfo","getIndex","nodes","set","node","Array","isArray","forEach","_index","_fileInfo","context","strs","genCSS","add","chunk","index","isEmpty","join","output","value","visitor","visit","op","a","b","precision","numPrecision","Number","toFixed","compare","Color","rgb","originalForm","self","match","map","c","i","parseInt","alpha","split","clamp","v","max","min","toHex","round","toString","assign","luma","r","g","pow","toCSS","doNotCompress","color","colorFunction","compress","args","fround","indexOf","toHSL","h","l","toRGB","splitcolor","operate","other","_operate","d","toHSV","toARGB","x","fromKeyword","keyword","key","toLowerCase","slice","Paren","eval","_noSpaceCombinators"," ","|","Combinator","emptyOrWhitespace","trim","spaceOrEmpty","Element","combinator","isVariable","currentFileInfo","visibilityInfo","copyVisibilityInfo","setParent","accept","clone","firstSelector","charAt","ALWAYS","PARENS_DIVISION","PARENS","RewriteUrls","getType","payload","copy","target","constructor","getPrototypeOf","il","arguments","k","j","jl","__spreadArrays","getOwnPropertyNames","getOwnPropertySymbols","reduce","carry","props","includes","newVal","originalObject","includeNonenumerable","propType","propertyIsEnumerable","defineProperty","enumerable","writable","configurable","assignProp","nonenumerable","getLocation","inputStream","n","line","column","copyArray","arr","obj","cloned","prop","defaults","obj1","obj2","newObj","_defaults","defaults_1","copyOptions","opts","strictMath","math","Constants.Math","relativeUrls","rewriteUrls","Constants.RewriteUrls","flattenArray","result","length_1","isNullOrUndefined","val","anonymousFunc","LessError","fileContentMap","currentFilename","message","stack","input","contents","loc","utils.getLocation","col","callLine","lines","found","func","Function","lineAdjust","callExtract","extract","create","F","stylize","str","errorTxt","substr","_visitArgs","visitDeeper","_hasIndexed","_noop","implementation","_implementation","_visitInCache","_visitOutCache","indexNodeTypes","ticker","child","typeIndex","tree","Visitor","nodeTypeIndex","fnName","impl","funcOut","visitArgs","newNode","isReplacing","cnt","nonReplacing","out","evald","flatten","item","nestedCnt","nestedItem","contexts","copyFromOriginal","original","destination","propertiesToCopy","parseCopyProperties","Parse","paths","evalCopyProperties","isPathRelative","path","test","isPathLocalRelative","Eval","frames","importantScope","enterCalc","calcStack","inCalc","exitCalc","pop","inParenthesis","parensStack","outOfParenthesis","mathOn","isMathOn","pathRequiresRewrite","rewritePath","rootpath","newPath","normalizePath","segment","segments","reverse","onSequencerEmpty","imports","variableImports","_onSequencerEmpty","_currentDepth","ImportSequencer","callback","importSequencer","importItem","isReady","tryRun","apply","variableImport","ImportVisitor","importer","finish","_visitor","_importer","_finish","importCount","onceFileDetectionMap","recursionDetector","_sequencer","run","root","isFinished","visitImport","importNode","inlineCSS","inline","css","utils.copyArray","importParent","isVariableImport","addVariableImport","processImportNode","evaldImportNode","evalForImport","multiple","importMultiple","tryAppendLessExtension","rules","onImported","sequencedOnImported","addImport","getPath","importedAtRoot","fullPath","importVisitor","isPlugin","isOptional","optional","duplicateImport","skip","importedFilename","oldContext","visitDeclaration","declNode","unshift","visitDeclarationOut","shift","visitAtRule","atRuleNode","visitAtRuleOut","visitMixinDefinition","mixinDefinitionNode","visitMixinDefinitionOut","visitRuleset","rulesetNode","visitRulesetOut","visitMedia","mediaNode","visitMediaOut","visible","SetTreeVisibilityVisitor","visitArray","blocksVisibility","ensureVisibility","ensureInvisibility","allExtendsStack","ExtendFinderVisitor","allExtends","extend","extendList","allSelectorsExtendList","ruleCnt","Extend","extendOnEveryPath","selectorPath","selExtendList","allSelectorsExtend","foundExtends","findSelfSelectors","ruleset","firstExtendOnThisSelectorPath","selectors","ProcessExtendsVisitor","extendFinder","extendIndices","doExtendChaining","newRoot","checkExtendsForNonMatched","indices","filter","hasFoundMatches","parent_ids","selector","extendsList","extendsListTarget","iterationCount","extendIndex","targetExtendIndex","matches","newSelector","targetExtend","newExtend","extendsToAdd","extendVisitor","object_id","selfSelectors","findMatch","selfSelector","extendSelector","isVisible","option","extendChainCount","selectorOne","selectorTwo","ruleNode","selectorNode","pathIndex","selectorsToAdd","extendedSelectors","haystackSelectorPath","haystackSelectorIndex","hackstackSelector","hackstackElementIndex","haystackElement","targetCombinator","potentialMatch","needleElements","elements","potentialMatches","allowBefore","matched","initialCombinator","isElementValuesEqual","finished","allowAfter","endPathIndex","endPathElementIndex","elementValue1","elementValue2","Attribute","Selector","replacementSelector","matchIndex","firstElement","newElements","currentSelectorPathIndex","currentSelectorPathElementIndex","currentValue","derived","createDerived","newAllExtends","lastIndex","JoinSelectorVisitor","getIsOutput","joinSelectors","multiMedia","isRooted","_context","CSSVisitorUtils","bodyRules","rule","isSilent","owner","thing","compiledRulesBody","keepOnlyVisibleChilds","removeVisibilityBlock","firstRoot","hasVisibleSelector","ToCSSVisitor","utils","variable","mixinNode","visitExtend","extendNode","visitComment","commentNode","originalRules","resolveVisibility","visitAtRuleWithBody","visitAtRuleWithoutBody","visitAnonymous","anonymousNode","nodeRules","hasFakeRuleset","getBodyRules","_mergeRules","name","charset","debugInfo","comment","Comment","checkValidNodes","isRoot","Declaration","Call","allowRoot","rulesets","_compileRulesetPaths","nodeRuleCnt","_removeDuplicateRules","isVisibleRuleset","p","ruleList","ruleCache","ruleCSS","groups","groupsArr","i_3","merge","group","result_1","space_1","comma_1","Expression","important","Value","MarkVisibleSelectorsVisitor","ExtendVisitor","furthest","furthestPossibleErrorMessage","chunks","current","currentPos","saveStack","parserInput","skipWhitespace","nextChar","oldi","oldj","curr","endIndex","mem","inp","charCodeAt","autoCommentAbsorb","isLineComment","nextNewLine","text","commentStore","nextStarSlash","save","restore","possibleErrorMessage","state","forget","isWhitespace","offset","pos","code","$re","tok","exec","$char","$peekChar","$str","tokLength","$quoted","startChar","currentPosition","$parseUntil","testChar","quote","returnVal","inComment","blockDepth","blockStack","parseGroups","startPos","lastPos","loop","char","expected","peek","peekChar","currentChar","prevChar","getInput","peekNotNumeric","start","chunkInput","failFunction","fail","lastOpening","lastOpeningParen","lastMultiComment","lastMultiCommentEndBrace","chunkerCurrentIndex","currentChunkStartIndex","cc","cc2","len","level","parenLevel","emitFrom","emitChunk","force","String","fromCharCode","chunker","end","furthestReachedEnd","furthestChar","makeRegistry","base","_data","addMultiple","keys","_this","get","getLocalFunctions","inherit","MediaSyntaxOptions","queryInParens","ContainerSyntaxOptions","Parser","currentIndex","parsers","getParserInput","expect","arg","expectChar","getDebugInfo","lineNumber","fileName","parseNode","parseList","returnNodes","parser","additionalData","globalVars","modifyVars","ignored","err","preText","disablePluginRule","plugin","serializeVars","preProcessors","getPreProcessors","process","banner","contentsIgnoredChars","Ruleset","primary","functionRegistry","endInfo","processImports","visitors","mixin","extendRule","definition","declaration","variableCall","entities","atrule","foundSemiColon","mixinLookup","quoted","forceEscaped","isEscaped","customFuncCall","stop","f","ieAlpha","boolean","condition","if","prevArgs","isSemiColonSeparated","argsComma","argsSemiColon","detachedRuleset","assignment","expression","literal","dimension","unicodeDescriptor","entity","url","property","Variable","Property","ch","variableCurly","curly","propertyCurly","colorKeyword","ud","javascript","js","escape","Boolean","parsedName","lookups","inValue","ruleLookups","VariableCall","NamespaceValue","isRule","element","getLookup","hasParens","elem","elemIndex","re","isCall","expressionContainsNamed","nameLoop","expand","returner","variadic","expressions","hasSep","throwAwayComments","cond","params","argInfo","conditions","block","lookupValue","Quoted","attribute","slashedCombinator","isLess","when","cif","content","blockRuleset","Definition","DetachedRuleset","dumpLineNumbers","strictImports","hasDR","ruleProperty","permissiveValue","anonymousValue","untilTokens","done","testCurrentChar","Anonymous","variableRegex","propRegex","import","features","dir","importOptions","mediaFeatures","o","optionName","importOption","mediaFeature","syntaxOptions","rangeP","atomicCondition","rvalue","lvalue","prepareAndGetNestableAtRule","treeType","atRule","nestableAtRule","Media","Container","pluginArgs","nonVendorSpecificName","hasIdentifier","hasExpression","hasUnknown","hasBlock","sub","addition","parens","multiplication","operation","isSpaced","operand","parensInOp","needsParens","logical","next","conditionAnd","negatedCondition","parenthesisCondition","negate","body","me","tryConditionFollowedByParenthesis","preparsedCond","delim","simpleProperty","vars","name_1","evaldCondition","getElements","mixinElements_","utils.isNullOrUndefined","mediaEmpty","els","importManager","createEmptySelectors","el","sels","olen","mixinElements","isJustParentSelector","Keyword","True","False","mapLines","rulesetLike","isRulesetLike","MATH","asComment","ctx","asMediaQuery","filenameWithProtocol","lineSeparator","lastRule","prevMath","evaldValue","mathBypass","evalName","importantResult","makeImportant","isCompressed","defaultFunc","value_","error_","reset","_lookups","_variables","_properties","isRuleset","selCnt","hasVariable","hasOnePassingSelector","toParseSelectors","startingIndex","selectorFileInfo","utils.flattenArray","subRule","originalRuleset","allowImports","globalFunctionRegistry","ctxFrames","ctxSelectors","evalImports","rsRules","evalFirst","mediaBlockCount","mediaBlocks","resetCache","bubbleSelectors","importRules","matchArgs","matchCondition","lastSelector","_rulesets","variables","hash","properties","name_2","decl","parseValue","lastDeclaration","toParse","transformDeclaration","nodes_1","filtRules","prependRule","find","foundMixins","ruleNodes","tabLevel","sep","tabRuleStr","tabSetStr","charsetNodeIndex","importNodeIndex","isCharset","pathCnt","pathSubCnt","currentLastRule","joinSelector","createParenthesis","elementsToPak","originalElement","replacementParen","insideParent","createSelector","containedElement","addReplacementIntoPath","beginningPath","addPath","replacedElement","originalSelector","newSelectorPath","newJoinedSelector","parentEl","restOfPath","addAllReplacementsIntoPath","addPaths","mergeElementsOnToSelectors","sel","deriveSelector","deriveFrom","newPaths","replaceParentSelector","inSelector","currentElements","newSelectors","selectorsMultiplied","maybeSelector","hadParentSelector","nestedSelector","replaced","nestedPaths","replacedNewSelectors","concatenated","AtRule","outputRuleset","mediaPathBackup","mediaBlocksBackup","mediaPath","callEval","Unit","numerator","denominator","backupUnit","sort","strictUnits","returnStr","is","unitString","toUpperCase","isLength","RegExp","isSingular","usedUnits","mapUnit","groupName","atomicUnit","cancel","counter","count","Dimension","unit","parseFloat","isNaN","toColor","strValue","convertTo","unify","numericCompare","conversions","targetUnit","applyUnit","derivedConversions","Operation","operands","__assign","t","noSpacing","returnValue","doubleParen","functionCaller","evalArgs","commentFilter","subNodes","to","from","pack","ar","calc","currentMathContext","funcCaller","FunctionCaller","isValid","columnNumber","evaluating","frame","fun","mergeRules","less","vArr","escaped","containsVariables","that","iterativeReplace","regexp","replacementFnc","evaluatedValue","URL","isEvald","urlArgs","NestableAtRulePrototype","evalTop","evalNested","permute","fragment","rest","Import","pathValue","reference","evalPath","doEval","addVisibilityBlock","registry","newImport","JsEvalNode","evaluateJavaScript","evalContext","javascriptEnabled","jsify","toJS","JavaScript","string","Assignment","Condition","QueryInParens","op2","mvalue","UnicodeDescriptor","Negative","next_id","selectorElements","selfElements","ruleCall","substring","arity","optionalParameters","required","evalParams","mixinEnv","evaldArguments","varargs","isNamedFound","argIndex","argsLength","evalCall","_arguments","mixinFrames","allArgsCnt","requiredArgsCnt","MixinCall","mixins","mixinPath","argValue","isRecursive","isOneFound","candidate","defaultResult","noArgumentsFilter","candidates","conditionResult","calcDefGroup","namespace","MixinDefinition","format","newRules","_setVisibilityToReplacement","replacement","AbstractFileManager","lastIndexOf","ext","tryAppendExtension","basePath","laterPath","baseUrl","urlDirectories","baseUrlDirectories","urlParts","extractUrlParts","baseUrlParts","diff","hostPart","directories","urlPartsRegex","rawDirectories","rawPath","fileUrl","require","AbstractPluginLoader","pluginOptions","pluginObj","localModule","shortname","FileManager","trySetOptions","use","exports","loader","validatePlugin","minVersion","compareVersion","addPlugin","setOptions","version","versionToString","aVersion","bVersion","versionString","plugins","printUsage","If","trueValue","falseValue","isdefined","colorFunctions","hsla","origColor","hsl","number","rgba","size","m1","m2","hue","hsv","hsva","vs","floor","perm","saturation","lightness","hsvhue","hsvsaturation","hsvvalue","luminance","saturate","amount","method","desaturate","lighten","darken","fadein","fadeout","fade","spin","mix","color1","color2","weight","w","w1","w2","greyscale","contrast","dark","light","threshold","argb","tint","shade","colorBlend","mode","cb","cs","cr","ab","as","colorBlendModeFunctions","multiply","screen","overlay","softlight","sqrt","hardlight","difference","abs","exclusion","average","negation","getItemsFromNode","_SELF","~","_i","expr","values","range","step","stepValue","list","each","rs","iterator","tryEval","Quote","valueName","keyName","indexName","MathHelper","fn","mathFunctions","ceil","sin","cos","atan","asin","acos","mathHelper","fraction","num","minMax","isMin","currentUnified","referenceUnified","unitStatic","unitClone","order","convert","pi","mod","y","percentage","evaluated","encodeURI","pattern","flags","%","token","encodeURIComponent","isa","Type","isunit","isruleset","iscolor","isnumber","isstring","iskeyword","isurl","ispixel","ispercentage","isem","get-unit","colorBlending","fallback","functionThis","data-uri","mimetypeNode","filePathNode","mimetype","filePath","entryPath","fragmentStart","utils.clone","rawBuffer","getFileManager","useBase64","mimeLookup","charsetLookup","fileSync","loadFileSync","buf","encodeBase64","uri","dataUri","svg-gradient","direction","stops","gradientDirectionSvg","position","positionValue","gradientType","rectangleDimension","renderEnv","directionValue","throwArgumentDescriptor","types","evaldRoot","evalEnv","visitorIterator","preEvalVisitors","first","isPreEvalVisitor","isPreVisitor","pm","postProcessors","installedPlugins","pluginCache","Loader","PluginLoader","PluginManager","install","preProcessor","priority","indexToInsertAt","postProcessor","manager","PluginManagerFactory","newFactory","major","minor","patch","pre","build","sourceMapOutput","sourceMapBuilder","parseTree","SourceMapBuilder","ParseTree","transformTree","toCSSOptions","sourceMap","getPostProcessors","file_1","getExternalSourceMap","files","rootFilename","SourceMapOutput","contentsIgnoredCharsMap","contentsMap","sourceMapFilename","sourceMapURL","outputFilename","sourceMapOutputFilename","sourceMapBasepath","sourceMapRootpath","outputSourceFiles","sourceMapGenerator","sourceMapFileInline","disableSourcemapAnnotation","sourceMapInputFilename","normalizeFilename","removeBasepath","getCSSAppendage","_css","_rootNode","_contentsMap","_contentsIgnoredCharsMap","_sourceMapFilename","_outputFilename","_sourceMapBasepath","_sourceMapRootpath","_outputSourceFiles","_sourceMapGeneratorConstructor","getSourceMapGenerator","_lineNumber","_column","sourceLines","columns","sourceColumns","inputSource","_sourceMapGenerator","addMapping","generated","source","file","sourceRoot","setSourceContent","sourceMapContent","stringify","toJSON","rootFileInfo","mime","queue","ImportManager","pluginLoader","fileParsedFunc","importedEqualsRoot","newFileInfo","loadedFile","promise","loadFileCallback","resolvedFilename","pathDiff","isPathAbsolute","alwaysMakePathsAbsolute","newEnv","evalPlugin","syncImport","loadPluginSync","loadPlugin","loadFile","then","render","utils.copyOptions","self_1","Promise","resolve","reject","Render","context_1","pluginManager_1","reUsePluginManager","imports_1","evalResult","fileContent","parseVersion","initial","data","ctor","api","fileCache","doXHR","errback","xhr","XMLHttpRequest","async","isFileProtocol","fileAsync","handleResponse","status","responseText","getResponseHeader","overrideMimeType","open","setRequestHeader","send","onreadystatechange","readyState","supports","clearFileCache","location","useFileCache","lessText_1","webInfo","lastModified","Date","log","fulfill","catch","rootHref","errorReporting","errors","errorline","classname","logLevel","errorConsole","timer","filenameNoPath","className","innerHTML","browser","style","env","setInterval","replaceChild","clearInterval","errorHTML","remove","removeErrorHTML","depends","lint","insecure","protocol","poll","hostname","port","onReady","addDefaultOptions","LESS_PLUGINS","lessRoot","FM","addFileManager","loggers","console","LogListener","ErrorReporting","cache","localStorage","setCSS","setItem","getCSS","getItem","timestamp","valueOf","Cache","imageSize","imageFunctions","image-size","image-width","image-height","ImageSize","typePattern","thisArg","curryArgs","loadStyles","instanceOptions","loadStyleSheet","reload","remaining","local","loadInitialFileCallback","loadStyleSheets","sheets","watch","watchMode","watchTimer","unwatch","registerStylesheetsImmediately","links","rel","registerStylesheets","record","refresh","startTime","endTime","totalMilliseconds","remainingSheets","refreshStyles","resolveOrReject","pageLoadFinished"],"mappings":";;;;;;;;;8OACgBA,EAAUC,GACtB,OAAOA,EAAKC,QAAQ,qBAAsB,IACrCA,QAAQ,qBAAsB,IAC9BA,QAAQ,MAAO,IACfA,QAAQ,eAAgB,IACxBA,QAAQ,YAAa,KACrB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AAOnhD,GAGPujD,EAAQkE,MACRnf,EAAKnmC,OAAOzB,KAAK,WAAWpC,EAAMhB,qBAElCgrC,EAAKnmC,OAAOzB,KAAK,YAAYpC,EAAMhB,uBAEvCknD,EAAkBtkD,EAAO9B,SAAUugB,EAAKrgB,GACxCgqC,EAAKnmC,OAAOzB,KAAK,WAAWpC,EAAMhB,uBAAqB,IAAImmD,KAAS+E,SAM5C,MAHxBE,IAIID,EAAoB,IAAIhF,KAAS8E,EACjCjgB,EAAKnmC,OAAOzB,KAAK,uCAAuC+nD,QACxDvH,EAAQ,CACJqH,YACAC,UACAC,oBACAb,OAAQtf,EAAKsf,OAAOvoD,UAG5BmpD,EAAU,IAAI/E,OACf8D,EAAQj1B,GAGf80B,EAAW90B,OAInBgW,EAAKqgB,cAAgBvB,EACd9e,EHrQEjqB,CAAKne,OAAQzC,IAU1B,SAASmrD,GAAgB/G,GACjBA,EAAK9/C,UACLgkD,QAAQtlD,KAAKohD,GAEZpkD,GAAQ4kD,OACT7iD,GAAKM,YAAY2kD,WAZzBvkD,OAAOooC,KAAOA,GAgBV7qC,GAAQ+nD,UACJ,SAASlqC,KAAKpb,OAAOkjD,SAAS1iB,OAC9B4H,GAAKuf,QAGJpqD,GAAQ4kD,QACT1jC,GAAM,oCACNnf,GAAOpB,SAASoB,MAAQpB,SAASqB,qBAAqB,QAAQ,IAC9DglD,GAAQrmD,SAASU,cAAc,UAEzBqC,KAAO,WACTsjD,GAAMxlD,WACNwlD,GAAMxlD,WAAWc,QAAU4e,GAE3B8lC,GAAMvlD,YAAYd,SAASe,eAAewf,KAG9Cnf,GAAKN,YAAYulD,KAErBnc,GAAK2f,iCACL3f,GAAKugB,iBAAmBvgB,GAAKggB,QAAqB,gBAAbhgB,GAAKoc,KAAuB7D,KAAK+H,GAAiBA"}
\ No newline at end of file
diff --git a/packages/less/dist/less.js b/packages/less/dist/less.js
index 1c06b3e9c..c93afa6f3 100644
--- a/packages/less/dist/less.js
+++ b/packages/less/dist/less.js
@@ -4706,6 +4706,10 @@
if (e) {
value.push(e);
}
+ if (parserInput.peek(',')) {
+ value.push(new (tree.Anonymous)(',', parserInput.i));
+ parserInput.$char(',');
+ }
} while (e);
done = testCurrentChar();
if (value.length > 0) {
@@ -7125,7 +7129,12 @@
for (var i_1 = 0; i_1 < this.value.length; i_1++) {
this.value[i_1].genCSS(context, output);
if (!this.noSpacing && i_1 + 1 < this.value.length) {
- output.add(' ');
+ if (!this.noSpacing && i_1 + 1 < this.value.length) {
+ if (i_1 + 1 < this.value.length && !(this.value[i_1 + 1] instanceof Anonymous) ||
+ this.value[i_1 + 1] instanceof Anonymous && this.value[i_1 + 1].value !== ',') {
+ output.add(' ');
+ }
+ }
}
}
},
diff --git a/packages/less/dist/less.min.js b/packages/less/dist/less.min.js
index 44a6df818..f4d168e48 100644
--- a/packages/less/dist/less.min.js
+++ b/packages/less/dist/less.min.js
@@ -7,5 +7,5 @@
*
* @license Apache-2.0
*/
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).less=t()}(this,(function(){"use strict";function e(e){return e.replace(/^[a-z-]+:\/+?[^/]+/,"").replace(/[?&]livereload=\w+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^.\w-]+/g,"-").replace(/\./g,":")}function t(e,t){if(t)for(var i in t.dataset)if(Object.prototype.hasOwnProperty.call(t.dataset,i))if("env"===i||"dumpLineNumbers"===i||"rootpath"===i||"errorReporting"===i)e[i]=t.dataset[i];else try{e[i]=JSON.parse(t.dataset[i])}catch(e){}}var i=function(t,i,n){var r=n.href||"",s="less:"+(n.title||e(r)),o=t.getElementById(s),a=!1,l=t.createElement("style");l.setAttribute("type","text/css"),n.media&&l.setAttribute("media",n.media),l.id=s,l.styleSheet||(l.appendChild(t.createTextNode(i)),a=null!==o&&o.childNodes.length>0&&l.childNodes.length>0&&o.firstChild.nodeValue===l.firstChild.nodeValue);var u=t.getElementsByTagName("head")[0];if(null===o||!1===a){var c=n&&n.nextSibling||null;c?c.parentNode.insertBefore(l,c):u.appendChild(l)}if(o&&!1===a&&o.parentNode.removeChild(o),l.styleSheet)try{l.styleSheet.cssText=i}catch(e){throw new Error("Couldn't reassign styleSheet.cssText.")}},n=function(e){var t,i=e.document;return i.currentScript||(t=i.getElementsByTagName("script"))[t.length-1]},r={error:function(e){this._fireEvent("error",e)},warn:function(e){this._fireEvent("warn",e)},info:function(e){this._fireEvent("info",e)},debug:function(e){this._fireEvent("debug",e)},addListener:function(e){this._listeners.push(e)},removeListener:function(e){for(var t=0;t=0;a--){var l=o[a];if(l[s?"supportsSync":"supports"](e,t,i,n))return l}return null},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},e}(),o={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},a={length:{m:1,cm:.01,mm:.001,in:.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:1/400,turn:1}},l={colors:o,unitConversions:a},u=function(){function e(){this.parent=null,this.visibilityBlocks=void 0,this.nodeVisible=void 0,this.rootNode=null,this.parsed=null}return Object.defineProperty(e.prototype,"currentFileInfo",{get:function(){return this.fileInfo()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.getIndex()},enumerable:!1,configurable:!0}),e.prototype.setParent=function(t,i){function n(t){t&&t instanceof e&&(t.parent=i)}Array.isArray(t)?t.forEach(n):n(t)},e.prototype.getIndex=function(){return this._index||this.parent&&this.parent.getIndex()||0},e.prototype.fileInfo=function(){return this._fileInfo||this.parent&&this.parent.fileInfo()||{}},e.prototype.isRulesetLike=function(){return!1},e.prototype.toCSS=function(e){var t=[];return this.genCSS(e,{add:function(e,i,n){t.push(e)},isEmpty:function(){return 0===t.length}}),t.join("")},e.prototype.genCSS=function(e,t){t.add(this.value)},e.prototype.accept=function(e){this.value=e.visit(this.value)},e.prototype.eval=function(){return this},e.prototype._operate=function(e,t,i,n){switch(t){case"+":return i+n;case"-":return i-n;case"*":return i*n;case"/":return i/n}},e.prototype.fround=function(e,t){var i=e&&e.numPrecision;return i?Number((t+2e-16).toFixed(i)):t},e.compare=function(t,i){if(t.compare&&"Quoted"!==i.type&&"Anonymous"!==i.type)return t.compare(i);if(i.compare)return-i.compare(t);if(t.type===i.type){if(t=t.value,i=i.value,!Array.isArray(t))return t===i?0:void 0;if(t.length===i.length){for(var n=0;nt?1:void 0},e.prototype.blocksVisibility=function(){return void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),0!==this.visibilityBlocks},e.prototype.addVisibilityBlock=function(){void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks+1},e.prototype.removeVisibilityBlock=function(){void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks-1},e.prototype.ensureVisibility=function(){this.nodeVisible=!0},e.prototype.ensureInvisibility=function(){this.nodeVisible=!1},e.prototype.isVisible=function(){return this.nodeVisible},e.prototype.visibilityInfo=function(){return{visibilityBlocks:this.visibilityBlocks,nodeVisible:this.nodeVisible}},e.prototype.copyVisibilityInfo=function(e){e&&(this.visibilityBlocks=e.visibilityBlocks,this.nodeVisible=e.nodeVisible)},e}(),c=function(e,t,i){var n=this;Array.isArray(e)?this.rgb=e:e.length>=6?(this.rgb=[],e.match(/.{2}/g).map((function(e,t){t<3?n.rgb.push(parseInt(e,16)):n.alpha=parseInt(e,16)/255}))):(this.rgb=[],e.split("").map((function(e,t){t<3?n.rgb.push(parseInt(e+e,16)):n.alpha=parseInt(e+e,16)/255}))),this.alpha=this.alpha||("number"==typeof t?t:1),void 0!==i&&(this.value=i)};function h(e,t){return Math.min(Math.max(e,0),t)}function f(e){return"#"+e.map((function(e){return((e=h(Math.round(e),255))<16?"0":"")+e.toString(16)})).join("")}c.prototype=Object.assign(new u,{type:"Color",luma:function(){var e=this.rgb[0]/255,t=this.rgb[1]/255,i=this.rgb[2]/255;return.2126*(e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(i=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))},genCSS:function(e,t){t.add(this.toCSS(e))},toCSS:function(e,t){var i,n,r,s=e&&e.compress&&!t,o=[];if(n=this.fround(e,this.alpha),this.value)if(0===this.value.indexOf("rgb"))n<1&&(r="rgba");else{if(0!==this.value.indexOf("hsl"))return this.value;r=n<1?"hsla":"hsl"}else n<1&&(r="rgba");switch(r){case"rgba":o=this.rgb.map((function(e){return h(Math.round(e),255)})).concat(h(n,1));break;case"hsla":o.push(h(n,1));case"hsl":i=this.toHSL(),o=[this.fround(e,i.h),this.fround(e,100*i.s)+"%",this.fround(e,100*i.l)+"%"].concat(o)}if(r)return r+"("+o.join(","+(s?"":" "))+")";if(i=this.toRGB(),s){var a=i.split("");a[1]===a[2]&&a[3]===a[4]&&a[5]===a[6]&&(i="#"+a[1]+a[3]+a[5])}return i},operate:function(e,t,i){for(var n=new Array(3),r=this.alpha*(1-i.alpha)+i.alpha,s=0;s<3;s++)n[s]=this._operate(e,t,this.rgb[s],i.rgb[s]);return new c(n,r)},toRGB:function(){return f(this.rgb)},toHSL:function(){var e,t,i=this.rgb[0]/255,n=this.rgb[1]/255,r=this.rgb[2]/255,s=this.alpha,o=Math.max(i,n,r),a=Math.min(i,n,r),l=(o+a)/2,u=o-a;if(o===a)e=t=0;else{switch(t=l>.5?u/(2-o-a):u/(o+a),o){case i:e=(n-r)/u+(n=0&&"\n"!==t.charAt(i);)r++;return"number"==typeof e&&(n=(t.slice(0,e).match(/\n/g)||"").length),{line:n,column:r}}function k(e){var t,i=e.length,n=new Array(i);for(t=0;t|Function):(\d+):(\d+)/,V=function(e,t,i){Error.call(this);var n=e.filename||i;if(this.message=e.message,this.stack=e.stack,t&&n){var r=t.contents[n],s=C(e.index,r),o=s.line,a=s.column,l=e.call&&C(e.call,r).line,u=r?r.split("\n"):"";if(this.type=e.type||"Syntax",this.filename=n,this.index=e.index,this.line="number"==typeof o?o+1:null,this.column=a,!this.line&&this.stack){var c=this.stack.match(O),h=new Function("a","throw new Error()"),f=0;try{h()}catch(e){var p=e.stack.match(O);f=1-parseInt(p[2])}c&&(c[2]&&(this.line=parseInt(c[2])+f),c[3]&&(this.column=parseInt(c[3])))}this.callLine=l+1,this.callExtract=u[l],this.extract=[u[this.line-2],u[this.line-1],u[this.line]]}};if(void 0===Object.create){var F=function(){};F.prototype=Error.prototype,V.prototype=new F}else V.prototype=Object.create(Error.prototype);V.prototype.constructor=V,V.prototype.toString=function(e){e=e||{};var t="",i=this.extract||[],n=[],r=function(e){return e};if(e.stylize){var s=typeof e.stylize;if("function"!==s)throw Error("options.stylize should be a function, got a "+s+"!");r=e.stylize}if(null!==this.line){if("string"==typeof i[0]&&n.push(r(this.line-1+" "+i[0],"grey")),"string"==typeof i[1]){var o=this.line+" ";i[1]&&(o+=i[1].slice(0,this.column)+r(r(r(i[1].substr(this.column,1),"bold")+i[1].slice(this.column+1),"red"),"inverse")),n.push(o)}"string"==typeof i[2]&&n.push(r(this.line+1+" "+i[2],"grey")),n=n.join("\n")+r("","reset")+"\n"}return t+=r(this.type+"Error: "+this.message,"red"),this.filename&&(t+=r(" in ","red")+this.filename),this.line&&(t+=r(" on line "+this.line+", column "+(this.column+1)+":","grey")),t+="\n"+n,this.callLine&&(t+=r("from ","red")+(this.filename||"")+"/n",t+=r(this.callLine,"grey")+" "+this.callExtract+"/n"),t};var $={visitDeeper:!0},L=!1;function j(e){return e}var N=function(){function e(e){this._implementation=e,this._visitInCache={},this._visitOutCache={},L||(!function e(t,i){var n,r;for(n in t)switch(typeof(r=t[n])){case"function":r.prototype&&r.prototype.type&&(r.prototype.typeIndex=i++);break;case"object":i=e(r,i)}return i}(He,1),L=!0)}return e.prototype.visit=function(e){if(!e)return e;var t=e.typeIndex;if(!t)return e.value&&e.value.typeIndex&&this.visit(e.value),e;var i,n=this._implementation,r=this._visitInCache[t],s=this._visitOutCache[t],o=$;if(o.visitDeeper=!0,r||(r=n[i="visit"+e.type]||j,s=n[i+"Out"]||j,this._visitInCache[t]=r,this._visitOutCache[t]=s),r!==j){var a=r.call(n,e,o);e&&n.isReplacing&&(e=a)}if(o.visitDeeper&&e)if(e.length)for(var l=0,u=e.length;lg.PARENS_DIVISION)||this.parensStack&&this.parensStack.length))},D.Eval.prototype.pathRequiresRewrite=function(e){return(this.rewriteUrls===b?z:T)(e)},D.Eval.prototype.rewritePath=function(e,t){var i;return t=t||"",i=this.normalizePath(t+e),z(e)&&T(t)&&!1===z(i)&&(i="./"+i),i},D.Eval.prototype.normalizePath=function(e){var t,i=e.split("/").reverse();for(e=[];0!==i.length;)switch(t=i.pop()){case".":break;case"..":0===e.length||".."===e[e.length-1]?e.push(t):e.pop();break;default:e.push(t)}return e.join("/")};var G=function(){function e(e){this.imports=[],this.variableImports=[],this._onSequencerEmpty=e,this._currentDepth=0}return e.prototype.addImport=function(e){var t=this,i={callback:e,args:null,isReady:!1};return this.imports.push(i),function(){i.args=Array.prototype.slice.call(arguments,0),i.isReady=!0,t.tryRun()}},e.prototype.addVariableImport=function(e){this.variableImports.push(e)},e.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var e=this.imports[0];if(!e.isReady)return;this.imports=this.imports.slice(1),e.callback.apply(null,e.args)}if(0===this.variableImports.length)break;var t=this.variableImports[0];this.variableImports=this.variableImports.slice(1),t()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},e}(),W=function(e,t){this._visitor=new N(this),this._importer=e,this._finish=t,this.context=new D.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new G(this._onSequencerEmpty.bind(this))};W.prototype={isReplacing:!1,run:function(e){try{this._visitor.visit(e)}catch(e){this.error=e}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(e,t){var i=e.options.inline;if(!e.css||i){var n=new D.Eval(this.context,k(this.context.frames)),r=n.frames[0];this.importCount++,e.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,e,n,r)):this.processImportNode(e,n,r)}t.visitDeeper=!1},processImportNode:function(e,t,i){var n,r=e.options.inline;try{n=e.evalForImport(t)}catch(t){t.filename||(t.index=e.getIndex(),t.filename=e.fileInfo().filename),e.css=!0,e.error=t}if(!n||n.css&&!r)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{n.options.multiple&&(t.importMultiple=!0);for(var s=void 0===n.css,o=0;o=0||(a=[u.selfSelectors[0]],(s=f.findMatch(l,a)).length&&(l.hasFoundMatches=!0,l.selfSelectors.forEach((function(e){var t=u.visibilityInfo();o=f.extendSelector(s,a,e,l.isVisible()),(c=new He.Extend(u.selector,u.option,0,u.fileInfo(),t)).selfSelectors=o,o[o.length-1].extendList=[c],h.push(c),c.ruleset=u.ruleset,c.parent_ids=c.parent_ids.concat(u.parent_ids,l.parent_ids),u.firstExtendOnThisSelectorPath&&(c.firstExtendOnThisSelectorPath=!0,u.ruleset.paths.push(o))}))));if(h.length){if(this.extendChainCount++,i>100){var p="{unable to calculate}",v="{unable to calculate}";try{p=h[0].selfSelectors[0].toCSS(),v=h[0].selector.toCSS()}catch(e){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+p+":extend("+v+")"}}return h.concat(f.doExtendChaining(h,t,i+1))}return h},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitSelector=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){if(!e.root){var i,n,r,s,o=this.allExtendsStack[this.allExtendsStack.length-1],a=[],l=this;for(r=0;r0&&u[l.matched].combinator.value!==o?l=null:l.matched++,l&&(l.finished=l.matched===u.length,l.finished&&!e.allowAfter&&(r+1u&&c>0&&(h[h.length-1].elements=h[h.length-1].elements.concat(t[u].elements.slice(c)),c=0,u++),l=s.elements.slice(c,a.index).concat([o]).concat(i.elements.slice(1)),u===a.pathIndex&&r>0?h[h.length-1].elements=h[h.length-1].elements.concat(l):(h=h.concat(t.slice(u,a.pathIndex))).push(new He.Selector(l)),u=a.endPathIndex,(c=a.endPathElementIndex)>=t[u].elements.length&&(c=0,u++);return u0&&(h[h.length-1].elements=h[h.length-1].elements.concat(t[u].elements.slice(c)),u++),h=(h=h.concat(t.slice(u,t.length))).map((function(e){var t=e.createDerived(e.elements);return n?t.ensureVisibility():t.ensureInvisibility(),t}))},e.prototype.visitMedia=function(e,t){var i=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);i=i.concat(this.doExtendChaining(i,e.allExtends)),this.allExtendsStack.push(i)},e.prototype.visitMediaOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e.prototype.visitAtRule=function(e,t){var i=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);i=i.concat(this.doExtendChaining(i,e.allExtends)),this.allExtendsStack.push(i)},e.prototype.visitAtRuleOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e}(),K=function(){function e(){this.contexts=[[]],this._visitor=new N(this)}return e.prototype.run=function(e){return this._visitor.visit(e)},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){var i,n=this.contexts[this.contexts.length-1],r=[];this.contexts.push(r),e.root||((i=e.selectors)&&(i=i.filter((function(e){return e.getIsOutput()})),e.selectors=i.length?i:i=null,i&&e.joinSelectors(r,n,i)),i||(e.rules=null),e.paths=r)},e.prototype.visitRulesetOut=function(e){this.contexts.length=this.contexts.length-1},e.prototype.visitMedia=function(e,t){var i=this.contexts[this.contexts.length-1];e.rules[0].root=0===i.length||i[0].multiMedia},e.prototype.visitAtRule=function(e,t){var i=this.contexts[this.contexts.length-1];e.rules&&e.rules.length&&(e.rules[0].root=e.isRooted||0===i.length||null)},e}(),Z=function(){function e(e){this._visitor=new N(this),this._context=e}return e.prototype.containsSilentNonBlockedChild=function(e){var t;if(!e)return!1;for(var i=0;i0},e.prototype.resolveVisibility=function(e){if(!e.blocksVisibility()){if(this.isEmpty(e))return;return e}var t=e.rules[0];if(this.keepOnlyVisibleChilds(t),!this.isEmpty(t))return e.ensureVisibility(),e.removeVisibilityBlock(),e},e.prototype.isVisibleRuleset=function(e){return!!e.firstRoot||!this.isEmpty(e)&&!(!e.root&&!this.hasVisibleSelector(e))},e}(),X=function(e){this._visitor=new N(this),this._context=e,this.utils=new Z(e)};X.prototype={isReplacing:!0,run:function(e){return this._visitor.visit(e)},visitDeclaration:function(e,t){if(!e.blocksVisibility()&&!e.variable)return e},visitMixinDefinition:function(e,t){e.frames=[]},visitExtend:function(e,t){},visitComment:function(e,t){if(!e.blocksVisibility()&&!e.isSilent(this._context))return e},visitMedia:function(e,t){var i=e.rules[0].rules;return e.accept(this._visitor),t.visitDeeper=!1,this.utils.resolveVisibility(e,i)},visitImport:function(e,t){if(!e.blocksVisibility())return e},visitAtRule:function(e,t){return e.rules&&e.rules.length?this.visitAtRuleWithBody(e,t):this.visitAtRuleWithoutBody(e,t)},visitAnonymous:function(e,t){if(!e.blocksVisibility())return e.accept(this._visitor),e},visitAtRuleWithBody:function(e,t){var i=function(e){var t=e.rules;return function(e){var t=e.rules;return 1===t.length&&(!t[0].paths||0===t[0].paths.length)}(e)?t[0].rules:t}(e);return e.accept(this._visitor),t.visitDeeper=!1,this.utils.isEmpty(e)||this._mergeRules(e.rules[0].rules),this.utils.resolveVisibility(e,i)},visitAtRuleWithoutBody:function(e,t){if(!e.blocksVisibility()){if("@charset"===e.name){if(this.charset){if(e.debugInfo){var i=new He.Comment("/* "+e.toCSS(this._context).replace(/\n/g,"")+" */\n");return i.debugInfo=e.debugInfo,this._visitor.visit(i)}return}this.charset=!0}return e}},checkValidNodes:function(e,t){if(e)for(var i=0;i0?e.accept(this._visitor):e.rules=null,t.visitDeeper=!1}return e.rules&&(this._mergeRules(e.rules),this._removeDuplicateRules(e.rules)),this.utils.isVisibleRuleset(e)&&(e.ensureVisibility(),n.splice(0,0,e)),1===n.length?n[0]:n},_compileRulesetPaths:function(e){e.paths&&(e.paths=e.paths.filter((function(e){var t;for(" "===e[0].elements[0].combinator.value&&(e[0].elements[0].combinator=new He.Combinator("")),t=0;t=0;n--)if((i=e[n])instanceof He.Declaration)if(r[i.name]){(t=r[i.name])instanceof He.Declaration&&(t=r[i.name]=[r[i.name].toCSS(this._context)]);var s=i.toCSS(this._context);-1!==t.indexOf(s)?e.splice(n,1):t.push(s)}else r[i.name]=i}},_mergeRules:function(e){if(e){for(var t={},i=[],n=0;n0){var t=e[0],i=[],n=[new He.Expression(i)];e.forEach((function(e){"+"===e.merge&&i.length>0&&n.push(new He.Expression(i=[])),i.push(e.value),t.important=t.important||e.important})),t.value=new He.Value(n)}}))}}};var Y={Visitor:N,ImportVisitor:W,MarkVisibleSelectorsVisitor:J,ExtendVisitor:Q,JoinSelectorVisitor:K,ToCSSVisitor:X};var ee=function(){var e,t,i,n,r,s,o,a=[],l={};function u(i){for(var n,a,c,h=l.i,f=t,p=l.i-o,v=l.i+s.length-p,d=l.i+=i,m=e;l.i=0){c={index:l.i,text:m.substr(l.i,y+2-l.i),isLineComment:!1},l.i+=c.text.length-1,l.commentStore.push(c);continue}}break}if(32!==n&&10!==n&&9!==n&&13!==n)break}if(s=s.slice(i+l.i-d+p),o=l.i,!s.length){if(ti||l.i===i&&e&&!n)&&(i=l.i,n=e);var r=a.pop();s=r.current,o=l.i=r.i,t=r.j},l.forget=function(){a.pop()},l.isWhitespace=function(t){var i=l.i+(t||0),n=e.charCodeAt(i);return 32===n||13===n||9===n||10===n},l.$re=function(e){l.i>o&&(s=s.slice(l.i-o),o=l.i);var t=e.exec(s);return t?(u(t[0].length),"string"==typeof t?t:1===t.length?t[0]:t):null},l.$char=function(t){return e.charAt(l.i)!==t?null:(u(1),t)},l.$peekChar=function(t){return e.charAt(l.i)!==t?null:t},l.$str=function(t){for(var i=t.length,n=0;nh&&(d=!1)}}while(d);return r||null},l.autoCommentAbsorb=!0,l.commentStore=[],l.finished=!1,l.peek=function(t){if("string"==typeof t){for(var i=0;i57||t<43||47===t||44===t},l.start=function(n,a,c){e=n,l.i=t=o=i=0,r=a?function(e,t){var i,n,r,s,o,a,l,u,c,h=e.length,f=0,p=0,v=[],d=0;function m(t){var i=o-d;i<512&&!t||!i||(v.push(e.slice(d,o+1)),d=o+1)}for(o=0;o=97&&l<=122||l<34))switch(l){case 40:p++,n=o;continue;case 41:if(--p<0)return t("missing opening `(`",o);continue;case 59:p||m();continue;case 123:f++,i=o;continue;case 125:if(--f<0)return t("missing opening `{`",o);f||p||m();continue;case 92:if(o96)){if(u==l){c=1;break}if(92==u){if(o==h-1)return t("unescaped `\\`",o);o++}}if(c)continue;return t("unmatched `"+String.fromCharCode(l)+"`",a);case 47:if(p||o==h-1)continue;if(47==(u=e.charCodeAt(o+1)))for(o+=2;oi&&s>r?"missing closing `}` or `*/`":"missing closing `}`",i):0!==p?t("missing closing `)`",n):(m(!0),v)}(n,c):[n],s=r[0],u(0)},l.end=function(){var t,r=l.i>=e.length;return l.i=e.length-1,furthestChar:e[l.i]}},l};var te=function e(t){return{_data:{},add:function(e,t){e=e.toLowerCase(),this._data.hasOwnProperty(e),this._data[e]=t},addMultiple:function(e){var t=this;Object.keys(e).forEach((function(i){t.add(i,e[i])}))},get:function(e){return this._data[e]||t&&t.get(e)},getLocalFunctions:function(){return this._data},inherit:function(){return e(this)},create:function(t){return e(t)}}}(null),ie={queryInParens:!0},ne={queryInParens:!0},re=function e(t,i,n,r){var s;r=r||0;var o=ee();function a(e,t){throw new V({index:o.i,filename:n.filename,type:t||"Syntax",message:e},i)}function l(e,t){var i=e instanceof Function?e.call(s):o.$re(e);if(i)return i;a(t||("string"==typeof e?"expected '"+e+"' got '"+o.currentChar()+"'":"unexpected token"))}function u(e,t){if(o.$char(e))return e;a(t||"expected '"+e+"' got '"+o.currentChar()+"'")}function c(e){var t=n.filename;return{lineNumber:C(e,o.getInput()).line+1,fileName:t}}return{parserInput:o,imports:i,fileInfo:n,parseNode:function(e,t,a){var l,u=[],c=o;try{c.start(e,!1,(function(e,t){a({message:e,index:t+r})}));for(var h=0,f=void 0;f=t[h];h++)l=s[f](),u.push(l||null);c.end().isFinished?a(null,u):a(!0,null)}catch(e){throw new V({index:e.index+r,message:e.message},i,n.filename)}},parse:function(r,l,u){var c,h,f,p,v=null,d="";if(u&&u.disablePluginRule&&(s.plugin=function(){o.$re(/^@plugin?\s+/)&&a("@plugin statements are not allowed when disablePluginRule is set to true")}),h=u&&u.globalVars?e.serializeVars(u.globalVars)+"\n":"",f=u&&u.modifyVars?"\n"+e.serializeVars(u.modifyVars):"",t.pluginManager)for(var m=t.pluginManager.getPreProcessors(),g=0;g");return e},args:function(e){var t,i,n,r,l,u,c,h=s.entities,f={args:null,variadic:!1},p=[],v=[],d=[],m=!0;for(o.save();;){if(e)u=s.detachedRuleset()||s.expression();else{if(o.commentStore.length=0,o.$str("...")){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({variadic:!0});break}u=h.variable()||h.property()||h.literal()||h.keyword()||this.call(!0)}if(!u||!m)break;r=null,u.throwAwayComments&&u.throwAwayComments(),l=u;var g=null;if(e?u.value&&1==u.value.length&&(g=u.value[0]):g=u,g&&(g instanceof He.Variable||g instanceof He.Property))if(o.$char(":")){if(p.length>0&&(t&&a("Cannot mix ; and , as delimiter types"),i=!0),!(l=s.detachedRuleset()||s.expression())){if(!e)return o.restore(),f.args=[],f;a("could not understand value for named argument")}r=n=g.name}else if(o.$str("...")){if(!e){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({name:u.name,variadic:!0});break}c=!0}else e||(n=r=g.name,l=null);l&&p.push(l),d.push({name:r,value:l,expand:c}),o.$char(",")?m=!0:((m=";"===o.$char(";"))||t)&&(i&&a("Cannot mix ; and , as delimiter types"),t=!0,p.length>1&&(l=new He.Value(p)),v.push({name:n,value:l,expand:c}),n=null,p=[],i=!1)}return o.forget(),f.args=t?v:d,f},definition:function(){var e,t,i,n,r=[],a=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),t=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){e=t[1];var u=this.args(!1);if(r=u.args,a=u.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(n=l(s.conditions,"expected condition")),i=s.block())return o.forget(),new He.mixin.Definition(e,r,i,n,a);o.restore()}else o.restore()},ruleLookups:function(){var e,t=[];if("["===o.currentChar()){for(;;){if(o.save(),!(e=this.lookupValue())&&""!==e){o.restore();break}t.push(e),o.forget()}return t.length>0?t:void 0}},lookupValue:function(){if(o.save(),o.$char("[")){var e=o.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);if(o.$char("]"))return e||""===e?(o.forget(),e):void o.restore();o.restore()}else o.restore()}},entity:function(){var e=this.entities;return this.comment()||e.literal()||e.variable()||e.url()||e.property()||e.call()||e.keyword()||this.mixin.call(!0)||e.javascript()},end:function(){return o.$char(";")||o.peek("}")},ieAlpha:function(){var e;if(o.$re(/^opacity=/i))return(e=o.$re(/^\d+/))||(e="@{"+(e=l(s.entities.variable,"Could not parse alpha")).name.slice(1)+"}"),u(")"),new He.Quoted("","alpha(opacity="+e+")")},element:function(){var e,t,i,s=o.i;if(t=this.combinator(),(e=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[.#:](?=@)/)||this.entities.variableCurly())||(o.save(),o.$char("(")?(i=this.selector(!1))&&o.$char(")")?(e=new He.Paren(i),o.forget()):o.restore("Missing closing ')'"):o.forget()),e)return new He.Element(t,e,e instanceof He.Variable,s+r,n)},combinator:function(){var e=o.currentChar();if("/"===e){o.save();var t=o.$re(/^\/[a-z]+\//i);if(t)return o.forget(),new He.Combinator(t);o.restore()}if(">"===e||"+"===e||"~"===e||"|"===e||"^"===e){for(o.i++,"^"===e&&"^"===o.currentChar()&&(e="^^",o.i++);o.isWhitespace();)o.i++;return new He.Combinator(e)}return o.isWhitespace(-1)?new He.Combinator(" "):new He.Combinator(null)},selector:function(e){var t,i,s,u,c,h,f,p=o.i;for(e=!1!==e;(e&&(i=this.extend())||e&&(h=o.$str("when"))||(u=this.element()))&&(h?f=l(this.conditions,"expected condition"):f?a("CSS guard can only be used at the end of selector"):i?c=c?c.concat(i):i:(c&&a("Extend can only be used at the end of selector"),s=o.currentChar(),t?t.push(u):t=[u],u=null),"{"!==s&&"}"!==s&&";"!==s&&","!==s&&")"!==s););if(t)return new He.Selector(t,c,f,p+r,n);c&&a("Extend must be used to extend a selector, it cannot be used on its own")},selectors:function(){for(var e,t;(e=this.selector())&&(t?t.push(e):t=[e],o.commentStore.length=0,e.condition&&t.length>1&&a("Guards are only currently allowed on a single selector."),o.$char(","));)e.condition&&a("Guards are only currently allowed on a single selector."),o.commentStore.length=0;return t},attribute:function(){if(o.$char("[")){var e,t,i,n,r=this.entities;return(e=r.variableCurly())||(e=l(/^(?:[_A-Za-z0-9-*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),(i=o.$re(/^[|~*$^]?=/))&&(t=r.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||r.variableCurly())&&(n=o.$re(/^[iIsS]/)),u("]"),new He.Attribute(e,i,t,n)}},block:function(){var e;if(o.$char("{")&&(e=this.primary())&&o.$char("}"))return e},blockRuleset:function(){var e=this.block();return e&&(e=new He.Ruleset(null,e)),e},detachedRuleset:function(){var e,t,i;if(o.save(),!o.$re(/^[.#]\(/)||(t=(e=this.mixin.args(!1)).args,i=e.variadic,o.$char(")"))){var n=this.blockRuleset();if(n)return o.forget(),t?new He.mixin.Definition(null,t,n,null,i):new He.DetachedRuleset(n);o.restore()}else o.restore()},ruleset:function(){var e,i,n;if(o.save(),t.dumpLineNumbers&&(n=c(o.i)),(e=this.selectors())&&(i=this.block())){o.forget();var r=new He.Ruleset(e,i,t.strictImports);return t.dumpLineNumbers&&(r.debugInfo=n),r}o.restore()},declaration:function(){var e,t,i,s,a,l,u=o.i,c=o.currentChar();if("."!==c&&"#"!==c&&"&"!==c&&":"!==c)if(o.save(),e=this.variable()||this.ruleProperty()){if((l="string"==typeof e)&&(t=this.detachedRuleset())&&(i=!0),o.commentStore.length=0,!t){if(a=!l&&e.length>1&&e.pop().value,t=e[0].value&&"--"===e[0].value.slice(0,2)?this.permissiveValue(/[;}]/):this.anonymousValue())return o.forget(),new He.Declaration(e,t,!1,a,u+r,n);t||(t=this.value()),t?s=this.important():l&&(t=this.permissiveValue())}if(t&&(this.end()||i))return o.forget(),new He.Declaration(e,t,s,a,u+r,n);o.restore()}else o.restore()},anonymousValue:function(){var e=o.i,t=o.$re(/^([^.#@$+/'"*`(;{}-]*);/);if(t)return new He.Anonymous(t[1],e+r)},permissiveValue:function(e){var t,i,r,s,l=e||";",u=o.i,c=[];function h(){var e=o.currentChar();return"string"==typeof l?e===l:l.test(e)}if(!h()){s=[];do{((i=this.comment())||(i=this.entity()))&&s.push(i)}while(i);if(r=h(),s.length>0){if(s=new He.Expression(s),r)return s;c.push(s)," "===o.prevChar()&&c.push(new He.Anonymous(" ",u))}if(o.save(),s=o.$parseUntil(l)){if("string"==typeof s&&a("Expected '"+s+"'","Parse"),1===s.length&&" "===s[0])return o.forget(),new He.Anonymous("",u);var f=void 0;for(t=0;t]=|<=|>=|[<>]|=)/)?(o.restore(),i=this.condition(),o.save(),(s=this.atomicCondition(null,i.rvalue))||o.restore()):(o.restore(),t=this.value()),o.$char(")")?i&&!t?(u.push(new He.Paren(new He.QueryInParens(i.op,i.lvalue,i.rvalue,s?s.op:null,s?s.rvalue:null,i._index))),t=i):i&&t?u.push(new He.Paren(new He.Declaration(i,t,null,null,o.i+r,n,!0))):t?u.push(new He.Paren(t)):a("badly formed media feature definition"):a("Missing closing ')'","Parse"))}while(t);if(o.forget(),u.length>0)return new He.Expression(u)},mediaFeatures:function(e){var t,i=this.entities,n=[];do{if(t=this.mediaFeature(e)){if(n.push(t),!o.$char(","))break}else if((t=i.variable()||i.mixinLookup())&&(n.push(t),!o.$char(",")))break}while(t);return n.length>0?n:null},prepareAndGetNestableAtRule:function(e,i,s,l){var u=this.mediaFeatures(l),c=this.block();c||a("media definitions require block statements after any features"),o.forget();var h=new e(c,u,i+r,n);return t.dumpLineNumbers&&(h.debugInfo=s),h},nestableAtRule:function(){var e,i=o.i;if(t.dumpLineNumbers&&(e=c(i)),o.save(),o.$peekChar("@")){if(o.$str("@media"))return this.prepareAndGetNestableAtRule(He.Media,i,e,ie);if(o.$str("@container"))return this.prepareAndGetNestableAtRule(He.Container,i,e,ne)}o.restore()},plugin:function(){var e,t,i,s=o.i;if(o.$re(/^@plugin\s+/)){if(i=(t=this.pluginArgs())?{pluginArgs:t,isPlugin:!0}:{isPlugin:!0},e=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=s,a("missing semi-colon on @plugin")),new He.Import(e,null,i,s+r,n);o.i=s,a("malformed @plugin statement")}},pluginArgs:function(){if(o.save(),!o.$char("("))return o.restore(),null;var e=o.$re(/^\s*([^);]+)\)\s*/);return e[1]?(o.forget(),e[1].trim()):(o.restore(),null)},atrule:function(){var e,i,s,l,u,h,f,p=o.i,v=!0,d=!0;if("@"===o.currentChar()){if(i=this.import()||this.plugin()||this.nestableAtRule())return i;if(o.save(),e=o.$re(/^@[a-z-]+/)){switch(l=e,"-"==e.charAt(1)&&e.indexOf("-",2)>0&&(l="@"+e.slice(e.indexOf("-",2)+1)),l){case"@charset":u=!0,v=!1;break;case"@namespace":h=!0,v=!1;break;case"@keyframes":case"@counter-style":u=!0;break;case"@document":case"@supports":f=!0,d=!1;break;default:f=!0}if(o.commentStore.length=0,u?(i=this.entity())||a("expected "+e+" identifier"):h?(i=this.expression())||a("expected "+e+" expression"):f&&(i=this.permissiveValue(/^[{;]/),v="{"===o.currentChar(),i?i.value||(i=null):v||";"===o.currentChar()||a(e+" rule is missing block or ending semi-colon")),v&&(s=this.blockRuleset()),s||!v&&i&&o.$char(";"))return o.forget(),new He.AtRule(e,i,s,p+r,n,t.dumpLineNumbers?c(p):null,d);o.restore("at-rule options not recognised")}}},value:function(){var e,t=[],i=o.i;do{if((e=this.expression())&&(t.push(e),!o.$char(",")))break}while(e);if(t.length>0)return new He.Value(t,i+r)},important:function(){if("!"===o.currentChar())return o.$re(/^! *important/)},sub:function(){var e,t;if(o.save(),o.$char("("))return(e=this.addition())&&o.$char(")")?(o.forget(),(t=new He.Expression([e])).parens=!0,t):void o.restore("Expected ')'");o.restore()},multiplication:function(){var e,t,i,n,r;if(e=this.operand()){for(r=o.isWhitespace(-1);!o.peek(/^\/[*/]/);){if(o.save(),!(i=o.$char("/")||o.$char("*")||o.$str("./"))){o.forget();break}if(!(t=this.operand())){o.restore();break}o.forget(),e.parensInOp=!0,t.parensInOp=!0,n=new He.Operation(i,[n||e,t],r),r=o.isWhitespace(-1)}return n||e}},addition:function(){var e,t,i,n,r;if(e=this.multiplication()){for(r=o.isWhitespace(-1);(i=o.$re(/^[-+]\s+/)||!r&&(o.$char("+")||o.$char("-")))&&(t=this.multiplication());)e.parensInOp=!0,t.parensInOp=!0,n=new He.Operation(i,[n||e,t],r),r=o.isWhitespace(-1);return n||e}},conditions:function(){var e,t,i,n=o.i;if(e=this.condition(!0)){for(;o.peek(/^,\s*(not\s*)?\(/)&&o.$char(",")&&(t=this.condition(!0));)i=new He.Condition("or",i||e,t,n+r);return i||e}},condition:function(e){var t,i,n;if(t=this.conditionAnd(e)){if(i=o.$str("or")){if(!(n=this.condition(e)))return;t=new He.Condition(i,t,n)}return t}},conditionAnd:function(e){var t,i,n,r,s=this;if(t=(r=s.negatedCondition(e)||s.parenthesisCondition(e))||e?r:s.atomicCondition(e)){if(i=o.$str("and")){if(!(n=this.conditionAnd(e)))return;t=new He.Condition(i,t,n)}return t}},negatedCondition:function(e){if(o.$str("not")){var t=this.parenthesisCondition(e);return t&&(t.negate=!t.negate),t}},parenthesisCondition:function(e){var t;if(o.save(),o.$str("(")){if(t=function(t){var i;if(o.save(),i=t.condition(e)){if(o.$char(")"))return o.forget(),i;o.restore()}else o.restore()}(this))return o.forget(),t;if(t=this.atomicCondition(e)){if(o.$char(")"))return o.forget(),t;o.restore("expected ')' got '"+o.currentChar()+"'")}else o.restore()}else o.restore()},atomicCondition:function(e,t){var i,n,s,l,u=this.entities,c=o.i,h=function(){return this.addition()||u.keyword()||u.quoted()||u.mixinLookup()}.bind(this);if(i=t||h())return o.$char(">")?l=o.$char("=")?">=":">":o.$char("<")?l=o.$char("=")?"<=":"<":o.$char("=")&&(l=o.$char(">")?"=>":o.$char("<")?"=<":"="),l?(n=h())?s=new He.Condition(l,i,n,c+r,!1):a("expected expression"):t||(s=new He.Condition("=",i,new He.Keyword("true"),c+r,!1)),s},operand:function(){var e,t=this.entities;o.peek(/^-[@$(]/)&&(e=o.$char("-"));var i=this.sub()||t.dimension()||t.color()||t.variable()||t.property()||t.call()||t.quoted(!0)||t.colorKeyword()||t.mixinLookup();return e&&(i.parensInOp=!0,i=new He.Negative(i)),i},expression:function(){var e,t,i=[],n=o.i;do{(e=this.comment())?i.push(e):((e=this.addition()||this.entity())instanceof He.Comment&&(e=null),e&&(i.push(e),o.peek(/^\/[/*]/)||(t=o.$char("/"))&&i.push(new He.Anonymous(t,n+r))))}while(e);if(i.length>0)return new He.Expression(i)},property:function(){var e=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(e)return e[1]},ruleProperty:function(){var e,t,i=[],s=[];o.save();var a=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(a)return i=[new He.Keyword(a[1])],o.forget(),i;function l(e){var t=o.i,n=o.$re(e);if(n)return s.push(t),i.push(n[1])}for(l(/^(\*?)/);l(/^((?:[\w-]+)|(?:[@$]\{[\w-]+\}))/););if(i.length>1&&l(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===i[0]&&(i.shift(),s.shift()),t=0;t0;e--){var t=this.rules[e-1];if(t instanceof ce)return this.parseValue(t)}},parseValue:function(e){var t=this;function i(e){return e.value instanceof le&&!e.parsed?("string"==typeof e.value.value?new re(this.parse.context,this.parse.importManager,e.fileInfo(),e.value.getIndex()).parseNode(e.value.value,["value","important"],(function(t,i){t&&(e.parsed=!0),i&&(e.value=i[0],e.important=i[1]||"",e.parsed=!0)})):e.parsed=!0,e):e}if(Array.isArray(e)){var n=[];return e.forEach((function(e){n.push(i.call(t,e))})),n}return i.call(t,e)},rulesets:function(){if(!this.rules)return[];var e,t,i=[],n=this.rules;for(e=0;t=n[e];e++)t.isRuleset&&i.push(t);return i},prependRule:function(e){var t=this.rules;t?t.unshift(e):this.rules=[e],this.setParent(e,this)},find:function(e,t,i){t=t||this;var n,r,s=[],o=e.toCSS();return o in this._lookups?this._lookups[o]:(this.rulesets().forEach((function(o){if(o!==t)for(var a=0;an){if(!i||i(o)){r=o.find(new se(e.elements.slice(n)),t,i);for(var l=0;l0&&t.add(l),e.firstSelector=!0,o[0].genCSS(e,t),e.firstSelector=!1,n=1;n0?(s=(r=k(e)).pop(),o=n.createDerived(k(s.elements))):o=n.createDerived([]),t.length>0){var a=i.combinator,l=t[0].elements[0];a.emptyOrWhitespace&&!l.combinator.emptyOrWhitespace&&(a=l.combinator),o.elements.push(new m(a,l.value,i.isVariable,i._index,i._fileInfo)),o.elements=o.elements.concat(t[0].elements.slice(1))}if(0!==o.elements.length&&r.push(o),t.length>1){var u=t.slice(1);u=u.map((function(e){return e.createDerived(e.elements,[])})),r=r.concat(u)}return r}function o(e,t,i,n,r){var o;for(o=0;o0?n[n.length-1]=n[n.length-1].createDerived(n[n.length-1].elements.concat(e)):n.push(new se(e));else t.push([new se(e)])}function l(e,t){var i=t.createDerived(t.elements,t.extendList,t.evaldCondition);return i.copyVisibilityInfo(e),i}var u,c;if(!function e(t,i,l){var u,c,h,f,v,d,g,y,b,w,x,S,I=!1;for(f=[],v=[[]],u=0;y=l.elements[u];u++)if("&"!==y.value){var C=(S=void 0,(x=y).value instanceof p&&(S=x.value.value)instanceof se?S:null);if(null!==C){a(f,v);var k,_=[],A=[];for(k=e(_,i,C),I=I||k,h=0;h<_.length;h++){o(v,[r(n(_[h],y),y)],y,l,A)}v=A,f=[]}else f.push(y)}else{for(I=!0,d=[],a(f,v),c=0;c0&&g[0].elements.push(new m(y.combinator,"",y.isVariable,y._index,y._fileInfo)),d.push(g);else for(h=0;h0&&(t.push(v[u]),w=v[u][b-1],v[u][b-1]=w.createDerived(w.elements,l.extendList));return I}(c=[],t,i))if(t.length>0)for(c=[],u=0;u0)for(t=0;t-1e-6&&(n=i.toFixed(20).replace(/0+$/,"")),e&&e.compress){if(0===i&&this.unit.isLength())return void t.add(n);i>0&&i<1&&(n=n.substr(1))}t.add(n),this.unit.genCSS(e,t)},operate:function(e,t,i){var n=this._operate(e,t,this.value,i.value),r=this.unit.clone();if("+"===t||"-"===t)if(0===r.numerator.length&&0===r.denominator.length)r=i.unit.clone(),this.unit.backupUnit&&(r.backupUnit=this.unit.backupUnit);else if(0===i.unit.numerator.length&&0===r.denominator.length);else{if(i=i.convertTo(this.unit.usedUnits()),e.strictUnits&&i.unit.toString()!==r.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+r.toString()+"' and '"+i.unit.toString()+"'.");n=this._operate(e,t,this.value,i.value)}else"*"===t?(r.numerator=r.numerator.concat(i.unit.numerator).sort(),r.denominator=r.denominator.concat(i.unit.denominator).sort(),r.cancel()):"/"===t&&(r.numerator=r.numerator.concat(i.unit.denominator).sort(),r.denominator=r.denominator.concat(i.unit.numerator).sort(),r.cancel());return new we(n,r)},compare:function(e){var t,i;if(e instanceof we){if(this.unit.isEmpty()||e.unit.isEmpty())t=this,i=e;else if(t=this.unify(),i=e.unify(),0!==t.unit.compare(i.unit))return;return u.numericCompare(t.value,i.value)}},unify:function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},convertTo:function(e){var t,i,n,r,s,o=this.value,l=this.unit.clone(),u={};if("string"==typeof e){for(t in a)a[t].hasOwnProperty(e)&&((u={})[t]=e);e=u}for(i in s=function(e,t){return n.hasOwnProperty(e)?(t?o/=n[e]/n[r]:o*=n[e]/n[r],r):e},e)e.hasOwnProperty(i)&&(r=e[i],n=a[i],l.map(s));return l.cancel(),new we(o,l)}});var xe=g,Se=function(e,t,i){this.op=e.trim(),this.operands=t,this.isSpaced=i};Se.prototype=Object.assign(new u,{type:"Operation",accept:function(e){this.operands=e.visitArray(this.operands)},eval:function(e){var t,i=this.operands[0].eval(e),n=this.operands[1].eval(e);if(e.isMathOn(this.op)){if(t="./"===this.op?"/":this.op,i instanceof we&&n instanceof c&&(i=i.toColor()),n instanceof we&&i instanceof c&&(n=n.toColor()),!i.operate||!n.operate){if((i instanceof Se||n instanceof Se)&&"/"===i.op&&e.math===xe.PARENS_DIVISION)return new Se(this.op,[i,n],this.isSpaced);throw{type:"Operation",message:"Operation on an invalid type"}}return i.operate(e,t,n)}return new Se(this.op,[i,n],this.isSpaced)},genCSS:function(e,t){this.operands[0].genCSS(e,t),this.isSpaced&&t.add(" "),t.add(this.op),this.isSpaced&&t.add(" "),this.operands[1].genCSS(e,t)}});var Ie=function(){return(Ie=Object.assign||function(e){for(var t,i=1,n=arguments.length;i1?t=new Ce(this.value.map((function(t){return t.eval?t.eval(e):t})),this.noSpacing):1===this.value.length?(!this.value[0].parens||this.value[0].parensInOp||e.inCalc||(r=!0),t=this.value[0].eval(e)):t=this,n&&e.outOfParenthesis(),!this.parens||!this.parensInOp||i||r||t instanceof we||(t=new p(t)),t},genCSS:function(e,t){for(var i=0;i1){var i=new se([],null,null,this.getIndex(),this.fileInfo()).createEmptySelectors();(t=new me(i,e.mediaBlocks)).multiMedia=!0,t.copyVisibilityInfo(this.visibilityInfo()),this.setParent(t,this)}return delete e.mediaBlocks,delete e.mediaPath,t},evalNested:function(e){var t,i,n=e.mediaPath.concat([this]);for(t=0;t0;t--)e.splice(t,0,new le("and"));return new Ce(e)}))),this.setParent(this.features,this),new me([],[])},permute:function(e){if(0===e.length)return[];if(1===e.length)return e[0];for(var t=[],i=this.permute(e.slice(1)),n=0;n1?"["+e.value.map((function(e){return e.toCSS()})).join(", ")+"]":e.toCSS()}});var Le=function(e,t,i,n){this.escaped=t,this.expression=e,this._index=i,this._fileInfo=n};Le.prototype=Object.assign(new $e,{type:"JavaScript",eval:function(e){var t=this.evaluateJavaScript(this.expression,e),i=typeof t;return"number"!==i||isNaN(t)?"string"===i?new Ee('"'+t+'"',t,this.escaped,this._index):Array.isArray(t)?new le(t.join(", ")):new le(t):new we(t)}});var je=function(e,t){this.key=e,this.value=t};je.prototype=Object.assign(new u,{type:"Assignment",accept:function(e){this.value=e.visit(this.value)},eval:function(e){return this.value.eval?new je(this.key,this.value.eval(e)):this},genCSS:function(e,t){t.add(this.key+"="),this.value.genCSS?this.value.genCSS(e,t):t.add(this.value)}});var Ne=function(e,t,i,n,r){this.op=e.trim(),this.lvalue=t,this.rvalue=i,this._index=n,this.negate=r};Ne.prototype=Object.assign(new u,{type:"Condition",accept:function(e){this.lvalue=e.visit(this.lvalue),this.rvalue=e.visit(this.rvalue)},eval:function(e){var t=function(e,t,i){switch(e){case"and":return t&&i;case"or":return t||i;default:switch(u.compare(t,i)){case-1:return"<"===e||"=<"===e||"<="===e;case 0:return"="===e||">="===e||"=<"===e||"<="===e;case 1:return">"===e||">="===e;default:return!1}}}(this.op,this.lvalue.eval(e),this.rvalue.eval(e));return this.negate?!t:t}});var De=function(e,t,i,n,r,s){this.op=e.trim(),this.lvalue=t,this.mvalue=i,this.op2=n?n.trim():null,this.rvalue=r,this._index=s};De.prototype=Object.assign(new u,{type:"QueryInParens",accept:function(e){this.lvalue=e.visit(this.lvalue),this.mvalue=e.visit(this.mvalue),this.rvalue&&(this.rvalue=e.visit(this.rvalue))},eval:function(e){return this.lvalue=this.lvalue.eval(e),this.mvalue=this.mvalue.eval(e),this.rvalue&&(this.rvalue=this.rvalue.eval(e)),this},genCSS:function(e,t){this.lvalue.genCSS(e,t),t.add(" "+this.op+" "),this.mvalue.genCSS(e,t),this.rvalue&&(t.add(" "+this.op2+" "),this.rvalue.genCSS(e,t))}});var Be=function(e,t,i,n,r){this._index=i,this._fileInfo=n;var s=new se([],null,null,this._index,this._fileInfo).createEmptySelectors();this.features=new oe(t),this.rules=[new me(s,e)],this.rules[0].allowImports=!0,this.copyVisibilityInfo(r),this.allowRoot=!0,this.setParent(s,this),this.setParent(this.features,this),this.setParent(this.rules,this)};Be.prototype=Object.assign(new ge,Ie(Ie({type:"Container"},Oe),{genCSS:function(e,t){t.add("@container ",this._fileInfo,this._index),this.features.genCSS(e,t),this.outputRuleset(e,t,this.rules)},eval:function(e){e.mediaBlocks||(e.mediaBlocks=[],e.mediaPath=[]);var t=new Be(null,[],this._index,this._fileInfo,this.visibilityInfo());return this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,t.debugInfo=this.debugInfo),t.features=this.features.eval(e),e.mediaPath.push(t),e.mediaBlocks.push(t),this.rules[0].functionRegistry=e.frames[0].functionRegistry.inherit(),e.frames.unshift(this.rules[0]),t.rules=[this.rules[0].eval(e)],e.frames.shift(),e.mediaPath.pop(),0===e.mediaPath.length?t.evalTop(e):t.evalNested(e)}}));var Ue=function(e){this.value=e};Ue.prototype=Object.assign(new u,{type:"UnicodeDescriptor"});var qe=function(e){this.value=e};qe.prototype=Object.assign(new u,{type:"Negative",genCSS:function(e,t){t.add("-"),this.value.genCSS(e,t)},eval:function(e){return e.isMathOn()?new Se("*",[new we(-1),this.value]).eval(e):new qe(this.value.eval(e))}});var Te=function(e,t,i,n,r){switch(this.selector=e,this.option=t,this.object_id=Te.next_id++,this.parent_ids=[this.object_id],this._index=i,this._fileInfo=n,this.copyVisibilityInfo(r),this.allowRoot=!0,t){case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}this.setParent(this.selector,this)};Te.prototype=Object.assign(new u,{type:"Extend",accept:function(e){this.selector=e.visit(this.selector)},eval:function(e){return new Te(this.selector.eval(e),this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},clone:function(e){return new Te(this.selector,this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},findSelfSelectors:function(e){var t,i,n=[];for(t=0;t0&&i.length&&""===i[0].combinator.value&&(i[0].combinator.value=" "),n=n.concat(e[t].elements);this.selfSelectors=[new se(n)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())}}),Te.next_id=0;var ze=function(e,t,i){this.variable=e,this._index=t,this._fileInfo=i,this.allowRoot=!0};ze.prototype=Object.assign(new u,{type:"VariableCall",eval:function(e){var t,i=new Ae(this.variable,this.getIndex(),this.fileInfo()).eval(e),n=new V({message:"Could not evaluate variable call "+this.variable});if(!i.ruleset){if(i.rules)t=i;else if(Array.isArray(i))t=new me("",i);else{if(!Array.isArray(i.value))throw n;t=new me("",i.value)}i=new ye(t)}if(i.ruleset)return i.callEval(e);throw n}});var Ge=function(e,t,i,n){this.value=e,this.lookups=t,this._index=i,this._fileInfo=n};Ge.prototype=Object.assign(new u,{type:"NamespaceValue",eval:function(e){var t,i,n=this.value.eval(e);for(t=0;tthis.params.length)return!1}i=Math.min(s,this.arity);for(var o=0;o0){for(c=!0,a=0;a0)f=2;else if(f=1,p[1]+p[2]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(m)+"`",index:this.getIndex(),filename:this.fileInfo().filename};for(a=0;a0&&(e=e.slice(0,t)),(t=e.lastIndexOf("/"))<0&&(t=e.lastIndexOf("\\")),t<0?"":e.slice(0,t+1)},e.prototype.tryAppendExtension=function(e,t){return/(\.[a-z]*$)|([?;].*)$/.test(e)?e:e+t},e.prototype.tryAppendLessExtension=function(e){return this.tryAppendExtension(e,".less")},e.prototype.supportsSync=function(){return!1},e.prototype.alwaysMakePathsAbsolute=function(){return!1},e.prototype.isPathAbsolute=function(e){return/^(?:[a-z-]+:|\/|\\|#)/i.test(e)},e.prototype.join=function(e,t){return e?e+t:t},e.prototype.pathDiff=function(e,t){var i,n,r,s,o=this.extractUrlParts(e),a=this.extractUrlParts(t),l="";if(o.hostPart!==a.hostPart)return"";for(n=Math.max(a.directories.length,o.directories.length),i=0;iparseInt(t[i])?-1:1;return 0},e.prototype.versionToString=function(e){for(var t="",i=0;i1?e-1:e)<1?r+(s-r)*e*6:2*e<1?s:3*e<2?r+(s-r)*(2/3-e)*6:r}try{if(e instanceof c)return n=t?st(t):e.alpha,new c(e.rgb,n,"hsla");e=st(e)%360/360,t=tt(st(t)),i=tt(st(i)),n=tt(st(n)),r=2*i-(s=i<=.5?i*(t+1):i+t-i*t);var a=[255*o(e+1/3),255*o(e),255*o(e-1/3)];return n=st(n),new c(a,n,"hsla")}catch(e){}},hsv:function(e,t,i){return Ye.hsva(e,t,i,1)},hsva:function(e,t,i,n){var r,s;e=st(e)%360/360*360,t=st(t),i=st(i),n=st(n);var o=[i,i*(1-t),i*(1-(s=e/60-(r=Math.floor(e/60%6)))*t),i*(1-(1-s)*t)],a=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return Ye.rgba(255*o[a[r][0]],255*o[a[r][1]],255*o[a[r][2]],n)},hue:function(e){return new we(nt(e).h)},saturation:function(e){return new we(100*nt(e).s,"%")},lightness:function(e){return new we(100*nt(e).l,"%")},hsvhue:function(e){return new we(rt(e).h)},hsvsaturation:function(e){return new we(100*rt(e).s,"%")},hsvvalue:function(e){return new we(100*rt(e).v,"%")},red:function(e){return new we(e.rgb[0])},green:function(e){return new we(e.rgb[1])},blue:function(e){return new we(e.rgb[2])},alpha:function(e){return new we(nt(e).a)},luma:function(e){return new we(e.luma()*e.alpha*100,"%")},luminance:function(e){var t=.2126*e.rgb[0]/255+.7152*e.rgb[1]/255+.0722*e.rgb[2]/255;return new we(t*e.alpha*100,"%")},saturate:function(e,t,i){if(!e.rgb)return null;var n=nt(e);return void 0!==i&&"relative"===i.value?n.s+=n.s*t.value/100:n.s+=t.value/100,n.s=tt(n.s),it(e,n)},desaturate:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.s-=n.s*t.value/100:n.s-=t.value/100,n.s=tt(n.s),it(e,n)},lighten:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.l+=n.l*t.value/100:n.l+=t.value/100,n.l=tt(n.l),it(e,n)},darken:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.l-=n.l*t.value/100:n.l-=t.value/100,n.l=tt(n.l),it(e,n)},fadein:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.a+=n.a*t.value/100:n.a+=t.value/100,n.a=tt(n.a),it(e,n)},fadeout:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.a-=n.a*t.value/100:n.a-=t.value/100,n.a=tt(n.a),it(e,n)},fade:function(e,t){var i=nt(e);return i.a=t.value/100,i.a=tt(i.a),it(e,i)},spin:function(e,t){var i=nt(e),n=(i.h+t.value)%360;return i.h=n<0?360+n:n,it(e,i)},mix:function(e,t,i){i||(i=new we(50));var n=i.value/100,r=2*n-1,s=nt(e).a-nt(t).a,o=((r*s==-1?r:(r+s)/(1+r*s))+1)/2,a=1-o,l=[e.rgb[0]*o+t.rgb[0]*a,e.rgb[1]*o+t.rgb[1]*a,e.rgb[2]*o+t.rgb[2]*a],u=e.alpha*n+t.alpha*(1-n);return new c(l,u)},greyscale:function(e){return Ye.desaturate(e,new we(100))},contrast:function(e,t,i,n){if(!e.rgb)return null;if(void 0===i&&(i=Ye.rgba(255,255,255,1)),void 0===t&&(t=Ye.rgba(0,0,0,1)),t.luma()>i.luma()){var r=i;i=t,t=r}return n=void 0===n?.43:st(n),e.luma().5&&(n=1,i=e>.25?Math.sqrt(e):((16*e-12)*e+4)*e),e-(1-2*t)*n*(i-e)},hardlight:function(e,t){return lt.overlay(t,e)},difference:function(e,t){return Math.abs(e-t)},exclusion:function(e,t){return e+t-2*e*t},average:function(e,t){return(e+t)/2},negation:function(e,t){return 1-Math.abs(e+t-1)}};for(var ut in lt)lt.hasOwnProperty(ut)&&(at[ut]=at.bind(null,lt[ut]));var ct=function(e){return Array.isArray(e.value)?e.value:Array(e)},ht={_SELF:function(e){return e},"~":function(){for(var e=[],t=0;to.value)&&(h[n]=r);else{if(void 0!==l&&a!==l)throw{type:"Argument",message:"incompatible types"};f[a]=h.length,h.push(r)}else Array.isArray(t[i].value)&&Array.prototype.push.apply(t,Array.prototype.slice.call(t[i].value));return 1==h.length?h[0]:(t=h.map((function(e){return e.toCSS(c.context)})).join(this.context.compress?",":", "),new le((e?"min":"max")+"("+t+")"))},mt={min:function(){for(var e=[],t=0;t<'+u+'Gradient id="g" '+i+">",r=0;r";return n+=""+u+"Gradient>',n=encodeURIComponent(n),new Re(new Ee("'"+(n="data:image/svg+xml,"+n)+"'",n,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)}}),te.addMultiple(wt),t};function St(e,t){var i,n=(t=t||{}).variables,r=new D.Eval(t);"object"!=typeof n||Array.isArray(n)||(n=Object.keys(n).map((function(e){var t=n[e];return t instanceof He.Value||(t instanceof He.Expression||(t=new He.Expression([t])),t=new He.Value([t])),new He.Declaration("@"+e,t,!1,null,0)})),r.frames=[new He.Ruleset(null,n)]);var s,o,a=[new Y.JoinSelectorVisitor,new Y.MarkVisibleSelectorsVisitor(!0),new Y.ExtendVisitor,new Y.ToCSSVisitor({compress:Boolean(t.compress)})],l=[];if(t.pluginManager){o=t.pluginManager.visitor();for(var u=0;u<2;u++)for(o.first();s=o.get();)s.isPreEvalVisitor?0!==u&&-1!==l.indexOf(s)||(l.push(s),s.run(e)):0!==u&&-1!==a.indexOf(s)||(s.isPreVisitor?a.unshift(s):a.push(s))}i=e.eval(r);for(var c=0;c=t);i++);this.preProcessors.splice(i,0,{preProcessor:e,priority:t})},e.prototype.addPostProcessor=function(e,t){var i;for(i=0;i=t);i++);this.postProcessors.splice(i,0,{postProcessor:e,priority:t})},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.getPreProcessors=function(){for(var e=[],t=0;t0){var n=void 0,r=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?n=this.sourceMapURL:this._sourceMapFilename&&(n=this._sourceMapFilename),this.sourceMapURL=n,this.sourceMap=r}return this._css.join("")},t}()}(e=new s(e,t)),e)),a=function(e){return function(){function t(e,t,i){this.less=e,this.rootFilename=i.filename,this.paths=t.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=t.mime,this.error=null,this.context=t,this.queue=[],this.files={}}return t.prototype.push=function(t,i,n,s,o){var a=this,l=this.context.pluginManager.Loader;this.queue.push(t);var u=function(e,i,n){a.queue.splice(a.queue.indexOf(t),1);var l=n===a.rootFilename;s.optional&&e?(o(null,{rules:[]},!1,null),r.info("The file "+n+" was skipped because it was not found and the import was marked optional.")):(a.files[n]||s.inline||(a.files[n]={root:i,options:s}),e&&!a.error&&(a.error=e),o(e,i,l,n))},c={rewriteUrls:this.context.rewriteUrls,entryPath:n.entryPath,rootpath:n.rootpath,rootFilename:n.rootFilename},h=e.getFileManager(t,n.currentDirectory,this.context,e);if(h){var f,p,v=function(e){var t,i=e.filename,r=e.contents.replace(/^\uFEFF/,"");c.currentDirectory=h.getPath(i),c.rewriteUrls&&(c.rootpath=h.join(a.context.rootpath||"",h.pathDiff(c.currentDirectory,c.entryPath)),!h.isPathAbsolute(c.rootpath)&&h.alwaysMakePathsAbsolute()&&(c.rootpath=h.join(c.entryPath,c.rootpath))),c.filename=i;var o=new D.Parse(a.context);o.processImports=!1,a.contents[i]=r,(n.reference||s.reference)&&(c.reference=!0),s.isPlugin?(t=l.evalPlugin(r,o,a,s.pluginArgs,c))instanceof V?u(t,null,i):u(null,t,i):s.inline?u(null,r,i):!a.files[i]||a.files[i].options.multiple||s.multiple?new re(o,a,c).parse(r,(function(e,t){u(e,t,i)})):u(null,a.files[i].root,i)},d=_(this.context);i&&(d.ext=s.isPlugin?".js":".less"),s.isPlugin?(d.mime="application/javascript",d.syncImport?f=l.loadPluginSync(t,n.currentDirectory,d,e,h):p=l.loadPlugin(t,n.currentDirectory,d,e,h)):d.syncImport?f=h.loadFileSync(t,n.currentDirectory,d,e):p=h.loadFile(t,n.currentDirectory,d,e,(function(e,t){e?u(e):v(t)})),f?f.filename?v(f):u(f):p&&p.then(v,u)}else u({message:"Could not find a file-manager for "+t})},t}()}(e);var u,c=function(e,t){var i=function(e,n,r){if("function"==typeof n?(r=n,n=P(this.options,{})):n=P(this.options,n||{}),!r){var s=this;return new Promise((function(t,r){i.call(s,e,n,(function(e,i){e?r(e):t(i)}))}))}this.parse(e,n,(function(e,i,n,s){if(e)return r(e);var o;try{o=new t(i,n).toCSS(s)}catch(e){return r(e)}r(null,o)}))};return i}(0,o),h=function(e,t,i){var n=function(e,t,r){if("function"==typeof t?(r=t,t=P(this.options,{})):t=P(this.options,t||{}),!r){var s=this;return new Promise((function(i,r){n.call(s,e,t,(function(e,t){e?r(e):i(t)}))}))}var o,a=void 0,l=new kt(this,!t.reUsePluginManager);if(t.pluginManager=l,o=new D.Parse(t),t.rootFileInfo)a=t.rootFileInfo;else{var u=t.filename||"input",c=u.replace(/[^/\\]*$/,"");(a={filename:u,rewriteUrls:o.rewriteUrls,rootpath:o.rootpath||"",currentDirectory:c,entryPath:c,rootFilename:u}).rootpath&&"/"!==a.rootpath.slice(-1)&&(a.rootpath+="/")}var h=new i(this,o,a);this.importManager=h,t.plugins&&t.plugins.forEach((function(e){var t,i;if(e.fileContent){if(i=e.fileContent.replace(/^\uFEFF/,""),(t=l.Loader.evalPlugin(i,o,h,e.options,e.filename))instanceof V)return r(t)}else l.addPlugin(e)})),new re(o,h,a).parse(e,(function(e,i){if(e)return r(e);r(null,i,h,t)}),t)};return n}(0,0,a),f=Pt("v4.2.0"),p={version:[f.major,f.minor,f.patch],data:l,tree:He,Environment:s,AbstractFileManager:Qe,AbstractPluginLoader:Ke,environment:e,visitors:Y,Parser:re,functions:xt(e),contexts:D,SourceMapOutput:i,SourceMapBuilder:n,ParseTree:o,ImportManager:a,render:c,parse:h,LessError:V,transformTree:St,utils:R,PluginManager:kt,logger:r},v=function(e){return function(){var t=Object.create(e.prototype);return e.apply(t,Array.prototype.slice.call(arguments,0)),t}},d=Object.create(p);for(var m in p.tree)if("function"==typeof(u=p.tree[m]))d[m.toLowerCase()]=v(u);else for(var g in d[m]=Object.create(null),u)d[m][g.toLowerCase()]=v(u[g]);return p.parse=p.parse.bind(d),p.render=p.render.bind(d),d}var Et={},Rt=function(){};Rt.prototype=Object.assign(new Qe,{alwaysMakePathsAbsolute:function(){return!0},join:function(e,t){return e?this.extractUrlParts(t,e).path:t},doXHR:function(e,t,i,n){var r=new XMLHttpRequest,s=!_t.isFileProtocol||_t.fileAsync;function o(t,i,n){t.status>=200&&t.status<300?i(t.responseText,t.getResponseHeader("Last-Modified")):"function"==typeof n&&n(t.status,e)}"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/css"),At.debug("XHR: Getting '"+e+"'"),r.open("GET",e,s),r.setRequestHeader("Accept",t||"text/x-less, text/css; q=0.9, */*; q=0.5"),r.send(null),_t.isFileProtocol&&!_t.fileAsync?0===r.status||r.status>=200&&r.status<300?i(r.responseText):n(r.status,e):s?r.onreadystatechange=function(){4==r.readyState&&o(r,i,n)}:o(r,i,n)},supports:function(){return!0},clearFileCache:function(){Et={}},loadFile:function(e,t,i){t&&!this.isPathAbsolute(e)&&(e=t+e),e=i.ext?this.tryAppendExtension(e,i.ext):e,i=i||{};var n=this.extractUrlParts(e,window.location.href).url,r=this;return new Promise((function(e,t){if(i.useFileCache&&Et[n])try{var s=Et[n];return e({contents:s,filename:n,webInfo:{lastModified:new Date}})}catch(e){return t({filename:n,message:"Error loading file "+n+" error was "+e.message})}r.doXHR(n,i.mime,(function(t,i){Et[n]=t,e({contents:t,filename:n,webInfo:{lastModified:i}})}),(function(e,i){t({type:"File",message:"'"+i+"' wasn't found ("+e+")",href:n})}))}))}});var Ot=function(e,t){return _t=e,At=t,Rt},Vt=function(e){this.less=e};Vt.prototype=Object.assign(new Ke,{loadPlugin:function(e,t,i,n,r){return new Promise((function(s,o){r.loadFile(e,t,i,n).then(s).catch(o)}))}});var Ft=function(t,n,r){return{add:function(s,o){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting?function(e,t){var i=e.filename||t,s=[],o=(e.type||"Syntax")+"Error: "+(e.message||"There is an error in your .less file")+" in "+i,a=function(e,t,i){void 0!==e.extract[t]&&s.push("{line} {content}".replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,i).replace(/\{content\}/,e.extract[t]))};e.line&&(a(e,0,""),a(e,1,"line"),a(e,2,""),o+=" on line "+e.line+", column "+(e.column+1)+":\n"+s.join("\n")),e.stack&&(e.extract||r.logLevel>=4)&&(o+="\nStack Trace\n"+e.stack),n.logger.error(o)}(s,o):"function"==typeof r.errorReporting&&r.errorReporting("add",s,o):function(n,s){var o,a,l="less-error-message:"+e(s||""),u=t.document.createElement("div"),c=[],h=n.filename||s,f=h.match(/([^/]+(\?.*)?)$/)[1];u.id=l,u.className="less-error-message",a=""+(n.type||"Syntax")+"Error: "+(n.message||"There is an error in your .less file")+'
in '+f+" ";var p=function(e,t,i){void 0!==e.extract[t]&&c.push('
{content}
'.replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,i).replace(/\{content\}/,e.extract[t]))};n.line&&(p(n,0,""),p(n,1,"line"),p(n,2,""),a+="on line "+n.line+", column "+(n.column+1)+":"),n.stack&&(n.extract||r.logLevel>=4)&&(a+="
Stack Trace"+n.stack.split("\n").slice(1).join("
")),u.innerHTML=a,i(t.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),u.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===r.env&&(o=setInterval((function(){var e=t.document,i=e.body;i&&(e.getElementById(l)?i.replaceChild(u,e.getElementById(l)):i.insertBefore(u,i.firstChild),clearInterval(o))}),10))}(s,o)},remove:function(i){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting||"function"==typeof r.errorReporting&&r.errorReporting("remove",i):function(i){var n=t.document.getElementById("less-error-message:"+e(i));n&&n.parentNode.removeChild(n)}(i)}}},$t={javascriptEnabled:!1,depends:!1,compress:!1,lint:!1,paths:[],color:!0,strictImports:!1,insecure:!1,rootpath:"",rewriteUrls:!1,math:1,strictUnits:!1,globalVars:null,modifyVars:null,urlArgs:""};if(window.less)for(var Lt in window.less)Object.prototype.hasOwnProperty.call(window.less,Lt)&&($t[Lt]=window.less[Lt]);!function(e,i){t(i,n(e)),void 0===i.isFileProtocol&&(i.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(e.location.protocol)),i.async=i.async||!1,i.fileAsync=i.fileAsync||!1,i.poll=i.poll||(i.isFileProtocol?1e3:1500),i.env=i.env||("127.0.0.1"==e.location.hostname||"0.0.0.0"==e.location.hostname||"localhost"==e.location.hostname||e.location.port&&e.location.port.length>0||i.isFileProtocol?"development":"production");var r=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(e.location.hash);r&&(i.dumpLineNumbers=r[1]),void 0===i.useFileCache&&(i.useFileCache=!0),void 0===i.onReady&&(i.onReady=!0),i.relativeUrls&&(i.rewriteUrls="all")}(window,$t),$t.plugins=$t.plugins||[],window.LESS_PLUGINS&&($t.plugins=$t.plugins.concat(window.LESS_PLUGINS));var jt,Nt,Dt,Bt=function(e,n){var r=e.document,s=Mt();s.options=n;var o=s.environment,a=Ot(n,s.logger),l=new a;o.addFileManager(l),s.FileManager=a,s.PluginLoader=Vt,function(e,t){t.logLevel=void 0!==t.logLevel?t.logLevel:"development"===t.env?3:1,t.loggers||(t.loggers=[{debug:function(e){t.logLevel>=4&&console.log(e)},info:function(e){t.logLevel>=3&&console.log(e)},warn:function(e){t.logLevel>=2&&console.warn(e)},error:function(e){t.logLevel>=1&&console.error(e)}}]);for(var i=0;i0&&l.childNodes.length>0&&o.firstChild.nodeValue===l.firstChild.nodeValue);var u=t.getElementsByTagName("head")[0];if(null===o||!1===a){var h=n&&n.nextSibling||null;h?h.parentNode.insertBefore(l,h):u.appendChild(l)}if(o&&!1===a&&o.parentNode.removeChild(o),l.styleSheet)try{l.styleSheet.cssText=i}catch(e){throw new Error("Couldn't reassign styleSheet.cssText.")}},n=function(e){var t,i=e.document;return i.currentScript||(t=i.getElementsByTagName("script"))[t.length-1]},r={error:function(e){this._fireEvent("error",e)},warn:function(e){this._fireEvent("warn",e)},info:function(e){this._fireEvent("info",e)},debug:function(e){this._fireEvent("debug",e)},addListener:function(e){this._listeners.push(e)},removeListener:function(e){for(var t=0;t=0;a--){var l=o[a];if(l[s?"supportsSync":"supports"](e,t,i,n))return l}return null},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},e}(),o={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},a={length:{m:1,cm:.01,mm:.001,in:.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:1/400,turn:1}},l={colors:o,unitConversions:a},u=function(){function e(){this.parent=null,this.visibilityBlocks=void 0,this.nodeVisible=void 0,this.rootNode=null,this.parsed=null}return Object.defineProperty(e.prototype,"currentFileInfo",{get:function(){return this.fileInfo()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.getIndex()},enumerable:!1,configurable:!0}),e.prototype.setParent=function(t,i){function n(t){t&&t instanceof e&&(t.parent=i)}Array.isArray(t)?t.forEach(n):n(t)},e.prototype.getIndex=function(){return this._index||this.parent&&this.parent.getIndex()||0},e.prototype.fileInfo=function(){return this._fileInfo||this.parent&&this.parent.fileInfo()||{}},e.prototype.isRulesetLike=function(){return!1},e.prototype.toCSS=function(e){var t=[];return this.genCSS(e,{add:function(e,i,n){t.push(e)},isEmpty:function(){return 0===t.length}}),t.join("")},e.prototype.genCSS=function(e,t){t.add(this.value)},e.prototype.accept=function(e){this.value=e.visit(this.value)},e.prototype.eval=function(){return this},e.prototype._operate=function(e,t,i,n){switch(t){case"+":return i+n;case"-":return i-n;case"*":return i*n;case"/":return i/n}},e.prototype.fround=function(e,t){var i=e&&e.numPrecision;return i?Number((t+2e-16).toFixed(i)):t},e.compare=function(t,i){if(t.compare&&"Quoted"!==i.type&&"Anonymous"!==i.type)return t.compare(i);if(i.compare)return-i.compare(t);if(t.type===i.type){if(t=t.value,i=i.value,!Array.isArray(t))return t===i?0:void 0;if(t.length===i.length){for(var n=0;nt?1:void 0},e.prototype.blocksVisibility=function(){return void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),0!==this.visibilityBlocks},e.prototype.addVisibilityBlock=function(){void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks+1},e.prototype.removeVisibilityBlock=function(){void 0===this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks-1},e.prototype.ensureVisibility=function(){this.nodeVisible=!0},e.prototype.ensureInvisibility=function(){this.nodeVisible=!1},e.prototype.isVisible=function(){return this.nodeVisible},e.prototype.visibilityInfo=function(){return{visibilityBlocks:this.visibilityBlocks,nodeVisible:this.nodeVisible}},e.prototype.copyVisibilityInfo=function(e){e&&(this.visibilityBlocks=e.visibilityBlocks,this.nodeVisible=e.nodeVisible)},e}(),h=function(e,t,i){var n=this;Array.isArray(e)?this.rgb=e:e.length>=6?(this.rgb=[],e.match(/.{2}/g).map((function(e,t){t<3?n.rgb.push(parseInt(e,16)):n.alpha=parseInt(e,16)/255}))):(this.rgb=[],e.split("").map((function(e,t){t<3?n.rgb.push(parseInt(e+e,16)):n.alpha=parseInt(e+e,16)/255}))),this.alpha=this.alpha||("number"==typeof t?t:1),void 0!==i&&(this.value=i)};function c(e,t){return Math.min(Math.max(e,0),t)}function f(e){return"#"+e.map((function(e){return((e=c(Math.round(e),255))<16?"0":"")+e.toString(16)})).join("")}h.prototype=Object.assign(new u,{type:"Color",luma:function(){var e=this.rgb[0]/255,t=this.rgb[1]/255,i=this.rgb[2]/255;return.2126*(e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(i=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))},genCSS:function(e,t){t.add(this.toCSS(e))},toCSS:function(e,t){var i,n,r,s=e&&e.compress&&!t,o=[];if(n=this.fround(e,this.alpha),this.value)if(0===this.value.indexOf("rgb"))n<1&&(r="rgba");else{if(0!==this.value.indexOf("hsl"))return this.value;r=n<1?"hsla":"hsl"}else n<1&&(r="rgba");switch(r){case"rgba":o=this.rgb.map((function(e){return c(Math.round(e),255)})).concat(c(n,1));break;case"hsla":o.push(c(n,1));case"hsl":i=this.toHSL(),o=[this.fround(e,i.h),this.fround(e,100*i.s)+"%",this.fround(e,100*i.l)+"%"].concat(o)}if(r)return r+"("+o.join(","+(s?"":" "))+")";if(i=this.toRGB(),s){var a=i.split("");a[1]===a[2]&&a[3]===a[4]&&a[5]===a[6]&&(i="#"+a[1]+a[3]+a[5])}return i},operate:function(e,t,i){for(var n=new Array(3),r=this.alpha*(1-i.alpha)+i.alpha,s=0;s<3;s++)n[s]=this._operate(e,t,this.rgb[s],i.rgb[s]);return new h(n,r)},toRGB:function(){return f(this.rgb)},toHSL:function(){var e,t,i=this.rgb[0]/255,n=this.rgb[1]/255,r=this.rgb[2]/255,s=this.alpha,o=Math.max(i,n,r),a=Math.min(i,n,r),l=(o+a)/2,u=o-a;if(o===a)e=t=0;else{switch(t=l>.5?u/(2-o-a):u/(o+a),o){case i:e=(n-r)/u+(n=0&&"\n"!==t.charAt(i);)r++;return"number"==typeof e&&(n=(t.slice(0,e).match(/\n/g)||"").length),{line:n,column:r}}function k(e){var t,i=e.length,n=new Array(i);for(t=0;t|Function):(\d+):(\d+)/,V=function(e,t,i){Error.call(this);var n=e.filename||i;if(this.message=e.message,this.stack=e.stack,t&&n){var r=t.contents[n],s=C(e.index,r),o=s.line,a=s.column,l=e.call&&C(e.call,r).line,u=r?r.split("\n"):"";if(this.type=e.type||"Syntax",this.filename=n,this.index=e.index,this.line="number"==typeof o?o+1:null,this.column=a,!this.line&&this.stack){var h=this.stack.match(O),c=new Function("a","throw new Error()"),f=0;try{c()}catch(e){var p=e.stack.match(O);f=1-parseInt(p[2])}h&&(h[2]&&(this.line=parseInt(h[2])+f),h[3]&&(this.column=parseInt(h[3])))}this.callLine=l+1,this.callExtract=u[l],this.extract=[u[this.line-2],u[this.line-1],u[this.line]]}};if(void 0===Object.create){var F=function(){};F.prototype=Error.prototype,V.prototype=new F}else V.prototype=Object.create(Error.prototype);V.prototype.constructor=V,V.prototype.toString=function(e){e=e||{};var t="",i=this.extract||[],n=[],r=function(e){return e};if(e.stylize){var s=typeof e.stylize;if("function"!==s)throw Error("options.stylize should be a function, got a "+s+"!");r=e.stylize}if(null!==this.line){if("string"==typeof i[0]&&n.push(r(this.line-1+" "+i[0],"grey")),"string"==typeof i[1]){var o=this.line+" ";i[1]&&(o+=i[1].slice(0,this.column)+r(r(r(i[1].substr(this.column,1),"bold")+i[1].slice(this.column+1),"red"),"inverse")),n.push(o)}"string"==typeof i[2]&&n.push(r(this.line+1+" "+i[2],"grey")),n=n.join("\n")+r("","reset")+"\n"}return t+=r(this.type+"Error: "+this.message,"red"),this.filename&&(t+=r(" in ","red")+this.filename),this.line&&(t+=r(" on line "+this.line+", column "+(this.column+1)+":","grey")),t+="\n"+n,this.callLine&&(t+=r("from ","red")+(this.filename||"")+"/n",t+=r(this.callLine,"grey")+" "+this.callExtract+"/n"),t};var $={visitDeeper:!0},L=!1;function j(e){return e}var N=function(){function e(e){this._implementation=e,this._visitInCache={},this._visitOutCache={},L||(!function e(t,i){var n,r;for(n in t)switch(typeof(r=t[n])){case"function":r.prototype&&r.prototype.type&&(r.prototype.typeIndex=i++);break;case"object":i=e(r,i)}return i}(He,1),L=!0)}return e.prototype.visit=function(e){if(!e)return e;var t=e.typeIndex;if(!t)return e.value&&e.value.typeIndex&&this.visit(e.value),e;var i,n=this._implementation,r=this._visitInCache[t],s=this._visitOutCache[t],o=$;if(o.visitDeeper=!0,r||(r=n[i="visit"+e.type]||j,s=n[i+"Out"]||j,this._visitInCache[t]=r,this._visitOutCache[t]=s),r!==j){var a=r.call(n,e,o);e&&n.isReplacing&&(e=a)}if(o.visitDeeper&&e)if(e.length)for(var l=0,u=e.length;lg.PARENS_DIVISION)||this.parensStack&&this.parensStack.length))},D.Eval.prototype.pathRequiresRewrite=function(e){return(this.rewriteUrls===b?z:T)(e)},D.Eval.prototype.rewritePath=function(e,t){var i;return t=t||"",i=this.normalizePath(t+e),z(e)&&T(t)&&!1===z(i)&&(i="./"+i),i},D.Eval.prototype.normalizePath=function(e){var t,i=e.split("/").reverse();for(e=[];0!==i.length;)switch(t=i.pop()){case".":break;case"..":0===e.length||".."===e[e.length-1]?e.push(t):e.pop();break;default:e.push(t)}return e.join("/")};var G=function(){function e(e){this.imports=[],this.variableImports=[],this._onSequencerEmpty=e,this._currentDepth=0}return e.prototype.addImport=function(e){var t=this,i={callback:e,args:null,isReady:!1};return this.imports.push(i),function(){i.args=Array.prototype.slice.call(arguments,0),i.isReady=!0,t.tryRun()}},e.prototype.addVariableImport=function(e){this.variableImports.push(e)},e.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var e=this.imports[0];if(!e.isReady)return;this.imports=this.imports.slice(1),e.callback.apply(null,e.args)}if(0===this.variableImports.length)break;var t=this.variableImports[0];this.variableImports=this.variableImports.slice(1),t()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},e}(),W=function(e,t){this._visitor=new N(this),this._importer=e,this._finish=t,this.context=new D.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new G(this._onSequencerEmpty.bind(this))};W.prototype={isReplacing:!1,run:function(e){try{this._visitor.visit(e)}catch(e){this.error=e}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(e,t){var i=e.options.inline;if(!e.css||i){var n=new D.Eval(this.context,k(this.context.frames)),r=n.frames[0];this.importCount++,e.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,e,n,r)):this.processImportNode(e,n,r)}t.visitDeeper=!1},processImportNode:function(e,t,i){var n,r=e.options.inline;try{n=e.evalForImport(t)}catch(t){t.filename||(t.index=e.getIndex(),t.filename=e.fileInfo().filename),e.css=!0,e.error=t}if(!n||n.css&&!r)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{n.options.multiple&&(t.importMultiple=!0);for(var s=void 0===n.css,o=0;o=0||(a=[u.selfSelectors[0]],(s=f.findMatch(l,a)).length&&(l.hasFoundMatches=!0,l.selfSelectors.forEach((function(e){var t=u.visibilityInfo();o=f.extendSelector(s,a,e,l.isVisible()),(h=new He.Extend(u.selector,u.option,0,u.fileInfo(),t)).selfSelectors=o,o[o.length-1].extendList=[h],c.push(h),h.ruleset=u.ruleset,h.parent_ids=h.parent_ids.concat(u.parent_ids,l.parent_ids),u.firstExtendOnThisSelectorPath&&(h.firstExtendOnThisSelectorPath=!0,u.ruleset.paths.push(o))}))));if(c.length){if(this.extendChainCount++,i>100){var p="{unable to calculate}",v="{unable to calculate}";try{p=c[0].selfSelectors[0].toCSS(),v=c[0].selector.toCSS()}catch(e){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+p+":extend("+v+")"}}return c.concat(f.doExtendChaining(c,t,i+1))}return c},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitSelector=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){if(!e.root){var i,n,r,s,o=this.allExtendsStack[this.allExtendsStack.length-1],a=[],l=this;for(r=0;r0&&u[l.matched].combinator.value!==o?l=null:l.matched++,l&&(l.finished=l.matched===u.length,l.finished&&!e.allowAfter&&(r+1u&&h>0&&(c[c.length-1].elements=c[c.length-1].elements.concat(t[u].elements.slice(h)),h=0,u++),l=s.elements.slice(h,a.index).concat([o]).concat(i.elements.slice(1)),u===a.pathIndex&&r>0?c[c.length-1].elements=c[c.length-1].elements.concat(l):(c=c.concat(t.slice(u,a.pathIndex))).push(new He.Selector(l)),u=a.endPathIndex,(h=a.endPathElementIndex)>=t[u].elements.length&&(h=0,u++);return u0&&(c[c.length-1].elements=c[c.length-1].elements.concat(t[u].elements.slice(h)),u++),c=(c=c.concat(t.slice(u,t.length))).map((function(e){var t=e.createDerived(e.elements);return n?t.ensureVisibility():t.ensureInvisibility(),t}))},e.prototype.visitMedia=function(e,t){var i=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);i=i.concat(this.doExtendChaining(i,e.allExtends)),this.allExtendsStack.push(i)},e.prototype.visitMediaOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e.prototype.visitAtRule=function(e,t){var i=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);i=i.concat(this.doExtendChaining(i,e.allExtends)),this.allExtendsStack.push(i)},e.prototype.visitAtRuleOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e}(),K=function(){function e(){this.contexts=[[]],this._visitor=new N(this)}return e.prototype.run=function(e){return this._visitor.visit(e)},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){var i,n=this.contexts[this.contexts.length-1],r=[];this.contexts.push(r),e.root||((i=e.selectors)&&(i=i.filter((function(e){return e.getIsOutput()})),e.selectors=i.length?i:i=null,i&&e.joinSelectors(r,n,i)),i||(e.rules=null),e.paths=r)},e.prototype.visitRulesetOut=function(e){this.contexts.length=this.contexts.length-1},e.prototype.visitMedia=function(e,t){var i=this.contexts[this.contexts.length-1];e.rules[0].root=0===i.length||i[0].multiMedia},e.prototype.visitAtRule=function(e,t){var i=this.contexts[this.contexts.length-1];e.rules&&e.rules.length&&(e.rules[0].root=e.isRooted||0===i.length||null)},e}(),Z=function(){function e(e){this._visitor=new N(this),this._context=e}return e.prototype.containsSilentNonBlockedChild=function(e){var t;if(!e)return!1;for(var i=0;i0},e.prototype.resolveVisibility=function(e){if(!e.blocksVisibility()){if(this.isEmpty(e))return;return e}var t=e.rules[0];if(this.keepOnlyVisibleChilds(t),!this.isEmpty(t))return e.ensureVisibility(),e.removeVisibilityBlock(),e},e.prototype.isVisibleRuleset=function(e){return!!e.firstRoot||!this.isEmpty(e)&&!(!e.root&&!this.hasVisibleSelector(e))},e}(),X=function(e){this._visitor=new N(this),this._context=e,this.utils=new Z(e)};X.prototype={isReplacing:!0,run:function(e){return this._visitor.visit(e)},visitDeclaration:function(e,t){if(!e.blocksVisibility()&&!e.variable)return e},visitMixinDefinition:function(e,t){e.frames=[]},visitExtend:function(e,t){},visitComment:function(e,t){if(!e.blocksVisibility()&&!e.isSilent(this._context))return e},visitMedia:function(e,t){var i=e.rules[0].rules;return e.accept(this._visitor),t.visitDeeper=!1,this.utils.resolveVisibility(e,i)},visitImport:function(e,t){if(!e.blocksVisibility())return e},visitAtRule:function(e,t){return e.rules&&e.rules.length?this.visitAtRuleWithBody(e,t):this.visitAtRuleWithoutBody(e,t)},visitAnonymous:function(e,t){if(!e.blocksVisibility())return e.accept(this._visitor),e},visitAtRuleWithBody:function(e,t){var i=function(e){var t=e.rules;return function(e){var t=e.rules;return 1===t.length&&(!t[0].paths||0===t[0].paths.length)}(e)?t[0].rules:t}(e);return e.accept(this._visitor),t.visitDeeper=!1,this.utils.isEmpty(e)||this._mergeRules(e.rules[0].rules),this.utils.resolveVisibility(e,i)},visitAtRuleWithoutBody:function(e,t){if(!e.blocksVisibility()){if("@charset"===e.name){if(this.charset){if(e.debugInfo){var i=new He.Comment("/* "+e.toCSS(this._context).replace(/\n/g,"")+" */\n");return i.debugInfo=e.debugInfo,this._visitor.visit(i)}return}this.charset=!0}return e}},checkValidNodes:function(e,t){if(e)for(var i=0;i0?e.accept(this._visitor):e.rules=null,t.visitDeeper=!1}return e.rules&&(this._mergeRules(e.rules),this._removeDuplicateRules(e.rules)),this.utils.isVisibleRuleset(e)&&(e.ensureVisibility(),n.splice(0,0,e)),1===n.length?n[0]:n},_compileRulesetPaths:function(e){e.paths&&(e.paths=e.paths.filter((function(e){var t;for(" "===e[0].elements[0].combinator.value&&(e[0].elements[0].combinator=new He.Combinator("")),t=0;t=0;n--)if((i=e[n])instanceof He.Declaration)if(r[i.name]){(t=r[i.name])instanceof He.Declaration&&(t=r[i.name]=[r[i.name].toCSS(this._context)]);var s=i.toCSS(this._context);-1!==t.indexOf(s)?e.splice(n,1):t.push(s)}else r[i.name]=i}},_mergeRules:function(e){if(e){for(var t={},i=[],n=0;n0){var t=e[0],i=[],n=[new He.Expression(i)];e.forEach((function(e){"+"===e.merge&&i.length>0&&n.push(new He.Expression(i=[])),i.push(e.value),t.important=t.important||e.important})),t.value=new He.Value(n)}}))}}};var Y={Visitor:N,ImportVisitor:W,MarkVisibleSelectorsVisitor:J,ExtendVisitor:Q,JoinSelectorVisitor:K,ToCSSVisitor:X};var ee=function(){var e,t,i,n,r,s,o,a=[],l={};function u(i){for(var n,a,h,c=l.i,f=t,p=l.i-o,v=l.i+s.length-p,d=l.i+=i,m=e;l.i=0){h={index:l.i,text:m.substr(l.i,y+2-l.i),isLineComment:!1},l.i+=h.text.length-1,l.commentStore.push(h);continue}}break}if(32!==n&&10!==n&&9!==n&&13!==n)break}if(s=s.slice(i+l.i-d+p),o=l.i,!s.length){if(ti||l.i===i&&e&&!n)&&(i=l.i,n=e);var r=a.pop();s=r.current,o=l.i=r.i,t=r.j},l.forget=function(){a.pop()},l.isWhitespace=function(t){var i=l.i+(t||0),n=e.charCodeAt(i);return 32===n||13===n||9===n||10===n},l.$re=function(e){l.i>o&&(s=s.slice(l.i-o),o=l.i);var t=e.exec(s);return t?(u(t[0].length),"string"==typeof t?t:1===t.length?t[0]:t):null},l.$char=function(t){return e.charAt(l.i)!==t?null:(u(1),t)},l.$peekChar=function(t){return e.charAt(l.i)!==t?null:t},l.$str=function(t){for(var i=t.length,n=0;nc&&(d=!1)}}while(d);return r||null},l.autoCommentAbsorb=!0,l.commentStore=[],l.finished=!1,l.peek=function(t){if("string"==typeof t){for(var i=0;i57||t<43||47===t||44===t},l.start=function(n,a,h){e=n,l.i=t=o=i=0,r=a?function(e,t){var i,n,r,s,o,a,l,u,h,c=e.length,f=0,p=0,v=[],d=0;function m(t){var i=o-d;i<512&&!t||!i||(v.push(e.slice(d,o+1)),d=o+1)}for(o=0;o=97&&l<=122||l<34))switch(l){case 40:p++,n=o;continue;case 41:if(--p<0)return t("missing opening `(`",o);continue;case 59:p||m();continue;case 123:f++,i=o;continue;case 125:if(--f<0)return t("missing opening `{`",o);f||p||m();continue;case 92:if(o96)){if(u==l){h=1;break}if(92==u){if(o==c-1)return t("unescaped `\\`",o);o++}}if(h)continue;return t("unmatched `"+String.fromCharCode(l)+"`",a);case 47:if(p||o==c-1)continue;if(47==(u=e.charCodeAt(o+1)))for(o+=2;oi&&s>r?"missing closing `}` or `*/`":"missing closing `}`",i):0!==p?t("missing closing `)`",n):(m(!0),v)}(n,h):[n],s=r[0],u(0)},l.end=function(){var t,r=l.i>=e.length;return l.i=e.length-1,furthestChar:e[l.i]}},l};var te=function e(t){return{_data:{},add:function(e,t){e=e.toLowerCase(),this._data.hasOwnProperty(e),this._data[e]=t},addMultiple:function(e){var t=this;Object.keys(e).forEach((function(i){t.add(i,e[i])}))},get:function(e){return this._data[e]||t&&t.get(e)},getLocalFunctions:function(){return this._data},inherit:function(){return e(this)},create:function(t){return e(t)}}}(null),ie={queryInParens:!0},ne={queryInParens:!0},re=function e(t,i,n,r){var s;r=r||0;var o=ee();function a(e,t){throw new V({index:o.i,filename:n.filename,type:t||"Syntax",message:e},i)}function l(e,t){var i=e instanceof Function?e.call(s):o.$re(e);if(i)return i;a(t||("string"==typeof e?"expected '"+e+"' got '"+o.currentChar()+"'":"unexpected token"))}function u(e,t){if(o.$char(e))return e;a(t||"expected '"+e+"' got '"+o.currentChar()+"'")}function h(e){var t=n.filename;return{lineNumber:C(e,o.getInput()).line+1,fileName:t}}return{parserInput:o,imports:i,fileInfo:n,parseNode:function(e,t,a){var l,u=[],h=o;try{h.start(e,!1,(function(e,t){a({message:e,index:t+r})}));for(var c=0,f=void 0;f=t[c];c++)l=s[f](),u.push(l||null);h.end().isFinished?a(null,u):a(!0,null)}catch(e){throw new V({index:e.index+r,message:e.message},i,n.filename)}},parse:function(r,l,u){var h,c,f,p,v=null,d="";if(u&&u.disablePluginRule&&(s.plugin=function(){o.$re(/^@plugin?\s+/)&&a("@plugin statements are not allowed when disablePluginRule is set to true")}),c=u&&u.globalVars?e.serializeVars(u.globalVars)+"\n":"",f=u&&u.modifyVars?"\n"+e.serializeVars(u.modifyVars):"",t.pluginManager)for(var m=t.pluginManager.getPreProcessors(),g=0;g");return e},args:function(e){var t,i,n,r,l,u,h,c=s.entities,f={args:null,variadic:!1},p=[],v=[],d=[],m=!0;for(o.save();;){if(e)u=s.detachedRuleset()||s.expression();else{if(o.commentStore.length=0,o.$str("...")){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({variadic:!0});break}u=c.variable()||c.property()||c.literal()||c.keyword()||this.call(!0)}if(!u||!m)break;r=null,u.throwAwayComments&&u.throwAwayComments(),l=u;var g=null;if(e?u.value&&1==u.value.length&&(g=u.value[0]):g=u,g&&(g instanceof He.Variable||g instanceof He.Property))if(o.$char(":")){if(p.length>0&&(t&&a("Cannot mix ; and , as delimiter types"),i=!0),!(l=s.detachedRuleset()||s.expression())){if(!e)return o.restore(),f.args=[],f;a("could not understand value for named argument")}r=n=g.name}else if(o.$str("...")){if(!e){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({name:u.name,variadic:!0});break}h=!0}else e||(n=r=g.name,l=null);l&&p.push(l),d.push({name:r,value:l,expand:h}),o.$char(",")?m=!0:((m=";"===o.$char(";"))||t)&&(i&&a("Cannot mix ; and , as delimiter types"),t=!0,p.length>1&&(l=new He.Value(p)),v.push({name:n,value:l,expand:h}),n=null,p=[],i=!1)}return o.forget(),f.args=t?v:d,f},definition:function(){var e,t,i,n,r=[],a=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),t=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){e=t[1];var u=this.args(!1);if(r=u.args,a=u.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(n=l(s.conditions,"expected condition")),i=s.block())return o.forget(),new He.mixin.Definition(e,r,i,n,a);o.restore()}else o.restore()},ruleLookups:function(){var e,t=[];if("["===o.currentChar()){for(;;){if(o.save(),!(e=this.lookupValue())&&""!==e){o.restore();break}t.push(e),o.forget()}return t.length>0?t:void 0}},lookupValue:function(){if(o.save(),o.$char("[")){var e=o.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);if(o.$char("]"))return e||""===e?(o.forget(),e):void o.restore();o.restore()}else o.restore()}},entity:function(){var e=this.entities;return this.comment()||e.literal()||e.variable()||e.url()||e.property()||e.call()||e.keyword()||this.mixin.call(!0)||e.javascript()},end:function(){return o.$char(";")||o.peek("}")},ieAlpha:function(){var e;if(o.$re(/^opacity=/i))return(e=o.$re(/^\d+/))||(e="@{"+(e=l(s.entities.variable,"Could not parse alpha")).name.slice(1)+"}"),u(")"),new He.Quoted("","alpha(opacity="+e+")")},element:function(){var e,t,i,s=o.i;if(t=this.combinator(),(e=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[.#:](?=@)/)||this.entities.variableCurly())||(o.save(),o.$char("(")?(i=this.selector(!1))&&o.$char(")")?(e=new He.Paren(i),o.forget()):o.restore("Missing closing ')'"):o.forget()),e)return new He.Element(t,e,e instanceof He.Variable,s+r,n)},combinator:function(){var e=o.currentChar();if("/"===e){o.save();var t=o.$re(/^\/[a-z]+\//i);if(t)return o.forget(),new He.Combinator(t);o.restore()}if(">"===e||"+"===e||"~"===e||"|"===e||"^"===e){for(o.i++,"^"===e&&"^"===o.currentChar()&&(e="^^",o.i++);o.isWhitespace();)o.i++;return new He.Combinator(e)}return o.isWhitespace(-1)?new He.Combinator(" "):new He.Combinator(null)},selector:function(e){var t,i,s,u,h,c,f,p=o.i;for(e=!1!==e;(e&&(i=this.extend())||e&&(c=o.$str("when"))||(u=this.element()))&&(c?f=l(this.conditions,"expected condition"):f?a("CSS guard can only be used at the end of selector"):i?h=h?h.concat(i):i:(h&&a("Extend can only be used at the end of selector"),s=o.currentChar(),t?t.push(u):t=[u],u=null),"{"!==s&&"}"!==s&&";"!==s&&","!==s&&")"!==s););if(t)return new He.Selector(t,h,f,p+r,n);h&&a("Extend must be used to extend a selector, it cannot be used on its own")},selectors:function(){for(var e,t;(e=this.selector())&&(t?t.push(e):t=[e],o.commentStore.length=0,e.condition&&t.length>1&&a("Guards are only currently allowed on a single selector."),o.$char(","));)e.condition&&a("Guards are only currently allowed on a single selector."),o.commentStore.length=0;return t},attribute:function(){if(o.$char("[")){var e,t,i,n,r=this.entities;return(e=r.variableCurly())||(e=l(/^(?:[_A-Za-z0-9-*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),(i=o.$re(/^[|~*$^]?=/))&&(t=r.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||r.variableCurly())&&(n=o.$re(/^[iIsS]/)),u("]"),new He.Attribute(e,i,t,n)}},block:function(){var e;if(o.$char("{")&&(e=this.primary())&&o.$char("}"))return e},blockRuleset:function(){var e=this.block();return e&&(e=new He.Ruleset(null,e)),e},detachedRuleset:function(){var e,t,i;if(o.save(),!o.$re(/^[.#]\(/)||(t=(e=this.mixin.args(!1)).args,i=e.variadic,o.$char(")"))){var n=this.blockRuleset();if(n)return o.forget(),t?new He.mixin.Definition(null,t,n,null,i):new He.DetachedRuleset(n);o.restore()}else o.restore()},ruleset:function(){var e,i,n;if(o.save(),t.dumpLineNumbers&&(n=h(o.i)),(e=this.selectors())&&(i=this.block())){o.forget();var r=new He.Ruleset(e,i,t.strictImports);return t.dumpLineNumbers&&(r.debugInfo=n),r}o.restore()},declaration:function(){var e,t,i,s,a,l,u=o.i,h=o.currentChar();if("."!==h&&"#"!==h&&"&"!==h&&":"!==h)if(o.save(),e=this.variable()||this.ruleProperty()){if((l="string"==typeof e)&&(t=this.detachedRuleset())&&(i=!0),o.commentStore.length=0,!t){if(a=!l&&e.length>1&&e.pop().value,t=e[0].value&&"--"===e[0].value.slice(0,2)?this.permissiveValue(/[;}]/):this.anonymousValue())return o.forget(),new He.Declaration(e,t,!1,a,u+r,n);t||(t=this.value()),t?s=this.important():l&&(t=this.permissiveValue())}if(t&&(this.end()||i))return o.forget(),new He.Declaration(e,t,s,a,u+r,n);o.restore()}else o.restore()},anonymousValue:function(){var e=o.i,t=o.$re(/^([^.#@$+/'"*`(;{}-]*);/);if(t)return new He.Anonymous(t[1],e+r)},permissiveValue:function(e){var t,i,r,s,l=e||";",u=o.i,h=[];function c(){var e=o.currentChar();return"string"==typeof l?e===l:l.test(e)}if(!c()){s=[];do{(i=this.comment())?s.push(i):((i=this.entity())&&s.push(i),o.peek(",")&&(s.push(new He.Anonymous(",",o.i)),o.$char(",")))}while(i);if(r=c(),s.length>0){if(s=new He.Expression(s),r)return s;h.push(s)," "===o.prevChar()&&h.push(new He.Anonymous(" ",u))}if(o.save(),s=o.$parseUntil(l)){if("string"==typeof s&&a("Expected '"+s+"'","Parse"),1===s.length&&" "===s[0])return o.forget(),new He.Anonymous("",u);var f=void 0;for(t=0;t]=|<=|>=|[<>]|=)/)?(o.restore(),i=this.condition(),o.save(),(s=this.atomicCondition(null,i.rvalue))||o.restore()):(o.restore(),t=this.value()),o.$char(")")?i&&!t?(u.push(new He.Paren(new He.QueryInParens(i.op,i.lvalue,i.rvalue,s?s.op:null,s?s.rvalue:null,i._index))),t=i):i&&t?u.push(new He.Paren(new He.Declaration(i,t,null,null,o.i+r,n,!0))):t?u.push(new He.Paren(t)):a("badly formed media feature definition"):a("Missing closing ')'","Parse"))}while(t);if(o.forget(),u.length>0)return new He.Expression(u)},mediaFeatures:function(e){var t,i=this.entities,n=[];do{if(t=this.mediaFeature(e)){if(n.push(t),!o.$char(","))break}else if((t=i.variable()||i.mixinLookup())&&(n.push(t),!o.$char(",")))break}while(t);return n.length>0?n:null},prepareAndGetNestableAtRule:function(e,i,s,l){var u=this.mediaFeatures(l),h=this.block();h||a("media definitions require block statements after any features"),o.forget();var c=new e(h,u,i+r,n);return t.dumpLineNumbers&&(c.debugInfo=s),c},nestableAtRule:function(){var e,i=o.i;if(t.dumpLineNumbers&&(e=h(i)),o.save(),o.$peekChar("@")){if(o.$str("@media"))return this.prepareAndGetNestableAtRule(He.Media,i,e,ie);if(o.$str("@container"))return this.prepareAndGetNestableAtRule(He.Container,i,e,ne)}o.restore()},plugin:function(){var e,t,i,s=o.i;if(o.$re(/^@plugin\s+/)){if(i=(t=this.pluginArgs())?{pluginArgs:t,isPlugin:!0}:{isPlugin:!0},e=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=s,a("missing semi-colon on @plugin")),new He.Import(e,null,i,s+r,n);o.i=s,a("malformed @plugin statement")}},pluginArgs:function(){if(o.save(),!o.$char("("))return o.restore(),null;var e=o.$re(/^\s*([^);]+)\)\s*/);return e[1]?(o.forget(),e[1].trim()):(o.restore(),null)},atrule:function(){var e,i,s,l,u,c,f,p=o.i,v=!0,d=!0;if("@"===o.currentChar()){if(i=this.import()||this.plugin()||this.nestableAtRule())return i;if(o.save(),e=o.$re(/^@[a-z-]+/)){switch(l=e,"-"==e.charAt(1)&&e.indexOf("-",2)>0&&(l="@"+e.slice(e.indexOf("-",2)+1)),l){case"@charset":u=!0,v=!1;break;case"@namespace":c=!0,v=!1;break;case"@keyframes":case"@counter-style":u=!0;break;case"@document":case"@supports":f=!0,d=!1;break;default:f=!0}if(o.commentStore.length=0,u?(i=this.entity())||a("expected "+e+" identifier"):c?(i=this.expression())||a("expected "+e+" expression"):f&&(i=this.permissiveValue(/^[{;]/),v="{"===o.currentChar(),i?i.value||(i=null):v||";"===o.currentChar()||a(e+" rule is missing block or ending semi-colon")),v&&(s=this.blockRuleset()),s||!v&&i&&o.$char(";"))return o.forget(),new He.AtRule(e,i,s,p+r,n,t.dumpLineNumbers?h(p):null,d);o.restore("at-rule options not recognised")}}},value:function(){var e,t=[],i=o.i;do{if((e=this.expression())&&(t.push(e),!o.$char(",")))break}while(e);if(t.length>0)return new He.Value(t,i+r)},important:function(){if("!"===o.currentChar())return o.$re(/^! *important/)},sub:function(){var e,t;if(o.save(),o.$char("("))return(e=this.addition())&&o.$char(")")?(o.forget(),(t=new He.Expression([e])).parens=!0,t):void o.restore("Expected ')'");o.restore()},multiplication:function(){var e,t,i,n,r;if(e=this.operand()){for(r=o.isWhitespace(-1);!o.peek(/^\/[*/]/);){if(o.save(),!(i=o.$char("/")||o.$char("*")||o.$str("./"))){o.forget();break}if(!(t=this.operand())){o.restore();break}o.forget(),e.parensInOp=!0,t.parensInOp=!0,n=new He.Operation(i,[n||e,t],r),r=o.isWhitespace(-1)}return n||e}},addition:function(){var e,t,i,n,r;if(e=this.multiplication()){for(r=o.isWhitespace(-1);(i=o.$re(/^[-+]\s+/)||!r&&(o.$char("+")||o.$char("-")))&&(t=this.multiplication());)e.parensInOp=!0,t.parensInOp=!0,n=new He.Operation(i,[n||e,t],r),r=o.isWhitespace(-1);return n||e}},conditions:function(){var e,t,i,n=o.i;if(e=this.condition(!0)){for(;o.peek(/^,\s*(not\s*)?\(/)&&o.$char(",")&&(t=this.condition(!0));)i=new He.Condition("or",i||e,t,n+r);return i||e}},condition:function(e){var t,i,n;if(t=this.conditionAnd(e)){if(i=o.$str("or")){if(!(n=this.condition(e)))return;t=new He.Condition(i,t,n)}return t}},conditionAnd:function(e){var t,i,n,r,s=this;if(t=(r=s.negatedCondition(e)||s.parenthesisCondition(e))||e?r:s.atomicCondition(e)){if(i=o.$str("and")){if(!(n=this.conditionAnd(e)))return;t=new He.Condition(i,t,n)}return t}},negatedCondition:function(e){if(o.$str("not")){var t=this.parenthesisCondition(e);return t&&(t.negate=!t.negate),t}},parenthesisCondition:function(e){var t;if(o.save(),o.$str("(")){if(t=function(t){var i;if(o.save(),i=t.condition(e)){if(o.$char(")"))return o.forget(),i;o.restore()}else o.restore()}(this))return o.forget(),t;if(t=this.atomicCondition(e)){if(o.$char(")"))return o.forget(),t;o.restore("expected ')' got '"+o.currentChar()+"'")}else o.restore()}else o.restore()},atomicCondition:function(e,t){var i,n,s,l,u=this.entities,h=o.i,c=function(){return this.addition()||u.keyword()||u.quoted()||u.mixinLookup()}.bind(this);if(i=t||c())return o.$char(">")?l=o.$char("=")?">=":">":o.$char("<")?l=o.$char("=")?"<=":"<":o.$char("=")&&(l=o.$char(">")?"=>":o.$char("<")?"=<":"="),l?(n=c())?s=new He.Condition(l,i,n,h+r,!1):a("expected expression"):t||(s=new He.Condition("=",i,new He.Keyword("true"),h+r,!1)),s},operand:function(){var e,t=this.entities;o.peek(/^-[@$(]/)&&(e=o.$char("-"));var i=this.sub()||t.dimension()||t.color()||t.variable()||t.property()||t.call()||t.quoted(!0)||t.colorKeyword()||t.mixinLookup();return e&&(i.parensInOp=!0,i=new He.Negative(i)),i},expression:function(){var e,t,i=[],n=o.i;do{(e=this.comment())?i.push(e):((e=this.addition()||this.entity())instanceof He.Comment&&(e=null),e&&(i.push(e),o.peek(/^\/[/*]/)||(t=o.$char("/"))&&i.push(new He.Anonymous(t,n+r))))}while(e);if(i.length>0)return new He.Expression(i)},property:function(){var e=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(e)return e[1]},ruleProperty:function(){var e,t,i=[],s=[];o.save();var a=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(a)return i=[new He.Keyword(a[1])],o.forget(),i;function l(e){var t=o.i,n=o.$re(e);if(n)return s.push(t),i.push(n[1])}for(l(/^(\*?)/);l(/^((?:[\w-]+)|(?:[@$]\{[\w-]+\}))/););if(i.length>1&&l(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===i[0]&&(i.shift(),s.shift()),t=0;t0;e--){var t=this.rules[e-1];if(t instanceof he)return this.parseValue(t)}},parseValue:function(e){var t=this;function i(e){return e.value instanceof le&&!e.parsed?("string"==typeof e.value.value?new re(this.parse.context,this.parse.importManager,e.fileInfo(),e.value.getIndex()).parseNode(e.value.value,["value","important"],(function(t,i){t&&(e.parsed=!0),i&&(e.value=i[0],e.important=i[1]||"",e.parsed=!0)})):e.parsed=!0,e):e}if(Array.isArray(e)){var n=[];return e.forEach((function(e){n.push(i.call(t,e))})),n}return i.call(t,e)},rulesets:function(){if(!this.rules)return[];var e,t,i=[],n=this.rules;for(e=0;t=n[e];e++)t.isRuleset&&i.push(t);return i},prependRule:function(e){var t=this.rules;t?t.unshift(e):this.rules=[e],this.setParent(e,this)},find:function(e,t,i){t=t||this;var n,r,s=[],o=e.toCSS();return o in this._lookups?this._lookups[o]:(this.rulesets().forEach((function(o){if(o!==t)for(var a=0;an){if(!i||i(o)){r=o.find(new se(e.elements.slice(n)),t,i);for(var l=0;l0&&t.add(l),e.firstSelector=!0,o[0].genCSS(e,t),e.firstSelector=!1,n=1;n0?(s=(r=k(e)).pop(),o=n.createDerived(k(s.elements))):o=n.createDerived([]),t.length>0){var a=i.combinator,l=t[0].elements[0];a.emptyOrWhitespace&&!l.combinator.emptyOrWhitespace&&(a=l.combinator),o.elements.push(new m(a,l.value,i.isVariable,i._index,i._fileInfo)),o.elements=o.elements.concat(t[0].elements.slice(1))}if(0!==o.elements.length&&r.push(o),t.length>1){var u=t.slice(1);u=u.map((function(e){return e.createDerived(e.elements,[])})),r=r.concat(u)}return r}function o(e,t,i,n,r){var o;for(o=0;o0?n[n.length-1]=n[n.length-1].createDerived(n[n.length-1].elements.concat(e)):n.push(new se(e));else t.push([new se(e)])}function l(e,t){var i=t.createDerived(t.elements,t.extendList,t.evaldCondition);return i.copyVisibilityInfo(e),i}var u,h;if(!function e(t,i,l){var u,h,c,f,v,d,g,y,b,w,x,S,I=!1;for(f=[],v=[[]],u=0;y=l.elements[u];u++)if("&"!==y.value){var C=(S=void 0,(x=y).value instanceof p&&(S=x.value.value)instanceof se?S:null);if(null!==C){a(f,v);var k,_=[],A=[];for(k=e(_,i,C),I=I||k,c=0;c<_.length;c++){o(v,[r(n(_[c],y),y)],y,l,A)}v=A,f=[]}else f.push(y)}else{for(I=!0,d=[],a(f,v),h=0;h0&&g[0].elements.push(new m(y.combinator,"",y.isVariable,y._index,y._fileInfo)),d.push(g);else for(c=0;c0&&(t.push(v[u]),w=v[u][b-1],v[u][b-1]=w.createDerived(w.elements,l.extendList));return I}(h=[],t,i))if(t.length>0)for(h=[],u=0;u0)for(t=0;t-1e-6&&(n=i.toFixed(20).replace(/0+$/,"")),e&&e.compress){if(0===i&&this.unit.isLength())return void t.add(n);i>0&&i<1&&(n=n.substr(1))}t.add(n),this.unit.genCSS(e,t)},operate:function(e,t,i){var n=this._operate(e,t,this.value,i.value),r=this.unit.clone();if("+"===t||"-"===t)if(0===r.numerator.length&&0===r.denominator.length)r=i.unit.clone(),this.unit.backupUnit&&(r.backupUnit=this.unit.backupUnit);else if(0===i.unit.numerator.length&&0===r.denominator.length);else{if(i=i.convertTo(this.unit.usedUnits()),e.strictUnits&&i.unit.toString()!==r.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+r.toString()+"' and '"+i.unit.toString()+"'.");n=this._operate(e,t,this.value,i.value)}else"*"===t?(r.numerator=r.numerator.concat(i.unit.numerator).sort(),r.denominator=r.denominator.concat(i.unit.denominator).sort(),r.cancel()):"/"===t&&(r.numerator=r.numerator.concat(i.unit.denominator).sort(),r.denominator=r.denominator.concat(i.unit.numerator).sort(),r.cancel());return new we(n,r)},compare:function(e){var t,i;if(e instanceof we){if(this.unit.isEmpty()||e.unit.isEmpty())t=this,i=e;else if(t=this.unify(),i=e.unify(),0!==t.unit.compare(i.unit))return;return u.numericCompare(t.value,i.value)}},unify:function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},convertTo:function(e){var t,i,n,r,s,o=this.value,l=this.unit.clone(),u={};if("string"==typeof e){for(t in a)a[t].hasOwnProperty(e)&&((u={})[t]=e);e=u}for(i in s=function(e,t){return n.hasOwnProperty(e)?(t?o/=n[e]/n[r]:o*=n[e]/n[r],r):e},e)e.hasOwnProperty(i)&&(r=e[i],n=a[i],l.map(s));return l.cancel(),new we(o,l)}});var xe=g,Se=function(e,t,i){this.op=e.trim(),this.operands=t,this.isSpaced=i};Se.prototype=Object.assign(new u,{type:"Operation",accept:function(e){this.operands=e.visitArray(this.operands)},eval:function(e){var t,i=this.operands[0].eval(e),n=this.operands[1].eval(e);if(e.isMathOn(this.op)){if(t="./"===this.op?"/":this.op,i instanceof we&&n instanceof h&&(i=i.toColor()),n instanceof we&&i instanceof h&&(n=n.toColor()),!i.operate||!n.operate){if((i instanceof Se||n instanceof Se)&&"/"===i.op&&e.math===xe.PARENS_DIVISION)return new Se(this.op,[i,n],this.isSpaced);throw{type:"Operation",message:"Operation on an invalid type"}}return i.operate(e,t,n)}return new Se(this.op,[i,n],this.isSpaced)},genCSS:function(e,t){this.operands[0].genCSS(e,t),this.isSpaced&&t.add(" "),t.add(this.op),this.isSpaced&&t.add(" "),this.operands[1].genCSS(e,t)}});var Ie=function(){return(Ie=Object.assign||function(e){for(var t,i=1,n=arguments.length;i1?t=new Ce(this.value.map((function(t){return t.eval?t.eval(e):t})),this.noSpacing):1===this.value.length?(!this.value[0].parens||this.value[0].parensInOp||e.inCalc||(r=!0),t=this.value[0].eval(e)):t=this,n&&e.outOfParenthesis(),!this.parens||!this.parensInOp||i||r||t instanceof we||(t=new p(t)),t},genCSS:function(e,t){for(var i=0;i1){var i=new se([],null,null,this.getIndex(),this.fileInfo()).createEmptySelectors();(t=new me(i,e.mediaBlocks)).multiMedia=!0,t.copyVisibilityInfo(this.visibilityInfo()),this.setParent(t,this)}return delete e.mediaBlocks,delete e.mediaPath,t},evalNested:function(e){var t,i,n=e.mediaPath.concat([this]);for(t=0;t0;t--)e.splice(t,0,new le("and"));return new Ce(e)}))),this.setParent(this.features,this),new me([],[])},permute:function(e){if(0===e.length)return[];if(1===e.length)return e[0];for(var t=[],i=this.permute(e.slice(1)),n=0;n1?"["+e.value.map((function(e){return e.toCSS()})).join(", ")+"]":e.toCSS()}});var Le=function(e,t,i,n){this.escaped=t,this.expression=e,this._index=i,this._fileInfo=n};Le.prototype=Object.assign(new $e,{type:"JavaScript",eval:function(e){var t=this.evaluateJavaScript(this.expression,e),i=typeof t;return"number"!==i||isNaN(t)?"string"===i?new Ee('"'+t+'"',t,this.escaped,this._index):Array.isArray(t)?new le(t.join(", ")):new le(t):new we(t)}});var je=function(e,t){this.key=e,this.value=t};je.prototype=Object.assign(new u,{type:"Assignment",accept:function(e){this.value=e.visit(this.value)},eval:function(e){return this.value.eval?new je(this.key,this.value.eval(e)):this},genCSS:function(e,t){t.add(this.key+"="),this.value.genCSS?this.value.genCSS(e,t):t.add(this.value)}});var Ne=function(e,t,i,n,r){this.op=e.trim(),this.lvalue=t,this.rvalue=i,this._index=n,this.negate=r};Ne.prototype=Object.assign(new u,{type:"Condition",accept:function(e){this.lvalue=e.visit(this.lvalue),this.rvalue=e.visit(this.rvalue)},eval:function(e){var t=function(e,t,i){switch(e){case"and":return t&&i;case"or":return t||i;default:switch(u.compare(t,i)){case-1:return"<"===e||"=<"===e||"<="===e;case 0:return"="===e||">="===e||"=<"===e||"<="===e;case 1:return">"===e||">="===e;default:return!1}}}(this.op,this.lvalue.eval(e),this.rvalue.eval(e));return this.negate?!t:t}});var De=function(e,t,i,n,r,s){this.op=e.trim(),this.lvalue=t,this.mvalue=i,this.op2=n?n.trim():null,this.rvalue=r,this._index=s};De.prototype=Object.assign(new u,{type:"QueryInParens",accept:function(e){this.lvalue=e.visit(this.lvalue),this.mvalue=e.visit(this.mvalue),this.rvalue&&(this.rvalue=e.visit(this.rvalue))},eval:function(e){return this.lvalue=this.lvalue.eval(e),this.mvalue=this.mvalue.eval(e),this.rvalue&&(this.rvalue=this.rvalue.eval(e)),this},genCSS:function(e,t){this.lvalue.genCSS(e,t),t.add(" "+this.op+" "),this.mvalue.genCSS(e,t),this.rvalue&&(t.add(" "+this.op2+" "),this.rvalue.genCSS(e,t))}});var Be=function(e,t,i,n,r){this._index=i,this._fileInfo=n;var s=new se([],null,null,this._index,this._fileInfo).createEmptySelectors();this.features=new oe(t),this.rules=[new me(s,e)],this.rules[0].allowImports=!0,this.copyVisibilityInfo(r),this.allowRoot=!0,this.setParent(s,this),this.setParent(this.features,this),this.setParent(this.rules,this)};Be.prototype=Object.assign(new ge,Ie(Ie({type:"Container"},Oe),{genCSS:function(e,t){t.add("@container ",this._fileInfo,this._index),this.features.genCSS(e,t),this.outputRuleset(e,t,this.rules)},eval:function(e){e.mediaBlocks||(e.mediaBlocks=[],e.mediaPath=[]);var t=new Be(null,[],this._index,this._fileInfo,this.visibilityInfo());return this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,t.debugInfo=this.debugInfo),t.features=this.features.eval(e),e.mediaPath.push(t),e.mediaBlocks.push(t),this.rules[0].functionRegistry=e.frames[0].functionRegistry.inherit(),e.frames.unshift(this.rules[0]),t.rules=[this.rules[0].eval(e)],e.frames.shift(),e.mediaPath.pop(),0===e.mediaPath.length?t.evalTop(e):t.evalNested(e)}}));var Ue=function(e){this.value=e};Ue.prototype=Object.assign(new u,{type:"UnicodeDescriptor"});var qe=function(e){this.value=e};qe.prototype=Object.assign(new u,{type:"Negative",genCSS:function(e,t){t.add("-"),this.value.genCSS(e,t)},eval:function(e){return e.isMathOn()?new Se("*",[new we(-1),this.value]).eval(e):new qe(this.value.eval(e))}});var Te=function(e,t,i,n,r){switch(this.selector=e,this.option=t,this.object_id=Te.next_id++,this.parent_ids=[this.object_id],this._index=i,this._fileInfo=n,this.copyVisibilityInfo(r),this.allowRoot=!0,t){case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}this.setParent(this.selector,this)};Te.prototype=Object.assign(new u,{type:"Extend",accept:function(e){this.selector=e.visit(this.selector)},eval:function(e){return new Te(this.selector.eval(e),this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},clone:function(e){return new Te(this.selector,this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},findSelfSelectors:function(e){var t,i,n=[];for(t=0;t0&&i.length&&""===i[0].combinator.value&&(i[0].combinator.value=" "),n=n.concat(e[t].elements);this.selfSelectors=[new se(n)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())}}),Te.next_id=0;var ze=function(e,t,i){this.variable=e,this._index=t,this._fileInfo=i,this.allowRoot=!0};ze.prototype=Object.assign(new u,{type:"VariableCall",eval:function(e){var t,i=new Ae(this.variable,this.getIndex(),this.fileInfo()).eval(e),n=new V({message:"Could not evaluate variable call "+this.variable});if(!i.ruleset){if(i.rules)t=i;else if(Array.isArray(i))t=new me("",i);else{if(!Array.isArray(i.value))throw n;t=new me("",i.value)}i=new ye(t)}if(i.ruleset)return i.callEval(e);throw n}});var Ge=function(e,t,i,n){this.value=e,this.lookups=t,this._index=i,this._fileInfo=n};Ge.prototype=Object.assign(new u,{type:"NamespaceValue",eval:function(e){var t,i,n=this.value.eval(e);for(t=0;tthis.params.length)return!1}i=Math.min(s,this.arity);for(var o=0;o0){for(h=!0,a=0;a0)f=2;else if(f=1,p[1]+p[2]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(m)+"`",index:this.getIndex(),filename:this.fileInfo().filename};for(a=0;a0&&(e=e.slice(0,t)),(t=e.lastIndexOf("/"))<0&&(t=e.lastIndexOf("\\")),t<0?"":e.slice(0,t+1)},e.prototype.tryAppendExtension=function(e,t){return/(\.[a-z]*$)|([?;].*)$/.test(e)?e:e+t},e.prototype.tryAppendLessExtension=function(e){return this.tryAppendExtension(e,".less")},e.prototype.supportsSync=function(){return!1},e.prototype.alwaysMakePathsAbsolute=function(){return!1},e.prototype.isPathAbsolute=function(e){return/^(?:[a-z-]+:|\/|\\|#)/i.test(e)},e.prototype.join=function(e,t){return e?e+t:t},e.prototype.pathDiff=function(e,t){var i,n,r,s,o=this.extractUrlParts(e),a=this.extractUrlParts(t),l="";if(o.hostPart!==a.hostPart)return"";for(n=Math.max(a.directories.length,o.directories.length),i=0;iparseInt(t[i])?-1:1;return 0},e.prototype.versionToString=function(e){for(var t="",i=0;i1?e-1:e)<1?r+(s-r)*e*6:2*e<1?s:3*e<2?r+(s-r)*(2/3-e)*6:r}try{if(e instanceof h)return n=t?st(t):e.alpha,new h(e.rgb,n,"hsla");e=st(e)%360/360,t=tt(st(t)),i=tt(st(i)),n=tt(st(n)),r=2*i-(s=i<=.5?i*(t+1):i+t-i*t);var a=[255*o(e+1/3),255*o(e),255*o(e-1/3)];return n=st(n),new h(a,n,"hsla")}catch(e){}},hsv:function(e,t,i){return Ye.hsva(e,t,i,1)},hsva:function(e,t,i,n){var r,s;e=st(e)%360/360*360,t=st(t),i=st(i),n=st(n);var o=[i,i*(1-t),i*(1-(s=e/60-(r=Math.floor(e/60%6)))*t),i*(1-(1-s)*t)],a=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return Ye.rgba(255*o[a[r][0]],255*o[a[r][1]],255*o[a[r][2]],n)},hue:function(e){return new we(nt(e).h)},saturation:function(e){return new we(100*nt(e).s,"%")},lightness:function(e){return new we(100*nt(e).l,"%")},hsvhue:function(e){return new we(rt(e).h)},hsvsaturation:function(e){return new we(100*rt(e).s,"%")},hsvvalue:function(e){return new we(100*rt(e).v,"%")},red:function(e){return new we(e.rgb[0])},green:function(e){return new we(e.rgb[1])},blue:function(e){return new we(e.rgb[2])},alpha:function(e){return new we(nt(e).a)},luma:function(e){return new we(e.luma()*e.alpha*100,"%")},luminance:function(e){var t=.2126*e.rgb[0]/255+.7152*e.rgb[1]/255+.0722*e.rgb[2]/255;return new we(t*e.alpha*100,"%")},saturate:function(e,t,i){if(!e.rgb)return null;var n=nt(e);return void 0!==i&&"relative"===i.value?n.s+=n.s*t.value/100:n.s+=t.value/100,n.s=tt(n.s),it(e,n)},desaturate:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.s-=n.s*t.value/100:n.s-=t.value/100,n.s=tt(n.s),it(e,n)},lighten:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.l+=n.l*t.value/100:n.l+=t.value/100,n.l=tt(n.l),it(e,n)},darken:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.l-=n.l*t.value/100:n.l-=t.value/100,n.l=tt(n.l),it(e,n)},fadein:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.a+=n.a*t.value/100:n.a+=t.value/100,n.a=tt(n.a),it(e,n)},fadeout:function(e,t,i){var n=nt(e);return void 0!==i&&"relative"===i.value?n.a-=n.a*t.value/100:n.a-=t.value/100,n.a=tt(n.a),it(e,n)},fade:function(e,t){var i=nt(e);return i.a=t.value/100,i.a=tt(i.a),it(e,i)},spin:function(e,t){var i=nt(e),n=(i.h+t.value)%360;return i.h=n<0?360+n:n,it(e,i)},mix:function(e,t,i){i||(i=new we(50));var n=i.value/100,r=2*n-1,s=nt(e).a-nt(t).a,o=((r*s==-1?r:(r+s)/(1+r*s))+1)/2,a=1-o,l=[e.rgb[0]*o+t.rgb[0]*a,e.rgb[1]*o+t.rgb[1]*a,e.rgb[2]*o+t.rgb[2]*a],u=e.alpha*n+t.alpha*(1-n);return new h(l,u)},greyscale:function(e){return Ye.desaturate(e,new we(100))},contrast:function(e,t,i,n){if(!e.rgb)return null;if(void 0===i&&(i=Ye.rgba(255,255,255,1)),void 0===t&&(t=Ye.rgba(0,0,0,1)),t.luma()>i.luma()){var r=i;i=t,t=r}return n=void 0===n?.43:st(n),e.luma().5&&(n=1,i=e>.25?Math.sqrt(e):((16*e-12)*e+4)*e),e-(1-2*t)*n*(i-e)},hardlight:function(e,t){return lt.overlay(t,e)},difference:function(e,t){return Math.abs(e-t)},exclusion:function(e,t){return e+t-2*e*t},average:function(e,t){return(e+t)/2},negation:function(e,t){return 1-Math.abs(e+t-1)}};for(var ut in lt)lt.hasOwnProperty(ut)&&(at[ut]=at.bind(null,lt[ut]));var ht=function(e){return Array.isArray(e.value)?e.value:Array(e)},ct={_SELF:function(e){return e},"~":function(){for(var e=[],t=0;to.value)&&(c[n]=r);else{if(void 0!==l&&a!==l)throw{type:"Argument",message:"incompatible types"};f[a]=c.length,c.push(r)}else Array.isArray(t[i].value)&&Array.prototype.push.apply(t,Array.prototype.slice.call(t[i].value));return 1==c.length?c[0]:(t=c.map((function(e){return e.toCSS(h.context)})).join(this.context.compress?",":", "),new le((e?"min":"max")+"("+t+")"))},mt={min:function(){for(var e=[],t=0;t<'+u+'Gradient id="g" '+i+">",r=0;r";return n+=""+u+"Gradient>',n=encodeURIComponent(n),new Re(new Ee("'"+(n="data:image/svg+xml,"+n)+"'",n,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)}}),te.addMultiple(wt),t};function St(e,t){var i,n=(t=t||{}).variables,r=new D.Eval(t);"object"!=typeof n||Array.isArray(n)||(n=Object.keys(n).map((function(e){var t=n[e];return t instanceof He.Value||(t instanceof He.Expression||(t=new He.Expression([t])),t=new He.Value([t])),new He.Declaration("@"+e,t,!1,null,0)})),r.frames=[new He.Ruleset(null,n)]);var s,o,a=[new Y.JoinSelectorVisitor,new Y.MarkVisibleSelectorsVisitor(!0),new Y.ExtendVisitor,new Y.ToCSSVisitor({compress:Boolean(t.compress)})],l=[];if(t.pluginManager){o=t.pluginManager.visitor();for(var u=0;u<2;u++)for(o.first();s=o.get();)s.isPreEvalVisitor?0!==u&&-1!==l.indexOf(s)||(l.push(s),s.run(e)):0!==u&&-1!==a.indexOf(s)||(s.isPreVisitor?a.unshift(s):a.push(s))}i=e.eval(r);for(var h=0;h=t);i++);this.preProcessors.splice(i,0,{preProcessor:e,priority:t})},e.prototype.addPostProcessor=function(e,t){var i;for(i=0;i=t);i++);this.postProcessors.splice(i,0,{postProcessor:e,priority:t})},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.getPreProcessors=function(){for(var e=[],t=0;t0){var n=void 0,r=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?n=this.sourceMapURL:this._sourceMapFilename&&(n=this._sourceMapFilename),this.sourceMapURL=n,this.sourceMap=r}return this._css.join("")},t}()}(e=new s(e,t)),e)),a=function(e){return function(){function t(e,t,i){this.less=e,this.rootFilename=i.filename,this.paths=t.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=t.mime,this.error=null,this.context=t,this.queue=[],this.files={}}return t.prototype.push=function(t,i,n,s,o){var a=this,l=this.context.pluginManager.Loader;this.queue.push(t);var u=function(e,i,n){a.queue.splice(a.queue.indexOf(t),1);var l=n===a.rootFilename;s.optional&&e?(o(null,{rules:[]},!1,null),r.info("The file "+n+" was skipped because it was not found and the import was marked optional.")):(a.files[n]||s.inline||(a.files[n]={root:i,options:s}),e&&!a.error&&(a.error=e),o(e,i,l,n))},h={rewriteUrls:this.context.rewriteUrls,entryPath:n.entryPath,rootpath:n.rootpath,rootFilename:n.rootFilename},c=e.getFileManager(t,n.currentDirectory,this.context,e);if(c){var f,p,v=function(e){var t,i=e.filename,r=e.contents.replace(/^\uFEFF/,"");h.currentDirectory=c.getPath(i),h.rewriteUrls&&(h.rootpath=c.join(a.context.rootpath||"",c.pathDiff(h.currentDirectory,h.entryPath)),!c.isPathAbsolute(h.rootpath)&&c.alwaysMakePathsAbsolute()&&(h.rootpath=c.join(h.entryPath,h.rootpath))),h.filename=i;var o=new D.Parse(a.context);o.processImports=!1,a.contents[i]=r,(n.reference||s.reference)&&(h.reference=!0),s.isPlugin?(t=l.evalPlugin(r,o,a,s.pluginArgs,h))instanceof V?u(t,null,i):u(null,t,i):s.inline?u(null,r,i):!a.files[i]||a.files[i].options.multiple||s.multiple?new re(o,a,h).parse(r,(function(e,t){u(e,t,i)})):u(null,a.files[i].root,i)},d=_(this.context);i&&(d.ext=s.isPlugin?".js":".less"),s.isPlugin?(d.mime="application/javascript",d.syncImport?f=l.loadPluginSync(t,n.currentDirectory,d,e,c):p=l.loadPlugin(t,n.currentDirectory,d,e,c)):d.syncImport?f=c.loadFileSync(t,n.currentDirectory,d,e):p=c.loadFile(t,n.currentDirectory,d,e,(function(e,t){e?u(e):v(t)})),f?f.filename?v(f):u(f):p&&p.then(v,u)}else u({message:"Could not find a file-manager for "+t})},t}()}(e);var u,h=function(e,t){var i=function(e,n,r){if("function"==typeof n?(r=n,n=P(this.options,{})):n=P(this.options,n||{}),!r){var s=this;return new Promise((function(t,r){i.call(s,e,n,(function(e,i){e?r(e):t(i)}))}))}this.parse(e,n,(function(e,i,n,s){if(e)return r(e);var o;try{o=new t(i,n).toCSS(s)}catch(e){return r(e)}r(null,o)}))};return i}(0,o),c=function(e,t,i){var n=function(e,t,r){if("function"==typeof t?(r=t,t=P(this.options,{})):t=P(this.options,t||{}),!r){var s=this;return new Promise((function(i,r){n.call(s,e,t,(function(e,t){e?r(e):i(t)}))}))}var o,a=void 0,l=new kt(this,!t.reUsePluginManager);if(t.pluginManager=l,o=new D.Parse(t),t.rootFileInfo)a=t.rootFileInfo;else{var u=t.filename||"input",h=u.replace(/[^/\\]*$/,"");(a={filename:u,rewriteUrls:o.rewriteUrls,rootpath:o.rootpath||"",currentDirectory:h,entryPath:h,rootFilename:u}).rootpath&&"/"!==a.rootpath.slice(-1)&&(a.rootpath+="/")}var c=new i(this,o,a);this.importManager=c,t.plugins&&t.plugins.forEach((function(e){var t,i;if(e.fileContent){if(i=e.fileContent.replace(/^\uFEFF/,""),(t=l.Loader.evalPlugin(i,o,c,e.options,e.filename))instanceof V)return r(t)}else l.addPlugin(e)})),new re(o,c,a).parse(e,(function(e,i){if(e)return r(e);r(null,i,c,t)}),t)};return n}(0,0,a),f=Pt("v4.2.0"),p={version:[f.major,f.minor,f.patch],data:l,tree:He,Environment:s,AbstractFileManager:Qe,AbstractPluginLoader:Ke,environment:e,visitors:Y,Parser:re,functions:xt(e),contexts:D,SourceMapOutput:i,SourceMapBuilder:n,ParseTree:o,ImportManager:a,render:h,parse:c,LessError:V,transformTree:St,utils:R,PluginManager:kt,logger:r},v=function(e){return function(){var t=Object.create(e.prototype);return e.apply(t,Array.prototype.slice.call(arguments,0)),t}},d=Object.create(p);for(var m in p.tree)if("function"==typeof(u=p.tree[m]))d[m.toLowerCase()]=v(u);else for(var g in d[m]=Object.create(null),u)d[m][g.toLowerCase()]=v(u[g]);return p.parse=p.parse.bind(d),p.render=p.render.bind(d),d}var Et={},Rt=function(){};Rt.prototype=Object.assign(new Qe,{alwaysMakePathsAbsolute:function(){return!0},join:function(e,t){return e?this.extractUrlParts(t,e).path:t},doXHR:function(e,t,i,n){var r=new XMLHttpRequest,s=!_t.isFileProtocol||_t.fileAsync;function o(t,i,n){t.status>=200&&t.status<300?i(t.responseText,t.getResponseHeader("Last-Modified")):"function"==typeof n&&n(t.status,e)}"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/css"),At.debug("XHR: Getting '"+e+"'"),r.open("GET",e,s),r.setRequestHeader("Accept",t||"text/x-less, text/css; q=0.9, */*; q=0.5"),r.send(null),_t.isFileProtocol&&!_t.fileAsync?0===r.status||r.status>=200&&r.status<300?i(r.responseText):n(r.status,e):s?r.onreadystatechange=function(){4==r.readyState&&o(r,i,n)}:o(r,i,n)},supports:function(){return!0},clearFileCache:function(){Et={}},loadFile:function(e,t,i){t&&!this.isPathAbsolute(e)&&(e=t+e),e=i.ext?this.tryAppendExtension(e,i.ext):e,i=i||{};var n=this.extractUrlParts(e,window.location.href).url,r=this;return new Promise((function(e,t){if(i.useFileCache&&Et[n])try{var s=Et[n];return e({contents:s,filename:n,webInfo:{lastModified:new Date}})}catch(e){return t({filename:n,message:"Error loading file "+n+" error was "+e.message})}r.doXHR(n,i.mime,(function(t,i){Et[n]=t,e({contents:t,filename:n,webInfo:{lastModified:i}})}),(function(e,i){t({type:"File",message:"'"+i+"' wasn't found ("+e+")",href:n})}))}))}});var Ot=function(e,t){return _t=e,At=t,Rt},Vt=function(e){this.less=e};Vt.prototype=Object.assign(new Ke,{loadPlugin:function(e,t,i,n,r){return new Promise((function(s,o){r.loadFile(e,t,i,n).then(s).catch(o)}))}});var Ft=function(t,n,r){return{add:function(s,o){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting?function(e,t){var i=e.filename||t,s=[],o=(e.type||"Syntax")+"Error: "+(e.message||"There is an error in your .less file")+" in "+i,a=function(e,t,i){void 0!==e.extract[t]&&s.push("{line} {content}".replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,i).replace(/\{content\}/,e.extract[t]))};e.line&&(a(e,0,""),a(e,1,"line"),a(e,2,""),o+=" on line "+e.line+", column "+(e.column+1)+":\n"+s.join("\n")),e.stack&&(e.extract||r.logLevel>=4)&&(o+="\nStack Trace\n"+e.stack),n.logger.error(o)}(s,o):"function"==typeof r.errorReporting&&r.errorReporting("add",s,o):function(n,s){var o,a,l="less-error-message:"+e(s||""),u=t.document.createElement("div"),h=[],c=n.filename||s,f=c.match(/([^/]+(\?.*)?)$/)[1];u.id=l,u.className="less-error-message",a=""+(n.type||"Syntax")+"Error: "+(n.message||"There is an error in your .less file")+'
in '+f+" ";var p=function(e,t,i){void 0!==e.extract[t]&&h.push('
{content}
'.replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,i).replace(/\{content\}/,e.extract[t]))};n.line&&(p(n,0,""),p(n,1,"line"),p(n,2,""),a+="on line "+n.line+", column "+(n.column+1)+":"),n.stack&&(n.extract||r.logLevel>=4)&&(a+="
Stack Trace"+n.stack.split("\n").slice(1).join("
")),u.innerHTML=a,i(t.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),u.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===r.env&&(o=setInterval((function(){var e=t.document,i=e.body;i&&(e.getElementById(l)?i.replaceChild(u,e.getElementById(l)):i.insertBefore(u,i.firstChild),clearInterval(o))}),10))}(s,o)},remove:function(i){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting||"function"==typeof r.errorReporting&&r.errorReporting("remove",i):function(i){var n=t.document.getElementById("less-error-message:"+e(i));n&&n.parentNode.removeChild(n)}(i)}}},$t={javascriptEnabled:!1,depends:!1,compress:!1,lint:!1,paths:[],color:!0,strictImports:!1,insecure:!1,rootpath:"",rewriteUrls:!1,math:1,strictUnits:!1,globalVars:null,modifyVars:null,urlArgs:""};if(window.less)for(var Lt in window.less)Object.prototype.hasOwnProperty.call(window.less,Lt)&&($t[Lt]=window.less[Lt]);!function(e,i){t(i,n(e)),void 0===i.isFileProtocol&&(i.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(e.location.protocol)),i.async=i.async||!1,i.fileAsync=i.fileAsync||!1,i.poll=i.poll||(i.isFileProtocol?1e3:1500),i.env=i.env||("127.0.0.1"==e.location.hostname||"0.0.0.0"==e.location.hostname||"localhost"==e.location.hostname||e.location.port&&e.location.port.length>0||i.isFileProtocol?"development":"production");var r=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(e.location.hash);r&&(i.dumpLineNumbers=r[1]),void 0===i.useFileCache&&(i.useFileCache=!0),void 0===i.onReady&&(i.onReady=!0),i.relativeUrls&&(i.rewriteUrls="all")}(window,$t),$t.plugins=$t.plugins||[],window.LESS_PLUGINS&&($t.plugins=$t.plugins.concat(window.LESS_PLUGINS));var jt,Nt,Dt,Bt=function(e,n){var r=e.document,s=Mt();s.options=n;var o=s.environment,a=Ot(n,s.logger),l=new a;o.addFileManager(l),s.FileManager=a,s.PluginLoader=Vt,function(e,t){t.logLevel=void 0!==t.logLevel?t.logLevel:"development"===t.env?3:1,t.loggers||(t.loggers=[{debug:function(e){t.logLevel>=4&&console.log(e)},info:function(e){t.logLevel>=3&&console.log(e)},warn:function(e){t.logLevel>=2&&console.warn(e)},error:function(e){t.logLevel>=1&&console.error(e)}}]);for(var i=0;i 0 && styleNode.childNodes.length > 0 &&\n oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue);\n }\n\n const head = document.getElementsByTagName('head')[0];\n\n // If there is no oldStyleNode, just append; otherwise, only append if we need\n // to replace oldStyleNode with an updated stylesheet\n if (oldStyleNode === null || keepOldStyleNode === false) {\n const nextEl = sheet && sheet.nextSibling || null;\n if (nextEl) {\n nextEl.parentNode.insertBefore(styleNode, nextEl);\n } else {\n head.appendChild(styleNode);\n }\n }\n if (oldStyleNode && keepOldStyleNode === false) {\n oldStyleNode.parentNode.removeChild(oldStyleNode);\n }\n\n // For IE.\n // This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash.\n // See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head\n if (styleNode.styleSheet) {\n try {\n styleNode.styleSheet.cssText = styles;\n } catch (e) {\n throw new Error('Couldn\\'t reassign styleSheet.cssText.');\n }\n }\n },\n currentScript: function(window) {\n const document = window.document;\n return document.currentScript || (() => {\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n })();\n }\n};\n","export default {\n error: function(msg) {\n this._fireEvent('error', msg);\n },\n warn: function(msg) {\n this._fireEvent('warn', msg);\n },\n info: function(msg) {\n this._fireEvent('info', msg);\n },\n debug: function(msg) {\n this._fireEvent('debug', msg);\n },\n addListener: function(listener) {\n this._listeners.push(listener);\n },\n removeListener: function(listener) {\n for (let i = 0; i < this._listeners.length; i++) {\n if (this._listeners[i] === listener) {\n this._listeners.splice(i, 1);\n return;\n }\n }\n },\n _fireEvent: function(type, msg) {\n for (let i = 0; i < this._listeners.length; i++) {\n const logFunction = this._listeners[i][type];\n if (logFunction) {\n logFunction(msg);\n }\n }\n },\n _listeners: []\n};\n","/**\n * @todo Document why this abstraction exists, and the relationship between\n * environment, file managers, and plugin manager\n */\n\nimport logger from '../logger';\n\nclass Environment {\n constructor(externalEnvironment, fileManagers) {\n this.fileManagers = fileManagers || [];\n externalEnvironment = externalEnvironment || {};\n\n const optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator'];\n const requiredFunctions = [];\n const functions = requiredFunctions.concat(optionalFunctions);\n\n for (let i = 0; i < functions.length; i++) {\n const propName = functions[i];\n const environmentFunc = externalEnvironment[propName];\n if (environmentFunc) {\n this[propName] = environmentFunc.bind(externalEnvironment);\n } else if (i < requiredFunctions.length) {\n this.warn(`missing required function in environment - ${propName}`);\n }\n }\n }\n\n getFileManager(filename, currentDirectory, options, environment, isSync) {\n\n if (!filename) {\n logger.warn('getFileManager called with no filename.. Please report this issue. continuing.');\n }\n if (currentDirectory === undefined) {\n logger.warn('getFileManager called with null directory.. Please report this issue. continuing.');\n }\n\n let fileManagers = this.fileManagers;\n if (options.pluginManager) {\n fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers());\n }\n for (let i = fileManagers.length - 1; i >= 0 ; i--) {\n const fileManager = fileManagers[i];\n if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) {\n return fileManager;\n }\n }\n return null;\n }\n\n addFileManager(fileManager) {\n this.fileManagers.push(fileManager);\n }\n\n clearFileManagers() {\n this.fileManagers = [];\n }\n}\n\nexport default Environment;\n","export default {\n 'aliceblue':'#f0f8ff',\n 'antiquewhite':'#faebd7',\n 'aqua':'#00ffff',\n 'aquamarine':'#7fffd4',\n 'azure':'#f0ffff',\n 'beige':'#f5f5dc',\n 'bisque':'#ffe4c4',\n 'black':'#000000',\n 'blanchedalmond':'#ffebcd',\n 'blue':'#0000ff',\n 'blueviolet':'#8a2be2',\n 'brown':'#a52a2a',\n 'burlywood':'#deb887',\n 'cadetblue':'#5f9ea0',\n 'chartreuse':'#7fff00',\n 'chocolate':'#d2691e',\n 'coral':'#ff7f50',\n 'cornflowerblue':'#6495ed',\n 'cornsilk':'#fff8dc',\n 'crimson':'#dc143c',\n 'cyan':'#00ffff',\n 'darkblue':'#00008b',\n 'darkcyan':'#008b8b',\n 'darkgoldenrod':'#b8860b',\n 'darkgray':'#a9a9a9',\n 'darkgrey':'#a9a9a9',\n 'darkgreen':'#006400',\n 'darkkhaki':'#bdb76b',\n 'darkmagenta':'#8b008b',\n 'darkolivegreen':'#556b2f',\n 'darkorange':'#ff8c00',\n 'darkorchid':'#9932cc',\n 'darkred':'#8b0000',\n 'darksalmon':'#e9967a',\n 'darkseagreen':'#8fbc8f',\n 'darkslateblue':'#483d8b',\n 'darkslategray':'#2f4f4f',\n 'darkslategrey':'#2f4f4f',\n 'darkturquoise':'#00ced1',\n 'darkviolet':'#9400d3',\n 'deeppink':'#ff1493',\n 'deepskyblue':'#00bfff',\n 'dimgray':'#696969',\n 'dimgrey':'#696969',\n 'dodgerblue':'#1e90ff',\n 'firebrick':'#b22222',\n 'floralwhite':'#fffaf0',\n 'forestgreen':'#228b22',\n 'fuchsia':'#ff00ff',\n 'gainsboro':'#dcdcdc',\n 'ghostwhite':'#f8f8ff',\n 'gold':'#ffd700',\n 'goldenrod':'#daa520',\n 'gray':'#808080',\n 'grey':'#808080',\n 'green':'#008000',\n 'greenyellow':'#adff2f',\n 'honeydew':'#f0fff0',\n 'hotpink':'#ff69b4',\n 'indianred':'#cd5c5c',\n 'indigo':'#4b0082',\n 'ivory':'#fffff0',\n 'khaki':'#f0e68c',\n 'lavender':'#e6e6fa',\n 'lavenderblush':'#fff0f5',\n 'lawngreen':'#7cfc00',\n 'lemonchiffon':'#fffacd',\n 'lightblue':'#add8e6',\n 'lightcoral':'#f08080',\n 'lightcyan':'#e0ffff',\n 'lightgoldenrodyellow':'#fafad2',\n 'lightgray':'#d3d3d3',\n 'lightgrey':'#d3d3d3',\n 'lightgreen':'#90ee90',\n 'lightpink':'#ffb6c1',\n 'lightsalmon':'#ffa07a',\n 'lightseagreen':'#20b2aa',\n 'lightskyblue':'#87cefa',\n 'lightslategray':'#778899',\n 'lightslategrey':'#778899',\n 'lightsteelblue':'#b0c4de',\n 'lightyellow':'#ffffe0',\n 'lime':'#00ff00',\n 'limegreen':'#32cd32',\n 'linen':'#faf0e6',\n 'magenta':'#ff00ff',\n 'maroon':'#800000',\n 'mediumaquamarine':'#66cdaa',\n 'mediumblue':'#0000cd',\n 'mediumorchid':'#ba55d3',\n 'mediumpurple':'#9370d8',\n 'mediumseagreen':'#3cb371',\n 'mediumslateblue':'#7b68ee',\n 'mediumspringgreen':'#00fa9a',\n 'mediumturquoise':'#48d1cc',\n 'mediumvioletred':'#c71585',\n 'midnightblue':'#191970',\n 'mintcream':'#f5fffa',\n 'mistyrose':'#ffe4e1',\n 'moccasin':'#ffe4b5',\n 'navajowhite':'#ffdead',\n 'navy':'#000080',\n 'oldlace':'#fdf5e6',\n 'olive':'#808000',\n 'olivedrab':'#6b8e23',\n 'orange':'#ffa500',\n 'orangered':'#ff4500',\n 'orchid':'#da70d6',\n 'palegoldenrod':'#eee8aa',\n 'palegreen':'#98fb98',\n 'paleturquoise':'#afeeee',\n 'palevioletred':'#d87093',\n 'papayawhip':'#ffefd5',\n 'peachpuff':'#ffdab9',\n 'peru':'#cd853f',\n 'pink':'#ffc0cb',\n 'plum':'#dda0dd',\n 'powderblue':'#b0e0e6',\n 'purple':'#800080',\n 'rebeccapurple':'#663399',\n 'red':'#ff0000',\n 'rosybrown':'#bc8f8f',\n 'royalblue':'#4169e1',\n 'saddlebrown':'#8b4513',\n 'salmon':'#fa8072',\n 'sandybrown':'#f4a460',\n 'seagreen':'#2e8b57',\n 'seashell':'#fff5ee',\n 'sienna':'#a0522d',\n 'silver':'#c0c0c0',\n 'skyblue':'#87ceeb',\n 'slateblue':'#6a5acd',\n 'slategray':'#708090',\n 'slategrey':'#708090',\n 'snow':'#fffafa',\n 'springgreen':'#00ff7f',\n 'steelblue':'#4682b4',\n 'tan':'#d2b48c',\n 'teal':'#008080',\n 'thistle':'#d8bfd8',\n 'tomato':'#ff6347',\n 'turquoise':'#40e0d0',\n 'violet':'#ee82ee',\n 'wheat':'#f5deb3',\n 'white':'#ffffff',\n 'whitesmoke':'#f5f5f5',\n 'yellow':'#ffff00',\n 'yellowgreen':'#9acd32'\n};","export default {\n length: {\n 'm': 1,\n 'cm': 0.01,\n 'mm': 0.001,\n 'in': 0.0254,\n 'px': 0.0254 / 96,\n 'pt': 0.0254 / 72,\n 'pc': 0.0254 / 72 * 12\n },\n duration: {\n 's': 1,\n 'ms': 0.001\n },\n angle: {\n 'rad': 1 / (2 * Math.PI),\n 'deg': 1 / 360,\n 'grad': 1 / 400,\n 'turn': 1\n }\n};","import colors from './colors';\nimport unitConversions from './unit-conversions';\n\nexport default { colors, unitConversions };\n","/**\n * The reason why Node is a class and other nodes simply do not extend\n * from Node (since we're transpiling) is due to this issue:\n * \n * @see https://github.com/less/less.js/issues/3434\n */\nclass Node {\n constructor() {\n this.parent = null;\n this.visibilityBlocks = undefined;\n this.nodeVisible = undefined;\n this.rootNode = null;\n this.parsed = null;\n }\n\n get currentFileInfo() {\n return this.fileInfo();\n }\n\n get index() {\n return this.getIndex();\n }\n\n setParent(nodes, parent) {\n function set(node) {\n if (node && node instanceof Node) {\n node.parent = parent;\n }\n }\n if (Array.isArray(nodes)) {\n nodes.forEach(set);\n }\n else {\n set(nodes);\n }\n }\n\n getIndex() {\n return this._index || (this.parent && this.parent.getIndex()) || 0;\n }\n\n fileInfo() {\n return this._fileInfo || (this.parent && this.parent.fileInfo()) || {};\n }\n\n isRulesetLike() { return false; }\n\n toCSS(context) {\n const strs = [];\n this.genCSS(context, {\n // remove when genCSS has JSDoc types\n // eslint-disable-next-line no-unused-vars\n add: function(chunk, fileInfo, index) {\n strs.push(chunk);\n },\n isEmpty: function () {\n return strs.length === 0;\n }\n });\n return strs.join('');\n }\n\n genCSS(context, output) {\n output.add(this.value);\n }\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n }\n\n eval() { return this; }\n\n _operate(context, op, a, b) {\n switch (op) {\n case '+': return a + b;\n case '-': return a - b;\n case '*': return a * b;\n case '/': return a / b;\n }\n }\n\n fround(context, value) {\n const precision = context && context.numPrecision;\n // add \"epsilon\" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded:\n return (precision) ? Number((value + 2e-16).toFixed(precision)) : value;\n }\n\n static compare(a, b) {\n /* returns:\n -1: a < b\n 0: a = b\n 1: a > b\n and *any* other value for a != b (e.g. undefined, NaN, -2 etc.) */\n\n if ((a.compare) &&\n // for \"symmetric results\" force toCSS-based comparison\n // of Quoted or Anonymous if either value is one of those\n !(b.type === 'Quoted' || b.type === 'Anonymous')) {\n return a.compare(b);\n } else if (b.compare) {\n return -b.compare(a);\n } else if (a.type !== b.type) {\n return undefined;\n }\n\n a = a.value;\n b = b.value;\n if (!Array.isArray(a)) {\n return a === b ? 0 : undefined;\n }\n if (a.length !== b.length) {\n return undefined;\n }\n for (let i = 0; i < a.length; i++) {\n if (Node.compare(a[i], b[i]) !== 0) {\n return undefined;\n }\n }\n return 0;\n }\n\n static numericCompare(a, b) {\n return a < b ? -1\n : a === b ? 0\n : a > b ? 1 : undefined;\n }\n\n // Returns true if this node represents root of ast imported by reference\n blocksVisibility() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n return this.visibilityBlocks !== 0;\n }\n\n addVisibilityBlock() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks + 1;\n }\n\n removeVisibilityBlock() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks - 1;\n }\n\n // Turns on node visibility - if called node will be shown in output regardless\n // of whether it comes from import by reference or not\n ensureVisibility() {\n this.nodeVisible = true;\n }\n\n // Turns off node visibility - if called node will NOT be shown in output regardless\n // of whether it comes from import by reference or not\n ensureInvisibility() {\n this.nodeVisible = false;\n }\n\n // return values:\n // false - the node must not be visible\n // true - the node must be visible\n // undefined or null - the node has the same visibility as its parent\n isVisible() {\n return this.nodeVisible;\n }\n\n visibilityInfo() {\n return {\n visibilityBlocks: this.visibilityBlocks,\n nodeVisible: this.nodeVisible\n };\n }\n\n copyVisibilityInfo(info) {\n if (!info) {\n return;\n }\n this.visibilityBlocks = info.visibilityBlocks;\n this.nodeVisible = info.nodeVisible;\n }\n}\n\nexport default Node;\n","import Node from './node';\nimport colors from '../data/colors';\n\n//\n// RGB Colors - #ff0014, #eee\n//\nconst Color = function(rgb, a, originalForm) {\n const self = this;\n //\n // The end goal here, is to parse the arguments\n // into an integer triplet, such as `128, 255, 0`\n //\n // This facilitates operations and conversions.\n //\n if (Array.isArray(rgb)) {\n this.rgb = rgb;\n } else if (rgb.length >= 6) {\n this.rgb = [];\n rgb.match(/.{2}/g).map(function (c, i) {\n if (i < 3) {\n self.rgb.push(parseInt(c, 16));\n } else {\n self.alpha = (parseInt(c, 16)) / 255;\n }\n });\n } else {\n this.rgb = [];\n rgb.split('').map(function (c, i) {\n if (i < 3) {\n self.rgb.push(parseInt(c + c, 16));\n } else {\n self.alpha = (parseInt(c + c, 16)) / 255;\n }\n });\n }\n this.alpha = this.alpha || (typeof a === 'number' ? a : 1);\n if (typeof originalForm !== 'undefined') {\n this.value = originalForm;\n }\n}\n\nColor.prototype = Object.assign(new Node(), {\n type: 'Color',\n\n luma() {\n let r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255;\n\n r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4);\n g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4);\n b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4);\n\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n },\n\n toCSS(context, doNotCompress) {\n const compress = context && context.compress && !doNotCompress;\n let color;\n let alpha;\n let colorFunction;\n let args = [];\n\n // `value` is set if this color was originally\n // converted from a named color string so we need\n // to respect this and try to output named color too.\n alpha = this.fround(context, this.alpha);\n\n if (this.value) {\n if (this.value.indexOf('rgb') === 0) {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n } else if (this.value.indexOf('hsl') === 0) {\n if (alpha < 1) {\n colorFunction = 'hsla';\n } else {\n colorFunction = 'hsl';\n }\n } else {\n return this.value;\n }\n } else {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n }\n\n switch (colorFunction) {\n case 'rgba':\n args = this.rgb.map(function (c) {\n return clamp(Math.round(c), 255);\n }).concat(clamp(alpha, 1));\n break;\n case 'hsla':\n args.push(clamp(alpha, 1));\n // eslint-disable-next-line no-fallthrough\n case 'hsl':\n color = this.toHSL();\n args = [\n this.fround(context, color.h),\n `${this.fround(context, color.s * 100)}%`,\n `${this.fround(context, color.l * 100)}%`\n ].concat(args);\n }\n\n if (colorFunction) {\n // Values are capped between `0` and `255`, rounded and zero-padded.\n return `${colorFunction}(${args.join(`,${compress ? '' : ' '}`)})`;\n }\n\n color = this.toRGB();\n\n if (compress) {\n const splitcolor = color.split('');\n\n // Convert color to short format\n if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) {\n color = `#${splitcolor[1]}${splitcolor[3]}${splitcolor[5]}`;\n }\n }\n\n return color;\n },\n\n //\n // Operations have to be done per-channel, if not,\n // channels will spill onto each other. Once we have\n // our result, in the form of an integer triplet,\n // we create a new Color node to hold the result.\n //\n operate(context, op, other) {\n const rgb = new Array(3);\n const alpha = this.alpha * (1 - other.alpha) + other.alpha;\n for (let c = 0; c < 3; c++) {\n rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]);\n }\n return new Color(rgb, alpha);\n },\n\n toRGB() {\n return toHex(this.rgb);\n },\n\n toHSL() {\n const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;\n\n const max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h;\n let s;\n const l = (max + min) / 2;\n const d = max - min;\n\n if (max === min) {\n h = s = 0;\n } else {\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, l, a };\n },\n\n // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript\n toHSV() {\n const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;\n\n const max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h;\n let s;\n const v = max;\n\n const d = max - min;\n if (max === 0) {\n s = 0;\n } else {\n s = d / max;\n }\n\n if (max === min) {\n h = 0;\n } else {\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, v, a };\n },\n\n toARGB() {\n return toHex([this.alpha * 255].concat(this.rgb));\n },\n\n compare(x) {\n return (x.rgb &&\n x.rgb[0] === this.rgb[0] &&\n x.rgb[1] === this.rgb[1] &&\n x.rgb[2] === this.rgb[2] &&\n x.alpha === this.alpha) ? 0 : undefined;\n }\n});\n\nColor.fromKeyword = function(keyword) {\n let c;\n const key = keyword.toLowerCase();\n // eslint-disable-next-line no-prototype-builtins\n if (colors.hasOwnProperty(key)) {\n c = new Color(colors[key].slice(1));\n }\n else if (key === 'transparent') {\n c = new Color([0, 0, 0], 0);\n }\n\n if (c) {\n c.value = keyword;\n return c;\n }\n};\n\nfunction clamp(v, max) {\n return Math.min(Math.max(v, 0), max);\n}\n\nfunction toHex(v) {\n return `#${v.map(function (c) {\n c = clamp(Math.round(c), 255);\n return (c < 16 ? '0' : '') + c.toString(16);\n }).join('')}`;\n}\n\nexport default Color;\n","import Node from './node';\n\nconst Paren = function(node) {\n this.value = node;\n};\n\nParen.prototype = Object.assign(new Node(), {\n type: 'Paren',\n\n genCSS(context, output) {\n output.add('(');\n this.value.genCSS(context, output);\n output.add(')');\n },\n\n eval(context) {\n return new Paren(this.value.eval(context));\n }\n});\n\nexport default Paren;\n","import Node from './node';\nconst _noSpaceCombinators = {\n '': true,\n ' ': true,\n '|': true\n};\n\nconst Combinator = function(value) {\n if (value === ' ') {\n this.value = ' ';\n this.emptyOrWhitespace = true;\n } else {\n this.value = value ? value.trim() : '';\n this.emptyOrWhitespace = this.value === '';\n }\n}\n\nCombinator.prototype = Object.assign(new Node(), {\n type: 'Combinator',\n\n genCSS(context, output) {\n const spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' ';\n output.add(spaceOrEmpty + this.value + spaceOrEmpty);\n }\n});\n\nexport default Combinator;\n","import Node from './node';\nimport Paren from './paren';\nimport Combinator from './combinator';\n\nconst Element = function(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) {\n this.combinator = combinator instanceof Combinator ?\n combinator : new Combinator(combinator);\n\n if (typeof value === 'string') {\n this.value = value.trim();\n } else if (value) {\n this.value = value;\n } else {\n this.value = '';\n }\n this.isVariable = isVariable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.combinator, this);\n}\n\nElement.prototype = Object.assign(new Node(), {\n type: 'Element',\n\n accept(visitor) {\n const value = this.value;\n this.combinator = visitor.visit(this.combinator);\n if (typeof value === 'object') {\n this.value = visitor.visit(value);\n }\n },\n\n eval(context) {\n return new Element(this.combinator,\n this.value.eval ? this.value.eval(context) : this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n clone() {\n return new Element(this.combinator,\n this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context), this.fileInfo(), this.getIndex());\n },\n\n toCSS(context) {\n context = context || {};\n let value = this.value;\n const firstSelector = context.firstSelector;\n if (value instanceof Paren) {\n // selector in parens should not be affected by outer selector\n // flags (breaks only interpolated selectors - see #1973)\n context.firstSelector = true;\n }\n value = value.toCSS ? value.toCSS(context) : value;\n context.firstSelector = firstSelector;\n if (value === '' && this.combinator.value.charAt(0) === '&') {\n return '';\n } else {\n return this.combinator.toCSS(context) + value;\n }\n }\n});\n\nexport default Element;\n","\nexport const Math = {\n ALWAYS: 0,\n PARENS_DIVISION: 1,\n PARENS: 2\n // removed - STRICT_LEGACY: 3\n};\n\nexport const RewriteUrls = {\n OFF: 0,\n LOCAL: 1,\n ALL: 2\n};","/**\r\n * Returns the object type of the given payload\r\n *\r\n * @param {*} payload\r\n * @returns {string}\r\n */\r\nfunction getType(payload) {\r\n return Object.prototype.toString.call(payload).slice(8, -1);\r\n}\r\n/**\r\n * Returns whether the payload is undefined\r\n *\r\n * @param {*} payload\r\n * @returns {payload is undefined}\r\n */\r\nfunction isUndefined(payload) {\r\n return getType(payload) === 'Undefined';\r\n}\r\n/**\r\n * Returns whether the payload is null\r\n *\r\n * @param {*} payload\r\n * @returns {payload is null}\r\n */\r\nfunction isNull(payload) {\r\n return getType(payload) === 'Null';\r\n}\r\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Record}\r\n */\r\nfunction isPlainObject(payload) {\r\n if (getType(payload) !== 'Object')\r\n return false;\r\n return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;\r\n}\r\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Record}\r\n */\r\nfunction isObject(payload) {\r\n return isPlainObject(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is { [K in any]: never }}\r\n */\r\nfunction isEmptyObject(payload) {\r\n return isPlainObject(payload) && Object.keys(payload).length === 0;\r\n}\r\n/**\r\n * Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Record}\r\n */\r\nfunction isAnyObject(payload) {\r\n return getType(payload) === 'Object';\r\n}\r\n/**\r\n * Returns whether the payload is an object like a type passed in < >\r\n *\r\n * Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.\r\n *\r\n * @template T this must be passed in < >\r\n * @param {*} payload\r\n * @returns {payload is T}\r\n */\r\nfunction isObjectLike(payload) {\r\n return isAnyObject(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a function (regular or async)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is AnyFunction}\r\n */\r\nfunction isFunction(payload) {\r\n return typeof payload === \"function\";\r\n}\r\n/**\r\n * Returns whether the payload is an array\r\n *\r\n * @param {any} payload\r\n * @returns {payload is any[]}\r\n */\r\nfunction isArray(payload) {\r\n return getType(payload) === 'Array';\r\n}\r\n/**\r\n * Returns whether the payload is a an array with at least 1 item\r\n *\r\n * @param {*} payload\r\n * @returns {payload is any[]}\r\n */\r\nfunction isFullArray(payload) {\r\n return isArray(payload) && payload.length > 0;\r\n}\r\n/**\r\n * Returns whether the payload is a an empty array\r\n *\r\n * @param {*} payload\r\n * @returns {payload is []}\r\n */\r\nfunction isEmptyArray(payload) {\r\n return isArray(payload) && payload.length === 0;\r\n}\r\n/**\r\n * Returns whether the payload is a string\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isString(payload) {\r\n return getType(payload) === 'String';\r\n}\r\n/**\r\n * Returns whether the payload is a string, BUT returns false for ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isFullString(payload) {\r\n return isString(payload) && payload !== '';\r\n}\r\n/**\r\n * Returns whether the payload is ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isEmptyString(payload) {\r\n return payload === '';\r\n}\r\n/**\r\n * Returns whether the payload is a number (but not NaN)\r\n *\r\n * This will return `false` for `NaN`!!\r\n *\r\n * @param {*} payload\r\n * @returns {payload is number}\r\n */\r\nfunction isNumber(payload) {\r\n return getType(payload) === 'Number' && !isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a boolean\r\n *\r\n * @param {*} payload\r\n * @returns {payload is boolean}\r\n */\r\nfunction isBoolean(payload) {\r\n return getType(payload) === 'Boolean';\r\n}\r\n/**\r\n * Returns whether the payload is a regular expression (RegExp)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is RegExp}\r\n */\r\nfunction isRegExp(payload) {\r\n return getType(payload) === 'RegExp';\r\n}\r\n/**\r\n * Returns whether the payload is a Map\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Map}\r\n */\r\nfunction isMap(payload) {\r\n return getType(payload) === 'Map';\r\n}\r\n/**\r\n * Returns whether the payload is a WeakMap\r\n *\r\n * @param {*} payload\r\n * @returns {payload is WeakMap}\r\n */\r\nfunction isWeakMap(payload) {\r\n return getType(payload) === 'WeakMap';\r\n}\r\n/**\r\n * Returns whether the payload is a Set\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Set}\r\n */\r\nfunction isSet(payload) {\r\n return getType(payload) === 'Set';\r\n}\r\n/**\r\n * Returns whether the payload is a WeakSet\r\n *\r\n * @param {*} payload\r\n * @returns {payload is WeakSet}\r\n */\r\nfunction isWeakSet(payload) {\r\n return getType(payload) === 'WeakSet';\r\n}\r\n/**\r\n * Returns whether the payload is a Symbol\r\n *\r\n * @param {*} payload\r\n * @returns {payload is symbol}\r\n */\r\nfunction isSymbol(payload) {\r\n return getType(payload) === 'Symbol';\r\n}\r\n/**\r\n * Returns whether the payload is a Date, and that the date is valid\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Date}\r\n */\r\nfunction isDate(payload) {\r\n return getType(payload) === 'Date' && !isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a Blob\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Blob}\r\n */\r\nfunction isBlob(payload) {\r\n return getType(payload) === 'Blob';\r\n}\r\n/**\r\n * Returns whether the payload is a File\r\n *\r\n * @param {*} payload\r\n * @returns {payload is File}\r\n */\r\nfunction isFile(payload) {\r\n return getType(payload) === 'File';\r\n}\r\n/**\r\n * Returns whether the payload is a Promise\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Promise}\r\n */\r\nfunction isPromise(payload) {\r\n return getType(payload) === 'Promise';\r\n}\r\n/**\r\n * Returns whether the payload is an Error\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Error}\r\n */\r\nfunction isError(payload) {\r\n return getType(payload) === 'Error';\r\n}\r\n/**\r\n * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is typeof NaN}\r\n */\r\nfunction isNaNValue(payload) {\r\n return getType(payload) === 'Number' && isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is boolean | null | undefined | number | string | symbol)}\r\n */\r\nfunction isPrimitive(payload) {\r\n return (isBoolean(payload) ||\r\n isNull(payload) ||\r\n isUndefined(payload) ||\r\n isNumber(payload) ||\r\n isString(payload) ||\r\n isSymbol(payload));\r\n}\r\n/**\r\n * Returns true whether the payload is null or undefined\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is null | undefined)}\r\n */\r\nfunction isNullOrUndefined(payload) {\r\n return isNull(payload) || isUndefined(payload);\r\n}\r\n/**\r\n * Does a generic check to check that the given payload is of a given type.\r\n * In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!);\r\n * It will, however, differentiate between object and null\r\n *\r\n * @template T\r\n * @param {*} payload\r\n * @param {T} type\r\n * @throws {TypeError} Will throw type error if type is an invalid type\r\n * @returns {payload is T}\r\n */\r\nfunction isType(payload, type) {\r\n if (!(type instanceof Function)) {\r\n throw new TypeError('Type must be a function');\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {\r\n throw new TypeError('Type is not a class');\r\n }\r\n // Classes usually have names (as functions usually have names)\r\n var name = type.name;\r\n return getType(payload) === name || Boolean(payload && payload.constructor === type);\r\n}\n\nexport { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyArray, isEmptyObject, isEmptyString, isError, isFile, isFullArray, isFullString, isFunction, isMap, isNaNValue, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isType, isUndefined, isWeakMap, isWeakSet };\n","import { isArray, isPlainObject } from 'is-what';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\n\nfunction assignProp(carry, key, newVal, originalObject, includeNonenumerable) {\r\n var propType = {}.propertyIsEnumerable.call(originalObject, key)\r\n ? 'enumerable'\r\n : 'nonenumerable';\r\n if (propType === 'enumerable')\r\n carry[key] = newVal;\r\n if (includeNonenumerable && propType === 'nonenumerable') {\r\n Object.defineProperty(carry, key, {\r\n value: newVal,\r\n enumerable: false,\r\n writable: true,\r\n configurable: true,\r\n });\r\n }\r\n}\r\n/**\r\n * Copy (clone) an object and all its props recursively to get rid of any prop referenced of the original object. Arrays are also cloned, however objects inside arrays are still linked.\r\n *\r\n * @export\r\n * @template T\r\n * @param {T} target Target can be anything\r\n * @param {Options} [options={}] Options can be `props` or `nonenumerable`\r\n * @returns {T} the target with replaced values\r\n * @export\r\n */\r\nfunction copy(target, options) {\r\n if (options === void 0) { options = {}; }\r\n if (isArray(target))\r\n return target.map(function (i) { return copy(i, options); });\r\n if (!isPlainObject(target))\r\n return target;\r\n var props = Object.getOwnPropertyNames(target);\r\n var symbols = Object.getOwnPropertySymbols(target);\r\n return __spreadArrays(props, symbols).reduce(function (carry, key) {\r\n if (isArray(options.props) && !options.props.includes(key)) {\r\n return carry;\r\n }\r\n var val = target[key];\r\n var newVal = copy(val, options);\r\n assignProp(carry, key, newVal, target, options.nonenumerable);\r\n return carry;\r\n }, {});\r\n}\n\nexport { copy };\n","/* jshint proto: true */\nimport * as Constants from './constants';\nimport { copy } from 'copy-anything';\n\nexport function getLocation(index, inputStream) {\n let n = index + 1;\n let line = null;\n let column = -1;\n\n while (--n >= 0 && inputStream.charAt(n) !== '\\n') {\n column++;\n }\n\n if (typeof index === 'number') {\n line = (inputStream.slice(0, index).match(/\\n/g) || '').length;\n }\n\n return {\n line,\n column\n };\n}\n\nexport function copyArray(arr) {\n let i;\n const length = arr.length;\n const copy = new Array(length);\n\n for (i = 0; i < length; i++) {\n copy[i] = arr[i];\n }\n return copy;\n}\n\nexport function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n}\n\nexport function defaults(obj1, obj2) {\n let newObj = obj2 || {};\n if (!obj2._defaults) {\n newObj = {};\n const defaults = copy(obj1);\n newObj._defaults = defaults;\n const cloned = obj2 ? copy(obj2) : {};\n Object.assign(newObj, defaults, cloned);\n }\n return newObj;\n}\n\nexport function copyOptions(obj1, obj2) {\n if (obj2 && obj2._defaults) {\n return obj2;\n }\n const opts = defaults(obj1, obj2);\n if (opts.strictMath) {\n opts.math = Constants.Math.PARENS;\n }\n // Back compat with changed relativeUrls option\n if (opts.relativeUrls) {\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n }\n if (typeof opts.math === 'string') {\n switch (opts.math.toLowerCase()) {\n case 'always':\n opts.math = Constants.Math.ALWAYS;\n break;\n case 'parens-division':\n opts.math = Constants.Math.PARENS_DIVISION;\n break;\n case 'strict':\n case 'parens':\n opts.math = Constants.Math.PARENS;\n break;\n default:\n opts.math = Constants.Math.PARENS;\n }\n }\n if (typeof opts.rewriteUrls === 'string') {\n switch (opts.rewriteUrls.toLowerCase()) {\n case 'off':\n opts.rewriteUrls = Constants.RewriteUrls.OFF;\n break;\n case 'local':\n opts.rewriteUrls = Constants.RewriteUrls.LOCAL;\n break;\n case 'all':\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n break;\n }\n }\n return opts;\n}\n\nexport function merge(obj1, obj2) {\n for (const prop in obj2) {\n if (Object.prototype.hasOwnProperty.call(obj2, prop)) {\n obj1[prop] = obj2[prop];\n }\n }\n return obj1;\n}\n\nexport function flattenArray(arr, result = []) {\n for (let i = 0, length = arr.length; i < length; i++) {\n const value = arr[i];\n if (Array.isArray(value)) {\n flattenArray(value, result);\n } else {\n if (value !== undefined) {\n result.push(value);\n }\n }\n }\n return result;\n}\n\nexport function isNullOrUndefined(val) {\n return val === null || val === undefined\n}","import * as utils from './utils';\n\nconst anonymousFunc = /(|Function):(\\d+):(\\d+)/;\n\n/**\n * This is a centralized class of any error that could be thrown internally (mostly by the parser).\n * Besides standard .message it keeps some additional data like a path to the file where the error\n * occurred along with line and column numbers.\n *\n * @class\n * @extends Error\n * @type {module.LessError}\n *\n * @prop {string} type\n * @prop {string} filename\n * @prop {number} index\n * @prop {number} line\n * @prop {number} column\n * @prop {number} callLine\n * @prop {number} callExtract\n * @prop {string[]} extract\n *\n * @param {Object} e - An error object to wrap around or just a descriptive object\n * @param {Object} fileContentMap - An object with file contents in 'contents' property (like importManager) @todo - move to fileManager?\n * @param {string} [currentFilename]\n */\nconst LessError = function(e, fileContentMap, currentFilename) {\n Error.call(this);\n\n const filename = e.filename || currentFilename;\n\n this.message = e.message;\n this.stack = e.stack;\n\n if (fileContentMap && filename) {\n const input = fileContentMap.contents[filename];\n const loc = utils.getLocation(e.index, input);\n var line = loc.line;\n const col = loc.column;\n const callLine = e.call && utils.getLocation(e.call, input).line;\n const lines = input ? input.split('\\n') : '';\n\n this.type = e.type || 'Syntax';\n this.filename = filename;\n this.index = e.index;\n this.line = typeof line === 'number' ? line + 1 : null;\n this.column = col;\n\n if (!this.line && this.stack) {\n const found = this.stack.match(anonymousFunc);\n\n /**\n * We have to figure out how this environment stringifies anonymous functions\n * so we can correctly map plugin errors.\n * \n * Note, in Node 8, the output of anonymous funcs varied based on parameters\n * being present or not, so we inject dummy params.\n */\n const func = new Function('a', 'throw new Error()');\n let lineAdjust = 0;\n try {\n func();\n } catch (e) {\n const match = e.stack.match(anonymousFunc);\n lineAdjust = 1 - parseInt(match[2]);\n }\n\n if (found) {\n if (found[2]) {\n this.line = parseInt(found[2]) + lineAdjust;\n }\n if (found[3]) {\n this.column = parseInt(found[3]);\n }\n }\n }\n\n this.callLine = callLine + 1;\n this.callExtract = lines[callLine];\n\n this.extract = [\n lines[this.line - 2],\n lines[this.line - 1],\n lines[this.line]\n ];\n }\n\n};\n\nif (typeof Object.create === 'undefined') {\n const F = function () {};\n F.prototype = Error.prototype;\n LessError.prototype = new F();\n} else {\n LessError.prototype = Object.create(Error.prototype);\n}\n\nLessError.prototype.constructor = LessError;\n\n/**\n * An overridden version of the default Object.prototype.toString\n * which uses additional information to create a helpful message.\n *\n * @param {Object} options\n * @returns {string}\n */\nLessError.prototype.toString = function(options) {\n options = options || {};\n\n let message = '';\n const extract = this.extract || [];\n let error = [];\n let stylize = function (str) { return str; };\n if (options.stylize) {\n const type = typeof options.stylize;\n if (type !== 'function') {\n throw Error(`options.stylize should be a function, got a ${type}!`);\n }\n stylize = options.stylize;\n }\n\n if (this.line !== null) {\n if (typeof extract[0] === 'string') {\n error.push(stylize(`${this.line - 1} ${extract[0]}`, 'grey'));\n }\n\n if (typeof extract[1] === 'string') {\n let errorTxt = `${this.line} `;\n if (extract[1]) {\n errorTxt += extract[1].slice(0, this.column) +\n stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') +\n extract[1].slice(this.column + 1), 'red'), 'inverse');\n }\n error.push(errorTxt);\n }\n\n if (typeof extract[2] === 'string') {\n error.push(stylize(`${this.line + 1} ${extract[2]}`, 'grey'));\n }\n error = `${error.join('\\n') + stylize('', 'reset')}\\n`;\n }\n\n message += stylize(`${this.type}Error: ${this.message}`, 'red');\n if (this.filename) {\n message += stylize(' in ', 'red') + this.filename;\n }\n if (this.line) {\n message += stylize(` on line ${this.line}, column ${this.column + 1}:`, 'grey');\n }\n\n message += `\\n${error}`;\n\n if (this.callLine) {\n message += `${stylize('from ', 'red') + (this.filename || '')}/n`;\n message += `${stylize(this.callLine, 'grey')} ${this.callExtract}/n`;\n }\n\n return message;\n};\n\nexport default LessError;","import tree from '../tree';\n\nconst _visitArgs = { visitDeeper: true };\nlet _hasIndexed = false;\n\nfunction _noop(node) {\n return node;\n}\n\nfunction indexNodeTypes(parent, ticker) {\n // add .typeIndex to tree node types for lookup table\n let key, child;\n for (key in parent) { \n /* eslint guard-for-in: 0 */\n child = parent[key];\n switch (typeof child) {\n case 'function':\n // ignore bound functions directly on tree which do not have a prototype\n // or aren't nodes\n if (child.prototype && child.prototype.type) {\n child.prototype.typeIndex = ticker++;\n }\n break;\n case 'object':\n ticker = indexNodeTypes(child, ticker);\n break;\n \n }\n }\n return ticker;\n}\n\nclass Visitor {\n constructor(implementation) {\n this._implementation = implementation;\n this._visitInCache = {};\n this._visitOutCache = {};\n\n if (!_hasIndexed) {\n indexNodeTypes(tree, 1);\n _hasIndexed = true;\n }\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n\n const nodeTypeIndex = node.typeIndex;\n if (!nodeTypeIndex) {\n // MixinCall args aren't a node type?\n if (node.value && node.value.typeIndex) {\n this.visit(node.value);\n }\n return node;\n }\n\n const impl = this._implementation;\n let func = this._visitInCache[nodeTypeIndex];\n let funcOut = this._visitOutCache[nodeTypeIndex];\n const visitArgs = _visitArgs;\n let fnName;\n\n visitArgs.visitDeeper = true;\n\n if (!func) {\n fnName = `visit${node.type}`;\n func = impl[fnName] || _noop;\n funcOut = impl[`${fnName}Out`] || _noop;\n this._visitInCache[nodeTypeIndex] = func;\n this._visitOutCache[nodeTypeIndex] = funcOut;\n }\n\n if (func !== _noop) {\n const newNode = func.call(impl, node, visitArgs);\n if (node && impl.isReplacing) {\n node = newNode;\n }\n }\n\n if (visitArgs.visitDeeper && node) {\n if (node.length) {\n for (let i = 0, cnt = node.length; i < cnt; i++) {\n if (node[i].accept) {\n node[i].accept(this);\n }\n }\n } else if (node.accept) {\n node.accept(this);\n }\n }\n\n if (funcOut != _noop) {\n funcOut.call(impl, node);\n }\n\n return node;\n }\n\n visitArray(nodes, nonReplacing) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n\n // Non-replacing\n if (nonReplacing || !this._implementation.isReplacing) {\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n // Replacing\n const out = [];\n for (i = 0; i < cnt; i++) {\n const evald = this.visit(nodes[i]);\n if (evald === undefined) { continue; }\n if (!evald.splice) {\n out.push(evald);\n } else if (evald.length) {\n this.flatten(evald, out);\n }\n }\n return out;\n }\n\n flatten(arr, out) {\n if (!out) {\n out = [];\n }\n\n let cnt, i, item, nestedCnt, j, nestedItem;\n\n for (i = 0, cnt = arr.length; i < cnt; i++) {\n item = arr[i];\n if (item === undefined) {\n continue;\n }\n if (!item.splice) {\n out.push(item);\n continue;\n }\n\n for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) {\n nestedItem = item[j];\n if (nestedItem === undefined) {\n continue;\n }\n if (!nestedItem.splice) {\n out.push(nestedItem);\n } else if (nestedItem.length) {\n this.flatten(nestedItem, out);\n }\n }\n }\n\n return out;\n }\n}\n\nexport default Visitor;\n","const contexts = {};\nexport default contexts;\nimport * as Constants from './constants';\n\nconst copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) {\n if (!original) { return; }\n\n for (let i = 0; i < propertiesToCopy.length; i++) {\n if (Object.prototype.hasOwnProperty.call(original, propertiesToCopy[i])) {\n destination[propertiesToCopy[i]] = original[propertiesToCopy[i]];\n }\n }\n};\n\n/*\n parse is used whilst parsing\n */\nconst parseCopyProperties = [\n // options\n 'paths', // option - unmodified - paths to search for imports on\n 'rewriteUrls', // option - whether to adjust URL's to be relative\n 'rootpath', // option - rootpath to append to URL's\n 'strictImports', // option -\n 'insecure', // option - whether to allow imports from insecure ssl hosts\n 'dumpLineNumbers', // option - whether to dump line numbers\n 'compress', // option - whether to compress\n 'syncImport', // option - whether to import synchronously\n 'chunkInput', // option - whether to chunk input. more performant but causes parse issues.\n 'mime', // browser only - mime type for sheet import\n 'useFileCache', // browser only - whether to use the per file session cache\n // context\n 'processImports', // option & context - whether to process imports. if false then imports will not be imported.\n // Used by the import manager to stop multiple import visitors being created.\n 'pluginManager' // Used as the plugin manager for the session\n];\n\ncontexts.Parse = function(options) {\n copyFromOriginal(options, this, parseCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n};\n\nconst evalCopyProperties = [\n 'paths', // additional include paths\n 'compress', // whether to compress\n 'math', // whether math has to be within parenthesis\n 'strictUnits', // whether units need to evaluate correctly\n 'sourceMap', // whether to output a source map\n 'importMultiple', // whether we are currently importing multiple copies\n 'urlArgs', // whether to add args into url tokens\n 'javascriptEnabled', // option - whether Inline JavaScript is enabled. if undefined, defaults to false\n 'pluginManager', // Used as the plugin manager for the session\n 'importantScope', // used to bubble up !important statements\n 'rewriteUrls' // option - whether to adjust URL's to be relative\n];\n\ncontexts.Eval = function(options, frames) {\n copyFromOriginal(options, this, evalCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n\n this.frames = frames || [];\n this.importantScope = this.importantScope || [];\n};\n\ncontexts.Eval.prototype.enterCalc = function () {\n if (!this.calcStack) {\n this.calcStack = [];\n }\n this.calcStack.push(true);\n this.inCalc = true;\n};\n\ncontexts.Eval.prototype.exitCalc = function () {\n this.calcStack.pop();\n if (!this.calcStack.length) {\n this.inCalc = false;\n }\n};\n\ncontexts.Eval.prototype.inParenthesis = function () {\n if (!this.parensStack) {\n this.parensStack = [];\n }\n this.parensStack.push(true);\n};\n\ncontexts.Eval.prototype.outOfParenthesis = function () {\n this.parensStack.pop();\n};\n\ncontexts.Eval.prototype.inCalc = false;\ncontexts.Eval.prototype.mathOn = true;\ncontexts.Eval.prototype.isMathOn = function (op) {\n if (!this.mathOn) {\n return false;\n }\n if (op === '/' && this.math !== Constants.Math.ALWAYS && (!this.parensStack || !this.parensStack.length)) {\n return false;\n }\n if (this.math > Constants.Math.PARENS_DIVISION) {\n return this.parensStack && this.parensStack.length;\n }\n return true;\n};\n\ncontexts.Eval.prototype.pathRequiresRewrite = function (path) {\n const isRelative = this.rewriteUrls === Constants.RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative;\n\n return isRelative(path);\n};\n\ncontexts.Eval.prototype.rewritePath = function (path, rootpath) {\n let newPath;\n\n rootpath = rootpath || '';\n newPath = this.normalizePath(rootpath + path);\n\n // If a path was explicit relative and the rootpath was not an absolute path\n // we must ensure that the new path is also explicit relative.\n if (isPathLocalRelative(path) &&\n isPathRelative(rootpath) &&\n isPathLocalRelative(newPath) === false) {\n newPath = `./${newPath}`;\n }\n\n return newPath;\n};\n\ncontexts.Eval.prototype.normalizePath = function (path) {\n const segments = path.split('/').reverse();\n let segment;\n\n path = [];\n while (segments.length !== 0) {\n segment = segments.pop();\n switch ( segment ) {\n case '.':\n break;\n case '..':\n if ((path.length === 0) || (path[path.length - 1] === '..')) {\n path.push( segment );\n } else {\n path.pop();\n }\n break;\n default:\n path.push(segment);\n break;\n }\n }\n\n return path.join('/');\n};\n\nfunction isPathRelative(path) {\n return !/^(?:[a-z-]+:|\\/|#)/i.test(path);\n}\n\nfunction isPathLocalRelative(path) {\n return path.charAt(0) === '.';\n}\n\n// todo - do the same for the toCSS ?\n","class ImportSequencer {\n constructor(onSequencerEmpty) {\n this.imports = [];\n this.variableImports = [];\n this._onSequencerEmpty = onSequencerEmpty;\n this._currentDepth = 0;\n }\n\n addImport(callback) {\n const importSequencer = this,\n importItem = {\n callback,\n args: null,\n isReady: false\n };\n this.imports.push(importItem);\n return function() {\n importItem.args = Array.prototype.slice.call(arguments, 0);\n importItem.isReady = true;\n importSequencer.tryRun();\n };\n }\n\n addVariableImport(callback) {\n this.variableImports.push(callback);\n }\n\n tryRun() {\n this._currentDepth++;\n try {\n while (true) {\n while (this.imports.length > 0) {\n const importItem = this.imports[0];\n if (!importItem.isReady) {\n return;\n }\n this.imports = this.imports.slice(1);\n importItem.callback.apply(null, importItem.args);\n }\n if (this.variableImports.length === 0) {\n break;\n }\n const variableImport = this.variableImports[0];\n this.variableImports = this.variableImports.slice(1);\n variableImport();\n }\n } finally {\n this._currentDepth--;\n }\n if (this._currentDepth === 0 && this._onSequencerEmpty) {\n this._onSequencerEmpty();\n }\n }\n}\n\nexport default ImportSequencer;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport contexts from '../contexts';\nimport Visitor from './visitor';\nimport ImportSequencer from './import-sequencer';\nimport * as utils from '../utils';\n\nconst ImportVisitor = function(importer, finish) {\n\n this._visitor = new Visitor(this);\n this._importer = importer;\n this._finish = finish;\n this.context = new contexts.Eval();\n this.importCount = 0;\n this.onceFileDetectionMap = {};\n this.recursionDetector = {};\n this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this));\n};\n\nImportVisitor.prototype = {\n isReplacing: false,\n run: function (root) {\n try {\n // process the contents\n this._visitor.visit(root);\n }\n catch (e) {\n this.error = e;\n }\n\n this.isFinished = true;\n this._sequencer.tryRun();\n },\n _onSequencerEmpty: function() {\n if (!this.isFinished) {\n return;\n }\n this._finish(this.error);\n },\n visitImport: function (importNode, visitArgs) {\n const inlineCSS = importNode.options.inline;\n\n if (!importNode.css || inlineCSS) {\n\n const context = new contexts.Eval(this.context, utils.copyArray(this.context.frames));\n const importParent = context.frames[0];\n\n this.importCount++;\n if (importNode.isVariableImport()) {\n this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent));\n } else {\n this.processImportNode(importNode, context, importParent);\n }\n }\n visitArgs.visitDeeper = false;\n },\n processImportNode: function(importNode, context, importParent) {\n let evaldImportNode;\n const inlineCSS = importNode.options.inline;\n\n try {\n evaldImportNode = importNode.evalForImport(context);\n } catch (e) {\n if (!e.filename) { e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename; }\n // attempt to eval properly and treat as css\n importNode.css = true;\n // if that fails, this error will be thrown\n importNode.error = e;\n }\n\n if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) {\n\n if (evaldImportNode.options.multiple) {\n context.importMultiple = true;\n }\n\n // try appending if we haven't determined if it is css or not\n const tryAppendLessExtension = evaldImportNode.css === undefined;\n\n for (let i = 0; i < importParent.rules.length; i++) {\n if (importParent.rules[i] === importNode) {\n importParent.rules[i] = evaldImportNode;\n break;\n }\n }\n\n const onImported = this.onImported.bind(this, evaldImportNode, context), sequencedOnImported = this._sequencer.addImport(onImported);\n\n this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(),\n evaldImportNode.options, sequencedOnImported);\n } else {\n this.importCount--;\n if (this.isFinished) {\n this._sequencer.tryRun();\n }\n }\n },\n onImported: function (importNode, context, e, root, importedAtRoot, fullPath) {\n if (e) {\n if (!e.filename) {\n e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename;\n }\n this.error = e;\n }\n\n const importVisitor = this,\n inlineCSS = importNode.options.inline,\n isPlugin = importNode.options.isPlugin,\n isOptional = importNode.options.optional,\n duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector;\n\n if (!context.importMultiple) {\n if (duplicateImport) {\n importNode.skip = true;\n } else {\n importNode.skip = function() {\n if (fullPath in importVisitor.onceFileDetectionMap) {\n return true;\n }\n importVisitor.onceFileDetectionMap[fullPath] = true;\n return false;\n };\n }\n }\n\n if (!fullPath && isOptional) {\n importNode.skip = true;\n }\n\n if (root) {\n importNode.root = root;\n importNode.importedFilename = fullPath;\n\n if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) {\n importVisitor.recursionDetector[fullPath] = true;\n\n const oldContext = this.context;\n this.context = context;\n try {\n this._visitor.visit(root);\n } catch (e) {\n this.error = e;\n }\n this.context = oldContext;\n }\n }\n\n importVisitor.importCount--;\n\n if (importVisitor.isFinished) {\n importVisitor._sequencer.tryRun();\n }\n },\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.unshift(declNode);\n } else {\n visitArgs.visitDeeper = false;\n }\n },\n visitDeclarationOut: function(declNode) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.shift();\n }\n },\n visitAtRule: function (atRuleNode, visitArgs) {\n this.context.frames.unshift(atRuleNode);\n },\n visitAtRuleOut: function (atRuleNode) {\n this.context.frames.shift();\n },\n visitMixinDefinition: function (mixinDefinitionNode, visitArgs) {\n this.context.frames.unshift(mixinDefinitionNode);\n },\n visitMixinDefinitionOut: function (mixinDefinitionNode) {\n this.context.frames.shift();\n },\n visitRuleset: function (rulesetNode, visitArgs) {\n this.context.frames.unshift(rulesetNode);\n },\n visitRulesetOut: function (rulesetNode) {\n this.context.frames.shift();\n },\n visitMedia: function (mediaNode, visitArgs) {\n this.context.frames.unshift(mediaNode.rules[0]);\n },\n visitMediaOut: function (mediaNode) {\n this.context.frames.shift();\n }\n};\nexport default ImportVisitor;\n","class SetTreeVisibilityVisitor {\n constructor(visible) {\n this.visible = visible;\n }\n\n run(root) {\n this.visit(root);\n }\n\n visitArray(nodes) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n if (node.constructor === Array) {\n return this.visitArray(node);\n }\n\n if (!node.blocksVisibility || node.blocksVisibility()) {\n return node;\n }\n if (this.visible) {\n node.ensureVisibility();\n } else {\n node.ensureInvisibility();\n }\n\n node.accept(this);\n return node;\n }\n}\n\nexport default SetTreeVisibilityVisitor;","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport tree from '../tree';\nimport Visitor from './visitor';\nimport logger from '../logger';\nimport * as utils from '../utils';\n\n/* jshint loopfunc:true */\n\nclass ExtendFinderVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n this.contexts = [];\n this.allExtendsStack = [[]];\n }\n\n run(root) {\n root = this._visitor.visit(root);\n root.allExtends = this.allExtendsStack[0];\n return root;\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n\n let i;\n let j;\n let extend;\n const allSelectorsExtendList = [];\n let extendList;\n\n // get &:extend(.a); rules which apply to all selectors in this ruleset\n const rules = rulesetNode.rules, ruleCnt = rules ? rules.length : 0;\n for (i = 0; i < ruleCnt; i++) {\n if (rulesetNode.rules[i] instanceof tree.Extend) {\n allSelectorsExtendList.push(rules[i]);\n rulesetNode.extendOnEveryPath = true;\n }\n }\n\n // now find every selector and apply the extends that apply to all extends\n // and the ones which apply to an individual extend\n const paths = rulesetNode.paths;\n for (i = 0; i < paths.length; i++) {\n const selectorPath = paths[i], selector = selectorPath[selectorPath.length - 1], selExtendList = selector.extendList;\n\n extendList = selExtendList ? utils.copyArray(selExtendList).concat(allSelectorsExtendList)\n : allSelectorsExtendList;\n\n if (extendList) {\n extendList = extendList.map(function(allSelectorsExtend) {\n return allSelectorsExtend.clone();\n });\n }\n\n for (j = 0; j < extendList.length; j++) {\n this.foundExtends = true;\n extend = extendList[j];\n extend.findSelfSelectors(selectorPath);\n extend.ruleset = rulesetNode;\n if (j === 0) { extend.firstExtendOnThisSelectorPath = true; }\n this.allExtendsStack[this.allExtendsStack.length - 1].push(extend);\n }\n }\n\n this.contexts.push(rulesetNode.selectors);\n }\n\n visitRulesetOut(rulesetNode) {\n if (!rulesetNode.root) {\n this.contexts.length = this.contexts.length - 1;\n }\n }\n\n visitMedia(mediaNode, visitArgs) {\n mediaNode.allExtends = [];\n this.allExtendsStack.push(mediaNode.allExtends);\n }\n\n visitMediaOut(mediaNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n atRuleNode.allExtends = [];\n this.allExtendsStack.push(atRuleNode.allExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n}\n\nclass ProcessExtendsVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n const extendFinder = new ExtendFinderVisitor();\n this.extendIndices = {};\n extendFinder.run(root);\n if (!extendFinder.foundExtends) { return root; }\n root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends));\n this.allExtendsStack = [root.allExtends];\n const newRoot = this._visitor.visit(root);\n this.checkExtendsForNonMatched(root.allExtends);\n return newRoot;\n }\n\n checkExtendsForNonMatched(extendList) {\n const indices = this.extendIndices;\n extendList.filter(function(extend) {\n return !extend.hasFoundMatches && extend.parent_ids.length == 1;\n }).forEach(function(extend) {\n let selector = '_unknown_';\n try {\n selector = extend.selector.toCSS({});\n }\n catch (_) {}\n\n if (!indices[`${extend.index} ${selector}`]) {\n indices[`${extend.index} ${selector}`] = true;\n logger.warn(`extend '${selector}' has no matches`);\n }\n });\n }\n\n doExtendChaining(extendsList, extendsListTarget, iterationCount) {\n //\n // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering\n // and pasting the selector we would do normally, but we are also adding an extend with the same target selector\n // this means this new extend can then go and alter other extends\n //\n // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors\n // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already\n // processed if we look at each selector at a time, as is done in visitRuleset\n\n let extendIndex;\n\n let targetExtendIndex;\n let matches;\n const extendsToAdd = [];\n let newSelector;\n const extendVisitor = this;\n let selectorPath;\n let extend;\n let targetExtend;\n let newExtend;\n\n iterationCount = iterationCount || 0;\n\n // loop through comparing every extend with every target extend.\n // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place\n // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one\n // and the second is the target.\n // the separation into two lists allows us to process a subset of chains with a bigger set, as is the\n // case when processing media queries\n for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) {\n for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) {\n\n extend = extendsList[extendIndex];\n targetExtend = extendsListTarget[targetExtendIndex];\n\n // look for circular references\n if ( extend.parent_ids.indexOf( targetExtend.object_id ) >= 0 ) { continue; }\n\n // find a match in the target extends self selector (the bit before :extend)\n selectorPath = [targetExtend.selfSelectors[0]];\n matches = extendVisitor.findMatch(extend, selectorPath);\n\n if (matches.length) {\n extend.hasFoundMatches = true;\n\n // we found a match, so for each self selector..\n extend.selfSelectors.forEach(function(selfSelector) {\n const info = targetExtend.visibilityInfo();\n\n // process the extend as usual\n newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible());\n\n // but now we create a new extend from it\n newExtend = new(tree.Extend)(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info);\n newExtend.selfSelectors = newSelector;\n\n // add the extend onto the list of extends for that selector\n newSelector[newSelector.length - 1].extendList = [newExtend];\n\n // record that we need to add it.\n extendsToAdd.push(newExtend);\n newExtend.ruleset = targetExtend.ruleset;\n\n // remember its parents for circular references\n newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids);\n\n // only process the selector once.. if we have :extend(.a,.b) then multiple\n // extends will look at the same selector path, so when extending\n // we know that any others will be duplicates in terms of what is added to the css\n if (targetExtend.firstExtendOnThisSelectorPath) {\n newExtend.firstExtendOnThisSelectorPath = true;\n targetExtend.ruleset.paths.push(newSelector);\n }\n });\n }\n }\n }\n\n if (extendsToAdd.length) {\n // try to detect circular references to stop a stack overflow.\n // may no longer be needed.\n this.extendChainCount++;\n if (iterationCount > 100) {\n let selectorOne = '{unable to calculate}';\n let selectorTwo = '{unable to calculate}';\n try {\n selectorOne = extendsToAdd[0].selfSelectors[0].toCSS();\n selectorTwo = extendsToAdd[0].selector.toCSS();\n }\n catch (e) {}\n throw { message: `extend circular reference detected. One of the circular extends is currently:${selectorOne}:extend(${selectorTwo})`};\n }\n\n // now process the new extends on the existing rules so that we can handle a extending b extending c extending\n // d extending e...\n return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1));\n } else {\n return extendsToAdd;\n }\n }\n\n visitDeclaration(ruleNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitSelector(selectorNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n let matches;\n let pathIndex;\n let extendIndex;\n const allExtends = this.allExtendsStack[this.allExtendsStack.length - 1];\n const selectorsToAdd = [];\n const extendVisitor = this;\n let selectorPath;\n\n // look at each selector path in the ruleset, find any extend matches and then copy, find and replace\n\n for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) {\n for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) {\n selectorPath = rulesetNode.paths[pathIndex];\n\n // extending extends happens initially, before the main pass\n if (rulesetNode.extendOnEveryPath) { continue; }\n const extendList = selectorPath[selectorPath.length - 1].extendList;\n if (extendList && extendList.length) { continue; }\n\n matches = this.findMatch(allExtends[extendIndex], selectorPath);\n\n if (matches.length) {\n allExtends[extendIndex].hasFoundMatches = true;\n\n allExtends[extendIndex].selfSelectors.forEach(function(selfSelector) {\n let extendedSelectors;\n extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible());\n selectorsToAdd.push(extendedSelectors);\n });\n }\n }\n }\n rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd);\n }\n\n findMatch(extend, haystackSelectorPath) {\n //\n // look through the haystack selector path to try and find the needle - extend.selector\n // returns an array of selector matches that can then be replaced\n //\n let haystackSelectorIndex;\n\n let hackstackSelector;\n let hackstackElementIndex;\n let haystackElement;\n let targetCombinator;\n let i;\n const extendVisitor = this;\n const needleElements = extend.selector.elements;\n const potentialMatches = [];\n let potentialMatch;\n const matches = [];\n\n // loop through the haystack elements\n for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) {\n hackstackSelector = haystackSelectorPath[haystackSelectorIndex];\n\n for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) {\n\n haystackElement = hackstackSelector.elements[hackstackElementIndex];\n\n // if we allow elements before our match we can add a potential match every time. otherwise only at the first element.\n if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) {\n potentialMatches.push({pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0,\n initialCombinator: haystackElement.combinator});\n }\n\n for (i = 0; i < potentialMatches.length; i++) {\n potentialMatch = potentialMatches[i];\n\n // selectors add \" \" onto the first element. When we use & it joins the selectors together, but if we don't\n // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to\n // work out what the resulting combinator will be\n targetCombinator = haystackElement.combinator.value;\n if (targetCombinator === '' && hackstackElementIndex === 0) {\n targetCombinator = ' ';\n }\n\n // if we don't match, null our match to indicate failure\n if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) ||\n (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) {\n potentialMatch = null;\n } else {\n potentialMatch.matched++;\n }\n\n // if we are still valid and have finished, test whether we have elements after and whether these are allowed\n if (potentialMatch) {\n potentialMatch.finished = potentialMatch.matched === needleElements.length;\n if (potentialMatch.finished &&\n (!extend.allowAfter &&\n (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) {\n potentialMatch = null;\n }\n }\n // if null we remove, if not, we are still valid, so either push as a valid match or continue\n if (potentialMatch) {\n if (potentialMatch.finished) {\n potentialMatch.length = needleElements.length;\n potentialMatch.endPathIndex = haystackSelectorIndex;\n potentialMatch.endPathElementIndex = hackstackElementIndex + 1; // index after end of match\n potentialMatches.length = 0; // we don't allow matches to overlap, so start matching again\n matches.push(potentialMatch);\n }\n } else {\n potentialMatches.splice(i, 1);\n i--;\n }\n }\n }\n }\n return matches;\n }\n\n isElementValuesEqual(elementValue1, elementValue2) {\n if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') {\n return elementValue1 === elementValue2;\n }\n if (elementValue1 instanceof tree.Attribute) {\n if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) {\n return false;\n }\n if (!elementValue1.value || !elementValue2.value) {\n if (elementValue1.value || elementValue2.value) {\n return false;\n }\n return true;\n }\n elementValue1 = elementValue1.value.value || elementValue1.value;\n elementValue2 = elementValue2.value.value || elementValue2.value;\n return elementValue1 === elementValue2;\n }\n elementValue1 = elementValue1.value;\n elementValue2 = elementValue2.value;\n if (elementValue1 instanceof tree.Selector) {\n if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) {\n return false;\n }\n for (let i = 0; i < elementValue1.elements.length; i++) {\n if (elementValue1.elements[i].combinator.value !== elementValue2.elements[i].combinator.value) {\n if (i !== 0 || (elementValue1.elements[i].combinator.value || ' ') !== (elementValue2.elements[i].combinator.value || ' ')) {\n return false;\n }\n }\n if (!this.isElementValuesEqual(elementValue1.elements[i].value, elementValue2.elements[i].value)) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n\n extendSelector(matches, selectorPath, replacementSelector, isVisible) {\n\n // for a set of matches, replace each match with the replacement selector\n\n let currentSelectorPathIndex = 0, currentSelectorPathElementIndex = 0, path = [], matchIndex, selector, firstElement, match, newElements;\n\n for (matchIndex = 0; matchIndex < matches.length; matchIndex++) {\n match = matches[matchIndex];\n selector = selectorPath[match.pathIndex];\n firstElement = new tree.Element(\n match.initialCombinator,\n replacementSelector.elements[0].value,\n replacementSelector.elements[0].isVariable,\n replacementSelector.elements[0].getIndex(),\n replacementSelector.elements[0].fileInfo()\n );\n\n if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n\n newElements = selector.elements\n .slice(currentSelectorPathElementIndex, match.index)\n .concat([firstElement])\n .concat(replacementSelector.elements.slice(1));\n\n if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) {\n path[path.length - 1].elements =\n path[path.length - 1].elements.concat(newElements);\n } else {\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex));\n\n path.push(new tree.Selector(\n newElements\n ));\n }\n currentSelectorPathIndex = match.endPathIndex;\n currentSelectorPathElementIndex = match.endPathElementIndex;\n if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) {\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n }\n\n if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathIndex++;\n }\n\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length));\n path = path.map(function (currentValue) {\n // we can re-use elements here, because the visibility property matters only for selectors\n const derived = currentValue.createDerived(currentValue.elements);\n if (isVisible) {\n derived.ensureVisibility();\n } else {\n derived.ensureInvisibility();\n }\n return derived;\n });\n return path;\n }\n\n visitMedia(mediaNode, visitArgs) {\n let newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitMediaOut(mediaNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n let newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n}\n\nexport default ProcessExtendsVisitor;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport Visitor from './visitor';\n\nclass JoinSelectorVisitor {\n constructor() {\n this.contexts = [[]];\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n return this._visitor.visit(root);\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n const paths = [];\n let selectors;\n\n this.contexts.push(paths);\n\n if (!rulesetNode.root) {\n selectors = rulesetNode.selectors;\n if (selectors) {\n selectors = selectors.filter(function(selector) { return selector.getIsOutput(); });\n rulesetNode.selectors = selectors.length ? selectors : (selectors = null);\n if (selectors) { rulesetNode.joinSelectors(paths, context, selectors); }\n }\n if (!selectors) { rulesetNode.rules = null; }\n rulesetNode.paths = paths;\n }\n }\n\n visitRulesetOut(rulesetNode) {\n this.contexts.length = this.contexts.length - 1;\n }\n\n visitMedia(mediaNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia);\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n if (atRuleNode.rules && atRuleNode.rules.length) {\n atRuleNode.rules[0].root = (atRuleNode.isRooted || context.length === 0 || null);\n }\n }\n}\n\nexport default JoinSelectorVisitor;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport tree from '../tree';\nimport Visitor from './visitor';\n\nclass CSSVisitorUtils {\n constructor(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n }\n\n containsSilentNonBlockedChild(bodyRules) {\n let rule;\n if (!bodyRules) {\n return false;\n }\n for (let r = 0; r < bodyRules.length; r++) {\n rule = bodyRules[r];\n if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) {\n // the atrule contains something that was referenced (likely by extend)\n // therefore it needs to be shown in output too\n return true;\n }\n }\n return false;\n }\n\n keepOnlyVisibleChilds(owner) {\n if (owner && owner.rules) {\n owner.rules = owner.rules.filter(thing => thing.isVisible());\n }\n }\n\n isEmpty(owner) {\n return (owner && owner.rules) \n ? (owner.rules.length === 0) : true;\n }\n\n hasVisibleSelector(rulesetNode) {\n return (rulesetNode && rulesetNode.paths)\n ? (rulesetNode.paths.length > 0) : false;\n }\n\n resolveVisibility(node) {\n if (!node.blocksVisibility()) {\n if (this.isEmpty(node)) {\n return ;\n }\n\n return node;\n }\n\n const compiledRulesBody = node.rules[0];\n this.keepOnlyVisibleChilds(compiledRulesBody);\n\n if (this.isEmpty(compiledRulesBody)) {\n return ;\n }\n\n node.ensureVisibility();\n node.removeVisibilityBlock();\n\n return node;\n }\n\n isVisibleRuleset(rulesetNode) {\n if (rulesetNode.firstRoot) {\n return true;\n }\n\n if (this.isEmpty(rulesetNode)) {\n return false;\n }\n\n if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) {\n return false;\n }\n\n return true;\n }\n}\n\nconst ToCSSVisitor = function(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n this.utils = new CSSVisitorUtils(context);\n};\n\nToCSSVisitor.prototype = {\n isReplacing: true,\n run: function (root) {\n return this._visitor.visit(root);\n },\n\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.blocksVisibility() || declNode.variable) {\n return;\n }\n return declNode;\n },\n\n visitMixinDefinition: function (mixinNode, visitArgs) {\n // mixin definitions do not get eval'd - this means they keep state\n // so we have to clear that state here so it isn't used if toCSS is called twice\n mixinNode.frames = [];\n },\n\n visitExtend: function (extendNode, visitArgs) {\n },\n\n visitComment: function (commentNode, visitArgs) {\n if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) {\n return;\n }\n return commentNode;\n },\n\n visitMedia: function(mediaNode, visitArgs) {\n const originalRules = mediaNode.rules[0].rules;\n mediaNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n return this.utils.resolveVisibility(mediaNode, originalRules);\n },\n\n visitImport: function (importNode, visitArgs) {\n if (importNode.blocksVisibility()) {\n return ;\n }\n return importNode;\n },\n\n visitAtRule: function(atRuleNode, visitArgs) {\n if (atRuleNode.rules && atRuleNode.rules.length) {\n return this.visitAtRuleWithBody(atRuleNode, visitArgs);\n } else {\n return this.visitAtRuleWithoutBody(atRuleNode, visitArgs);\n }\n },\n\n visitAnonymous: function(anonymousNode, visitArgs) {\n if (!anonymousNode.blocksVisibility()) {\n anonymousNode.accept(this._visitor);\n return anonymousNode;\n }\n },\n\n visitAtRuleWithBody: function(atRuleNode, visitArgs) {\n // if there is only one nested ruleset and that one has no path, then it is\n // just fake ruleset\n function hasFakeRuleset(atRuleNode) {\n const bodyRules = atRuleNode.rules;\n return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0);\n }\n function getBodyRules(atRuleNode) {\n const nodeRules = atRuleNode.rules;\n if (hasFakeRuleset(atRuleNode)) {\n return nodeRules[0].rules;\n }\n\n return nodeRules;\n }\n // it is still true that it is only one ruleset in array\n // this is last such moment\n // process childs\n const originalRules = getBodyRules(atRuleNode);\n atRuleNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n if (!this.utils.isEmpty(atRuleNode)) {\n this._mergeRules(atRuleNode.rules[0].rules);\n }\n\n return this.utils.resolveVisibility(atRuleNode, originalRules);\n },\n\n visitAtRuleWithoutBody: function(atRuleNode, visitArgs) {\n if (atRuleNode.blocksVisibility()) {\n return;\n }\n\n if (atRuleNode.name === '@charset') {\n // Only output the debug info together with subsequent @charset definitions\n // a comment (or @media statement) before the actual @charset atrule would\n // be considered illegal css as it has to be on the first line\n if (this.charset) {\n if (atRuleNode.debugInfo) {\n const comment = new tree.Comment(`/* ${atRuleNode.toCSS(this._context).replace(/\\n/g, '')} */\\n`);\n comment.debugInfo = atRuleNode.debugInfo;\n return this._visitor.visit(comment);\n }\n return;\n }\n this.charset = true;\n }\n\n return atRuleNode;\n },\n\n checkValidNodes: function(rules, isRoot) {\n if (!rules) {\n return;\n }\n\n for (let i = 0; i < rules.length; i++) {\n const ruleNode = rules[i];\n if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) {\n throw { message: 'Properties must be inside selector blocks. They cannot be in the root',\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode instanceof tree.Call) {\n throw { message: `Function '${ruleNode.name}' did not return a root node`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode.type && !ruleNode.allowRoot) {\n throw { message: `${ruleNode.type} node returned by a function is not valid here`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n }\n },\n\n visitRuleset: function (rulesetNode, visitArgs) {\n // at this point rulesets are nested into each other\n let rule;\n\n const rulesets = [];\n\n this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot);\n\n if (!rulesetNode.root) {\n // remove invisible paths\n this._compileRulesetPaths(rulesetNode);\n\n // remove rulesets from this ruleset body and compile them separately\n const nodeRules = rulesetNode.rules;\n\n let nodeRuleCnt = nodeRules ? nodeRules.length : 0;\n for (let i = 0; i < nodeRuleCnt; ) {\n rule = nodeRules[i];\n if (rule && rule.rules) {\n // visit because we are moving them out from being a child\n rulesets.push(this._visitor.visit(rule));\n nodeRules.splice(i, 1);\n nodeRuleCnt--;\n continue;\n }\n i++;\n }\n // accept the visitor to remove rules and refactor itself\n // then we can decide nogw whether we want it or not\n // compile body\n if (nodeRuleCnt > 0) {\n rulesetNode.accept(this._visitor);\n } else {\n rulesetNode.rules = null;\n }\n visitArgs.visitDeeper = false;\n } else { // if (! rulesetNode.root) {\n rulesetNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n }\n\n if (rulesetNode.rules) {\n this._mergeRules(rulesetNode.rules);\n this._removeDuplicateRules(rulesetNode.rules);\n }\n\n // now decide whether we keep the ruleset\n if (this.utils.isVisibleRuleset(rulesetNode)) {\n rulesetNode.ensureVisibility();\n rulesets.splice(0, 0, rulesetNode);\n }\n\n if (rulesets.length === 1) {\n return rulesets[0];\n }\n return rulesets;\n },\n\n _compileRulesetPaths: function(rulesetNode) {\n if (rulesetNode.paths) {\n rulesetNode.paths = rulesetNode.paths\n .filter(p => {\n let i;\n if (p[0].elements[0].combinator.value === ' ') {\n p[0].elements[0].combinator = new(tree.Combinator)('');\n }\n for (i = 0; i < p.length; i++) {\n if (p[i].isVisible() && p[i].getIsOutput()) {\n return true;\n }\n }\n return false;\n });\n }\n },\n\n _removeDuplicateRules: function(rules) {\n if (!rules) { return; }\n\n // remove duplicates\n const ruleCache = {};\n\n let ruleList;\n let rule;\n let i;\n\n for (i = rules.length - 1; i >= 0 ; i--) {\n rule = rules[i];\n if (rule instanceof tree.Declaration) {\n if (!ruleCache[rule.name]) {\n ruleCache[rule.name] = rule;\n } else {\n ruleList = ruleCache[rule.name];\n if (ruleList instanceof tree.Declaration) {\n ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)];\n }\n const ruleCSS = rule.toCSS(this._context);\n if (ruleList.indexOf(ruleCSS) !== -1) {\n rules.splice(i, 1);\n } else {\n ruleList.push(ruleCSS);\n }\n }\n }\n }\n },\n\n _mergeRules: function(rules) {\n if (!rules) {\n return; \n }\n\n const groups = {};\n const groupsArr = [];\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n if (rule.merge) {\n const key = rule.name;\n groups[key] ? rules.splice(i--, 1) : \n groupsArr.push(groups[key] = []);\n groups[key].push(rule);\n }\n }\n\n groupsArr.forEach(group => {\n if (group.length > 0) {\n const result = group[0];\n let space = [];\n const comma = [new tree.Expression(space)];\n group.forEach(rule => {\n if ((rule.merge === '+') && (space.length > 0)) {\n comma.push(new tree.Expression(space = []));\n }\n space.push(rule.value);\n result.important = result.important || rule.important;\n });\n result.value = new tree.Value(comma);\n }\n });\n }\n};\n\nexport default ToCSSVisitor;\n","import Visitor from './visitor';\nimport ImportVisitor from './import-visitor';\nimport MarkVisibleSelectorsVisitor from './set-tree-visibility-visitor';\nimport ExtendVisitor from './extend-visitor';\nimport JoinSelectorVisitor from './join-selector-visitor';\nimport ToCSSVisitor from './to-css-visitor';\n\nexport default {\n Visitor,\n ImportVisitor,\n MarkVisibleSelectorsVisitor,\n ExtendVisitor,\n JoinSelectorVisitor,\n ToCSSVisitor\n};\n","import chunker from './chunker';\n\nexport default () => {\n let // Less input string\n input;\n\n let // current chunk\n j;\n\n const // holds state for backtracking\n saveStack = [];\n\n let // furthest index the parser has gone to\n furthest;\n\n let // if this is furthest we got to, this is the probably cause\n furthestPossibleErrorMessage;\n\n let // chunkified input\n chunks;\n\n let // current chunk\n current;\n\n let // index of current chunk, in `input`\n currentPos;\n\n const parserInput = {};\n const CHARCODE_SPACE = 32;\n const CHARCODE_TAB = 9;\n const CHARCODE_LF = 10;\n const CHARCODE_CR = 13;\n const CHARCODE_PLUS = 43;\n const CHARCODE_COMMA = 44;\n const CHARCODE_FORWARD_SLASH = 47;\n const CHARCODE_9 = 57;\n\n function skipWhitespace(length) {\n const oldi = parserInput.i;\n const oldj = j;\n const curr = parserInput.i - currentPos;\n const endIndex = parserInput.i + current.length - curr;\n const mem = (parserInput.i += length);\n const inp = input;\n let c;\n let nextChar;\n let comment;\n\n for (; parserInput.i < endIndex; parserInput.i++) {\n c = inp.charCodeAt(parserInput.i);\n\n if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) {\n nextChar = inp.charAt(parserInput.i + 1);\n if (nextChar === '/') {\n comment = {index: parserInput.i, isLineComment: true};\n let nextNewLine = inp.indexOf('\\n', parserInput.i + 2);\n if (nextNewLine < 0) {\n nextNewLine = endIndex;\n }\n parserInput.i = nextNewLine;\n comment.text = inp.substr(comment.index, parserInput.i - comment.index);\n parserInput.commentStore.push(comment);\n continue;\n } else if (nextChar === '*') {\n const nextStarSlash = inp.indexOf('*/', parserInput.i + 2);\n if (nextStarSlash >= 0) {\n comment = {\n index: parserInput.i,\n text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i),\n isLineComment: false\n };\n parserInput.i += comment.text.length - 1;\n parserInput.commentStore.push(comment);\n continue;\n }\n }\n break;\n }\n\n if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) {\n break;\n }\n }\n\n current = current.slice(length + parserInput.i - mem + curr);\n currentPos = parserInput.i;\n\n if (!current.length) {\n if (j < chunks.length - 1) {\n current = chunks[++j];\n skipWhitespace(0); // skip space at the beginning of a chunk\n return true; // things changed\n }\n parserInput.finished = true;\n }\n\n return oldi !== parserInput.i || oldj !== j;\n }\n\n parserInput.save = () => {\n currentPos = parserInput.i;\n saveStack.push( { current, i: parserInput.i, j });\n };\n parserInput.restore = possibleErrorMessage => {\n\n if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) {\n furthest = parserInput.i;\n furthestPossibleErrorMessage = possibleErrorMessage;\n }\n const state = saveStack.pop();\n current = state.current;\n currentPos = parserInput.i = state.i;\n j = state.j;\n };\n parserInput.forget = () => {\n saveStack.pop();\n };\n parserInput.isWhitespace = offset => {\n const pos = parserInput.i + (offset || 0);\n const code = input.charCodeAt(pos);\n return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF);\n };\n\n // Specialization of $(tok)\n parserInput.$re = tok => {\n if (parserInput.i > currentPos) {\n current = current.slice(parserInput.i - currentPos);\n currentPos = parserInput.i;\n }\n\n const m = tok.exec(current);\n if (!m) {\n return null;\n }\n\n skipWhitespace(m[0].length);\n if (typeof m === 'string') {\n return m;\n }\n\n return m.length === 1 ? m[0] : m;\n };\n\n parserInput.$char = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n skipWhitespace(1);\n return tok;\n };\n\n parserInput.$peekChar = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n return tok;\n };\n\n parserInput.$str = tok => {\n const tokLength = tok.length;\n\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tokLength; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return null;\n }\n }\n\n skipWhitespace(tokLength);\n return tok;\n };\n\n parserInput.$quoted = loc => {\n const pos = loc || parserInput.i;\n const startChar = input.charAt(pos);\n\n if (startChar !== '\\'' && startChar !== '\"') {\n return;\n }\n const length = input.length;\n const currentPosition = pos;\n\n for (let i = 1; i + currentPosition < length; i++) {\n const nextChar = input.charAt(i + currentPosition);\n switch (nextChar) {\n case '\\\\':\n i++;\n continue;\n case '\\r':\n case '\\n':\n break;\n case startChar: {\n const str = input.substr(currentPosition, i + 1);\n if (!loc && loc !== 0) {\n skipWhitespace(i + 1);\n return str\n }\n return [startChar, str];\n }\n default:\n }\n }\n return null;\n };\n\n /**\n * Permissive parsing. Ignores everything except matching {} [] () and quotes\n * until matching token (outside of blocks)\n */\n parserInput.$parseUntil = tok => {\n let quote = '';\n let returnVal = null;\n let inComment = false;\n let blockDepth = 0;\n const blockStack = [];\n const parseGroups = [];\n const length = input.length;\n const startPos = parserInput.i;\n let lastPos = parserInput.i;\n let i = parserInput.i;\n let loop = true;\n let testChar;\n\n if (typeof tok === 'string') {\n testChar = char => char === tok\n } else {\n testChar = char => tok.test(char)\n }\n\n do {\n let nextChar = input.charAt(i);\n if (blockDepth === 0 && testChar(nextChar)) {\n returnVal = input.substr(lastPos, i - lastPos);\n if (returnVal) {\n parseGroups.push(returnVal);\n }\n else {\n parseGroups.push(' ');\n }\n returnVal = parseGroups;\n skipWhitespace(i - startPos);\n loop = false\n } else {\n if (inComment) {\n if (nextChar === '*' && \n input.charAt(i + 1) === '/') {\n i++;\n blockDepth--;\n inComment = false;\n }\n i++;\n continue;\n }\n switch (nextChar) {\n case '\\\\':\n i++;\n nextChar = input.charAt(i);\n parseGroups.push(input.substr(lastPos, i - lastPos + 1));\n lastPos = i + 1;\n break;\n case '/':\n if (input.charAt(i + 1) === '*') {\n i++;\n inComment = true;\n blockDepth++;\n }\n break;\n case '\\'':\n case '\"':\n quote = parserInput.$quoted(i);\n if (quote) {\n parseGroups.push(input.substr(lastPos, i - lastPos), quote);\n i += quote[1].length - 1;\n lastPos = i + 1;\n }\n else {\n skipWhitespace(i - startPos);\n returnVal = nextChar;\n loop = false;\n }\n break;\n case '{':\n blockStack.push('}');\n blockDepth++;\n break;\n case '(':\n blockStack.push(')');\n blockDepth++;\n break;\n case '[':\n blockStack.push(']');\n blockDepth++;\n break;\n case '}':\n case ')':\n case ']': {\n const expected = blockStack.pop();\n if (nextChar === expected) {\n blockDepth--;\n } else {\n // move the parser to the error and return expected\n skipWhitespace(i - startPos);\n returnVal = expected;\n loop = false;\n }\n }\n }\n i++;\n if (i > length) {\n loop = false;\n }\n }\n } while (loop);\n\n return returnVal ? returnVal : null;\n }\n\n parserInput.autoCommentAbsorb = true;\n parserInput.commentStore = [];\n parserInput.finished = false;\n\n // Same as $(), but don't change the state of the parser,\n // just return the match.\n parserInput.peek = tok => {\n if (typeof tok === 'string') {\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tok.length; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return false;\n }\n }\n return true;\n } else {\n return tok.test(current);\n }\n };\n\n // Specialization of peek()\n // TODO remove or change some currentChar calls to peekChar\n parserInput.peekChar = tok => input.charAt(parserInput.i) === tok;\n\n parserInput.currentChar = () => input.charAt(parserInput.i);\n\n parserInput.prevChar = () => input.charAt(parserInput.i - 1);\n\n parserInput.getInput = () => input;\n\n parserInput.peekNotNumeric = () => {\n const c = input.charCodeAt(parserInput.i);\n // Is the first char of the dimension 0-9, '.', '+' or '-'\n return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA;\n };\n\n parserInput.start = (str, chunkInput, failFunction) => {\n input = str;\n parserInput.i = j = currentPos = furthest = 0;\n\n // chunking apparently makes things quicker (but my tests indicate\n // it might actually make things slower in node at least)\n // and it is a non-perfect parse - it can't recognise\n // unquoted urls, meaning it can't distinguish comments\n // meaning comments with quotes or {}() in them get 'counted'\n // and then lead to parse errors.\n // In addition if the chunking chunks in the wrong place we might\n // not be able to parse a parser statement in one go\n // this is officially deprecated but can be switched on via an option\n // in the case it causes too much performance issues.\n if (chunkInput) {\n chunks = chunker(str, failFunction);\n } else {\n chunks = [str];\n }\n\n current = chunks[0];\n\n skipWhitespace(0);\n };\n\n parserInput.end = () => {\n let message;\n const isFinished = parserInput.i >= input.length;\n\n if (parserInput.i < furthest) {\n message = furthestPossibleErrorMessage;\n parserInput.i = furthest;\n }\n return {\n isFinished,\n furthest: parserInput.i,\n furthestPossibleErrorMessage: message,\n furthestReachedEnd: parserInput.i >= input.length - 1,\n furthestChar: input[parserInput.i]\n };\n };\n\n return parserInput;\n};\n","// Split the input into chunks.\nexport default function (input, fail) {\n const len = input.length;\n let level = 0;\n let parenLevel = 0;\n let lastOpening;\n let lastOpeningParen;\n let lastMultiComment;\n let lastMultiCommentEndBrace;\n const chunks = [];\n let emitFrom = 0;\n let chunkerCurrentIndex;\n let currentChunkStartIndex;\n let cc;\n let cc2;\n let matched;\n\n function emitChunk(force) {\n const len = chunkerCurrentIndex - emitFrom;\n if (((len < 512) && !force) || !len) {\n return;\n }\n chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1));\n emitFrom = chunkerCurrentIndex + 1;\n }\n\n for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc = input.charCodeAt(chunkerCurrentIndex);\n if (((cc >= 97) && (cc <= 122)) || (cc < 34)) {\n // a-z or whitespace\n continue;\n }\n\n switch (cc) {\n case 40: // (\n parenLevel++;\n lastOpeningParen = chunkerCurrentIndex;\n continue;\n case 41: // )\n if (--parenLevel < 0) {\n return fail('missing opening `(`', chunkerCurrentIndex);\n }\n continue;\n case 59: // ;\n if (!parenLevel) { emitChunk(); }\n continue;\n case 123: // {\n level++;\n lastOpening = chunkerCurrentIndex;\n continue;\n case 125: // }\n if (--level < 0) {\n return fail('missing opening `{`', chunkerCurrentIndex);\n }\n if (!level && !parenLevel) { emitChunk(); }\n continue;\n case 92: // \\\n if (chunkerCurrentIndex < len - 1) { chunkerCurrentIndex++; continue; }\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n case 34:\n case 39:\n case 96: // \", ' and `\n matched = 0;\n currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 > 96) { continue; }\n if (cc2 == cc) { matched = 1; break; }\n if (cc2 == 92) { // \\\n if (chunkerCurrentIndex == len - 1) {\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n }\n chunkerCurrentIndex++;\n }\n }\n if (matched) { continue; }\n return fail(`unmatched \\`${String.fromCharCode(cc)}\\``, currentChunkStartIndex);\n case 47: // /, check for comment\n if (parenLevel || (chunkerCurrentIndex == len - 1)) { continue; }\n cc2 = input.charCodeAt(chunkerCurrentIndex + 1);\n if (cc2 == 47) {\n // //, find lnfeed\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) { break; }\n }\n } else if (cc2 == 42) {\n // /*, find */\n lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 == 125) { lastMultiCommentEndBrace = chunkerCurrentIndex; }\n if (cc2 != 42) { continue; }\n if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) { break; }\n }\n if (chunkerCurrentIndex == len - 1) {\n return fail('missing closing `*/`', currentChunkStartIndex);\n }\n chunkerCurrentIndex++;\n }\n continue;\n case 42: // *, check for unmatched */\n if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) {\n return fail('unmatched `/*`', chunkerCurrentIndex);\n }\n continue;\n }\n }\n\n if (level !== 0) {\n if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) {\n return fail('missing closing `}` or `*/`', lastOpening);\n } else {\n return fail('missing closing `}`', lastOpening);\n }\n } else if (parenLevel !== 0) {\n return fail('missing closing `)`', lastOpeningParen);\n }\n\n emitChunk(true);\n return chunks;\n}\n","function makeRegistry( base ) {\n return {\n _data: {},\n add: function(name, func) {\n // precautionary case conversion, as later querying of\n // the registry by function-caller uses lower case as well.\n name = name.toLowerCase();\n\n // eslint-disable-next-line no-prototype-builtins\n if (this._data.hasOwnProperty(name)) {\n // TODO warn\n }\n this._data[name] = func;\n },\n addMultiple: function(functions) {\n Object.keys(functions).forEach(\n name => {\n this.add(name, functions[name]);\n });\n },\n get: function(name) {\n return this._data[name] || ( base && base.get( name ));\n },\n getLocalFunctions: function() {\n return this._data;\n },\n inherit: function() {\n return makeRegistry( this );\n },\n create: function(base) {\n return makeRegistry(base);\n }\n };\n}\n\nexport default makeRegistry( null );","export const MediaSyntaxOptions = {\n queryInParens: true\n};\n\nexport const ContainerSyntaxOptions = {\n queryInParens: true\n};\n","import LessError from '../less-error';\nimport tree from '../tree';\nimport visitors from '../visitors';\nimport getParserInput from './parser-input';\nimport * as utils from '../utils';\nimport functionRegistry from '../functions/function-registry';\nimport { ContainerSyntaxOptions, MediaSyntaxOptions } from '../tree/atrule-syntax';\n\n//\n// less.js - parser\n//\n// A relatively straight-forward predictive parser.\n// There is no tokenization/lexing stage, the input is parsed\n// in one sweep.\n//\n// To make the parser fast enough to run in the browser, several\n// optimization had to be made:\n//\n// - Matching and slicing on a huge input is often cause of slowdowns.\n// The solution is to chunkify the input into smaller strings.\n// The chunks are stored in the `chunks` var,\n// `j` holds the current chunk index, and `currentPos` holds\n// the index of the current chunk in relation to `input`.\n// This gives us an almost 4x speed-up.\n//\n// - In many cases, we don't need to match individual tokens;\n// for example, if a value doesn't hold any variables, operations\n// or dynamic references, the parser can effectively 'skip' it,\n// treating it as a literal.\n// An example would be '1px solid #000' - which evaluates to itself,\n// we don't need to know what the individual components are.\n// The drawback, of course is that you don't get the benefits of\n// syntax-checking on the CSS. This gives us a 50% speed-up in the parser,\n// and a smaller speed-up in the code-gen.\n//\n//\n// Token matching is done with the `$` function, which either takes\n// a terminal string or regexp, or a non-terminal function to call.\n// It also takes care of moving all the indices forwards.\n//\n\nconst Parser = function Parser(context, imports, fileInfo, currentIndex) {\n currentIndex = currentIndex || 0;\n let parsers;\n const parserInput = getParserInput();\n\n function error(msg, type) {\n throw new LessError(\n {\n index: parserInput.i,\n filename: fileInfo.filename,\n type: type || 'Syntax',\n message: msg\n },\n imports\n );\n }\n\n function expect(arg, msg) {\n // some older browsers return typeof 'function' for RegExp\n const result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg);\n if (result) {\n return result;\n }\n\n error(msg || (typeof arg === 'string'\n ? `expected '${arg}' got '${parserInput.currentChar()}'`\n : 'unexpected token'));\n }\n\n // Specialization of expect()\n function expectChar(arg, msg) {\n if (parserInput.$char(arg)) {\n return arg;\n }\n error(msg || `expected '${arg}' got '${parserInput.currentChar()}'`);\n }\n\n function getDebugInfo(index) {\n const filename = fileInfo.filename;\n\n return {\n lineNumber: utils.getLocation(index, parserInput.getInput()).line + 1,\n fileName: filename\n };\n }\n\n /**\n * Used after initial parsing to create nodes on the fly\n *\n * @param {String} str - string to parse\n * @param {Array} parseList - array of parsers to run input through e.g. [\"value\", \"important\"]\n * @param {Number} currentIndex - start number to begin indexing\n * @param {Object} fileInfo - fileInfo to attach to created nodes\n */\n function parseNode(str, parseList, callback) {\n let result;\n const returnNodes = [];\n const parser = parserInput;\n\n try {\n parser.start(str, false, function fail(msg, index) {\n callback({\n message: msg,\n index: index + currentIndex\n });\n });\n for (let x = 0, p; (p = parseList[x]); x++) {\n result = parsers[p]();\n returnNodes.push(result || null);\n }\n\n const endInfo = parser.end();\n if (endInfo.isFinished) {\n callback(null, returnNodes);\n }\n else {\n callback(true, null);\n }\n } catch (e) {\n throw new LessError({\n index: e.index + currentIndex,\n message: e.message\n }, imports, fileInfo.filename);\n }\n }\n\n //\n // The Parser\n //\n return {\n parserInput,\n imports,\n fileInfo,\n parseNode,\n //\n // Parse an input string into an abstract syntax tree,\n // @param str A string containing 'less' markup\n // @param callback call `callback` when done.\n // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply\n //\n parse: function (str, callback, additionalData) {\n let root;\n let err = null;\n let globalVars;\n let modifyVars;\n let ignored;\n let preText = '';\n\n // Optionally disable @plugin parsing\n if (additionalData && additionalData.disablePluginRule) {\n parsers.plugin = function() {\n var dir = parserInput.$re(/^@plugin?\\s+/);\n if (dir) {\n error('@plugin statements are not allowed when disablePluginRule is set to true');\n }\n }\n }\n\n globalVars = (additionalData && additionalData.globalVars) ? `${Parser.serializeVars(additionalData.globalVars)}\\n` : '';\n modifyVars = (additionalData && additionalData.modifyVars) ? `\\n${Parser.serializeVars(additionalData.modifyVars)}` : '';\n\n if (context.pluginManager) {\n const preProcessors = context.pluginManager.getPreProcessors();\n for (let i = 0; i < preProcessors.length; i++) {\n str = preProcessors[i].process(str, { context, imports, fileInfo });\n }\n }\n\n if (globalVars || (additionalData && additionalData.banner)) {\n preText = ((additionalData && additionalData.banner) ? additionalData.banner : '') + globalVars;\n ignored = imports.contentsIgnoredChars;\n ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0;\n ignored[fileInfo.filename] += preText.length;\n }\n\n str = str.replace(/\\r\\n?/g, '\\n');\n // Remove potential UTF Byte Order Mark\n str = preText + str.replace(/^\\uFEFF/, '') + modifyVars;\n imports.contents[fileInfo.filename] = str;\n\n // Start with the primary rule.\n // The whole syntax tree is held under a Ruleset node,\n // with the `root` property set to true, so no `{}` are\n // output. The callback is called when the input is parsed.\n try {\n parserInput.start(str, context.chunkInput, function fail(msg, index) {\n throw new LessError({\n index,\n type: 'Parse',\n message: msg,\n filename: fileInfo.filename\n }, imports);\n });\n\n tree.Node.prototype.parse = this;\n root = new tree.Ruleset(null, this.parsers.primary());\n tree.Node.prototype.rootNode = root;\n root.root = true;\n root.firstRoot = true;\n root.functionRegistry = functionRegistry.inherit();\n\n } catch (e) {\n return callback(new LessError(e, imports, fileInfo.filename));\n }\n\n // If `i` is smaller than the `input.length - 1`,\n // it means the parser wasn't able to parse the whole\n // string, so we've got a parsing error.\n //\n // We try to extract a \\n delimited string,\n // showing the line where the parse error occurred.\n // We split it up into two parts (the part which parsed,\n // and the part which didn't), so we can color them differently.\n const endInfo = parserInput.end();\n if (!endInfo.isFinished) {\n\n let message = endInfo.furthestPossibleErrorMessage;\n\n if (!message) {\n message = 'Unrecognised input';\n if (endInfo.furthestChar === '}') {\n message += '. Possibly missing opening \\'{\\'';\n } else if (endInfo.furthestChar === ')') {\n message += '. Possibly missing opening \\'(\\'';\n } else if (endInfo.furthestReachedEnd) {\n message += '. Possibly missing something';\n }\n }\n\n err = new LessError({\n type: 'Parse',\n message,\n index: endInfo.furthest,\n filename: fileInfo.filename\n }, imports);\n }\n\n const finish = e => {\n e = err || e || imports.error;\n\n if (e) {\n if (!(e instanceof LessError)) {\n e = new LessError(e, imports, fileInfo.filename);\n }\n\n return callback(e);\n }\n else {\n return callback(null, root);\n }\n };\n\n if (context.processImports !== false) {\n new visitors.ImportVisitor(imports, finish)\n .run(root);\n } else {\n return finish();\n }\n },\n\n //\n // Here in, the parsing rules/functions\n //\n // The basic structure of the syntax tree generated is as follows:\n //\n // Ruleset -> Declaration -> Value -> Expression -> Entity\n //\n // Here's some Less code:\n //\n // .class {\n // color: #fff;\n // border: 1px solid #000;\n // width: @w + 4px;\n // > .child {...}\n // }\n //\n // And here's what the parse tree might look like:\n //\n // Ruleset (Selector '.class', [\n // Declaration (\"color\", Value ([Expression [Color #fff]]))\n // Declaration (\"border\", Value ([Expression [Dimension 1px][Keyword \"solid\"][Color #000]]))\n // Declaration (\"width\", Value ([Expression [Operation \" + \" [Variable \"@w\"][Dimension 4px]]]))\n // Ruleset (Selector [Element '>', '.child'], [...])\n // ])\n //\n // In general, most rules will try to parse a token with the `$re()` function, and if the return\n // value is truly, will return a new node, of the relevant type. Sometimes, we need to check\n // first, before parsing, that's when we use `peek()`.\n //\n parsers: parsers = {\n //\n // The `primary` rule is the *entry* and *exit* point of the parser.\n // The rules here can appear at any level of the parse tree.\n //\n // The recursive nature of the grammar is an interplay between the `block`\n // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,\n // as represented by this simplified grammar:\n //\n // primary → (ruleset | declaration)+\n // ruleset → selector+ block\n // block → '{' primary '}'\n //\n // Only at one point is the primary rule not called from the\n // block rule: at the root level.\n //\n primary: function () {\n const mixin = this.mixin;\n let root = [];\n let node;\n\n while (true) {\n while (true) {\n node = this.comment();\n if (!node) { break; }\n root.push(node);\n }\n // always process comments before deciding if finished\n if (parserInput.finished) {\n break;\n }\n if (parserInput.peek('}')) {\n break;\n }\n\n node = this.extendRule();\n if (node) {\n root = root.concat(node);\n continue;\n }\n\n node = mixin.definition() || this.declaration() || mixin.call(false, false) ||\n this.ruleset() || this.variableCall() || this.entities.call() || this.atrule();\n if (node) {\n root.push(node);\n } else {\n let foundSemiColon = false;\n while (parserInput.$char(';')) {\n foundSemiColon = true;\n }\n if (!foundSemiColon) {\n break;\n }\n }\n }\n\n return root;\n },\n\n // comments are collected by the main parsing mechanism and then assigned to nodes\n // where the current structure allows it\n comment: function () {\n if (parserInput.commentStore.length) {\n const comment = parserInput.commentStore.shift();\n return new(tree.Comment)(comment.text, comment.isLineComment, comment.index + currentIndex, fileInfo);\n }\n },\n\n //\n // Entities are tokens which can be found inside an Expression\n //\n entities: {\n mixinLookup: function() {\n return parsers.mixin.call(true, true);\n },\n //\n // A string, which supports escaping \" and '\n //\n // \"milky way\" 'he\\'s the one!'\n //\n quoted: function (forceEscaped) {\n let str;\n const index = parserInput.i;\n let isEscaped = false;\n\n parserInput.save();\n if (parserInput.$char('~')) {\n isEscaped = true;\n } else if (forceEscaped) {\n parserInput.restore();\n return;\n }\n\n str = parserInput.$quoted();\n if (!str) {\n parserInput.restore();\n return;\n }\n parserInput.forget();\n\n return new(tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index + currentIndex, fileInfo);\n },\n\n //\n // A catch-all word, such as:\n //\n // black border-collapse\n //\n keyword: function () {\n const k = parserInput.$char('%') || parserInput.$re(/^\\[?(?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\\]?/);\n if (k) {\n return tree.Color.fromKeyword(k) || new(tree.Keyword)(k);\n }\n },\n\n //\n // A function call\n //\n // rgb(255, 0, 255)\n //\n // The arguments are parsed with the `entities.arguments` parser.\n //\n call: function () {\n let name;\n let args;\n let func;\n const index = parserInput.i;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (parserInput.peek(/^url\\(/i)) {\n return;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^([\\w-]+|%|~|progid:[\\w.]+)\\(/);\n if (!name) {\n parserInput.forget();\n return;\n }\n\n name = name[1];\n func = this.customFuncCall(name);\n if (func) {\n args = func.parse();\n if (args && func.stop) {\n parserInput.forget();\n return args;\n }\n }\n\n args = this.arguments(args);\n\n if (!parserInput.$char(')')) {\n parserInput.restore('Could not parse call arguments or missing \\')\\'');\n return;\n }\n\n parserInput.forget();\n\n return new(tree.Call)(name, args, index + currentIndex, fileInfo);\n },\n\n //\n // Parsing rules for functions with non-standard args, e.g.:\n //\n // boolean(not(2 > 1))\n //\n // This is a quick prototype, to be modified/improved when\n // more custom-parsed funcs come (e.g. `selector(...)`)\n //\n\n customFuncCall: function (name) {\n /* Ideally the table is to be moved out of here for faster perf.,\n but it's quite tricky since it relies on all these `parsers`\n and `expect` available only here */\n return {\n alpha: f(parsers.ieAlpha, true),\n boolean: f(condition),\n 'if': f(condition)\n }[name.toLowerCase()];\n\n function f(parse, stop) {\n return {\n parse, // parsing function\n stop // when true - stop after parse() and return its result,\n // otherwise continue for plain args\n };\n }\n\n function condition() {\n return [expect(parsers.condition, 'expected condition')];\n }\n },\n\n arguments: function (prevArgs) {\n let argsComma = prevArgs || [];\n const argsSemiColon = [];\n let isSemiColonSeparated;\n let value;\n\n parserInput.save();\n\n while (true) {\n if (prevArgs) {\n prevArgs = false;\n } else {\n value = parsers.detachedRuleset() || this.assignment() || parsers.expression();\n if (!value) {\n break;\n }\n\n if (value.value && value.value.length == 1) {\n value = value.value[0];\n }\n\n argsComma.push(value);\n }\n\n if (parserInput.$char(',')) {\n continue;\n }\n\n if (parserInput.$char(';') || isSemiColonSeparated) {\n isSemiColonSeparated = true;\n value = (argsComma.length < 1) ? argsComma[0]\n : new tree.Value(argsComma);\n argsSemiColon.push(value);\n argsComma = [];\n }\n }\n\n parserInput.forget();\n return isSemiColonSeparated ? argsSemiColon : argsComma;\n },\n literal: function () {\n return this.dimension() ||\n this.color() ||\n this.quoted() ||\n this.unicodeDescriptor();\n },\n\n // Assignments are argument entities for calls.\n // They are present in ie filter properties as shown below.\n //\n // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* )\n //\n\n assignment: function () {\n let key;\n let value;\n parserInput.save();\n key = parserInput.$re(/^\\w+(?=\\s?=)/i);\n if (!key) {\n parserInput.restore();\n return;\n }\n if (!parserInput.$char('=')) {\n parserInput.restore();\n return;\n }\n value = parsers.entity();\n if (value) {\n parserInput.forget();\n return new(tree.Assignment)(key, value);\n } else {\n parserInput.restore();\n }\n },\n\n //\n // Parse url() tokens\n //\n // We use a specific rule for urls, because they don't really behave like\n // standard function calls. The difference is that the argument doesn't have\n // to be enclosed within a string, so it can't be parsed as an Expression.\n //\n url: function () {\n let value;\n const index = parserInput.i;\n\n parserInput.autoCommentAbsorb = false;\n\n if (!parserInput.$str('url(')) {\n parserInput.autoCommentAbsorb = true;\n return;\n }\n\n value = this.quoted() || this.variable() || this.property() ||\n parserInput.$re(/^(?:(?:\\\\[()'\"])|[^()'\"])+/) || '';\n\n parserInput.autoCommentAbsorb = true;\n\n expectChar(')');\n\n return new(tree.URL)((value.value !== undefined ||\n value instanceof tree.Variable ||\n value instanceof tree.Property) ?\n value : new(tree.Anonymous)(value, index), index + currentIndex, fileInfo);\n },\n\n //\n // A Variable entity, such as `@fink`, in\n //\n // width: @fink + 2px\n //\n // We use a different parser for variable definitions,\n // see `parsers.variable`.\n //\n variable: function () {\n let ch;\n let name;\n const index = parserInput.i;\n\n parserInput.save();\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\\w-]+/))) {\n ch = parserInput.currentChar();\n if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\\s/)) {\n // this may be a VariableCall lookup\n const result = parsers.variableCall(name);\n if (result) {\n parserInput.forget();\n return result;\n }\n }\n parserInput.forget();\n return new(tree.Variable)(name, index + currentIndex, fileInfo);\n }\n parserInput.restore();\n },\n\n // A variable entity using the protective {} e.g. @{var}\n variableCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\\{([\\w-]+)\\}/))) {\n return new(tree.Variable)(`@${curly[1]}`, index + currentIndex, fileInfo);\n }\n },\n //\n // A Property accessor, such as `$color`, in\n //\n // background-color: $color\n //\n property: function () {\n let name;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (name = parserInput.$re(/^\\$[\\w-]+/))) {\n return new(tree.Property)(name, index + currentIndex, fileInfo);\n }\n },\n\n // A property entity useing the protective {} e.g. ${prop}\n propertyCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\\$\\{([\\w-]+)\\}/))) {\n return new(tree.Property)(`$${curly[1]}`, index + currentIndex, fileInfo);\n }\n },\n //\n // A Hexadecimal color\n //\n // #4F3C2F\n //\n // `rgb` and `hsl` colors are parsed through the `entities.call` parser.\n //\n color: function () {\n let rgb;\n parserInput.save();\n\n if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})([\\w.#[])?/))) {\n if (!rgb[2]) {\n parserInput.forget();\n return new(tree.Color)(rgb[1], undefined, rgb[0]);\n }\n }\n parserInput.restore();\n },\n\n colorKeyword: function () {\n parserInput.save();\n const autoCommentAbsorb = parserInput.autoCommentAbsorb;\n parserInput.autoCommentAbsorb = false;\n const k = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/);\n parserInput.autoCommentAbsorb = autoCommentAbsorb;\n if (!k) {\n parserInput.forget();\n return;\n }\n parserInput.restore();\n const color = tree.Color.fromKeyword(k);\n if (color) {\n parserInput.$str(k);\n return color;\n }\n },\n\n //\n // A Dimension, that is, a number and a unit\n //\n // 0.5em 95%\n //\n dimension: function () {\n if (parserInput.peekNotNumeric()) {\n return;\n }\n\n const value = parserInput.$re(/^([+-]?\\d*\\.?\\d+)(%|[a-z_]+)?/i);\n if (value) {\n return new(tree.Dimension)(value[1], value[2]);\n }\n },\n\n //\n // A unicode descriptor, as is used in unicode-range\n //\n // U+0?? or U+00A1-00A9\n //\n unicodeDescriptor: function () {\n let ud;\n\n ud = parserInput.$re(/^U\\+[0-9a-fA-F?]+(-[0-9a-fA-F?]+)?/);\n if (ud) {\n return new(tree.UnicodeDescriptor)(ud[0]);\n }\n },\n\n //\n // JavaScript code to be evaluated\n //\n // `window.location.href`\n //\n javascript: function () {\n let js;\n const index = parserInput.i;\n\n parserInput.save();\n\n const escape = parserInput.$char('~');\n const jsQuote = parserInput.$char('`');\n\n if (!jsQuote) {\n parserInput.restore();\n return;\n }\n\n js = parserInput.$re(/^[^`]*`/);\n if (js) {\n parserInput.forget();\n return new(tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index + currentIndex, fileInfo);\n }\n parserInput.restore('invalid javascript definition');\n }\n },\n\n //\n // The variable part of a variable definition. Used in the `rule` parser\n //\n // @fink:\n //\n variable: function () {\n let name;\n\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\\w-]+)\\s*:/))) { return name[1]; }\n },\n\n //\n // Call a variable value to retrieve a detached ruleset\n // or a value from a detached ruleset's rules.\n //\n // @fink();\n // @fink;\n // color: @fink[@color];\n //\n variableCall: function (parsedName) {\n let lookups;\n const i = parserInput.i;\n const inValue = !!parsedName;\n let name = parsedName;\n\n parserInput.save();\n\n if (name || (parserInput.currentChar() === '@'\n && (name = parserInput.$re(/^(@[\\w-]+)(\\(\\s*\\))?/)))) {\n\n lookups = this.mixin.ruleLookups();\n\n if (!lookups && ((inValue && parserInput.$str('()') !== '()') || (name[2] !== '()'))) {\n parserInput.restore('Missing \\'[...]\\' lookup in variable call');\n return;\n }\n\n if (!inValue) {\n name = name[1];\n }\n\n const call = new tree.VariableCall(name, i, fileInfo);\n if (!inValue && parsers.end()) {\n parserInput.forget();\n return call;\n }\n else {\n parserInput.forget();\n return new tree.NamespaceValue(call, lookups, i, fileInfo);\n }\n }\n\n parserInput.restore();\n },\n\n //\n // extend syntax - used to extend selectors\n //\n extend: function(isRule) {\n let elements;\n let e;\n const index = parserInput.i;\n let option;\n let extendList;\n let extend;\n\n if (!parserInput.$str(isRule ? '&:extend(' : ':extend(')) {\n return;\n }\n\n do {\n option = null;\n elements = null;\n while (!(option = parserInput.$re(/^(all)(?=\\s*(\\)|,))/))) {\n e = this.element();\n if (!e) {\n break;\n }\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n }\n\n option = option && option[1];\n if (!elements) {\n error('Missing target selector for :extend().');\n }\n extend = new(tree.Extend)(new(tree.Selector)(elements), option, index + currentIndex, fileInfo);\n if (extendList) {\n extendList.push(extend);\n } else {\n extendList = [ extend ];\n }\n } while (parserInput.$char(','));\n\n expect(/^\\)/);\n\n if (isRule) {\n expect(/^;/);\n }\n\n return extendList;\n },\n\n //\n // extendRule - used in a rule to extend all the parent selectors\n //\n extendRule: function() {\n return this.extend(true);\n },\n\n //\n // Mixins\n //\n mixin: {\n //\n // A Mixin call, with an optional argument list\n //\n // #mixins > .square(#fff);\n // #mixins.square(#fff);\n // .rounded(4px, black);\n // .button;\n //\n // We can lookup / return a value using the lookup syntax:\n //\n // color: #mixin.square(#fff)[@color];\n //\n // The `while` loop is there because mixins can be\n // namespaced, but we only support the child and descendant\n // selector for now.\n //\n call: function (inValue, getLookup) {\n const s = parserInput.currentChar();\n let important = false;\n let lookups;\n const index = parserInput.i;\n let elements;\n let args;\n let hasParens;\n\n if (s !== '.' && s !== '#') { return; }\n\n parserInput.save(); // stop us absorbing part of an invalid selector\n\n elements = this.elements();\n\n if (elements) {\n if (parserInput.$char('(')) {\n args = this.args(true).args;\n expectChar(')');\n hasParens = true;\n }\n\n if (getLookup !== false) {\n lookups = this.ruleLookups();\n }\n if (getLookup === true && !lookups) {\n parserInput.restore();\n return;\n }\n\n if (inValue && !lookups && !hasParens) {\n // This isn't a valid in-value mixin call\n parserInput.restore();\n return;\n }\n\n if (!inValue && parsers.important()) {\n important = true;\n }\n\n if (inValue || parsers.end()) {\n parserInput.forget();\n const mixin = new(tree.mixin.Call)(elements, args, index + currentIndex, fileInfo, !lookups && important);\n if (lookups) {\n return new tree.NamespaceValue(mixin, lookups);\n }\n else {\n return mixin;\n }\n }\n }\n\n parserInput.restore();\n },\n /**\n * Matching elements for mixins\n * (Start with . or # and can have > )\n */\n elements: function() {\n let elements;\n let e;\n let c;\n let elem;\n let elemIndex;\n const re = /^[#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/;\n while (true) {\n elemIndex = parserInput.i;\n e = parserInput.$re(re);\n\n if (!e) {\n break;\n }\n elem = new(tree.Element)(c, e, false, elemIndex + currentIndex, fileInfo);\n if (elements) {\n elements.push(elem);\n } else {\n elements = [ elem ];\n }\n c = parserInput.$char('>');\n }\n return elements;\n },\n args: function (isCall) {\n const entities = parsers.entities;\n const returner = { args:null, variadic: false };\n let expressions = [];\n const argsSemiColon = [];\n const argsComma = [];\n let isSemiColonSeparated;\n let expressionContainsNamed;\n let name;\n let nameLoop;\n let value;\n let arg;\n let expand;\n let hasSep = true;\n\n parserInput.save();\n\n while (true) {\n if (isCall) {\n arg = parsers.detachedRuleset() || parsers.expression();\n } else {\n parserInput.commentStore.length = 0;\n if (parserInput.$str('...')) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ variadic: true });\n break;\n }\n arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true);\n }\n\n if (!arg || !hasSep) {\n break;\n }\n\n nameLoop = null;\n if (arg.throwAwayComments) {\n arg.throwAwayComments();\n }\n value = arg;\n let val = null;\n\n if (isCall) {\n // Variable\n if (arg.value && arg.value.length == 1) {\n val = arg.value[0];\n }\n } else {\n val = arg;\n }\n\n if (val && (val instanceof tree.Variable || val instanceof tree.Property)) {\n if (parserInput.$char(':')) {\n if (expressions.length > 0) {\n if (isSemiColonSeparated) {\n error('Cannot mix ; and , as delimiter types');\n }\n expressionContainsNamed = true;\n }\n\n value = parsers.detachedRuleset() || parsers.expression();\n\n if (!value) {\n if (isCall) {\n error('could not understand value for named argument');\n } else {\n parserInput.restore();\n returner.args = [];\n return returner;\n }\n }\n nameLoop = (name = val.name);\n } else if (parserInput.$str('...')) {\n if (!isCall) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ name: arg.name, variadic: true });\n break;\n } else {\n expand = true;\n }\n } else if (!isCall) {\n name = nameLoop = val.name;\n value = null;\n }\n }\n\n if (value) {\n expressions.push(value);\n }\n\n argsComma.push({ name:nameLoop, value, expand });\n\n if (parserInput.$char(',')) {\n hasSep = true;\n continue;\n }\n hasSep = parserInput.$char(';') === ';';\n\n if (hasSep || isSemiColonSeparated) {\n\n if (expressionContainsNamed) {\n error('Cannot mix ; and , as delimiter types');\n }\n\n isSemiColonSeparated = true;\n\n if (expressions.length > 1) {\n value = new(tree.Value)(expressions);\n }\n argsSemiColon.push({ name, value, expand });\n\n name = null;\n expressions = [];\n expressionContainsNamed = false;\n }\n }\n\n parserInput.forget();\n returner.args = isSemiColonSeparated ? argsSemiColon : argsComma;\n return returner;\n },\n //\n // A Mixin definition, with a list of parameters\n //\n // .rounded (@radius: 2px, @color) {\n // ...\n // }\n //\n // Until we have a finer grained state-machine, we have to\n // do a look-ahead, to make sure we don't have a mixin call.\n // See the `rule` function for more information.\n //\n // We start by matching `.rounded (`, and then proceed on to\n // the argument list, which has optional default values.\n // We store the parameters in `params`, with a `value` key,\n // if there is a value, such as in the case of `@radius`.\n //\n // Once we've got our params list, and a closing `)`, we parse\n // the `{...}` block.\n //\n definition: function () {\n let name;\n let params = [];\n let match;\n let ruleset;\n let cond;\n let variadic = false;\n if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') ||\n parserInput.peek(/^[^{]*\\}/)) {\n return;\n }\n\n parserInput.save();\n\n match = parserInput.$re(/^([#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\\s*\\(/);\n if (match) {\n name = match[1];\n\n const argInfo = this.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n\n // .mixincall(\"@{a}\");\n // looks a bit like a mixin definition..\n // also\n // .mixincall(@a: {rule: set;});\n // so we have to be nice and restore\n if (!parserInput.$char(')')) {\n parserInput.restore('Missing closing \\')\\'');\n return;\n }\n\n parserInput.commentStore.length = 0;\n\n if (parserInput.$str('when')) { // Guard\n cond = expect(parsers.conditions, 'expected condition');\n }\n\n ruleset = parsers.block();\n\n if (ruleset) {\n parserInput.forget();\n return new(tree.mixin.Definition)(name, params, ruleset, cond, variadic);\n } else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n\n ruleLookups: function() {\n let rule;\n const lookups = [];\n\n if (parserInput.currentChar() !== '[') {\n return;\n }\n\n while (true) {\n parserInput.save();\n rule = this.lookupValue();\n if (!rule && rule !== '') {\n parserInput.restore();\n break;\n }\n lookups.push(rule);\n parserInput.forget();\n }\n if (lookups.length > 0) {\n return lookups;\n }\n },\n\n lookupValue: function() {\n parserInput.save();\n\n if (!parserInput.$char('[')) {\n parserInput.restore();\n return;\n }\n\n const name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);\n\n if (!parserInput.$char(']')) {\n parserInput.restore();\n return;\n }\n\n if (name || name === '') {\n parserInput.forget();\n return name;\n }\n\n parserInput.restore();\n }\n },\n //\n // Entities are the smallest recognized token,\n // and can be found inside a rule's value.\n //\n entity: function () {\n const entities = this.entities;\n\n return this.comment() || entities.literal() || entities.variable() || entities.url() ||\n entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) ||\n entities.javascript();\n },\n\n //\n // A Declaration terminator. Note that we use `peek()` to check for '}',\n // because the `block` rule will be expecting it, but we still need to make sure\n // it's there, if ';' was omitted.\n //\n end: function () {\n return parserInput.$char(';') || parserInput.peek('}');\n },\n\n //\n // IE's alpha function\n //\n // alpha(opacity=88)\n //\n ieAlpha: function () {\n let value;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (!parserInput.$re(/^opacity=/i)) { return; }\n value = parserInput.$re(/^\\d+/);\n if (!value) {\n value = expect(parsers.entities.variable, 'Could not parse alpha');\n value = `@{${value.name.slice(1)}}`;\n }\n expectChar(')');\n return new tree.Quoted('', `alpha(opacity=${value})`);\n },\n\n //\n // A Selector Element\n //\n // div\n // + h1\n // #socks\n // input[type=\"text\"]\n //\n // Elements are the building blocks for Selectors,\n // they are made out of a `Combinator` (see combinator rule),\n // and an element name, such as a tag a class, or `*`.\n //\n element: function () {\n let e;\n let c;\n let v;\n const index = parserInput.i;\n\n c = this.combinator();\n\n e = parserInput.$re(/^(?:\\d+\\.\\d+|\\d+)%/) ||\n // eslint-disable-next-line no-control-regex\n parserInput.$re(/^(?:[.#]?|:*)(?:[\\w-]|[^\\x00-\\x9f]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||\n parserInput.$char('*') || parserInput.$char('&') || this.attribute() ||\n parserInput.$re(/^\\([^&()@]+\\)/) || parserInput.$re(/^[.#:](?=@)/) ||\n this.entities.variableCurly();\n\n if (!e) {\n parserInput.save();\n if (parserInput.$char('(')) {\n if ((v = this.selector(false)) && parserInput.$char(')')) {\n e = new(tree.Paren)(v);\n parserInput.forget();\n } else {\n parserInput.restore('Missing closing \\')\\'');\n }\n } else {\n parserInput.forget();\n }\n }\n\n if (e) { return new(tree.Element)(c, e, e instanceof tree.Variable, index + currentIndex, fileInfo); }\n },\n\n //\n // Combinators combine elements together, in a Selector.\n //\n // Because our parser isn't white-space sensitive, special care\n // has to be taken, when parsing the descendant combinator, ` `,\n // as it's an empty space. We have to check the previous character\n // in the input, to see if it's a ` ` character. More info on how\n // we deal with this in *combinator.js*.\n //\n combinator: function () {\n let c = parserInput.currentChar();\n\n if (c === '/') {\n parserInput.save();\n const slashedCombinator = parserInput.$re(/^\\/[a-z]+\\//i);\n if (slashedCombinator) {\n parserInput.forget();\n return new(tree.Combinator)(slashedCombinator);\n }\n parserInput.restore();\n }\n\n if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') {\n parserInput.i++;\n if (c === '^' && parserInput.currentChar() === '^') {\n c = '^^';\n parserInput.i++;\n }\n while (parserInput.isWhitespace()) { parserInput.i++; }\n return new(tree.Combinator)(c);\n } else if (parserInput.isWhitespace(-1)) {\n return new(tree.Combinator)(' ');\n } else {\n return new(tree.Combinator)(null);\n }\n },\n //\n // A CSS Selector\n // with less extensions e.g. the ability to extend and guard\n //\n // .class > div + h1\n // li a:hover\n //\n // Selectors are made out of one or more Elements, see above.\n //\n selector: function (isLess) {\n const index = parserInput.i;\n let elements;\n let extendList;\n let c;\n let e;\n let allExtends;\n let when;\n let condition;\n isLess = isLess !== false;\n while ((isLess && (extendList = this.extend())) || (isLess && (when = parserInput.$str('when'))) || (e = this.element())) {\n if (when) {\n condition = expect(this.conditions, 'expected condition');\n } else if (condition) {\n error('CSS guard can only be used at the end of selector');\n } else if (extendList) {\n if (allExtends) {\n allExtends = allExtends.concat(extendList);\n } else {\n allExtends = extendList;\n }\n } else {\n if (allExtends) { error('Extend can only be used at the end of selector'); }\n c = parserInput.currentChar();\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n e = null;\n }\n if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') {\n break;\n }\n }\n\n if (elements) { return new(tree.Selector)(elements, allExtends, condition, index + currentIndex, fileInfo); }\n if (allExtends) { error('Extend must be used to extend a selector, it cannot be used on its own'); }\n },\n selectors: function () {\n let s;\n let selectors;\n while (true) {\n s = this.selector();\n if (!s) {\n break;\n }\n if (selectors) {\n selectors.push(s);\n } else {\n selectors = [ s ];\n }\n parserInput.commentStore.length = 0;\n if (s.condition && selectors.length > 1) {\n error('Guards are only currently allowed on a single selector.');\n }\n if (!parserInput.$char(',')) { break; }\n if (s.condition) {\n error('Guards are only currently allowed on a single selector.');\n }\n parserInput.commentStore.length = 0;\n }\n return selectors;\n },\n attribute: function () {\n if (!parserInput.$char('[')) { return; }\n\n const entities = this.entities;\n let key;\n let val;\n let op;\n //\n // case-insensitive flag\n // e.g. [attr operator value i]\n //\n let cif;\n\n if (!(key = entities.variableCurly())) {\n key = expect(/^(?:[_A-Za-z0-9-*]*\\|)?(?:[_A-Za-z0-9-]|\\\\.)+/);\n }\n\n op = parserInput.$re(/^[|~*$^]?=/);\n if (op) {\n val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\\w-]+/) || entities.variableCurly();\n if (val) {\n cif = parserInput.$re(/^[iIsS]/);\n }\n }\n\n expectChar(']');\n\n return new(tree.Attribute)(key, op, val, cif);\n },\n\n //\n // The `block` rule is used by `ruleset` and `mixin.definition`.\n // It's a wrapper around the `primary` rule, with added `{}`.\n //\n block: function () {\n let content;\n if (parserInput.$char('{') && (content = this.primary()) && parserInput.$char('}')) {\n return content;\n }\n },\n\n blockRuleset: function() {\n let block = this.block();\n\n if (block) {\n block = new tree.Ruleset(null, block);\n }\n return block;\n },\n\n detachedRuleset: function() {\n let argInfo;\n let params;\n let variadic;\n\n parserInput.save();\n if (parserInput.$re(/^[.#]\\(/)) {\n /**\n * DR args currently only implemented for each() function, and not\n * yet settable as `@dr: #(@arg) {}`\n * This should be done when DRs are merged with mixins.\n * See: https://github.com/less/less-meta/issues/16\n */\n argInfo = this.mixin.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return;\n }\n }\n const blockRuleset = this.blockRuleset();\n if (blockRuleset) {\n parserInput.forget();\n if (params) {\n return new tree.mixin.Definition(null, params, blockRuleset, null, variadic);\n }\n return new tree.DetachedRuleset(blockRuleset);\n }\n parserInput.restore();\n },\n\n //\n // div, .class, body > p {...}\n //\n ruleset: function () {\n let selectors;\n let rules;\n let debugInfo;\n\n parserInput.save();\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(parserInput.i);\n }\n\n selectors = this.selectors();\n\n if (selectors && (rules = this.block())) {\n parserInput.forget();\n const ruleset = new(tree.Ruleset)(selectors, rules, context.strictImports);\n if (context.dumpLineNumbers) {\n ruleset.debugInfo = debugInfo;\n }\n return ruleset;\n } else {\n parserInput.restore();\n }\n },\n declaration: function () {\n let name;\n let value;\n const index = parserInput.i;\n let hasDR;\n const c = parserInput.currentChar();\n let important;\n let merge;\n let isVariable;\n\n if (c === '.' || c === '#' || c === '&' || c === ':') { return; }\n\n parserInput.save();\n\n name = this.variable() || this.ruleProperty();\n if (name) {\n isVariable = typeof name === 'string';\n\n if (isVariable) {\n value = this.detachedRuleset();\n if (value) {\n hasDR = true;\n }\n }\n\n parserInput.commentStore.length = 0;\n if (!value) {\n // a name returned by this.ruleProperty() is always an array of the form:\n // [string-1, ..., string-n, \"\"] or [string-1, ..., string-n, \"+\"]\n // where each item is a tree.Keyword or tree.Variable\n merge = !isVariable && name.length > 1 && name.pop().value;\n\n // Custom property values get permissive parsing\n if (name[0].value && name[0].value.slice(0, 2) === '--') {\n value = this.permissiveValue(/[;}]/);\n }\n // Try to store values as anonymous\n // If we need the value later we'll re-parse it in ruleset.parseValue\n else {\n value = this.anonymousValue();\n }\n if (value) {\n parserInput.forget();\n // anonymous values absorb the end ';' which is required for them to work\n return new(tree.Declaration)(name, value, false, merge, index + currentIndex, fileInfo);\n }\n\n if (!value) {\n value = this.value();\n }\n\n if (value) {\n important = this.important();\n } else if (isVariable) {\n // As a last resort, try permissiveValue\n value = this.permissiveValue();\n }\n }\n\n if (value && (this.end() || hasDR)) {\n parserInput.forget();\n return new(tree.Declaration)(name, value, important, merge, index + currentIndex, fileInfo);\n }\n else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n anonymousValue: function () {\n const index = parserInput.i;\n const match = parserInput.$re(/^([^.#@$+/'\"*`(;{}-]*);/);\n if (match) {\n return new(tree.Anonymous)(match[1], index + currentIndex);\n }\n },\n /**\n * Used for custom properties, at-rules, and variables (as fallback)\n * Parses almost anything inside of {} [] () \"\" blocks\n * until it reaches outer-most tokens.\n *\n * First, it will try to parse comments and entities to reach\n * the end. This is mostly like the Expression parser except no\n * math is allowed.\n */\n permissiveValue: function (untilTokens) {\n let i;\n let e;\n let done;\n let value;\n const tok = untilTokens || ';';\n const index = parserInput.i;\n const result = [];\n\n function testCurrentChar() {\n const char = parserInput.currentChar();\n if (typeof tok === 'string') {\n return char === tok;\n } else {\n return tok.test(char);\n }\n }\n if (testCurrentChar()) {\n return;\n }\n value = [];\n do {\n e = this.comment();\n if (e) {\n value.push(e);\n continue;\n }\n e = this.entity();\n if (e) {\n value.push(e);\n }\n } while (e);\n\n done = testCurrentChar();\n\n if (value.length > 0) {\n value = new(tree.Expression)(value);\n if (done) {\n return value;\n }\n else {\n result.push(value);\n }\n // Preserve space before $parseUntil as it will not\n if (parserInput.prevChar() === ' ') {\n result.push(new tree.Anonymous(' ', index));\n }\n }\n parserInput.save();\n\n value = parserInput.$parseUntil(tok);\n\n if (value) {\n if (typeof value === 'string') {\n error(`Expected '${value}'`, 'Parse');\n }\n if (value.length === 1 && value[0] === ' ') {\n parserInput.forget();\n return new tree.Anonymous('', index);\n }\n let item;\n for (i = 0; i < value.length; i++) {\n item = value[i];\n if (Array.isArray(item)) {\n // Treat actual quotes as normal quoted values\n result.push(new tree.Quoted(item[0], item[1], true, index, fileInfo));\n }\n else {\n if (i === value.length - 1) {\n item = item.trim();\n }\n // Treat like quoted values, but replace vars like unquoted expressions\n const quote = new tree.Quoted('\\'', item, true, index, fileInfo);\n quote.variableRegex = /@([\\w-]+)/g;\n quote.propRegex = /\\$([\\w-]+)/g;\n result.push(quote);\n }\n }\n parserInput.forget();\n return new tree.Expression(result, true);\n }\n parserInput.restore();\n },\n\n //\n // An @import atrule\n //\n // @import \"lib\";\n //\n // Depending on our environment, importing is done differently:\n // In the browser, it's an XHR request, in Node, it would be a\n // file-system operation. The function used for importing is\n // stored in `import`, which we pass to the Import constructor.\n //\n 'import': function () {\n let path;\n let features;\n const index = parserInput.i;\n\n const dir = parserInput.$re(/^@import\\s+/);\n\n if (dir) {\n const options = (dir ? this.importOptions() : null) || {};\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n features = this.mediaFeatures({});\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon or unrecognised media features on import');\n }\n features = features && new(tree.Value)(features);\n return new(tree.Import)(path, features, options, index + currentIndex, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed import statement');\n }\n }\n },\n\n importOptions: function() {\n let o;\n const options = {};\n let optionName;\n let value;\n\n // list of options, surrounded by parens\n if (!parserInput.$char('(')) { return null; }\n do {\n o = this.importOption();\n if (o) {\n optionName = o;\n value = true;\n switch (optionName) {\n case 'css':\n optionName = 'less';\n value = false;\n break;\n case 'once':\n optionName = 'multiple';\n value = false;\n break;\n }\n options[optionName] = value;\n if (!parserInput.$char(',')) { break; }\n }\n } while (o);\n expectChar(')');\n return options;\n },\n\n importOption: function() {\n const opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/);\n if (opt) {\n return opt[1];\n }\n },\n\n mediaFeature: function (syntaxOptions) {\n const entities = this.entities;\n const nodes = [];\n let e;\n let p;\n let rangeP;\n parserInput.save();\n do {\n e = entities.keyword() || entities.variable() || entities.mixinLookup();\n if (e) {\n nodes.push(e);\n } else if (parserInput.$char('(')) {\n p = this.property();\n parserInput.save();\n if (!p && syntaxOptions.queryInParens && parserInput.$re(/^[0-9a-z-]*\\s*([<>]=|<=|>=|[<>]|=)/)) {\n parserInput.restore();\n p = this.condition();\n\n parserInput.save();\n rangeP = this.atomicCondition(null, p.rvalue);\n if (!rangeP) {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n e = this.value();\n }\n if (parserInput.$char(')')) {\n if (p && !e) {\n nodes.push(new (tree.Paren)(new (tree.QueryInParens)(p.op, p.lvalue, p.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p._index)));\t\t\t\t \n e = p;\n } else if (p && e) {\n nodes.push(new (tree.Paren)(new (tree.Declaration)(p, e, null, null, parserInput.i + currentIndex, fileInfo, true)));\n } else if (e) {\n nodes.push(new(tree.Paren)(e));\n } else {\n error('badly formed media feature definition');\n }\n } else {\n error('Missing closing \\')\\'', 'Parse');\n }\n }\n } while (e);\n\n parserInput.forget();\n if (nodes.length > 0) {\n return new(tree.Expression)(nodes);\n }\n },\n\n mediaFeatures: function (syntaxOptions) {\n const entities = this.entities;\n const features = [];\n let e;\n do {\n e = this.mediaFeature(syntaxOptions);\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n } else {\n e = entities.variable() || entities.mixinLookup();\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n }\n } while (e);\n\n return features.length > 0 ? features : null;\n },\n\n prepareAndGetNestableAtRule: function (treeType, index, debugInfo, syntaxOptions) {\n const features = this.mediaFeatures(syntaxOptions);\n\n const rules = this.block();\n\n if (!rules) {\n error('media definitions require block statements after any features');\n }\n\n parserInput.forget();\n\n const atRule = new (treeType)(rules, features, index + currentIndex, fileInfo);\n if (context.dumpLineNumbers) {\n atRule.debugInfo = debugInfo;\n }\n\n return atRule;\n },\n\n nestableAtRule: function () {\n let debugInfo;\n const index = parserInput.i;\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(index);\n }\n parserInput.save();\n\n if (parserInput.$peekChar('@')) {\n if (parserInput.$str('@media')) {\n return this.prepareAndGetNestableAtRule(tree.Media, index, debugInfo, MediaSyntaxOptions);\n }\n \n if (parserInput.$str('@container')) {\n return this.prepareAndGetNestableAtRule(tree.Container, index, debugInfo, ContainerSyntaxOptions);\n }\n }\n \n parserInput.restore();\n },\n\n //\n\n // A @plugin directive, used to import plugins dynamically.\n //\n // @plugin (args) \"lib\";\n //\n plugin: function () {\n let path;\n let args;\n let options;\n const index = parserInput.i;\n const dir = parserInput.$re(/^@plugin\\s+/);\n\n if (dir) {\n args = this.pluginArgs();\n\n if (args) {\n options = {\n pluginArgs: args,\n isPlugin: true\n };\n }\n else {\n options = { isPlugin: true };\n }\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon on @plugin');\n }\n return new(tree.Import)(path, null, options, index + currentIndex, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed @plugin statement');\n }\n }\n },\n\n pluginArgs: function() {\n // list of options, surrounded by parens\n parserInput.save();\n if (!parserInput.$char('(')) {\n parserInput.restore();\n return null;\n }\n const args = parserInput.$re(/^\\s*([^);]+)\\)\\s*/);\n if (args[1]) {\n parserInput.forget();\n return args[1].trim();\n }\n else {\n parserInput.restore();\n return null;\n }\n },\n\n //\n // A CSS AtRule\n //\n // @charset \"utf-8\";\n //\n atrule: function () {\n const index = parserInput.i;\n let name;\n let value;\n let rules;\n let nonVendorSpecificName;\n let hasIdentifier;\n let hasExpression;\n let hasUnknown;\n let hasBlock = true;\n let isRooted = true;\n\n if (parserInput.currentChar() !== '@') { return; }\n\n value = this['import']() || this.plugin() || this.nestableAtRule();\n if (value) {\n return value;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^@[a-z-]+/);\n\n if (!name) { return; }\n\n nonVendorSpecificName = name;\n if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {\n nonVendorSpecificName = `@${name.slice(name.indexOf('-', 2) + 1)}`;\n }\n\n switch (nonVendorSpecificName) {\n case '@charset':\n hasIdentifier = true;\n hasBlock = false;\n break;\n case '@namespace':\n hasExpression = true;\n hasBlock = false;\n break;\n case '@keyframes':\n case '@counter-style':\n hasIdentifier = true;\n break;\n case '@document':\n case '@supports':\n hasUnknown = true;\n isRooted = false;\n break;\n default:\n hasUnknown = true;\n break;\n }\n\n parserInput.commentStore.length = 0;\n\n if (hasIdentifier) {\n value = this.entity();\n if (!value) {\n error(`expected ${name} identifier`);\n }\n } else if (hasExpression) {\n value = this.expression();\n if (!value) {\n error(`expected ${name} expression`);\n }\n } else if (hasUnknown) {\n value = this.permissiveValue(/^[{;]/);\n hasBlock = (parserInput.currentChar() === '{');\n if (!value) {\n if (!hasBlock && parserInput.currentChar() !== ';') {\n error(`${name} rule is missing block or ending semi-colon`);\n }\n }\n else if (!value.value) {\n value = null;\n }\n }\n\n if (hasBlock) {\n rules = this.blockRuleset();\n }\n\n if (rules || (!hasBlock && value && parserInput.$char(';'))) {\n parserInput.forget();\n return new(tree.AtRule)(name, value, rules, index + currentIndex, fileInfo,\n context.dumpLineNumbers ? getDebugInfo(index) : null,\n isRooted\n );\n }\n\n parserInput.restore('at-rule options not recognised');\n },\n\n //\n // A Value is a comma-delimited list of Expressions\n //\n // font-family: Baskerville, Georgia, serif;\n //\n // In a Rule, a Value represents everything after the `:`,\n // and before the `;`.\n //\n value: function () {\n let e;\n const expressions = [];\n const index = parserInput.i;\n\n do {\n e = this.expression();\n if (e) {\n expressions.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n } while (e);\n\n if (expressions.length > 0) {\n return new(tree.Value)(expressions, index + currentIndex);\n }\n },\n important: function () {\n if (parserInput.currentChar() === '!') {\n return parserInput.$re(/^! *important/);\n }\n },\n sub: function () {\n let a;\n let e;\n\n parserInput.save();\n if (parserInput.$char('(')) {\n a = this.addition();\n if (a && parserInput.$char(')')) {\n parserInput.forget();\n e = new(tree.Expression)([a]);\n e.parens = true;\n return e;\n }\n parserInput.restore('Expected \\')\\'');\n return;\n }\n parserInput.restore();\n },\n multiplication: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.operand();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n if (parserInput.peek(/^\\/[*/]/)) {\n break;\n }\n\n parserInput.save();\n\n op = parserInput.$char('/') || parserInput.$char('*') || parserInput.$str('./');\n\n if (!op) { parserInput.forget(); break; }\n\n a = this.operand();\n\n if (!a) { parserInput.restore(); break; }\n parserInput.forget();\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n addition: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.multiplication();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n op = parserInput.$re(/^[-+]\\s+/) || (!isSpaced && (parserInput.$char('+') || parserInput.$char('-')));\n if (!op) {\n break;\n }\n a = this.multiplication();\n if (!a) {\n break;\n }\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n conditions: function () {\n let a;\n let b;\n const index = parserInput.i;\n let condition;\n\n a = this.condition(true);\n if (a) {\n while (true) {\n if (!parserInput.peek(/^,\\s*(not\\s*)?\\(/) || !parserInput.$char(',')) {\n break;\n }\n b = this.condition(true);\n if (!b) {\n break;\n }\n condition = new(tree.Condition)('or', condition || a, b, index + currentIndex);\n }\n return condition || a;\n }\n },\n condition: function (needsParens) {\n let result;\n let logical;\n let next;\n function or() {\n return parserInput.$str('or');\n }\n\n result = this.conditionAnd(needsParens);\n if (!result) {\n return ;\n }\n logical = or();\n if (logical) {\n next = this.condition(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n conditionAnd: function (needsParens) {\n let result;\n let logical;\n let next;\n const self = this;\n function insideCondition() {\n const cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens);\n if (!cond && !needsParens) {\n return self.atomicCondition(needsParens);\n }\n return cond;\n }\n function and() {\n return parserInput.$str('and');\n }\n\n result = insideCondition();\n if (!result) {\n return ;\n }\n logical = and();\n if (logical) {\n next = this.conditionAnd(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n negatedCondition: function (needsParens) {\n if (parserInput.$str('not')) {\n const result = this.parenthesisCondition(needsParens);\n if (result) {\n result.negate = !result.negate;\n }\n return result;\n }\n },\n parenthesisCondition: function (needsParens) {\n function tryConditionFollowedByParenthesis(me) {\n let body;\n parserInput.save();\n body = me.condition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return ;\n }\n parserInput.forget();\n return body;\n }\n\n let body;\n parserInput.save();\n if (!parserInput.$str('(')) {\n parserInput.restore();\n return ;\n }\n body = tryConditionFollowedByParenthesis(this);\n if (body) {\n parserInput.forget();\n return body;\n }\n\n body = this.atomicCondition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore(`expected ')' got '${parserInput.currentChar()}'`);\n return ;\n }\n parserInput.forget();\n return body;\n },\n atomicCondition: function (needsParens, preparsedCond) {\n const entities = this.entities;\n const index = parserInput.i;\n let a;\n let b;\n let c;\n let op;\n\n const cond = (function() {\n return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup();\n }).bind(this)\n\n if (preparsedCond) {\n a = preparsedCond;\n } else {\n a = cond();\n }\n\n if (a) {\n if (parserInput.$char('>')) {\n if (parserInput.$char('=')) {\n op = '>=';\n } else {\n op = '>';\n }\n } else\n if (parserInput.$char('<')) {\n if (parserInput.$char('=')) {\n op = '<=';\n } else {\n op = '<';\n }\n } else\n if (parserInput.$char('=')) {\n if (parserInput.$char('>')) {\n op = '=>';\n } else if (parserInput.$char('<')) {\n op = '=<';\n } else {\n op = '=';\n }\n }\n if (op) {\n b = cond();\n if (b) {\n c = new(tree.Condition)(op, a, b, index + currentIndex, false);\n } else {\n error('expected expression');\n }\n } else if (!preparsedCond) {\n c = new(tree.Condition)('=', a, new(tree.Keyword)('true'), index + currentIndex, false);\n }\n return c;\n }\n },\n\n //\n // An operand is anything that can be part of an operation,\n // such as a Color, or a Variable\n //\n operand: function () {\n const entities = this.entities;\n let negate;\n\n if (parserInput.peek(/^-[@$(]/)) {\n negate = parserInput.$char('-');\n }\n\n let o = this.sub() || entities.dimension() ||\n entities.color() || entities.variable() ||\n entities.property() || entities.call() ||\n entities.quoted(true) || entities.colorKeyword() ||\n entities.mixinLookup();\n\n if (negate) {\n o.parensInOp = true;\n o = new(tree.Negative)(o);\n }\n\n return o;\n },\n\n //\n // Expressions either represent mathematical operations,\n // or white-space delimited Entities.\n //\n // 1px solid black\n // @var * 2\n //\n expression: function () {\n const entities = [];\n let e;\n let delim;\n const index = parserInput.i;\n\n do {\n e = this.comment();\n if (e) {\n entities.push(e);\n continue;\n }\n e = this.addition() || this.entity();\n\n if (e instanceof tree.Comment) {\n e = null;\n }\n\n if (e) {\n entities.push(e);\n // operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n if (!parserInput.peek(/^\\/[/*]/)) {\n delim = parserInput.$char('/');\n if (delim) {\n entities.push(new(tree.Anonymous)(delim, index + currentIndex));\n }\n }\n }\n } while (e);\n if (entities.length > 0) {\n return new(tree.Expression)(entities);\n }\n },\n property: function () {\n const name = parserInput.$re(/^(\\*?-?[_a-zA-Z0-9-]+)\\s*:/);\n if (name) {\n return name[1];\n }\n },\n ruleProperty: function () {\n let name = [];\n const index = [];\n let s;\n let k;\n\n parserInput.save();\n\n const simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\\s*:/);\n if (simpleProperty) {\n name = [new(tree.Keyword)(simpleProperty[1])];\n parserInput.forget();\n return name;\n }\n\n function match(re) {\n const i = parserInput.i;\n const chunk = parserInput.$re(re);\n if (chunk) {\n index.push(i);\n return name.push(chunk[1]);\n }\n }\n\n match(/^(\\*?)/);\n while (true) {\n if (!match(/^((?:[\\w-]+)|(?:[@$]\\{[\\w-]+\\}))/)) {\n break;\n }\n }\n\n if ((name.length > 1) && match(/^((?:\\+_|\\+)?)\\s*:/)) {\n parserInput.forget();\n\n // at last, we have the complete match now. move forward,\n // convert name particles to tree objects and return:\n if (name[0] === '') {\n name.shift();\n index.shift();\n }\n for (k = 0; k < name.length; k++) {\n s = name[k];\n name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ?\n new(tree.Keyword)(s) :\n (s.charAt(0) === '@' ?\n new(tree.Variable)(`@${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo) :\n new(tree.Property)(`$${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo));\n }\n return name;\n }\n parserInput.restore();\n }\n }\n };\n};\nParser.serializeVars = vars => {\n let s = '';\n\n for (const name in vars) {\n if (Object.hasOwnProperty.call(vars, name)) {\n const value = vars[name];\n s += `${((name[0] === '@') ? '' : '@') + name}: ${value}${(String(value).slice(-1) === ';') ? '' : ';'}`;\n }\n }\n\n return s;\n};\n\nexport default Parser;","import Node from './node';\nimport Element from './element';\nimport LessError from '../less-error';\nimport * as utils from '../utils';\nimport Parser from '../parser/parser';\n\nconst Selector = function(elements, extendList, condition, index, currentFileInfo, visibilityInfo) {\n this.extendList = extendList;\n this.condition = condition;\n this.evaldCondition = !condition;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.elements = this.getElements(elements);\n this.mixinElements_ = undefined;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.elements, this);\n};\n\nSelector.prototype = Object.assign(new Node(), {\n type: 'Selector',\n\n accept(visitor) {\n if (this.elements) {\n this.elements = visitor.visitArray(this.elements);\n }\n if (this.extendList) {\n this.extendList = visitor.visitArray(this.extendList);\n }\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n },\n\n createDerived(elements, extendList, evaldCondition) {\n elements = this.getElements(elements);\n const newSelector = new Selector(elements, extendList || this.extendList,\n null, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n newSelector.evaldCondition = (!utils.isNullOrUndefined(evaldCondition)) ? evaldCondition : this.evaldCondition;\n newSelector.mediaEmpty = this.mediaEmpty;\n return newSelector;\n },\n\n getElements(els) {\n if (!els) {\n return [new Element('', '&', false, this._index, this._fileInfo)];\n }\n if (typeof els === 'string') {\n new Parser(this.parse.context, this.parse.importManager, this._fileInfo, this._index).parseNode(\n els,\n ['selector'],\n function(err, result) {\n if (err) {\n throw new LessError({\n index: err.index,\n message: err.message\n }, this.parse.imports, this._fileInfo.filename);\n }\n els = result[0].elements;\n });\n }\n return els;\n },\n\n createEmptySelectors() {\n const el = new Element('', '&', false, this._index, this._fileInfo), sels = [new Selector([el], null, null, this._index, this._fileInfo)];\n sels[0].mediaEmpty = true;\n return sels;\n },\n\n match(other) {\n const elements = this.elements;\n const len = elements.length;\n let olen;\n let i;\n\n other = other.mixinElements();\n olen = other.length;\n if (olen === 0 || len < olen) {\n return 0;\n } else {\n for (i = 0; i < olen; i++) {\n if (elements[i].value !== other[i]) {\n return 0;\n }\n }\n }\n\n return olen; // return number of matched elements\n },\n\n mixinElements() {\n if (this.mixinElements_) {\n return this.mixinElements_;\n }\n\n let elements = this.elements.map( function(v) {\n return v.combinator.value + (v.value.value || v.value);\n }).join('').match(/[,*.\\w-]([\\w-]|(\\\\.))*/g);\n\n if (elements) {\n if (elements[0] === '&') {\n elements.shift();\n }\n } else {\n elements = [];\n }\n\n return (this.mixinElements_ = elements);\n },\n\n isJustParentSelector() {\n return !this.mediaEmpty &&\n this.elements.length === 1 &&\n this.elements[0].value === '&' &&\n (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === '');\n },\n\n eval(context) {\n const evaldCondition = this.condition && this.condition.eval(context);\n let elements = this.elements;\n let extendList = this.extendList;\n\n elements = elements && elements.map(function (e) { return e.eval(context); });\n extendList = extendList && extendList.map(function(extend) { return extend.eval(context); });\n\n return this.createDerived(elements, extendList, evaldCondition);\n },\n\n genCSS(context, output) {\n let i, element;\n if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') {\n output.add(' ', this.fileInfo(), this.getIndex());\n }\n for (i = 0; i < this.elements.length; i++) {\n element = this.elements[i];\n element.genCSS(context, output);\n }\n },\n\n getIsOutput() {\n return this.evaldCondition;\n }\n});\n\nexport default Selector;\n","import Node from './node';\n\nconst Value = function(value) {\n if (!value) {\n throw new Error('Value requires an array argument');\n }\n if (!Array.isArray(value)) {\n this.value = [ value ];\n }\n else {\n this.value = value;\n }\n};\n\nValue.prototype = Object.assign(new Node(), {\n type: 'Value',\n\n accept(visitor) {\n if (this.value) {\n this.value = visitor.visitArray(this.value);\n }\n },\n\n eval(context) {\n if (this.value.length === 1) {\n return this.value[0].eval(context);\n } else {\n return new Value(this.value.map(function (v) {\n return v.eval(context);\n }));\n }\n },\n\n genCSS(context, output) {\n let i;\n for (i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (i + 1 < this.value.length) {\n output.add((context && context.compress) ? ',' : ', ');\n }\n }\n }\n});\n\nexport default Value;\n","import Node from './node';\n\nconst Keyword = function(value) {\n this.value = value;\n};\n\nKeyword.prototype = Object.assign(new Node(), {\n type: 'Keyword',\n\n genCSS(context, output) {\n if (this.value === '%') { throw { type: 'Syntax', message: 'Invalid % without number' }; }\n output.add(this.value);\n }\n});\n\nKeyword.True = new Keyword('true');\nKeyword.False = new Keyword('false');\n\nexport default Keyword;\n","import Node from './node';\n\nconst Anonymous = function(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {\n this.value = value;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.mapLines = mapLines;\n this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;\n this.allowRoot = true;\n this.copyVisibilityInfo(visibilityInfo);\n}\n\nAnonymous.prototype = Object.assign(new Node(), {\n type: 'Anonymous',\n eval() {\n return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());\n },\n compare(other) {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n },\n isRulesetLike() {\n return this.rulesetLike;\n },\n genCSS(context, output) {\n this.nodeVisible = Boolean(this.value);\n if (this.nodeVisible) {\n output.add(this.value, this._fileInfo, this._index, this.mapLines);\n }\n }\n})\n\nexport default Anonymous;\n","import Node from './node';\nimport Value from './value';\nimport Keyword from './keyword';\nimport Anonymous from './anonymous';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\nfunction evalName(context, name) {\n let value = '';\n let i;\n const n = name.length;\n const output = {add: function (s) {value += s;}};\n for (i = 0; i < n; i++) {\n name[i].eval(context).genCSS(context, output);\n }\n return value;\n}\n\nconst Declaration = function(name, value, important, merge, index, currentFileInfo, inline, variable) {\n this.name = name;\n this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]);\n this.important = important ? ` ${important.trim()}` : '';\n this.merge = merge;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.inline = inline || false;\n this.variable = (variable !== undefined) ? variable\n : (name.charAt && (name.charAt(0) === '@'));\n this.allowRoot = true;\n this.setParent(this.value, this);\n};\n\nDeclaration.prototype = Object.assign(new Node(), {\n type: 'Declaration',\n\n genCSS(context, output) {\n output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex());\n try {\n this.value.genCSS(context, output);\n }\n catch (e) {\n e.index = this._index;\n e.filename = this._fileInfo.filename;\n throw e;\n }\n output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index);\n },\n\n eval(context) {\n let mathBypass = false, prevMath, name = this.name, evaldValue, variable = this.variable;\n if (typeof name !== 'string') {\n // expand 'primitive' name directly to get\n // things faster (~10% for benchmark.less):\n name = (name.length === 1) && (name[0] instanceof Keyword) ?\n name[0].value : evalName(context, name);\n variable = false; // never treat expanded interpolation as new variable name\n }\n\n // @todo remove when parens-division is default\n if (name === 'font' && context.math === MATH.ALWAYS) {\n mathBypass = true;\n prevMath = context.math;\n context.math = MATH.PARENS_DIVISION;\n }\n try {\n context.importantScope.push({});\n evaldValue = this.value.eval(context);\n\n if (!this.variable && evaldValue.type === 'DetachedRuleset') {\n throw { message: 'Rulesets cannot be evaluated on a property.',\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n let important = this.important;\n const importantResult = context.importantScope.pop();\n if (!important && importantResult.important) {\n important = importantResult.important;\n }\n\n return new Declaration(name,\n evaldValue,\n important,\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline,\n variable);\n }\n catch (e) {\n if (typeof e.index !== 'number') {\n e.index = this.getIndex();\n e.filename = this.fileInfo().filename;\n }\n throw e;\n }\n finally {\n if (mathBypass) {\n context.math = prevMath;\n }\n }\n },\n\n makeImportant() {\n return new Declaration(this.name,\n this.value,\n '!important',\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline);\n }\n});\n\nexport default Declaration;","function asComment(ctx) {\n return `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\\n`;\n}\n\nfunction asMediaQuery(ctx) {\n let filenameWithProtocol = ctx.debugInfo.fileName;\n if (!/^[a-z]+:\\/\\//i.test(filenameWithProtocol)) {\n filenameWithProtocol = `file://${filenameWithProtocol}`;\n }\n return `@media -sass-debug-info{filename{font-family:${filenameWithProtocol.replace(/([.:/\\\\])/g, function (a) {\n if (a == '\\\\') {\n a = '/';\n }\n return `\\\\${a}`;\n })}}line{font-family:\\\\00003${ctx.debugInfo.lineNumber}}}\\n`;\n}\n\nfunction debugInfo(context, ctx, lineSeparator) {\n let result = '';\n if (context.dumpLineNumbers && !context.compress) {\n switch (context.dumpLineNumbers) {\n case 'comments':\n result = asComment(ctx);\n break;\n case 'mediaquery':\n result = asMediaQuery(ctx);\n break;\n case 'all':\n result = asComment(ctx) + (lineSeparator || '') + asMediaQuery(ctx);\n break;\n }\n }\n return result;\n}\n\nexport default debugInfo;\n\n","import Node from './node';\nimport getDebugInfo from './debug-info';\n\nconst Comment = function(value, isLineComment, index, currentFileInfo) {\n this.value = value;\n this.isLineComment = isLineComment;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n}\n\nComment.prototype = Object.assign(new Node(), {\n type: 'Comment',\n\n genCSS(context, output) {\n if (this.debugInfo) {\n output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n },\n\n isSilent(context) {\n const isCompressed = context.compress && this.value[2] !== '!';\n return this.isLineComment || isCompressed;\n }\n});\n\nexport default Comment;\n","import Keyword from '../tree/keyword';\nimport * as utils from '../utils';\n\nconst defaultFunc = {\n eval: function () {\n const v = this.value_;\n const e = this.error_;\n if (e) {\n throw e;\n }\n if (!utils.isNullOrUndefined(v)) {\n return v ? Keyword.True : Keyword.False;\n }\n },\n value: function (v) {\n this.value_ = v;\n },\n error: function (e) {\n this.error_ = e;\n },\n reset: function () {\n this.value_ = this.error_ = null;\n }\n};\n\nexport default defaultFunc;\n","import Node from './node';\nimport Declaration from './declaration';\nimport Keyword from './keyword';\nimport Comment from './comment';\nimport Paren from './paren';\nimport Selector from './selector';\nimport Element from './element';\nimport Anonymous from './anonymous';\nimport contexts from '../contexts';\nimport globalFunctionRegistry from '../functions/function-registry';\nimport defaultFunc from '../functions/default';\nimport getDebugInfo from './debug-info';\nimport * as utils from '../utils';\nimport Parser from '../parser/parser';\n\nconst Ruleset = function(selectors, rules, strictImports, visibilityInfo) {\n this.selectors = selectors;\n this.rules = rules;\n this._lookups = {};\n this._variables = null;\n this._properties = null;\n this.strictImports = strictImports;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n this.setParent(this.selectors, this);\n this.setParent(this.rules, this);\n}\n\nRuleset.prototype = Object.assign(new Node(), {\n type: 'Ruleset',\n isRuleset: true,\n\n isRulesetLike() { return true; },\n\n accept(visitor) {\n if (this.paths) {\n this.paths = visitor.visitArray(this.paths, true);\n } else if (this.selectors) {\n this.selectors = visitor.visitArray(this.selectors);\n }\n if (this.rules && this.rules.length) {\n this.rules = visitor.visitArray(this.rules);\n }\n },\n\n eval(context) {\n let selectors;\n let selCnt;\n let selector;\n let i;\n let hasVariable;\n let hasOnePassingSelector = false;\n\n if (this.selectors && (selCnt = this.selectors.length)) {\n selectors = new Array(selCnt);\n defaultFunc.error({\n type: 'Syntax',\n message: 'it is currently only allowed in parametric mixin guards,'\n });\n\n for (i = 0; i < selCnt; i++) {\n selector = this.selectors[i].eval(context);\n for (let j = 0; j < selector.elements.length; j++) {\n if (selector.elements[j].isVariable) {\n hasVariable = true;\n break;\n }\n }\n selectors[i] = selector;\n if (selector.evaldCondition) {\n hasOnePassingSelector = true;\n }\n }\n\n if (hasVariable) {\n const toParseSelectors = new Array(selCnt);\n for (i = 0; i < selCnt; i++) {\n selector = selectors[i];\n toParseSelectors[i] = selector.toCSS(context);\n }\n const startingIndex = selectors[0].getIndex();\n const selectorFileInfo = selectors[0].fileInfo();\n new Parser(context, this.parse.importManager, selectorFileInfo, startingIndex).parseNode(\n toParseSelectors.join(','),\n ['selectors'],\n function(err, result) {\n if (result) {\n selectors = utils.flattenArray(result);\n }\n });\n }\n\n defaultFunc.reset();\n } else {\n hasOnePassingSelector = true;\n }\n\n let rules = this.rules ? utils.copyArray(this.rules) : null;\n const ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo());\n let rule;\n let subRule;\n\n ruleset.originalRuleset = this;\n ruleset.root = this.root;\n ruleset.firstRoot = this.firstRoot;\n ruleset.allowImports = this.allowImports;\n\n if (this.debugInfo) {\n ruleset.debugInfo = this.debugInfo;\n }\n\n if (!hasOnePassingSelector) {\n rules.length = 0;\n }\n\n // inherit a function registry from the frames stack when possible;\n // otherwise from the global registry\n ruleset.functionRegistry = (function (frames) {\n let i = 0;\n const n = frames.length;\n let found;\n for ( ; i !== n ; ++i ) {\n found = frames[ i ].functionRegistry;\n if ( found ) { return found; }\n }\n return globalFunctionRegistry;\n }(context.frames)).inherit();\n\n // push the current ruleset to the frames stack\n const ctxFrames = context.frames;\n ctxFrames.unshift(ruleset);\n\n // currrent selectors\n let ctxSelectors = context.selectors;\n if (!ctxSelectors) {\n context.selectors = ctxSelectors = [];\n }\n ctxSelectors.unshift(this.selectors);\n\n // Evaluate imports\n if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) {\n ruleset.evalImports(context);\n }\n\n // Store the frames around mixin definitions,\n // so they can be evaluated like closures when the time comes.\n const rsRules = ruleset.rules;\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.evalFirst) {\n rsRules[i] = rule.eval(context);\n }\n }\n\n const mediaBlockCount = (context.mediaBlocks && context.mediaBlocks.length) || 0;\n\n // Evaluate mixin calls.\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.type === 'MixinCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).filter(function(r) {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope if the variable is\n // already there. consider returning false here\n // but we need a way to \"return\" variable from mixins\n return !(ruleset.variable(r.name));\n }\n return true;\n });\n rsRules.splice.apply(rsRules, [i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n } else if (rule.type === 'VariableCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).rules.filter(function(r) {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope at all\n return false;\n }\n return true;\n });\n rsRules.splice.apply(rsRules, [i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n if (!rule.evalFirst) {\n rsRules[i] = rule = rule.eval ? rule.eval(context) : rule;\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n // for rulesets, check if it is a css guard and can be removed\n if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) {\n // check if it can be folded in (e.g. & where)\n if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) {\n rsRules.splice(i--, 1);\n\n for (let j = 0; (subRule = rule.rules[j]); j++) {\n if (subRule instanceof Node) {\n subRule.copyVisibilityInfo(rule.visibilityInfo());\n if (!(subRule instanceof Declaration) || !subRule.variable) {\n rsRules.splice(++i, 0, subRule);\n }\n }\n }\n }\n }\n }\n\n // Pop the stack\n ctxFrames.shift();\n ctxSelectors.shift();\n\n if (context.mediaBlocks) {\n for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) {\n context.mediaBlocks[i].bubbleSelectors(selectors);\n }\n }\n\n return ruleset;\n },\n\n evalImports(context) {\n const rules = this.rules;\n let i;\n let importRules;\n if (!rules) { return; }\n\n for (i = 0; i < rules.length; i++) {\n if (rules[i].type === 'Import') {\n importRules = rules[i].eval(context);\n if (importRules && (importRules.length || importRules.length === 0)) {\n rules.splice.apply(rules, [i, 1].concat(importRules));\n i += importRules.length - 1;\n } else {\n rules.splice(i, 1, importRules);\n }\n this.resetCache();\n }\n }\n },\n\n makeImportant() {\n const result = new Ruleset(this.selectors, this.rules.map(function (r) {\n if (r.makeImportant) {\n return r.makeImportant();\n } else {\n return r;\n }\n }), this.strictImports, this.visibilityInfo());\n\n return result;\n },\n\n matchArgs(args) {\n return !args || args.length === 0;\n },\n\n // lets you call a css selector with a guard\n matchCondition(args, context) {\n const lastSelector = this.selectors[this.selectors.length - 1];\n if (!lastSelector.evaldCondition) {\n return false;\n }\n if (lastSelector.condition &&\n !lastSelector.condition.eval(\n new contexts.Eval(context,\n context.frames))) {\n return false;\n }\n return true;\n },\n\n resetCache() {\n this._rulesets = null;\n this._variables = null;\n this._properties = null;\n this._lookups = {};\n },\n\n variables() {\n if (!this._variables) {\n this._variables = !this.rules ? {} : this.rules.reduce(function (hash, r) {\n if (r instanceof Declaration && r.variable === true) {\n hash[r.name] = r;\n }\n // when evaluating variables in an import statement, imports have not been eval'd\n // so we need to go inside import statements.\n // guard against root being a string (in the case of inlined less)\n if (r.type === 'Import' && r.root && r.root.variables) {\n const vars = r.root.variables();\n for (const name in vars) {\n // eslint-disable-next-line no-prototype-builtins\n if (vars.hasOwnProperty(name)) {\n hash[name] = r.root.variable(name);\n }\n }\n }\n return hash;\n }, {});\n }\n return this._variables;\n },\n\n properties() {\n if (!this._properties) {\n this._properties = !this.rules ? {} : this.rules.reduce(function (hash, r) {\n if (r instanceof Declaration && r.variable !== true) {\n const name = (r.name.length === 1) && (r.name[0] instanceof Keyword) ?\n r.name[0].value : r.name;\n // Properties don't overwrite as they can merge\n if (!hash[`$${name}`]) {\n hash[`$${name}`] = [ r ];\n }\n else {\n hash[`$${name}`].push(r);\n }\n }\n return hash;\n }, {});\n }\n return this._properties;\n },\n\n variable(name) {\n const decl = this.variables()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n },\n\n property(name) {\n const decl = this.properties()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n },\n\n lastDeclaration() {\n for (let i = this.rules.length; i > 0; i--) {\n const decl = this.rules[i - 1];\n if (decl instanceof Declaration) {\n return this.parseValue(decl);\n }\n }\n },\n\n parseValue(toParse) {\n const self = this;\n function transformDeclaration(decl) {\n if (decl.value instanceof Anonymous && !decl.parsed) {\n if (typeof decl.value.value === 'string') {\n new Parser(this.parse.context, this.parse.importManager, decl.fileInfo(), decl.value.getIndex()).parseNode(\n decl.value.value,\n ['value', 'important'],\n function(err, result) {\n if (err) {\n decl.parsed = true;\n }\n if (result) {\n decl.value = result[0];\n decl.important = result[1] || '';\n decl.parsed = true;\n }\n });\n } else {\n decl.parsed = true;\n }\n\n return decl;\n }\n else {\n return decl;\n }\n }\n if (!Array.isArray(toParse)) {\n return transformDeclaration.call(self, toParse);\n }\n else {\n const nodes = [];\n toParse.forEach(function(n) {\n nodes.push(transformDeclaration.call(self, n));\n });\n return nodes;\n }\n },\n\n rulesets() {\n if (!this.rules) { return []; }\n\n const filtRules = [];\n const rules = this.rules;\n let i;\n let rule;\n\n for (i = 0; (rule = rules[i]); i++) {\n if (rule.isRuleset) {\n filtRules.push(rule);\n }\n }\n\n return filtRules;\n },\n\n prependRule(rule) {\n const rules = this.rules;\n if (rules) {\n rules.unshift(rule);\n } else {\n this.rules = [ rule ];\n }\n this.setParent(rule, this);\n },\n\n find(selector, self, filter) {\n self = self || this;\n const rules = [];\n let match;\n let foundMixins;\n const key = selector.toCSS();\n\n if (key in this._lookups) { return this._lookups[key]; }\n\n this.rulesets().forEach(function (rule) {\n if (rule !== self) {\n for (let j = 0; j < rule.selectors.length; j++) {\n match = selector.match(rule.selectors[j]);\n if (match) {\n if (selector.elements.length > match) {\n if (!filter || filter(rule)) {\n foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter);\n for (let i = 0; i < foundMixins.length; ++i) {\n foundMixins[i].path.push(rule);\n }\n Array.prototype.push.apply(rules, foundMixins);\n }\n } else {\n rules.push({ rule, path: []});\n }\n break;\n }\n }\n }\n });\n this._lookups[key] = rules;\n return rules;\n },\n\n genCSS(context, output) {\n let i;\n let j;\n const charsetRuleNodes = [];\n let ruleNodes = [];\n\n let // Line number debugging\n debugInfo;\n\n let rule;\n let path;\n\n context.tabLevel = (context.tabLevel || 0);\n\n if (!this.root) {\n context.tabLevel++;\n }\n\n const tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' ');\n const tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' ');\n let sep;\n\n let charsetNodeIndex = 0;\n let importNodeIndex = 0;\n for (i = 0; (rule = this.rules[i]); i++) {\n if (rule instanceof Comment) {\n if (importNodeIndex === i) {\n importNodeIndex++;\n }\n ruleNodes.push(rule);\n } else if (rule.isCharset && rule.isCharset()) {\n ruleNodes.splice(charsetNodeIndex, 0, rule);\n charsetNodeIndex++;\n importNodeIndex++;\n } else if (rule.type === 'Import') {\n ruleNodes.splice(importNodeIndex, 0, rule);\n importNodeIndex++;\n } else {\n ruleNodes.push(rule);\n }\n }\n ruleNodes = charsetRuleNodes.concat(ruleNodes);\n\n // If this is the root node, we don't render\n // a selector, or {}.\n if (!this.root) {\n debugInfo = getDebugInfo(context, this, tabSetStr);\n\n if (debugInfo) {\n output.add(debugInfo);\n output.add(tabSetStr);\n }\n\n const paths = this.paths;\n const pathCnt = paths.length;\n let pathSubCnt;\n\n sep = context.compress ? ',' : (`,\\n${tabSetStr}`);\n\n for (i = 0; i < pathCnt; i++) {\n path = paths[i];\n if (!(pathSubCnt = path.length)) { continue; }\n if (i > 0) { output.add(sep); }\n\n context.firstSelector = true;\n path[0].genCSS(context, output);\n\n context.firstSelector = false;\n for (j = 1; j < pathSubCnt; j++) {\n path[j].genCSS(context, output);\n }\n }\n\n output.add((context.compress ? '{' : ' {\\n') + tabRuleStr);\n }\n\n // Compile rules and rulesets\n for (i = 0; (rule = ruleNodes[i]); i++) {\n\n if (i + 1 === ruleNodes.length) {\n context.lastRule = true;\n }\n\n const currentLastRule = context.lastRule;\n if (rule.isRulesetLike(rule)) {\n context.lastRule = false;\n }\n\n if (rule.genCSS) {\n rule.genCSS(context, output);\n } else if (rule.value) {\n output.add(rule.value.toString());\n }\n\n context.lastRule = currentLastRule;\n\n if (!context.lastRule && rule.isVisible()) {\n output.add(context.compress ? '' : (`\\n${tabRuleStr}`));\n } else {\n context.lastRule = false;\n }\n }\n\n if (!this.root) {\n output.add((context.compress ? '}' : `\\n${tabSetStr}}`));\n context.tabLevel--;\n }\n\n if (!output.isEmpty() && !context.compress && this.firstRoot) {\n output.add('\\n');\n }\n },\n\n joinSelectors(paths, context, selectors) {\n for (let s = 0; s < selectors.length; s++) {\n this.joinSelector(paths, context, selectors[s]);\n }\n },\n\n joinSelector(paths, context, selector) {\n\n function createParenthesis(elementsToPak, originalElement) {\n let replacementParen, j;\n if (elementsToPak.length === 0) {\n replacementParen = new Paren(elementsToPak[0]);\n } else {\n const insideParent = new Array(elementsToPak.length);\n for (j = 0; j < elementsToPak.length; j++) {\n insideParent[j] = new Element(\n null,\n elementsToPak[j],\n originalElement.isVariable,\n originalElement._index,\n originalElement._fileInfo\n );\n }\n replacementParen = new Paren(new Selector(insideParent));\n }\n return replacementParen;\n }\n\n function createSelector(containedElement, originalElement) {\n let element, selector;\n element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo);\n selector = new Selector([element]);\n return selector;\n }\n\n // joins selector path from `beginningPath` with selector path in `addPath`\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns concatenated path\n function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) {\n let newSelectorPath, lastSelector, newJoinedSelector;\n // our new selector path\n newSelectorPath = [];\n\n // construct the joined selector - if & is the first thing this will be empty,\n // if not newJoinedSelector will be the last set of elements in the selector\n if (beginningPath.length > 0) {\n newSelectorPath = utils.copyArray(beginningPath);\n lastSelector = newSelectorPath.pop();\n newJoinedSelector = originalSelector.createDerived(utils.copyArray(lastSelector.elements));\n }\n else {\n newJoinedSelector = originalSelector.createDerived([]);\n }\n\n if (addPath.length > 0) {\n // /deep/ is a CSS4 selector - (removed, so should deprecate)\n // that is valid without anything in front of it\n // so if the & does not have a combinator that is \"\" or \" \" then\n // and there is a combinator on the parent, then grab that.\n // this also allows + a { & .b { .a & { ... though not sure why you would want to do that\n let combinator = replacedElement.combinator;\n\n const parentEl = addPath[0].elements[0];\n if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) {\n combinator = parentEl.combinator;\n }\n // join the elements so far with the first part of the parent\n newJoinedSelector.elements.push(new Element(\n combinator,\n parentEl.value,\n replacedElement.isVariable,\n replacedElement._index,\n replacedElement._fileInfo\n ));\n newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1));\n }\n\n // now add the joined selector - but only if it is not empty\n if (newJoinedSelector.elements.length !== 0) {\n newSelectorPath.push(newJoinedSelector);\n }\n\n // put together the parent selectors after the join (e.g. the rest of the parent)\n if (addPath.length > 1) {\n let restOfPath = addPath.slice(1);\n restOfPath = restOfPath.map(function (selector) {\n return selector.createDerived(selector.elements, []);\n });\n newSelectorPath = newSelectorPath.concat(restOfPath);\n }\n return newSelectorPath;\n }\n\n // joins selector path from `beginningPath` with every selector path in `addPaths` array\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns array with all concatenated paths\n function addAllReplacementsIntoPath( beginningPath, addPaths, replacedElement, originalSelector, result) {\n let j;\n for (j = 0; j < beginningPath.length; j++) {\n const newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector);\n result.push(newSelectorPath);\n }\n return result;\n }\n\n function mergeElementsOnToSelectors(elements, selectors) {\n let i, sel;\n\n if (elements.length === 0) {\n return ;\n }\n if (selectors.length === 0) {\n selectors.push([ new Selector(elements) ]);\n return;\n }\n\n for (i = 0; (sel = selectors[i]); i++) {\n // if the previous thing in sel is a parent this needs to join on to it\n if (sel.length > 0) {\n sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements));\n }\n else {\n sel.push(new Selector(elements));\n }\n }\n }\n\n // replace all parent selectors inside `inSelector` by content of `context` array\n // resulting selectors are returned inside `paths` array\n // returns true if `inSelector` contained at least one parent selector\n function replaceParentSelector(paths, context, inSelector) {\n // The paths are [[Selector]]\n // The first list is a list of comma separated selectors\n // The inner list is a list of inheritance separated selectors\n // e.g.\n // .a, .b {\n // .c {\n // }\n // }\n // == [[.a] [.c]] [[.b] [.c]]\n //\n let i, j, k, currentElements, newSelectors, selectorsMultiplied, sel, el, hadParentSelector = false, length, lastSelector;\n function findNestedSelector(element) {\n let maybeSelector;\n if (!(element.value instanceof Paren)) {\n return null;\n }\n\n maybeSelector = element.value.value;\n if (!(maybeSelector instanceof Selector)) {\n return null;\n }\n\n return maybeSelector;\n }\n\n // the elements from the current selector so far\n currentElements = [];\n // the current list of new selectors to add to the path.\n // We will build it up. We initiate it with one empty selector as we \"multiply\" the new selectors\n // by the parents\n newSelectors = [\n []\n ];\n\n for (i = 0; (el = inSelector.elements[i]); i++) {\n // non parent reference elements just get added\n if (el.value !== '&') {\n const nestedSelector = findNestedSelector(el);\n if (nestedSelector !== null) {\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n const nestedPaths = [];\n let replaced;\n const replacedNewSelectors = [];\n replaced = replaceParentSelector(nestedPaths, context, nestedSelector);\n hadParentSelector = hadParentSelector || replaced;\n // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors\n for (k = 0; k < nestedPaths.length; k++) {\n const replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el);\n addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors);\n }\n newSelectors = replacedNewSelectors;\n currentElements = [];\n } else {\n currentElements.push(el);\n }\n\n } else {\n hadParentSelector = true;\n // the new list of selectors to add\n selectorsMultiplied = [];\n\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n // loop through our current selectors\n for (j = 0; j < newSelectors.length; j++) {\n sel = newSelectors[j];\n // if we don't have any parent paths, the & might be in a mixin so that it can be used\n // whether there are parents or not\n if (context.length === 0) {\n // the combinator used on el should now be applied to the next element instead so that\n // it is not lost\n if (sel.length > 0) {\n sel[0].elements.push(new Element(el.combinator, '', el.isVariable, el._index, el._fileInfo));\n }\n selectorsMultiplied.push(sel);\n }\n else {\n // and the parent selectors\n for (k = 0; k < context.length; k++) {\n // We need to put the current selectors\n // then join the last selector's elements on to the parents selectors\n const newSelectorPath = addReplacementIntoPath(sel, context[k], el, inSelector);\n // add that to our new set of selectors\n selectorsMultiplied.push(newSelectorPath);\n }\n }\n }\n\n // our new selectors has been multiplied, so reset the state\n newSelectors = selectorsMultiplied;\n currentElements = [];\n }\n }\n\n // if we have any elements left over (e.g. .a& .b == .b)\n // add them on to all the current selectors\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n for (i = 0; i < newSelectors.length; i++) {\n length = newSelectors[i].length;\n if (length > 0) {\n paths.push(newSelectors[i]);\n lastSelector = newSelectors[i][length - 1];\n newSelectors[i][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList);\n }\n }\n\n return hadParentSelector;\n }\n\n function deriveSelector(visibilityInfo, deriveFrom) {\n const newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition);\n newSelector.copyVisibilityInfo(visibilityInfo);\n return newSelector;\n }\n\n // joinSelector code follows\n let i, newPaths, hadParentSelector;\n\n newPaths = [];\n hadParentSelector = replaceParentSelector(newPaths, context, selector);\n\n if (!hadParentSelector) {\n if (context.length > 0) {\n newPaths = [];\n for (i = 0; i < context.length; i++) {\n\n const concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo()));\n\n concatenated.push(selector);\n newPaths.push(concatenated);\n }\n }\n else {\n newPaths = [[selector]];\n }\n }\n\n for (i = 0; i < newPaths.length; i++) {\n paths.push(newPaths[i]);\n }\n\n }\n});\n\nexport default Ruleset;\n","import Node from './node';\nimport Selector from './selector';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\n\nconst AtRule = function(\n name,\n value,\n rules,\n index,\n currentFileInfo,\n debugInfo,\n isRooted,\n visibilityInfo\n) {\n let i;\n\n this.name = name;\n this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value);\n if (rules) {\n if (Array.isArray(rules)) {\n this.rules = rules;\n } else {\n this.rules = [rules];\n this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors();\n }\n for (i = 0; i < this.rules.length; i++) {\n this.rules[i].allowImports = true;\n }\n this.setParent(this.rules, this);\n }\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.debugInfo = debugInfo;\n this.isRooted = isRooted || false;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n}\n\nAtRule.prototype = Object.assign(new Node(), {\n type: 'AtRule',\n accept(visitor) {\n const value = this.value, rules = this.rules;\n if (rules) {\n this.rules = visitor.visitArray(rules);\n }\n if (value) {\n this.value = visitor.visit(value);\n }\n },\n\n isRulesetLike() {\n return this.rules || !this.isCharset();\n },\n\n isCharset() {\n return '@charset' === this.name;\n },\n\n genCSS(context, output) {\n const value = this.value, rules = this.rules;\n output.add(this.name, this.fileInfo(), this.getIndex());\n if (value) {\n output.add(' ');\n value.genCSS(context, output);\n }\n if (rules) {\n this.outputRuleset(context, output, rules);\n } else {\n output.add(';');\n }\n },\n\n eval(context) {\n let mediaPathBackup, mediaBlocksBackup, value = this.value, rules = this.rules;\n\n // media stored inside other atrule should not bubble over it\n // backpup media bubbling information\n mediaPathBackup = context.mediaPath;\n mediaBlocksBackup = context.mediaBlocks;\n // deleted media bubbling information\n context.mediaPath = [];\n context.mediaBlocks = [];\n\n if (value) {\n value = value.eval(context);\n }\n if (rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n rules = [rules[0].eval(context)];\n rules[0].root = true;\n }\n // restore media bubbling information\n context.mediaPath = mediaPathBackup;\n context.mediaBlocks = mediaBlocksBackup;\n\n return new AtRule(this.name, value, rules,\n this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo());\n },\n\n variable(name) {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.variable.call(this.rules[0], name);\n }\n },\n\n find() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.find.apply(this.rules[0], arguments);\n }\n },\n\n rulesets() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.rulesets.apply(this.rules[0]);\n }\n },\n\n outputRuleset(context, output, rules) {\n const ruleCnt = rules.length;\n let i;\n context.tabLevel = (context.tabLevel | 0) + 1;\n\n // Compressed\n if (context.compress) {\n output.add('{');\n for (i = 0; i < ruleCnt; i++) {\n rules[i].genCSS(context, output);\n }\n output.add('}');\n context.tabLevel--;\n return;\n }\n\n // Non-compressed\n const tabSetStr = `\\n${Array(context.tabLevel).join(' ')}`, tabRuleStr = `${tabSetStr} `;\n if (!ruleCnt) {\n output.add(` {${tabSetStr}}`);\n } else {\n output.add(` {${tabRuleStr}`);\n rules[0].genCSS(context, output);\n for (i = 1; i < ruleCnt; i++) {\n output.add(tabRuleStr);\n rules[i].genCSS(context, output);\n }\n output.add(`${tabSetStr}}`);\n }\n\n context.tabLevel--;\n }\n});\n\nexport default AtRule;\n","import Node from './node';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nconst DetachedRuleset = function(ruleset, frames) {\n this.ruleset = ruleset;\n this.frames = frames;\n this.setParent(this.ruleset, this);\n};\n\nDetachedRuleset.prototype = Object.assign(new Node(), {\n type: 'DetachedRuleset',\n evalFirst: true,\n\n accept(visitor) {\n this.ruleset = visitor.visit(this.ruleset);\n },\n\n eval(context) {\n const frames = this.frames || utils.copyArray(context.frames);\n return new DetachedRuleset(this.ruleset, frames);\n },\n\n callEval(context) {\n return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context);\n }\n});\n\nexport default DetachedRuleset;\n","import Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport * as utils from '../utils';\n\nconst Unit = function(numerator, denominator, backupUnit) {\n this.numerator = numerator ? utils.copyArray(numerator).sort() : [];\n this.denominator = denominator ? utils.copyArray(denominator).sort() : [];\n if (backupUnit) {\n this.backupUnit = backupUnit;\n } else if (numerator && numerator.length) {\n this.backupUnit = numerator[0];\n }\n};\n\nUnit.prototype = Object.assign(new Node(), {\n type: 'Unit',\n\n clone() {\n return new Unit(utils.copyArray(this.numerator), utils.copyArray(this.denominator), this.backupUnit);\n },\n\n genCSS(context, output) {\n // Dimension checks the unit is singular and throws an error if in strict math mode.\n const strictUnits = context && context.strictUnits;\n if (this.numerator.length === 1) {\n output.add(this.numerator[0]); // the ideal situation\n } else if (!strictUnits && this.backupUnit) {\n output.add(this.backupUnit);\n } else if (!strictUnits && this.denominator.length) {\n output.add(this.denominator[0]);\n }\n },\n\n toString() {\n let i, returnStr = this.numerator.join('*');\n for (i = 0; i < this.denominator.length; i++) {\n returnStr += `/${this.denominator[i]}`;\n }\n return returnStr;\n },\n\n compare(other) {\n return this.is(other.toString()) ? 0 : undefined;\n },\n\n is(unitString) {\n return this.toString().toUpperCase() === unitString.toUpperCase();\n },\n\n isLength() {\n return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS());\n },\n\n isEmpty() {\n return this.numerator.length === 0 && this.denominator.length === 0;\n },\n\n isSingular() {\n return this.numerator.length <= 1 && this.denominator.length === 0;\n },\n\n map(callback) {\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n this.numerator[i] = callback(this.numerator[i], false);\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n this.denominator[i] = callback(this.denominator[i], true);\n }\n },\n\n usedUnits() {\n let group;\n const result = {};\n let mapUnit;\n let groupName;\n\n mapUnit = function (atomicUnit) {\n // eslint-disable-next-line no-prototype-builtins\n if (group.hasOwnProperty(atomicUnit) && !result[groupName]) {\n result[groupName] = atomicUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in unitConversions) {\n // eslint-disable-next-line no-prototype-builtins\n if (unitConversions.hasOwnProperty(groupName)) {\n group = unitConversions[groupName];\n\n this.map(mapUnit);\n }\n }\n\n return result;\n },\n\n cancel() {\n const counter = {};\n let atomicUnit;\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n atomicUnit = this.numerator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) + 1;\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n atomicUnit = this.denominator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) - 1;\n }\n\n this.numerator = [];\n this.denominator = [];\n\n for (atomicUnit in counter) {\n // eslint-disable-next-line no-prototype-builtins\n if (counter.hasOwnProperty(atomicUnit)) {\n const count = counter[atomicUnit];\n\n if (count > 0) {\n for (i = 0; i < count; i++) {\n this.numerator.push(atomicUnit);\n }\n } else if (count < 0) {\n for (i = 0; i < -count; i++) {\n this.denominator.push(atomicUnit);\n }\n }\n }\n }\n\n this.numerator.sort();\n this.denominator.sort();\n }\n});\n\nexport default Unit;\n","/* eslint-disable no-prototype-builtins */\nimport Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport Unit from './unit';\nimport Color from './color';\n\n//\n// A number with a unit\n//\nconst Dimension = function(value, unit) {\n this.value = parseFloat(value);\n if (isNaN(this.value)) {\n throw new Error('Dimension is not a number.');\n }\n this.unit = (unit && unit instanceof Unit) ? unit :\n new Unit(unit ? [unit] : undefined);\n this.setParent(this.unit, this);\n};\n\nDimension.prototype = Object.assign(new Node(), {\n type: 'Dimension',\n\n accept(visitor) {\n this.unit = visitor.visit(this.unit);\n },\n\n // remove when Nodes have JSDoc types\n // eslint-disable-next-line no-unused-vars\n eval(context) {\n return this;\n },\n\n toColor() {\n return new Color([this.value, this.value, this.value]);\n },\n\n genCSS(context, output) {\n if ((context && context.strictUnits) && !this.unit.isSingular()) {\n throw new Error(`Multiple units in dimension. Correct the units or use the unit function. Bad unit: ${this.unit.toString()}`);\n }\n\n const value = this.fround(context, this.value);\n let strValue = String(value);\n\n if (value !== 0 && value < 0.000001 && value > -0.000001) {\n // would be output 1e-6 etc.\n strValue = value.toFixed(20).replace(/0+$/, '');\n }\n\n if (context && context.compress) {\n // Zero values doesn't need a unit\n if (value === 0 && this.unit.isLength()) {\n output.add(strValue);\n return;\n }\n\n // Float values doesn't need a leading zero\n if (value > 0 && value < 1) {\n strValue = (strValue).substr(1);\n }\n }\n\n output.add(strValue);\n this.unit.genCSS(context, output);\n },\n\n // In an operation between two Dimensions,\n // we default to the first Dimension's unit,\n // so `1px + 2` will yield `3px`.\n operate(context, op, other) {\n /* jshint noempty:false */\n let value = this._operate(context, op, this.value, other.value);\n let unit = this.unit.clone();\n\n if (op === '+' || op === '-') {\n if (unit.numerator.length === 0 && unit.denominator.length === 0) {\n unit = other.unit.clone();\n if (this.unit.backupUnit) {\n unit.backupUnit = this.unit.backupUnit;\n }\n } else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) {\n // do nothing\n } else {\n other = other.convertTo(this.unit.usedUnits());\n\n if (context.strictUnits && other.unit.toString() !== unit.toString()) {\n throw new Error('Incompatible units. Change the units or use the unit function. '\n + `Bad units: '${unit.toString()}' and '${other.unit.toString()}'.`);\n }\n\n value = this._operate(context, op, this.value, other.value);\n }\n } else if (op === '*') {\n unit.numerator = unit.numerator.concat(other.unit.numerator).sort();\n unit.denominator = unit.denominator.concat(other.unit.denominator).sort();\n unit.cancel();\n } else if (op === '/') {\n unit.numerator = unit.numerator.concat(other.unit.denominator).sort();\n unit.denominator = unit.denominator.concat(other.unit.numerator).sort();\n unit.cancel();\n }\n return new Dimension(value, unit);\n },\n\n compare(other) {\n let a, b;\n\n if (!(other instanceof Dimension)) {\n return undefined;\n }\n\n if (this.unit.isEmpty() || other.unit.isEmpty()) {\n a = this;\n b = other;\n } else {\n a = this.unify();\n b = other.unify();\n if (a.unit.compare(b.unit) !== 0) {\n return undefined;\n }\n }\n\n return Node.numericCompare(a.value, b.value);\n },\n\n unify() {\n return this.convertTo({ length: 'px', duration: 's', angle: 'rad' });\n },\n\n convertTo(conversions) {\n let value = this.value;\n const unit = this.unit.clone();\n let i;\n let groupName;\n let group;\n let targetUnit;\n let derivedConversions = {};\n let applyUnit;\n\n if (typeof conversions === 'string') {\n for (i in unitConversions) {\n if (unitConversions[i].hasOwnProperty(conversions)) {\n derivedConversions = {};\n derivedConversions[i] = conversions;\n }\n }\n conversions = derivedConversions;\n }\n applyUnit = function (atomicUnit, denominator) {\n if (group.hasOwnProperty(atomicUnit)) {\n if (denominator) {\n value = value / (group[atomicUnit] / group[targetUnit]);\n } else {\n value = value * (group[atomicUnit] / group[targetUnit]);\n }\n\n return targetUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in conversions) {\n if (conversions.hasOwnProperty(groupName)) {\n targetUnit = conversions[groupName];\n group = unitConversions[groupName];\n\n unit.map(applyUnit);\n }\n }\n\n unit.cancel();\n\n return new Dimension(value, unit);\n }\n});\n\nexport default Dimension;\n","import Node from './node';\nimport Color from './color';\nimport Dimension from './dimension';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\n\nconst Operation = function(op, operands, isSpaced) {\n this.op = op.trim();\n this.operands = operands;\n this.isSpaced = isSpaced;\n};\n\nOperation.prototype = Object.assign(new Node(), {\n type: 'Operation',\n\n accept(visitor) {\n this.operands = visitor.visitArray(this.operands);\n },\n\n eval(context) {\n let a = this.operands[0].eval(context), b = this.operands[1].eval(context), op;\n\n if (context.isMathOn(this.op)) {\n op = this.op === './' ? '/' : this.op;\n if (a instanceof Dimension && b instanceof Color) {\n a = a.toColor();\n }\n if (b instanceof Dimension && a instanceof Color) {\n b = b.toColor();\n }\n if (!a.operate || !b.operate) {\n if (\n (a instanceof Operation || b instanceof Operation)\n && a.op === '/' && context.math === MATH.PARENS_DIVISION\n ) {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n throw { type: 'Operation',\n message: 'Operation on an invalid type' };\n }\n\n return a.operate(context, op, b);\n } else {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n },\n\n genCSS(context, output) {\n this.operands[0].genCSS(context, output);\n if (this.isSpaced) {\n output.add(' ');\n }\n output.add(this.op);\n if (this.isSpaced) {\n output.add(' ');\n }\n this.operands[1].genCSS(context, output);\n }\n});\n\nexport default Operation;\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import Node from './node';\nimport Paren from './paren';\nimport Comment from './comment';\nimport Dimension from './dimension';\n\nconst Expression = function(value, noSpacing) {\n this.value = value;\n this.noSpacing = noSpacing;\n if (!value) {\n throw new Error('Expression requires an array parameter');\n }\n};\n\nExpression.prototype = Object.assign(new Node(), {\n type: 'Expression',\n\n accept(visitor) {\n this.value = visitor.visitArray(this.value);\n },\n\n eval(context) {\n let returnValue;\n const mathOn = context.isMathOn();\n const inParenthesis = this.parens;\n\n let doubleParen = false;\n if (inParenthesis) {\n context.inParenthesis();\n }\n if (this.value.length > 1) {\n returnValue = new Expression(this.value.map(function (e) {\n if (!e.eval) {\n return e;\n }\n return e.eval(context);\n }), this.noSpacing);\n } else if (this.value.length === 1) {\n if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) {\n doubleParen = true;\n }\n returnValue = this.value[0].eval(context);\n } else {\n returnValue = this;\n }\n if (inParenthesis) {\n context.outOfParenthesis();\n }\n if (this.parens && this.parensInOp && !mathOn && !doubleParen \n && (!(returnValue instanceof Dimension))) {\n returnValue = new Paren(returnValue);\n }\n return returnValue;\n },\n\n genCSS(context, output) {\n for (let i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (!this.noSpacing && i + 1 < this.value.length) {\n output.add(' ');\n }\n }\n },\n\n throwAwayComments() {\n this.value = this.value.filter(function(v) {\n return !(v instanceof Comment);\n });\n }\n});\n\nexport default Expression;\n","import Expression from '../tree/expression';\n\nclass functionCaller {\n constructor(name, context, index, currentFileInfo) {\n this.name = name.toLowerCase();\n this.index = index;\n this.context = context;\n this.currentFileInfo = currentFileInfo;\n\n this.func = context.frames[0].functionRegistry.get(this.name);\n }\n\n isValid() {\n return Boolean(this.func);\n }\n\n call(args) {\n if (!(Array.isArray(args))) {\n args = [args];\n }\n const evalArgs = this.func.evalArgs;\n if (evalArgs !== false) {\n args = args.map(a => a.eval(this.context));\n }\n const commentFilter = item => !(item.type === 'Comment');\n\n // This code is terrible and should be replaced as per this issue...\n // https://github.com/less/less.js/issues/2477\n args = args\n .filter(commentFilter)\n .map(item => {\n if (item.type === 'Expression') {\n const subNodes = item.value.filter(commentFilter);\n if (subNodes.length === 1) {\n // https://github.com/less/less.js/issues/3616\n if (item.parens && subNodes[0].op === '/') {\n return item;\n }\n return subNodes[0];\n } else {\n return new Expression(subNodes);\n }\n }\n return item;\n });\n\n if (evalArgs === false) {\n return this.func(this.context, ...args);\n }\n\n return this.func(...args);\n }\n}\n\nexport default functionCaller;\n","import Node from './node';\nimport Anonymous from './anonymous';\nimport FunctionCaller from '../functions/function-caller';\n\n//\n// A function call node.\n//\nconst Call = function(name, args, index, currentFileInfo) {\n this.name = name;\n this.args = args;\n this.calc = name === 'calc';\n this._index = index;\n this._fileInfo = currentFileInfo;\n}\n\nCall.prototype = Object.assign(new Node(), {\n type: 'Call',\n\n accept(visitor) {\n if (this.args) {\n this.args = visitor.visitArray(this.args);\n }\n },\n\n //\n // When evaluating a function call,\n // we either find the function in the functionRegistry,\n // in which case we call it, passing the evaluated arguments,\n // if this returns null or we cannot find the function, we\n // simply print it out as it appeared originally [2].\n //\n // The reason why we evaluate the arguments, is in the case where\n // we try to pass a variable to a function, like: `saturate(@color)`.\n // The function should receive the value, not the variable.\n //\n eval(context) {\n /**\n * Turn off math for calc(), and switch back on for evaluating nested functions\n */\n const currentMathContext = context.mathOn;\n context.mathOn = !this.calc;\n if (this.calc || context.inCalc) {\n context.enterCalc();\n }\n\n const exitCalc = () => {\n if (this.calc || context.inCalc) {\n context.exitCalc();\n }\n context.mathOn = currentMathContext;\n };\n\n let result;\n const funcCaller = new FunctionCaller(this.name, context, this.getIndex(), this.fileInfo());\n\n if (funcCaller.isValid()) {\n try {\n result = funcCaller.call(this.args);\n exitCalc();\n } catch (e) {\n // eslint-disable-next-line no-prototype-builtins\n if (e.hasOwnProperty('line') && e.hasOwnProperty('column')) {\n throw e;\n }\n throw { \n type: e.type || 'Runtime',\n message: `Error evaluating function \\`${this.name}\\`${e.message ? `: ${e.message}` : ''}`,\n index: this.getIndex(), \n filename: this.fileInfo().filename,\n line: e.lineNumber,\n column: e.columnNumber\n };\n }\n }\n\n if (result !== null && result !== undefined) {\n // Results that that are not nodes are cast as Anonymous nodes\n // Falsy values or booleans are returned as empty nodes\n if (!(result instanceof Node)) {\n if (!result || result === true) {\n result = new Anonymous(null); \n }\n else {\n result = new Anonymous(result.toString()); \n }\n \n }\n result._index = this._index;\n result._fileInfo = this._fileInfo;\n return result;\n }\n\n const args = this.args.map(a => a.eval(context));\n exitCalc();\n\n return new Call(this.name, args, this.getIndex(), this.fileInfo());\n },\n\n genCSS(context, output) {\n output.add(`${this.name}(`, this.fileInfo(), this.getIndex());\n\n for (let i = 0; i < this.args.length; i++) {\n this.args[i].genCSS(context, output);\n if (i + 1 < this.args.length) {\n output.add(', ');\n }\n }\n\n output.add(')');\n }\n});\n\nexport default Call;\n","import Node from './node';\nimport Call from './call';\n\nconst Variable = function(name, index, currentFileInfo) {\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n};\n\nVariable.prototype = Object.assign(new Node(), {\n type: 'Variable',\n\n eval(context) {\n let variable, name = this.name;\n\n if (name.indexOf('@@') === 0) {\n name = `@${new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value}`;\n }\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive variable definition for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n variable = this.find(context.frames, function (frame) {\n const v = frame.variable(name);\n if (v) {\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n // If in calc, wrap vars in a function call to cascade evaluate args first\n if (context.inCalc) {\n return (new Call('_SELF', [v.value])).eval(context);\n }\n else {\n return v.value.eval(context);\n }\n }\n });\n if (variable) {\n this.evaluating = false;\n return variable;\n } else {\n throw { type: 'Name',\n message: `variable ${name} is undefined`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n },\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n});\n\nexport default Variable;\n","import Node from './node';\nimport Declaration from './declaration';\n\nconst Property = function(name, index, currentFileInfo) {\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n};\n\nProperty.prototype = Object.assign(new Node(), {\n type: 'Property',\n\n eval(context) {\n let property;\n const name = this.name;\n // TODO: shorten this reference\n const mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive property reference for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n property = this.find(context.frames, function (frame) {\n let v;\n const vArr = frame.property(name);\n if (vArr) {\n for (let i = 0; i < vArr.length; i++) {\n v = vArr[i];\n\n vArr[i] = new Declaration(v.name,\n v.value,\n v.important,\n v.merge,\n v.index,\n v.currentFileInfo,\n v.inline,\n v.variable\n );\n }\n mergeRules(vArr);\n\n v = vArr[vArr.length - 1];\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n v = v.value.eval(context);\n return v;\n }\n });\n if (property) {\n this.evaluating = false;\n return property;\n } else {\n throw { type: 'Name',\n message: `Property '${name}' is undefined`,\n filename: this.currentFileInfo.filename,\n index: this.index };\n }\n },\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n});\n\nexport default Property;\n","import Node from './node';\n\nconst Attribute = function(key, op, value, cif) {\n this.key = key;\n this.op = op;\n this.value = value;\n this.cif = cif;\n}\n\nAttribute.prototype = Object.assign(new Node(), {\n type: 'Attribute',\n\n eval(context) {\n return new Attribute(\n this.key.eval ? this.key.eval(context) : this.key,\n this.op,\n (this.value && this.value.eval) ? this.value.eval(context) : this.value,\n this.cif\n );\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n },\n\n toCSS(context) {\n let value = this.key.toCSS ? this.key.toCSS(context) : this.key;\n\n if (this.op) {\n value += this.op;\n value += (this.value.toCSS ? this.value.toCSS(context) : this.value);\n }\n\n if (this.cif) {\n value = value + ' ' + this.cif;\n }\n\n return `[${value}]`;\n }\n});\n\nexport default Attribute;\n","import Node from './node';\nimport Variable from './variable';\nimport Property from './property';\n\nconst Quoted = function(str, content, escaped, index, currentFileInfo) {\n this.escaped = (escaped === undefined) ? true : escaped;\n this.value = content || '';\n this.quote = str.charAt(0);\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.variableRegex = /@\\{([\\w-]+)\\}/g;\n this.propRegex = /\\$\\{([\\w-]+)\\}/g;\n this.allowRoot = escaped;\n};\n\nQuoted.prototype = Object.assign(new Node(), {\n type: 'Quoted',\n\n genCSS(context, output) {\n if (!this.escaped) {\n output.add(this.quote, this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n if (!this.escaped) {\n output.add(this.quote);\n }\n },\n\n containsVariables() {\n return this.value.match(this.variableRegex);\n },\n\n eval(context) {\n const that = this;\n let value = this.value;\n const variableReplacement = function (_, name) {\n const v = new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n const propertyReplacement = function (_, name) {\n const v = new Property(`$${name}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n function iterativeReplace(value, regexp, replacementFnc) {\n let evaluatedValue = value;\n do {\n value = evaluatedValue.toString();\n evaluatedValue = value.replace(regexp, replacementFnc);\n } while (value !== evaluatedValue);\n return evaluatedValue;\n }\n value = iterativeReplace(value, this.variableRegex, variableReplacement);\n value = iterativeReplace(value, this.propRegex, propertyReplacement);\n return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo());\n },\n\n compare(other) {\n // when comparing quoted strings allow the quote to differ\n if (other.type === 'Quoted' && !this.escaped && !other.escaped) {\n return Node.numericCompare(this.value, other.value);\n } else {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n }\n }\n});\n\nexport default Quoted;\n","import Node from './node';\n\nfunction escapePath(path) {\n return path.replace(/[()'\"\\s]/g, function(match) { return `\\\\${match}`; });\n}\n\nconst URL = function(val, index, currentFileInfo, isEvald) {\n this.value = val;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.isEvald = isEvald;\n};\n\nURL.prototype = Object.assign(new Node(), {\n type: 'Url',\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n },\n\n genCSS(context, output) {\n output.add('url(');\n this.value.genCSS(context, output);\n output.add(')');\n },\n\n eval(context) {\n const val = this.value.eval(context);\n let rootpath;\n\n if (!this.isEvald) {\n // Add the rootpath if the URL requires a rewrite\n rootpath = this.fileInfo() && this.fileInfo().rootpath;\n if (typeof rootpath === 'string' &&\n typeof val.value === 'string' &&\n context.pathRequiresRewrite(val.value)) {\n if (!val.quote) {\n rootpath = escapePath(rootpath);\n }\n val.value = context.rewritePath(val.value, rootpath);\n } else {\n val.value = context.normalizePath(val.value);\n }\n\n // Add url args if enabled\n if (context.urlArgs) {\n if (!val.value.match(/^\\s*data:/)) {\n const delimiter = val.value.indexOf('?') === -1 ? '?' : '&';\n const urlArgs = delimiter + context.urlArgs;\n if (val.value.indexOf('#') !== -1) {\n val.value = val.value.replace('#', `${urlArgs}#`);\n } else {\n val.value += urlArgs;\n }\n }\n }\n }\n\n return new URL(val, this.getIndex(), this.fileInfo(), true);\n }\n});\n\nexport default URL;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport Anonymous from './anonymous';\nimport Expression from './expression';\nimport * as utils from '../utils';\n\nconst NestableAtRulePrototype = {\n\n isRulesetLike() {\n return true;\n },\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n if (this.rules) {\n this.rules = visitor.visitArray(this.rules);\n }\n },\n\n evalTop(context) {\n let result = this;\n\n // Render all dependent Media blocks.\n if (context.mediaBlocks.length > 1) {\n const selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors();\n result = new Ruleset(selectors, context.mediaBlocks);\n result.multiMedia = true;\n result.copyVisibilityInfo(this.visibilityInfo());\n this.setParent(result, this);\n }\n\n delete context.mediaBlocks;\n delete context.mediaPath;\n\n return result;\n },\n\n evalNested(context) {\n let i;\n let value;\n const path = context.mediaPath.concat([this]);\n\n // Extract the media-query conditions separated with `,` (OR).\n for (i = 0; i < path.length; i++) {\n value = path[i].features instanceof Value ?\n path[i].features.value : path[i].features;\n path[i] = Array.isArray(value) ? value : [value];\n }\n\n // Trace all permutations to generate the resulting media-query.\n //\n // (a, b and c) with nested (d, e) ->\n // a and d\n // a and e\n // b and c and d\n // b and c and e\n this.features = new Value(this.permute(path).map(path => {\n path = path.map(fragment => fragment.toCSS ? fragment : new Anonymous(fragment));\n\n for (i = path.length - 1; i > 0; i--) {\n path.splice(i, 0, new Anonymous('and'));\n }\n\n return new Expression(path);\n }));\n this.setParent(this.features, this);\n\n // Fake a tree-node that doesn't output anything.\n return new Ruleset([], []);\n },\n\n permute(arr) {\n if (arr.length === 0) {\n return [];\n } else if (arr.length === 1) {\n return arr[0];\n } else {\n const result = [];\n const rest = this.permute(arr.slice(1));\n for (let i = 0; i < rest.length; i++) {\n for (let j = 0; j < arr[0].length; j++) {\n result.push([arr[0][j]].concat(rest[i]));\n }\n }\n return result;\n }\n },\n\n bubbleSelectors(selectors) {\n if (!selectors) {\n return;\n }\n this.rules = [new Ruleset(utils.copyArray(selectors), [this.rules[0]])];\n this.setParent(this.rules, this);\n }\n};\n\nexport default NestableAtRulePrototype;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport AtRule from './atrule';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst Media = function(value, features, index, currentFileInfo, visibilityInfo) {\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n};\n\nMedia.prototype = Object.assign(new AtRule(), {\n type: 'Media',\n\n ...NestableAtRulePrototype,\n\n genCSS(context, output) {\n output.add('@media ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n },\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n});\n\nexport default Media;\n","import Node from './node';\nimport Media from './media';\nimport URL from './url';\nimport Quoted from './quoted';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\nimport * as utils from '../utils';\nimport LessError from '../less-error';\n\n//\n// CSS @import node\n//\n// The general strategy here is that we don't want to wait\n// for the parsing to be completed, before we start importing\n// the file. That's because in the context of a browser,\n// most of the time will be spent waiting for the server to respond.\n//\n// On creation, we push the import path to our import queue, though\n// `import,push`, we also pass it a callback, which it'll call once\n// the file has been fetched, and parsed.\n//\nconst Import = function(path, features, options, index, currentFileInfo, visibilityInfo) {\n this.options = options;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.path = path;\n this.features = features;\n this.allowRoot = true;\n\n if (this.options.less !== undefined || this.options.inline) {\n this.css = !this.options.less || this.options.inline;\n } else {\n const pathValue = this.getPath();\n if (pathValue && /[#.&?]css([?;].*)?$/.test(pathValue)) {\n this.css = true;\n }\n }\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.features, this);\n this.setParent(this.path, this);\n};\n\nImport.prototype = Object.assign(new Node(), {\n type: 'Import',\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n this.path = visitor.visit(this.path);\n if (!this.options.isPlugin && !this.options.inline && this.root) {\n this.root = visitor.visit(this.root);\n }\n },\n\n genCSS(context, output) {\n if (this.css && this.path._fileInfo.reference === undefined) {\n output.add('@import ', this._fileInfo, this._index);\n this.path.genCSS(context, output);\n if (this.features) {\n output.add(' ');\n this.features.genCSS(context, output);\n }\n output.add(';');\n }\n },\n\n getPath() {\n return (this.path instanceof URL) ?\n this.path.value.value : this.path.value;\n },\n\n isVariableImport() {\n let path = this.path;\n if (path instanceof URL) {\n path = path.value;\n }\n if (path instanceof Quoted) {\n return path.containsVariables();\n }\n\n return true;\n },\n\n evalForImport(context) {\n let path = this.path;\n\n if (path instanceof URL) {\n path = path.value;\n }\n\n return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo());\n },\n\n evalPath(context) {\n const path = this.path.eval(context);\n const fileInfo = this._fileInfo;\n\n if (!(path instanceof URL)) {\n // Add the rootpath if the URL requires a rewrite\n const pathValue = path.value;\n if (fileInfo &&\n pathValue &&\n context.pathRequiresRewrite(pathValue)) {\n path.value = context.rewritePath(pathValue, fileInfo.rootpath);\n } else {\n path.value = context.normalizePath(path.value);\n }\n }\n\n return path;\n },\n\n eval(context) {\n const result = this.doEval(context);\n if (this.options.reference || this.blocksVisibility()) {\n if (result.length || result.length === 0) {\n result.forEach(function (node) {\n node.addVisibilityBlock();\n }\n );\n } else {\n result.addVisibilityBlock();\n }\n }\n return result;\n },\n\n doEval(context) {\n let ruleset;\n let registry;\n const features = this.features && this.features.eval(context);\n\n if (this.options.isPlugin) {\n if (this.root && this.root.eval) {\n try {\n this.root.eval(context);\n }\n catch (e) {\n e.message = 'Plugin error during evaluation';\n throw new LessError(e, this.root.imports, this.root.filename);\n }\n }\n registry = context.frames[0] && context.frames[0].functionRegistry;\n if ( registry && this.root && this.root.functions ) {\n registry.addMultiple( this.root.functions );\n }\n\n return [];\n }\n\n if (this.skip) {\n if (typeof this.skip === 'function') {\n this.skip = this.skip();\n }\n if (this.skip) {\n return [];\n }\n }\n if (this.options.inline) {\n const contents = new Anonymous(this.root, 0,\n {\n filename: this.importedFilename,\n reference: this.path._fileInfo && this.path._fileInfo.reference\n }, true, true);\n\n return this.features ? new Media([contents], this.features.value) : [contents];\n } else if (this.css) {\n const newImport = new Import(this.evalPath(context), features, this.options, this._index);\n if (!newImport.css && this.error) {\n throw this.error;\n }\n return newImport;\n } else if (this.root) {\n ruleset = new Ruleset(null, utils.copyArray(this.root.rules));\n ruleset.evalImports(context);\n\n return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules;\n } else {\n return [];\n }\n }\n});\n\nexport default Import;\n","import Node from './node';\nimport Variable from './variable';\n\nconst JsEvalNode = function() {};\n\nJsEvalNode.prototype = Object.assign(new Node(), {\n evaluateJavaScript(expression, context) {\n let result;\n const that = this;\n const evalContext = {};\n\n if (!context.javascriptEnabled) {\n throw { message: 'Inline JavaScript is not enabled. Is it set in your options?',\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n expression = expression.replace(/@\\{([\\w-]+)\\}/g, function (_, name) {\n return that.jsify(new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context));\n });\n\n try {\n expression = new Function(`return (${expression})`);\n } catch (e) {\n throw { message: `JavaScript evaluation error: ${e.message} from \\`${expression}\\`` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n const variables = context.frames[0].variables();\n for (const k in variables) {\n // eslint-disable-next-line no-prototype-builtins\n if (variables.hasOwnProperty(k)) {\n evalContext[k.slice(1)] = {\n value: variables[k].value,\n toJS: function () {\n return this.value.eval(context).toCSS();\n }\n };\n }\n }\n\n try {\n result = expression.call(evalContext);\n } catch (e) {\n throw { message: `JavaScript evaluation error: '${e.name}: ${e.message.replace(/[\"]/g, '\\'')}'` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n return result;\n },\n\n jsify(obj) {\n if (Array.isArray(obj.value) && (obj.value.length > 1)) {\n return `[${obj.value.map(function (v) { return v.toCSS(); }).join(', ')}]`;\n } else {\n return obj.toCSS();\n }\n }\n});\n\nexport default JsEvalNode;\n","import JsEvalNode from './js-eval-node';\nimport Dimension from './dimension';\nimport Quoted from './quoted';\nimport Anonymous from './anonymous';\n\nconst JavaScript = function(string, escaped, index, currentFileInfo) {\n this.escaped = escaped;\n this.expression = string;\n this._index = index;\n this._fileInfo = currentFileInfo;\n}\n\nJavaScript.prototype = Object.assign(new JsEvalNode(), {\n type: 'JavaScript',\n\n eval(context) {\n const result = this.evaluateJavaScript(this.expression, context);\n const type = typeof result;\n\n if (type === 'number' && !isNaN(result)) {\n return new Dimension(result);\n } else if (type === 'string') {\n return new Quoted(`\"${result}\"`, result, this.escaped, this._index);\n } else if (Array.isArray(result)) {\n return new Anonymous(result.join(', '));\n } else {\n return new Anonymous(result);\n }\n }\n});\n\nexport default JavaScript;\n","import Node from './node';\n\nconst Assignment = function(key, val) {\n this.key = key;\n this.value = val;\n}\n\nAssignment.prototype = Object.assign(new Node(), {\n type: 'Assignment',\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n },\n\n eval(context) {\n if (this.value.eval) {\n return new Assignment(this.key, this.value.eval(context));\n }\n return this;\n },\n\n genCSS(context, output) {\n output.add(`${this.key}=`);\n if (this.value.genCSS) {\n this.value.genCSS(context, output);\n } else {\n output.add(this.value);\n }\n }\n});\n\nexport default Assignment;\n","import Node from './node';\n\nconst Condition = function(op, l, r, i, negate) {\n this.op = op.trim();\n this.lvalue = l;\n this.rvalue = r;\n this._index = i;\n this.negate = negate;\n};\n\nCondition.prototype = Object.assign(new Node(), {\n type: 'Condition',\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.rvalue = visitor.visit(this.rvalue);\n },\n\n eval(context) {\n const result = (function (op, a, b) {\n switch (op) {\n case 'and': return a && b;\n case 'or': return a || b;\n default:\n switch (Node.compare(a, b)) {\n case -1:\n return op === '<' || op === '=<' || op === '<=';\n case 0:\n return op === '=' || op === '>=' || op === '=<' || op === '<=';\n case 1:\n return op === '>' || op === '>=';\n default:\n return false;\n }\n }\n })(this.op, this.lvalue.eval(context), this.rvalue.eval(context));\n\n return this.negate ? !result : result;\n }\n});\n\nexport default Condition;\n","import Node from './node';\n\nconst QueryInParens = function (op, l, m, op2, r, i) {\n this.op = op.trim();\n this.lvalue = l;\n this.mvalue = m;\n this.op2 = op2 ? op2.trim() : null;\n this.rvalue = r;\n this._index = i;\n};\n\nQueryInParens.prototype = Object.assign(new Node(), {\n type: 'QueryInParens',\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.mvalue = visitor.visit(this.mvalue);\n if (this.rvalue) {\n this.rvalue = visitor.visit(this.rvalue);\n }\n },\n\n eval(context) {\n this.lvalue = this.lvalue.eval(context);\n this.mvalue = this.mvalue.eval(context);\n if (this.rvalue) {\n this.rvalue = this.rvalue.eval(context);\n }\n return this;\n },\n\n genCSS(context, output) {\n this.lvalue.genCSS(context, output);\n output.add(' ' + this.op + ' ');\n this.mvalue.genCSS(context, output);\n if (this.rvalue) {\n output.add(' ' + this.op2 + ' ');\n this.rvalue.genCSS(context, output);\n }\n },\n});\n\nexport default QueryInParens;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport AtRule from './atrule';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst Container = function(value, features, index, currentFileInfo, visibilityInfo) {\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n};\n\nContainer.prototype = Object.assign(new AtRule(), {\n type: 'Container',\n\n ...NestableAtRulePrototype,\n\n genCSS(context, output) {\n output.add('@container ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n },\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Container(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n});\n\nexport default Container;\n","import Node from './node';\n\nconst UnicodeDescriptor = function(value) {\n this.value = value;\n}\n\nUnicodeDescriptor.prototype = Object.assign(new Node(), {\n type: 'UnicodeDescriptor'\n})\n\nexport default UnicodeDescriptor;\n","import Node from './node';\nimport Operation from './operation';\nimport Dimension from './dimension';\n\nconst Negative = function(node) {\n this.value = node;\n};\n\nNegative.prototype = Object.assign(new Node(), {\n type: 'Negative',\n\n genCSS(context, output) {\n output.add('-');\n this.value.genCSS(context, output);\n },\n\n eval(context) {\n if (context.isMathOn()) {\n return (new Operation('*', [new Dimension(-1), this.value])).eval(context);\n }\n return new Negative(this.value.eval(context));\n }\n});\n\nexport default Negative;\n","import Node from './node';\nimport Selector from './selector';\n\nconst Extend = function(selector, option, index, currentFileInfo, visibilityInfo) {\n this.selector = selector;\n this.option = option;\n this.object_id = Extend.next_id++;\n this.parent_ids = [this.object_id];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n switch (option) {\n case 'all':\n this.allowBefore = true;\n this.allowAfter = true;\n break;\n default:\n this.allowBefore = false;\n this.allowAfter = false;\n break;\n }\n this.setParent(this.selector, this);\n};\n\nExtend.prototype = Object.assign(new Node(), {\n type: 'Extend',\n\n accept(visitor) {\n this.selector = visitor.visit(this.selector);\n },\n\n eval(context) {\n return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n // remove when Nodes have JSDoc types\n // eslint-disable-next-line no-unused-vars\n clone(context) {\n return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n // it concatenates (joins) all selectors in selector array\n findSelfSelectors(selectors) {\n let selfElements = [], i, selectorElements;\n\n for (i = 0; i < selectors.length; i++) {\n selectorElements = selectors[i].elements;\n // duplicate the logic in genCSS function inside the selector node.\n // future TODO - move both logics into the selector joiner visitor\n if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') {\n selectorElements[0].combinator.value = ' ';\n }\n selfElements = selfElements.concat(selectors[i].elements);\n }\n\n this.selfSelectors = [new Selector(selfElements)];\n this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo());\n }\n});\n\nExtend.next_id = 0;\nexport default Extend;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport DetachedRuleset from './detached-ruleset';\nimport LessError from '../less-error';\n\nconst VariableCall = function(variable, index, currentFileInfo) {\n this.variable = variable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n};\n\nVariableCall.prototype = Object.assign(new Node(), {\n type: 'VariableCall',\n\n eval(context) {\n let rules;\n let detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context);\n const error = new LessError({message: `Could not evaluate variable call ${this.variable}`});\n\n if (!detachedRuleset.ruleset) {\n if (detachedRuleset.rules) {\n rules = detachedRuleset;\n }\n else if (Array.isArray(detachedRuleset)) {\n rules = new Ruleset('', detachedRuleset);\n }\n else if (Array.isArray(detachedRuleset.value)) {\n rules = new Ruleset('', detachedRuleset.value);\n }\n else {\n throw error;\n }\n detachedRuleset = new DetachedRuleset(rules);\n }\n\n if (detachedRuleset.ruleset) {\n return detachedRuleset.callEval(context);\n }\n throw error;\n }\n});\n\nexport default VariableCall;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport Selector from './selector';\n\nconst NamespaceValue = function(ruleCall, lookups, index, fileInfo) {\n this.value = ruleCall;\n this.lookups = lookups;\n this._index = index;\n this._fileInfo = fileInfo;\n};\n\nNamespaceValue.prototype = Object.assign(new Node(), {\n type: 'NamespaceValue',\n\n eval(context) {\n let i, name, rules = this.value.eval(context);\n \n for (i = 0; i < this.lookups.length; i++) {\n name = this.lookups[i];\n\n /**\n * Eval'd DRs return rulesets.\n * Eval'd mixins return rules, so let's make a ruleset if we need it.\n * We need to do this because of late parsing of values\n */\n if (Array.isArray(rules)) {\n rules = new Ruleset([new Selector()], rules);\n }\n\n if (name === '') {\n rules = rules.lastDeclaration();\n }\n else if (name.charAt(0) === '@') {\n if (name.charAt(1) === '@') {\n name = `@${new Variable(name.substr(1)).eval(context).value}`;\n }\n if (rules.variables) {\n rules = rules.variable(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `variable ${name} not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n }\n else {\n if (name.substring(0, 2) === '$@') {\n name = `$${new Variable(name.substr(1)).eval(context).value}`;\n }\n else {\n name = name.charAt(0) === '$' ? name : `$${name}`;\n }\n if (rules.properties) {\n rules = rules.property(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `property \"${name.substr(1)}\" not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n // Properties are an array of values, since a ruleset can have multiple props.\n // We pick the last one (the \"cascaded\" value)\n rules = rules[rules.length - 1];\n }\n\n if (rules.value) {\n rules = rules.eval(context).value;\n }\n if (rules.ruleset) {\n rules = rules.ruleset.eval(context);\n }\n }\n return rules;\n }\n});\n\nexport default NamespaceValue;\n","import Selector from './selector';\nimport Element from './element';\nimport Ruleset from './ruleset';\nimport Declaration from './declaration';\nimport DetachedRuleset from './detached-ruleset';\nimport Expression from './expression';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nconst Definition = function(name, params, rules, condition, variadic, frames, visibilityInfo) {\n this.name = name || 'anonymous mixin';\n this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])];\n this.params = params;\n this.condition = condition;\n this.variadic = variadic;\n this.arity = params.length;\n this.rules = rules;\n this._lookups = {};\n const optionalParameters = [];\n this.required = params.reduce(function (count, p) {\n if (!p.name || (p.name && !p.value)) {\n return count + 1;\n }\n else {\n optionalParameters.push(p.name);\n return count;\n }\n }, 0);\n this.optionalParameters = optionalParameters;\n this.frames = frames;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n}\n\nDefinition.prototype = Object.assign(new Ruleset(), {\n type: 'MixinDefinition',\n evalFirst: true,\n\n accept(visitor) {\n if (this.params && this.params.length) {\n this.params = visitor.visitArray(this.params);\n }\n this.rules = visitor.visitArray(this.rules);\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n },\n\n evalParams(context, mixinEnv, args, evaldArguments) {\n /* jshint boss:true */\n const frame = new Ruleset(null, null);\n\n let varargs;\n let arg;\n const params = utils.copyArray(this.params);\n let i;\n let j;\n let val;\n let name;\n let isNamedFound;\n let argIndex;\n let argsLength = 0;\n\n if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) {\n frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit();\n }\n mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames));\n\n if (args) {\n args = utils.copyArray(args);\n argsLength = args.length;\n\n for (i = 0; i < argsLength; i++) {\n arg = args[i];\n if (name = (arg && arg.name)) {\n isNamedFound = false;\n for (j = 0; j < params.length; j++) {\n if (!evaldArguments[j] && name === params[j].name) {\n evaldArguments[j] = arg.value.eval(context);\n frame.prependRule(new Declaration(name, arg.value.eval(context)));\n isNamedFound = true;\n break;\n }\n }\n if (isNamedFound) {\n args.splice(i, 1);\n i--;\n continue;\n } else {\n throw { type: 'Runtime', message: `Named argument for ${this.name} ${args[i].name} not found` };\n }\n }\n }\n }\n argIndex = 0;\n for (i = 0; i < params.length; i++) {\n if (evaldArguments[i]) { continue; }\n\n arg = args && args[argIndex];\n\n if (name = params[i].name) {\n if (params[i].variadic) {\n varargs = [];\n for (j = argIndex; j < argsLength; j++) {\n varargs.push(args[j].value.eval(context));\n }\n frame.prependRule(new Declaration(name, new Expression(varargs).eval(context)));\n } else {\n val = arg && arg.value;\n if (val) {\n // This was a mixin call, pass in a detached ruleset of it's eval'd rules\n if (Array.isArray(val)) {\n val = new DetachedRuleset(new Ruleset('', val));\n }\n else {\n val = val.eval(context);\n }\n } else if (params[i].value) {\n val = params[i].value.eval(mixinEnv);\n frame.resetCache();\n } else {\n throw { type: 'Runtime', message: `wrong number of arguments for ${this.name} (${argsLength} for ${this.arity})` };\n }\n\n frame.prependRule(new Declaration(name, val));\n evaldArguments[i] = val;\n }\n }\n\n if (params[i].variadic && args) {\n for (j = argIndex; j < argsLength; j++) {\n evaldArguments[j] = args[j].value.eval(context);\n }\n }\n argIndex++;\n }\n\n return frame;\n },\n\n makeImportant() {\n const rules = !this.rules ? this.rules : this.rules.map(function (r) {\n if (r.makeImportant) {\n return r.makeImportant(true);\n } else {\n return r;\n }\n });\n const result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames);\n return result;\n },\n\n eval(context) {\n return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || utils.copyArray(context.frames));\n },\n\n evalCall(context, args, important) {\n const _arguments = [];\n const mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames;\n const frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments);\n let rules;\n let ruleset;\n\n frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context)));\n\n rules = utils.copyArray(this.rules);\n\n ruleset = new Ruleset(null, rules);\n ruleset.originalRuleset = this;\n ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames)));\n if (important) {\n ruleset = ruleset.makeImportant();\n }\n return ruleset;\n },\n\n matchCondition(args, context) {\n if (this.condition && !this.condition.eval(\n new contexts.Eval(context,\n [this.evalParams(context, /* the parameter variables */\n new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])]\n .concat(this.frames || []) // the parent namespace/mixin frames\n .concat(context.frames)))) { // the current environment frames\n return false;\n }\n return true;\n },\n\n matchArgs(args, context) {\n const allArgsCnt = (args && args.length) || 0;\n let len;\n const optionalParameters = this.optionalParameters;\n const requiredArgsCnt = !args ? 0 : args.reduce(function (count, p) {\n if (optionalParameters.indexOf(p.name) < 0) {\n return count + 1;\n } else {\n return count;\n }\n }, 0);\n\n if (!this.variadic) {\n if (requiredArgsCnt < this.required) {\n return false;\n }\n if (allArgsCnt > this.params.length) {\n return false;\n }\n } else {\n if (requiredArgsCnt < (this.required - 1)) {\n return false;\n }\n }\n\n // check patterns\n len = Math.min(requiredArgsCnt, this.arity);\n\n for (let i = 0; i < len; i++) {\n if (!this.params[i].name && !this.params[i].variadic) {\n if (args[i].value.eval(context).toCSS() != this.params[i].value.eval(context).toCSS()) {\n return false;\n }\n }\n }\n return true;\n }\n});\n\nexport default Definition;\n","import Node from './node';\nimport Selector from './selector';\nimport MixinDefinition from './mixin-definition';\nimport defaultFunc from '../functions/default';\n\nconst MixinCall = function(elements, args, index, currentFileInfo, important) {\n this.selector = new Selector(elements);\n this.arguments = args || [];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.important = important;\n this.allowRoot = true;\n this.setParent(this.selector, this);\n};\n\nMixinCall.prototype = Object.assign(new Node(), {\n type: 'MixinCall',\n\n accept(visitor) {\n if (this.selector) {\n this.selector = visitor.visit(this.selector);\n }\n if (this.arguments.length) {\n this.arguments = visitor.visitArray(this.arguments);\n }\n },\n\n eval(context) {\n let mixins;\n let mixin;\n let mixinPath;\n const args = [];\n let arg;\n let argValue;\n const rules = [];\n let match = false;\n let i;\n let m;\n let f;\n let isRecursive;\n let isOneFound;\n const candidates = [];\n let candidate;\n const conditionResult = [];\n let defaultResult;\n const defFalseEitherCase = -1;\n const defNone = 0;\n const defTrue = 1;\n const defFalse = 2;\n let count;\n let originalRuleset;\n let noArgumentsFilter;\n\n this.selector = this.selector.eval(context);\n\n function calcDefGroup(mixin, mixinPath) {\n let f, p, namespace;\n\n for (f = 0; f < 2; f++) {\n conditionResult[f] = true;\n defaultFunc.value(f);\n for (p = 0; p < mixinPath.length && conditionResult[f]; p++) {\n namespace = mixinPath[p];\n if (namespace.matchCondition) {\n conditionResult[f] = conditionResult[f] && namespace.matchCondition(null, context);\n }\n }\n if (mixin.matchCondition) {\n conditionResult[f] = conditionResult[f] && mixin.matchCondition(args, context);\n }\n }\n if (conditionResult[0] || conditionResult[1]) {\n if (conditionResult[0] != conditionResult[1]) {\n return conditionResult[1] ?\n defTrue : defFalse;\n }\n\n return defNone;\n }\n return defFalseEitherCase;\n }\n\n for (i = 0; i < this.arguments.length; i++) {\n arg = this.arguments[i];\n argValue = arg.value.eval(context);\n if (arg.expand && Array.isArray(argValue.value)) {\n argValue = argValue.value;\n for (m = 0; m < argValue.length; m++) {\n args.push({value: argValue[m]});\n }\n } else {\n args.push({name: arg.name, value: argValue});\n }\n }\n\n noArgumentsFilter = function(rule) {return rule.matchArgs(null, context);};\n\n for (i = 0; i < context.frames.length; i++) {\n if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) {\n isOneFound = true;\n\n // To make `default()` function independent of definition order we have two \"subpasses\" here.\n // At first we evaluate each guard *twice* (with `default() == true` and `default() == false`),\n // and build candidate list with corresponding flags. Then, when we know all possible matches,\n // we make a final decision.\n\n for (m = 0; m < mixins.length; m++) {\n mixin = mixins[m].rule;\n mixinPath = mixins[m].path;\n isRecursive = false;\n for (f = 0; f < context.frames.length; f++) {\n if ((!(mixin instanceof MixinDefinition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) {\n isRecursive = true;\n break;\n }\n }\n if (isRecursive) {\n continue;\n }\n\n if (mixin.matchArgs(args, context)) {\n candidate = {mixin, group: calcDefGroup(mixin, mixinPath)};\n\n if (candidate.group !== defFalseEitherCase) {\n candidates.push(candidate);\n }\n\n match = true;\n }\n }\n\n defaultFunc.reset();\n\n count = [0, 0, 0];\n for (m = 0; m < candidates.length; m++) {\n count[candidates[m].group]++;\n }\n\n if (count[defNone] > 0) {\n defaultResult = defFalse;\n } else {\n defaultResult = defTrue;\n if ((count[defTrue] + count[defFalse]) > 1) {\n throw { type: 'Runtime',\n message: `Ambiguous use of \\`default()\\` found when matching for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n }\n\n for (m = 0; m < candidates.length; m++) {\n candidate = candidates[m].group;\n if ((candidate === defNone) || (candidate === defaultResult)) {\n try {\n mixin = candidates[m].mixin;\n if (!(mixin instanceof MixinDefinition)) {\n originalRuleset = mixin.originalRuleset || mixin;\n mixin = new MixinDefinition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo());\n mixin.originalRuleset = originalRuleset;\n }\n const newRules = mixin.evalCall(context, args, this.important).rules;\n this._setVisibilityToReplacement(newRules);\n Array.prototype.push.apply(rules, newRules);\n } catch (e) {\n throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack };\n }\n }\n }\n\n if (match) {\n return rules;\n }\n }\n }\n if (isOneFound) {\n throw { type: 'Runtime',\n message: `No matching definition was found for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n } else {\n throw { type: 'Name',\n message: `${this.selector.toCSS().trim()} is undefined`,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n },\n\n _setVisibilityToReplacement(replacement) {\n let i, rule;\n if (this.blocksVisibility()) {\n for (i = 0; i < replacement.length; i++) {\n rule = replacement[i];\n rule.addVisibilityBlock();\n }\n }\n },\n\n format(args) {\n return `${this.selector.toCSS().trim()}(${args ? args.map(function (a) {\n let argValue = '';\n if (a.name) {\n argValue += `${a.name}:`;\n }\n if (a.value.toCSS) {\n argValue += a.value.toCSS();\n } else {\n argValue += '???';\n }\n return argValue;\n }).join(', ') : ''})`;\n }\n});\n\nexport default MixinCall;\n","import Node from './node';\nimport Color from './color';\nimport AtRule from './atrule';\nimport DetachedRuleset from './detached-ruleset';\nimport Operation from './operation';\nimport Dimension from './dimension';\nimport Unit from './unit';\nimport Keyword from './keyword';\nimport Variable from './variable';\nimport Property from './property';\nimport Ruleset from './ruleset';\nimport Element from './element';\nimport Attribute from './attribute';\nimport Combinator from './combinator';\nimport Selector from './selector';\nimport Quoted from './quoted';\nimport Expression from './expression';\nimport Declaration from './declaration';\nimport Call from './call';\nimport URL from './url';\nimport Import from './import';\nimport Comment from './comment';\nimport Anonymous from './anonymous';\nimport Value from './value';\nimport JavaScript from './javascript';\nimport Assignment from './assignment';\nimport Condition from './condition';\nimport QueryInParens from './query-in-parens';\nimport Paren from './paren';\nimport Media from './media';\nimport Container from './container';\nimport UnicodeDescriptor from './unicode-descriptor';\nimport Negative from './negative';\nimport Extend from './extend';\nimport VariableCall from './variable-call';\nimport NamespaceValue from './namespace-value';\n\n// mixins\nimport MixinCall from './mixin-call';\nimport MixinDefinition from './mixin-definition';\n\nexport default {\n Node, Color, AtRule, DetachedRuleset, Operation,\n Dimension, Unit, Keyword, Variable, Property,\n Ruleset, Element, Attribute, Combinator, Selector,\n Quoted, Expression, Declaration, Call, URL, Import,\n Comment, Anonymous, Value, JavaScript, Assignment,\n Condition, Paren, Media, Container, QueryInParens, \n UnicodeDescriptor, Negative, Extend, VariableCall, \n NamespaceValue,\n mixin: {\n Call: MixinCall,\n Definition: MixinDefinition\n }\n};","class AbstractFileManager {\n getPath(filename) {\n let j = filename.lastIndexOf('?');\n if (j > 0) {\n filename = filename.slice(0, j);\n }\n j = filename.lastIndexOf('/');\n if (j < 0) {\n j = filename.lastIndexOf('\\\\');\n }\n if (j < 0) {\n return '';\n }\n return filename.slice(0, j + 1);\n }\n\n tryAppendExtension(path, ext) {\n return /(\\.[a-z]*$)|([?;].*)$/.test(path) ? path : path + ext;\n }\n\n tryAppendLessExtension(path) {\n return this.tryAppendExtension(path, '.less');\n }\n\n supportsSync() {\n return false;\n }\n\n alwaysMakePathsAbsolute() {\n return false;\n }\n\n isPathAbsolute(filename) {\n return (/^(?:[a-z-]+:|\\/|\\\\|#)/i).test(filename);\n }\n\n // TODO: pull out / replace?\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return basePath + laterPath;\n }\n\n pathDiff(url, baseUrl) {\n // diff between two paths to create a relative path\n\n const urlParts = this.extractUrlParts(url);\n\n const baseUrlParts = this.extractUrlParts(baseUrl);\n let i;\n let max;\n let urlDirectories;\n let baseUrlDirectories;\n let diff = '';\n if (urlParts.hostPart !== baseUrlParts.hostPart) {\n return '';\n }\n max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);\n for (i = 0; i < max; i++) {\n if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; }\n }\n baseUrlDirectories = baseUrlParts.directories.slice(i);\n urlDirectories = urlParts.directories.slice(i);\n for (i = 0; i < baseUrlDirectories.length - 1; i++) {\n diff += '../';\n }\n for (i = 0; i < urlDirectories.length - 1; i++) {\n diff += `${urlDirectories[i]}/`;\n }\n return diff;\n }\n\n /**\n * Helper function, not part of API.\n * This should be replaceable by newer Node / Browser APIs\n * \n * @param {string} url \n * @param {string} baseUrl\n */\n extractUrlParts(url, baseUrl) {\n // urlParts[1] = protocol://hostname/ OR /\n // urlParts[2] = / if path relative to host base\n // urlParts[3] = directories\n // urlParts[4] = filename\n // urlParts[5] = parameters\n\n const urlPartsRegex = /^((?:[a-z-]+:)?\\/{2}(?:[^/?#]*\\/)|([/\\\\]))?((?:[^/\\\\?#]*[/\\\\])*)([^/\\\\?#]*)([#?].*)?$/i;\n\n const urlParts = url.match(urlPartsRegex);\n const returner = {};\n let rawDirectories = [];\n const directories = [];\n let i;\n let baseUrlParts;\n\n if (!urlParts) {\n throw new Error(`Could not parse sheet href - '${url}'`);\n }\n\n // Stylesheets in IE don't always return the full path\n if (baseUrl && (!urlParts[1] || urlParts[2])) {\n baseUrlParts = baseUrl.match(urlPartsRegex);\n if (!baseUrlParts) {\n throw new Error(`Could not parse page url - '${baseUrl}'`);\n }\n urlParts[1] = urlParts[1] || baseUrlParts[1] || '';\n if (!urlParts[2]) {\n urlParts[3] = baseUrlParts[3] + urlParts[3];\n }\n }\n\n if (urlParts[3]) {\n rawDirectories = urlParts[3].replace(/\\\\/g, '/').split('/');\n\n // collapse '..' and skip '.'\n for (i = 0; i < rawDirectories.length; i++) {\n\n if (rawDirectories[i] === '..') {\n directories.pop();\n }\n else if (rawDirectories[i] !== '.') {\n directories.push(rawDirectories[i]);\n }\n \n }\n }\n\n returner.hostPart = urlParts[1];\n returner.directories = directories;\n returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/');\n returner.path = (urlParts[1] || '') + directories.join('/');\n returner.filename = urlParts[4];\n returner.fileUrl = returner.path + (urlParts[4] || '');\n returner.url = returner.fileUrl + (urlParts[5] || '');\n return returner;\n }\n}\n\nexport default AbstractFileManager;\n","import functionRegistry from '../functions/function-registry';\nimport LessError from '../less-error';\n\nclass AbstractPluginLoader {\n constructor() {\n // Implemented by Node.js plugin loader\n this.require = function() {\n return null;\n }\n }\n\n evalPlugin(contents, context, imports, pluginOptions, fileInfo) {\n\n let loader, registry, pluginObj, localModule, pluginManager, filename, result;\n\n pluginManager = context.pluginManager;\n\n if (fileInfo) {\n if (typeof fileInfo === 'string') {\n filename = fileInfo;\n }\n else {\n filename = fileInfo.filename;\n }\n }\n const shortname = (new this.less.FileManager()).extractUrlParts(filename).filename;\n\n if (filename) {\n pluginObj = pluginManager.get(filename);\n\n if (pluginObj) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n return pluginObj;\n }\n }\n localModule = {\n exports: {},\n pluginManager,\n fileInfo\n };\n registry = functionRegistry.create();\n\n const registerPlugin = function(obj) {\n pluginObj = obj;\n };\n\n try {\n loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents);\n loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo);\n }\n catch (e) {\n return new LessError(e, imports, filename);\n }\n\n if (!pluginObj) {\n pluginObj = localModule.exports;\n }\n pluginObj = this.validatePlugin(pluginObj, filename, shortname);\n\n if (pluginObj instanceof LessError) {\n return pluginObj;\n }\n\n if (pluginObj) {\n pluginObj.imports = imports;\n pluginObj.filename = filename;\n\n // For < 3.x (or unspecified minVersion) - setOptions() before install()\n if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n\n if (result) {\n return result;\n }\n }\n\n // Run on first load\n pluginManager.addPlugin(pluginObj, fileInfo.filename, registry);\n pluginObj.functions = registry.getLocalFunctions();\n\n // Need to call setOptions again because the pluginObj might have functions\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n\n // Run every @plugin call\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n\n }\n else {\n return new LessError({ message: 'Not a valid plugin' }, imports, filename);\n }\n\n return pluginObj;\n\n }\n\n trySetOptions(plugin, filename, name, options) {\n if (options && !plugin.setOptions) {\n return new LessError({\n message: `Options have been provided but the plugin ${name} does not support any options.`\n });\n }\n try {\n plugin.setOptions && plugin.setOptions(options);\n }\n catch (e) {\n return new LessError(e);\n }\n }\n\n validatePlugin(plugin, filename, name) {\n if (plugin) {\n // support plugins being a function\n // so that the plugin can be more usable programmatically\n if (typeof plugin === 'function') {\n plugin = new plugin();\n }\n\n if (plugin.minVersion) {\n if (this.compareVersion(plugin.minVersion, this.less.version) < 0) {\n return new LessError({\n message: `Plugin ${name} requires version ${this.versionToString(plugin.minVersion)}`\n });\n }\n }\n return plugin;\n }\n return null;\n }\n\n compareVersion(aVersion, bVersion) {\n if (typeof aVersion === 'string') {\n aVersion = aVersion.match(/^(\\d+)\\.?(\\d+)?\\.?(\\d+)?/);\n aVersion.shift();\n }\n for (let i = 0; i < aVersion.length; i++) {\n if (aVersion[i] !== bVersion[i]) {\n return parseInt(aVersion[i]) > parseInt(bVersion[i]) ? -1 : 1;\n }\n }\n return 0;\n }\n\n versionToString(version) {\n let versionString = '';\n for (let i = 0; i < version.length; i++) {\n versionString += (versionString ? '.' : '') + version[i];\n }\n return versionString;\n }\n\n printUsage(plugins) {\n for (let i = 0; i < plugins.length; i++) {\n const plugin = plugins[i];\n if (plugin.printUsage) {\n plugin.printUsage();\n }\n }\n }\n}\n\nexport default AbstractPluginLoader;\n\n","import Anonymous from '../tree/anonymous';\nimport Keyword from '../tree/keyword';\n\nfunction boolean(condition) {\n return condition ? Keyword.True : Keyword.False;\n}\n\n/**\n * Functions with evalArgs set to false are sent context\n * as the first argument.\n */\nfunction If(context, condition, trueValue, falseValue) {\n return condition.eval(context) ? trueValue.eval(context)\n : (falseValue ? falseValue.eval(context) : new Anonymous);\n}\nIf.evalArgs = false;\n\nfunction isdefined(context, variable) {\n try {\n variable.eval(context);\n return Keyword.True;\n } catch (e) {\n return Keyword.False;\n }\n}\n\nisdefined.evalArgs = false;\n\nexport default { isdefined, boolean, 'if': If };\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport Expression from '../tree/expression';\nimport Operation from '../tree/operation';\nlet colorFunctions;\n\nfunction clamp(val) {\n return Math.min(1, Math.max(0, val));\n}\nfunction hsla(origColor, hsl) {\n const color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a);\n if (color) {\n if (origColor.value && \n /^(rgb|hsl)/.test(origColor.value)) {\n color.value = origColor.value;\n } else {\n color.value = 'rgb';\n }\n return color;\n }\n}\nfunction toHSL(color) {\n if (color.toHSL) {\n return color.toHSL();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction toHSV(color) {\n if (color.toHSV) {\n return color.toHSV();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction number(n) {\n if (n instanceof Dimension) {\n return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);\n } else if (typeof n === 'number') {\n return n;\n } else {\n throw {\n type: 'Argument',\n message: 'color functions take numbers as parameters'\n };\n }\n}\nfunction scaled(n, size) {\n if (n instanceof Dimension && n.unit.is('%')) {\n return parseFloat(n.value * size / 100);\n } else {\n return number(n);\n }\n}\ncolorFunctions = {\n rgb: function (r, g, b) {\n let a = 1\n /**\n * Comma-less syntax\n * e.g. rgb(0 128 255 / 50%)\n */\n if (r instanceof Expression) {\n const val = r.value\n r = val[0]\n g = val[1]\n b = val[2]\n /** \n * @todo - should this be normalized in\n * function caller? Or parsed differently?\n */\n if (b instanceof Operation) {\n const op = b\n b = op.operands[0]\n a = op.operands[1]\n }\n }\n const color = colorFunctions.rgba(r, g, b, a);\n if (color) {\n color.value = 'rgb';\n return color;\n }\n },\n rgba: function (r, g, b, a) {\n try {\n if (r instanceof Color) {\n if (g) {\n a = number(g);\n } else {\n a = r.alpha;\n }\n return new Color(r.rgb, a, 'rgba');\n }\n const rgb = [r, g, b].map(c => scaled(c, 255));\n a = number(a);\n return new Color(rgb, a, 'rgba');\n }\n catch (e) {}\n },\n hsl: function (h, s, l) {\n let a = 1\n if (h instanceof Expression) {\n const val = h.value\n h = val[0]\n s = val[1]\n l = val[2]\n\n if (l instanceof Operation) {\n const op = l\n l = op.operands[0]\n a = op.operands[1]\n }\n }\n const color = colorFunctions.hsla(h, s, l, a);\n if (color) {\n color.value = 'hsl';\n return color;\n }\n },\n hsla: function (h, s, l, a) {\n let m1;\n let m2;\n\n function hue(h) {\n h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n else if (h * 2 < 1) {\n return m2;\n }\n else if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n else {\n return m1;\n }\n }\n\n try {\n if (h instanceof Color) {\n if (s) {\n a = number(s);\n } else {\n a = h.alpha;\n }\n return new Color(h.rgb, a, 'hsla');\n }\n\n h = (number(h) % 360) / 360;\n s = clamp(number(s));l = clamp(number(l));a = clamp(number(a));\n\n m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n m1 = l * 2 - m2;\n\n const rgb = [\n hue(h + 1 / 3) * 255,\n hue(h) * 255,\n hue(h - 1 / 3) * 255\n ];\n a = number(a);\n return new Color(rgb, a, 'hsla');\n }\n catch (e) {}\n },\n\n hsv: function(h, s, v) {\n return colorFunctions.hsva(h, s, v, 1.0);\n },\n\n hsva: function(h, s, v, a) {\n h = ((number(h) % 360) / 360) * 360;\n s = number(s);v = number(v);a = number(a);\n\n let i;\n let f;\n i = Math.floor((h / 60) % 6);\n f = (h / 60) - i;\n\n const vs = [v,\n v * (1 - s),\n v * (1 - f * s),\n v * (1 - (1 - f) * s)];\n const perm = [[0, 3, 1],\n [2, 0, 1],\n [1, 0, 3],\n [1, 2, 0],\n [3, 1, 0],\n [0, 1, 2]];\n\n return colorFunctions.rgba(vs[perm[i][0]] * 255,\n vs[perm[i][1]] * 255,\n vs[perm[i][2]] * 255,\n a);\n },\n\n hue: function (color) {\n return new Dimension(toHSL(color).h);\n },\n saturation: function (color) {\n return new Dimension(toHSL(color).s * 100, '%');\n },\n lightness: function (color) {\n return new Dimension(toHSL(color).l * 100, '%');\n },\n hsvhue: function(color) {\n return new Dimension(toHSV(color).h);\n },\n hsvsaturation: function (color) {\n return new Dimension(toHSV(color).s * 100, '%');\n },\n hsvvalue: function (color) {\n return new Dimension(toHSV(color).v * 100, '%');\n },\n red: function (color) {\n return new Dimension(color.rgb[0]);\n },\n green: function (color) {\n return new Dimension(color.rgb[1]);\n },\n blue: function (color) {\n return new Dimension(color.rgb[2]);\n },\n alpha: function (color) {\n return new Dimension(toHSL(color).a);\n },\n luma: function (color) {\n return new Dimension(color.luma() * color.alpha * 100, '%');\n },\n luminance: function (color) {\n const luminance =\n (0.2126 * color.rgb[0] / 255) +\n (0.7152 * color.rgb[1] / 255) +\n (0.0722 * color.rgb[2] / 255);\n\n return new Dimension(luminance * color.alpha * 100, '%');\n },\n saturate: function (color, amount, method) {\n // filter: saturate(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s += hsl.s * amount.value / 100;\n }\n else {\n hsl.s += amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n desaturate: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s -= hsl.s * amount.value / 100;\n }\n else {\n hsl.s -= amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n lighten: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l += hsl.l * amount.value / 100;\n }\n else {\n hsl.l += amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n darken: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l -= hsl.l * amount.value / 100;\n }\n else {\n hsl.l -= amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n fadein: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a += hsl.a * amount.value / 100;\n }\n else {\n hsl.a += amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fadeout: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a -= hsl.a * amount.value / 100;\n }\n else {\n hsl.a -= amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fade: function (color, amount) {\n const hsl = toHSL(color);\n\n hsl.a = amount.value / 100;\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n spin: function (color, amount) {\n const hsl = toHSL(color);\n const hue = (hsl.h + amount.value) % 360;\n\n hsl.h = hue < 0 ? 360 + hue : hue;\n\n return hsla(color, hsl);\n },\n //\n // Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein\n // http://sass-lang.com\n //\n mix: function (color1, color2, weight) {\n if (!weight) {\n weight = new Dimension(50);\n }\n const p = weight.value / 100.0;\n const w = p * 2 - 1;\n const a = toHSL(color1).a - toHSL(color2).a;\n\n const w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n const w2 = 1 - w1;\n\n const rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,\n color1.rgb[1] * w1 + color2.rgb[1] * w2,\n color1.rgb[2] * w1 + color2.rgb[2] * w2];\n\n const alpha = color1.alpha * p + color2.alpha * (1 - p);\n\n return new Color(rgb, alpha);\n },\n greyscale: function (color) {\n return colorFunctions.desaturate(color, new Dimension(100));\n },\n contrast: function (color, dark, light, threshold) {\n // filter: contrast(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n if (typeof light === 'undefined') {\n light = colorFunctions.rgba(255, 255, 255, 1.0);\n }\n if (typeof dark === 'undefined') {\n dark = colorFunctions.rgba(0, 0, 0, 1.0);\n }\n // Figure out which is actually light and dark:\n if (dark.luma() > light.luma()) {\n const t = light;\n light = dark;\n dark = t;\n }\n if (typeof threshold === 'undefined') {\n threshold = 0.43;\n } else {\n threshold = number(threshold);\n }\n if (color.luma() < threshold) {\n return light;\n } else {\n return dark;\n }\n },\n // Changes made in 2.7.0 - Reverted in 3.0.0\n // contrast: function (color, color1, color2, threshold) {\n // // Return which of `color1` and `color2` has the greatest contrast with `color`\n // // according to the standard WCAG contrast ratio calculation.\n // // http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n // // The threshold param is no longer used, in line with SASS.\n // // filter: contrast(3.2);\n // // should be kept as is, so check for color\n // if (!color.rgb) {\n // return null;\n // }\n // if (typeof color1 === 'undefined') {\n // color1 = colorFunctions.rgba(0, 0, 0, 1.0);\n // }\n // if (typeof color2 === 'undefined') {\n // color2 = colorFunctions.rgba(255, 255, 255, 1.0);\n // }\n // var contrast1, contrast2;\n // var luma = color.luma();\n // var luma1 = color1.luma();\n // var luma2 = color2.luma();\n // // Calculate contrast ratios for each color\n // if (luma > luma1) {\n // contrast1 = (luma + 0.05) / (luma1 + 0.05);\n // } else {\n // contrast1 = (luma1 + 0.05) / (luma + 0.05);\n // }\n // if (luma > luma2) {\n // contrast2 = (luma + 0.05) / (luma2 + 0.05);\n // } else {\n // contrast2 = (luma2 + 0.05) / (luma + 0.05);\n // }\n // if (contrast1 > contrast2) {\n // return color1;\n // } else {\n // return color2;\n // }\n // },\n argb: function (color) {\n return new Anonymous(color.toARGB());\n },\n color: function(c) {\n if ((c instanceof Quoted) &&\n (/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) {\n const val = c.value.slice(1);\n return new Color(val, undefined, `#${val}`);\n }\n if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) {\n c.value = undefined;\n return c;\n }\n throw {\n type: 'Argument',\n message: 'argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF'\n };\n },\n tint: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount);\n },\n shade: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount);\n }\n};\n\nexport default colorFunctions;\n","import Color from '../tree/color';\n\n// Color Blending\n// ref: http://www.w3.org/TR/compositing-1\n\nfunction colorBlend(mode, color1, color2) {\n const ab = color1.alpha; // result\n\n let // backdrop\n cb;\n\n const as = color2.alpha;\n\n let // source\n cs;\n\n let ar;\n let cr;\n const r = [];\n\n ar = as + ab * (1 - as);\n for (let i = 0; i < 3; i++) {\n cb = color1.rgb[i] / 255;\n cs = color2.rgb[i] / 255;\n cr = mode(cb, cs);\n if (ar) {\n cr = (as * cs + ab * (cb -\n as * (cb + cs - cr))) / ar;\n }\n r[i] = cr * 255;\n }\n\n return new Color(r, ar);\n}\n\nconst colorBlendModeFunctions = {\n multiply: function(cb, cs) {\n return cb * cs;\n },\n screen: function(cb, cs) {\n return cb + cs - cb * cs;\n },\n overlay: function(cb, cs) {\n cb *= 2;\n return (cb <= 1) ?\n colorBlendModeFunctions.multiply(cb, cs) :\n colorBlendModeFunctions.screen(cb - 1, cs);\n },\n softlight: function(cb, cs) {\n let d = 1;\n let e = cb;\n if (cs > 0.5) {\n e = 1;\n d = (cb > 0.25) ? Math.sqrt(cb)\n : ((16 * cb - 12) * cb + 4) * cb;\n }\n return cb - (1 - 2 * cs) * e * (d - cb);\n },\n hardlight: function(cb, cs) {\n return colorBlendModeFunctions.overlay(cs, cb);\n },\n difference: function(cb, cs) {\n return Math.abs(cb - cs);\n },\n exclusion: function(cb, cs) {\n return cb + cs - 2 * cb * cs;\n },\n\n // non-w3c functions:\n average: function(cb, cs) {\n return (cb + cs) / 2;\n },\n negation: function(cb, cs) {\n return 1 - Math.abs(cb + cs - 1);\n }\n};\n\nfor (const f in colorBlendModeFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (colorBlendModeFunctions.hasOwnProperty(f)) {\n colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]);\n }\n}\n\nexport default colorBlend;\n","import Comment from '../tree/comment';\nimport Node from '../tree/node';\nimport Dimension from '../tree/dimension';\nimport Declaration from '../tree/declaration';\nimport Expression from '../tree/expression';\nimport Ruleset from '../tree/ruleset';\nimport Selector from '../tree/selector';\nimport Element from '../tree/element';\nimport Quote from '../tree/quoted';\nimport Value from '../tree/value';\n\nconst getItemsFromNode = node => {\n // handle non-array values as an array of length 1\n // return 'undefined' if index is invalid\n const items = Array.isArray(node.value) ?\n node.value : Array(node);\n\n return items;\n};\n\nexport default {\n _SELF: function(n) {\n return n;\n },\n '~': function(...expr) {\n if (expr.length === 1) {\n return expr[0];\n }\n return new Value(expr);\n },\n extract: function(values, index) {\n // (1-based index)\n index = index.value - 1;\n\n return getItemsFromNode(values)[index];\n },\n length: function(values) {\n return new Dimension(getItemsFromNode(values).length);\n },\n /**\n * Creates a Less list of incremental values.\n * Modeled after Lodash's range function, also exists natively in PHP\n * \n * @param {Dimension} [start=1]\n * @param {Dimension} end - e.g. 10 or 10px - unit is added to output\n * @param {Dimension} [step=1] \n */\n range: function(start, end, step) {\n let from;\n let to;\n let stepValue = 1;\n const list = [];\n if (end) {\n to = end;\n from = start.value;\n if (step) {\n stepValue = step.value;\n }\n }\n else {\n from = 1;\n to = start;\n }\n\n for (let i = from; i <= to.value; i += stepValue) {\n list.push(new Dimension(i, to.unit));\n }\n\n return new Expression(list);\n },\n each: function(list, rs) {\n const rules = [];\n let newRules;\n let iterator;\n\n const tryEval = val => {\n if (val instanceof Node) {\n return val.eval(this.context);\n }\n return val;\n };\n\n if (list.value && !(list instanceof Quote)) {\n if (Array.isArray(list.value)) {\n iterator = list.value.map(tryEval);\n } else {\n iterator = [tryEval(list.value)];\n }\n } else if (list.ruleset) {\n iterator = tryEval(list.ruleset).rules;\n } else if (list.rules) {\n iterator = list.rules.map(tryEval);\n } else if (Array.isArray(list)) {\n iterator = list.map(tryEval);\n } else {\n iterator = [tryEval(list)];\n }\n\n let valueName = '@value';\n let keyName = '@key';\n let indexName = '@index';\n\n if (rs.params) {\n valueName = rs.params[0] && rs.params[0].name;\n keyName = rs.params[1] && rs.params[1].name;\n indexName = rs.params[2] && rs.params[2].name;\n rs = rs.rules;\n } else {\n rs = rs.ruleset;\n }\n\n for (let i = 0; i < iterator.length; i++) {\n let key;\n let value;\n const item = iterator[i];\n if (item instanceof Declaration) {\n key = typeof item.name === 'string' ? item.name : item.name[0].value;\n value = item.value;\n } else {\n key = new Dimension(i + 1);\n value = item;\n }\n\n if (item instanceof Comment) {\n continue;\n }\n\n newRules = rs.rules.slice(0);\n if (valueName) {\n newRules.push(new Declaration(valueName,\n value,\n false, false, this.index, this.currentFileInfo));\n }\n if (indexName) {\n newRules.push(new Declaration(indexName,\n new Dimension(i + 1),\n false, false, this.index, this.currentFileInfo));\n }\n if (keyName) {\n newRules.push(new Declaration(keyName,\n key,\n false, false, this.index, this.currentFileInfo));\n }\n\n rules.push(new Ruleset([ new(Selector)([ new Element('', '&') ]) ],\n newRules,\n rs.strictImports,\n rs.visibilityInfo()\n ));\n }\n\n return new Ruleset([ new(Selector)([ new Element('', '&') ]) ],\n rules,\n rs.strictImports,\n rs.visibilityInfo()\n ).eval(this.context);\n }\n};\n","import Dimension from '../tree/dimension';\n\nconst MathHelper = (fn, unit, n) => {\n if (!(n instanceof Dimension)) {\n throw { type: 'Argument', message: 'argument must be a number' };\n }\n if (unit === null) {\n unit = n.unit;\n } else {\n n = n.unify();\n }\n return new Dimension(fn(parseFloat(n.value)), unit);\n};\n\nexport default MathHelper;","import mathHelper from './math-helper.js';\n\nconst mathFunctions = {\n // name, unit\n ceil: null,\n floor: null,\n sqrt: null,\n abs: null,\n tan: '',\n sin: '',\n cos: '',\n atan: 'rad',\n asin: 'rad',\n acos: 'rad'\n};\n\nfor (const f in mathFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (mathFunctions.hasOwnProperty(f)) {\n mathFunctions[f] = mathHelper.bind(null, Math[f], mathFunctions[f]);\n }\n}\n\nmathFunctions.round = (n, f) => {\n const fraction = typeof f === 'undefined' ? 0 : f.value;\n return mathHelper(num => num.toFixed(fraction), null, n);\n};\n\nexport default mathFunctions;\n","import Dimension from '../tree/dimension';\nimport Anonymous from '../tree/anonymous';\nimport mathHelper from './math-helper.js';\n\nconst minMax = function (isMin, args) {\n args = Array.prototype.slice.call(args);\n switch (args.length) {\n case 0: throw { type: 'Argument', message: 'one or more arguments required' };\n }\n let i; // key is the unit.toString() for unified Dimension values,\n let j;\n let current;\n let currentUnified;\n let referenceUnified;\n let unit;\n let unitStatic;\n let unitClone;\n\n const // elems only contains original argument values.\n order = [];\n\n const values = {};\n // value is the index into the order array.\n for (i = 0; i < args.length; i++) {\n current = args[i];\n if (!(current instanceof Dimension)) {\n if (Array.isArray(args[i].value)) {\n Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));\n }\n continue;\n }\n currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();\n unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();\n unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic;\n unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone;\n j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit];\n if (j === undefined) {\n if (unitStatic !== undefined && unit !== unitStatic) {\n throw { type: 'Argument', message: 'incompatible types' };\n }\n values[unit] = order.length;\n order.push(current);\n continue;\n }\n referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify();\n if ( isMin && currentUnified.value < referenceUnified.value ||\n !isMin && currentUnified.value > referenceUnified.value) {\n order[j] = current;\n }\n }\n if (order.length == 1) {\n return order[0];\n }\n args = order.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');\n return new Anonymous(`${isMin ? 'min' : 'max'}(${args})`);\n};\n\nexport default {\n min: function(...args) {\n try {\n return minMax.call(this, true, args);\n } catch (e) {}\n },\n max: function(...args) {\n try {\n return minMax.call(this, false, args);\n } catch (e) {}\n },\n convert: function (val, unit) {\n return val.convertTo(unit.value);\n },\n pi: function () {\n return new Dimension(Math.PI);\n },\n mod: function(a, b) {\n return new Dimension(a.value % b.value, a.unit);\n },\n pow: function(x, y) {\n if (typeof x === 'number' && typeof y === 'number') {\n x = new Dimension(x);\n y = new Dimension(y);\n } else if (!(x instanceof Dimension) || !(y instanceof Dimension)) {\n throw { type: 'Argument', message: 'arguments must be numbers' };\n }\n\n return new Dimension(Math.pow(x.value, y.value), x.unit);\n },\n percentage: function (n) {\n const result = mathHelper(num => num * 100, '%', n);\n\n return result;\n }\n};\n","import Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport JavaScript from '../tree/javascript';\n\nexport default {\n e: function (str) {\n return new Quoted('\"', str instanceof JavaScript ? str.evaluated : str.value, true);\n },\n escape: function (str) {\n return new Anonymous(\n encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B')\n .replace(/\\(/g, '%28').replace(/\\)/g, '%29'));\n },\n replace: function (string, pattern, replacement, flags) {\n let result = string.value;\n replacement = (replacement.type === 'Quoted') ?\n replacement.value : replacement.toCSS();\n result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement);\n return new Quoted(string.quote || '', result, string.escaped);\n },\n '%': function (string /* arg, arg, ... */) {\n const args = Array.prototype.slice.call(arguments, 1);\n let result = string.value;\n\n for (let i = 0; i < args.length; i++) {\n /* jshint loopfunc:true */\n result = result.replace(/%[sda]/i, token => {\n const value = ((args[i].type === 'Quoted') &&\n token.match(/s/i)) ? args[i].value : args[i].toCSS();\n return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;\n });\n }\n result = result.replace(/%%/g, '%');\n return new Quoted(string.quote || '', result, string.escaped);\n }\n};\n","import Keyword from '../tree/keyword';\nimport DetachedRuleset from '../tree/detached-ruleset';\nimport Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport URL from '../tree/url';\nimport Operation from '../tree/operation';\n\nconst isa = (n, Type) => (n instanceof Type) ? Keyword.True : Keyword.False;\nconst isunit = (n, unit) => {\n if (unit === undefined) {\n throw { type: 'Argument', message: 'missing the required second argument to isunit.' };\n }\n unit = typeof unit.value === 'string' ? unit.value : unit;\n if (typeof unit !== 'string') {\n throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' };\n }\n return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False;\n};\n\nexport default {\n isruleset: function (n) {\n return isa(n, DetachedRuleset);\n },\n iscolor: function (n) {\n return isa(n, Color);\n },\n isnumber: function (n) {\n return isa(n, Dimension);\n },\n isstring: function (n) {\n return isa(n, Quoted);\n },\n iskeyword: function (n) {\n return isa(n, Keyword);\n },\n isurl: function (n) {\n return isa(n, URL);\n },\n ispixel: function (n) {\n return isunit(n, 'px');\n },\n ispercentage: function (n) {\n return isunit(n, '%');\n },\n isem: function (n) {\n return isunit(n, 'em');\n },\n isunit,\n unit: function (val, unit) {\n if (!(val instanceof Dimension)) {\n throw { type: 'Argument',\n message: `the first argument to unit must be a number${val instanceof Operation ? '. Have you forgotten parenthesis?' : ''}` };\n }\n if (unit) {\n if (unit instanceof Keyword) {\n unit = unit.value;\n } else {\n unit = unit.toCSS();\n }\n } else {\n unit = '';\n }\n return new Dimension(val.value, unit);\n },\n 'get-unit': function (n) {\n return new Anonymous(n.unit);\n }\n};\n","import functionRegistry from './function-registry';\nimport functionCaller from './function-caller';\n\nimport boolean from './boolean';\nimport defaultFunc from './default';\nimport color from './color';\nimport colorBlending from './color-blending';\nimport dataUri from './data-uri';\nimport list from './list';\nimport math from './math';\nimport number from './number';\nimport string from './string';\nimport svg from './svg';\nimport types from './types';\n\nexport default environment => {\n const functions = { functionRegistry, functionCaller };\n\n // register functions\n functionRegistry.addMultiple(boolean);\n functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc));\n functionRegistry.addMultiple(color);\n functionRegistry.addMultiple(colorBlending);\n functionRegistry.addMultiple(dataUri(environment));\n functionRegistry.addMultiple(list);\n functionRegistry.addMultiple(math);\n functionRegistry.addMultiple(number);\n functionRegistry.addMultiple(string);\n functionRegistry.addMultiple(svg(environment));\n functionRegistry.addMultiple(types);\n\n return functions;\n};\n","import Quoted from '../tree/quoted';\nimport URL from '../tree/url';\nimport * as utils from '../utils';\nimport logger from '../logger';\n\nexport default environment => {\n \n const fallback = (functionThis, node) => new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); \n\n return { 'data-uri': function(mimetypeNode, filePathNode) {\n\n if (!filePathNode) {\n filePathNode = mimetypeNode;\n mimetypeNode = null;\n }\n\n let mimetype = mimetypeNode && mimetypeNode.value;\n let filePath = filePathNode.value;\n const currentFileInfo = this.currentFileInfo;\n const currentDirectory = currentFileInfo.rewriteUrls ?\n currentFileInfo.currentDirectory : currentFileInfo.entryPath;\n\n const fragmentStart = filePath.indexOf('#');\n let fragment = '';\n if (fragmentStart !== -1) {\n fragment = filePath.slice(fragmentStart);\n filePath = filePath.slice(0, fragmentStart);\n }\n const context = utils.clone(this.context);\n context.rawBuffer = true;\n\n const fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true);\n\n if (!fileManager) {\n return fallback(this, filePathNode);\n }\n\n let useBase64 = false;\n\n // detect the mimetype if not given\n if (!mimetypeNode) {\n\n mimetype = environment.mimeLookup(filePath);\n\n if (mimetype === 'image/svg+xml') {\n useBase64 = false;\n } else {\n // use base 64 unless it's an ASCII or UTF-8 format\n const charset = environment.charsetLookup(mimetype);\n useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0;\n }\n if (useBase64) { mimetype += ';base64'; }\n }\n else {\n useBase64 = /;base64$/.test(mimetype);\n }\n\n const fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment);\n if (!fileSync.contents) {\n logger.warn(`Skipped data-uri embedding of ${filePath} because file not found`);\n return fallback(this, filePathNode || mimetypeNode);\n }\n let buf = fileSync.contents;\n if (useBase64 && !environment.encodeBase64) {\n return fallback(this, filePathNode);\n }\n\n buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);\n\n const uri = `data:${mimetype},${buf}${fragment}`;\n\n return new URL(new Quoted(`\"${uri}\"`, uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Expression from '../tree/expression';\nimport Quoted from '../tree/quoted';\nimport URL from '../tree/url';\n\nexport default () => {\n return { 'svg-gradient': function(direction) {\n let stops;\n let gradientDirectionSvg;\n let gradientType = 'linear';\n let rectangleDimension = 'x=\"0\" y=\"0\" width=\"1\" height=\"1\"';\n const renderEnv = {compress: false};\n let returner;\n const directionValue = direction.toCSS(renderEnv);\n let i;\n let color;\n let position;\n let positionValue;\n let alpha;\n\n function throwArgumentDescriptor() {\n throw { type: 'Argument',\n message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' +\n ' end_color [end_position] or direction, color list' };\n }\n\n if (arguments.length == 2) {\n if (arguments[1].value.length < 2) {\n throwArgumentDescriptor();\n }\n stops = arguments[1].value;\n } else if (arguments.length < 3) {\n throwArgumentDescriptor();\n } else {\n stops = Array.prototype.slice.call(arguments, 1);\n }\n\n switch (directionValue) {\n case 'to bottom':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\"';\n break;\n case 'to right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'to bottom right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\"';\n break;\n case 'to top right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"100%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'ellipse':\n case 'ellipse at center':\n gradientType = 'radial';\n gradientDirectionSvg = 'cx=\"50%\" cy=\"50%\" r=\"75%\"';\n rectangleDimension = 'x=\"-50\" y=\"-50\" width=\"101\" height=\"101\"';\n break;\n default:\n throw { type: 'Argument', message: 'svg-gradient direction must be \\'to bottom\\', \\'to right\\',' +\n ' \\'to bottom right\\', \\'to top right\\' or \\'ellipse at center\\'' };\n }\n returner = ``;\n\n returner = encodeURIComponent(returner);\n\n returner = `data:image/svg+xml,${returner}`;\n return new URL(new Quoted(`'${returner}'`, returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import contexts from './contexts';\nimport visitor from './visitors';\nimport tree from './tree';\n\nexport default function(root, options) {\n options = options || {};\n let evaldRoot;\n let variables = options.variables;\n const evalEnv = new contexts.Eval(options);\n\n //\n // Allows setting variables with a hash, so:\n //\n // `{ color: new tree.Color('#f01') }` will become:\n //\n // new tree.Declaration('@color',\n // new tree.Value([\n // new tree.Expression([\n // new tree.Color('#f01')\n // ])\n // ])\n // )\n //\n if (typeof variables === 'object' && !Array.isArray(variables)) {\n variables = Object.keys(variables).map(function (k) {\n let value = variables[k];\n\n if (!(value instanceof tree.Value)) {\n if (!(value instanceof tree.Expression)) {\n value = new tree.Expression([value]);\n }\n value = new tree.Value([value]);\n }\n return new tree.Declaration(`@${k}`, value, false, null, 0);\n });\n evalEnv.frames = [new tree.Ruleset(null, variables)];\n }\n\n const visitors = [\n new visitor.JoinSelectorVisitor(),\n new visitor.MarkVisibleSelectorsVisitor(true),\n new visitor.ExtendVisitor(),\n new visitor.ToCSSVisitor({compress: Boolean(options.compress)})\n ];\n\n const preEvalVisitors = [];\n let v;\n let visitorIterator;\n\n /**\n * first() / get() allows visitors to be added while visiting\n * \n * @todo Add scoping for visitors just like functions for @plugin; right now they're global\n */\n if (options.pluginManager) {\n visitorIterator = options.pluginManager.visitor();\n for (let i = 0; i < 2; i++) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (v.isPreEvalVisitor) {\n if (i === 0 || preEvalVisitors.indexOf(v) === -1) {\n preEvalVisitors.push(v);\n v.run(root);\n }\n }\n else {\n if (i === 0 || visitors.indexOf(v) === -1) {\n if (v.isPreVisitor) {\n visitors.unshift(v);\n }\n else {\n visitors.push(v);\n }\n }\n }\n }\n }\n }\n\n evaldRoot = root.eval(evalEnv);\n\n for (let i = 0; i < visitors.length; i++) {\n visitors[i].run(evaldRoot);\n }\n\n // Run any remaining visitors added after eval pass\n if (options.pluginManager) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (visitors.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) {\n v.run(evaldRoot);\n }\n }\n }\n\n return evaldRoot;\n}\n","/**\n * Plugin Manager\n */\nclass PluginManager {\n constructor(less) {\n this.less = less;\n this.visitors = [];\n this.preProcessors = [];\n this.postProcessors = [];\n this.installedPlugins = [];\n this.fileManagers = [];\n this.iterator = -1;\n this.pluginCache = {};\n this.Loader = new less.PluginLoader(less);\n }\n\n /**\n * Adds all the plugins in the array\n * @param {Array} plugins\n */\n addPlugins(plugins) {\n if (plugins) {\n for (let i = 0; i < plugins.length; i++) {\n this.addPlugin(plugins[i]);\n }\n }\n }\n\n /**\n *\n * @param plugin\n * @param {String} filename\n */\n addPlugin(plugin, filename, functionRegistry) {\n this.installedPlugins.push(plugin);\n if (filename) {\n this.pluginCache[filename] = plugin;\n }\n if (plugin.install) {\n plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry);\n }\n }\n\n /**\n *\n * @param filename\n */\n get(filename) {\n return this.pluginCache[filename];\n }\n\n /**\n * Adds a visitor. The visitor object has options on itself to determine\n * when it should run.\n * @param visitor\n */\n addVisitor(visitor) {\n this.visitors.push(visitor);\n }\n\n /**\n * Adds a pre processor object\n * @param {object} preProcessor\n * @param {number} priority - guidelines 1 = before import, 1000 = import, 2000 = after import\n */\n addPreProcessor(preProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) {\n if (this.preProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.preProcessors.splice(indexToInsertAt, 0, {preProcessor, priority});\n }\n\n /**\n * Adds a post processor object\n * @param {object} postProcessor\n * @param {number} priority - guidelines 1 = before compression, 1000 = compression, 2000 = after compression\n */\n addPostProcessor(postProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) {\n if (this.postProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.postProcessors.splice(indexToInsertAt, 0, {postProcessor, priority});\n }\n\n /**\n *\n * @param manager\n */\n addFileManager(manager) {\n this.fileManagers.push(manager);\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPreProcessors() {\n const preProcessors = [];\n for (let i = 0; i < this.preProcessors.length; i++) {\n preProcessors.push(this.preProcessors[i].preProcessor);\n }\n return preProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPostProcessors() {\n const postProcessors = [];\n for (let i = 0; i < this.postProcessors.length; i++) {\n postProcessors.push(this.postProcessors[i].postProcessor);\n }\n return postProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getVisitors() {\n return this.visitors;\n }\n\n visitor() {\n const self = this;\n return {\n first: function() {\n self.iterator = -1;\n return self.visitors[self.iterator];\n },\n get: function() {\n self.iterator += 1;\n return self.visitors[self.iterator];\n }\n };\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getFileManagers() {\n return this.fileManagers;\n }\n}\n\nlet pm;\n\nconst PluginManagerFactory = function(less, newFactory) {\n if (newFactory || !pm) {\n pm = new PluginManager(less);\n }\n return pm;\n};\n\n//\nexport default PluginManagerFactory;\n","'use strict';\n\nfunction parseNodeVersion(version) {\n var match = version.match(/^v(\\d{1,2})\\.(\\d{1,2})\\.(\\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\\+([0-9A-Za-z-.]+))?$/); // eslint-disable-line max-len\n if (!match) {\n throw new Error('Unable to parse: ' + version);\n }\n\n var res = {\n major: parseInt(match[1], 10),\n minor: parseInt(match[2], 10),\n patch: parseInt(match[3], 10),\n pre: match[4] || '',\n build: match[5] || '',\n };\n\n return res;\n}\n\nmodule.exports = parseNodeVersion;\n","import AbstractFileManager from '../less/environment/abstract-file-manager.js';\n\nlet options;\nlet logger;\nlet fileCache = {};\n\n// TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load\nconst FileManager = function() {}\nFileManager.prototype = Object.assign(new AbstractFileManager(), {\n alwaysMakePathsAbsolute() {\n return true;\n },\n\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return this.extractUrlParts(laterPath, basePath).path;\n },\n\n doXHR(url, type, callback, errback) {\n const xhr = new XMLHttpRequest();\n const async = options.isFileProtocol ? options.fileAsync : true;\n\n if (typeof xhr.overrideMimeType === 'function') {\n xhr.overrideMimeType('text/css');\n }\n logger.debug(`XHR: Getting '${url}'`);\n xhr.open('GET', url, async);\n xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');\n xhr.send(null);\n\n function handleResponse(xhr, callback, errback) {\n if (xhr.status >= 200 && xhr.status < 300) {\n callback(xhr.responseText,\n xhr.getResponseHeader('Last-Modified'));\n } else if (typeof errback === 'function') {\n errback(xhr.status, url);\n }\n }\n\n if (options.isFileProtocol && !options.fileAsync) {\n if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) {\n callback(xhr.responseText);\n } else {\n errback(xhr.status, url);\n }\n } else if (async) {\n xhr.onreadystatechange = () => {\n if (xhr.readyState == 4) {\n handleResponse(xhr, callback, errback);\n }\n };\n } else {\n handleResponse(xhr, callback, errback);\n }\n },\n\n supports() {\n return true;\n },\n\n clearFileCache() {\n fileCache = {};\n },\n\n loadFile(filename, currentDirectory, options) {\n // TODO: Add prefix support like less-node?\n // What about multiple paths?\n\n if (currentDirectory && !this.isPathAbsolute(filename)) {\n filename = currentDirectory + filename;\n }\n\n filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename;\n\n options = options || {};\n\n // sheet may be set to the stylesheet for the initial load or a collection of properties including\n // some context variables for imports\n const hrefParts = this.extractUrlParts(filename, window.location.href);\n const href = hrefParts.url;\n const self = this;\n \n return new Promise((resolve, reject) => {\n if (options.useFileCache && fileCache[href]) {\n try {\n const lessText = fileCache[href];\n return resolve({ contents: lessText, filename: href, webInfo: { lastModified: new Date() }});\n } catch (e) {\n return reject({ filename: href, message: `Error loading file ${href} error was ${e.message}` });\n }\n }\n\n self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) {\n // per file cache\n fileCache[href] = data;\n\n // Use remote copy (re-parse)\n resolve({ contents: data, filename: href, webInfo: { lastModified }});\n }, function doXHRError(status, url) {\n reject({ type: 'File', message: `'${url}' wasn't found (${status})`, href });\n });\n });\n }\n});\n\nexport default (opts, log) => {\n options = opts;\n logger = log;\n return FileManager;\n}\n","import Environment from './environment/environment';\nimport data from './data';\nimport tree from './tree';\nimport AbstractFileManager from './environment/abstract-file-manager';\nimport AbstractPluginLoader from './environment/abstract-plugin-loader';\nimport visitors from './visitors';\nimport Parser from './parser/parser';\nimport functions from './functions';\nimport contexts from './contexts';\nimport LessError from './less-error';\nimport transformTree from './transform-tree';\nimport * as utils from './utils';\nimport PluginManager from './plugin-manager';\nimport logger from './logger';\nimport SourceMapOutput from './source-map-output';\nimport SourceMapBuilder from './source-map-builder';\nimport ParseTree from './parse-tree';\nimport ImportManager from './import-manager';\nimport Parse from './parse';\nimport Render from './render';\nimport { version } from '../../package.json';\nimport parseVersion from 'parse-node-version';\n\nexport default function(environment, fileManagers) {\n let sourceMapOutput, sourceMapBuilder, parseTree, importManager;\n\n environment = new Environment(environment, fileManagers);\n sourceMapOutput = SourceMapOutput(environment);\n sourceMapBuilder = SourceMapBuilder(sourceMapOutput, environment);\n parseTree = ParseTree(sourceMapBuilder);\n importManager = ImportManager(environment);\n\n const render = Render(environment, parseTree, importManager);\n const parse = Parse(environment, parseTree, importManager);\n\n const v = parseVersion(`v${version}`);\n const initial = {\n version: [v.major, v.minor, v.patch],\n data,\n tree,\n Environment,\n AbstractFileManager,\n AbstractPluginLoader,\n environment,\n visitors,\n Parser,\n functions: functions(environment),\n contexts,\n SourceMapOutput: sourceMapOutput,\n SourceMapBuilder: sourceMapBuilder,\n ParseTree: parseTree,\n ImportManager: importManager,\n render,\n parse,\n LessError,\n transformTree,\n utils,\n PluginManager,\n logger\n };\n\n // Create a public API\n\n const ctor = function(t) {\n return function() {\n const obj = Object.create(t.prototype);\n t.apply(obj, Array.prototype.slice.call(arguments, 0));\n return obj;\n };\n };\n let t;\n const api = Object.create(initial);\n for (const n in initial.tree) {\n /* eslint guard-for-in: 0 */\n t = initial.tree[n];\n if (typeof t === 'function') {\n api[n.toLowerCase()] = ctor(t);\n }\n else {\n api[n] = Object.create(null);\n for (const o in t) {\n /* eslint guard-for-in: 0 */\n api[n][o.toLowerCase()] = ctor(t[o]);\n }\n }\n }\n\n /**\n * Some of the functions assume a `this` context of the API object,\n * which causes it to fail when wrapped for ES6 imports.\n * \n * An assumed `this` should be removed in the future.\n */\n initial.parse = initial.parse.bind(api);\n initial.render = initial.render.bind(api);\n\n return api;\n}\n","import LessError from './less-error';\nimport transformTree from './transform-tree';\nimport logger from './logger';\n\nexport default function(SourceMapBuilder) {\n class ParseTree {\n constructor(root, imports) {\n this.root = root;\n this.imports = imports;\n }\n\n toCSS(options) {\n let evaldRoot;\n const result = {};\n let sourceMapBuilder;\n try {\n evaldRoot = transformTree(this.root, options);\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n try {\n const compress = Boolean(options.compress);\n if (compress) {\n logger.warn('The compress option has been deprecated. ' + \n 'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');\n }\n\n const toCSSOptions = {\n compress,\n dumpLineNumbers: options.dumpLineNumbers,\n strictUnits: Boolean(options.strictUnits),\n numPrecision: 8};\n\n if (options.sourceMap) {\n sourceMapBuilder = new SourceMapBuilder(options.sourceMap);\n result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports);\n } else {\n result.css = evaldRoot.toCSS(toCSSOptions);\n }\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n if (options.pluginManager) {\n const postProcessors = options.pluginManager.getPostProcessors();\n for (let i = 0; i < postProcessors.length; i++) {\n result.css = postProcessors[i].process(result.css, { sourceMap: sourceMapBuilder, options, imports: this.imports });\n }\n }\n if (options.sourceMap) {\n result.map = sourceMapBuilder.getExternalSourceMap();\n }\n\n result.imports = [];\n for (const file in this.imports.files) {\n if (Object.prototype.hasOwnProperty.call(this.imports.files, file) && file !== this.imports.rootFilename) {\n result.imports.push(file);\n }\n }\n return result;\n }\n }\n\n return ParseTree;\n}\n","export default function (SourceMapOutput, environment) {\n class SourceMapBuilder {\n constructor(options) {\n this.options = options;\n }\n\n toCSS(rootNode, options, imports) {\n const sourceMapOutput = new SourceMapOutput(\n {\n contentsIgnoredCharsMap: imports.contentsIgnoredChars,\n rootNode,\n contentsMap: imports.contents,\n sourceMapFilename: this.options.sourceMapFilename,\n sourceMapURL: this.options.sourceMapURL,\n outputFilename: this.options.sourceMapOutputFilename,\n sourceMapBasepath: this.options.sourceMapBasepath,\n sourceMapRootpath: this.options.sourceMapRootpath,\n outputSourceFiles: this.options.outputSourceFiles,\n sourceMapGenerator: this.options.sourceMapGenerator,\n sourceMapFileInline: this.options.sourceMapFileInline, \n disableSourcemapAnnotation: this.options.disableSourcemapAnnotation\n });\n\n const css = sourceMapOutput.toCSS(options);\n this.sourceMap = sourceMapOutput.sourceMap;\n this.sourceMapURL = sourceMapOutput.sourceMapURL;\n if (this.options.sourceMapInputFilename) {\n this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename);\n }\n if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) {\n this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL);\n }\n return css + this.getCSSAppendage();\n }\n\n getCSSAppendage() {\n\n let sourceMapURL = this.sourceMapURL;\n if (this.options.sourceMapFileInline) {\n if (this.sourceMap === undefined) {\n return '';\n }\n sourceMapURL = `data:application/json;base64,${environment.encodeBase64(this.sourceMap)}`;\n }\n\n if (this.options.disableSourcemapAnnotation) {\n return '';\n }\n\n if (sourceMapURL) {\n return `/*# sourceMappingURL=${sourceMapURL} */`;\n }\n return '';\n }\n\n getExternalSourceMap() {\n return this.sourceMap;\n }\n\n setExternalSourceMap(sourceMap) {\n this.sourceMap = sourceMap;\n }\n\n isInline() {\n return this.options.sourceMapFileInline;\n }\n\n getSourceMapURL() {\n return this.sourceMapURL;\n }\n\n getOutputFilename() {\n return this.options.sourceMapOutputFilename;\n }\n\n getInputFilename() {\n return this.sourceMapInputFilename;\n }\n }\n\n return SourceMapBuilder;\n}\n","export default function (environment) {\n class SourceMapOutput {\n constructor(options) {\n this._css = [];\n this._rootNode = options.rootNode;\n this._contentsMap = options.contentsMap;\n this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;\n if (options.sourceMapFilename) {\n this._sourceMapFilename = options.sourceMapFilename.replace(/\\\\/g, '/');\n }\n this._outputFilename = options.outputFilename;\n this.sourceMapURL = options.sourceMapURL;\n if (options.sourceMapBasepath) {\n this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\\\/g, '/');\n }\n if (options.sourceMapRootpath) {\n this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\\\/g, '/');\n if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') {\n this._sourceMapRootpath += '/';\n }\n } else {\n this._sourceMapRootpath = '';\n }\n this._outputSourceFiles = options.outputSourceFiles;\n this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();\n\n this._lineNumber = 0;\n this._column = 0;\n }\n\n removeBasepath(path) {\n if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) {\n path = path.substring(this._sourceMapBasepath.length);\n if (path.charAt(0) === '\\\\' || path.charAt(0) === '/') {\n path = path.substring(1);\n }\n }\n\n return path;\n }\n\n normalizeFilename(filename) {\n filename = filename.replace(/\\\\/g, '/');\n filename = this.removeBasepath(filename);\n return (this._sourceMapRootpath || '') + filename;\n }\n\n add(chunk, fileInfo, index, mapLines) {\n\n // ignore adding empty strings\n if (!chunk) {\n return;\n }\n\n let lines, sourceLines, columns, sourceColumns, i;\n\n if (fileInfo && fileInfo.filename) {\n let inputSource = this._contentsMap[fileInfo.filename];\n\n // remove vars/banner added to the top of the file\n if (this._contentsIgnoredCharsMap[fileInfo.filename]) {\n // adjust the index\n index -= this._contentsIgnoredCharsMap[fileInfo.filename];\n if (index < 0) { index = 0; }\n // adjust the source\n inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);\n }\n\n /** \n * ignore empty content, or failsafe\n * if contents map is incorrect\n */\n if (inputSource === undefined) {\n this._css.push(chunk);\n return;\n }\n\n inputSource = inputSource.substring(0, index);\n sourceLines = inputSource.split('\\n');\n sourceColumns = sourceLines[sourceLines.length - 1];\n }\n\n lines = chunk.split('\\n');\n columns = lines[lines.length - 1];\n\n if (fileInfo && fileInfo.filename) {\n if (!mapLines) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column},\n original: { line: sourceLines.length, column: sourceColumns.length},\n source: this.normalizeFilename(fileInfo.filename)});\n } else {\n for (i = 0; i < lines.length; i++) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0},\n original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0},\n source: this.normalizeFilename(fileInfo.filename)});\n }\n }\n }\n\n if (lines.length === 1) {\n this._column += columns.length;\n } else {\n this._lineNumber += lines.length - 1;\n this._column = columns.length;\n }\n\n this._css.push(chunk);\n }\n\n isEmpty() {\n return this._css.length === 0;\n }\n\n toCSS(context) {\n this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });\n\n if (this._outputSourceFiles) {\n for (const filename in this._contentsMap) {\n // eslint-disable-next-line no-prototype-builtins\n if (this._contentsMap.hasOwnProperty(filename)) {\n let source = this._contentsMap[filename];\n if (this._contentsIgnoredCharsMap[filename]) {\n source = source.slice(this._contentsIgnoredCharsMap[filename]);\n }\n this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source);\n }\n }\n }\n\n this._rootNode.genCSS(context, this);\n\n if (this._css.length > 0) {\n let sourceMapURL;\n const sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());\n\n if (this.sourceMapURL) {\n sourceMapURL = this.sourceMapURL;\n } else if (this._sourceMapFilename) {\n sourceMapURL = this._sourceMapFilename;\n }\n this.sourceMapURL = sourceMapURL;\n\n this.sourceMap = sourceMapContent;\n }\n\n return this._css.join('');\n }\n }\n\n return SourceMapOutput;\n}\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport LessError from './less-error';\nimport * as utils from './utils';\nimport logger from './logger';\n\nexport default function(environment) {\n // FileInfo = {\n // 'rewriteUrls' - option - whether to adjust URL's to be relative\n // 'filename' - full resolved filename of current file\n // 'rootpath' - path to append to normal URLs for this node\n // 'currentDirectory' - path to the current file, absolute\n // 'rootFilename' - filename of the base file\n // 'entryPath' - absolute path to the entry file\n // 'reference' - whether the file should not be output and only output parts that are referenced\n\n class ImportManager {\n constructor(less, context, rootFileInfo) {\n this.less = less;\n this.rootFilename = rootFileInfo.filename;\n this.paths = context.paths || []; // Search paths, when importing\n this.contents = {}; // map - filename to contents of all the files\n this.contentsIgnoredChars = {}; // map - filename to lines at the beginning of each file to ignore\n this.mime = context.mime;\n this.error = null;\n this.context = context;\n // Deprecated? Unused outside of here, could be useful.\n this.queue = []; // Files which haven't been imported yet\n this.files = {}; // Holds the imported parse trees.\n }\n\n /**\n * Add an import to be imported\n * @param path - the raw path\n * @param tryAppendExtension - whether to try appending a file extension (.less or .js if the path has no extension)\n * @param currentFileInfo - the current file info (used for instance to work out relative paths)\n * @param importOptions - import options\n * @param callback - callback for when it is imported\n */\n push(path, tryAppendExtension, currentFileInfo, importOptions, callback) {\n const importManager = this, pluginLoader = this.context.pluginManager.Loader;\n\n this.queue.push(path);\n\n const fileParsedFunc = function (e, root, fullPath) {\n importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue\n\n const importedEqualsRoot = fullPath === importManager.rootFilename;\n if (importOptions.optional && e) {\n callback(null, {rules:[]}, false, null);\n logger.info(`The file ${fullPath} was skipped because it was not found and the import was marked optional.`);\n }\n else {\n // Inline imports aren't cached here.\n // If we start to cache them, please make sure they won't conflict with non-inline imports of the\n // same name as they used to do before this comment and the condition below have been added.\n if (!importManager.files[fullPath] && !importOptions.inline) {\n importManager.files[fullPath] = { root, options: importOptions };\n }\n if (e && !importManager.error) { importManager.error = e; }\n callback(e, root, importedEqualsRoot, fullPath);\n }\n };\n\n const newFileInfo = {\n rewriteUrls: this.context.rewriteUrls,\n entryPath: currentFileInfo.entryPath,\n rootpath: currentFileInfo.rootpath,\n rootFilename: currentFileInfo.rootFilename\n };\n\n const fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment);\n\n if (!fileManager) {\n fileParsedFunc({ message: `Could not find a file-manager for ${path}` });\n return;\n }\n\n const loadFileCallback = function(loadedFile) {\n let plugin;\n const resolvedFilename = loadedFile.filename;\n const contents = loadedFile.contents.replace(/^\\uFEFF/, '');\n\n // Pass on an updated rootpath if path of imported file is relative and file\n // is in a (sub|sup) directory\n //\n // Examples:\n // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/',\n // then rootpath should become 'less/module/nav/'\n // - If path of imported file is '../mixins.less' and rootpath is 'less/',\n // then rootpath should become 'less/../'\n newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename);\n if (newFileInfo.rewriteUrls) {\n newFileInfo.rootpath = fileManager.join(\n (importManager.context.rootpath || ''),\n fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath));\n\n if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) {\n newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath);\n }\n }\n newFileInfo.filename = resolvedFilename;\n\n const newEnv = new contexts.Parse(importManager.context);\n\n newEnv.processImports = false;\n importManager.contents[resolvedFilename] = contents;\n\n if (currentFileInfo.reference || importOptions.reference) {\n newFileInfo.reference = true;\n }\n\n if (importOptions.isPlugin) {\n plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo);\n if (plugin instanceof LessError) {\n fileParsedFunc(plugin, null, resolvedFilename);\n }\n else {\n fileParsedFunc(null, plugin, resolvedFilename);\n }\n } else if (importOptions.inline) {\n fileParsedFunc(null, contents, resolvedFilename);\n } else {\n // import (multiple) parse trees apparently get altered and can't be cached.\n // TODO: investigate why this is\n if (importManager.files[resolvedFilename]\n && !importManager.files[resolvedFilename].options.multiple\n && !importOptions.multiple) {\n\n fileParsedFunc(null, importManager.files[resolvedFilename].root, resolvedFilename);\n }\n else {\n new Parser(newEnv, importManager, newFileInfo).parse(contents, function (e, root) {\n fileParsedFunc(e, root, resolvedFilename);\n });\n }\n }\n };\n let loadedFile;\n let promise;\n const context = utils.clone(this.context);\n\n if (tryAppendExtension) {\n context.ext = importOptions.isPlugin ? '.js' : '.less';\n }\n\n if (importOptions.isPlugin) {\n context.mime = 'application/javascript';\n\n if (context.syncImport) {\n loadedFile = pluginLoader.loadPluginSync(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n } else {\n promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n }\n }\n else {\n if (context.syncImport) {\n loadedFile = fileManager.loadFileSync(path, currentFileInfo.currentDirectory, context, environment);\n } else {\n promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment,\n (err, loadedFile) => {\n if (err) {\n fileParsedFunc(err);\n } else {\n loadFileCallback(loadedFile);\n }\n });\n }\n }\n if (loadedFile) {\n if (!loadedFile.filename) {\n fileParsedFunc(loadedFile);\n } else {\n loadFileCallback(loadedFile);\n }\n } else if (promise) {\n promise.then(loadFileCallback, fileParsedFunc);\n }\n }\n }\n\n return ImportManager;\n}\n","import * as utils from './utils';\n\nexport default function(environment, ParseTree) {\n const render = function (input, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise(function (resolve, reject) {\n render.call(self, input, options, function(err, output) {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n this.parse(input, options, function(err, root, imports, options) {\n if (err) { return callback(err); }\n\n let result;\n try {\n const parseTree = new ParseTree(root, imports);\n result = parseTree.toCSS(options);\n }\n catch (err) { return callback(err); }\n\n callback(null, result);\n });\n }\n };\n\n return render;\n}\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport PluginManager from './plugin-manager';\nimport LessError from './less-error';\nimport * as utils from './utils';\n\nexport default function(environment, ParseTree, ImportManager) {\n const parse = function (input, options, callback) {\n\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise(function (resolve, reject) {\n parse.call(self, input, options, function(err, output) {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n let context;\n let rootFileInfo;\n const pluginManager = new PluginManager(this, !options.reUsePluginManager);\n\n options.pluginManager = pluginManager;\n\n context = new contexts.Parse(options);\n\n if (options.rootFileInfo) {\n rootFileInfo = options.rootFileInfo;\n } else {\n const filename = options.filename || 'input';\n const entryPath = filename.replace(/[^/\\\\]*$/, '');\n rootFileInfo = {\n filename,\n rewriteUrls: context.rewriteUrls,\n rootpath: context.rootpath || '',\n currentDirectory: entryPath,\n entryPath,\n rootFilename: filename\n };\n // add in a missing trailing slash\n if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') {\n rootFileInfo.rootpath += '/';\n }\n }\n\n const imports = new ImportManager(this, context, rootFileInfo);\n this.importManager = imports;\n\n // TODO: allow the plugins to be just a list of paths or names\n // Do an async plugin queue like lessc\n\n if (options.plugins) {\n options.plugins.forEach(function(plugin) {\n let evalResult, contents;\n if (plugin.fileContent) {\n contents = plugin.fileContent.replace(/^\\uFEFF/, '');\n evalResult = pluginManager.Loader.evalPlugin(contents, context, imports, plugin.options, plugin.filename);\n if (evalResult instanceof LessError) {\n return callback(evalResult);\n }\n }\n else {\n pluginManager.addPlugin(plugin);\n }\n });\n }\n\n new Parser(context, imports, rootFileInfo)\n .parse(input, function (e, root) {\n if (e) { return callback(e); }\n callback(null, root, imports, options);\n }, options);\n }\n };\n return parse;\n}\n","/**\n * @todo Add tests for browser `@plugin`\n */\nimport AbstractPluginLoader from '../less/environment/abstract-plugin-loader.js';\n\n/**\n * Browser Plugin Loader\n */\nconst PluginLoader = function(less) {\n this.less = less;\n // Should we shim this.require for browser? Probably not?\n};\n\nPluginLoader.prototype = Object.assign(new AbstractPluginLoader(), {\n loadPlugin(filename, basePath, context, environment, fileManager) {\n return new Promise((fulfill, reject) => {\n fileManager.loadFile(filename, basePath, context, environment)\n .then(fulfill).catch(reject);\n });\n }\n});\n\nexport default PluginLoader;\n\n","import * as utils from './utils';\nimport browser from './browser';\n\nexport default (window, less, options) => {\n\n function errorHTML(e, rootHref) {\n const id = `less-error-message:${utils.extractId(rootHref || '')}`;\n const template = '{content}
';\n const elem = window.document.createElement('div');\n let timer;\n let content;\n const errors = [];\n const filename = e.filename || rootHref;\n const filenameNoPath = filename.match(/([^/]+(\\?.*)?)$/)[1];\n\n elem.id = id;\n elem.className = 'less-error-message';\n\n content = `${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'}` + \n `
in ${filenameNoPath} `;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += `on line ${e.line}, column ${e.column + 1}:
`;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `
Stack Trace${e.stack.split('\\n').slice(1).join('
')}`;\n }\n elem.innerHTML = content;\n\n // CSS for error messages\n browser.createCSS(window.document, [\n '.less-error-message ul, .less-error-message li {',\n 'list-style-type: none;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message label {',\n 'font-size: 12px;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'color: #cc7777;',\n '}',\n '.less-error-message pre {',\n 'color: #dd6666;',\n 'padding: 4px 0;',\n 'margin: 0;',\n 'display: inline-block;',\n '}',\n '.less-error-message pre.line {',\n 'color: #ff0000;',\n '}',\n '.less-error-message h3 {',\n 'font-size: 20px;',\n 'font-weight: bold;',\n 'padding: 15px 0 5px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message a {',\n 'color: #10a',\n '}',\n '.less-error-message .error {',\n 'color: red;',\n 'font-weight: bold;',\n 'padding-bottom: 2px;',\n 'border-bottom: 1px dashed red;',\n '}'\n ].join('\\n'), { title: 'error-message' });\n\n elem.style.cssText = [\n 'font-family: Arial, sans-serif',\n 'border: 1px solid #e00',\n 'background-color: #eee',\n 'border-radius: 5px',\n '-webkit-border-radius: 5px',\n '-moz-border-radius: 5px',\n 'color: #e00',\n 'padding: 15px',\n 'margin-bottom: 15px'\n ].join(';');\n\n if (options.env === 'development') {\n timer = setInterval(() => {\n const document = window.document;\n const body = document.body;\n if (body) {\n if (document.getElementById(id)) {\n body.replaceChild(elem, document.getElementById(id));\n } else {\n body.insertBefore(elem, body.firstChild);\n }\n clearInterval(timer);\n }\n }, 10);\n }\n }\n\n function removeErrorHTML(path) {\n const node = window.document.getElementById(`less-error-message:${utils.extractId(path)}`);\n if (node) {\n node.parentNode.removeChild(node);\n }\n }\n\n function removeErrorConsole() {\n // no action\n }\n\n function removeError(path) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n removeErrorHTML(path);\n } else if (options.errorReporting === 'console') {\n removeErrorConsole(path);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('remove', path);\n }\n }\n\n function errorConsole(e, rootHref) {\n const template = '{line} {content}';\n const filename = e.filename || rootHref;\n const errors = [];\n let content = `${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'} in ${filename}`;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += ` on line ${e.line}, column ${e.column + 1}:\\n${errors.join('\\n')}`;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `\\nStack Trace\\n${e.stack}`;\n }\n less.logger.error(content);\n }\n\n function error(e, rootHref) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n errorHTML(e, rootHref);\n } else if (options.errorReporting === 'console') {\n errorConsole(e, rootHref);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('add', e, rootHref);\n }\n }\n\n return {\n add: error,\n remove: removeError\n };\n};\n","/**\n * Kicks off less and compiles any stylesheets\n * used in the browser distributed version of less\n * to kick-start less using the browser api\n */\nimport defaultOptions from '../less/default-options';\nimport addDefaultOptions from './add-default-options';\nimport root from './index';\n\nconst options = defaultOptions();\n\nif (window.less) {\n for (const key in window.less) {\n if (Object.prototype.hasOwnProperty.call(window.less, key)) {\n options[key] = window.less[key];\n }\n }\n}\naddDefaultOptions(window, options);\n\noptions.plugins = options.plugins || [];\n\nif (window.LESS_PLUGINS) {\n options.plugins = options.plugins.concat(window.LESS_PLUGINS);\n}\n\nconst less = root(window, options);\nexport default less;\n\nwindow.less = less;\n\nlet css;\nlet head;\nlet style;\n\n// Always restore page visibility\nfunction resolveOrReject(data) {\n if (data.filename) {\n console.warn(data);\n }\n if (!options.async) {\n head.removeChild(style);\n }\n}\n\nif (options.onReady) {\n if (/!watch/.test(window.location.hash)) {\n less.watch();\n }\n // Simulate synchronous stylesheet loading by hiding page rendering\n if (!options.async) {\n css = 'body { display: none !important }';\n head = document.head || document.getElementsByTagName('head')[0];\n style = document.createElement('style');\n\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n less.registerStylesheetsImmediately();\n less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject);\n}\n","// Export a new default each time\nexport default function() {\n return {\n /* Inline Javascript - @plugin still allowed */\n javascriptEnabled: false,\n\n /* Outputs a makefile import dependency list to stdout. */\n depends: false,\n\n /* (DEPRECATED) Compress using less built-in compression. \n * This does an okay job but does not utilise all the tricks of \n * dedicated css compression. */\n compress: false,\n\n /* Runs the less parser and just reports errors without any output. */\n lint: false,\n\n /* Sets available include paths.\n * If the file in an @import rule does not exist at that exact location, \n * less will look for it at the location(s) passed to this option. \n * You might use this for instance to specify a path to a library which \n * you want to be referenced simply and relatively in the less files. */\n paths: [],\n\n /* color output in the terminal */\n color: true,\n\n /* The strictImports controls whether the compiler will allow an @import inside of either \n * @media blocks or (a later addition) other selector blocks.\n * See: https://github.com/less/less.js/issues/656 */\n strictImports: false,\n\n /* Allow Imports from Insecure HTTPS Hosts */\n insecure: false,\n\n /* Allows you to add a path to every generated import and url in your css. \n * This does not affect less import statements that are processed, just ones \n * that are left in the output css. */\n rootpath: '',\n\n /* By default URLs are kept as-is, so if you import a file in a sub-directory \n * that references an image, exactly the same URL will be output in the css. \n * This option allows you to re-write URL's in imported files so that the \n * URL is always relative to the base imported file */\n rewriteUrls: false,\n\n /* How to process math \n * 0 always - eagerly try to solve all operations\n * 1 parens-division - require parens for division \"/\"\n * 2 parens | strict - require parens for all operations\n * 3 strict-legacy - legacy strict behavior (super-strict)\n */\n math: 1,\n\n /* Without this option, less attempts to guess at the output unit when it does maths. */\n strictUnits: false,\n\n /* Effectively the declaration is put at the top of your base Less file, \n * meaning it can be used but it also can be overridden if this variable \n * is defined in the file. */\n globalVars: null,\n\n /* As opposed to the global variable option, this puts the declaration at the\n * end of your base file, meaning it will override anything defined in your Less file. */\n modifyVars: null,\n\n /* This option allows you to specify a argument to go on to every URL. */\n urlArgs: ''\n }\n}","import {addDataAttr} from './utils';\nimport browser from './browser';\n\nexport default (window, options) => {\n\n // use options from the current script tag data attribues\n addDataAttr(options, browser.currentScript(window));\n\n if (options.isFileProtocol === undefined) {\n options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol);\n }\n\n // Load styles asynchronously (default: false)\n //\n // This is set to `false` by default, so that the body\n // doesn't start loading before the stylesheets are parsed.\n // Setting this to `true` can result in flickering.\n //\n options.async = options.async || false;\n options.fileAsync = options.fileAsync || false;\n\n // Interval between watch polls\n options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500);\n\n options.env = options.env || (window.location.hostname == '127.0.0.1' ||\n window.location.hostname == '0.0.0.0' ||\n window.location.hostname == 'localhost' ||\n (window.location.port &&\n window.location.port.length > 0) ||\n options.isFileProtocol ? 'development'\n : 'production');\n\n const dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash);\n if (dumpLineNumbers) {\n options.dumpLineNumbers = dumpLineNumbers[1];\n }\n\n if (options.useFileCache === undefined) {\n options.useFileCache = true;\n }\n\n if (options.onReady === undefined) {\n options.onReady = true;\n }\n\n if (options.relativeUrls) {\n options.rewriteUrls = 'all';\n }\n};\n","//\n// index.js\n// Should expose the additional browser functions on to the less object\n//\nimport {addDataAttr} from './utils';\nimport lessRoot from '../less';\nimport browser from './browser';\nimport FM from './file-manager';\nimport PluginLoader from './plugin-loader';\nimport LogListener from './log-listener';\nimport ErrorReporting from './error-reporting';\nimport Cache from './cache';\nimport ImageSize from './image-size';\n\nexport default (window, options) => {\n const document = window.document;\n const less = lessRoot();\n\n less.options = options;\n const environment = less.environment;\n const FileManager = FM(options, less.logger);\n const fileManager = new FileManager();\n environment.addFileManager(fileManager);\n less.FileManager = FileManager;\n less.PluginLoader = PluginLoader;\n\n LogListener(less, options);\n const errors = ErrorReporting(window, less, options);\n const cache = less.cache = options.cache || Cache(window, options, less.logger);\n ImageSize(less.environment);\n\n // Setup user functions - Deprecate?\n if (options.functions) {\n less.functions.functionRegistry.addMultiple(options.functions);\n }\n\n const typePattern = /^text\\/(x-)?less$/;\n\n function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n }\n\n // only really needed for phantom\n function bind(func, thisArg) {\n const curryArgs = Array.prototype.slice.call(arguments, 2);\n return function() {\n const args = curryArgs.concat(Array.prototype.slice.call(arguments, 0));\n return func.apply(thisArg, args);\n };\n }\n\n function loadStyles(modifyVars) {\n const styles = document.getElementsByTagName('style');\n let style;\n\n for (let i = 0; i < styles.length; i++) {\n style = styles[i];\n if (style.type.match(typePattern)) {\n const instanceOptions = clone(options);\n instanceOptions.modifyVars = modifyVars;\n const lessText = style.innerHTML || '';\n instanceOptions.filename = document.location.href.replace(/#.*$/, '');\n\n /* jshint loopfunc:true */\n // use closure to store current style\n less.render(lessText, instanceOptions,\n bind((style, e, result) => {\n if (e) {\n errors.add(e, 'inline');\n } else {\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = result.css;\n } else {\n style.innerHTML = result.css;\n }\n }\n }, null, style));\n }\n }\n }\n\n function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {\n\n const instanceOptions = clone(options);\n addDataAttr(instanceOptions, sheet);\n instanceOptions.mime = sheet.type;\n\n if (modifyVars) {\n instanceOptions.modifyVars = modifyVars;\n }\n\n function loadInitialFileCallback(loadedFile) {\n const data = loadedFile.contents;\n const path = loadedFile.filename;\n const webInfo = loadedFile.webInfo;\n\n const newFileInfo = {\n currentDirectory: fileManager.getPath(path),\n filename: path,\n rootFilename: path,\n rewriteUrls: instanceOptions.rewriteUrls\n };\n\n newFileInfo.entryPath = newFileInfo.currentDirectory;\n newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory;\n\n if (webInfo) {\n webInfo.remaining = remaining;\n\n const css = cache.getCSS(path, webInfo, instanceOptions.modifyVars);\n if (!reload && css) {\n webInfo.local = true;\n callback(null, css, data, sheet, webInfo, path);\n return;\n }\n\n }\n\n // TODO add tests around how this behaves when reloading\n errors.remove(path);\n\n instanceOptions.rootFileInfo = newFileInfo;\n less.render(data, instanceOptions, (e, result) => {\n if (e) {\n e.href = path;\n callback(e);\n } else {\n cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css);\n callback(null, result.css, data, sheet, webInfo, path);\n }\n });\n }\n\n fileManager.loadFile(sheet.href, null, instanceOptions, environment)\n .then(loadedFile => {\n loadInitialFileCallback(loadedFile);\n }).catch(err => {\n console.log(err);\n callback(err);\n });\n\n }\n\n function loadStyleSheets(callback, reload, modifyVars) {\n for (let i = 0; i < less.sheets.length; i++) {\n loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1), modifyVars);\n }\n }\n\n function initRunningMode() {\n if (less.env === 'development') {\n less.watchTimer = setInterval(() => {\n if (less.watchMode) {\n fileManager.clearFileCache();\n /**\n * @todo remove when this is typed with JSDoc\n */\n // eslint-disable-next-line no-unused-vars\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n } else if (css) {\n browser.createCSS(window.document, css, sheet);\n }\n });\n }\n }, options.poll);\n }\n }\n\n //\n // Watch mode\n //\n less.watch = function () {\n if (!less.watchMode ) {\n less.env = 'development';\n initRunningMode();\n }\n this.watchMode = true;\n return true;\n };\n\n less.unwatch = function () {clearInterval(less.watchTimer); this.watchMode = false; return false; };\n\n //\n // Synchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\".\n //\n less.registerStylesheetsImmediately = () => {\n const links = document.getElementsByTagName('link');\n less.sheets = [];\n\n for (let i = 0; i < links.length; i++) {\n if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&\n (links[i].type.match(typePattern)))) {\n less.sheets.push(links[i]);\n }\n }\n };\n\n //\n // Asynchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\", returning a Promise.\n //\n less.registerStylesheets = () => new Promise((resolve) => {\n less.registerStylesheetsImmediately();\n resolve();\n });\n\n //\n // With this function, it's possible to alter variables and re-render\n // CSS without reloading less-files\n //\n less.modifyVars = record => less.refresh(true, record, false);\n\n less.refresh = (reload, modifyVars, clearFileCache) => {\n if ((reload || clearFileCache) && clearFileCache !== false) {\n fileManager.clearFileCache();\n }\n return new Promise((resolve, reject) => {\n let startTime;\n let endTime;\n let totalMilliseconds;\n let remainingSheets;\n startTime = endTime = new Date();\n\n // Set counter for remaining unprocessed sheets\n remainingSheets = less.sheets.length;\n\n if (remainingSheets === 0) {\n\n endTime = new Date();\n totalMilliseconds = endTime - startTime;\n less.logger.info('Less has finished and no sheets were loaded.');\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n\n } else {\n // Relies on less.sheets array, callback seems to be guaranteed to be called for every element of the array\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n reject(e);\n return;\n }\n if (webInfo.local) {\n less.logger.info(`Loading ${sheet.href} from cache.`);\n } else {\n less.logger.info(`Rendered ${sheet.href} successfully.`);\n }\n browser.createCSS(window.document, css, sheet);\n less.logger.info(`CSS for ${sheet.href} generated in ${new Date() - endTime}ms`);\n\n // Count completed sheet\n remainingSheets--;\n\n // Check if the last remaining sheet was processed and then call the promise\n if (remainingSheets === 0) {\n totalMilliseconds = new Date() - startTime;\n less.logger.info(`Less has finished. CSS generated in ${totalMilliseconds}ms`);\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n }\n endTime = new Date();\n }, reload, modifyVars);\n }\n\n loadStyles(modifyVars);\n });\n };\n\n less.refreshStyles = loadStyles;\n return less;\n};\n","export default (less, options) => {\n const logLevel_debug = 4;\n const logLevel_info = 3;\n const logLevel_warn = 2;\n const logLevel_error = 1;\n\n // The amount of logging in the javascript console.\n // 3 - Debug, information and errors\n // 2 - Information and errors\n // 1 - Errors\n // 0 - None\n // Defaults to 2\n options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error);\n\n if (!options.loggers) {\n options.loggers = [{\n debug: function(msg) {\n if (options.logLevel >= logLevel_debug) {\n console.log(msg);\n }\n },\n info: function(msg) {\n if (options.logLevel >= logLevel_info) {\n console.log(msg);\n }\n },\n warn: function(msg) {\n if (options.logLevel >= logLevel_warn) {\n console.warn(msg);\n }\n },\n error: function(msg) {\n if (options.logLevel >= logLevel_error) {\n console.error(msg);\n }\n }\n }];\n }\n for (let i = 0; i < options.loggers.length; i++) {\n less.logger.addListener(options.loggers[i]);\n }\n};\n","// Cache system is a bit outdated and could do with work\n\nexport default (window, options, logger) => {\n let cache = null;\n if (options.env !== 'development') {\n try {\n cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage;\n } catch (_) {}\n }\n return {\n setCSS: function(path, lastModified, modifyVars, styles) {\n if (cache) {\n logger.info(`saving ${path} to cache.`);\n try {\n cache.setItem(path, styles);\n cache.setItem(`${path}:timestamp`, lastModified);\n if (modifyVars) {\n cache.setItem(`${path}:vars`, JSON.stringify(modifyVars));\n }\n } catch (e) {\n // TODO - could do with adding more robust error handling\n logger.error(`failed to save \"${path}\" to local storage for caching.`);\n }\n }\n },\n getCSS: function(path, webInfo, modifyVars) {\n const css = cache && cache.getItem(path);\n const timestamp = cache && cache.getItem(`${path}:timestamp`);\n let vars = cache && cache.getItem(`${path}:vars`);\n\n modifyVars = modifyVars || {};\n vars = vars || '{}'; // if not set, treat as the JSON representation of an empty object\n\n if (timestamp && webInfo.lastModified &&\n (new Date(webInfo.lastModified).valueOf() ===\n new Date(timestamp).valueOf()) &&\n JSON.stringify(modifyVars) === vars) {\n // Use local copy\n return css;\n }\n }\n };\n};\n","\nimport functionRegistry from './../less/functions/function-registry';\n\nexport default () => {\n function imageSize() {\n throw {\n type: 'Runtime',\n message: 'Image size functions are not supported in browser version of less'\n };\n }\n\n const imageFunctions = {\n 'image-size': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-width': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-height': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n }\n };\n\n functionRegistry.addMultiple(imageFunctions);\n};\n"],"names":["extractId","href","replace","addDataAttr","options","tag","opt","dataset","Object","prototype","hasOwnProperty","call","JSON","parse","_","document","styles","sheet","id","title","utils.extractId","oldStyleNode","getElementById","keepOldStyleNode","styleNode","createElement","setAttribute","media","styleSheet","appendChild","createTextNode","childNodes","length","firstChild","nodeValue","head","getElementsByTagName","nextEl","nextSibling","parentNode","insertBefore","removeChild","cssText","e","Error","window","scripts","currentScript","error","msg","this","_fireEvent","warn","info","debug","addListener","listener","_listeners","push","removeListener","i_1","splice","type","i_2","logFunction","externalEnvironment","fileManagers","requiredFunctions","functions","concat","propName","environmentFunc","bind","Environment","filename","currentDirectory","environment","isSync","logger","undefined","pluginManager","getFileManagers","fileManager","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","darkgrey","darkgreen","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","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","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","m","cm","mm","in","px","pt","pc","duration","s","ms","angle","rad","Math","PI","deg","grad","turn","colors","unitConversions","parent","visibilityBlocks","nodeVisible","rootNode","parsed","Node","fileInfo","getIndex","nodes","set","node","Array","isArray","forEach","_index","_fileInfo","context","strs","genCSS","add","chunk","index","isEmpty","join","output","value","visitor","visit","op","a","b","precision","numPrecision","Number","toFixed","compare","Color","rgb","originalForm","self","match","map","c","i","parseInt","alpha","split","clamp","v","max","min","toHex","round","toString","assign","luma","r","g","pow","toCSS","doNotCompress","color","colorFunction","compress","args","fround","indexOf","toHSL","h","l","toRGB","splitcolor","operate","other","_operate","d","toHSV","toARGB","x","fromKeyword","keyword","key","toLowerCase","slice","Paren","eval","_noSpaceCombinators"," ","|","Combinator","emptyOrWhitespace","trim","spaceOrEmpty","Element","combinator","isVariable","currentFileInfo","visibilityInfo","copyVisibilityInfo","setParent","accept","clone","firstSelector","charAt","ALWAYS","PARENS_DIVISION","PARENS","RewriteUrls","getType","payload","copy","target","constructor","getPrototypeOf","il","arguments","k","j","jl","__spreadArrays","getOwnPropertyNames","getOwnPropertySymbols","reduce","carry","props","includes","newVal","originalObject","includeNonenumerable","propType","propertyIsEnumerable","defineProperty","enumerable","writable","configurable","assignProp","nonenumerable","getLocation","inputStream","n","line","column","copyArray","arr","obj","cloned","prop","defaults","obj1","obj2","newObj","_defaults","defaults_1","copyOptions","opts","strictMath","math","Constants.Math","relativeUrls","rewriteUrls","Constants.RewriteUrls","flattenArray","result","length_1","isNullOrUndefined","val","anonymousFunc","LessError","fileContentMap","currentFilename","message","stack","input","contents","loc","utils.getLocation","col","callLine","lines","found","func","Function","lineAdjust","callExtract","extract","create","F","stylize","str","errorTxt","substr","_visitArgs","visitDeeper","_hasIndexed","_noop","implementation","_implementation","_visitInCache","_visitOutCache","indexNodeTypes","ticker","child","typeIndex","tree","Visitor","nodeTypeIndex","fnName","impl","funcOut","visitArgs","newNode","isReplacing","cnt","nonReplacing","out","evald","flatten","item","nestedCnt","nestedItem","contexts","copyFromOriginal","original","destination","propertiesToCopy","parseCopyProperties","Parse","paths","evalCopyProperties","isPathRelative","path","test","isPathLocalRelative","Eval","frames","importantScope","enterCalc","calcStack","inCalc","exitCalc","pop","inParenthesis","parensStack","outOfParenthesis","mathOn","isMathOn","pathRequiresRewrite","rewritePath","rootpath","newPath","normalizePath","segment","segments","reverse","onSequencerEmpty","imports","variableImports","_onSequencerEmpty","_currentDepth","ImportSequencer","callback","importSequencer","importItem","isReady","tryRun","apply","variableImport","ImportVisitor","importer","finish","_visitor","_importer","_finish","importCount","onceFileDetectionMap","recursionDetector","_sequencer","run","root","isFinished","visitImport","importNode","inlineCSS","inline","css","utils.copyArray","importParent","isVariableImport","addVariableImport","processImportNode","evaldImportNode","evalForImport","multiple","importMultiple","tryAppendLessExtension","rules","onImported","sequencedOnImported","addImport","getPath","importedAtRoot","fullPath","importVisitor","isPlugin","isOptional","optional","duplicateImport","skip","importedFilename","oldContext","visitDeclaration","declNode","unshift","visitDeclarationOut","shift","visitAtRule","atRuleNode","visitAtRuleOut","visitMixinDefinition","mixinDefinitionNode","visitMixinDefinitionOut","visitRuleset","rulesetNode","visitRulesetOut","visitMedia","mediaNode","visitMediaOut","visible","SetTreeVisibilityVisitor","visitArray","blocksVisibility","ensureVisibility","ensureInvisibility","allExtendsStack","ExtendFinderVisitor","allExtends","extend","extendList","allSelectorsExtendList","ruleCnt","Extend","extendOnEveryPath","selectorPath","selExtendList","allSelectorsExtend","foundExtends","findSelfSelectors","ruleset","firstExtendOnThisSelectorPath","selectors","ProcessExtendsVisitor","extendFinder","extendIndices","doExtendChaining","newRoot","checkExtendsForNonMatched","indices","filter","hasFoundMatches","parent_ids","selector","extendsList","extendsListTarget","iterationCount","extendIndex","targetExtendIndex","matches","newSelector","targetExtend","newExtend","extendsToAdd","extendVisitor","object_id","selfSelectors","findMatch","selfSelector","extendSelector","isVisible","option","extendChainCount","selectorOne","selectorTwo","ruleNode","selectorNode","pathIndex","selectorsToAdd","extendedSelectors","haystackSelectorPath","haystackSelectorIndex","hackstackSelector","hackstackElementIndex","haystackElement","targetCombinator","potentialMatch","needleElements","elements","potentialMatches","allowBefore","matched","initialCombinator","isElementValuesEqual","finished","allowAfter","endPathIndex","endPathElementIndex","elementValue1","elementValue2","Attribute","Selector","replacementSelector","matchIndex","firstElement","newElements","currentSelectorPathIndex","currentSelectorPathElementIndex","currentValue","derived","createDerived","newAllExtends","lastIndex","JoinSelectorVisitor","getIsOutput","joinSelectors","multiMedia","isRooted","_context","CSSVisitorUtils","bodyRules","rule","isSilent","owner","thing","compiledRulesBody","keepOnlyVisibleChilds","removeVisibilityBlock","firstRoot","hasVisibleSelector","ToCSSVisitor","utils","variable","mixinNode","visitExtend","extendNode","visitComment","commentNode","originalRules","resolveVisibility","visitAtRuleWithBody","visitAtRuleWithoutBody","visitAnonymous","anonymousNode","nodeRules","hasFakeRuleset","getBodyRules","_mergeRules","name","charset","debugInfo","comment","Comment","checkValidNodes","isRoot","Declaration","Call","allowRoot","rulesets","_compileRulesetPaths","nodeRuleCnt","_removeDuplicateRules","isVisibleRuleset","p","ruleList","ruleCache","ruleCSS","groups","groupsArr","i_3","merge","group","result_1","space_1","comma_1","Expression","important","Value","MarkVisibleSelectorsVisitor","ExtendVisitor","furthest","furthestPossibleErrorMessage","chunks","current","currentPos","saveStack","parserInput","skipWhitespace","nextChar","oldi","oldj","curr","endIndex","mem","inp","charCodeAt","autoCommentAbsorb","isLineComment","nextNewLine","text","commentStore","nextStarSlash","save","restore","possibleErrorMessage","state","forget","isWhitespace","offset","pos","code","$re","tok","exec","$char","$peekChar","$str","tokLength","$quoted","startChar","currentPosition","$parseUntil","testChar","quote","returnVal","inComment","blockDepth","blockStack","parseGroups","startPos","lastPos","loop","char","expected","peek","peekChar","currentChar","prevChar","getInput","peekNotNumeric","start","chunkInput","failFunction","fail","lastOpening","lastOpeningParen","lastMultiComment","lastMultiCommentEndBrace","chunkerCurrentIndex","currentChunkStartIndex","cc","cc2","len","level","parenLevel","emitFrom","emitChunk","force","String","fromCharCode","chunker","end","furthestReachedEnd","furthestChar","makeRegistry","base","_data","addMultiple","keys","_this","get","getLocalFunctions","inherit","MediaSyntaxOptions","queryInParens","ContainerSyntaxOptions","Parser","currentIndex","parsers","getParserInput","expect","arg","expectChar","getDebugInfo","lineNumber","fileName","parseNode","parseList","returnNodes","parser","additionalData","globalVars","modifyVars","ignored","err","preText","disablePluginRule","plugin","serializeVars","preProcessors","getPreProcessors","process","banner","contentsIgnoredChars","Ruleset","primary","functionRegistry","endInfo","processImports","visitors","mixin","extendRule","definition","declaration","variableCall","entities","atrule","foundSemiColon","mixinLookup","quoted","forceEscaped","isEscaped","customFuncCall","stop","f","ieAlpha","boolean","condition","if","prevArgs","isSemiColonSeparated","argsComma","argsSemiColon","detachedRuleset","assignment","expression","literal","dimension","unicodeDescriptor","entity","url","property","Variable","Property","ch","variableCurly","curly","propertyCurly","colorKeyword","ud","javascript","js","escape","Boolean","parsedName","lookups","inValue","ruleLookups","VariableCall","NamespaceValue","isRule","element","getLookup","hasParens","elem","elemIndex","re","isCall","expressionContainsNamed","nameLoop","expand","returner","variadic","expressions","hasSep","throwAwayComments","cond","params","argInfo","conditions","block","lookupValue","Quoted","attribute","slashedCombinator","isLess","when","cif","content","blockRuleset","Definition","DetachedRuleset","dumpLineNumbers","strictImports","hasDR","ruleProperty","permissiveValue","anonymousValue","untilTokens","done","testCurrentChar","Anonymous","variableRegex","propRegex","import","features","dir","importOptions","mediaFeatures","o","optionName","importOption","mediaFeature","syntaxOptions","rangeP","atomicCondition","rvalue","lvalue","prepareAndGetNestableAtRule","treeType","atRule","nestableAtRule","Media","Container","pluginArgs","nonVendorSpecificName","hasIdentifier","hasExpression","hasUnknown","hasBlock","sub","addition","parens","multiplication","operation","isSpaced","operand","parensInOp","needsParens","logical","next","conditionAnd","negatedCondition","parenthesisCondition","negate","body","me","tryConditionFollowedByParenthesis","preparsedCond","delim","simpleProperty","vars","name_1","evaldCondition","getElements","mixinElements_","utils.isNullOrUndefined","mediaEmpty","els","importManager","createEmptySelectors","el","sels","olen","mixinElements","isJustParentSelector","Keyword","True","False","mapLines","rulesetLike","isRulesetLike","MATH","asComment","ctx","asMediaQuery","filenameWithProtocol","lineSeparator","lastRule","prevMath","evaldValue","mathBypass","evalName","importantResult","makeImportant","isCompressed","defaultFunc","value_","error_","reset","_lookups","_variables","_properties","isRuleset","selCnt","hasVariable","hasOnePassingSelector","toParseSelectors","startingIndex","selectorFileInfo","utils.flattenArray","subRule","originalRuleset","allowImports","globalFunctionRegistry","ctxFrames","ctxSelectors","evalImports","rsRules","evalFirst","mediaBlockCount","mediaBlocks","resetCache","bubbleSelectors","importRules","matchArgs","matchCondition","lastSelector","_rulesets","variables","hash","properties","name_2","decl","parseValue","lastDeclaration","toParse","transformDeclaration","nodes_1","filtRules","prependRule","find","foundMixins","ruleNodes","tabLevel","sep","tabRuleStr","tabSetStr","charsetNodeIndex","importNodeIndex","isCharset","pathCnt","pathSubCnt","currentLastRule","joinSelector","createParenthesis","elementsToPak","originalElement","replacementParen","insideParent","createSelector","containedElement","addReplacementIntoPath","beginningPath","addPath","replacedElement","originalSelector","newSelectorPath","newJoinedSelector","parentEl","restOfPath","addAllReplacementsIntoPath","addPaths","mergeElementsOnToSelectors","sel","deriveSelector","deriveFrom","newPaths","replaceParentSelector","inSelector","currentElements","newSelectors","selectorsMultiplied","maybeSelector","hadParentSelector","nestedSelector","replaced","nestedPaths","replacedNewSelectors","concatenated","AtRule","outputRuleset","mediaPathBackup","mediaBlocksBackup","mediaPath","callEval","Unit","numerator","denominator","backupUnit","sort","strictUnits","returnStr","is","unitString","toUpperCase","isLength","RegExp","isSingular","usedUnits","mapUnit","groupName","atomicUnit","cancel","counter","count","Dimension","unit","parseFloat","isNaN","toColor","strValue","convertTo","unify","numericCompare","conversions","targetUnit","applyUnit","derivedConversions","Operation","operands","__assign","t","noSpacing","returnValue","doubleParen","functionCaller","evalArgs","commentFilter","subNodes","to","from","pack","ar","calc","currentMathContext","funcCaller","FunctionCaller","isValid","columnNumber","evaluating","frame","fun","mergeRules","less","vArr","escaped","containsVariables","that","iterativeReplace","regexp","replacementFnc","evaluatedValue","URL","isEvald","urlArgs","NestableAtRulePrototype","evalTop","evalNested","permute","fragment","rest","Import","pathValue","reference","evalPath","doEval","addVisibilityBlock","registry","newImport","JsEvalNode","evaluateJavaScript","evalContext","javascriptEnabled","jsify","toJS","JavaScript","string","Assignment","Condition","QueryInParens","op2","mvalue","UnicodeDescriptor","Negative","next_id","selectorElements","selfElements","ruleCall","substring","arity","optionalParameters","required","evalParams","mixinEnv","evaldArguments","varargs","isNamedFound","argIndex","argsLength","evalCall","_arguments","mixinFrames","allArgsCnt","requiredArgsCnt","MixinCall","mixins","mixinPath","argValue","isRecursive","isOneFound","candidate","defaultResult","noArgumentsFilter","candidates","conditionResult","calcDefGroup","namespace","MixinDefinition","format","newRules","_setVisibilityToReplacement","replacement","AbstractFileManager","lastIndexOf","ext","tryAppendExtension","basePath","laterPath","baseUrl","urlDirectories","baseUrlDirectories","urlParts","extractUrlParts","baseUrlParts","diff","hostPart","directories","urlPartsRegex","rawDirectories","rawPath","fileUrl","require","AbstractPluginLoader","pluginOptions","pluginObj","localModule","shortname","FileManager","trySetOptions","use","exports","loader","validatePlugin","minVersion","compareVersion","addPlugin","setOptions","version","versionToString","aVersion","bVersion","versionString","plugins","printUsage","If","trueValue","falseValue","isdefined","colorFunctions","hsla","origColor","hsl","number","rgba","size","m1","m2","hue","hsv","hsva","vs","floor","perm","saturation","lightness","hsvhue","hsvsaturation","hsvvalue","luminance","saturate","amount","method","desaturate","lighten","darken","fadein","fadeout","fade","spin","mix","color1","color2","weight","w","w1","w2","greyscale","contrast","dark","light","threshold","argb","tint","shade","colorBlend","mode","cb","cs","cr","ab","as","colorBlendModeFunctions","multiply","screen","overlay","softlight","sqrt","hardlight","difference","abs","exclusion","average","negation","getItemsFromNode","_SELF","~","_i","expr","values","range","step","stepValue","list","each","rs","iterator","tryEval","Quote","valueName","keyName","indexName","MathHelper","fn","mathFunctions","ceil","sin","cos","atan","asin","acos","mathHelper","fraction","num","minMax","isMin","currentUnified","referenceUnified","unitStatic","unitClone","order","convert","pi","mod","y","percentage","evaluated","encodeURI","pattern","flags","%","token","encodeURIComponent","isa","Type","isunit","isruleset","iscolor","isnumber","isstring","iskeyword","isurl","ispixel","ispercentage","isem","get-unit","colorBlending","fallback","functionThis","data-uri","mimetypeNode","filePathNode","mimetype","filePath","entryPath","fragmentStart","utils.clone","rawBuffer","getFileManager","useBase64","mimeLookup","charsetLookup","fileSync","loadFileSync","buf","encodeBase64","uri","dataUri","svg-gradient","direction","stops","gradientDirectionSvg","position","positionValue","gradientType","rectangleDimension","renderEnv","directionValue","throwArgumentDescriptor","types","evaldRoot","evalEnv","visitorIterator","preEvalVisitors","first","isPreEvalVisitor","isPreVisitor","pm","postProcessors","installedPlugins","pluginCache","Loader","PluginLoader","PluginManager","install","preProcessor","priority","indexToInsertAt","postProcessor","manager","PluginManagerFactory","newFactory","major","minor","patch","pre","build","sourceMapOutput","sourceMapBuilder","parseTree","SourceMapBuilder","ParseTree","transformTree","toCSSOptions","sourceMap","getPostProcessors","file_1","getExternalSourceMap","files","rootFilename","SourceMapOutput","contentsIgnoredCharsMap","contentsMap","sourceMapFilename","sourceMapURL","outputFilename","sourceMapOutputFilename","sourceMapBasepath","sourceMapRootpath","outputSourceFiles","sourceMapGenerator","sourceMapFileInline","disableSourcemapAnnotation","sourceMapInputFilename","normalizeFilename","removeBasepath","getCSSAppendage","_css","_rootNode","_contentsMap","_contentsIgnoredCharsMap","_sourceMapFilename","_outputFilename","_sourceMapBasepath","_sourceMapRootpath","_outputSourceFiles","_sourceMapGeneratorConstructor","getSourceMapGenerator","_lineNumber","_column","sourceLines","columns","sourceColumns","inputSource","_sourceMapGenerator","addMapping","generated","source","file","sourceRoot","setSourceContent","sourceMapContent","stringify","toJSON","rootFileInfo","mime","queue","ImportManager","pluginLoader","fileParsedFunc","importedEqualsRoot","newFileInfo","loadedFile","promise","loadFileCallback","resolvedFilename","pathDiff","isPathAbsolute","alwaysMakePathsAbsolute","newEnv","evalPlugin","syncImport","loadPluginSync","loadPlugin","loadFile","then","render","utils.copyOptions","self_1","Promise","resolve","reject","Render","context_1","pluginManager_1","reUsePluginManager","imports_1","evalResult","fileContent","parseVersion","initial","data","ctor","api","fileCache","doXHR","errback","xhr","XMLHttpRequest","async","isFileProtocol","fileAsync","handleResponse","status","responseText","getResponseHeader","overrideMimeType","open","setRequestHeader","send","onreadystatechange","readyState","supports","clearFileCache","location","useFileCache","lessText_1","webInfo","lastModified","Date","log","fulfill","catch","rootHref","errorReporting","errors","errorline","classname","logLevel","errorConsole","timer","filenameNoPath","className","innerHTML","browser","style","env","setInterval","replaceChild","clearInterval","errorHTML","remove","removeErrorHTML","depends","lint","insecure","protocol","poll","hostname","port","onReady","addDefaultOptions","LESS_PLUGINS","lessRoot","FM","addFileManager","loggers","console","LogListener","ErrorReporting","cache","localStorage","setCSS","setItem","getCSS","getItem","timestamp","valueOf","Cache","imageSize","imageFunctions","image-size","image-width","image-height","ImageSize","typePattern","thisArg","curryArgs","loadStyles","instanceOptions","loadStyleSheet","reload","remaining","local","loadInitialFileCallback","loadStyleSheets","sheets","watch","watchMode","watchTimer","unwatch","registerStylesheetsImmediately","links","rel","registerStylesheets","record","refresh","startTime","endTime","totalMilliseconds","remainingSheets","refreshStyles","resolveOrReject","pageLoadFinished"],"mappings":";;;;;;;;;8OACgBA,EAAUC,GACtB,OAAOA,EAAKC,QAAQ,qBAAsB,IACrCA,QAAQ,qBAAsB,IAC9BA,QAAQ,MAAO,IACfA,QAAQ,eAAgB,IACxBA,QAAQ,YAAa,KACrBA,QAAQ,MAAO,cAGRC,EAAYC,EAASC,GACjC,GAAKA,EACL,IAAK,IAAMC,KAAOD,EAAIE,QAClB,GAAIC,OAAOC,UAAUC,eAAeC,KAAKN,EAAIE,QAASD,GAClD,GAAY,QAARA,GAAyB,oBAARA,GAAqC,aAARA,GAA8B,mBAARA,EACpEF,EAAQE,GAAOD,EAAIE,QAAQD,QAE3B,IACIF,EAAQE,GAAOM,KAAKC,MAAMR,EAAIE,QAAQD,IAE1C,MAAOQ,WCjBR,SAAUC,EAAUC,EAAQC,GAEnC,IAAMhB,EAAOgB,EAAMhB,MAAQ,GAGrBiB,EAAK,SAAQD,EAAME,OAASC,EAAgBnB,IAG5CoB,EAAeN,EAASO,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pB,SAASoB,MAAQpB,SAASqB,qBAAqB,QAAQ,IAC9DglD,GAAQrmD,SAASU,cAAc,UAEzBqC,KAAO,WACTsjD,GAAMxlD,WACNwlD,GAAMxlD,WAAWc,QAAU4e,GAE3B8lC,GAAMvlD,YAAYd,SAASe,eAAewf,KAG9Cnf,GAAKN,YAAYulD,KAErBnc,GAAK2f,iCACL3f,GAAKugB,iBAAmBvgB,GAAKggB,QAAqB,gBAAbhgB,GAAKoc,KAAuB7D,KAAK+H,GAAiBA"}
\ No newline at end of file
+{"version":3,"file":"less.min.js","sources":["../src/less-browser/utils.js","../src/less-browser/browser.js","../src/less/logger.js","../src/less/environment/environment.js","../src/less/data/colors.js","../src/less/data/unit-conversions.js","../src/less/data/index.js","../src/less/tree/node.js","../src/less/tree/color.js","../src/less/tree/paren.js","../src/less/tree/combinator.js","../src/less/tree/element.js","../src/less/constants.js","../node_modules/is-what/dist/index.esm.js","../node_modules/copy-anything/dist/index.esm.js","../src/less/utils.js","../src/less/less-error.js","../src/less/visitors/visitor.js","../src/less/contexts.js","../src/less/visitors/import-sequencer.js","../src/less/visitors/import-visitor.js","../src/less/visitors/set-tree-visibility-visitor.js","../src/less/visitors/extend-visitor.js","../src/less/visitors/join-selector-visitor.js","../src/less/visitors/to-css-visitor.js","../src/less/visitors/index.js","../src/less/parser/parser-input.js","../src/less/parser/chunker.js","../src/less/functions/function-registry.js","../src/less/tree/atrule-syntax.js","../src/less/parser/parser.js","../src/less/tree/selector.js","../src/less/tree/value.js","../src/less/tree/keyword.js","../src/less/tree/anonymous.js","../src/less/tree/declaration.js","../src/less/tree/debug-info.js","../src/less/tree/comment.js","../src/less/functions/default.js","../src/less/tree/ruleset.js","../src/less/tree/atrule.js","../src/less/tree/detached-ruleset.js","../src/less/tree/unit.js","../src/less/tree/dimension.js","../src/less/tree/operation.js","../node_modules/tslib/tslib.es6.js","../src/less/tree/expression.js","../src/less/functions/function-caller.js","../src/less/tree/call.js","../src/less/tree/variable.js","../src/less/tree/property.js","../src/less/tree/attribute.js","../src/less/tree/quoted.js","../src/less/tree/url.js","../src/less/tree/nested-at-rule.js","../src/less/tree/media.js","../src/less/tree/import.js","../src/less/tree/js-eval-node.js","../src/less/tree/javascript.js","../src/less/tree/assignment.js","../src/less/tree/condition.js","../src/less/tree/query-in-parens.js","../src/less/tree/container.js","../src/less/tree/unicode-descriptor.js","../src/less/tree/negative.js","../src/less/tree/extend.js","../src/less/tree/variable-call.js","../src/less/tree/namespace-value.js","../src/less/tree/mixin-definition.js","../src/less/tree/mixin-call.js","../src/less/tree/index.js","../src/less/environment/abstract-file-manager.js","../src/less/environment/abstract-plugin-loader.js","../src/less/functions/boolean.js","../src/less/functions/color.js","../src/less/functions/color-blending.js","../src/less/functions/list.js","../src/less/functions/math-helper.js","../src/less/functions/math.js","../src/less/functions/number.js","../src/less/functions/string.js","../src/less/functions/types.js","../src/less/functions/index.js","../src/less/functions/data-uri.js","../src/less/functions/svg.js","../src/less/transform-tree.js","../src/less/plugin-manager.js","../node_modules/parse-node-version/index.js","../src/less-browser/file-manager.js","../src/less/index.js","../src/less/parse-tree.js","../src/less/source-map-builder.js","../src/less/source-map-output.js","../src/less/import-manager.js","../src/less/render.js","../src/less/parse.js","../src/less-browser/plugin-loader.js","../src/less-browser/error-reporting.js","../src/less-browser/bootstrap.js","../src/less/default-options.js","../src/less-browser/add-default-options.js","../src/less-browser/index.js","../src/less-browser/log-listener.js","../src/less-browser/cache.js","../src/less-browser/image-size.js"],"sourcesContent":["\nexport function extractId(href) {\n return href.replace(/^[a-z-]+:\\/+?[^/]+/, '') // Remove protocol & domain\n .replace(/[?&]livereload=\\w+/, '') // Remove LiveReload cachebuster\n .replace(/^\\//, '') // Remove root /\n .replace(/\\.[a-zA-Z]+$/, '') // Remove simple extension\n .replace(/[^.\\w-]+/g, '-') // Replace illegal characters\n .replace(/\\./g, ':'); // Replace dots with colons(for valid id)\n}\n\nexport function addDataAttr(options, tag) {\n if (!tag) {return;} // in case of tag is null or undefined\n for (const opt in tag.dataset) {\n if (Object.prototype.hasOwnProperty.call(tag.dataset, opt)) {\n if (opt === 'env' || opt === 'dumpLineNumbers' || opt === 'rootpath' || opt === 'errorReporting') {\n options[opt] = tag.dataset[opt];\n } else {\n try {\n options[opt] = JSON.parse(tag.dataset[opt]);\n }\n catch (_) {}\n }\n }\n }\n}\n","import * as utils from './utils';\n\nexport default {\n createCSS: function (document, styles, sheet) {\n // Strip the query-string\n const href = sheet.href || '';\n\n // If there is no title set, use the filename, minus the extension\n const id = `less:${sheet.title || utils.extractId(href)}`;\n\n // If this has already been inserted into the DOM, we may need to replace it\n const oldStyleNode = document.getElementById(id);\n let keepOldStyleNode = false;\n\n // Create a new stylesheet node for insertion or (if necessary) replacement\n const styleNode = document.createElement('style');\n styleNode.setAttribute('type', 'text/css');\n if (sheet.media) {\n styleNode.setAttribute('media', sheet.media);\n }\n styleNode.id = id;\n\n if (!styleNode.styleSheet) {\n styleNode.appendChild(document.createTextNode(styles));\n\n // If new contents match contents of oldStyleNode, don't replace oldStyleNode\n keepOldStyleNode = (oldStyleNode !== null && oldStyleNode.childNodes.length > 0 && styleNode.childNodes.length > 0 &&\n oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue);\n }\n\n const head = document.getElementsByTagName('head')[0];\n\n // If there is no oldStyleNode, just append; otherwise, only append if we need\n // to replace oldStyleNode with an updated stylesheet\n if (oldStyleNode === null || keepOldStyleNode === false) {\n const nextEl = sheet && sheet.nextSibling || null;\n if (nextEl) {\n nextEl.parentNode.insertBefore(styleNode, nextEl);\n } else {\n head.appendChild(styleNode);\n }\n }\n if (oldStyleNode && keepOldStyleNode === false) {\n oldStyleNode.parentNode.removeChild(oldStyleNode);\n }\n\n // For IE.\n // This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash.\n // See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head\n if (styleNode.styleSheet) {\n try {\n styleNode.styleSheet.cssText = styles;\n } catch (e) {\n throw new Error('Couldn\\'t reassign styleSheet.cssText.');\n }\n }\n },\n currentScript: function(window) {\n const document = window.document;\n return document.currentScript || (() => {\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n })();\n }\n};\n","export default {\n error: function(msg) {\n this._fireEvent('error', msg);\n },\n warn: function(msg) {\n this._fireEvent('warn', msg);\n },\n info: function(msg) {\n this._fireEvent('info', msg);\n },\n debug: function(msg) {\n this._fireEvent('debug', msg);\n },\n addListener: function(listener) {\n this._listeners.push(listener);\n },\n removeListener: function(listener) {\n for (let i = 0; i < this._listeners.length; i++) {\n if (this._listeners[i] === listener) {\n this._listeners.splice(i, 1);\n return;\n }\n }\n },\n _fireEvent: function(type, msg) {\n for (let i = 0; i < this._listeners.length; i++) {\n const logFunction = this._listeners[i][type];\n if (logFunction) {\n logFunction(msg);\n }\n }\n },\n _listeners: []\n};\n","/**\n * @todo Document why this abstraction exists, and the relationship between\n * environment, file managers, and plugin manager\n */\n\nimport logger from '../logger';\n\nclass Environment {\n constructor(externalEnvironment, fileManagers) {\n this.fileManagers = fileManagers || [];\n externalEnvironment = externalEnvironment || {};\n\n const optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator'];\n const requiredFunctions = [];\n const functions = requiredFunctions.concat(optionalFunctions);\n\n for (let i = 0; i < functions.length; i++) {\n const propName = functions[i];\n const environmentFunc = externalEnvironment[propName];\n if (environmentFunc) {\n this[propName] = environmentFunc.bind(externalEnvironment);\n } else if (i < requiredFunctions.length) {\n this.warn(`missing required function in environment - ${propName}`);\n }\n }\n }\n\n getFileManager(filename, currentDirectory, options, environment, isSync) {\n\n if (!filename) {\n logger.warn('getFileManager called with no filename.. Please report this issue. continuing.');\n }\n if (currentDirectory === undefined) {\n logger.warn('getFileManager called with null directory.. Please report this issue. continuing.');\n }\n\n let fileManagers = this.fileManagers;\n if (options.pluginManager) {\n fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers());\n }\n for (let i = fileManagers.length - 1; i >= 0 ; i--) {\n const fileManager = fileManagers[i];\n if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) {\n return fileManager;\n }\n }\n return null;\n }\n\n addFileManager(fileManager) {\n this.fileManagers.push(fileManager);\n }\n\n clearFileManagers() {\n this.fileManagers = [];\n }\n}\n\nexport default Environment;\n","export default {\n 'aliceblue':'#f0f8ff',\n 'antiquewhite':'#faebd7',\n 'aqua':'#00ffff',\n 'aquamarine':'#7fffd4',\n 'azure':'#f0ffff',\n 'beige':'#f5f5dc',\n 'bisque':'#ffe4c4',\n 'black':'#000000',\n 'blanchedalmond':'#ffebcd',\n 'blue':'#0000ff',\n 'blueviolet':'#8a2be2',\n 'brown':'#a52a2a',\n 'burlywood':'#deb887',\n 'cadetblue':'#5f9ea0',\n 'chartreuse':'#7fff00',\n 'chocolate':'#d2691e',\n 'coral':'#ff7f50',\n 'cornflowerblue':'#6495ed',\n 'cornsilk':'#fff8dc',\n 'crimson':'#dc143c',\n 'cyan':'#00ffff',\n 'darkblue':'#00008b',\n 'darkcyan':'#008b8b',\n 'darkgoldenrod':'#b8860b',\n 'darkgray':'#a9a9a9',\n 'darkgrey':'#a9a9a9',\n 'darkgreen':'#006400',\n 'darkkhaki':'#bdb76b',\n 'darkmagenta':'#8b008b',\n 'darkolivegreen':'#556b2f',\n 'darkorange':'#ff8c00',\n 'darkorchid':'#9932cc',\n 'darkred':'#8b0000',\n 'darksalmon':'#e9967a',\n 'darkseagreen':'#8fbc8f',\n 'darkslateblue':'#483d8b',\n 'darkslategray':'#2f4f4f',\n 'darkslategrey':'#2f4f4f',\n 'darkturquoise':'#00ced1',\n 'darkviolet':'#9400d3',\n 'deeppink':'#ff1493',\n 'deepskyblue':'#00bfff',\n 'dimgray':'#696969',\n 'dimgrey':'#696969',\n 'dodgerblue':'#1e90ff',\n 'firebrick':'#b22222',\n 'floralwhite':'#fffaf0',\n 'forestgreen':'#228b22',\n 'fuchsia':'#ff00ff',\n 'gainsboro':'#dcdcdc',\n 'ghostwhite':'#f8f8ff',\n 'gold':'#ffd700',\n 'goldenrod':'#daa520',\n 'gray':'#808080',\n 'grey':'#808080',\n 'green':'#008000',\n 'greenyellow':'#adff2f',\n 'honeydew':'#f0fff0',\n 'hotpink':'#ff69b4',\n 'indianred':'#cd5c5c',\n 'indigo':'#4b0082',\n 'ivory':'#fffff0',\n 'khaki':'#f0e68c',\n 'lavender':'#e6e6fa',\n 'lavenderblush':'#fff0f5',\n 'lawngreen':'#7cfc00',\n 'lemonchiffon':'#fffacd',\n 'lightblue':'#add8e6',\n 'lightcoral':'#f08080',\n 'lightcyan':'#e0ffff',\n 'lightgoldenrodyellow':'#fafad2',\n 'lightgray':'#d3d3d3',\n 'lightgrey':'#d3d3d3',\n 'lightgreen':'#90ee90',\n 'lightpink':'#ffb6c1',\n 'lightsalmon':'#ffa07a',\n 'lightseagreen':'#20b2aa',\n 'lightskyblue':'#87cefa',\n 'lightslategray':'#778899',\n 'lightslategrey':'#778899',\n 'lightsteelblue':'#b0c4de',\n 'lightyellow':'#ffffe0',\n 'lime':'#00ff00',\n 'limegreen':'#32cd32',\n 'linen':'#faf0e6',\n 'magenta':'#ff00ff',\n 'maroon':'#800000',\n 'mediumaquamarine':'#66cdaa',\n 'mediumblue':'#0000cd',\n 'mediumorchid':'#ba55d3',\n 'mediumpurple':'#9370d8',\n 'mediumseagreen':'#3cb371',\n 'mediumslateblue':'#7b68ee',\n 'mediumspringgreen':'#00fa9a',\n 'mediumturquoise':'#48d1cc',\n 'mediumvioletred':'#c71585',\n 'midnightblue':'#191970',\n 'mintcream':'#f5fffa',\n 'mistyrose':'#ffe4e1',\n 'moccasin':'#ffe4b5',\n 'navajowhite':'#ffdead',\n 'navy':'#000080',\n 'oldlace':'#fdf5e6',\n 'olive':'#808000',\n 'olivedrab':'#6b8e23',\n 'orange':'#ffa500',\n 'orangered':'#ff4500',\n 'orchid':'#da70d6',\n 'palegoldenrod':'#eee8aa',\n 'palegreen':'#98fb98',\n 'paleturquoise':'#afeeee',\n 'palevioletred':'#d87093',\n 'papayawhip':'#ffefd5',\n 'peachpuff':'#ffdab9',\n 'peru':'#cd853f',\n 'pink':'#ffc0cb',\n 'plum':'#dda0dd',\n 'powderblue':'#b0e0e6',\n 'purple':'#800080',\n 'rebeccapurple':'#663399',\n 'red':'#ff0000',\n 'rosybrown':'#bc8f8f',\n 'royalblue':'#4169e1',\n 'saddlebrown':'#8b4513',\n 'salmon':'#fa8072',\n 'sandybrown':'#f4a460',\n 'seagreen':'#2e8b57',\n 'seashell':'#fff5ee',\n 'sienna':'#a0522d',\n 'silver':'#c0c0c0',\n 'skyblue':'#87ceeb',\n 'slateblue':'#6a5acd',\n 'slategray':'#708090',\n 'slategrey':'#708090',\n 'snow':'#fffafa',\n 'springgreen':'#00ff7f',\n 'steelblue':'#4682b4',\n 'tan':'#d2b48c',\n 'teal':'#008080',\n 'thistle':'#d8bfd8',\n 'tomato':'#ff6347',\n 'turquoise':'#40e0d0',\n 'violet':'#ee82ee',\n 'wheat':'#f5deb3',\n 'white':'#ffffff',\n 'whitesmoke':'#f5f5f5',\n 'yellow':'#ffff00',\n 'yellowgreen':'#9acd32'\n};","export default {\n length: {\n 'm': 1,\n 'cm': 0.01,\n 'mm': 0.001,\n 'in': 0.0254,\n 'px': 0.0254 / 96,\n 'pt': 0.0254 / 72,\n 'pc': 0.0254 / 72 * 12\n },\n duration: {\n 's': 1,\n 'ms': 0.001\n },\n angle: {\n 'rad': 1 / (2 * Math.PI),\n 'deg': 1 / 360,\n 'grad': 1 / 400,\n 'turn': 1\n }\n};","import colors from './colors';\nimport unitConversions from './unit-conversions';\n\nexport default { colors, unitConversions };\n","/**\n * The reason why Node is a class and other nodes simply do not extend\n * from Node (since we're transpiling) is due to this issue:\n * \n * @see https://github.com/less/less.js/issues/3434\n */\nclass Node {\n constructor() {\n this.parent = null;\n this.visibilityBlocks = undefined;\n this.nodeVisible = undefined;\n this.rootNode = null;\n this.parsed = null;\n }\n\n get currentFileInfo() {\n return this.fileInfo();\n }\n\n get index() {\n return this.getIndex();\n }\n\n setParent(nodes, parent) {\n function set(node) {\n if (node && node instanceof Node) {\n node.parent = parent;\n }\n }\n if (Array.isArray(nodes)) {\n nodes.forEach(set);\n }\n else {\n set(nodes);\n }\n }\n\n getIndex() {\n return this._index || (this.parent && this.parent.getIndex()) || 0;\n }\n\n fileInfo() {\n return this._fileInfo || (this.parent && this.parent.fileInfo()) || {};\n }\n\n isRulesetLike() { return false; }\n\n toCSS(context) {\n const strs = [];\n this.genCSS(context, {\n // remove when genCSS has JSDoc types\n // eslint-disable-next-line no-unused-vars\n add: function(chunk, fileInfo, index) {\n strs.push(chunk);\n },\n isEmpty: function () {\n return strs.length === 0;\n }\n });\n return strs.join('');\n }\n\n genCSS(context, output) {\n output.add(this.value);\n }\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n }\n\n eval() { return this; }\n\n _operate(context, op, a, b) {\n switch (op) {\n case '+': return a + b;\n case '-': return a - b;\n case '*': return a * b;\n case '/': return a / b;\n }\n }\n\n fround(context, value) {\n const precision = context && context.numPrecision;\n // add \"epsilon\" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded:\n return (precision) ? Number((value + 2e-16).toFixed(precision)) : value;\n }\n\n static compare(a, b) {\n /* returns:\n -1: a < b\n 0: a = b\n 1: a > b\n and *any* other value for a != b (e.g. undefined, NaN, -2 etc.) */\n\n if ((a.compare) &&\n // for \"symmetric results\" force toCSS-based comparison\n // of Quoted or Anonymous if either value is one of those\n !(b.type === 'Quoted' || b.type === 'Anonymous')) {\n return a.compare(b);\n } else if (b.compare) {\n return -b.compare(a);\n } else if (a.type !== b.type) {\n return undefined;\n }\n\n a = a.value;\n b = b.value;\n if (!Array.isArray(a)) {\n return a === b ? 0 : undefined;\n }\n if (a.length !== b.length) {\n return undefined;\n }\n for (let i = 0; i < a.length; i++) {\n if (Node.compare(a[i], b[i]) !== 0) {\n return undefined;\n }\n }\n return 0;\n }\n\n static numericCompare(a, b) {\n return a < b ? -1\n : a === b ? 0\n : a > b ? 1 : undefined;\n }\n\n // Returns true if this node represents root of ast imported by reference\n blocksVisibility() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n return this.visibilityBlocks !== 0;\n }\n\n addVisibilityBlock() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks + 1;\n }\n\n removeVisibilityBlock() {\n if (this.visibilityBlocks === undefined) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks - 1;\n }\n\n // Turns on node visibility - if called node will be shown in output regardless\n // of whether it comes from import by reference or not\n ensureVisibility() {\n this.nodeVisible = true;\n }\n\n // Turns off node visibility - if called node will NOT be shown in output regardless\n // of whether it comes from import by reference or not\n ensureInvisibility() {\n this.nodeVisible = false;\n }\n\n // return values:\n // false - the node must not be visible\n // true - the node must be visible\n // undefined or null - the node has the same visibility as its parent\n isVisible() {\n return this.nodeVisible;\n }\n\n visibilityInfo() {\n return {\n visibilityBlocks: this.visibilityBlocks,\n nodeVisible: this.nodeVisible\n };\n }\n\n copyVisibilityInfo(info) {\n if (!info) {\n return;\n }\n this.visibilityBlocks = info.visibilityBlocks;\n this.nodeVisible = info.nodeVisible;\n }\n}\n\nexport default Node;\n","import Node from './node';\nimport colors from '../data/colors';\n\n//\n// RGB Colors - #ff0014, #eee\n//\nconst Color = function(rgb, a, originalForm) {\n const self = this;\n //\n // The end goal here, is to parse the arguments\n // into an integer triplet, such as `128, 255, 0`\n //\n // This facilitates operations and conversions.\n //\n if (Array.isArray(rgb)) {\n this.rgb = rgb;\n } else if (rgb.length >= 6) {\n this.rgb = [];\n rgb.match(/.{2}/g).map(function (c, i) {\n if (i < 3) {\n self.rgb.push(parseInt(c, 16));\n } else {\n self.alpha = (parseInt(c, 16)) / 255;\n }\n });\n } else {\n this.rgb = [];\n rgb.split('').map(function (c, i) {\n if (i < 3) {\n self.rgb.push(parseInt(c + c, 16));\n } else {\n self.alpha = (parseInt(c + c, 16)) / 255;\n }\n });\n }\n this.alpha = this.alpha || (typeof a === 'number' ? a : 1);\n if (typeof originalForm !== 'undefined') {\n this.value = originalForm;\n }\n}\n\nColor.prototype = Object.assign(new Node(), {\n type: 'Color',\n\n luma() {\n let r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255;\n\n r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4);\n g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4);\n b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4);\n\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n },\n\n toCSS(context, doNotCompress) {\n const compress = context && context.compress && !doNotCompress;\n let color;\n let alpha;\n let colorFunction;\n let args = [];\n\n // `value` is set if this color was originally\n // converted from a named color string so we need\n // to respect this and try to output named color too.\n alpha = this.fround(context, this.alpha);\n\n if (this.value) {\n if (this.value.indexOf('rgb') === 0) {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n } else if (this.value.indexOf('hsl') === 0) {\n if (alpha < 1) {\n colorFunction = 'hsla';\n } else {\n colorFunction = 'hsl';\n }\n } else {\n return this.value;\n }\n } else {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n }\n\n switch (colorFunction) {\n case 'rgba':\n args = this.rgb.map(function (c) {\n return clamp(Math.round(c), 255);\n }).concat(clamp(alpha, 1));\n break;\n case 'hsla':\n args.push(clamp(alpha, 1));\n // eslint-disable-next-line no-fallthrough\n case 'hsl':\n color = this.toHSL();\n args = [\n this.fround(context, color.h),\n `${this.fround(context, color.s * 100)}%`,\n `${this.fround(context, color.l * 100)}%`\n ].concat(args);\n }\n\n if (colorFunction) {\n // Values are capped between `0` and `255`, rounded and zero-padded.\n return `${colorFunction}(${args.join(`,${compress ? '' : ' '}`)})`;\n }\n\n color = this.toRGB();\n\n if (compress) {\n const splitcolor = color.split('');\n\n // Convert color to short format\n if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) {\n color = `#${splitcolor[1]}${splitcolor[3]}${splitcolor[5]}`;\n }\n }\n\n return color;\n },\n\n //\n // Operations have to be done per-channel, if not,\n // channels will spill onto each other. Once we have\n // our result, in the form of an integer triplet,\n // we create a new Color node to hold the result.\n //\n operate(context, op, other) {\n const rgb = new Array(3);\n const alpha = this.alpha * (1 - other.alpha) + other.alpha;\n for (let c = 0; c < 3; c++) {\n rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]);\n }\n return new Color(rgb, alpha);\n },\n\n toRGB() {\n return toHex(this.rgb);\n },\n\n toHSL() {\n const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;\n\n const max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h;\n let s;\n const l = (max + min) / 2;\n const d = max - min;\n\n if (max === min) {\n h = s = 0;\n } else {\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, l, a };\n },\n\n // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript\n toHSV() {\n const r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;\n\n const max = Math.max(r, g, b), min = Math.min(r, g, b);\n let h;\n let s;\n const v = max;\n\n const d = max - min;\n if (max === 0) {\n s = 0;\n } else {\n s = d / max;\n }\n\n if (max === min) {\n h = 0;\n } else {\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, v, a };\n },\n\n toARGB() {\n return toHex([this.alpha * 255].concat(this.rgb));\n },\n\n compare(x) {\n return (x.rgb &&\n x.rgb[0] === this.rgb[0] &&\n x.rgb[1] === this.rgb[1] &&\n x.rgb[2] === this.rgb[2] &&\n x.alpha === this.alpha) ? 0 : undefined;\n }\n});\n\nColor.fromKeyword = function(keyword) {\n let c;\n const key = keyword.toLowerCase();\n // eslint-disable-next-line no-prototype-builtins\n if (colors.hasOwnProperty(key)) {\n c = new Color(colors[key].slice(1));\n }\n else if (key === 'transparent') {\n c = new Color([0, 0, 0], 0);\n }\n\n if (c) {\n c.value = keyword;\n return c;\n }\n};\n\nfunction clamp(v, max) {\n return Math.min(Math.max(v, 0), max);\n}\n\nfunction toHex(v) {\n return `#${v.map(function (c) {\n c = clamp(Math.round(c), 255);\n return (c < 16 ? '0' : '') + c.toString(16);\n }).join('')}`;\n}\n\nexport default Color;\n","import Node from './node';\n\nconst Paren = function(node) {\n this.value = node;\n};\n\nParen.prototype = Object.assign(new Node(), {\n type: 'Paren',\n\n genCSS(context, output) {\n output.add('(');\n this.value.genCSS(context, output);\n output.add(')');\n },\n\n eval(context) {\n return new Paren(this.value.eval(context));\n }\n});\n\nexport default Paren;\n","import Node from './node';\nconst _noSpaceCombinators = {\n '': true,\n ' ': true,\n '|': true\n};\n\nconst Combinator = function(value) {\n if (value === ' ') {\n this.value = ' ';\n this.emptyOrWhitespace = true;\n } else {\n this.value = value ? value.trim() : '';\n this.emptyOrWhitespace = this.value === '';\n }\n}\n\nCombinator.prototype = Object.assign(new Node(), {\n type: 'Combinator',\n\n genCSS(context, output) {\n const spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' ';\n output.add(spaceOrEmpty + this.value + spaceOrEmpty);\n }\n});\n\nexport default Combinator;\n","import Node from './node';\nimport Paren from './paren';\nimport Combinator from './combinator';\n\nconst Element = function(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) {\n this.combinator = combinator instanceof Combinator ?\n combinator : new Combinator(combinator);\n\n if (typeof value === 'string') {\n this.value = value.trim();\n } else if (value) {\n this.value = value;\n } else {\n this.value = '';\n }\n this.isVariable = isVariable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.combinator, this);\n}\n\nElement.prototype = Object.assign(new Node(), {\n type: 'Element',\n\n accept(visitor) {\n const value = this.value;\n this.combinator = visitor.visit(this.combinator);\n if (typeof value === 'object') {\n this.value = visitor.visit(value);\n }\n },\n\n eval(context) {\n return new Element(this.combinator,\n this.value.eval ? this.value.eval(context) : this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n clone() {\n return new Element(this.combinator,\n this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context), this.fileInfo(), this.getIndex());\n },\n\n toCSS(context) {\n context = context || {};\n let value = this.value;\n const firstSelector = context.firstSelector;\n if (value instanceof Paren) {\n // selector in parens should not be affected by outer selector\n // flags (breaks only interpolated selectors - see #1973)\n context.firstSelector = true;\n }\n value = value.toCSS ? value.toCSS(context) : value;\n context.firstSelector = firstSelector;\n if (value === '' && this.combinator.value.charAt(0) === '&') {\n return '';\n } else {\n return this.combinator.toCSS(context) + value;\n }\n }\n});\n\nexport default Element;\n","\nexport const Math = {\n ALWAYS: 0,\n PARENS_DIVISION: 1,\n PARENS: 2\n // removed - STRICT_LEGACY: 3\n};\n\nexport const RewriteUrls = {\n OFF: 0,\n LOCAL: 1,\n ALL: 2\n};","/**\r\n * Returns the object type of the given payload\r\n *\r\n * @param {*} payload\r\n * @returns {string}\r\n */\r\nfunction getType(payload) {\r\n return Object.prototype.toString.call(payload).slice(8, -1);\r\n}\r\n/**\r\n * Returns whether the payload is undefined\r\n *\r\n * @param {*} payload\r\n * @returns {payload is undefined}\r\n */\r\nfunction isUndefined(payload) {\r\n return getType(payload) === 'Undefined';\r\n}\r\n/**\r\n * Returns whether the payload is null\r\n *\r\n * @param {*} payload\r\n * @returns {payload is null}\r\n */\r\nfunction isNull(payload) {\r\n return getType(payload) === 'Null';\r\n}\r\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Record}\r\n */\r\nfunction isPlainObject(payload) {\r\n if (getType(payload) !== 'Object')\r\n return false;\r\n return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;\r\n}\r\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Record}\r\n */\r\nfunction isObject(payload) {\r\n return isPlainObject(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is { [K in any]: never }}\r\n */\r\nfunction isEmptyObject(payload) {\r\n return isPlainObject(payload) && Object.keys(payload).length === 0;\r\n}\r\n/**\r\n * Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Record}\r\n */\r\nfunction isAnyObject(payload) {\r\n return getType(payload) === 'Object';\r\n}\r\n/**\r\n * Returns whether the payload is an object like a type passed in < >\r\n *\r\n * Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.\r\n *\r\n * @template T this must be passed in < >\r\n * @param {*} payload\r\n * @returns {payload is T}\r\n */\r\nfunction isObjectLike(payload) {\r\n return isAnyObject(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a function (regular or async)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is AnyFunction}\r\n */\r\nfunction isFunction(payload) {\r\n return typeof payload === \"function\";\r\n}\r\n/**\r\n * Returns whether the payload is an array\r\n *\r\n * @param {any} payload\r\n * @returns {payload is any[]}\r\n */\r\nfunction isArray(payload) {\r\n return getType(payload) === 'Array';\r\n}\r\n/**\r\n * Returns whether the payload is a an array with at least 1 item\r\n *\r\n * @param {*} payload\r\n * @returns {payload is any[]}\r\n */\r\nfunction isFullArray(payload) {\r\n return isArray(payload) && payload.length > 0;\r\n}\r\n/**\r\n * Returns whether the payload is a an empty array\r\n *\r\n * @param {*} payload\r\n * @returns {payload is []}\r\n */\r\nfunction isEmptyArray(payload) {\r\n return isArray(payload) && payload.length === 0;\r\n}\r\n/**\r\n * Returns whether the payload is a string\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isString(payload) {\r\n return getType(payload) === 'String';\r\n}\r\n/**\r\n * Returns whether the payload is a string, BUT returns false for ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isFullString(payload) {\r\n return isString(payload) && payload !== '';\r\n}\r\n/**\r\n * Returns whether the payload is ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\r\nfunction isEmptyString(payload) {\r\n return payload === '';\r\n}\r\n/**\r\n * Returns whether the payload is a number (but not NaN)\r\n *\r\n * This will return `false` for `NaN`!!\r\n *\r\n * @param {*} payload\r\n * @returns {payload is number}\r\n */\r\nfunction isNumber(payload) {\r\n return getType(payload) === 'Number' && !isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a boolean\r\n *\r\n * @param {*} payload\r\n * @returns {payload is boolean}\r\n */\r\nfunction isBoolean(payload) {\r\n return getType(payload) === 'Boolean';\r\n}\r\n/**\r\n * Returns whether the payload is a regular expression (RegExp)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is RegExp}\r\n */\r\nfunction isRegExp(payload) {\r\n return getType(payload) === 'RegExp';\r\n}\r\n/**\r\n * Returns whether the payload is a Map\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Map}\r\n */\r\nfunction isMap(payload) {\r\n return getType(payload) === 'Map';\r\n}\r\n/**\r\n * Returns whether the payload is a WeakMap\r\n *\r\n * @param {*} payload\r\n * @returns {payload is WeakMap}\r\n */\r\nfunction isWeakMap(payload) {\r\n return getType(payload) === 'WeakMap';\r\n}\r\n/**\r\n * Returns whether the payload is a Set\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Set}\r\n */\r\nfunction isSet(payload) {\r\n return getType(payload) === 'Set';\r\n}\r\n/**\r\n * Returns whether the payload is a WeakSet\r\n *\r\n * @param {*} payload\r\n * @returns {payload is WeakSet}\r\n */\r\nfunction isWeakSet(payload) {\r\n return getType(payload) === 'WeakSet';\r\n}\r\n/**\r\n * Returns whether the payload is a Symbol\r\n *\r\n * @param {*} payload\r\n * @returns {payload is symbol}\r\n */\r\nfunction isSymbol(payload) {\r\n return getType(payload) === 'Symbol';\r\n}\r\n/**\r\n * Returns whether the payload is a Date, and that the date is valid\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Date}\r\n */\r\nfunction isDate(payload) {\r\n return getType(payload) === 'Date' && !isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a Blob\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Blob}\r\n */\r\nfunction isBlob(payload) {\r\n return getType(payload) === 'Blob';\r\n}\r\n/**\r\n * Returns whether the payload is a File\r\n *\r\n * @param {*} payload\r\n * @returns {payload is File}\r\n */\r\nfunction isFile(payload) {\r\n return getType(payload) === 'File';\r\n}\r\n/**\r\n * Returns whether the payload is a Promise\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Promise}\r\n */\r\nfunction isPromise(payload) {\r\n return getType(payload) === 'Promise';\r\n}\r\n/**\r\n * Returns whether the payload is an Error\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Error}\r\n */\r\nfunction isError(payload) {\r\n return getType(payload) === 'Error';\r\n}\r\n/**\r\n * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is typeof NaN}\r\n */\r\nfunction isNaNValue(payload) {\r\n return getType(payload) === 'Number' && isNaN(payload);\r\n}\r\n/**\r\n * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is boolean | null | undefined | number | string | symbol)}\r\n */\r\nfunction isPrimitive(payload) {\r\n return (isBoolean(payload) ||\r\n isNull(payload) ||\r\n isUndefined(payload) ||\r\n isNumber(payload) ||\r\n isString(payload) ||\r\n isSymbol(payload));\r\n}\r\n/**\r\n * Returns true whether the payload is null or undefined\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is null | undefined)}\r\n */\r\nfunction isNullOrUndefined(payload) {\r\n return isNull(payload) || isUndefined(payload);\r\n}\r\n/**\r\n * Does a generic check to check that the given payload is of a given type.\r\n * In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!);\r\n * It will, however, differentiate between object and null\r\n *\r\n * @template T\r\n * @param {*} payload\r\n * @param {T} type\r\n * @throws {TypeError} Will throw type error if type is an invalid type\r\n * @returns {payload is T}\r\n */\r\nfunction isType(payload, type) {\r\n if (!(type instanceof Function)) {\r\n throw new TypeError('Type must be a function');\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {\r\n throw new TypeError('Type is not a class');\r\n }\r\n // Classes usually have names (as functions usually have names)\r\n var name = type.name;\r\n return getType(payload) === name || Boolean(payload && payload.constructor === type);\r\n}\n\nexport { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyArray, isEmptyObject, isEmptyString, isError, isFile, isFullArray, isFullString, isFunction, isMap, isNaNValue, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isType, isUndefined, isWeakMap, isWeakSet };\n","import { isArray, isPlainObject } from 'is-what';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\n\nfunction assignProp(carry, key, newVal, originalObject, includeNonenumerable) {\r\n var propType = {}.propertyIsEnumerable.call(originalObject, key)\r\n ? 'enumerable'\r\n : 'nonenumerable';\r\n if (propType === 'enumerable')\r\n carry[key] = newVal;\r\n if (includeNonenumerable && propType === 'nonenumerable') {\r\n Object.defineProperty(carry, key, {\r\n value: newVal,\r\n enumerable: false,\r\n writable: true,\r\n configurable: true,\r\n });\r\n }\r\n}\r\n/**\r\n * Copy (clone) an object and all its props recursively to get rid of any prop referenced of the original object. Arrays are also cloned, however objects inside arrays are still linked.\r\n *\r\n * @export\r\n * @template T\r\n * @param {T} target Target can be anything\r\n * @param {Options} [options={}] Options can be `props` or `nonenumerable`\r\n * @returns {T} the target with replaced values\r\n * @export\r\n */\r\nfunction copy(target, options) {\r\n if (options === void 0) { options = {}; }\r\n if (isArray(target))\r\n return target.map(function (i) { return copy(i, options); });\r\n if (!isPlainObject(target))\r\n return target;\r\n var props = Object.getOwnPropertyNames(target);\r\n var symbols = Object.getOwnPropertySymbols(target);\r\n return __spreadArrays(props, symbols).reduce(function (carry, key) {\r\n if (isArray(options.props) && !options.props.includes(key)) {\r\n return carry;\r\n }\r\n var val = target[key];\r\n var newVal = copy(val, options);\r\n assignProp(carry, key, newVal, target, options.nonenumerable);\r\n return carry;\r\n }, {});\r\n}\n\nexport { copy };\n","/* jshint proto: true */\nimport * as Constants from './constants';\nimport { copy } from 'copy-anything';\n\nexport function getLocation(index, inputStream) {\n let n = index + 1;\n let line = null;\n let column = -1;\n\n while (--n >= 0 && inputStream.charAt(n) !== '\\n') {\n column++;\n }\n\n if (typeof index === 'number') {\n line = (inputStream.slice(0, index).match(/\\n/g) || '').length;\n }\n\n return {\n line,\n column\n };\n}\n\nexport function copyArray(arr) {\n let i;\n const length = arr.length;\n const copy = new Array(length);\n\n for (i = 0; i < length; i++) {\n copy[i] = arr[i];\n }\n return copy;\n}\n\nexport function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n}\n\nexport function defaults(obj1, obj2) {\n let newObj = obj2 || {};\n if (!obj2._defaults) {\n newObj = {};\n const defaults = copy(obj1);\n newObj._defaults = defaults;\n const cloned = obj2 ? copy(obj2) : {};\n Object.assign(newObj, defaults, cloned);\n }\n return newObj;\n}\n\nexport function copyOptions(obj1, obj2) {\n if (obj2 && obj2._defaults) {\n return obj2;\n }\n const opts = defaults(obj1, obj2);\n if (opts.strictMath) {\n opts.math = Constants.Math.PARENS;\n }\n // Back compat with changed relativeUrls option\n if (opts.relativeUrls) {\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n }\n if (typeof opts.math === 'string') {\n switch (opts.math.toLowerCase()) {\n case 'always':\n opts.math = Constants.Math.ALWAYS;\n break;\n case 'parens-division':\n opts.math = Constants.Math.PARENS_DIVISION;\n break;\n case 'strict':\n case 'parens':\n opts.math = Constants.Math.PARENS;\n break;\n default:\n opts.math = Constants.Math.PARENS;\n }\n }\n if (typeof opts.rewriteUrls === 'string') {\n switch (opts.rewriteUrls.toLowerCase()) {\n case 'off':\n opts.rewriteUrls = Constants.RewriteUrls.OFF;\n break;\n case 'local':\n opts.rewriteUrls = Constants.RewriteUrls.LOCAL;\n break;\n case 'all':\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n break;\n }\n }\n return opts;\n}\n\nexport function merge(obj1, obj2) {\n for (const prop in obj2) {\n if (Object.prototype.hasOwnProperty.call(obj2, prop)) {\n obj1[prop] = obj2[prop];\n }\n }\n return obj1;\n}\n\nexport function flattenArray(arr, result = []) {\n for (let i = 0, length = arr.length; i < length; i++) {\n const value = arr[i];\n if (Array.isArray(value)) {\n flattenArray(value, result);\n } else {\n if (value !== undefined) {\n result.push(value);\n }\n }\n }\n return result;\n}\n\nexport function isNullOrUndefined(val) {\n return val === null || val === undefined\n}","import * as utils from './utils';\n\nconst anonymousFunc = /(|Function):(\\d+):(\\d+)/;\n\n/**\n * This is a centralized class of any error that could be thrown internally (mostly by the parser).\n * Besides standard .message it keeps some additional data like a path to the file where the error\n * occurred along with line and column numbers.\n *\n * @class\n * @extends Error\n * @type {module.LessError}\n *\n * @prop {string} type\n * @prop {string} filename\n * @prop {number} index\n * @prop {number} line\n * @prop {number} column\n * @prop {number} callLine\n * @prop {number} callExtract\n * @prop {string[]} extract\n *\n * @param {Object} e - An error object to wrap around or just a descriptive object\n * @param {Object} fileContentMap - An object with file contents in 'contents' property (like importManager) @todo - move to fileManager?\n * @param {string} [currentFilename]\n */\nconst LessError = function(e, fileContentMap, currentFilename) {\n Error.call(this);\n\n const filename = e.filename || currentFilename;\n\n this.message = e.message;\n this.stack = e.stack;\n\n if (fileContentMap && filename) {\n const input = fileContentMap.contents[filename];\n const loc = utils.getLocation(e.index, input);\n var line = loc.line;\n const col = loc.column;\n const callLine = e.call && utils.getLocation(e.call, input).line;\n const lines = input ? input.split('\\n') : '';\n\n this.type = e.type || 'Syntax';\n this.filename = filename;\n this.index = e.index;\n this.line = typeof line === 'number' ? line + 1 : null;\n this.column = col;\n\n if (!this.line && this.stack) {\n const found = this.stack.match(anonymousFunc);\n\n /**\n * We have to figure out how this environment stringifies anonymous functions\n * so we can correctly map plugin errors.\n * \n * Note, in Node 8, the output of anonymous funcs varied based on parameters\n * being present or not, so we inject dummy params.\n */\n const func = new Function('a', 'throw new Error()');\n let lineAdjust = 0;\n try {\n func();\n } catch (e) {\n const match = e.stack.match(anonymousFunc);\n lineAdjust = 1 - parseInt(match[2]);\n }\n\n if (found) {\n if (found[2]) {\n this.line = parseInt(found[2]) + lineAdjust;\n }\n if (found[3]) {\n this.column = parseInt(found[3]);\n }\n }\n }\n\n this.callLine = callLine + 1;\n this.callExtract = lines[callLine];\n\n this.extract = [\n lines[this.line - 2],\n lines[this.line - 1],\n lines[this.line]\n ];\n }\n\n};\n\nif (typeof Object.create === 'undefined') {\n const F = function () {};\n F.prototype = Error.prototype;\n LessError.prototype = new F();\n} else {\n LessError.prototype = Object.create(Error.prototype);\n}\n\nLessError.prototype.constructor = LessError;\n\n/**\n * An overridden version of the default Object.prototype.toString\n * which uses additional information to create a helpful message.\n *\n * @param {Object} options\n * @returns {string}\n */\nLessError.prototype.toString = function(options) {\n options = options || {};\n\n let message = '';\n const extract = this.extract || [];\n let error = [];\n let stylize = function (str) { return str; };\n if (options.stylize) {\n const type = typeof options.stylize;\n if (type !== 'function') {\n throw Error(`options.stylize should be a function, got a ${type}!`);\n }\n stylize = options.stylize;\n }\n\n if (this.line !== null) {\n if (typeof extract[0] === 'string') {\n error.push(stylize(`${this.line - 1} ${extract[0]}`, 'grey'));\n }\n\n if (typeof extract[1] === 'string') {\n let errorTxt = `${this.line} `;\n if (extract[1]) {\n errorTxt += extract[1].slice(0, this.column) +\n stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') +\n extract[1].slice(this.column + 1), 'red'), 'inverse');\n }\n error.push(errorTxt);\n }\n\n if (typeof extract[2] === 'string') {\n error.push(stylize(`${this.line + 1} ${extract[2]}`, 'grey'));\n }\n error = `${error.join('\\n') + stylize('', 'reset')}\\n`;\n }\n\n message += stylize(`${this.type}Error: ${this.message}`, 'red');\n if (this.filename) {\n message += stylize(' in ', 'red') + this.filename;\n }\n if (this.line) {\n message += stylize(` on line ${this.line}, column ${this.column + 1}:`, 'grey');\n }\n\n message += `\\n${error}`;\n\n if (this.callLine) {\n message += `${stylize('from ', 'red') + (this.filename || '')}/n`;\n message += `${stylize(this.callLine, 'grey')} ${this.callExtract}/n`;\n }\n\n return message;\n};\n\nexport default LessError;","import tree from '../tree';\n\nconst _visitArgs = { visitDeeper: true };\nlet _hasIndexed = false;\n\nfunction _noop(node) {\n return node;\n}\n\nfunction indexNodeTypes(parent, ticker) {\n // add .typeIndex to tree node types for lookup table\n let key, child;\n for (key in parent) { \n /* eslint guard-for-in: 0 */\n child = parent[key];\n switch (typeof child) {\n case 'function':\n // ignore bound functions directly on tree which do not have a prototype\n // or aren't nodes\n if (child.prototype && child.prototype.type) {\n child.prototype.typeIndex = ticker++;\n }\n break;\n case 'object':\n ticker = indexNodeTypes(child, ticker);\n break;\n \n }\n }\n return ticker;\n}\n\nclass Visitor {\n constructor(implementation) {\n this._implementation = implementation;\n this._visitInCache = {};\n this._visitOutCache = {};\n\n if (!_hasIndexed) {\n indexNodeTypes(tree, 1);\n _hasIndexed = true;\n }\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n\n const nodeTypeIndex = node.typeIndex;\n if (!nodeTypeIndex) {\n // MixinCall args aren't a node type?\n if (node.value && node.value.typeIndex) {\n this.visit(node.value);\n }\n return node;\n }\n\n const impl = this._implementation;\n let func = this._visitInCache[nodeTypeIndex];\n let funcOut = this._visitOutCache[nodeTypeIndex];\n const visitArgs = _visitArgs;\n let fnName;\n\n visitArgs.visitDeeper = true;\n\n if (!func) {\n fnName = `visit${node.type}`;\n func = impl[fnName] || _noop;\n funcOut = impl[`${fnName}Out`] || _noop;\n this._visitInCache[nodeTypeIndex] = func;\n this._visitOutCache[nodeTypeIndex] = funcOut;\n }\n\n if (func !== _noop) {\n const newNode = func.call(impl, node, visitArgs);\n if (node && impl.isReplacing) {\n node = newNode;\n }\n }\n\n if (visitArgs.visitDeeper && node) {\n if (node.length) {\n for (let i = 0, cnt = node.length; i < cnt; i++) {\n if (node[i].accept) {\n node[i].accept(this);\n }\n }\n } else if (node.accept) {\n node.accept(this);\n }\n }\n\n if (funcOut != _noop) {\n funcOut.call(impl, node);\n }\n\n return node;\n }\n\n visitArray(nodes, nonReplacing) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n\n // Non-replacing\n if (nonReplacing || !this._implementation.isReplacing) {\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n // Replacing\n const out = [];\n for (i = 0; i < cnt; i++) {\n const evald = this.visit(nodes[i]);\n if (evald === undefined) { continue; }\n if (!evald.splice) {\n out.push(evald);\n } else if (evald.length) {\n this.flatten(evald, out);\n }\n }\n return out;\n }\n\n flatten(arr, out) {\n if (!out) {\n out = [];\n }\n\n let cnt, i, item, nestedCnt, j, nestedItem;\n\n for (i = 0, cnt = arr.length; i < cnt; i++) {\n item = arr[i];\n if (item === undefined) {\n continue;\n }\n if (!item.splice) {\n out.push(item);\n continue;\n }\n\n for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) {\n nestedItem = item[j];\n if (nestedItem === undefined) {\n continue;\n }\n if (!nestedItem.splice) {\n out.push(nestedItem);\n } else if (nestedItem.length) {\n this.flatten(nestedItem, out);\n }\n }\n }\n\n return out;\n }\n}\n\nexport default Visitor;\n","const contexts = {};\nexport default contexts;\nimport * as Constants from './constants';\n\nconst copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) {\n if (!original) { return; }\n\n for (let i = 0; i < propertiesToCopy.length; i++) {\n if (Object.prototype.hasOwnProperty.call(original, propertiesToCopy[i])) {\n destination[propertiesToCopy[i]] = original[propertiesToCopy[i]];\n }\n }\n};\n\n/*\n parse is used whilst parsing\n */\nconst parseCopyProperties = [\n // options\n 'paths', // option - unmodified - paths to search for imports on\n 'rewriteUrls', // option - whether to adjust URL's to be relative\n 'rootpath', // option - rootpath to append to URL's\n 'strictImports', // option -\n 'insecure', // option - whether to allow imports from insecure ssl hosts\n 'dumpLineNumbers', // option - whether to dump line numbers\n 'compress', // option - whether to compress\n 'syncImport', // option - whether to import synchronously\n 'chunkInput', // option - whether to chunk input. more performant but causes parse issues.\n 'mime', // browser only - mime type for sheet import\n 'useFileCache', // browser only - whether to use the per file session cache\n // context\n 'processImports', // option & context - whether to process imports. if false then imports will not be imported.\n // Used by the import manager to stop multiple import visitors being created.\n 'pluginManager' // Used as the plugin manager for the session\n];\n\ncontexts.Parse = function(options) {\n copyFromOriginal(options, this, parseCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n};\n\nconst evalCopyProperties = [\n 'paths', // additional include paths\n 'compress', // whether to compress\n 'math', // whether math has to be within parenthesis\n 'strictUnits', // whether units need to evaluate correctly\n 'sourceMap', // whether to output a source map\n 'importMultiple', // whether we are currently importing multiple copies\n 'urlArgs', // whether to add args into url tokens\n 'javascriptEnabled', // option - whether Inline JavaScript is enabled. if undefined, defaults to false\n 'pluginManager', // Used as the plugin manager for the session\n 'importantScope', // used to bubble up !important statements\n 'rewriteUrls' // option - whether to adjust URL's to be relative\n];\n\ncontexts.Eval = function(options, frames) {\n copyFromOriginal(options, this, evalCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n\n this.frames = frames || [];\n this.importantScope = this.importantScope || [];\n};\n\ncontexts.Eval.prototype.enterCalc = function () {\n if (!this.calcStack) {\n this.calcStack = [];\n }\n this.calcStack.push(true);\n this.inCalc = true;\n};\n\ncontexts.Eval.prototype.exitCalc = function () {\n this.calcStack.pop();\n if (!this.calcStack.length) {\n this.inCalc = false;\n }\n};\n\ncontexts.Eval.prototype.inParenthesis = function () {\n if (!this.parensStack) {\n this.parensStack = [];\n }\n this.parensStack.push(true);\n};\n\ncontexts.Eval.prototype.outOfParenthesis = function () {\n this.parensStack.pop();\n};\n\ncontexts.Eval.prototype.inCalc = false;\ncontexts.Eval.prototype.mathOn = true;\ncontexts.Eval.prototype.isMathOn = function (op) {\n if (!this.mathOn) {\n return false;\n }\n if (op === '/' && this.math !== Constants.Math.ALWAYS && (!this.parensStack || !this.parensStack.length)) {\n return false;\n }\n if (this.math > Constants.Math.PARENS_DIVISION) {\n return this.parensStack && this.parensStack.length;\n }\n return true;\n};\n\ncontexts.Eval.prototype.pathRequiresRewrite = function (path) {\n const isRelative = this.rewriteUrls === Constants.RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative;\n\n return isRelative(path);\n};\n\ncontexts.Eval.prototype.rewritePath = function (path, rootpath) {\n let newPath;\n\n rootpath = rootpath || '';\n newPath = this.normalizePath(rootpath + path);\n\n // If a path was explicit relative and the rootpath was not an absolute path\n // we must ensure that the new path is also explicit relative.\n if (isPathLocalRelative(path) &&\n isPathRelative(rootpath) &&\n isPathLocalRelative(newPath) === false) {\n newPath = `./${newPath}`;\n }\n\n return newPath;\n};\n\ncontexts.Eval.prototype.normalizePath = function (path) {\n const segments = path.split('/').reverse();\n let segment;\n\n path = [];\n while (segments.length !== 0) {\n segment = segments.pop();\n switch ( segment ) {\n case '.':\n break;\n case '..':\n if ((path.length === 0) || (path[path.length - 1] === '..')) {\n path.push( segment );\n } else {\n path.pop();\n }\n break;\n default:\n path.push(segment);\n break;\n }\n }\n\n return path.join('/');\n};\n\nfunction isPathRelative(path) {\n return !/^(?:[a-z-]+:|\\/|#)/i.test(path);\n}\n\nfunction isPathLocalRelative(path) {\n return path.charAt(0) === '.';\n}\n\n// todo - do the same for the toCSS ?\n","class ImportSequencer {\n constructor(onSequencerEmpty) {\n this.imports = [];\n this.variableImports = [];\n this._onSequencerEmpty = onSequencerEmpty;\n this._currentDepth = 0;\n }\n\n addImport(callback) {\n const importSequencer = this,\n importItem = {\n callback,\n args: null,\n isReady: false\n };\n this.imports.push(importItem);\n return function() {\n importItem.args = Array.prototype.slice.call(arguments, 0);\n importItem.isReady = true;\n importSequencer.tryRun();\n };\n }\n\n addVariableImport(callback) {\n this.variableImports.push(callback);\n }\n\n tryRun() {\n this._currentDepth++;\n try {\n while (true) {\n while (this.imports.length > 0) {\n const importItem = this.imports[0];\n if (!importItem.isReady) {\n return;\n }\n this.imports = this.imports.slice(1);\n importItem.callback.apply(null, importItem.args);\n }\n if (this.variableImports.length === 0) {\n break;\n }\n const variableImport = this.variableImports[0];\n this.variableImports = this.variableImports.slice(1);\n variableImport();\n }\n } finally {\n this._currentDepth--;\n }\n if (this._currentDepth === 0 && this._onSequencerEmpty) {\n this._onSequencerEmpty();\n }\n }\n}\n\nexport default ImportSequencer;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport contexts from '../contexts';\nimport Visitor from './visitor';\nimport ImportSequencer from './import-sequencer';\nimport * as utils from '../utils';\n\nconst ImportVisitor = function(importer, finish) {\n\n this._visitor = new Visitor(this);\n this._importer = importer;\n this._finish = finish;\n this.context = new contexts.Eval();\n this.importCount = 0;\n this.onceFileDetectionMap = {};\n this.recursionDetector = {};\n this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this));\n};\n\nImportVisitor.prototype = {\n isReplacing: false,\n run: function (root) {\n try {\n // process the contents\n this._visitor.visit(root);\n }\n catch (e) {\n this.error = e;\n }\n\n this.isFinished = true;\n this._sequencer.tryRun();\n },\n _onSequencerEmpty: function() {\n if (!this.isFinished) {\n return;\n }\n this._finish(this.error);\n },\n visitImport: function (importNode, visitArgs) {\n const inlineCSS = importNode.options.inline;\n\n if (!importNode.css || inlineCSS) {\n\n const context = new contexts.Eval(this.context, utils.copyArray(this.context.frames));\n const importParent = context.frames[0];\n\n this.importCount++;\n if (importNode.isVariableImport()) {\n this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent));\n } else {\n this.processImportNode(importNode, context, importParent);\n }\n }\n visitArgs.visitDeeper = false;\n },\n processImportNode: function(importNode, context, importParent) {\n let evaldImportNode;\n const inlineCSS = importNode.options.inline;\n\n try {\n evaldImportNode = importNode.evalForImport(context);\n } catch (e) {\n if (!e.filename) { e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename; }\n // attempt to eval properly and treat as css\n importNode.css = true;\n // if that fails, this error will be thrown\n importNode.error = e;\n }\n\n if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) {\n\n if (evaldImportNode.options.multiple) {\n context.importMultiple = true;\n }\n\n // try appending if we haven't determined if it is css or not\n const tryAppendLessExtension = evaldImportNode.css === undefined;\n\n for (let i = 0; i < importParent.rules.length; i++) {\n if (importParent.rules[i] === importNode) {\n importParent.rules[i] = evaldImportNode;\n break;\n }\n }\n\n const onImported = this.onImported.bind(this, evaldImportNode, context), sequencedOnImported = this._sequencer.addImport(onImported);\n\n this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(),\n evaldImportNode.options, sequencedOnImported);\n } else {\n this.importCount--;\n if (this.isFinished) {\n this._sequencer.tryRun();\n }\n }\n },\n onImported: function (importNode, context, e, root, importedAtRoot, fullPath) {\n if (e) {\n if (!e.filename) {\n e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename;\n }\n this.error = e;\n }\n\n const importVisitor = this,\n inlineCSS = importNode.options.inline,\n isPlugin = importNode.options.isPlugin,\n isOptional = importNode.options.optional,\n duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector;\n\n if (!context.importMultiple) {\n if (duplicateImport) {\n importNode.skip = true;\n } else {\n importNode.skip = function() {\n if (fullPath in importVisitor.onceFileDetectionMap) {\n return true;\n }\n importVisitor.onceFileDetectionMap[fullPath] = true;\n return false;\n };\n }\n }\n\n if (!fullPath && isOptional) {\n importNode.skip = true;\n }\n\n if (root) {\n importNode.root = root;\n importNode.importedFilename = fullPath;\n\n if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) {\n importVisitor.recursionDetector[fullPath] = true;\n\n const oldContext = this.context;\n this.context = context;\n try {\n this._visitor.visit(root);\n } catch (e) {\n this.error = e;\n }\n this.context = oldContext;\n }\n }\n\n importVisitor.importCount--;\n\n if (importVisitor.isFinished) {\n importVisitor._sequencer.tryRun();\n }\n },\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.unshift(declNode);\n } else {\n visitArgs.visitDeeper = false;\n }\n },\n visitDeclarationOut: function(declNode) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.shift();\n }\n },\n visitAtRule: function (atRuleNode, visitArgs) {\n this.context.frames.unshift(atRuleNode);\n },\n visitAtRuleOut: function (atRuleNode) {\n this.context.frames.shift();\n },\n visitMixinDefinition: function (mixinDefinitionNode, visitArgs) {\n this.context.frames.unshift(mixinDefinitionNode);\n },\n visitMixinDefinitionOut: function (mixinDefinitionNode) {\n this.context.frames.shift();\n },\n visitRuleset: function (rulesetNode, visitArgs) {\n this.context.frames.unshift(rulesetNode);\n },\n visitRulesetOut: function (rulesetNode) {\n this.context.frames.shift();\n },\n visitMedia: function (mediaNode, visitArgs) {\n this.context.frames.unshift(mediaNode.rules[0]);\n },\n visitMediaOut: function (mediaNode) {\n this.context.frames.shift();\n }\n};\nexport default ImportVisitor;\n","class SetTreeVisibilityVisitor {\n constructor(visible) {\n this.visible = visible;\n }\n\n run(root) {\n this.visit(root);\n }\n\n visitArray(nodes) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n if (node.constructor === Array) {\n return this.visitArray(node);\n }\n\n if (!node.blocksVisibility || node.blocksVisibility()) {\n return node;\n }\n if (this.visible) {\n node.ensureVisibility();\n } else {\n node.ensureInvisibility();\n }\n\n node.accept(this);\n return node;\n }\n}\n\nexport default SetTreeVisibilityVisitor;","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport tree from '../tree';\nimport Visitor from './visitor';\nimport logger from '../logger';\nimport * as utils from '../utils';\n\n/* jshint loopfunc:true */\n\nclass ExtendFinderVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n this.contexts = [];\n this.allExtendsStack = [[]];\n }\n\n run(root) {\n root = this._visitor.visit(root);\n root.allExtends = this.allExtendsStack[0];\n return root;\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n\n let i;\n let j;\n let extend;\n const allSelectorsExtendList = [];\n let extendList;\n\n // get &:extend(.a); rules which apply to all selectors in this ruleset\n const rules = rulesetNode.rules, ruleCnt = rules ? rules.length : 0;\n for (i = 0; i < ruleCnt; i++) {\n if (rulesetNode.rules[i] instanceof tree.Extend) {\n allSelectorsExtendList.push(rules[i]);\n rulesetNode.extendOnEveryPath = true;\n }\n }\n\n // now find every selector and apply the extends that apply to all extends\n // and the ones which apply to an individual extend\n const paths = rulesetNode.paths;\n for (i = 0; i < paths.length; i++) {\n const selectorPath = paths[i], selector = selectorPath[selectorPath.length - 1], selExtendList = selector.extendList;\n\n extendList = selExtendList ? utils.copyArray(selExtendList).concat(allSelectorsExtendList)\n : allSelectorsExtendList;\n\n if (extendList) {\n extendList = extendList.map(function(allSelectorsExtend) {\n return allSelectorsExtend.clone();\n });\n }\n\n for (j = 0; j < extendList.length; j++) {\n this.foundExtends = true;\n extend = extendList[j];\n extend.findSelfSelectors(selectorPath);\n extend.ruleset = rulesetNode;\n if (j === 0) { extend.firstExtendOnThisSelectorPath = true; }\n this.allExtendsStack[this.allExtendsStack.length - 1].push(extend);\n }\n }\n\n this.contexts.push(rulesetNode.selectors);\n }\n\n visitRulesetOut(rulesetNode) {\n if (!rulesetNode.root) {\n this.contexts.length = this.contexts.length - 1;\n }\n }\n\n visitMedia(mediaNode, visitArgs) {\n mediaNode.allExtends = [];\n this.allExtendsStack.push(mediaNode.allExtends);\n }\n\n visitMediaOut(mediaNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n atRuleNode.allExtends = [];\n this.allExtendsStack.push(atRuleNode.allExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n}\n\nclass ProcessExtendsVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n const extendFinder = new ExtendFinderVisitor();\n this.extendIndices = {};\n extendFinder.run(root);\n if (!extendFinder.foundExtends) { return root; }\n root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends));\n this.allExtendsStack = [root.allExtends];\n const newRoot = this._visitor.visit(root);\n this.checkExtendsForNonMatched(root.allExtends);\n return newRoot;\n }\n\n checkExtendsForNonMatched(extendList) {\n const indices = this.extendIndices;\n extendList.filter(function(extend) {\n return !extend.hasFoundMatches && extend.parent_ids.length == 1;\n }).forEach(function(extend) {\n let selector = '_unknown_';\n try {\n selector = extend.selector.toCSS({});\n }\n catch (_) {}\n\n if (!indices[`${extend.index} ${selector}`]) {\n indices[`${extend.index} ${selector}`] = true;\n logger.warn(`extend '${selector}' has no matches`);\n }\n });\n }\n\n doExtendChaining(extendsList, extendsListTarget, iterationCount) {\n //\n // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering\n // and pasting the selector we would do normally, but we are also adding an extend with the same target selector\n // this means this new extend can then go and alter other extends\n //\n // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors\n // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already\n // processed if we look at each selector at a time, as is done in visitRuleset\n\n let extendIndex;\n\n let targetExtendIndex;\n let matches;\n const extendsToAdd = [];\n let newSelector;\n const extendVisitor = this;\n let selectorPath;\n let extend;\n let targetExtend;\n let newExtend;\n\n iterationCount = iterationCount || 0;\n\n // loop through comparing every extend with every target extend.\n // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place\n // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one\n // and the second is the target.\n // the separation into two lists allows us to process a subset of chains with a bigger set, as is the\n // case when processing media queries\n for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) {\n for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) {\n\n extend = extendsList[extendIndex];\n targetExtend = extendsListTarget[targetExtendIndex];\n\n // look for circular references\n if ( extend.parent_ids.indexOf( targetExtend.object_id ) >= 0 ) { continue; }\n\n // find a match in the target extends self selector (the bit before :extend)\n selectorPath = [targetExtend.selfSelectors[0]];\n matches = extendVisitor.findMatch(extend, selectorPath);\n\n if (matches.length) {\n extend.hasFoundMatches = true;\n\n // we found a match, so for each self selector..\n extend.selfSelectors.forEach(function(selfSelector) {\n const info = targetExtend.visibilityInfo();\n\n // process the extend as usual\n newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible());\n\n // but now we create a new extend from it\n newExtend = new(tree.Extend)(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info);\n newExtend.selfSelectors = newSelector;\n\n // add the extend onto the list of extends for that selector\n newSelector[newSelector.length - 1].extendList = [newExtend];\n\n // record that we need to add it.\n extendsToAdd.push(newExtend);\n newExtend.ruleset = targetExtend.ruleset;\n\n // remember its parents for circular references\n newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids);\n\n // only process the selector once.. if we have :extend(.a,.b) then multiple\n // extends will look at the same selector path, so when extending\n // we know that any others will be duplicates in terms of what is added to the css\n if (targetExtend.firstExtendOnThisSelectorPath) {\n newExtend.firstExtendOnThisSelectorPath = true;\n targetExtend.ruleset.paths.push(newSelector);\n }\n });\n }\n }\n }\n\n if (extendsToAdd.length) {\n // try to detect circular references to stop a stack overflow.\n // may no longer be needed.\n this.extendChainCount++;\n if (iterationCount > 100) {\n let selectorOne = '{unable to calculate}';\n let selectorTwo = '{unable to calculate}';\n try {\n selectorOne = extendsToAdd[0].selfSelectors[0].toCSS();\n selectorTwo = extendsToAdd[0].selector.toCSS();\n }\n catch (e) {}\n throw { message: `extend circular reference detected. One of the circular extends is currently:${selectorOne}:extend(${selectorTwo})`};\n }\n\n // now process the new extends on the existing rules so that we can handle a extending b extending c extending\n // d extending e...\n return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1));\n } else {\n return extendsToAdd;\n }\n }\n\n visitDeclaration(ruleNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitSelector(selectorNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n let matches;\n let pathIndex;\n let extendIndex;\n const allExtends = this.allExtendsStack[this.allExtendsStack.length - 1];\n const selectorsToAdd = [];\n const extendVisitor = this;\n let selectorPath;\n\n // look at each selector path in the ruleset, find any extend matches and then copy, find and replace\n\n for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) {\n for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) {\n selectorPath = rulesetNode.paths[pathIndex];\n\n // extending extends happens initially, before the main pass\n if (rulesetNode.extendOnEveryPath) { continue; }\n const extendList = selectorPath[selectorPath.length - 1].extendList;\n if (extendList && extendList.length) { continue; }\n\n matches = this.findMatch(allExtends[extendIndex], selectorPath);\n\n if (matches.length) {\n allExtends[extendIndex].hasFoundMatches = true;\n\n allExtends[extendIndex].selfSelectors.forEach(function(selfSelector) {\n let extendedSelectors;\n extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible());\n selectorsToAdd.push(extendedSelectors);\n });\n }\n }\n }\n rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd);\n }\n\n findMatch(extend, haystackSelectorPath) {\n //\n // look through the haystack selector path to try and find the needle - extend.selector\n // returns an array of selector matches that can then be replaced\n //\n let haystackSelectorIndex;\n\n let hackstackSelector;\n let hackstackElementIndex;\n let haystackElement;\n let targetCombinator;\n let i;\n const extendVisitor = this;\n const needleElements = extend.selector.elements;\n const potentialMatches = [];\n let potentialMatch;\n const matches = [];\n\n // loop through the haystack elements\n for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) {\n hackstackSelector = haystackSelectorPath[haystackSelectorIndex];\n\n for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) {\n\n haystackElement = hackstackSelector.elements[hackstackElementIndex];\n\n // if we allow elements before our match we can add a potential match every time. otherwise only at the first element.\n if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) {\n potentialMatches.push({pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0,\n initialCombinator: haystackElement.combinator});\n }\n\n for (i = 0; i < potentialMatches.length; i++) {\n potentialMatch = potentialMatches[i];\n\n // selectors add \" \" onto the first element. When we use & it joins the selectors together, but if we don't\n // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to\n // work out what the resulting combinator will be\n targetCombinator = haystackElement.combinator.value;\n if (targetCombinator === '' && hackstackElementIndex === 0) {\n targetCombinator = ' ';\n }\n\n // if we don't match, null our match to indicate failure\n if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) ||\n (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) {\n potentialMatch = null;\n } else {\n potentialMatch.matched++;\n }\n\n // if we are still valid and have finished, test whether we have elements after and whether these are allowed\n if (potentialMatch) {\n potentialMatch.finished = potentialMatch.matched === needleElements.length;\n if (potentialMatch.finished &&\n (!extend.allowAfter &&\n (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) {\n potentialMatch = null;\n }\n }\n // if null we remove, if not, we are still valid, so either push as a valid match or continue\n if (potentialMatch) {\n if (potentialMatch.finished) {\n potentialMatch.length = needleElements.length;\n potentialMatch.endPathIndex = haystackSelectorIndex;\n potentialMatch.endPathElementIndex = hackstackElementIndex + 1; // index after end of match\n potentialMatches.length = 0; // we don't allow matches to overlap, so start matching again\n matches.push(potentialMatch);\n }\n } else {\n potentialMatches.splice(i, 1);\n i--;\n }\n }\n }\n }\n return matches;\n }\n\n isElementValuesEqual(elementValue1, elementValue2) {\n if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') {\n return elementValue1 === elementValue2;\n }\n if (elementValue1 instanceof tree.Attribute) {\n if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) {\n return false;\n }\n if (!elementValue1.value || !elementValue2.value) {\n if (elementValue1.value || elementValue2.value) {\n return false;\n }\n return true;\n }\n elementValue1 = elementValue1.value.value || elementValue1.value;\n elementValue2 = elementValue2.value.value || elementValue2.value;\n return elementValue1 === elementValue2;\n }\n elementValue1 = elementValue1.value;\n elementValue2 = elementValue2.value;\n if (elementValue1 instanceof tree.Selector) {\n if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) {\n return false;\n }\n for (let i = 0; i < elementValue1.elements.length; i++) {\n if (elementValue1.elements[i].combinator.value !== elementValue2.elements[i].combinator.value) {\n if (i !== 0 || (elementValue1.elements[i].combinator.value || ' ') !== (elementValue2.elements[i].combinator.value || ' ')) {\n return false;\n }\n }\n if (!this.isElementValuesEqual(elementValue1.elements[i].value, elementValue2.elements[i].value)) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n\n extendSelector(matches, selectorPath, replacementSelector, isVisible) {\n\n // for a set of matches, replace each match with the replacement selector\n\n let currentSelectorPathIndex = 0, currentSelectorPathElementIndex = 0, path = [], matchIndex, selector, firstElement, match, newElements;\n\n for (matchIndex = 0; matchIndex < matches.length; matchIndex++) {\n match = matches[matchIndex];\n selector = selectorPath[match.pathIndex];\n firstElement = new tree.Element(\n match.initialCombinator,\n replacementSelector.elements[0].value,\n replacementSelector.elements[0].isVariable,\n replacementSelector.elements[0].getIndex(),\n replacementSelector.elements[0].fileInfo()\n );\n\n if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n\n newElements = selector.elements\n .slice(currentSelectorPathElementIndex, match.index)\n .concat([firstElement])\n .concat(replacementSelector.elements.slice(1));\n\n if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) {\n path[path.length - 1].elements =\n path[path.length - 1].elements.concat(newElements);\n } else {\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex));\n\n path.push(new tree.Selector(\n newElements\n ));\n }\n currentSelectorPathIndex = match.endPathIndex;\n currentSelectorPathElementIndex = match.endPathElementIndex;\n if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) {\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n }\n\n if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathIndex++;\n }\n\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length));\n path = path.map(function (currentValue) {\n // we can re-use elements here, because the visibility property matters only for selectors\n const derived = currentValue.createDerived(currentValue.elements);\n if (isVisible) {\n derived.ensureVisibility();\n } else {\n derived.ensureInvisibility();\n }\n return derived;\n });\n return path;\n }\n\n visitMedia(mediaNode, visitArgs) {\n let newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitMediaOut(mediaNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n let newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n}\n\nexport default ProcessExtendsVisitor;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport Visitor from './visitor';\n\nclass JoinSelectorVisitor {\n constructor() {\n this.contexts = [[]];\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n return this._visitor.visit(root);\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n const paths = [];\n let selectors;\n\n this.contexts.push(paths);\n\n if (!rulesetNode.root) {\n selectors = rulesetNode.selectors;\n if (selectors) {\n selectors = selectors.filter(function(selector) { return selector.getIsOutput(); });\n rulesetNode.selectors = selectors.length ? selectors : (selectors = null);\n if (selectors) { rulesetNode.joinSelectors(paths, context, selectors); }\n }\n if (!selectors) { rulesetNode.rules = null; }\n rulesetNode.paths = paths;\n }\n }\n\n visitRulesetOut(rulesetNode) {\n this.contexts.length = this.contexts.length - 1;\n }\n\n visitMedia(mediaNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia);\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n if (atRuleNode.rules && atRuleNode.rules.length) {\n atRuleNode.rules[0].root = (atRuleNode.isRooted || context.length === 0 || null);\n }\n }\n}\n\nexport default JoinSelectorVisitor;\n","/* eslint-disable no-unused-vars */\n/**\n * @todo - Remove unused when JSDoc types are added for visitor methods\n */\nimport tree from '../tree';\nimport Visitor from './visitor';\n\nclass CSSVisitorUtils {\n constructor(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n }\n\n containsSilentNonBlockedChild(bodyRules) {\n let rule;\n if (!bodyRules) {\n return false;\n }\n for (let r = 0; r < bodyRules.length; r++) {\n rule = bodyRules[r];\n if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) {\n // the atrule contains something that was referenced (likely by extend)\n // therefore it needs to be shown in output too\n return true;\n }\n }\n return false;\n }\n\n keepOnlyVisibleChilds(owner) {\n if (owner && owner.rules) {\n owner.rules = owner.rules.filter(thing => thing.isVisible());\n }\n }\n\n isEmpty(owner) {\n return (owner && owner.rules) \n ? (owner.rules.length === 0) : true;\n }\n\n hasVisibleSelector(rulesetNode) {\n return (rulesetNode && rulesetNode.paths)\n ? (rulesetNode.paths.length > 0) : false;\n }\n\n resolveVisibility(node) {\n if (!node.blocksVisibility()) {\n if (this.isEmpty(node)) {\n return ;\n }\n\n return node;\n }\n\n const compiledRulesBody = node.rules[0];\n this.keepOnlyVisibleChilds(compiledRulesBody);\n\n if (this.isEmpty(compiledRulesBody)) {\n return ;\n }\n\n node.ensureVisibility();\n node.removeVisibilityBlock();\n\n return node;\n }\n\n isVisibleRuleset(rulesetNode) {\n if (rulesetNode.firstRoot) {\n return true;\n }\n\n if (this.isEmpty(rulesetNode)) {\n return false;\n }\n\n if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) {\n return false;\n }\n\n return true;\n }\n}\n\nconst ToCSSVisitor = function(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n this.utils = new CSSVisitorUtils(context);\n};\n\nToCSSVisitor.prototype = {\n isReplacing: true,\n run: function (root) {\n return this._visitor.visit(root);\n },\n\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.blocksVisibility() || declNode.variable) {\n return;\n }\n return declNode;\n },\n\n visitMixinDefinition: function (mixinNode, visitArgs) {\n // mixin definitions do not get eval'd - this means they keep state\n // so we have to clear that state here so it isn't used if toCSS is called twice\n mixinNode.frames = [];\n },\n\n visitExtend: function (extendNode, visitArgs) {\n },\n\n visitComment: function (commentNode, visitArgs) {\n if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) {\n return;\n }\n return commentNode;\n },\n\n visitMedia: function(mediaNode, visitArgs) {\n const originalRules = mediaNode.rules[0].rules;\n mediaNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n return this.utils.resolveVisibility(mediaNode, originalRules);\n },\n\n visitImport: function (importNode, visitArgs) {\n if (importNode.blocksVisibility()) {\n return ;\n }\n return importNode;\n },\n\n visitAtRule: function(atRuleNode, visitArgs) {\n if (atRuleNode.rules && atRuleNode.rules.length) {\n return this.visitAtRuleWithBody(atRuleNode, visitArgs);\n } else {\n return this.visitAtRuleWithoutBody(atRuleNode, visitArgs);\n }\n },\n\n visitAnonymous: function(anonymousNode, visitArgs) {\n if (!anonymousNode.blocksVisibility()) {\n anonymousNode.accept(this._visitor);\n return anonymousNode;\n }\n },\n\n visitAtRuleWithBody: function(atRuleNode, visitArgs) {\n // if there is only one nested ruleset and that one has no path, then it is\n // just fake ruleset\n function hasFakeRuleset(atRuleNode) {\n const bodyRules = atRuleNode.rules;\n return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0);\n }\n function getBodyRules(atRuleNode) {\n const nodeRules = atRuleNode.rules;\n if (hasFakeRuleset(atRuleNode)) {\n return nodeRules[0].rules;\n }\n\n return nodeRules;\n }\n // it is still true that it is only one ruleset in array\n // this is last such moment\n // process childs\n const originalRules = getBodyRules(atRuleNode);\n atRuleNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n if (!this.utils.isEmpty(atRuleNode)) {\n this._mergeRules(atRuleNode.rules[0].rules);\n }\n\n return this.utils.resolveVisibility(atRuleNode, originalRules);\n },\n\n visitAtRuleWithoutBody: function(atRuleNode, visitArgs) {\n if (atRuleNode.blocksVisibility()) {\n return;\n }\n\n if (atRuleNode.name === '@charset') {\n // Only output the debug info together with subsequent @charset definitions\n // a comment (or @media statement) before the actual @charset atrule would\n // be considered illegal css as it has to be on the first line\n if (this.charset) {\n if (atRuleNode.debugInfo) {\n const comment = new tree.Comment(`/* ${atRuleNode.toCSS(this._context).replace(/\\n/g, '')} */\\n`);\n comment.debugInfo = atRuleNode.debugInfo;\n return this._visitor.visit(comment);\n }\n return;\n }\n this.charset = true;\n }\n\n return atRuleNode;\n },\n\n checkValidNodes: function(rules, isRoot) {\n if (!rules) {\n return;\n }\n\n for (let i = 0; i < rules.length; i++) {\n const ruleNode = rules[i];\n if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) {\n throw { message: 'Properties must be inside selector blocks. They cannot be in the root',\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode instanceof tree.Call) {\n throw { message: `Function '${ruleNode.name}' did not return a root node`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode.type && !ruleNode.allowRoot) {\n throw { message: `${ruleNode.type} node returned by a function is not valid here`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n }\n },\n\n visitRuleset: function (rulesetNode, visitArgs) {\n // at this point rulesets are nested into each other\n let rule;\n\n const rulesets = [];\n\n this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot);\n\n if (!rulesetNode.root) {\n // remove invisible paths\n this._compileRulesetPaths(rulesetNode);\n\n // remove rulesets from this ruleset body and compile them separately\n const nodeRules = rulesetNode.rules;\n\n let nodeRuleCnt = nodeRules ? nodeRules.length : 0;\n for (let i = 0; i < nodeRuleCnt; ) {\n rule = nodeRules[i];\n if (rule && rule.rules) {\n // visit because we are moving them out from being a child\n rulesets.push(this._visitor.visit(rule));\n nodeRules.splice(i, 1);\n nodeRuleCnt--;\n continue;\n }\n i++;\n }\n // accept the visitor to remove rules and refactor itself\n // then we can decide nogw whether we want it or not\n // compile body\n if (nodeRuleCnt > 0) {\n rulesetNode.accept(this._visitor);\n } else {\n rulesetNode.rules = null;\n }\n visitArgs.visitDeeper = false;\n } else { // if (! rulesetNode.root) {\n rulesetNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n }\n\n if (rulesetNode.rules) {\n this._mergeRules(rulesetNode.rules);\n this._removeDuplicateRules(rulesetNode.rules);\n }\n\n // now decide whether we keep the ruleset\n if (this.utils.isVisibleRuleset(rulesetNode)) {\n rulesetNode.ensureVisibility();\n rulesets.splice(0, 0, rulesetNode);\n }\n\n if (rulesets.length === 1) {\n return rulesets[0];\n }\n return rulesets;\n },\n\n _compileRulesetPaths: function(rulesetNode) {\n if (rulesetNode.paths) {\n rulesetNode.paths = rulesetNode.paths\n .filter(p => {\n let i;\n if (p[0].elements[0].combinator.value === ' ') {\n p[0].elements[0].combinator = new(tree.Combinator)('');\n }\n for (i = 0; i < p.length; i++) {\n if (p[i].isVisible() && p[i].getIsOutput()) {\n return true;\n }\n }\n return false;\n });\n }\n },\n\n _removeDuplicateRules: function(rules) {\n if (!rules) { return; }\n\n // remove duplicates\n const ruleCache = {};\n\n let ruleList;\n let rule;\n let i;\n\n for (i = rules.length - 1; i >= 0 ; i--) {\n rule = rules[i];\n if (rule instanceof tree.Declaration) {\n if (!ruleCache[rule.name]) {\n ruleCache[rule.name] = rule;\n } else {\n ruleList = ruleCache[rule.name];\n if (ruleList instanceof tree.Declaration) {\n ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)];\n }\n const ruleCSS = rule.toCSS(this._context);\n if (ruleList.indexOf(ruleCSS) !== -1) {\n rules.splice(i, 1);\n } else {\n ruleList.push(ruleCSS);\n }\n }\n }\n }\n },\n\n _mergeRules: function(rules) {\n if (!rules) {\n return; \n }\n\n const groups = {};\n const groupsArr = [];\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n if (rule.merge) {\n const key = rule.name;\n groups[key] ? rules.splice(i--, 1) : \n groupsArr.push(groups[key] = []);\n groups[key].push(rule);\n }\n }\n\n groupsArr.forEach(group => {\n if (group.length > 0) {\n const result = group[0];\n let space = [];\n const comma = [new tree.Expression(space)];\n group.forEach(rule => {\n if ((rule.merge === '+') && (space.length > 0)) {\n comma.push(new tree.Expression(space = []));\n }\n space.push(rule.value);\n result.important = result.important || rule.important;\n });\n result.value = new tree.Value(comma);\n }\n });\n }\n};\n\nexport default ToCSSVisitor;\n","import Visitor from './visitor';\nimport ImportVisitor from './import-visitor';\nimport MarkVisibleSelectorsVisitor from './set-tree-visibility-visitor';\nimport ExtendVisitor from './extend-visitor';\nimport JoinSelectorVisitor from './join-selector-visitor';\nimport ToCSSVisitor from './to-css-visitor';\n\nexport default {\n Visitor,\n ImportVisitor,\n MarkVisibleSelectorsVisitor,\n ExtendVisitor,\n JoinSelectorVisitor,\n ToCSSVisitor\n};\n","import chunker from './chunker';\n\nexport default () => {\n let // Less input string\n input;\n\n let // current chunk\n j;\n\n const // holds state for backtracking\n saveStack = [];\n\n let // furthest index the parser has gone to\n furthest;\n\n let // if this is furthest we got to, this is the probably cause\n furthestPossibleErrorMessage;\n\n let // chunkified input\n chunks;\n\n let // current chunk\n current;\n\n let // index of current chunk, in `input`\n currentPos;\n\n const parserInput = {};\n const CHARCODE_SPACE = 32;\n const CHARCODE_TAB = 9;\n const CHARCODE_LF = 10;\n const CHARCODE_CR = 13;\n const CHARCODE_PLUS = 43;\n const CHARCODE_COMMA = 44;\n const CHARCODE_FORWARD_SLASH = 47;\n const CHARCODE_9 = 57;\n\n function skipWhitespace(length) {\n const oldi = parserInput.i;\n const oldj = j;\n const curr = parserInput.i - currentPos;\n const endIndex = parserInput.i + current.length - curr;\n const mem = (parserInput.i += length);\n const inp = input;\n let c;\n let nextChar;\n let comment;\n\n for (; parserInput.i < endIndex; parserInput.i++) {\n c = inp.charCodeAt(parserInput.i);\n\n if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) {\n nextChar = inp.charAt(parserInput.i + 1);\n if (nextChar === '/') {\n comment = {index: parserInput.i, isLineComment: true};\n let nextNewLine = inp.indexOf('\\n', parserInput.i + 2);\n if (nextNewLine < 0) {\n nextNewLine = endIndex;\n }\n parserInput.i = nextNewLine;\n comment.text = inp.substr(comment.index, parserInput.i - comment.index);\n parserInput.commentStore.push(comment);\n continue;\n } else if (nextChar === '*') {\n const nextStarSlash = inp.indexOf('*/', parserInput.i + 2);\n if (nextStarSlash >= 0) {\n comment = {\n index: parserInput.i,\n text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i),\n isLineComment: false\n };\n parserInput.i += comment.text.length - 1;\n parserInput.commentStore.push(comment);\n continue;\n }\n }\n break;\n }\n\n if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) {\n break;\n }\n }\n\n current = current.slice(length + parserInput.i - mem + curr);\n currentPos = parserInput.i;\n\n if (!current.length) {\n if (j < chunks.length - 1) {\n current = chunks[++j];\n skipWhitespace(0); // skip space at the beginning of a chunk\n return true; // things changed\n }\n parserInput.finished = true;\n }\n\n return oldi !== parserInput.i || oldj !== j;\n }\n\n parserInput.save = () => {\n currentPos = parserInput.i;\n saveStack.push( { current, i: parserInput.i, j });\n };\n parserInput.restore = possibleErrorMessage => {\n\n if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) {\n furthest = parserInput.i;\n furthestPossibleErrorMessage = possibleErrorMessage;\n }\n const state = saveStack.pop();\n current = state.current;\n currentPos = parserInput.i = state.i;\n j = state.j;\n };\n parserInput.forget = () => {\n saveStack.pop();\n };\n parserInput.isWhitespace = offset => {\n const pos = parserInput.i + (offset || 0);\n const code = input.charCodeAt(pos);\n return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF);\n };\n\n // Specialization of $(tok)\n parserInput.$re = tok => {\n if (parserInput.i > currentPos) {\n current = current.slice(parserInput.i - currentPos);\n currentPos = parserInput.i;\n }\n\n const m = tok.exec(current);\n if (!m) {\n return null;\n }\n\n skipWhitespace(m[0].length);\n if (typeof m === 'string') {\n return m;\n }\n\n return m.length === 1 ? m[0] : m;\n };\n\n parserInput.$char = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n skipWhitespace(1);\n return tok;\n };\n\n parserInput.$peekChar = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n return tok;\n };\n\n parserInput.$str = tok => {\n const tokLength = tok.length;\n\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tokLength; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return null;\n }\n }\n\n skipWhitespace(tokLength);\n return tok;\n };\n\n parserInput.$quoted = loc => {\n const pos = loc || parserInput.i;\n const startChar = input.charAt(pos);\n\n if (startChar !== '\\'' && startChar !== '\"') {\n return;\n }\n const length = input.length;\n const currentPosition = pos;\n\n for (let i = 1; i + currentPosition < length; i++) {\n const nextChar = input.charAt(i + currentPosition);\n switch (nextChar) {\n case '\\\\':\n i++;\n continue;\n case '\\r':\n case '\\n':\n break;\n case startChar: {\n const str = input.substr(currentPosition, i + 1);\n if (!loc && loc !== 0) {\n skipWhitespace(i + 1);\n return str\n }\n return [startChar, str];\n }\n default:\n }\n }\n return null;\n };\n\n /**\n * Permissive parsing. Ignores everything except matching {} [] () and quotes\n * until matching token (outside of blocks)\n */\n parserInput.$parseUntil = tok => {\n let quote = '';\n let returnVal = null;\n let inComment = false;\n let blockDepth = 0;\n const blockStack = [];\n const parseGroups = [];\n const length = input.length;\n const startPos = parserInput.i;\n let lastPos = parserInput.i;\n let i = parserInput.i;\n let loop = true;\n let testChar;\n\n if (typeof tok === 'string') {\n testChar = char => char === tok\n } else {\n testChar = char => tok.test(char)\n }\n\n do {\n let nextChar = input.charAt(i);\n if (blockDepth === 0 && testChar(nextChar)) {\n returnVal = input.substr(lastPos, i - lastPos);\n if (returnVal) {\n parseGroups.push(returnVal);\n }\n else {\n parseGroups.push(' ');\n }\n returnVal = parseGroups;\n skipWhitespace(i - startPos);\n loop = false\n } else {\n if (inComment) {\n if (nextChar === '*' && \n input.charAt(i + 1) === '/') {\n i++;\n blockDepth--;\n inComment = false;\n }\n i++;\n continue;\n }\n switch (nextChar) {\n case '\\\\':\n i++;\n nextChar = input.charAt(i);\n parseGroups.push(input.substr(lastPos, i - lastPos + 1));\n lastPos = i + 1;\n break;\n case '/':\n if (input.charAt(i + 1) === '*') {\n i++;\n inComment = true;\n blockDepth++;\n }\n break;\n case '\\'':\n case '\"':\n quote = parserInput.$quoted(i);\n if (quote) {\n parseGroups.push(input.substr(lastPos, i - lastPos), quote);\n i += quote[1].length - 1;\n lastPos = i + 1;\n }\n else {\n skipWhitespace(i - startPos);\n returnVal = nextChar;\n loop = false;\n }\n break;\n case '{':\n blockStack.push('}');\n blockDepth++;\n break;\n case '(':\n blockStack.push(')');\n blockDepth++;\n break;\n case '[':\n blockStack.push(']');\n blockDepth++;\n break;\n case '}':\n case ')':\n case ']': {\n const expected = blockStack.pop();\n if (nextChar === expected) {\n blockDepth--;\n } else {\n // move the parser to the error and return expected\n skipWhitespace(i - startPos);\n returnVal = expected;\n loop = false;\n }\n }\n }\n i++;\n if (i > length) {\n loop = false;\n }\n }\n } while (loop);\n\n return returnVal ? returnVal : null;\n }\n\n parserInput.autoCommentAbsorb = true;\n parserInput.commentStore = [];\n parserInput.finished = false;\n\n // Same as $(), but don't change the state of the parser,\n // just return the match.\n parserInput.peek = tok => {\n if (typeof tok === 'string') {\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tok.length; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return false;\n }\n }\n return true;\n } else {\n return tok.test(current);\n }\n };\n\n // Specialization of peek()\n // TODO remove or change some currentChar calls to peekChar\n parserInput.peekChar = tok => input.charAt(parserInput.i) === tok;\n\n parserInput.currentChar = () => input.charAt(parserInput.i);\n\n parserInput.prevChar = () => input.charAt(parserInput.i - 1);\n\n parserInput.getInput = () => input;\n\n parserInput.peekNotNumeric = () => {\n const c = input.charCodeAt(parserInput.i);\n // Is the first char of the dimension 0-9, '.', '+' or '-'\n return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA;\n };\n\n parserInput.start = (str, chunkInput, failFunction) => {\n input = str;\n parserInput.i = j = currentPos = furthest = 0;\n\n // chunking apparently makes things quicker (but my tests indicate\n // it might actually make things slower in node at least)\n // and it is a non-perfect parse - it can't recognise\n // unquoted urls, meaning it can't distinguish comments\n // meaning comments with quotes or {}() in them get 'counted'\n // and then lead to parse errors.\n // In addition if the chunking chunks in the wrong place we might\n // not be able to parse a parser statement in one go\n // this is officially deprecated but can be switched on via an option\n // in the case it causes too much performance issues.\n if (chunkInput) {\n chunks = chunker(str, failFunction);\n } else {\n chunks = [str];\n }\n\n current = chunks[0];\n\n skipWhitespace(0);\n };\n\n parserInput.end = () => {\n let message;\n const isFinished = parserInput.i >= input.length;\n\n if (parserInput.i < furthest) {\n message = furthestPossibleErrorMessage;\n parserInput.i = furthest;\n }\n return {\n isFinished,\n furthest: parserInput.i,\n furthestPossibleErrorMessage: message,\n furthestReachedEnd: parserInput.i >= input.length - 1,\n furthestChar: input[parserInput.i]\n };\n };\n\n return parserInput;\n};\n","// Split the input into chunks.\nexport default function (input, fail) {\n const len = input.length;\n let level = 0;\n let parenLevel = 0;\n let lastOpening;\n let lastOpeningParen;\n let lastMultiComment;\n let lastMultiCommentEndBrace;\n const chunks = [];\n let emitFrom = 0;\n let chunkerCurrentIndex;\n let currentChunkStartIndex;\n let cc;\n let cc2;\n let matched;\n\n function emitChunk(force) {\n const len = chunkerCurrentIndex - emitFrom;\n if (((len < 512) && !force) || !len) {\n return;\n }\n chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1));\n emitFrom = chunkerCurrentIndex + 1;\n }\n\n for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc = input.charCodeAt(chunkerCurrentIndex);\n if (((cc >= 97) && (cc <= 122)) || (cc < 34)) {\n // a-z or whitespace\n continue;\n }\n\n switch (cc) {\n case 40: // (\n parenLevel++;\n lastOpeningParen = chunkerCurrentIndex;\n continue;\n case 41: // )\n if (--parenLevel < 0) {\n return fail('missing opening `(`', chunkerCurrentIndex);\n }\n continue;\n case 59: // ;\n if (!parenLevel) { emitChunk(); }\n continue;\n case 123: // {\n level++;\n lastOpening = chunkerCurrentIndex;\n continue;\n case 125: // }\n if (--level < 0) {\n return fail('missing opening `{`', chunkerCurrentIndex);\n }\n if (!level && !parenLevel) { emitChunk(); }\n continue;\n case 92: // \\\n if (chunkerCurrentIndex < len - 1) { chunkerCurrentIndex++; continue; }\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n case 34:\n case 39:\n case 96: // \", ' and `\n matched = 0;\n currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 > 96) { continue; }\n if (cc2 == cc) { matched = 1; break; }\n if (cc2 == 92) { // \\\n if (chunkerCurrentIndex == len - 1) {\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n }\n chunkerCurrentIndex++;\n }\n }\n if (matched) { continue; }\n return fail(`unmatched \\`${String.fromCharCode(cc)}\\``, currentChunkStartIndex);\n case 47: // /, check for comment\n if (parenLevel || (chunkerCurrentIndex == len - 1)) { continue; }\n cc2 = input.charCodeAt(chunkerCurrentIndex + 1);\n if (cc2 == 47) {\n // //, find lnfeed\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) { break; }\n }\n } else if (cc2 == 42) {\n // /*, find */\n lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 == 125) { lastMultiCommentEndBrace = chunkerCurrentIndex; }\n if (cc2 != 42) { continue; }\n if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) { break; }\n }\n if (chunkerCurrentIndex == len - 1) {\n return fail('missing closing `*/`', currentChunkStartIndex);\n }\n chunkerCurrentIndex++;\n }\n continue;\n case 42: // *, check for unmatched */\n if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) {\n return fail('unmatched `/*`', chunkerCurrentIndex);\n }\n continue;\n }\n }\n\n if (level !== 0) {\n if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) {\n return fail('missing closing `}` or `*/`', lastOpening);\n } else {\n return fail('missing closing `}`', lastOpening);\n }\n } else if (parenLevel !== 0) {\n return fail('missing closing `)`', lastOpeningParen);\n }\n\n emitChunk(true);\n return chunks;\n}\n","function makeRegistry( base ) {\n return {\n _data: {},\n add: function(name, func) {\n // precautionary case conversion, as later querying of\n // the registry by function-caller uses lower case as well.\n name = name.toLowerCase();\n\n // eslint-disable-next-line no-prototype-builtins\n if (this._data.hasOwnProperty(name)) {\n // TODO warn\n }\n this._data[name] = func;\n },\n addMultiple: function(functions) {\n Object.keys(functions).forEach(\n name => {\n this.add(name, functions[name]);\n });\n },\n get: function(name) {\n return this._data[name] || ( base && base.get( name ));\n },\n getLocalFunctions: function() {\n return this._data;\n },\n inherit: function() {\n return makeRegistry( this );\n },\n create: function(base) {\n return makeRegistry(base);\n }\n };\n}\n\nexport default makeRegistry( null );","export const MediaSyntaxOptions = {\n queryInParens: true\n};\n\nexport const ContainerSyntaxOptions = {\n queryInParens: true\n};\n","import LessError from '../less-error';\nimport tree from '../tree';\nimport visitors from '../visitors';\nimport getParserInput from './parser-input';\nimport * as utils from '../utils';\nimport functionRegistry from '../functions/function-registry';\nimport { ContainerSyntaxOptions, MediaSyntaxOptions } from '../tree/atrule-syntax';\n\n//\n// less.js - parser\n//\n// A relatively straight-forward predictive parser.\n// There is no tokenization/lexing stage, the input is parsed\n// in one sweep.\n//\n// To make the parser fast enough to run in the browser, several\n// optimization had to be made:\n//\n// - Matching and slicing on a huge input is often cause of slowdowns.\n// The solution is to chunkify the input into smaller strings.\n// The chunks are stored in the `chunks` var,\n// `j` holds the current chunk index, and `currentPos` holds\n// the index of the current chunk in relation to `input`.\n// This gives us an almost 4x speed-up.\n//\n// - In many cases, we don't need to match individual tokens;\n// for example, if a value doesn't hold any variables, operations\n// or dynamic references, the parser can effectively 'skip' it,\n// treating it as a literal.\n// An example would be '1px solid #000' - which evaluates to itself,\n// we don't need to know what the individual components are.\n// The drawback, of course is that you don't get the benefits of\n// syntax-checking on the CSS. This gives us a 50% speed-up in the parser,\n// and a smaller speed-up in the code-gen.\n//\n//\n// Token matching is done with the `$` function, which either takes\n// a terminal string or regexp, or a non-terminal function to call.\n// It also takes care of moving all the indices forwards.\n//\n\nconst Parser = function Parser(context, imports, fileInfo, currentIndex) {\n currentIndex = currentIndex || 0;\n let parsers;\n const parserInput = getParserInput();\n\n function error(msg, type) {\n throw new LessError(\n {\n index: parserInput.i,\n filename: fileInfo.filename,\n type: type || 'Syntax',\n message: msg\n },\n imports\n );\n }\n\n function expect(arg, msg) {\n // some older browsers return typeof 'function' for RegExp\n const result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg);\n if (result) {\n return result;\n }\n\n error(msg || (typeof arg === 'string'\n ? `expected '${arg}' got '${parserInput.currentChar()}'`\n : 'unexpected token'));\n }\n\n // Specialization of expect()\n function expectChar(arg, msg) {\n if (parserInput.$char(arg)) {\n return arg;\n }\n error(msg || `expected '${arg}' got '${parserInput.currentChar()}'`);\n }\n\n function getDebugInfo(index) {\n const filename = fileInfo.filename;\n\n return {\n lineNumber: utils.getLocation(index, parserInput.getInput()).line + 1,\n fileName: filename\n };\n }\n\n /**\n * Used after initial parsing to create nodes on the fly\n *\n * @param {String} str - string to parse\n * @param {Array} parseList - array of parsers to run input through e.g. [\"value\", \"important\"]\n * @param {Number} currentIndex - start number to begin indexing\n * @param {Object} fileInfo - fileInfo to attach to created nodes\n */\n function parseNode(str, parseList, callback) {\n let result;\n const returnNodes = [];\n const parser = parserInput;\n\n try {\n parser.start(str, false, function fail(msg, index) {\n callback({\n message: msg,\n index: index + currentIndex\n });\n });\n for (let x = 0, p; (p = parseList[x]); x++) {\n result = parsers[p]();\n returnNodes.push(result || null);\n }\n\n const endInfo = parser.end();\n if (endInfo.isFinished) {\n callback(null, returnNodes);\n }\n else {\n callback(true, null);\n }\n } catch (e) {\n throw new LessError({\n index: e.index + currentIndex,\n message: e.message\n }, imports, fileInfo.filename);\n }\n }\n\n //\n // The Parser\n //\n return {\n parserInput,\n imports,\n fileInfo,\n parseNode,\n //\n // Parse an input string into an abstract syntax tree,\n // @param str A string containing 'less' markup\n // @param callback call `callback` when done.\n // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply\n //\n parse: function (str, callback, additionalData) {\n let root;\n let err = null;\n let globalVars;\n let modifyVars;\n let ignored;\n let preText = '';\n\n // Optionally disable @plugin parsing\n if (additionalData && additionalData.disablePluginRule) {\n parsers.plugin = function() {\n var dir = parserInput.$re(/^@plugin?\\s+/);\n if (dir) {\n error('@plugin statements are not allowed when disablePluginRule is set to true');\n }\n }\n }\n\n globalVars = (additionalData && additionalData.globalVars) ? `${Parser.serializeVars(additionalData.globalVars)}\\n` : '';\n modifyVars = (additionalData && additionalData.modifyVars) ? `\\n${Parser.serializeVars(additionalData.modifyVars)}` : '';\n\n if (context.pluginManager) {\n const preProcessors = context.pluginManager.getPreProcessors();\n for (let i = 0; i < preProcessors.length; i++) {\n str = preProcessors[i].process(str, { context, imports, fileInfo });\n }\n }\n\n if (globalVars || (additionalData && additionalData.banner)) {\n preText = ((additionalData && additionalData.banner) ? additionalData.banner : '') + globalVars;\n ignored = imports.contentsIgnoredChars;\n ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0;\n ignored[fileInfo.filename] += preText.length;\n }\n\n str = str.replace(/\\r\\n?/g, '\\n');\n // Remove potential UTF Byte Order Mark\n str = preText + str.replace(/^\\uFEFF/, '') + modifyVars;\n imports.contents[fileInfo.filename] = str;\n\n // Start with the primary rule.\n // The whole syntax tree is held under a Ruleset node,\n // with the `root` property set to true, so no `{}` are\n // output. The callback is called when the input is parsed.\n try {\n parserInput.start(str, context.chunkInput, function fail(msg, index) {\n throw new LessError({\n index,\n type: 'Parse',\n message: msg,\n filename: fileInfo.filename\n }, imports);\n });\n\n tree.Node.prototype.parse = this;\n root = new tree.Ruleset(null, this.parsers.primary());\n tree.Node.prototype.rootNode = root;\n root.root = true;\n root.firstRoot = true;\n root.functionRegistry = functionRegistry.inherit();\n\n } catch (e) {\n return callback(new LessError(e, imports, fileInfo.filename));\n }\n\n // If `i` is smaller than the `input.length - 1`,\n // it means the parser wasn't able to parse the whole\n // string, so we've got a parsing error.\n //\n // We try to extract a \\n delimited string,\n // showing the line where the parse error occurred.\n // We split it up into two parts (the part which parsed,\n // and the part which didn't), so we can color them differently.\n const endInfo = parserInput.end();\n if (!endInfo.isFinished) {\n\n let message = endInfo.furthestPossibleErrorMessage;\n\n if (!message) {\n message = 'Unrecognised input';\n if (endInfo.furthestChar === '}') {\n message += '. Possibly missing opening \\'{\\'';\n } else if (endInfo.furthestChar === ')') {\n message += '. Possibly missing opening \\'(\\'';\n } else if (endInfo.furthestReachedEnd) {\n message += '. Possibly missing something';\n }\n }\n\n err = new LessError({\n type: 'Parse',\n message,\n index: endInfo.furthest,\n filename: fileInfo.filename\n }, imports);\n }\n\n const finish = e => {\n e = err || e || imports.error;\n\n if (e) {\n if (!(e instanceof LessError)) {\n e = new LessError(e, imports, fileInfo.filename);\n }\n\n return callback(e);\n }\n else {\n return callback(null, root);\n }\n };\n\n if (context.processImports !== false) {\n new visitors.ImportVisitor(imports, finish)\n .run(root);\n } else {\n return finish();\n }\n },\n\n //\n // Here in, the parsing rules/functions\n //\n // The basic structure of the syntax tree generated is as follows:\n //\n // Ruleset -> Declaration -> Value -> Expression -> Entity\n //\n // Here's some Less code:\n //\n // .class {\n // color: #fff;\n // border: 1px solid #000;\n // width: @w + 4px;\n // > .child {...}\n // }\n //\n // And here's what the parse tree might look like:\n //\n // Ruleset (Selector '.class', [\n // Declaration (\"color\", Value ([Expression [Color #fff]]))\n // Declaration (\"border\", Value ([Expression [Dimension 1px][Keyword \"solid\"][Color #000]]))\n // Declaration (\"width\", Value ([Expression [Operation \" + \" [Variable \"@w\"][Dimension 4px]]]))\n // Ruleset (Selector [Element '>', '.child'], [...])\n // ])\n //\n // In general, most rules will try to parse a token with the `$re()` function, and if the return\n // value is truly, will return a new node, of the relevant type. Sometimes, we need to check\n // first, before parsing, that's when we use `peek()`.\n //\n parsers: parsers = {\n //\n // The `primary` rule is the *entry* and *exit* point of the parser.\n // The rules here can appear at any level of the parse tree.\n //\n // The recursive nature of the grammar is an interplay between the `block`\n // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,\n // as represented by this simplified grammar:\n //\n // primary → (ruleset | declaration)+\n // ruleset → selector+ block\n // block → '{' primary '}'\n //\n // Only at one point is the primary rule not called from the\n // block rule: at the root level.\n //\n primary: function () {\n const mixin = this.mixin;\n let root = [];\n let node;\n\n while (true) {\n while (true) {\n node = this.comment();\n if (!node) { break; }\n root.push(node);\n }\n // always process comments before deciding if finished\n if (parserInput.finished) {\n break;\n }\n if (parserInput.peek('}')) {\n break;\n }\n\n node = this.extendRule();\n if (node) {\n root = root.concat(node);\n continue;\n }\n\n node = mixin.definition() || this.declaration() || mixin.call(false, false) ||\n this.ruleset() || this.variableCall() || this.entities.call() || this.atrule();\n if (node) {\n root.push(node);\n } else {\n let foundSemiColon = false;\n while (parserInput.$char(';')) {\n foundSemiColon = true;\n }\n if (!foundSemiColon) {\n break;\n }\n }\n }\n\n return root;\n },\n\n // comments are collected by the main parsing mechanism and then assigned to nodes\n // where the current structure allows it\n comment: function () {\n if (parserInput.commentStore.length) {\n const comment = parserInput.commentStore.shift();\n return new(tree.Comment)(comment.text, comment.isLineComment, comment.index + currentIndex, fileInfo);\n }\n },\n\n //\n // Entities are tokens which can be found inside an Expression\n //\n entities: {\n mixinLookup: function() {\n return parsers.mixin.call(true, true);\n },\n //\n // A string, which supports escaping \" and '\n //\n // \"milky way\" 'he\\'s the one!'\n //\n quoted: function (forceEscaped) {\n let str;\n const index = parserInput.i;\n let isEscaped = false;\n\n parserInput.save();\n if (parserInput.$char('~')) {\n isEscaped = true;\n } else if (forceEscaped) {\n parserInput.restore();\n return;\n }\n\n str = parserInput.$quoted();\n if (!str) {\n parserInput.restore();\n return;\n }\n parserInput.forget();\n\n return new(tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index + currentIndex, fileInfo);\n },\n\n //\n // A catch-all word, such as:\n //\n // black border-collapse\n //\n keyword: function () {\n const k = parserInput.$char('%') || parserInput.$re(/^\\[?(?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\\]?/);\n if (k) {\n return tree.Color.fromKeyword(k) || new(tree.Keyword)(k);\n }\n },\n\n //\n // A function call\n //\n // rgb(255, 0, 255)\n //\n // The arguments are parsed with the `entities.arguments` parser.\n //\n call: function () {\n let name;\n let args;\n let func;\n const index = parserInput.i;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (parserInput.peek(/^url\\(/i)) {\n return;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^([\\w-]+|%|~|progid:[\\w.]+)\\(/);\n if (!name) {\n parserInput.forget();\n return;\n }\n\n name = name[1];\n func = this.customFuncCall(name);\n if (func) {\n args = func.parse();\n if (args && func.stop) {\n parserInput.forget();\n return args;\n }\n }\n\n args = this.arguments(args);\n\n if (!parserInput.$char(')')) {\n parserInput.restore('Could not parse call arguments or missing \\')\\'');\n return;\n }\n\n parserInput.forget();\n\n return new(tree.Call)(name, args, index + currentIndex, fileInfo);\n },\n\n //\n // Parsing rules for functions with non-standard args, e.g.:\n //\n // boolean(not(2 > 1))\n //\n // This is a quick prototype, to be modified/improved when\n // more custom-parsed funcs come (e.g. `selector(...)`)\n //\n\n customFuncCall: function (name) {\n /* Ideally the table is to be moved out of here for faster perf.,\n but it's quite tricky since it relies on all these `parsers`\n and `expect` available only here */\n return {\n alpha: f(parsers.ieAlpha, true),\n boolean: f(condition),\n 'if': f(condition)\n }[name.toLowerCase()];\n\n function f(parse, stop) {\n return {\n parse, // parsing function\n stop // when true - stop after parse() and return its result,\n // otherwise continue for plain args\n };\n }\n\n function condition() {\n return [expect(parsers.condition, 'expected condition')];\n }\n },\n\n arguments: function (prevArgs) {\n let argsComma = prevArgs || [];\n const argsSemiColon = [];\n let isSemiColonSeparated;\n let value;\n\n parserInput.save();\n\n while (true) {\n if (prevArgs) {\n prevArgs = false;\n } else {\n value = parsers.detachedRuleset() || this.assignment() || parsers.expression();\n if (!value) {\n break;\n }\n\n if (value.value && value.value.length == 1) {\n value = value.value[0];\n }\n\n argsComma.push(value);\n }\n\n if (parserInput.$char(',')) {\n continue;\n }\n\n if (parserInput.$char(';') || isSemiColonSeparated) {\n isSemiColonSeparated = true;\n value = (argsComma.length < 1) ? argsComma[0]\n : new tree.Value(argsComma);\n argsSemiColon.push(value);\n argsComma = [];\n }\n }\n\n parserInput.forget();\n return isSemiColonSeparated ? argsSemiColon : argsComma;\n },\n literal: function () {\n return this.dimension() ||\n this.color() ||\n this.quoted() ||\n this.unicodeDescriptor();\n },\n\n // Assignments are argument entities for calls.\n // They are present in ie filter properties as shown below.\n //\n // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* )\n //\n\n assignment: function () {\n let key;\n let value;\n parserInput.save();\n key = parserInput.$re(/^\\w+(?=\\s?=)/i);\n if (!key) {\n parserInput.restore();\n return;\n }\n if (!parserInput.$char('=')) {\n parserInput.restore();\n return;\n }\n value = parsers.entity();\n if (value) {\n parserInput.forget();\n return new(tree.Assignment)(key, value);\n } else {\n parserInput.restore();\n }\n },\n\n //\n // Parse url() tokens\n //\n // We use a specific rule for urls, because they don't really behave like\n // standard function calls. The difference is that the argument doesn't have\n // to be enclosed within a string, so it can't be parsed as an Expression.\n //\n url: function () {\n let value;\n const index = parserInput.i;\n\n parserInput.autoCommentAbsorb = false;\n\n if (!parserInput.$str('url(')) {\n parserInput.autoCommentAbsorb = true;\n return;\n }\n\n value = this.quoted() || this.variable() || this.property() ||\n parserInput.$re(/^(?:(?:\\\\[()'\"])|[^()'\"])+/) || '';\n\n parserInput.autoCommentAbsorb = true;\n\n expectChar(')');\n\n return new(tree.URL)((value.value !== undefined ||\n value instanceof tree.Variable ||\n value instanceof tree.Property) ?\n value : new(tree.Anonymous)(value, index), index + currentIndex, fileInfo);\n },\n\n //\n // A Variable entity, such as `@fink`, in\n //\n // width: @fink + 2px\n //\n // We use a different parser for variable definitions,\n // see `parsers.variable`.\n //\n variable: function () {\n let ch;\n let name;\n const index = parserInput.i;\n\n parserInput.save();\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\\w-]+/))) {\n ch = parserInput.currentChar();\n if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\\s/)) {\n // this may be a VariableCall lookup\n const result = parsers.variableCall(name);\n if (result) {\n parserInput.forget();\n return result;\n }\n }\n parserInput.forget();\n return new(tree.Variable)(name, index + currentIndex, fileInfo);\n }\n parserInput.restore();\n },\n\n // A variable entity using the protective {} e.g. @{var}\n variableCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\\{([\\w-]+)\\}/))) {\n return new(tree.Variable)(`@${curly[1]}`, index + currentIndex, fileInfo);\n }\n },\n //\n // A Property accessor, such as `$color`, in\n //\n // background-color: $color\n //\n property: function () {\n let name;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (name = parserInput.$re(/^\\$[\\w-]+/))) {\n return new(tree.Property)(name, index + currentIndex, fileInfo);\n }\n },\n\n // A property entity useing the protective {} e.g. ${prop}\n propertyCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\\$\\{([\\w-]+)\\}/))) {\n return new(tree.Property)(`$${curly[1]}`, index + currentIndex, fileInfo);\n }\n },\n //\n // A Hexadecimal color\n //\n // #4F3C2F\n //\n // `rgb` and `hsl` colors are parsed through the `entities.call` parser.\n //\n color: function () {\n let rgb;\n parserInput.save();\n\n if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})([\\w.#[])?/))) {\n if (!rgb[2]) {\n parserInput.forget();\n return new(tree.Color)(rgb[1], undefined, rgb[0]);\n }\n }\n parserInput.restore();\n },\n\n colorKeyword: function () {\n parserInput.save();\n const autoCommentAbsorb = parserInput.autoCommentAbsorb;\n parserInput.autoCommentAbsorb = false;\n const k = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/);\n parserInput.autoCommentAbsorb = autoCommentAbsorb;\n if (!k) {\n parserInput.forget();\n return;\n }\n parserInput.restore();\n const color = tree.Color.fromKeyword(k);\n if (color) {\n parserInput.$str(k);\n return color;\n }\n },\n\n //\n // A Dimension, that is, a number and a unit\n //\n // 0.5em 95%\n //\n dimension: function () {\n if (parserInput.peekNotNumeric()) {\n return;\n }\n\n const value = parserInput.$re(/^([+-]?\\d*\\.?\\d+)(%|[a-z_]+)?/i);\n if (value) {\n return new(tree.Dimension)(value[1], value[2]);\n }\n },\n\n //\n // A unicode descriptor, as is used in unicode-range\n //\n // U+0?? or U+00A1-00A9\n //\n unicodeDescriptor: function () {\n let ud;\n\n ud = parserInput.$re(/^U\\+[0-9a-fA-F?]+(-[0-9a-fA-F?]+)?/);\n if (ud) {\n return new(tree.UnicodeDescriptor)(ud[0]);\n }\n },\n\n //\n // JavaScript code to be evaluated\n //\n // `window.location.href`\n //\n javascript: function () {\n let js;\n const index = parserInput.i;\n\n parserInput.save();\n\n const escape = parserInput.$char('~');\n const jsQuote = parserInput.$char('`');\n\n if (!jsQuote) {\n parserInput.restore();\n return;\n }\n\n js = parserInput.$re(/^[^`]*`/);\n if (js) {\n parserInput.forget();\n return new(tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index + currentIndex, fileInfo);\n }\n parserInput.restore('invalid javascript definition');\n }\n },\n\n //\n // The variable part of a variable definition. Used in the `rule` parser\n //\n // @fink:\n //\n variable: function () {\n let name;\n\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\\w-]+)\\s*:/))) { return name[1]; }\n },\n\n //\n // Call a variable value to retrieve a detached ruleset\n // or a value from a detached ruleset's rules.\n //\n // @fink();\n // @fink;\n // color: @fink[@color];\n //\n variableCall: function (parsedName) {\n let lookups;\n const i = parserInput.i;\n const inValue = !!parsedName;\n let name = parsedName;\n\n parserInput.save();\n\n if (name || (parserInput.currentChar() === '@'\n && (name = parserInput.$re(/^(@[\\w-]+)(\\(\\s*\\))?/)))) {\n\n lookups = this.mixin.ruleLookups();\n\n if (!lookups && ((inValue && parserInput.$str('()') !== '()') || (name[2] !== '()'))) {\n parserInput.restore('Missing \\'[...]\\' lookup in variable call');\n return;\n }\n\n if (!inValue) {\n name = name[1];\n }\n\n const call = new tree.VariableCall(name, i, fileInfo);\n if (!inValue && parsers.end()) {\n parserInput.forget();\n return call;\n }\n else {\n parserInput.forget();\n return new tree.NamespaceValue(call, lookups, i, fileInfo);\n }\n }\n\n parserInput.restore();\n },\n\n //\n // extend syntax - used to extend selectors\n //\n extend: function(isRule) {\n let elements;\n let e;\n const index = parserInput.i;\n let option;\n let extendList;\n let extend;\n\n if (!parserInput.$str(isRule ? '&:extend(' : ':extend(')) {\n return;\n }\n\n do {\n option = null;\n elements = null;\n while (!(option = parserInput.$re(/^(all)(?=\\s*(\\)|,))/))) {\n e = this.element();\n if (!e) {\n break;\n }\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n }\n\n option = option && option[1];\n if (!elements) {\n error('Missing target selector for :extend().');\n }\n extend = new(tree.Extend)(new(tree.Selector)(elements), option, index + currentIndex, fileInfo);\n if (extendList) {\n extendList.push(extend);\n } else {\n extendList = [ extend ];\n }\n } while (parserInput.$char(','));\n\n expect(/^\\)/);\n\n if (isRule) {\n expect(/^;/);\n }\n\n return extendList;\n },\n\n //\n // extendRule - used in a rule to extend all the parent selectors\n //\n extendRule: function() {\n return this.extend(true);\n },\n\n //\n // Mixins\n //\n mixin: {\n //\n // A Mixin call, with an optional argument list\n //\n // #mixins > .square(#fff);\n // #mixins.square(#fff);\n // .rounded(4px, black);\n // .button;\n //\n // We can lookup / return a value using the lookup syntax:\n //\n // color: #mixin.square(#fff)[@color];\n //\n // The `while` loop is there because mixins can be\n // namespaced, but we only support the child and descendant\n // selector for now.\n //\n call: function (inValue, getLookup) {\n const s = parserInput.currentChar();\n let important = false;\n let lookups;\n const index = parserInput.i;\n let elements;\n let args;\n let hasParens;\n\n if (s !== '.' && s !== '#') { return; }\n\n parserInput.save(); // stop us absorbing part of an invalid selector\n\n elements = this.elements();\n\n if (elements) {\n if (parserInput.$char('(')) {\n args = this.args(true).args;\n expectChar(')');\n hasParens = true;\n }\n\n if (getLookup !== false) {\n lookups = this.ruleLookups();\n }\n if (getLookup === true && !lookups) {\n parserInput.restore();\n return;\n }\n\n if (inValue && !lookups && !hasParens) {\n // This isn't a valid in-value mixin call\n parserInput.restore();\n return;\n }\n\n if (!inValue && parsers.important()) {\n important = true;\n }\n\n if (inValue || parsers.end()) {\n parserInput.forget();\n const mixin = new(tree.mixin.Call)(elements, args, index + currentIndex, fileInfo, !lookups && important);\n if (lookups) {\n return new tree.NamespaceValue(mixin, lookups);\n }\n else {\n return mixin;\n }\n }\n }\n\n parserInput.restore();\n },\n /**\n * Matching elements for mixins\n * (Start with . or # and can have > )\n */\n elements: function() {\n let elements;\n let e;\n let c;\n let elem;\n let elemIndex;\n const re = /^[#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/;\n while (true) {\n elemIndex = parserInput.i;\n e = parserInput.$re(re);\n\n if (!e) {\n break;\n }\n elem = new(tree.Element)(c, e, false, elemIndex + currentIndex, fileInfo);\n if (elements) {\n elements.push(elem);\n } else {\n elements = [ elem ];\n }\n c = parserInput.$char('>');\n }\n return elements;\n },\n args: function (isCall) {\n const entities = parsers.entities;\n const returner = { args:null, variadic: false };\n let expressions = [];\n const argsSemiColon = [];\n const argsComma = [];\n let isSemiColonSeparated;\n let expressionContainsNamed;\n let name;\n let nameLoop;\n let value;\n let arg;\n let expand;\n let hasSep = true;\n\n parserInput.save();\n\n while (true) {\n if (isCall) {\n arg = parsers.detachedRuleset() || parsers.expression();\n } else {\n parserInput.commentStore.length = 0;\n if (parserInput.$str('...')) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ variadic: true });\n break;\n }\n arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true);\n }\n\n if (!arg || !hasSep) {\n break;\n }\n\n nameLoop = null;\n if (arg.throwAwayComments) {\n arg.throwAwayComments();\n }\n value = arg;\n let val = null;\n\n if (isCall) {\n // Variable\n if (arg.value && arg.value.length == 1) {\n val = arg.value[0];\n }\n } else {\n val = arg;\n }\n\n if (val && (val instanceof tree.Variable || val instanceof tree.Property)) {\n if (parserInput.$char(':')) {\n if (expressions.length > 0) {\n if (isSemiColonSeparated) {\n error('Cannot mix ; and , as delimiter types');\n }\n expressionContainsNamed = true;\n }\n\n value = parsers.detachedRuleset() || parsers.expression();\n\n if (!value) {\n if (isCall) {\n error('could not understand value for named argument');\n } else {\n parserInput.restore();\n returner.args = [];\n return returner;\n }\n }\n nameLoop = (name = val.name);\n } else if (parserInput.$str('...')) {\n if (!isCall) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ name: arg.name, variadic: true });\n break;\n } else {\n expand = true;\n }\n } else if (!isCall) {\n name = nameLoop = val.name;\n value = null;\n }\n }\n\n if (value) {\n expressions.push(value);\n }\n\n argsComma.push({ name:nameLoop, value, expand });\n\n if (parserInput.$char(',')) {\n hasSep = true;\n continue;\n }\n hasSep = parserInput.$char(';') === ';';\n\n if (hasSep || isSemiColonSeparated) {\n\n if (expressionContainsNamed) {\n error('Cannot mix ; and , as delimiter types');\n }\n\n isSemiColonSeparated = true;\n\n if (expressions.length > 1) {\n value = new(tree.Value)(expressions);\n }\n argsSemiColon.push({ name, value, expand });\n\n name = null;\n expressions = [];\n expressionContainsNamed = false;\n }\n }\n\n parserInput.forget();\n returner.args = isSemiColonSeparated ? argsSemiColon : argsComma;\n return returner;\n },\n //\n // A Mixin definition, with a list of parameters\n //\n // .rounded (@radius: 2px, @color) {\n // ...\n // }\n //\n // Until we have a finer grained state-machine, we have to\n // do a look-ahead, to make sure we don't have a mixin call.\n // See the `rule` function for more information.\n //\n // We start by matching `.rounded (`, and then proceed on to\n // the argument list, which has optional default values.\n // We store the parameters in `params`, with a `value` key,\n // if there is a value, such as in the case of `@radius`.\n //\n // Once we've got our params list, and a closing `)`, we parse\n // the `{...}` block.\n //\n definition: function () {\n let name;\n let params = [];\n let match;\n let ruleset;\n let cond;\n let variadic = false;\n if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') ||\n parserInput.peek(/^[^{]*\\}/)) {\n return;\n }\n\n parserInput.save();\n\n match = parserInput.$re(/^([#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\\s*\\(/);\n if (match) {\n name = match[1];\n\n const argInfo = this.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n\n // .mixincall(\"@{a}\");\n // looks a bit like a mixin definition..\n // also\n // .mixincall(@a: {rule: set;});\n // so we have to be nice and restore\n if (!parserInput.$char(')')) {\n parserInput.restore('Missing closing \\')\\'');\n return;\n }\n\n parserInput.commentStore.length = 0;\n\n if (parserInput.$str('when')) { // Guard\n cond = expect(parsers.conditions, 'expected condition');\n }\n\n ruleset = parsers.block();\n\n if (ruleset) {\n parserInput.forget();\n return new(tree.mixin.Definition)(name, params, ruleset, cond, variadic);\n } else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n\n ruleLookups: function() {\n let rule;\n const lookups = [];\n\n if (parserInput.currentChar() !== '[') {\n return;\n }\n\n while (true) {\n parserInput.save();\n rule = this.lookupValue();\n if (!rule && rule !== '') {\n parserInput.restore();\n break;\n }\n lookups.push(rule);\n parserInput.forget();\n }\n if (lookups.length > 0) {\n return lookups;\n }\n },\n\n lookupValue: function() {\n parserInput.save();\n\n if (!parserInput.$char('[')) {\n parserInput.restore();\n return;\n }\n\n const name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);\n\n if (!parserInput.$char(']')) {\n parserInput.restore();\n return;\n }\n\n if (name || name === '') {\n parserInput.forget();\n return name;\n }\n\n parserInput.restore();\n }\n },\n //\n // Entities are the smallest recognized token,\n // and can be found inside a rule's value.\n //\n entity: function () {\n const entities = this.entities;\n\n return this.comment() || entities.literal() || entities.variable() || entities.url() ||\n entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) ||\n entities.javascript();\n },\n\n //\n // A Declaration terminator. Note that we use `peek()` to check for '}',\n // because the `block` rule will be expecting it, but we still need to make sure\n // it's there, if ';' was omitted.\n //\n end: function () {\n return parserInput.$char(';') || parserInput.peek('}');\n },\n\n //\n // IE's alpha function\n //\n // alpha(opacity=88)\n //\n ieAlpha: function () {\n let value;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (!parserInput.$re(/^opacity=/i)) { return; }\n value = parserInput.$re(/^\\d+/);\n if (!value) {\n value = expect(parsers.entities.variable, 'Could not parse alpha');\n value = `@{${value.name.slice(1)}}`;\n }\n expectChar(')');\n return new tree.Quoted('', `alpha(opacity=${value})`);\n },\n\n //\n // A Selector Element\n //\n // div\n // + h1\n // #socks\n // input[type=\"text\"]\n //\n // Elements are the building blocks for Selectors,\n // they are made out of a `Combinator` (see combinator rule),\n // and an element name, such as a tag a class, or `*`.\n //\n element: function () {\n let e;\n let c;\n let v;\n const index = parserInput.i;\n\n c = this.combinator();\n\n e = parserInput.$re(/^(?:\\d+\\.\\d+|\\d+)%/) ||\n // eslint-disable-next-line no-control-regex\n parserInput.$re(/^(?:[.#]?|:*)(?:[\\w-]|[^\\x00-\\x9f]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||\n parserInput.$char('*') || parserInput.$char('&') || this.attribute() ||\n parserInput.$re(/^\\([^&()@]+\\)/) || parserInput.$re(/^[.#:](?=@)/) ||\n this.entities.variableCurly();\n\n if (!e) {\n parserInput.save();\n if (parserInput.$char('(')) {\n if ((v = this.selector(false)) && parserInput.$char(')')) {\n e = new(tree.Paren)(v);\n parserInput.forget();\n } else {\n parserInput.restore('Missing closing \\')\\'');\n }\n } else {\n parserInput.forget();\n }\n }\n\n if (e) { return new(tree.Element)(c, e, e instanceof tree.Variable, index + currentIndex, fileInfo); }\n },\n\n //\n // Combinators combine elements together, in a Selector.\n //\n // Because our parser isn't white-space sensitive, special care\n // has to be taken, when parsing the descendant combinator, ` `,\n // as it's an empty space. We have to check the previous character\n // in the input, to see if it's a ` ` character. More info on how\n // we deal with this in *combinator.js*.\n //\n combinator: function () {\n let c = parserInput.currentChar();\n\n if (c === '/') {\n parserInput.save();\n const slashedCombinator = parserInput.$re(/^\\/[a-z]+\\//i);\n if (slashedCombinator) {\n parserInput.forget();\n return new(tree.Combinator)(slashedCombinator);\n }\n parserInput.restore();\n }\n\n if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') {\n parserInput.i++;\n if (c === '^' && parserInput.currentChar() === '^') {\n c = '^^';\n parserInput.i++;\n }\n while (parserInput.isWhitespace()) { parserInput.i++; }\n return new(tree.Combinator)(c);\n } else if (parserInput.isWhitespace(-1)) {\n return new(tree.Combinator)(' ');\n } else {\n return new(tree.Combinator)(null);\n }\n },\n //\n // A CSS Selector\n // with less extensions e.g. the ability to extend and guard\n //\n // .class > div + h1\n // li a:hover\n //\n // Selectors are made out of one or more Elements, see above.\n //\n selector: function (isLess) {\n const index = parserInput.i;\n let elements;\n let extendList;\n let c;\n let e;\n let allExtends;\n let when;\n let condition;\n isLess = isLess !== false;\n while ((isLess && (extendList = this.extend())) || (isLess && (when = parserInput.$str('when'))) || (e = this.element())) {\n if (when) {\n condition = expect(this.conditions, 'expected condition');\n } else if (condition) {\n error('CSS guard can only be used at the end of selector');\n } else if (extendList) {\n if (allExtends) {\n allExtends = allExtends.concat(extendList);\n } else {\n allExtends = extendList;\n }\n } else {\n if (allExtends) { error('Extend can only be used at the end of selector'); }\n c = parserInput.currentChar();\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n e = null;\n }\n if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') {\n break;\n }\n }\n\n if (elements) { return new(tree.Selector)(elements, allExtends, condition, index + currentIndex, fileInfo); }\n if (allExtends) { error('Extend must be used to extend a selector, it cannot be used on its own'); }\n },\n selectors: function () {\n let s;\n let selectors;\n while (true) {\n s = this.selector();\n if (!s) {\n break;\n }\n if (selectors) {\n selectors.push(s);\n } else {\n selectors = [ s ];\n }\n parserInput.commentStore.length = 0;\n if (s.condition && selectors.length > 1) {\n error('Guards are only currently allowed on a single selector.');\n }\n if (!parserInput.$char(',')) { break; }\n if (s.condition) {\n error('Guards are only currently allowed on a single selector.');\n }\n parserInput.commentStore.length = 0;\n }\n return selectors;\n },\n attribute: function () {\n if (!parserInput.$char('[')) { return; }\n\n const entities = this.entities;\n let key;\n let val;\n let op;\n //\n // case-insensitive flag\n // e.g. [attr operator value i]\n //\n let cif;\n\n if (!(key = entities.variableCurly())) {\n key = expect(/^(?:[_A-Za-z0-9-*]*\\|)?(?:[_A-Za-z0-9-]|\\\\.)+/);\n }\n\n op = parserInput.$re(/^[|~*$^]?=/);\n if (op) {\n val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\\w-]+/) || entities.variableCurly();\n if (val) {\n cif = parserInput.$re(/^[iIsS]/);\n }\n }\n\n expectChar(']');\n\n return new(tree.Attribute)(key, op, val, cif);\n },\n\n //\n // The `block` rule is used by `ruleset` and `mixin.definition`.\n // It's a wrapper around the `primary` rule, with added `{}`.\n //\n block: function () {\n let content;\n if (parserInput.$char('{') && (content = this.primary()) && parserInput.$char('}')) {\n return content;\n }\n },\n\n blockRuleset: function() {\n let block = this.block();\n\n if (block) {\n block = new tree.Ruleset(null, block);\n }\n return block;\n },\n\n detachedRuleset: function() {\n let argInfo;\n let params;\n let variadic;\n\n parserInput.save();\n if (parserInput.$re(/^[.#]\\(/)) {\n /**\n * DR args currently only implemented for each() function, and not\n * yet settable as `@dr: #(@arg) {}`\n * This should be done when DRs are merged with mixins.\n * See: https://github.com/less/less-meta/issues/16\n */\n argInfo = this.mixin.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return;\n }\n }\n const blockRuleset = this.blockRuleset();\n if (blockRuleset) {\n parserInput.forget();\n if (params) {\n return new tree.mixin.Definition(null, params, blockRuleset, null, variadic);\n }\n return new tree.DetachedRuleset(blockRuleset);\n }\n parserInput.restore();\n },\n\n //\n // div, .class, body > p {...}\n //\n ruleset: function () {\n let selectors;\n let rules;\n let debugInfo;\n\n parserInput.save();\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(parserInput.i);\n }\n\n selectors = this.selectors();\n\n if (selectors && (rules = this.block())) {\n parserInput.forget();\n const ruleset = new(tree.Ruleset)(selectors, rules, context.strictImports);\n if (context.dumpLineNumbers) {\n ruleset.debugInfo = debugInfo;\n }\n return ruleset;\n } else {\n parserInput.restore();\n }\n },\n declaration: function () {\n let name;\n let value;\n const index = parserInput.i;\n let hasDR;\n const c = parserInput.currentChar();\n let important;\n let merge;\n let isVariable;\n\n if (c === '.' || c === '#' || c === '&' || c === ':') { return; }\n\n parserInput.save();\n\n name = this.variable() || this.ruleProperty();\n if (name) {\n isVariable = typeof name === 'string';\n\n if (isVariable) {\n value = this.detachedRuleset();\n if (value) {\n hasDR = true;\n }\n }\n\n parserInput.commentStore.length = 0;\n if (!value) {\n // a name returned by this.ruleProperty() is always an array of the form:\n // [string-1, ..., string-n, \"\"] or [string-1, ..., string-n, \"+\"]\n // where each item is a tree.Keyword or tree.Variable\n merge = !isVariable && name.length > 1 && name.pop().value;\n\n // Custom property values get permissive parsing\n if (name[0].value && name[0].value.slice(0, 2) === '--') {\n value = this.permissiveValue(/[;}]/);\n }\n // Try to store values as anonymous\n // If we need the value later we'll re-parse it in ruleset.parseValue\n else {\n value = this.anonymousValue();\n }\n if (value) {\n parserInput.forget();\n // anonymous values absorb the end ';' which is required for them to work\n return new(tree.Declaration)(name, value, false, merge, index + currentIndex, fileInfo);\n }\n\n if (!value) {\n value = this.value();\n }\n\n if (value) {\n important = this.important();\n } else if (isVariable) {\n // As a last resort, try permissiveValue\n value = this.permissiveValue();\n }\n }\n\n if (value && (this.end() || hasDR)) {\n parserInput.forget();\n return new(tree.Declaration)(name, value, important, merge, index + currentIndex, fileInfo);\n }\n else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n anonymousValue: function () {\n const index = parserInput.i;\n const match = parserInput.$re(/^([^.#@$+/'\"*`(;{}-]*);/);\n if (match) {\n return new(tree.Anonymous)(match[1], index + currentIndex);\n }\n },\n /**\n * Used for custom properties, at-rules, and variables (as fallback)\n * Parses almost anything inside of {} [] () \"\" blocks\n * until it reaches outer-most tokens.\n *\n * First, it will try to parse comments and entities to reach\n * the end. This is mostly like the Expression parser except no\n * math is allowed.\n */\n permissiveValue: function (untilTokens) {\n let i;\n let e;\n let done;\n let value;\n const tok = untilTokens || ';';\n const index = parserInput.i;\n const result = [];\n\n function testCurrentChar() {\n const char = parserInput.currentChar();\n if (typeof tok === 'string') {\n return char === tok;\n } else {\n return tok.test(char);\n }\n }\n if (testCurrentChar()) {\n return;\n }\n value = [];\n do {\n e = this.comment();\n if (e) {\n value.push(e);\n continue;\n }\n e = this.entity();\n if (e) {\n value.push(e);\n }\n if (parserInput.peek(',')) {\n value.push(new (tree.Anonymous)(',', parserInput.i));\n parserInput.$char(',');\n }\n } while (e);\n\n done = testCurrentChar();\n\n if (value.length > 0) {\n value = new(tree.Expression)(value);\n if (done) {\n return value;\n }\n else {\n result.push(value);\n }\n // Preserve space before $parseUntil as it will not\n if (parserInput.prevChar() === ' ') {\n result.push(new tree.Anonymous(' ', index));\n }\n }\n parserInput.save();\n\n value = parserInput.$parseUntil(tok);\n\n if (value) {\n if (typeof value === 'string') {\n error(`Expected '${value}'`, 'Parse');\n }\n if (value.length === 1 && value[0] === ' ') {\n parserInput.forget();\n return new tree.Anonymous('', index);\n }\n let item;\n for (i = 0; i < value.length; i++) {\n item = value[i];\n if (Array.isArray(item)) {\n // Treat actual quotes as normal quoted values\n result.push(new tree.Quoted(item[0], item[1], true, index, fileInfo));\n }\n else {\n if (i === value.length - 1) {\n item = item.trim();\n }\n // Treat like quoted values, but replace vars like unquoted expressions\n const quote = new tree.Quoted('\\'', item, true, index, fileInfo);\n quote.variableRegex = /@([\\w-]+)/g;\n quote.propRegex = /\\$([\\w-]+)/g;\n result.push(quote);\n }\n }\n parserInput.forget();\n return new tree.Expression(result, true);\n }\n parserInput.restore();\n },\n\n //\n // An @import atrule\n //\n // @import \"lib\";\n //\n // Depending on our environment, importing is done differently:\n // In the browser, it's an XHR request, in Node, it would be a\n // file-system operation. The function used for importing is\n // stored in `import`, which we pass to the Import constructor.\n //\n 'import': function () {\n let path;\n let features;\n const index = parserInput.i;\n\n const dir = parserInput.$re(/^@import\\s+/);\n\n if (dir) {\n const options = (dir ? this.importOptions() : null) || {};\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n features = this.mediaFeatures({});\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon or unrecognised media features on import');\n }\n features = features && new(tree.Value)(features);\n return new(tree.Import)(path, features, options, index + currentIndex, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed import statement');\n }\n }\n },\n\n importOptions: function() {\n let o;\n const options = {};\n let optionName;\n let value;\n\n // list of options, surrounded by parens\n if (!parserInput.$char('(')) { return null; }\n do {\n o = this.importOption();\n if (o) {\n optionName = o;\n value = true;\n switch (optionName) {\n case 'css':\n optionName = 'less';\n value = false;\n break;\n case 'once':\n optionName = 'multiple';\n value = false;\n break;\n }\n options[optionName] = value;\n if (!parserInput.$char(',')) { break; }\n }\n } while (o);\n expectChar(')');\n return options;\n },\n\n importOption: function() {\n const opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/);\n if (opt) {\n return opt[1];\n }\n },\n\n mediaFeature: function (syntaxOptions) {\n const entities = this.entities;\n const nodes = [];\n let e;\n let p;\n let rangeP;\n parserInput.save();\n do {\n e = entities.keyword() || entities.variable() || entities.mixinLookup();\n if (e) {\n nodes.push(e);\n } else if (parserInput.$char('(')) {\n p = this.property();\n parserInput.save();\n if (!p && syntaxOptions.queryInParens && parserInput.$re(/^[0-9a-z-]*\\s*([<>]=|<=|>=|[<>]|=)/)) {\n parserInput.restore();\n p = this.condition();\n\n parserInput.save();\n rangeP = this.atomicCondition(null, p.rvalue);\n if (!rangeP) {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n e = this.value();\n }\n if (parserInput.$char(')')) {\n if (p && !e) {\n nodes.push(new (tree.Paren)(new (tree.QueryInParens)(p.op, p.lvalue, p.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p._index)));\t\t\t\t \n e = p;\n } else if (p && e) {\n nodes.push(new (tree.Paren)(new (tree.Declaration)(p, e, null, null, parserInput.i + currentIndex, fileInfo, true)));\n } else if (e) {\n nodes.push(new(tree.Paren)(e));\n } else {\n error('badly formed media feature definition');\n }\n } else {\n error('Missing closing \\')\\'', 'Parse');\n }\n }\n } while (e);\n\n parserInput.forget();\n if (nodes.length > 0) {\n return new(tree.Expression)(nodes);\n }\n },\n\n mediaFeatures: function (syntaxOptions) {\n const entities = this.entities;\n const features = [];\n let e;\n do {\n e = this.mediaFeature(syntaxOptions);\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n } else {\n e = entities.variable() || entities.mixinLookup();\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n }\n } while (e);\n\n return features.length > 0 ? features : null;\n },\n\n prepareAndGetNestableAtRule: function (treeType, index, debugInfo, syntaxOptions) {\n const features = this.mediaFeatures(syntaxOptions);\n\n const rules = this.block();\n\n if (!rules) {\n error('media definitions require block statements after any features');\n }\n\n parserInput.forget();\n\n const atRule = new (treeType)(rules, features, index + currentIndex, fileInfo);\n if (context.dumpLineNumbers) {\n atRule.debugInfo = debugInfo;\n }\n\n return atRule;\n },\n\n nestableAtRule: function () {\n let debugInfo;\n const index = parserInput.i;\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(index);\n }\n parserInput.save();\n\n if (parserInput.$peekChar('@')) {\n if (parserInput.$str('@media')) {\n return this.prepareAndGetNestableAtRule(tree.Media, index, debugInfo, MediaSyntaxOptions);\n }\n \n if (parserInput.$str('@container')) {\n return this.prepareAndGetNestableAtRule(tree.Container, index, debugInfo, ContainerSyntaxOptions);\n }\n }\n \n parserInput.restore();\n },\n\n //\n\n // A @plugin directive, used to import plugins dynamically.\n //\n // @plugin (args) \"lib\";\n //\n plugin: function () {\n let path;\n let args;\n let options;\n const index = parserInput.i;\n const dir = parserInput.$re(/^@plugin\\s+/);\n\n if (dir) {\n args = this.pluginArgs();\n\n if (args) {\n options = {\n pluginArgs: args,\n isPlugin: true\n };\n }\n else {\n options = { isPlugin: true };\n }\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon on @plugin');\n }\n return new(tree.Import)(path, null, options, index + currentIndex, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed @plugin statement');\n }\n }\n },\n\n pluginArgs: function() {\n // list of options, surrounded by parens\n parserInput.save();\n if (!parserInput.$char('(')) {\n parserInput.restore();\n return null;\n }\n const args = parserInput.$re(/^\\s*([^);]+)\\)\\s*/);\n if (args[1]) {\n parserInput.forget();\n return args[1].trim();\n }\n else {\n parserInput.restore();\n return null;\n }\n },\n\n //\n // A CSS AtRule\n //\n // @charset \"utf-8\";\n //\n atrule: function () {\n const index = parserInput.i;\n let name;\n let value;\n let rules;\n let nonVendorSpecificName;\n let hasIdentifier;\n let hasExpression;\n let hasUnknown;\n let hasBlock = true;\n let isRooted = true;\n\n if (parserInput.currentChar() !== '@') { return; }\n\n value = this['import']() || this.plugin() || this.nestableAtRule();\n if (value) {\n return value;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^@[a-z-]+/);\n\n if (!name) { return; }\n\n nonVendorSpecificName = name;\n if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {\n nonVendorSpecificName = `@${name.slice(name.indexOf('-', 2) + 1)}`;\n }\n\n switch (nonVendorSpecificName) {\n case '@charset':\n hasIdentifier = true;\n hasBlock = false;\n break;\n case '@namespace':\n hasExpression = true;\n hasBlock = false;\n break;\n case '@keyframes':\n case '@counter-style':\n hasIdentifier = true;\n break;\n case '@document':\n case '@supports':\n hasUnknown = true;\n isRooted = false;\n break;\n default:\n hasUnknown = true;\n break;\n }\n\n parserInput.commentStore.length = 0;\n\n if (hasIdentifier) {\n value = this.entity();\n if (!value) {\n error(`expected ${name} identifier`);\n }\n } else if (hasExpression) {\n value = this.expression();\n if (!value) {\n error(`expected ${name} expression`);\n }\n } else if (hasUnknown) {\n value = this.permissiveValue(/^[{;]/);\n hasBlock = (parserInput.currentChar() === '{');\n if (!value) {\n if (!hasBlock && parserInput.currentChar() !== ';') {\n error(`${name} rule is missing block or ending semi-colon`);\n }\n }\n else if (!value.value) {\n value = null;\n }\n }\n\n if (hasBlock) {\n rules = this.blockRuleset();\n }\n\n if (rules || (!hasBlock && value && parserInput.$char(';'))) {\n parserInput.forget();\n return new(tree.AtRule)(name, value, rules, index + currentIndex, fileInfo,\n context.dumpLineNumbers ? getDebugInfo(index) : null,\n isRooted\n );\n }\n\n parserInput.restore('at-rule options not recognised');\n },\n\n //\n // A Value is a comma-delimited list of Expressions\n //\n // font-family: Baskerville, Georgia, serif;\n //\n // In a Rule, a Value represents everything after the `:`,\n // and before the `;`.\n //\n value: function () {\n let e;\n const expressions = [];\n const index = parserInput.i;\n\n do {\n e = this.expression();\n if (e) {\n expressions.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n } while (e);\n\n if (expressions.length > 0) {\n return new(tree.Value)(expressions, index + currentIndex);\n }\n },\n important: function () {\n if (parserInput.currentChar() === '!') {\n return parserInput.$re(/^! *important/);\n }\n },\n sub: function () {\n let a;\n let e;\n\n parserInput.save();\n if (parserInput.$char('(')) {\n a = this.addition();\n if (a && parserInput.$char(')')) {\n parserInput.forget();\n e = new(tree.Expression)([a]);\n e.parens = true;\n return e;\n }\n parserInput.restore('Expected \\')\\'');\n return;\n }\n parserInput.restore();\n },\n multiplication: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.operand();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n if (parserInput.peek(/^\\/[*/]/)) {\n break;\n }\n\n parserInput.save();\n\n op = parserInput.$char('/') || parserInput.$char('*') || parserInput.$str('./');\n\n if (!op) { parserInput.forget(); break; }\n\n a = this.operand();\n\n if (!a) { parserInput.restore(); break; }\n parserInput.forget();\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n addition: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.multiplication();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n op = parserInput.$re(/^[-+]\\s+/) || (!isSpaced && (parserInput.$char('+') || parserInput.$char('-')));\n if (!op) {\n break;\n }\n a = this.multiplication();\n if (!a) {\n break;\n }\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n conditions: function () {\n let a;\n let b;\n const index = parserInput.i;\n let condition;\n\n a = this.condition(true);\n if (a) {\n while (true) {\n if (!parserInput.peek(/^,\\s*(not\\s*)?\\(/) || !parserInput.$char(',')) {\n break;\n }\n b = this.condition(true);\n if (!b) {\n break;\n }\n condition = new(tree.Condition)('or', condition || a, b, index + currentIndex);\n }\n return condition || a;\n }\n },\n condition: function (needsParens) {\n let result;\n let logical;\n let next;\n function or() {\n return parserInput.$str('or');\n }\n\n result = this.conditionAnd(needsParens);\n if (!result) {\n return ;\n }\n logical = or();\n if (logical) {\n next = this.condition(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n conditionAnd: function (needsParens) {\n let result;\n let logical;\n let next;\n const self = this;\n function insideCondition() {\n const cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens);\n if (!cond && !needsParens) {\n return self.atomicCondition(needsParens);\n }\n return cond;\n }\n function and() {\n return parserInput.$str('and');\n }\n\n result = insideCondition();\n if (!result) {\n return ;\n }\n logical = and();\n if (logical) {\n next = this.conditionAnd(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n negatedCondition: function (needsParens) {\n if (parserInput.$str('not')) {\n const result = this.parenthesisCondition(needsParens);\n if (result) {\n result.negate = !result.negate;\n }\n return result;\n }\n },\n parenthesisCondition: function (needsParens) {\n function tryConditionFollowedByParenthesis(me) {\n let body;\n parserInput.save();\n body = me.condition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return ;\n }\n parserInput.forget();\n return body;\n }\n\n let body;\n parserInput.save();\n if (!parserInput.$str('(')) {\n parserInput.restore();\n return ;\n }\n body = tryConditionFollowedByParenthesis(this);\n if (body) {\n parserInput.forget();\n return body;\n }\n\n body = this.atomicCondition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore(`expected ')' got '${parserInput.currentChar()}'`);\n return ;\n }\n parserInput.forget();\n return body;\n },\n atomicCondition: function (needsParens, preparsedCond) {\n const entities = this.entities;\n const index = parserInput.i;\n let a;\n let b;\n let c;\n let op;\n\n const cond = (function() {\n return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup();\n }).bind(this)\n\n if (preparsedCond) {\n a = preparsedCond;\n } else {\n a = cond();\n }\n\n if (a) {\n if (parserInput.$char('>')) {\n if (parserInput.$char('=')) {\n op = '>=';\n } else {\n op = '>';\n }\n } else\n if (parserInput.$char('<')) {\n if (parserInput.$char('=')) {\n op = '<=';\n } else {\n op = '<';\n }\n } else\n if (parserInput.$char('=')) {\n if (parserInput.$char('>')) {\n op = '=>';\n } else if (parserInput.$char('<')) {\n op = '=<';\n } else {\n op = '=';\n }\n }\n if (op) {\n b = cond();\n if (b) {\n c = new(tree.Condition)(op, a, b, index + currentIndex, false);\n } else {\n error('expected expression');\n }\n } else if (!preparsedCond) {\n c = new(tree.Condition)('=', a, new(tree.Keyword)('true'), index + currentIndex, false);\n }\n return c;\n }\n },\n\n //\n // An operand is anything that can be part of an operation,\n // such as a Color, or a Variable\n //\n operand: function () {\n const entities = this.entities;\n let negate;\n\n if (parserInput.peek(/^-[@$(]/)) {\n negate = parserInput.$char('-');\n }\n\n let o = this.sub() || entities.dimension() ||\n entities.color() || entities.variable() ||\n entities.property() || entities.call() ||\n entities.quoted(true) || entities.colorKeyword() ||\n entities.mixinLookup();\n\n if (negate) {\n o.parensInOp = true;\n o = new(tree.Negative)(o);\n }\n\n return o;\n },\n\n //\n // Expressions either represent mathematical operations,\n // or white-space delimited Entities.\n //\n // 1px solid black\n // @var * 2\n //\n expression: function () {\n const entities = [];\n let e;\n let delim;\n const index = parserInput.i;\n\n do {\n e = this.comment();\n if (e) {\n entities.push(e);\n continue;\n }\n e = this.addition() || this.entity();\n\n if (e instanceof tree.Comment) {\n e = null;\n }\n\n if (e) {\n entities.push(e);\n // operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n if (!parserInput.peek(/^\\/[/*]/)) {\n delim = parserInput.$char('/');\n if (delim) {\n entities.push(new(tree.Anonymous)(delim, index + currentIndex));\n }\n }\n }\n } while (e);\n if (entities.length > 0) {\n return new(tree.Expression)(entities);\n }\n },\n property: function () {\n const name = parserInput.$re(/^(\\*?-?[_a-zA-Z0-9-]+)\\s*:/);\n if (name) {\n return name[1];\n }\n },\n ruleProperty: function () {\n let name = [];\n const index = [];\n let s;\n let k;\n\n parserInput.save();\n\n const simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\\s*:/);\n if (simpleProperty) {\n name = [new(tree.Keyword)(simpleProperty[1])];\n parserInput.forget();\n return name;\n }\n\n function match(re) {\n const i = parserInput.i;\n const chunk = parserInput.$re(re);\n if (chunk) {\n index.push(i);\n return name.push(chunk[1]);\n }\n }\n\n match(/^(\\*?)/);\n while (true) {\n if (!match(/^((?:[\\w-]+)|(?:[@$]\\{[\\w-]+\\}))/)) {\n break;\n }\n }\n\n if ((name.length > 1) && match(/^((?:\\+_|\\+)?)\\s*:/)) {\n parserInput.forget();\n\n // at last, we have the complete match now. move forward,\n // convert name particles to tree objects and return:\n if (name[0] === '') {\n name.shift();\n index.shift();\n }\n for (k = 0; k < name.length; k++) {\n s = name[k];\n name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ?\n new(tree.Keyword)(s) :\n (s.charAt(0) === '@' ?\n new(tree.Variable)(`@${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo) :\n new(tree.Property)(`$${s.slice(2, -1)}`, index[k] + currentIndex, fileInfo));\n }\n return name;\n }\n parserInput.restore();\n }\n }\n };\n};\nParser.serializeVars = vars => {\n let s = '';\n\n for (const name in vars) {\n if (Object.hasOwnProperty.call(vars, name)) {\n const value = vars[name];\n s += `${((name[0] === '@') ? '' : '@') + name}: ${value}${(String(value).slice(-1) === ';') ? '' : ';'}`;\n }\n }\n\n return s;\n};\n\nexport default Parser;","import Node from './node';\nimport Element from './element';\nimport LessError from '../less-error';\nimport * as utils from '../utils';\nimport Parser from '../parser/parser';\n\nconst Selector = function(elements, extendList, condition, index, currentFileInfo, visibilityInfo) {\n this.extendList = extendList;\n this.condition = condition;\n this.evaldCondition = !condition;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.elements = this.getElements(elements);\n this.mixinElements_ = undefined;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.elements, this);\n};\n\nSelector.prototype = Object.assign(new Node(), {\n type: 'Selector',\n\n accept(visitor) {\n if (this.elements) {\n this.elements = visitor.visitArray(this.elements);\n }\n if (this.extendList) {\n this.extendList = visitor.visitArray(this.extendList);\n }\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n },\n\n createDerived(elements, extendList, evaldCondition) {\n elements = this.getElements(elements);\n const newSelector = new Selector(elements, extendList || this.extendList,\n null, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n newSelector.evaldCondition = (!utils.isNullOrUndefined(evaldCondition)) ? evaldCondition : this.evaldCondition;\n newSelector.mediaEmpty = this.mediaEmpty;\n return newSelector;\n },\n\n getElements(els) {\n if (!els) {\n return [new Element('', '&', false, this._index, this._fileInfo)];\n }\n if (typeof els === 'string') {\n new Parser(this.parse.context, this.parse.importManager, this._fileInfo, this._index).parseNode(\n els,\n ['selector'],\n function(err, result) {\n if (err) {\n throw new LessError({\n index: err.index,\n message: err.message\n }, this.parse.imports, this._fileInfo.filename);\n }\n els = result[0].elements;\n });\n }\n return els;\n },\n\n createEmptySelectors() {\n const el = new Element('', '&', false, this._index, this._fileInfo), sels = [new Selector([el], null, null, this._index, this._fileInfo)];\n sels[0].mediaEmpty = true;\n return sels;\n },\n\n match(other) {\n const elements = this.elements;\n const len = elements.length;\n let olen;\n let i;\n\n other = other.mixinElements();\n olen = other.length;\n if (olen === 0 || len < olen) {\n return 0;\n } else {\n for (i = 0; i < olen; i++) {\n if (elements[i].value !== other[i]) {\n return 0;\n }\n }\n }\n\n return olen; // return number of matched elements\n },\n\n mixinElements() {\n if (this.mixinElements_) {\n return this.mixinElements_;\n }\n\n let elements = this.elements.map( function(v) {\n return v.combinator.value + (v.value.value || v.value);\n }).join('').match(/[,*.\\w-]([\\w-]|(\\\\.))*/g);\n\n if (elements) {\n if (elements[0] === '&') {\n elements.shift();\n }\n } else {\n elements = [];\n }\n\n return (this.mixinElements_ = elements);\n },\n\n isJustParentSelector() {\n return !this.mediaEmpty &&\n this.elements.length === 1 &&\n this.elements[0].value === '&' &&\n (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === '');\n },\n\n eval(context) {\n const evaldCondition = this.condition && this.condition.eval(context);\n let elements = this.elements;\n let extendList = this.extendList;\n\n elements = elements && elements.map(function (e) { return e.eval(context); });\n extendList = extendList && extendList.map(function(extend) { return extend.eval(context); });\n\n return this.createDerived(elements, extendList, evaldCondition);\n },\n\n genCSS(context, output) {\n let i, element;\n if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') {\n output.add(' ', this.fileInfo(), this.getIndex());\n }\n for (i = 0; i < this.elements.length; i++) {\n element = this.elements[i];\n element.genCSS(context, output);\n }\n },\n\n getIsOutput() {\n return this.evaldCondition;\n }\n});\n\nexport default Selector;\n","import Node from './node';\n\nconst Value = function(value) {\n if (!value) {\n throw new Error('Value requires an array argument');\n }\n if (!Array.isArray(value)) {\n this.value = [ value ];\n }\n else {\n this.value = value;\n }\n};\n\nValue.prototype = Object.assign(new Node(), {\n type: 'Value',\n\n accept(visitor) {\n if (this.value) {\n this.value = visitor.visitArray(this.value);\n }\n },\n\n eval(context) {\n if (this.value.length === 1) {\n return this.value[0].eval(context);\n } else {\n return new Value(this.value.map(function (v) {\n return v.eval(context);\n }));\n }\n },\n\n genCSS(context, output) {\n let i;\n for (i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (i + 1 < this.value.length) {\n output.add((context && context.compress) ? ',' : ', ');\n }\n }\n }\n});\n\nexport default Value;\n","import Node from './node';\n\nconst Keyword = function(value) {\n this.value = value;\n};\n\nKeyword.prototype = Object.assign(new Node(), {\n type: 'Keyword',\n\n genCSS(context, output) {\n if (this.value === '%') { throw { type: 'Syntax', message: 'Invalid % without number' }; }\n output.add(this.value);\n }\n});\n\nKeyword.True = new Keyword('true');\nKeyword.False = new Keyword('false');\n\nexport default Keyword;\n","import Node from './node';\n\nconst Anonymous = function(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {\n this.value = value;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.mapLines = mapLines;\n this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;\n this.allowRoot = true;\n this.copyVisibilityInfo(visibilityInfo);\n}\n\nAnonymous.prototype = Object.assign(new Node(), {\n type: 'Anonymous',\n eval() {\n return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());\n },\n compare(other) {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n },\n isRulesetLike() {\n return this.rulesetLike;\n },\n genCSS(context, output) {\n this.nodeVisible = Boolean(this.value);\n if (this.nodeVisible) {\n output.add(this.value, this._fileInfo, this._index, this.mapLines);\n }\n }\n})\n\nexport default Anonymous;\n","import Node from './node';\nimport Value from './value';\nimport Keyword from './keyword';\nimport Anonymous from './anonymous';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\nfunction evalName(context, name) {\n let value = '';\n let i;\n const n = name.length;\n const output = {add: function (s) {value += s;}};\n for (i = 0; i < n; i++) {\n name[i].eval(context).genCSS(context, output);\n }\n return value;\n}\n\nconst Declaration = function(name, value, important, merge, index, currentFileInfo, inline, variable) {\n this.name = name;\n this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]);\n this.important = important ? ` ${important.trim()}` : '';\n this.merge = merge;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.inline = inline || false;\n this.variable = (variable !== undefined) ? variable\n : (name.charAt && (name.charAt(0) === '@'));\n this.allowRoot = true;\n this.setParent(this.value, this);\n};\n\nDeclaration.prototype = Object.assign(new Node(), {\n type: 'Declaration',\n\n genCSS(context, output) {\n output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex());\n try {\n this.value.genCSS(context, output);\n }\n catch (e) {\n e.index = this._index;\n e.filename = this._fileInfo.filename;\n throw e;\n }\n output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index);\n },\n\n eval(context) {\n let mathBypass = false, prevMath, name = this.name, evaldValue, variable = this.variable;\n if (typeof name !== 'string') {\n // expand 'primitive' name directly to get\n // things faster (~10% for benchmark.less):\n name = (name.length === 1) && (name[0] instanceof Keyword) ?\n name[0].value : evalName(context, name);\n variable = false; // never treat expanded interpolation as new variable name\n }\n\n // @todo remove when parens-division is default\n if (name === 'font' && context.math === MATH.ALWAYS) {\n mathBypass = true;\n prevMath = context.math;\n context.math = MATH.PARENS_DIVISION;\n }\n try {\n context.importantScope.push({});\n evaldValue = this.value.eval(context);\n\n if (!this.variable && evaldValue.type === 'DetachedRuleset') {\n throw { message: 'Rulesets cannot be evaluated on a property.',\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n let important = this.important;\n const importantResult = context.importantScope.pop();\n if (!important && importantResult.important) {\n important = importantResult.important;\n }\n\n return new Declaration(name,\n evaldValue,\n important,\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline,\n variable);\n }\n catch (e) {\n if (typeof e.index !== 'number') {\n e.index = this.getIndex();\n e.filename = this.fileInfo().filename;\n }\n throw e;\n }\n finally {\n if (mathBypass) {\n context.math = prevMath;\n }\n }\n },\n\n makeImportant() {\n return new Declaration(this.name,\n this.value,\n '!important',\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline);\n }\n});\n\nexport default Declaration;","function asComment(ctx) {\n return `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\\n`;\n}\n\nfunction asMediaQuery(ctx) {\n let filenameWithProtocol = ctx.debugInfo.fileName;\n if (!/^[a-z]+:\\/\\//i.test(filenameWithProtocol)) {\n filenameWithProtocol = `file://${filenameWithProtocol}`;\n }\n return `@media -sass-debug-info{filename{font-family:${filenameWithProtocol.replace(/([.:/\\\\])/g, function (a) {\n if (a == '\\\\') {\n a = '/';\n }\n return `\\\\${a}`;\n })}}line{font-family:\\\\00003${ctx.debugInfo.lineNumber}}}\\n`;\n}\n\nfunction debugInfo(context, ctx, lineSeparator) {\n let result = '';\n if (context.dumpLineNumbers && !context.compress) {\n switch (context.dumpLineNumbers) {\n case 'comments':\n result = asComment(ctx);\n break;\n case 'mediaquery':\n result = asMediaQuery(ctx);\n break;\n case 'all':\n result = asComment(ctx) + (lineSeparator || '') + asMediaQuery(ctx);\n break;\n }\n }\n return result;\n}\n\nexport default debugInfo;\n\n","import Node from './node';\nimport getDebugInfo from './debug-info';\n\nconst Comment = function(value, isLineComment, index, currentFileInfo) {\n this.value = value;\n this.isLineComment = isLineComment;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n}\n\nComment.prototype = Object.assign(new Node(), {\n type: 'Comment',\n\n genCSS(context, output) {\n if (this.debugInfo) {\n output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n },\n\n isSilent(context) {\n const isCompressed = context.compress && this.value[2] !== '!';\n return this.isLineComment || isCompressed;\n }\n});\n\nexport default Comment;\n","import Keyword from '../tree/keyword';\nimport * as utils from '../utils';\n\nconst defaultFunc = {\n eval: function () {\n const v = this.value_;\n const e = this.error_;\n if (e) {\n throw e;\n }\n if (!utils.isNullOrUndefined(v)) {\n return v ? Keyword.True : Keyword.False;\n }\n },\n value: function (v) {\n this.value_ = v;\n },\n error: function (e) {\n this.error_ = e;\n },\n reset: function () {\n this.value_ = this.error_ = null;\n }\n};\n\nexport default defaultFunc;\n","import Node from './node';\nimport Declaration from './declaration';\nimport Keyword from './keyword';\nimport Comment from './comment';\nimport Paren from './paren';\nimport Selector from './selector';\nimport Element from './element';\nimport Anonymous from './anonymous';\nimport contexts from '../contexts';\nimport globalFunctionRegistry from '../functions/function-registry';\nimport defaultFunc from '../functions/default';\nimport getDebugInfo from './debug-info';\nimport * as utils from '../utils';\nimport Parser from '../parser/parser';\n\nconst Ruleset = function(selectors, rules, strictImports, visibilityInfo) {\n this.selectors = selectors;\n this.rules = rules;\n this._lookups = {};\n this._variables = null;\n this._properties = null;\n this.strictImports = strictImports;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n this.setParent(this.selectors, this);\n this.setParent(this.rules, this);\n}\n\nRuleset.prototype = Object.assign(new Node(), {\n type: 'Ruleset',\n isRuleset: true,\n\n isRulesetLike() { return true; },\n\n accept(visitor) {\n if (this.paths) {\n this.paths = visitor.visitArray(this.paths, true);\n } else if (this.selectors) {\n this.selectors = visitor.visitArray(this.selectors);\n }\n if (this.rules && this.rules.length) {\n this.rules = visitor.visitArray(this.rules);\n }\n },\n\n eval(context) {\n let selectors;\n let selCnt;\n let selector;\n let i;\n let hasVariable;\n let hasOnePassingSelector = false;\n\n if (this.selectors && (selCnt = this.selectors.length)) {\n selectors = new Array(selCnt);\n defaultFunc.error({\n type: 'Syntax',\n message: 'it is currently only allowed in parametric mixin guards,'\n });\n\n for (i = 0; i < selCnt; i++) {\n selector = this.selectors[i].eval(context);\n for (let j = 0; j < selector.elements.length; j++) {\n if (selector.elements[j].isVariable) {\n hasVariable = true;\n break;\n }\n }\n selectors[i] = selector;\n if (selector.evaldCondition) {\n hasOnePassingSelector = true;\n }\n }\n\n if (hasVariable) {\n const toParseSelectors = new Array(selCnt);\n for (i = 0; i < selCnt; i++) {\n selector = selectors[i];\n toParseSelectors[i] = selector.toCSS(context);\n }\n const startingIndex = selectors[0].getIndex();\n const selectorFileInfo = selectors[0].fileInfo();\n new Parser(context, this.parse.importManager, selectorFileInfo, startingIndex).parseNode(\n toParseSelectors.join(','),\n ['selectors'],\n function(err, result) {\n if (result) {\n selectors = utils.flattenArray(result);\n }\n });\n }\n\n defaultFunc.reset();\n } else {\n hasOnePassingSelector = true;\n }\n\n let rules = this.rules ? utils.copyArray(this.rules) : null;\n const ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo());\n let rule;\n let subRule;\n\n ruleset.originalRuleset = this;\n ruleset.root = this.root;\n ruleset.firstRoot = this.firstRoot;\n ruleset.allowImports = this.allowImports;\n\n if (this.debugInfo) {\n ruleset.debugInfo = this.debugInfo;\n }\n\n if (!hasOnePassingSelector) {\n rules.length = 0;\n }\n\n // inherit a function registry from the frames stack when possible;\n // otherwise from the global registry\n ruleset.functionRegistry = (function (frames) {\n let i = 0;\n const n = frames.length;\n let found;\n for ( ; i !== n ; ++i ) {\n found = frames[ i ].functionRegistry;\n if ( found ) { return found; }\n }\n return globalFunctionRegistry;\n }(context.frames)).inherit();\n\n // push the current ruleset to the frames stack\n const ctxFrames = context.frames;\n ctxFrames.unshift(ruleset);\n\n // currrent selectors\n let ctxSelectors = context.selectors;\n if (!ctxSelectors) {\n context.selectors = ctxSelectors = [];\n }\n ctxSelectors.unshift(this.selectors);\n\n // Evaluate imports\n if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) {\n ruleset.evalImports(context);\n }\n\n // Store the frames around mixin definitions,\n // so they can be evaluated like closures when the time comes.\n const rsRules = ruleset.rules;\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.evalFirst) {\n rsRules[i] = rule.eval(context);\n }\n }\n\n const mediaBlockCount = (context.mediaBlocks && context.mediaBlocks.length) || 0;\n\n // Evaluate mixin calls.\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.type === 'MixinCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).filter(function(r) {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope if the variable is\n // already there. consider returning false here\n // but we need a way to \"return\" variable from mixins\n return !(ruleset.variable(r.name));\n }\n return true;\n });\n rsRules.splice.apply(rsRules, [i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n } else if (rule.type === 'VariableCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).rules.filter(function(r) {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope at all\n return false;\n }\n return true;\n });\n rsRules.splice.apply(rsRules, [i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n if (!rule.evalFirst) {\n rsRules[i] = rule = rule.eval ? rule.eval(context) : rule;\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n // for rulesets, check if it is a css guard and can be removed\n if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) {\n // check if it can be folded in (e.g. & where)\n if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) {\n rsRules.splice(i--, 1);\n\n for (let j = 0; (subRule = rule.rules[j]); j++) {\n if (subRule instanceof Node) {\n subRule.copyVisibilityInfo(rule.visibilityInfo());\n if (!(subRule instanceof Declaration) || !subRule.variable) {\n rsRules.splice(++i, 0, subRule);\n }\n }\n }\n }\n }\n }\n\n // Pop the stack\n ctxFrames.shift();\n ctxSelectors.shift();\n\n if (context.mediaBlocks) {\n for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) {\n context.mediaBlocks[i].bubbleSelectors(selectors);\n }\n }\n\n return ruleset;\n },\n\n evalImports(context) {\n const rules = this.rules;\n let i;\n let importRules;\n if (!rules) { return; }\n\n for (i = 0; i < rules.length; i++) {\n if (rules[i].type === 'Import') {\n importRules = rules[i].eval(context);\n if (importRules && (importRules.length || importRules.length === 0)) {\n rules.splice.apply(rules, [i, 1].concat(importRules));\n i += importRules.length - 1;\n } else {\n rules.splice(i, 1, importRules);\n }\n this.resetCache();\n }\n }\n },\n\n makeImportant() {\n const result = new Ruleset(this.selectors, this.rules.map(function (r) {\n if (r.makeImportant) {\n return r.makeImportant();\n } else {\n return r;\n }\n }), this.strictImports, this.visibilityInfo());\n\n return result;\n },\n\n matchArgs(args) {\n return !args || args.length === 0;\n },\n\n // lets you call a css selector with a guard\n matchCondition(args, context) {\n const lastSelector = this.selectors[this.selectors.length - 1];\n if (!lastSelector.evaldCondition) {\n return false;\n }\n if (lastSelector.condition &&\n !lastSelector.condition.eval(\n new contexts.Eval(context,\n context.frames))) {\n return false;\n }\n return true;\n },\n\n resetCache() {\n this._rulesets = null;\n this._variables = null;\n this._properties = null;\n this._lookups = {};\n },\n\n variables() {\n if (!this._variables) {\n this._variables = !this.rules ? {} : this.rules.reduce(function (hash, r) {\n if (r instanceof Declaration && r.variable === true) {\n hash[r.name] = r;\n }\n // when evaluating variables in an import statement, imports have not been eval'd\n // so we need to go inside import statements.\n // guard against root being a string (in the case of inlined less)\n if (r.type === 'Import' && r.root && r.root.variables) {\n const vars = r.root.variables();\n for (const name in vars) {\n // eslint-disable-next-line no-prototype-builtins\n if (vars.hasOwnProperty(name)) {\n hash[name] = r.root.variable(name);\n }\n }\n }\n return hash;\n }, {});\n }\n return this._variables;\n },\n\n properties() {\n if (!this._properties) {\n this._properties = !this.rules ? {} : this.rules.reduce(function (hash, r) {\n if (r instanceof Declaration && r.variable !== true) {\n const name = (r.name.length === 1) && (r.name[0] instanceof Keyword) ?\n r.name[0].value : r.name;\n // Properties don't overwrite as they can merge\n if (!hash[`$${name}`]) {\n hash[`$${name}`] = [ r ];\n }\n else {\n hash[`$${name}`].push(r);\n }\n }\n return hash;\n }, {});\n }\n return this._properties;\n },\n\n variable(name) {\n const decl = this.variables()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n },\n\n property(name) {\n const decl = this.properties()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n },\n\n lastDeclaration() {\n for (let i = this.rules.length; i > 0; i--) {\n const decl = this.rules[i - 1];\n if (decl instanceof Declaration) {\n return this.parseValue(decl);\n }\n }\n },\n\n parseValue(toParse) {\n const self = this;\n function transformDeclaration(decl) {\n if (decl.value instanceof Anonymous && !decl.parsed) {\n if (typeof decl.value.value === 'string') {\n new Parser(this.parse.context, this.parse.importManager, decl.fileInfo(), decl.value.getIndex()).parseNode(\n decl.value.value,\n ['value', 'important'],\n function(err, result) {\n if (err) {\n decl.parsed = true;\n }\n if (result) {\n decl.value = result[0];\n decl.important = result[1] || '';\n decl.parsed = true;\n }\n });\n } else {\n decl.parsed = true;\n }\n\n return decl;\n }\n else {\n return decl;\n }\n }\n if (!Array.isArray(toParse)) {\n return transformDeclaration.call(self, toParse);\n }\n else {\n const nodes = [];\n toParse.forEach(function(n) {\n nodes.push(transformDeclaration.call(self, n));\n });\n return nodes;\n }\n },\n\n rulesets() {\n if (!this.rules) { return []; }\n\n const filtRules = [];\n const rules = this.rules;\n let i;\n let rule;\n\n for (i = 0; (rule = rules[i]); i++) {\n if (rule.isRuleset) {\n filtRules.push(rule);\n }\n }\n\n return filtRules;\n },\n\n prependRule(rule) {\n const rules = this.rules;\n if (rules) {\n rules.unshift(rule);\n } else {\n this.rules = [ rule ];\n }\n this.setParent(rule, this);\n },\n\n find(selector, self, filter) {\n self = self || this;\n const rules = [];\n let match;\n let foundMixins;\n const key = selector.toCSS();\n\n if (key in this._lookups) { return this._lookups[key]; }\n\n this.rulesets().forEach(function (rule) {\n if (rule !== self) {\n for (let j = 0; j < rule.selectors.length; j++) {\n match = selector.match(rule.selectors[j]);\n if (match) {\n if (selector.elements.length > match) {\n if (!filter || filter(rule)) {\n foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter);\n for (let i = 0; i < foundMixins.length; ++i) {\n foundMixins[i].path.push(rule);\n }\n Array.prototype.push.apply(rules, foundMixins);\n }\n } else {\n rules.push({ rule, path: []});\n }\n break;\n }\n }\n }\n });\n this._lookups[key] = rules;\n return rules;\n },\n\n genCSS(context, output) {\n let i;\n let j;\n const charsetRuleNodes = [];\n let ruleNodes = [];\n\n let // Line number debugging\n debugInfo;\n\n let rule;\n let path;\n\n context.tabLevel = (context.tabLevel || 0);\n\n if (!this.root) {\n context.tabLevel++;\n }\n\n const tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' ');\n const tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' ');\n let sep;\n\n let charsetNodeIndex = 0;\n let importNodeIndex = 0;\n for (i = 0; (rule = this.rules[i]); i++) {\n if (rule instanceof Comment) {\n if (importNodeIndex === i) {\n importNodeIndex++;\n }\n ruleNodes.push(rule);\n } else if (rule.isCharset && rule.isCharset()) {\n ruleNodes.splice(charsetNodeIndex, 0, rule);\n charsetNodeIndex++;\n importNodeIndex++;\n } else if (rule.type === 'Import') {\n ruleNodes.splice(importNodeIndex, 0, rule);\n importNodeIndex++;\n } else {\n ruleNodes.push(rule);\n }\n }\n ruleNodes = charsetRuleNodes.concat(ruleNodes);\n\n // If this is the root node, we don't render\n // a selector, or {}.\n if (!this.root) {\n debugInfo = getDebugInfo(context, this, tabSetStr);\n\n if (debugInfo) {\n output.add(debugInfo);\n output.add(tabSetStr);\n }\n\n const paths = this.paths;\n const pathCnt = paths.length;\n let pathSubCnt;\n\n sep = context.compress ? ',' : (`,\\n${tabSetStr}`);\n\n for (i = 0; i < pathCnt; i++) {\n path = paths[i];\n if (!(pathSubCnt = path.length)) { continue; }\n if (i > 0) { output.add(sep); }\n\n context.firstSelector = true;\n path[0].genCSS(context, output);\n\n context.firstSelector = false;\n for (j = 1; j < pathSubCnt; j++) {\n path[j].genCSS(context, output);\n }\n }\n\n output.add((context.compress ? '{' : ' {\\n') + tabRuleStr);\n }\n\n // Compile rules and rulesets\n for (i = 0; (rule = ruleNodes[i]); i++) {\n\n if (i + 1 === ruleNodes.length) {\n context.lastRule = true;\n }\n\n const currentLastRule = context.lastRule;\n if (rule.isRulesetLike(rule)) {\n context.lastRule = false;\n }\n\n if (rule.genCSS) {\n rule.genCSS(context, output);\n } else if (rule.value) {\n output.add(rule.value.toString());\n }\n\n context.lastRule = currentLastRule;\n\n if (!context.lastRule && rule.isVisible()) {\n output.add(context.compress ? '' : (`\\n${tabRuleStr}`));\n } else {\n context.lastRule = false;\n }\n }\n\n if (!this.root) {\n output.add((context.compress ? '}' : `\\n${tabSetStr}}`));\n context.tabLevel--;\n }\n\n if (!output.isEmpty() && !context.compress && this.firstRoot) {\n output.add('\\n');\n }\n },\n\n joinSelectors(paths, context, selectors) {\n for (let s = 0; s < selectors.length; s++) {\n this.joinSelector(paths, context, selectors[s]);\n }\n },\n\n joinSelector(paths, context, selector) {\n\n function createParenthesis(elementsToPak, originalElement) {\n let replacementParen, j;\n if (elementsToPak.length === 0) {\n replacementParen = new Paren(elementsToPak[0]);\n } else {\n const insideParent = new Array(elementsToPak.length);\n for (j = 0; j < elementsToPak.length; j++) {\n insideParent[j] = new Element(\n null,\n elementsToPak[j],\n originalElement.isVariable,\n originalElement._index,\n originalElement._fileInfo\n );\n }\n replacementParen = new Paren(new Selector(insideParent));\n }\n return replacementParen;\n }\n\n function createSelector(containedElement, originalElement) {\n let element, selector;\n element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo);\n selector = new Selector([element]);\n return selector;\n }\n\n // joins selector path from `beginningPath` with selector path in `addPath`\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns concatenated path\n function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) {\n let newSelectorPath, lastSelector, newJoinedSelector;\n // our new selector path\n newSelectorPath = [];\n\n // construct the joined selector - if & is the first thing this will be empty,\n // if not newJoinedSelector will be the last set of elements in the selector\n if (beginningPath.length > 0) {\n newSelectorPath = utils.copyArray(beginningPath);\n lastSelector = newSelectorPath.pop();\n newJoinedSelector = originalSelector.createDerived(utils.copyArray(lastSelector.elements));\n }\n else {\n newJoinedSelector = originalSelector.createDerived([]);\n }\n\n if (addPath.length > 0) {\n // /deep/ is a CSS4 selector - (removed, so should deprecate)\n // that is valid without anything in front of it\n // so if the & does not have a combinator that is \"\" or \" \" then\n // and there is a combinator on the parent, then grab that.\n // this also allows + a { & .b { .a & { ... though not sure why you would want to do that\n let combinator = replacedElement.combinator;\n\n const parentEl = addPath[0].elements[0];\n if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) {\n combinator = parentEl.combinator;\n }\n // join the elements so far with the first part of the parent\n newJoinedSelector.elements.push(new Element(\n combinator,\n parentEl.value,\n replacedElement.isVariable,\n replacedElement._index,\n replacedElement._fileInfo\n ));\n newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1));\n }\n\n // now add the joined selector - but only if it is not empty\n if (newJoinedSelector.elements.length !== 0) {\n newSelectorPath.push(newJoinedSelector);\n }\n\n // put together the parent selectors after the join (e.g. the rest of the parent)\n if (addPath.length > 1) {\n let restOfPath = addPath.slice(1);\n restOfPath = restOfPath.map(function (selector) {\n return selector.createDerived(selector.elements, []);\n });\n newSelectorPath = newSelectorPath.concat(restOfPath);\n }\n return newSelectorPath;\n }\n\n // joins selector path from `beginningPath` with every selector path in `addPaths` array\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns array with all concatenated paths\n function addAllReplacementsIntoPath( beginningPath, addPaths, replacedElement, originalSelector, result) {\n let j;\n for (j = 0; j < beginningPath.length; j++) {\n const newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector);\n result.push(newSelectorPath);\n }\n return result;\n }\n\n function mergeElementsOnToSelectors(elements, selectors) {\n let i, sel;\n\n if (elements.length === 0) {\n return ;\n }\n if (selectors.length === 0) {\n selectors.push([ new Selector(elements) ]);\n return;\n }\n\n for (i = 0; (sel = selectors[i]); i++) {\n // if the previous thing in sel is a parent this needs to join on to it\n if (sel.length > 0) {\n sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements));\n }\n else {\n sel.push(new Selector(elements));\n }\n }\n }\n\n // replace all parent selectors inside `inSelector` by content of `context` array\n // resulting selectors are returned inside `paths` array\n // returns true if `inSelector` contained at least one parent selector\n function replaceParentSelector(paths, context, inSelector) {\n // The paths are [[Selector]]\n // The first list is a list of comma separated selectors\n // The inner list is a list of inheritance separated selectors\n // e.g.\n // .a, .b {\n // .c {\n // }\n // }\n // == [[.a] [.c]] [[.b] [.c]]\n //\n let i, j, k, currentElements, newSelectors, selectorsMultiplied, sel, el, hadParentSelector = false, length, lastSelector;\n function findNestedSelector(element) {\n let maybeSelector;\n if (!(element.value instanceof Paren)) {\n return null;\n }\n\n maybeSelector = element.value.value;\n if (!(maybeSelector instanceof Selector)) {\n return null;\n }\n\n return maybeSelector;\n }\n\n // the elements from the current selector so far\n currentElements = [];\n // the current list of new selectors to add to the path.\n // We will build it up. We initiate it with one empty selector as we \"multiply\" the new selectors\n // by the parents\n newSelectors = [\n []\n ];\n\n for (i = 0; (el = inSelector.elements[i]); i++) {\n // non parent reference elements just get added\n if (el.value !== '&') {\n const nestedSelector = findNestedSelector(el);\n if (nestedSelector !== null) {\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n const nestedPaths = [];\n let replaced;\n const replacedNewSelectors = [];\n replaced = replaceParentSelector(nestedPaths, context, nestedSelector);\n hadParentSelector = hadParentSelector || replaced;\n // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors\n for (k = 0; k < nestedPaths.length; k++) {\n const replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el);\n addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors);\n }\n newSelectors = replacedNewSelectors;\n currentElements = [];\n } else {\n currentElements.push(el);\n }\n\n } else {\n hadParentSelector = true;\n // the new list of selectors to add\n selectorsMultiplied = [];\n\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n // loop through our current selectors\n for (j = 0; j < newSelectors.length; j++) {\n sel = newSelectors[j];\n // if we don't have any parent paths, the & might be in a mixin so that it can be used\n // whether there are parents or not\n if (context.length === 0) {\n // the combinator used on el should now be applied to the next element instead so that\n // it is not lost\n if (sel.length > 0) {\n sel[0].elements.push(new Element(el.combinator, '', el.isVariable, el._index, el._fileInfo));\n }\n selectorsMultiplied.push(sel);\n }\n else {\n // and the parent selectors\n for (k = 0; k < context.length; k++) {\n // We need to put the current selectors\n // then join the last selector's elements on to the parents selectors\n const newSelectorPath = addReplacementIntoPath(sel, context[k], el, inSelector);\n // add that to our new set of selectors\n selectorsMultiplied.push(newSelectorPath);\n }\n }\n }\n\n // our new selectors has been multiplied, so reset the state\n newSelectors = selectorsMultiplied;\n currentElements = [];\n }\n }\n\n // if we have any elements left over (e.g. .a& .b == .b)\n // add them on to all the current selectors\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n for (i = 0; i < newSelectors.length; i++) {\n length = newSelectors[i].length;\n if (length > 0) {\n paths.push(newSelectors[i]);\n lastSelector = newSelectors[i][length - 1];\n newSelectors[i][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList);\n }\n }\n\n return hadParentSelector;\n }\n\n function deriveSelector(visibilityInfo, deriveFrom) {\n const newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition);\n newSelector.copyVisibilityInfo(visibilityInfo);\n return newSelector;\n }\n\n // joinSelector code follows\n let i, newPaths, hadParentSelector;\n\n newPaths = [];\n hadParentSelector = replaceParentSelector(newPaths, context, selector);\n\n if (!hadParentSelector) {\n if (context.length > 0) {\n newPaths = [];\n for (i = 0; i < context.length; i++) {\n\n const concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo()));\n\n concatenated.push(selector);\n newPaths.push(concatenated);\n }\n }\n else {\n newPaths = [[selector]];\n }\n }\n\n for (i = 0; i < newPaths.length; i++) {\n paths.push(newPaths[i]);\n }\n\n }\n});\n\nexport default Ruleset;\n","import Node from './node';\nimport Selector from './selector';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\n\nconst AtRule = function(\n name,\n value,\n rules,\n index,\n currentFileInfo,\n debugInfo,\n isRooted,\n visibilityInfo\n) {\n let i;\n\n this.name = name;\n this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value);\n if (rules) {\n if (Array.isArray(rules)) {\n this.rules = rules;\n } else {\n this.rules = [rules];\n this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors();\n }\n for (i = 0; i < this.rules.length; i++) {\n this.rules[i].allowImports = true;\n }\n this.setParent(this.rules, this);\n }\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.debugInfo = debugInfo;\n this.isRooted = isRooted || false;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n}\n\nAtRule.prototype = Object.assign(new Node(), {\n type: 'AtRule',\n accept(visitor) {\n const value = this.value, rules = this.rules;\n if (rules) {\n this.rules = visitor.visitArray(rules);\n }\n if (value) {\n this.value = visitor.visit(value);\n }\n },\n\n isRulesetLike() {\n return this.rules || !this.isCharset();\n },\n\n isCharset() {\n return '@charset' === this.name;\n },\n\n genCSS(context, output) {\n const value = this.value, rules = this.rules;\n output.add(this.name, this.fileInfo(), this.getIndex());\n if (value) {\n output.add(' ');\n value.genCSS(context, output);\n }\n if (rules) {\n this.outputRuleset(context, output, rules);\n } else {\n output.add(';');\n }\n },\n\n eval(context) {\n let mediaPathBackup, mediaBlocksBackup, value = this.value, rules = this.rules;\n\n // media stored inside other atrule should not bubble over it\n // backpup media bubbling information\n mediaPathBackup = context.mediaPath;\n mediaBlocksBackup = context.mediaBlocks;\n // deleted media bubbling information\n context.mediaPath = [];\n context.mediaBlocks = [];\n\n if (value) {\n value = value.eval(context);\n }\n if (rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n rules = [rules[0].eval(context)];\n rules[0].root = true;\n }\n // restore media bubbling information\n context.mediaPath = mediaPathBackup;\n context.mediaBlocks = mediaBlocksBackup;\n\n return new AtRule(this.name, value, rules,\n this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo());\n },\n\n variable(name) {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.variable.call(this.rules[0], name);\n }\n },\n\n find() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.find.apply(this.rules[0], arguments);\n }\n },\n\n rulesets() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.rulesets.apply(this.rules[0]);\n }\n },\n\n outputRuleset(context, output, rules) {\n const ruleCnt = rules.length;\n let i;\n context.tabLevel = (context.tabLevel | 0) + 1;\n\n // Compressed\n if (context.compress) {\n output.add('{');\n for (i = 0; i < ruleCnt; i++) {\n rules[i].genCSS(context, output);\n }\n output.add('}');\n context.tabLevel--;\n return;\n }\n\n // Non-compressed\n const tabSetStr = `\\n${Array(context.tabLevel).join(' ')}`, tabRuleStr = `${tabSetStr} `;\n if (!ruleCnt) {\n output.add(` {${tabSetStr}}`);\n } else {\n output.add(` {${tabRuleStr}`);\n rules[0].genCSS(context, output);\n for (i = 1; i < ruleCnt; i++) {\n output.add(tabRuleStr);\n rules[i].genCSS(context, output);\n }\n output.add(`${tabSetStr}}`);\n }\n\n context.tabLevel--;\n }\n});\n\nexport default AtRule;\n","import Node from './node';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nconst DetachedRuleset = function(ruleset, frames) {\n this.ruleset = ruleset;\n this.frames = frames;\n this.setParent(this.ruleset, this);\n};\n\nDetachedRuleset.prototype = Object.assign(new Node(), {\n type: 'DetachedRuleset',\n evalFirst: true,\n\n accept(visitor) {\n this.ruleset = visitor.visit(this.ruleset);\n },\n\n eval(context) {\n const frames = this.frames || utils.copyArray(context.frames);\n return new DetachedRuleset(this.ruleset, frames);\n },\n\n callEval(context) {\n return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context);\n }\n});\n\nexport default DetachedRuleset;\n","import Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport * as utils from '../utils';\n\nconst Unit = function(numerator, denominator, backupUnit) {\n this.numerator = numerator ? utils.copyArray(numerator).sort() : [];\n this.denominator = denominator ? utils.copyArray(denominator).sort() : [];\n if (backupUnit) {\n this.backupUnit = backupUnit;\n } else if (numerator && numerator.length) {\n this.backupUnit = numerator[0];\n }\n};\n\nUnit.prototype = Object.assign(new Node(), {\n type: 'Unit',\n\n clone() {\n return new Unit(utils.copyArray(this.numerator), utils.copyArray(this.denominator), this.backupUnit);\n },\n\n genCSS(context, output) {\n // Dimension checks the unit is singular and throws an error if in strict math mode.\n const strictUnits = context && context.strictUnits;\n if (this.numerator.length === 1) {\n output.add(this.numerator[0]); // the ideal situation\n } else if (!strictUnits && this.backupUnit) {\n output.add(this.backupUnit);\n } else if (!strictUnits && this.denominator.length) {\n output.add(this.denominator[0]);\n }\n },\n\n toString() {\n let i, returnStr = this.numerator.join('*');\n for (i = 0; i < this.denominator.length; i++) {\n returnStr += `/${this.denominator[i]}`;\n }\n return returnStr;\n },\n\n compare(other) {\n return this.is(other.toString()) ? 0 : undefined;\n },\n\n is(unitString) {\n return this.toString().toUpperCase() === unitString.toUpperCase();\n },\n\n isLength() {\n return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS());\n },\n\n isEmpty() {\n return this.numerator.length === 0 && this.denominator.length === 0;\n },\n\n isSingular() {\n return this.numerator.length <= 1 && this.denominator.length === 0;\n },\n\n map(callback) {\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n this.numerator[i] = callback(this.numerator[i], false);\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n this.denominator[i] = callback(this.denominator[i], true);\n }\n },\n\n usedUnits() {\n let group;\n const result = {};\n let mapUnit;\n let groupName;\n\n mapUnit = function (atomicUnit) {\n // eslint-disable-next-line no-prototype-builtins\n if (group.hasOwnProperty(atomicUnit) && !result[groupName]) {\n result[groupName] = atomicUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in unitConversions) {\n // eslint-disable-next-line no-prototype-builtins\n if (unitConversions.hasOwnProperty(groupName)) {\n group = unitConversions[groupName];\n\n this.map(mapUnit);\n }\n }\n\n return result;\n },\n\n cancel() {\n const counter = {};\n let atomicUnit;\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n atomicUnit = this.numerator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) + 1;\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n atomicUnit = this.denominator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) - 1;\n }\n\n this.numerator = [];\n this.denominator = [];\n\n for (atomicUnit in counter) {\n // eslint-disable-next-line no-prototype-builtins\n if (counter.hasOwnProperty(atomicUnit)) {\n const count = counter[atomicUnit];\n\n if (count > 0) {\n for (i = 0; i < count; i++) {\n this.numerator.push(atomicUnit);\n }\n } else if (count < 0) {\n for (i = 0; i < -count; i++) {\n this.denominator.push(atomicUnit);\n }\n }\n }\n }\n\n this.numerator.sort();\n this.denominator.sort();\n }\n});\n\nexport default Unit;\n","/* eslint-disable no-prototype-builtins */\nimport Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport Unit from './unit';\nimport Color from './color';\n\n//\n// A number with a unit\n//\nconst Dimension = function(value, unit) {\n this.value = parseFloat(value);\n if (isNaN(this.value)) {\n throw new Error('Dimension is not a number.');\n }\n this.unit = (unit && unit instanceof Unit) ? unit :\n new Unit(unit ? [unit] : undefined);\n this.setParent(this.unit, this);\n};\n\nDimension.prototype = Object.assign(new Node(), {\n type: 'Dimension',\n\n accept(visitor) {\n this.unit = visitor.visit(this.unit);\n },\n\n // remove when Nodes have JSDoc types\n // eslint-disable-next-line no-unused-vars\n eval(context) {\n return this;\n },\n\n toColor() {\n return new Color([this.value, this.value, this.value]);\n },\n\n genCSS(context, output) {\n if ((context && context.strictUnits) && !this.unit.isSingular()) {\n throw new Error(`Multiple units in dimension. Correct the units or use the unit function. Bad unit: ${this.unit.toString()}`);\n }\n\n const value = this.fround(context, this.value);\n let strValue = String(value);\n\n if (value !== 0 && value < 0.000001 && value > -0.000001) {\n // would be output 1e-6 etc.\n strValue = value.toFixed(20).replace(/0+$/, '');\n }\n\n if (context && context.compress) {\n // Zero values doesn't need a unit\n if (value === 0 && this.unit.isLength()) {\n output.add(strValue);\n return;\n }\n\n // Float values doesn't need a leading zero\n if (value > 0 && value < 1) {\n strValue = (strValue).substr(1);\n }\n }\n\n output.add(strValue);\n this.unit.genCSS(context, output);\n },\n\n // In an operation between two Dimensions,\n // we default to the first Dimension's unit,\n // so `1px + 2` will yield `3px`.\n operate(context, op, other) {\n /* jshint noempty:false */\n let value = this._operate(context, op, this.value, other.value);\n let unit = this.unit.clone();\n\n if (op === '+' || op === '-') {\n if (unit.numerator.length === 0 && unit.denominator.length === 0) {\n unit = other.unit.clone();\n if (this.unit.backupUnit) {\n unit.backupUnit = this.unit.backupUnit;\n }\n } else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) {\n // do nothing\n } else {\n other = other.convertTo(this.unit.usedUnits());\n\n if (context.strictUnits && other.unit.toString() !== unit.toString()) {\n throw new Error('Incompatible units. Change the units or use the unit function. '\n + `Bad units: '${unit.toString()}' and '${other.unit.toString()}'.`);\n }\n\n value = this._operate(context, op, this.value, other.value);\n }\n } else if (op === '*') {\n unit.numerator = unit.numerator.concat(other.unit.numerator).sort();\n unit.denominator = unit.denominator.concat(other.unit.denominator).sort();\n unit.cancel();\n } else if (op === '/') {\n unit.numerator = unit.numerator.concat(other.unit.denominator).sort();\n unit.denominator = unit.denominator.concat(other.unit.numerator).sort();\n unit.cancel();\n }\n return new Dimension(value, unit);\n },\n\n compare(other) {\n let a, b;\n\n if (!(other instanceof Dimension)) {\n return undefined;\n }\n\n if (this.unit.isEmpty() || other.unit.isEmpty()) {\n a = this;\n b = other;\n } else {\n a = this.unify();\n b = other.unify();\n if (a.unit.compare(b.unit) !== 0) {\n return undefined;\n }\n }\n\n return Node.numericCompare(a.value, b.value);\n },\n\n unify() {\n return this.convertTo({ length: 'px', duration: 's', angle: 'rad' });\n },\n\n convertTo(conversions) {\n let value = this.value;\n const unit = this.unit.clone();\n let i;\n let groupName;\n let group;\n let targetUnit;\n let derivedConversions = {};\n let applyUnit;\n\n if (typeof conversions === 'string') {\n for (i in unitConversions) {\n if (unitConversions[i].hasOwnProperty(conversions)) {\n derivedConversions = {};\n derivedConversions[i] = conversions;\n }\n }\n conversions = derivedConversions;\n }\n applyUnit = function (atomicUnit, denominator) {\n if (group.hasOwnProperty(atomicUnit)) {\n if (denominator) {\n value = value / (group[atomicUnit] / group[targetUnit]);\n } else {\n value = value * (group[atomicUnit] / group[targetUnit]);\n }\n\n return targetUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in conversions) {\n if (conversions.hasOwnProperty(groupName)) {\n targetUnit = conversions[groupName];\n group = unitConversions[groupName];\n\n unit.map(applyUnit);\n }\n }\n\n unit.cancel();\n\n return new Dimension(value, unit);\n }\n});\n\nexport default Dimension;\n","import Node from './node';\nimport Color from './color';\nimport Dimension from './dimension';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\n\nconst Operation = function(op, operands, isSpaced) {\n this.op = op.trim();\n this.operands = operands;\n this.isSpaced = isSpaced;\n};\n\nOperation.prototype = Object.assign(new Node(), {\n type: 'Operation',\n\n accept(visitor) {\n this.operands = visitor.visitArray(this.operands);\n },\n\n eval(context) {\n let a = this.operands[0].eval(context), b = this.operands[1].eval(context), op;\n\n if (context.isMathOn(this.op)) {\n op = this.op === './' ? '/' : this.op;\n if (a instanceof Dimension && b instanceof Color) {\n a = a.toColor();\n }\n if (b instanceof Dimension && a instanceof Color) {\n b = b.toColor();\n }\n if (!a.operate || !b.operate) {\n if (\n (a instanceof Operation || b instanceof Operation)\n && a.op === '/' && context.math === MATH.PARENS_DIVISION\n ) {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n throw { type: 'Operation',\n message: 'Operation on an invalid type' };\n }\n\n return a.operate(context, op, b);\n } else {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n },\n\n genCSS(context, output) {\n this.operands[0].genCSS(context, output);\n if (this.isSpaced) {\n output.add(' ');\n }\n output.add(this.op);\n if (this.isSpaced) {\n output.add(' ');\n }\n this.operands[1].genCSS(context, output);\n }\n});\n\nexport default Operation;\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import Node from './node';\nimport Paren from './paren';\nimport Comment from './comment';\nimport Dimension from './dimension';\nimport Anonymous from './anonymous';\n\nconst Expression = function(value, noSpacing) {\n this.value = value;\n this.noSpacing = noSpacing;\n if (!value) {\n throw new Error('Expression requires an array parameter');\n }\n};\n\nExpression.prototype = Object.assign(new Node(), {\n type: 'Expression',\n\n accept(visitor) {\n this.value = visitor.visitArray(this.value);\n },\n\n eval(context) {\n let returnValue;\n const mathOn = context.isMathOn();\n const inParenthesis = this.parens;\n\n let doubleParen = false;\n if (inParenthesis) {\n context.inParenthesis();\n }\n if (this.value.length > 1) {\n returnValue = new Expression(this.value.map(function (e) {\n if (!e.eval) {\n return e;\n }\n return e.eval(context);\n }), this.noSpacing);\n } else if (this.value.length === 1) {\n if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) {\n doubleParen = true;\n }\n returnValue = this.value[0].eval(context);\n } else {\n returnValue = this;\n }\n if (inParenthesis) {\n context.outOfParenthesis();\n }\n if (this.parens && this.parensInOp && !mathOn && !doubleParen \n && (!(returnValue instanceof Dimension))) {\n returnValue = new Paren(returnValue);\n }\n return returnValue;\n },\n\n genCSS(context, output) {\n for (let i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (!this.noSpacing && i + 1 < this.value.length) {\n if (!this.noSpacing && i + 1 < this.value.length) {\n if (i + 1 < this.value.length && !(this.value[i + 1] instanceof Anonymous) ||\n this.value[i + 1] instanceof Anonymous && this.value[i + 1].value !== ',') {\n output.add(' ');\n }\n }\n }\n }\n },\n\n throwAwayComments() {\n this.value = this.value.filter(function(v) {\n return !(v instanceof Comment);\n });\n }\n});\n\nexport default Expression;\n","import Expression from '../tree/expression';\n\nclass functionCaller {\n constructor(name, context, index, currentFileInfo) {\n this.name = name.toLowerCase();\n this.index = index;\n this.context = context;\n this.currentFileInfo = currentFileInfo;\n\n this.func = context.frames[0].functionRegistry.get(this.name);\n }\n\n isValid() {\n return Boolean(this.func);\n }\n\n call(args) {\n if (!(Array.isArray(args))) {\n args = [args];\n }\n const evalArgs = this.func.evalArgs;\n if (evalArgs !== false) {\n args = args.map(a => a.eval(this.context));\n }\n const commentFilter = item => !(item.type === 'Comment');\n\n // This code is terrible and should be replaced as per this issue...\n // https://github.com/less/less.js/issues/2477\n args = args\n .filter(commentFilter)\n .map(item => {\n if (item.type === 'Expression') {\n const subNodes = item.value.filter(commentFilter);\n if (subNodes.length === 1) {\n // https://github.com/less/less.js/issues/3616\n if (item.parens && subNodes[0].op === '/') {\n return item;\n }\n return subNodes[0];\n } else {\n return new Expression(subNodes);\n }\n }\n return item;\n });\n\n if (evalArgs === false) {\n return this.func(this.context, ...args);\n }\n\n return this.func(...args);\n }\n}\n\nexport default functionCaller;\n","import Node from './node';\nimport Anonymous from './anonymous';\nimport FunctionCaller from '../functions/function-caller';\n\n//\n// A function call node.\n//\nconst Call = function(name, args, index, currentFileInfo) {\n this.name = name;\n this.args = args;\n this.calc = name === 'calc';\n this._index = index;\n this._fileInfo = currentFileInfo;\n}\n\nCall.prototype = Object.assign(new Node(), {\n type: 'Call',\n\n accept(visitor) {\n if (this.args) {\n this.args = visitor.visitArray(this.args);\n }\n },\n\n //\n // When evaluating a function call,\n // we either find the function in the functionRegistry,\n // in which case we call it, passing the evaluated arguments,\n // if this returns null or we cannot find the function, we\n // simply print it out as it appeared originally [2].\n //\n // The reason why we evaluate the arguments, is in the case where\n // we try to pass a variable to a function, like: `saturate(@color)`.\n // The function should receive the value, not the variable.\n //\n eval(context) {\n /**\n * Turn off math for calc(), and switch back on for evaluating nested functions\n */\n const currentMathContext = context.mathOn;\n context.mathOn = !this.calc;\n if (this.calc || context.inCalc) {\n context.enterCalc();\n }\n\n const exitCalc = () => {\n if (this.calc || context.inCalc) {\n context.exitCalc();\n }\n context.mathOn = currentMathContext;\n };\n\n let result;\n const funcCaller = new FunctionCaller(this.name, context, this.getIndex(), this.fileInfo());\n\n if (funcCaller.isValid()) {\n try {\n result = funcCaller.call(this.args);\n exitCalc();\n } catch (e) {\n // eslint-disable-next-line no-prototype-builtins\n if (e.hasOwnProperty('line') && e.hasOwnProperty('column')) {\n throw e;\n }\n throw { \n type: e.type || 'Runtime',\n message: `Error evaluating function \\`${this.name}\\`${e.message ? `: ${e.message}` : ''}`,\n index: this.getIndex(), \n filename: this.fileInfo().filename,\n line: e.lineNumber,\n column: e.columnNumber\n };\n }\n }\n\n if (result !== null && result !== undefined) {\n // Results that that are not nodes are cast as Anonymous nodes\n // Falsy values or booleans are returned as empty nodes\n if (!(result instanceof Node)) {\n if (!result || result === true) {\n result = new Anonymous(null); \n }\n else {\n result = new Anonymous(result.toString()); \n }\n \n }\n result._index = this._index;\n result._fileInfo = this._fileInfo;\n return result;\n }\n\n const args = this.args.map(a => a.eval(context));\n exitCalc();\n\n return new Call(this.name, args, this.getIndex(), this.fileInfo());\n },\n\n genCSS(context, output) {\n output.add(`${this.name}(`, this.fileInfo(), this.getIndex());\n\n for (let i = 0; i < this.args.length; i++) {\n this.args[i].genCSS(context, output);\n if (i + 1 < this.args.length) {\n output.add(', ');\n }\n }\n\n output.add(')');\n }\n});\n\nexport default Call;\n","import Node from './node';\nimport Call from './call';\n\nconst Variable = function(name, index, currentFileInfo) {\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n};\n\nVariable.prototype = Object.assign(new Node(), {\n type: 'Variable',\n\n eval(context) {\n let variable, name = this.name;\n\n if (name.indexOf('@@') === 0) {\n name = `@${new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value}`;\n }\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive variable definition for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n variable = this.find(context.frames, function (frame) {\n const v = frame.variable(name);\n if (v) {\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n // If in calc, wrap vars in a function call to cascade evaluate args first\n if (context.inCalc) {\n return (new Call('_SELF', [v.value])).eval(context);\n }\n else {\n return v.value.eval(context);\n }\n }\n });\n if (variable) {\n this.evaluating = false;\n return variable;\n } else {\n throw { type: 'Name',\n message: `variable ${name} is undefined`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n },\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n});\n\nexport default Variable;\n","import Node from './node';\nimport Declaration from './declaration';\n\nconst Property = function(name, index, currentFileInfo) {\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n};\n\nProperty.prototype = Object.assign(new Node(), {\n type: 'Property',\n\n eval(context) {\n let property;\n const name = this.name;\n // TODO: shorten this reference\n const mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive property reference for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n property = this.find(context.frames, function (frame) {\n let v;\n const vArr = frame.property(name);\n if (vArr) {\n for (let i = 0; i < vArr.length; i++) {\n v = vArr[i];\n\n vArr[i] = new Declaration(v.name,\n v.value,\n v.important,\n v.merge,\n v.index,\n v.currentFileInfo,\n v.inline,\n v.variable\n );\n }\n mergeRules(vArr);\n\n v = vArr[vArr.length - 1];\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n v = v.value.eval(context);\n return v;\n }\n });\n if (property) {\n this.evaluating = false;\n return property;\n } else {\n throw { type: 'Name',\n message: `Property '${name}' is undefined`,\n filename: this.currentFileInfo.filename,\n index: this.index };\n }\n },\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n});\n\nexport default Property;\n","import Node from './node';\n\nconst Attribute = function(key, op, value, cif) {\n this.key = key;\n this.op = op;\n this.value = value;\n this.cif = cif;\n}\n\nAttribute.prototype = Object.assign(new Node(), {\n type: 'Attribute',\n\n eval(context) {\n return new Attribute(\n this.key.eval ? this.key.eval(context) : this.key,\n this.op,\n (this.value && this.value.eval) ? this.value.eval(context) : this.value,\n this.cif\n );\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n },\n\n toCSS(context) {\n let value = this.key.toCSS ? this.key.toCSS(context) : this.key;\n\n if (this.op) {\n value += this.op;\n value += (this.value.toCSS ? this.value.toCSS(context) : this.value);\n }\n\n if (this.cif) {\n value = value + ' ' + this.cif;\n }\n\n return `[${value}]`;\n }\n});\n\nexport default Attribute;\n","import Node from './node';\nimport Variable from './variable';\nimport Property from './property';\n\nconst Quoted = function(str, content, escaped, index, currentFileInfo) {\n this.escaped = (escaped === undefined) ? true : escaped;\n this.value = content || '';\n this.quote = str.charAt(0);\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.variableRegex = /@\\{([\\w-]+)\\}/g;\n this.propRegex = /\\$\\{([\\w-]+)\\}/g;\n this.allowRoot = escaped;\n};\n\nQuoted.prototype = Object.assign(new Node(), {\n type: 'Quoted',\n\n genCSS(context, output) {\n if (!this.escaped) {\n output.add(this.quote, this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n if (!this.escaped) {\n output.add(this.quote);\n }\n },\n\n containsVariables() {\n return this.value.match(this.variableRegex);\n },\n\n eval(context) {\n const that = this;\n let value = this.value;\n const variableReplacement = function (_, name) {\n const v = new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n const propertyReplacement = function (_, name) {\n const v = new Property(`$${name}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n function iterativeReplace(value, regexp, replacementFnc) {\n let evaluatedValue = value;\n do {\n value = evaluatedValue.toString();\n evaluatedValue = value.replace(regexp, replacementFnc);\n } while (value !== evaluatedValue);\n return evaluatedValue;\n }\n value = iterativeReplace(value, this.variableRegex, variableReplacement);\n value = iterativeReplace(value, this.propRegex, propertyReplacement);\n return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo());\n },\n\n compare(other) {\n // when comparing quoted strings allow the quote to differ\n if (other.type === 'Quoted' && !this.escaped && !other.escaped) {\n return Node.numericCompare(this.value, other.value);\n } else {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n }\n }\n});\n\nexport default Quoted;\n","import Node from './node';\n\nfunction escapePath(path) {\n return path.replace(/[()'\"\\s]/g, function(match) { return `\\\\${match}`; });\n}\n\nconst URL = function(val, index, currentFileInfo, isEvald) {\n this.value = val;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.isEvald = isEvald;\n};\n\nURL.prototype = Object.assign(new Node(), {\n type: 'Url',\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n },\n\n genCSS(context, output) {\n output.add('url(');\n this.value.genCSS(context, output);\n output.add(')');\n },\n\n eval(context) {\n const val = this.value.eval(context);\n let rootpath;\n\n if (!this.isEvald) {\n // Add the rootpath if the URL requires a rewrite\n rootpath = this.fileInfo() && this.fileInfo().rootpath;\n if (typeof rootpath === 'string' &&\n typeof val.value === 'string' &&\n context.pathRequiresRewrite(val.value)) {\n if (!val.quote) {\n rootpath = escapePath(rootpath);\n }\n val.value = context.rewritePath(val.value, rootpath);\n } else {\n val.value = context.normalizePath(val.value);\n }\n\n // Add url args if enabled\n if (context.urlArgs) {\n if (!val.value.match(/^\\s*data:/)) {\n const delimiter = val.value.indexOf('?') === -1 ? '?' : '&';\n const urlArgs = delimiter + context.urlArgs;\n if (val.value.indexOf('#') !== -1) {\n val.value = val.value.replace('#', `${urlArgs}#`);\n } else {\n val.value += urlArgs;\n }\n }\n }\n }\n\n return new URL(val, this.getIndex(), this.fileInfo(), true);\n }\n});\n\nexport default URL;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport Anonymous from './anonymous';\nimport Expression from './expression';\nimport * as utils from '../utils';\n\nconst NestableAtRulePrototype = {\n\n isRulesetLike() {\n return true;\n },\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n if (this.rules) {\n this.rules = visitor.visitArray(this.rules);\n }\n },\n\n evalTop(context) {\n let result = this;\n\n // Render all dependent Media blocks.\n if (context.mediaBlocks.length > 1) {\n const selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors();\n result = new Ruleset(selectors, context.mediaBlocks);\n result.multiMedia = true;\n result.copyVisibilityInfo(this.visibilityInfo());\n this.setParent(result, this);\n }\n\n delete context.mediaBlocks;\n delete context.mediaPath;\n\n return result;\n },\n\n evalNested(context) {\n let i;\n let value;\n const path = context.mediaPath.concat([this]);\n\n // Extract the media-query conditions separated with `,` (OR).\n for (i = 0; i < path.length; i++) {\n value = path[i].features instanceof Value ?\n path[i].features.value : path[i].features;\n path[i] = Array.isArray(value) ? value : [value];\n }\n\n // Trace all permutations to generate the resulting media-query.\n //\n // (a, b and c) with nested (d, e) ->\n // a and d\n // a and e\n // b and c and d\n // b and c and e\n this.features = new Value(this.permute(path).map(path => {\n path = path.map(fragment => fragment.toCSS ? fragment : new Anonymous(fragment));\n\n for (i = path.length - 1; i > 0; i--) {\n path.splice(i, 0, new Anonymous('and'));\n }\n\n return new Expression(path);\n }));\n this.setParent(this.features, this);\n\n // Fake a tree-node that doesn't output anything.\n return new Ruleset([], []);\n },\n\n permute(arr) {\n if (arr.length === 0) {\n return [];\n } else if (arr.length === 1) {\n return arr[0];\n } else {\n const result = [];\n const rest = this.permute(arr.slice(1));\n for (let i = 0; i < rest.length; i++) {\n for (let j = 0; j < arr[0].length; j++) {\n result.push([arr[0][j]].concat(rest[i]));\n }\n }\n return result;\n }\n },\n\n bubbleSelectors(selectors) {\n if (!selectors) {\n return;\n }\n this.rules = [new Ruleset(utils.copyArray(selectors), [this.rules[0]])];\n this.setParent(this.rules, this);\n }\n};\n\nexport default NestableAtRulePrototype;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport AtRule from './atrule';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst Media = function(value, features, index, currentFileInfo, visibilityInfo) {\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n};\n\nMedia.prototype = Object.assign(new AtRule(), {\n type: 'Media',\n\n ...NestableAtRulePrototype,\n\n genCSS(context, output) {\n output.add('@media ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n },\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n});\n\nexport default Media;\n","import Node from './node';\nimport Media from './media';\nimport URL from './url';\nimport Quoted from './quoted';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\nimport * as utils from '../utils';\nimport LessError from '../less-error';\n\n//\n// CSS @import node\n//\n// The general strategy here is that we don't want to wait\n// for the parsing to be completed, before we start importing\n// the file. That's because in the context of a browser,\n// most of the time will be spent waiting for the server to respond.\n//\n// On creation, we push the import path to our import queue, though\n// `import,push`, we also pass it a callback, which it'll call once\n// the file has been fetched, and parsed.\n//\nconst Import = function(path, features, options, index, currentFileInfo, visibilityInfo) {\n this.options = options;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.path = path;\n this.features = features;\n this.allowRoot = true;\n\n if (this.options.less !== undefined || this.options.inline) {\n this.css = !this.options.less || this.options.inline;\n } else {\n const pathValue = this.getPath();\n if (pathValue && /[#.&?]css([?;].*)?$/.test(pathValue)) {\n this.css = true;\n }\n }\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.features, this);\n this.setParent(this.path, this);\n};\n\nImport.prototype = Object.assign(new Node(), {\n type: 'Import',\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n this.path = visitor.visit(this.path);\n if (!this.options.isPlugin && !this.options.inline && this.root) {\n this.root = visitor.visit(this.root);\n }\n },\n\n genCSS(context, output) {\n if (this.css && this.path._fileInfo.reference === undefined) {\n output.add('@import ', this._fileInfo, this._index);\n this.path.genCSS(context, output);\n if (this.features) {\n output.add(' ');\n this.features.genCSS(context, output);\n }\n output.add(';');\n }\n },\n\n getPath() {\n return (this.path instanceof URL) ?\n this.path.value.value : this.path.value;\n },\n\n isVariableImport() {\n let path = this.path;\n if (path instanceof URL) {\n path = path.value;\n }\n if (path instanceof Quoted) {\n return path.containsVariables();\n }\n\n return true;\n },\n\n evalForImport(context) {\n let path = this.path;\n\n if (path instanceof URL) {\n path = path.value;\n }\n\n return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo());\n },\n\n evalPath(context) {\n const path = this.path.eval(context);\n const fileInfo = this._fileInfo;\n\n if (!(path instanceof URL)) {\n // Add the rootpath if the URL requires a rewrite\n const pathValue = path.value;\n if (fileInfo &&\n pathValue &&\n context.pathRequiresRewrite(pathValue)) {\n path.value = context.rewritePath(pathValue, fileInfo.rootpath);\n } else {\n path.value = context.normalizePath(path.value);\n }\n }\n\n return path;\n },\n\n eval(context) {\n const result = this.doEval(context);\n if (this.options.reference || this.blocksVisibility()) {\n if (result.length || result.length === 0) {\n result.forEach(function (node) {\n node.addVisibilityBlock();\n }\n );\n } else {\n result.addVisibilityBlock();\n }\n }\n return result;\n },\n\n doEval(context) {\n let ruleset;\n let registry;\n const features = this.features && this.features.eval(context);\n\n if (this.options.isPlugin) {\n if (this.root && this.root.eval) {\n try {\n this.root.eval(context);\n }\n catch (e) {\n e.message = 'Plugin error during evaluation';\n throw new LessError(e, this.root.imports, this.root.filename);\n }\n }\n registry = context.frames[0] && context.frames[0].functionRegistry;\n if ( registry && this.root && this.root.functions ) {\n registry.addMultiple( this.root.functions );\n }\n\n return [];\n }\n\n if (this.skip) {\n if (typeof this.skip === 'function') {\n this.skip = this.skip();\n }\n if (this.skip) {\n return [];\n }\n }\n if (this.options.inline) {\n const contents = new Anonymous(this.root, 0,\n {\n filename: this.importedFilename,\n reference: this.path._fileInfo && this.path._fileInfo.reference\n }, true, true);\n\n return this.features ? new Media([contents], this.features.value) : [contents];\n } else if (this.css) {\n const newImport = new Import(this.evalPath(context), features, this.options, this._index);\n if (!newImport.css && this.error) {\n throw this.error;\n }\n return newImport;\n } else if (this.root) {\n ruleset = new Ruleset(null, utils.copyArray(this.root.rules));\n ruleset.evalImports(context);\n\n return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules;\n } else {\n return [];\n }\n }\n});\n\nexport default Import;\n","import Node from './node';\nimport Variable from './variable';\n\nconst JsEvalNode = function() {};\n\nJsEvalNode.prototype = Object.assign(new Node(), {\n evaluateJavaScript(expression, context) {\n let result;\n const that = this;\n const evalContext = {};\n\n if (!context.javascriptEnabled) {\n throw { message: 'Inline JavaScript is not enabled. Is it set in your options?',\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n expression = expression.replace(/@\\{([\\w-]+)\\}/g, function (_, name) {\n return that.jsify(new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context));\n });\n\n try {\n expression = new Function(`return (${expression})`);\n } catch (e) {\n throw { message: `JavaScript evaluation error: ${e.message} from \\`${expression}\\`` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n const variables = context.frames[0].variables();\n for (const k in variables) {\n // eslint-disable-next-line no-prototype-builtins\n if (variables.hasOwnProperty(k)) {\n evalContext[k.slice(1)] = {\n value: variables[k].value,\n toJS: function () {\n return this.value.eval(context).toCSS();\n }\n };\n }\n }\n\n try {\n result = expression.call(evalContext);\n } catch (e) {\n throw { message: `JavaScript evaluation error: '${e.name}: ${e.message.replace(/[\"]/g, '\\'')}'` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n return result;\n },\n\n jsify(obj) {\n if (Array.isArray(obj.value) && (obj.value.length > 1)) {\n return `[${obj.value.map(function (v) { return v.toCSS(); }).join(', ')}]`;\n } else {\n return obj.toCSS();\n }\n }\n});\n\nexport default JsEvalNode;\n","import JsEvalNode from './js-eval-node';\nimport Dimension from './dimension';\nimport Quoted from './quoted';\nimport Anonymous from './anonymous';\n\nconst JavaScript = function(string, escaped, index, currentFileInfo) {\n this.escaped = escaped;\n this.expression = string;\n this._index = index;\n this._fileInfo = currentFileInfo;\n}\n\nJavaScript.prototype = Object.assign(new JsEvalNode(), {\n type: 'JavaScript',\n\n eval(context) {\n const result = this.evaluateJavaScript(this.expression, context);\n const type = typeof result;\n\n if (type === 'number' && !isNaN(result)) {\n return new Dimension(result);\n } else if (type === 'string') {\n return new Quoted(`\"${result}\"`, result, this.escaped, this._index);\n } else if (Array.isArray(result)) {\n return new Anonymous(result.join(', '));\n } else {\n return new Anonymous(result);\n }\n }\n});\n\nexport default JavaScript;\n","import Node from './node';\n\nconst Assignment = function(key, val) {\n this.key = key;\n this.value = val;\n}\n\nAssignment.prototype = Object.assign(new Node(), {\n type: 'Assignment',\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n },\n\n eval(context) {\n if (this.value.eval) {\n return new Assignment(this.key, this.value.eval(context));\n }\n return this;\n },\n\n genCSS(context, output) {\n output.add(`${this.key}=`);\n if (this.value.genCSS) {\n this.value.genCSS(context, output);\n } else {\n output.add(this.value);\n }\n }\n});\n\nexport default Assignment;\n","import Node from './node';\n\nconst Condition = function(op, l, r, i, negate) {\n this.op = op.trim();\n this.lvalue = l;\n this.rvalue = r;\n this._index = i;\n this.negate = negate;\n};\n\nCondition.prototype = Object.assign(new Node(), {\n type: 'Condition',\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.rvalue = visitor.visit(this.rvalue);\n },\n\n eval(context) {\n const result = (function (op, a, b) {\n switch (op) {\n case 'and': return a && b;\n case 'or': return a || b;\n default:\n switch (Node.compare(a, b)) {\n case -1:\n return op === '<' || op === '=<' || op === '<=';\n case 0:\n return op === '=' || op === '>=' || op === '=<' || op === '<=';\n case 1:\n return op === '>' || op === '>=';\n default:\n return false;\n }\n }\n })(this.op, this.lvalue.eval(context), this.rvalue.eval(context));\n\n return this.negate ? !result : result;\n }\n});\n\nexport default Condition;\n","import Node from './node';\n\nconst QueryInParens = function (op, l, m, op2, r, i) {\n this.op = op.trim();\n this.lvalue = l;\n this.mvalue = m;\n this.op2 = op2 ? op2.trim() : null;\n this.rvalue = r;\n this._index = i;\n};\n\nQueryInParens.prototype = Object.assign(new Node(), {\n type: 'QueryInParens',\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.mvalue = visitor.visit(this.mvalue);\n if (this.rvalue) {\n this.rvalue = visitor.visit(this.rvalue);\n }\n },\n\n eval(context) {\n this.lvalue = this.lvalue.eval(context);\n this.mvalue = this.mvalue.eval(context);\n if (this.rvalue) {\n this.rvalue = this.rvalue.eval(context);\n }\n return this;\n },\n\n genCSS(context, output) {\n this.lvalue.genCSS(context, output);\n output.add(' ' + this.op + ' ');\n this.mvalue.genCSS(context, output);\n if (this.rvalue) {\n output.add(' ' + this.op2 + ' ');\n this.rvalue.genCSS(context, output);\n }\n },\n});\n\nexport default QueryInParens;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport AtRule from './atrule';\nimport NestableAtRulePrototype from './nested-at-rule';\n\nconst Container = function(value, features, index, currentFileInfo, visibilityInfo) {\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n};\n\nContainer.prototype = Object.assign(new AtRule(), {\n type: 'Container',\n\n ...NestableAtRulePrototype,\n\n genCSS(context, output) {\n output.add('@container ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n },\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Container(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n});\n\nexport default Container;\n","import Node from './node';\n\nconst UnicodeDescriptor = function(value) {\n this.value = value;\n}\n\nUnicodeDescriptor.prototype = Object.assign(new Node(), {\n type: 'UnicodeDescriptor'\n})\n\nexport default UnicodeDescriptor;\n","import Node from './node';\nimport Operation from './operation';\nimport Dimension from './dimension';\n\nconst Negative = function(node) {\n this.value = node;\n};\n\nNegative.prototype = Object.assign(new Node(), {\n type: 'Negative',\n\n genCSS(context, output) {\n output.add('-');\n this.value.genCSS(context, output);\n },\n\n eval(context) {\n if (context.isMathOn()) {\n return (new Operation('*', [new Dimension(-1), this.value])).eval(context);\n }\n return new Negative(this.value.eval(context));\n }\n});\n\nexport default Negative;\n","import Node from './node';\nimport Selector from './selector';\n\nconst Extend = function(selector, option, index, currentFileInfo, visibilityInfo) {\n this.selector = selector;\n this.option = option;\n this.object_id = Extend.next_id++;\n this.parent_ids = [this.object_id];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n switch (option) {\n case 'all':\n this.allowBefore = true;\n this.allowAfter = true;\n break;\n default:\n this.allowBefore = false;\n this.allowAfter = false;\n break;\n }\n this.setParent(this.selector, this);\n};\n\nExtend.prototype = Object.assign(new Node(), {\n type: 'Extend',\n\n accept(visitor) {\n this.selector = visitor.visit(this.selector);\n },\n\n eval(context) {\n return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n // remove when Nodes have JSDoc types\n // eslint-disable-next-line no-unused-vars\n clone(context) {\n return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n // it concatenates (joins) all selectors in selector array\n findSelfSelectors(selectors) {\n let selfElements = [], i, selectorElements;\n\n for (i = 0; i < selectors.length; i++) {\n selectorElements = selectors[i].elements;\n // duplicate the logic in genCSS function inside the selector node.\n // future TODO - move both logics into the selector joiner visitor\n if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') {\n selectorElements[0].combinator.value = ' ';\n }\n selfElements = selfElements.concat(selectors[i].elements);\n }\n\n this.selfSelectors = [new Selector(selfElements)];\n this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo());\n }\n});\n\nExtend.next_id = 0;\nexport default Extend;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport DetachedRuleset from './detached-ruleset';\nimport LessError from '../less-error';\n\nconst VariableCall = function(variable, index, currentFileInfo) {\n this.variable = variable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n};\n\nVariableCall.prototype = Object.assign(new Node(), {\n type: 'VariableCall',\n\n eval(context) {\n let rules;\n let detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context);\n const error = new LessError({message: `Could not evaluate variable call ${this.variable}`});\n\n if (!detachedRuleset.ruleset) {\n if (detachedRuleset.rules) {\n rules = detachedRuleset;\n }\n else if (Array.isArray(detachedRuleset)) {\n rules = new Ruleset('', detachedRuleset);\n }\n else if (Array.isArray(detachedRuleset.value)) {\n rules = new Ruleset('', detachedRuleset.value);\n }\n else {\n throw error;\n }\n detachedRuleset = new DetachedRuleset(rules);\n }\n\n if (detachedRuleset.ruleset) {\n return detachedRuleset.callEval(context);\n }\n throw error;\n }\n});\n\nexport default VariableCall;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport Selector from './selector';\n\nconst NamespaceValue = function(ruleCall, lookups, index, fileInfo) {\n this.value = ruleCall;\n this.lookups = lookups;\n this._index = index;\n this._fileInfo = fileInfo;\n};\n\nNamespaceValue.prototype = Object.assign(new Node(), {\n type: 'NamespaceValue',\n\n eval(context) {\n let i, name, rules = this.value.eval(context);\n \n for (i = 0; i < this.lookups.length; i++) {\n name = this.lookups[i];\n\n /**\n * Eval'd DRs return rulesets.\n * Eval'd mixins return rules, so let's make a ruleset if we need it.\n * We need to do this because of late parsing of values\n */\n if (Array.isArray(rules)) {\n rules = new Ruleset([new Selector()], rules);\n }\n\n if (name === '') {\n rules = rules.lastDeclaration();\n }\n else if (name.charAt(0) === '@') {\n if (name.charAt(1) === '@') {\n name = `@${new Variable(name.substr(1)).eval(context).value}`;\n }\n if (rules.variables) {\n rules = rules.variable(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `variable ${name} not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n }\n else {\n if (name.substring(0, 2) === '$@') {\n name = `$${new Variable(name.substr(1)).eval(context).value}`;\n }\n else {\n name = name.charAt(0) === '$' ? name : `$${name}`;\n }\n if (rules.properties) {\n rules = rules.property(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `property \"${name.substr(1)}\" not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n // Properties are an array of values, since a ruleset can have multiple props.\n // We pick the last one (the \"cascaded\" value)\n rules = rules[rules.length - 1];\n }\n\n if (rules.value) {\n rules = rules.eval(context).value;\n }\n if (rules.ruleset) {\n rules = rules.ruleset.eval(context);\n }\n }\n return rules;\n }\n});\n\nexport default NamespaceValue;\n","import Selector from './selector';\nimport Element from './element';\nimport Ruleset from './ruleset';\nimport Declaration from './declaration';\nimport DetachedRuleset from './detached-ruleset';\nimport Expression from './expression';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nconst Definition = function(name, params, rules, condition, variadic, frames, visibilityInfo) {\n this.name = name || 'anonymous mixin';\n this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])];\n this.params = params;\n this.condition = condition;\n this.variadic = variadic;\n this.arity = params.length;\n this.rules = rules;\n this._lookups = {};\n const optionalParameters = [];\n this.required = params.reduce(function (count, p) {\n if (!p.name || (p.name && !p.value)) {\n return count + 1;\n }\n else {\n optionalParameters.push(p.name);\n return count;\n }\n }, 0);\n this.optionalParameters = optionalParameters;\n this.frames = frames;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n}\n\nDefinition.prototype = Object.assign(new Ruleset(), {\n type: 'MixinDefinition',\n evalFirst: true,\n\n accept(visitor) {\n if (this.params && this.params.length) {\n this.params = visitor.visitArray(this.params);\n }\n this.rules = visitor.visitArray(this.rules);\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n },\n\n evalParams(context, mixinEnv, args, evaldArguments) {\n /* jshint boss:true */\n const frame = new Ruleset(null, null);\n\n let varargs;\n let arg;\n const params = utils.copyArray(this.params);\n let i;\n let j;\n let val;\n let name;\n let isNamedFound;\n let argIndex;\n let argsLength = 0;\n\n if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) {\n frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit();\n }\n mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames));\n\n if (args) {\n args = utils.copyArray(args);\n argsLength = args.length;\n\n for (i = 0; i < argsLength; i++) {\n arg = args[i];\n if (name = (arg && arg.name)) {\n isNamedFound = false;\n for (j = 0; j < params.length; j++) {\n if (!evaldArguments[j] && name === params[j].name) {\n evaldArguments[j] = arg.value.eval(context);\n frame.prependRule(new Declaration(name, arg.value.eval(context)));\n isNamedFound = true;\n break;\n }\n }\n if (isNamedFound) {\n args.splice(i, 1);\n i--;\n continue;\n } else {\n throw { type: 'Runtime', message: `Named argument for ${this.name} ${args[i].name} not found` };\n }\n }\n }\n }\n argIndex = 0;\n for (i = 0; i < params.length; i++) {\n if (evaldArguments[i]) { continue; }\n\n arg = args && args[argIndex];\n\n if (name = params[i].name) {\n if (params[i].variadic) {\n varargs = [];\n for (j = argIndex; j < argsLength; j++) {\n varargs.push(args[j].value.eval(context));\n }\n frame.prependRule(new Declaration(name, new Expression(varargs).eval(context)));\n } else {\n val = arg && arg.value;\n if (val) {\n // This was a mixin call, pass in a detached ruleset of it's eval'd rules\n if (Array.isArray(val)) {\n val = new DetachedRuleset(new Ruleset('', val));\n }\n else {\n val = val.eval(context);\n }\n } else if (params[i].value) {\n val = params[i].value.eval(mixinEnv);\n frame.resetCache();\n } else {\n throw { type: 'Runtime', message: `wrong number of arguments for ${this.name} (${argsLength} for ${this.arity})` };\n }\n\n frame.prependRule(new Declaration(name, val));\n evaldArguments[i] = val;\n }\n }\n\n if (params[i].variadic && args) {\n for (j = argIndex; j < argsLength; j++) {\n evaldArguments[j] = args[j].value.eval(context);\n }\n }\n argIndex++;\n }\n\n return frame;\n },\n\n makeImportant() {\n const rules = !this.rules ? this.rules : this.rules.map(function (r) {\n if (r.makeImportant) {\n return r.makeImportant(true);\n } else {\n return r;\n }\n });\n const result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames);\n return result;\n },\n\n eval(context) {\n return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || utils.copyArray(context.frames));\n },\n\n evalCall(context, args, important) {\n const _arguments = [];\n const mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames;\n const frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments);\n let rules;\n let ruleset;\n\n frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context)));\n\n rules = utils.copyArray(this.rules);\n\n ruleset = new Ruleset(null, rules);\n ruleset.originalRuleset = this;\n ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames)));\n if (important) {\n ruleset = ruleset.makeImportant();\n }\n return ruleset;\n },\n\n matchCondition(args, context) {\n if (this.condition && !this.condition.eval(\n new contexts.Eval(context,\n [this.evalParams(context, /* the parameter variables */\n new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])]\n .concat(this.frames || []) // the parent namespace/mixin frames\n .concat(context.frames)))) { // the current environment frames\n return false;\n }\n return true;\n },\n\n matchArgs(args, context) {\n const allArgsCnt = (args && args.length) || 0;\n let len;\n const optionalParameters = this.optionalParameters;\n const requiredArgsCnt = !args ? 0 : args.reduce(function (count, p) {\n if (optionalParameters.indexOf(p.name) < 0) {\n return count + 1;\n } else {\n return count;\n }\n }, 0);\n\n if (!this.variadic) {\n if (requiredArgsCnt < this.required) {\n return false;\n }\n if (allArgsCnt > this.params.length) {\n return false;\n }\n } else {\n if (requiredArgsCnt < (this.required - 1)) {\n return false;\n }\n }\n\n // check patterns\n len = Math.min(requiredArgsCnt, this.arity);\n\n for (let i = 0; i < len; i++) {\n if (!this.params[i].name && !this.params[i].variadic) {\n if (args[i].value.eval(context).toCSS() != this.params[i].value.eval(context).toCSS()) {\n return false;\n }\n }\n }\n return true;\n }\n});\n\nexport default Definition;\n","import Node from './node';\nimport Selector from './selector';\nimport MixinDefinition from './mixin-definition';\nimport defaultFunc from '../functions/default';\n\nconst MixinCall = function(elements, args, index, currentFileInfo, important) {\n this.selector = new Selector(elements);\n this.arguments = args || [];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.important = important;\n this.allowRoot = true;\n this.setParent(this.selector, this);\n};\n\nMixinCall.prototype = Object.assign(new Node(), {\n type: 'MixinCall',\n\n accept(visitor) {\n if (this.selector) {\n this.selector = visitor.visit(this.selector);\n }\n if (this.arguments.length) {\n this.arguments = visitor.visitArray(this.arguments);\n }\n },\n\n eval(context) {\n let mixins;\n let mixin;\n let mixinPath;\n const args = [];\n let arg;\n let argValue;\n const rules = [];\n let match = false;\n let i;\n let m;\n let f;\n let isRecursive;\n let isOneFound;\n const candidates = [];\n let candidate;\n const conditionResult = [];\n let defaultResult;\n const defFalseEitherCase = -1;\n const defNone = 0;\n const defTrue = 1;\n const defFalse = 2;\n let count;\n let originalRuleset;\n let noArgumentsFilter;\n\n this.selector = this.selector.eval(context);\n\n function calcDefGroup(mixin, mixinPath) {\n let f, p, namespace;\n\n for (f = 0; f < 2; f++) {\n conditionResult[f] = true;\n defaultFunc.value(f);\n for (p = 0; p < mixinPath.length && conditionResult[f]; p++) {\n namespace = mixinPath[p];\n if (namespace.matchCondition) {\n conditionResult[f] = conditionResult[f] && namespace.matchCondition(null, context);\n }\n }\n if (mixin.matchCondition) {\n conditionResult[f] = conditionResult[f] && mixin.matchCondition(args, context);\n }\n }\n if (conditionResult[0] || conditionResult[1]) {\n if (conditionResult[0] != conditionResult[1]) {\n return conditionResult[1] ?\n defTrue : defFalse;\n }\n\n return defNone;\n }\n return defFalseEitherCase;\n }\n\n for (i = 0; i < this.arguments.length; i++) {\n arg = this.arguments[i];\n argValue = arg.value.eval(context);\n if (arg.expand && Array.isArray(argValue.value)) {\n argValue = argValue.value;\n for (m = 0; m < argValue.length; m++) {\n args.push({value: argValue[m]});\n }\n } else {\n args.push({name: arg.name, value: argValue});\n }\n }\n\n noArgumentsFilter = function(rule) {return rule.matchArgs(null, context);};\n\n for (i = 0; i < context.frames.length; i++) {\n if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) {\n isOneFound = true;\n\n // To make `default()` function independent of definition order we have two \"subpasses\" here.\n // At first we evaluate each guard *twice* (with `default() == true` and `default() == false`),\n // and build candidate list with corresponding flags. Then, when we know all possible matches,\n // we make a final decision.\n\n for (m = 0; m < mixins.length; m++) {\n mixin = mixins[m].rule;\n mixinPath = mixins[m].path;\n isRecursive = false;\n for (f = 0; f < context.frames.length; f++) {\n if ((!(mixin instanceof MixinDefinition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) {\n isRecursive = true;\n break;\n }\n }\n if (isRecursive) {\n continue;\n }\n\n if (mixin.matchArgs(args, context)) {\n candidate = {mixin, group: calcDefGroup(mixin, mixinPath)};\n\n if (candidate.group !== defFalseEitherCase) {\n candidates.push(candidate);\n }\n\n match = true;\n }\n }\n\n defaultFunc.reset();\n\n count = [0, 0, 0];\n for (m = 0; m < candidates.length; m++) {\n count[candidates[m].group]++;\n }\n\n if (count[defNone] > 0) {\n defaultResult = defFalse;\n } else {\n defaultResult = defTrue;\n if ((count[defTrue] + count[defFalse]) > 1) {\n throw { type: 'Runtime',\n message: `Ambiguous use of \\`default()\\` found when matching for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n }\n\n for (m = 0; m < candidates.length; m++) {\n candidate = candidates[m].group;\n if ((candidate === defNone) || (candidate === defaultResult)) {\n try {\n mixin = candidates[m].mixin;\n if (!(mixin instanceof MixinDefinition)) {\n originalRuleset = mixin.originalRuleset || mixin;\n mixin = new MixinDefinition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo());\n mixin.originalRuleset = originalRuleset;\n }\n const newRules = mixin.evalCall(context, args, this.important).rules;\n this._setVisibilityToReplacement(newRules);\n Array.prototype.push.apply(rules, newRules);\n } catch (e) {\n throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack };\n }\n }\n }\n\n if (match) {\n return rules;\n }\n }\n }\n if (isOneFound) {\n throw { type: 'Runtime',\n message: `No matching definition was found for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n } else {\n throw { type: 'Name',\n message: `${this.selector.toCSS().trim()} is undefined`,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n },\n\n _setVisibilityToReplacement(replacement) {\n let i, rule;\n if (this.blocksVisibility()) {\n for (i = 0; i < replacement.length; i++) {\n rule = replacement[i];\n rule.addVisibilityBlock();\n }\n }\n },\n\n format(args) {\n return `${this.selector.toCSS().trim()}(${args ? args.map(function (a) {\n let argValue = '';\n if (a.name) {\n argValue += `${a.name}:`;\n }\n if (a.value.toCSS) {\n argValue += a.value.toCSS();\n } else {\n argValue += '???';\n }\n return argValue;\n }).join(', ') : ''})`;\n }\n});\n\nexport default MixinCall;\n","import Node from './node';\nimport Color from './color';\nimport AtRule from './atrule';\nimport DetachedRuleset from './detached-ruleset';\nimport Operation from './operation';\nimport Dimension from './dimension';\nimport Unit from './unit';\nimport Keyword from './keyword';\nimport Variable from './variable';\nimport Property from './property';\nimport Ruleset from './ruleset';\nimport Element from './element';\nimport Attribute from './attribute';\nimport Combinator from './combinator';\nimport Selector from './selector';\nimport Quoted from './quoted';\nimport Expression from './expression';\nimport Declaration from './declaration';\nimport Call from './call';\nimport URL from './url';\nimport Import from './import';\nimport Comment from './comment';\nimport Anonymous from './anonymous';\nimport Value from './value';\nimport JavaScript from './javascript';\nimport Assignment from './assignment';\nimport Condition from './condition';\nimport QueryInParens from './query-in-parens';\nimport Paren from './paren';\nimport Media from './media';\nimport Container from './container';\nimport UnicodeDescriptor from './unicode-descriptor';\nimport Negative from './negative';\nimport Extend from './extend';\nimport VariableCall from './variable-call';\nimport NamespaceValue from './namespace-value';\n\n// mixins\nimport MixinCall from './mixin-call';\nimport MixinDefinition from './mixin-definition';\n\nexport default {\n Node, Color, AtRule, DetachedRuleset, Operation,\n Dimension, Unit, Keyword, Variable, Property,\n Ruleset, Element, Attribute, Combinator, Selector,\n Quoted, Expression, Declaration, Call, URL, Import,\n Comment, Anonymous, Value, JavaScript, Assignment,\n Condition, Paren, Media, Container, QueryInParens, \n UnicodeDescriptor, Negative, Extend, VariableCall, \n NamespaceValue,\n mixin: {\n Call: MixinCall,\n Definition: MixinDefinition\n }\n};","class AbstractFileManager {\n getPath(filename) {\n let j = filename.lastIndexOf('?');\n if (j > 0) {\n filename = filename.slice(0, j);\n }\n j = filename.lastIndexOf('/');\n if (j < 0) {\n j = filename.lastIndexOf('\\\\');\n }\n if (j < 0) {\n return '';\n }\n return filename.slice(0, j + 1);\n }\n\n tryAppendExtension(path, ext) {\n return /(\\.[a-z]*$)|([?;].*)$/.test(path) ? path : path + ext;\n }\n\n tryAppendLessExtension(path) {\n return this.tryAppendExtension(path, '.less');\n }\n\n supportsSync() {\n return false;\n }\n\n alwaysMakePathsAbsolute() {\n return false;\n }\n\n isPathAbsolute(filename) {\n return (/^(?:[a-z-]+:|\\/|\\\\|#)/i).test(filename);\n }\n\n // TODO: pull out / replace?\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return basePath + laterPath;\n }\n\n pathDiff(url, baseUrl) {\n // diff between two paths to create a relative path\n\n const urlParts = this.extractUrlParts(url);\n\n const baseUrlParts = this.extractUrlParts(baseUrl);\n let i;\n let max;\n let urlDirectories;\n let baseUrlDirectories;\n let diff = '';\n if (urlParts.hostPart !== baseUrlParts.hostPart) {\n return '';\n }\n max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);\n for (i = 0; i < max; i++) {\n if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; }\n }\n baseUrlDirectories = baseUrlParts.directories.slice(i);\n urlDirectories = urlParts.directories.slice(i);\n for (i = 0; i < baseUrlDirectories.length - 1; i++) {\n diff += '../';\n }\n for (i = 0; i < urlDirectories.length - 1; i++) {\n diff += `${urlDirectories[i]}/`;\n }\n return diff;\n }\n\n /**\n * Helper function, not part of API.\n * This should be replaceable by newer Node / Browser APIs\n * \n * @param {string} url \n * @param {string} baseUrl\n */\n extractUrlParts(url, baseUrl) {\n // urlParts[1] = protocol://hostname/ OR /\n // urlParts[2] = / if path relative to host base\n // urlParts[3] = directories\n // urlParts[4] = filename\n // urlParts[5] = parameters\n\n const urlPartsRegex = /^((?:[a-z-]+:)?\\/{2}(?:[^/?#]*\\/)|([/\\\\]))?((?:[^/\\\\?#]*[/\\\\])*)([^/\\\\?#]*)([#?].*)?$/i;\n\n const urlParts = url.match(urlPartsRegex);\n const returner = {};\n let rawDirectories = [];\n const directories = [];\n let i;\n let baseUrlParts;\n\n if (!urlParts) {\n throw new Error(`Could not parse sheet href - '${url}'`);\n }\n\n // Stylesheets in IE don't always return the full path\n if (baseUrl && (!urlParts[1] || urlParts[2])) {\n baseUrlParts = baseUrl.match(urlPartsRegex);\n if (!baseUrlParts) {\n throw new Error(`Could not parse page url - '${baseUrl}'`);\n }\n urlParts[1] = urlParts[1] || baseUrlParts[1] || '';\n if (!urlParts[2]) {\n urlParts[3] = baseUrlParts[3] + urlParts[3];\n }\n }\n\n if (urlParts[3]) {\n rawDirectories = urlParts[3].replace(/\\\\/g, '/').split('/');\n\n // collapse '..' and skip '.'\n for (i = 0; i < rawDirectories.length; i++) {\n\n if (rawDirectories[i] === '..') {\n directories.pop();\n }\n else if (rawDirectories[i] !== '.') {\n directories.push(rawDirectories[i]);\n }\n \n }\n }\n\n returner.hostPart = urlParts[1];\n returner.directories = directories;\n returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/');\n returner.path = (urlParts[1] || '') + directories.join('/');\n returner.filename = urlParts[4];\n returner.fileUrl = returner.path + (urlParts[4] || '');\n returner.url = returner.fileUrl + (urlParts[5] || '');\n return returner;\n }\n}\n\nexport default AbstractFileManager;\n","import functionRegistry from '../functions/function-registry';\nimport LessError from '../less-error';\n\nclass AbstractPluginLoader {\n constructor() {\n // Implemented by Node.js plugin loader\n this.require = function() {\n return null;\n }\n }\n\n evalPlugin(contents, context, imports, pluginOptions, fileInfo) {\n\n let loader, registry, pluginObj, localModule, pluginManager, filename, result;\n\n pluginManager = context.pluginManager;\n\n if (fileInfo) {\n if (typeof fileInfo === 'string') {\n filename = fileInfo;\n }\n else {\n filename = fileInfo.filename;\n }\n }\n const shortname = (new this.less.FileManager()).extractUrlParts(filename).filename;\n\n if (filename) {\n pluginObj = pluginManager.get(filename);\n\n if (pluginObj) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n return pluginObj;\n }\n }\n localModule = {\n exports: {},\n pluginManager,\n fileInfo\n };\n registry = functionRegistry.create();\n\n const registerPlugin = function(obj) {\n pluginObj = obj;\n };\n\n try {\n loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents);\n loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo);\n }\n catch (e) {\n return new LessError(e, imports, filename);\n }\n\n if (!pluginObj) {\n pluginObj = localModule.exports;\n }\n pluginObj = this.validatePlugin(pluginObj, filename, shortname);\n\n if (pluginObj instanceof LessError) {\n return pluginObj;\n }\n\n if (pluginObj) {\n pluginObj.imports = imports;\n pluginObj.filename = filename;\n\n // For < 3.x (or unspecified minVersion) - setOptions() before install()\n if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n\n if (result) {\n return result;\n }\n }\n\n // Run on first load\n pluginManager.addPlugin(pluginObj, fileInfo.filename, registry);\n pluginObj.functions = registry.getLocalFunctions();\n\n // Need to call setOptions again because the pluginObj might have functions\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n\n // Run every @plugin call\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n\n }\n else {\n return new LessError({ message: 'Not a valid plugin' }, imports, filename);\n }\n\n return pluginObj;\n\n }\n\n trySetOptions(plugin, filename, name, options) {\n if (options && !plugin.setOptions) {\n return new LessError({\n message: `Options have been provided but the plugin ${name} does not support any options.`\n });\n }\n try {\n plugin.setOptions && plugin.setOptions(options);\n }\n catch (e) {\n return new LessError(e);\n }\n }\n\n validatePlugin(plugin, filename, name) {\n if (plugin) {\n // support plugins being a function\n // so that the plugin can be more usable programmatically\n if (typeof plugin === 'function') {\n plugin = new plugin();\n }\n\n if (plugin.minVersion) {\n if (this.compareVersion(plugin.minVersion, this.less.version) < 0) {\n return new LessError({\n message: `Plugin ${name} requires version ${this.versionToString(plugin.minVersion)}`\n });\n }\n }\n return plugin;\n }\n return null;\n }\n\n compareVersion(aVersion, bVersion) {\n if (typeof aVersion === 'string') {\n aVersion = aVersion.match(/^(\\d+)\\.?(\\d+)?\\.?(\\d+)?/);\n aVersion.shift();\n }\n for (let i = 0; i < aVersion.length; i++) {\n if (aVersion[i] !== bVersion[i]) {\n return parseInt(aVersion[i]) > parseInt(bVersion[i]) ? -1 : 1;\n }\n }\n return 0;\n }\n\n versionToString(version) {\n let versionString = '';\n for (let i = 0; i < version.length; i++) {\n versionString += (versionString ? '.' : '') + version[i];\n }\n return versionString;\n }\n\n printUsage(plugins) {\n for (let i = 0; i < plugins.length; i++) {\n const plugin = plugins[i];\n if (plugin.printUsage) {\n plugin.printUsage();\n }\n }\n }\n}\n\nexport default AbstractPluginLoader;\n\n","import Anonymous from '../tree/anonymous';\nimport Keyword from '../tree/keyword';\n\nfunction boolean(condition) {\n return condition ? Keyword.True : Keyword.False;\n}\n\n/**\n * Functions with evalArgs set to false are sent context\n * as the first argument.\n */\nfunction If(context, condition, trueValue, falseValue) {\n return condition.eval(context) ? trueValue.eval(context)\n : (falseValue ? falseValue.eval(context) : new Anonymous);\n}\nIf.evalArgs = false;\n\nfunction isdefined(context, variable) {\n try {\n variable.eval(context);\n return Keyword.True;\n } catch (e) {\n return Keyword.False;\n }\n}\n\nisdefined.evalArgs = false;\n\nexport default { isdefined, boolean, 'if': If };\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport Expression from '../tree/expression';\nimport Operation from '../tree/operation';\nlet colorFunctions;\n\nfunction clamp(val) {\n return Math.min(1, Math.max(0, val));\n}\nfunction hsla(origColor, hsl) {\n const color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a);\n if (color) {\n if (origColor.value && \n /^(rgb|hsl)/.test(origColor.value)) {\n color.value = origColor.value;\n } else {\n color.value = 'rgb';\n }\n return color;\n }\n}\nfunction toHSL(color) {\n if (color.toHSL) {\n return color.toHSL();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction toHSV(color) {\n if (color.toHSV) {\n return color.toHSV();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction number(n) {\n if (n instanceof Dimension) {\n return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);\n } else if (typeof n === 'number') {\n return n;\n } else {\n throw {\n type: 'Argument',\n message: 'color functions take numbers as parameters'\n };\n }\n}\nfunction scaled(n, size) {\n if (n instanceof Dimension && n.unit.is('%')) {\n return parseFloat(n.value * size / 100);\n } else {\n return number(n);\n }\n}\ncolorFunctions = {\n rgb: function (r, g, b) {\n let a = 1\n /**\n * Comma-less syntax\n * e.g. rgb(0 128 255 / 50%)\n */\n if (r instanceof Expression) {\n const val = r.value\n r = val[0]\n g = val[1]\n b = val[2]\n /** \n * @todo - should this be normalized in\n * function caller? Or parsed differently?\n */\n if (b instanceof Operation) {\n const op = b\n b = op.operands[0]\n a = op.operands[1]\n }\n }\n const color = colorFunctions.rgba(r, g, b, a);\n if (color) {\n color.value = 'rgb';\n return color;\n }\n },\n rgba: function (r, g, b, a) {\n try {\n if (r instanceof Color) {\n if (g) {\n a = number(g);\n } else {\n a = r.alpha;\n }\n return new Color(r.rgb, a, 'rgba');\n }\n const rgb = [r, g, b].map(c => scaled(c, 255));\n a = number(a);\n return new Color(rgb, a, 'rgba');\n }\n catch (e) {}\n },\n hsl: function (h, s, l) {\n let a = 1\n if (h instanceof Expression) {\n const val = h.value\n h = val[0]\n s = val[1]\n l = val[2]\n\n if (l instanceof Operation) {\n const op = l\n l = op.operands[0]\n a = op.operands[1]\n }\n }\n const color = colorFunctions.hsla(h, s, l, a);\n if (color) {\n color.value = 'hsl';\n return color;\n }\n },\n hsla: function (h, s, l, a) {\n let m1;\n let m2;\n\n function hue(h) {\n h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n else if (h * 2 < 1) {\n return m2;\n }\n else if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n else {\n return m1;\n }\n }\n\n try {\n if (h instanceof Color) {\n if (s) {\n a = number(s);\n } else {\n a = h.alpha;\n }\n return new Color(h.rgb, a, 'hsla');\n }\n\n h = (number(h) % 360) / 360;\n s = clamp(number(s));l = clamp(number(l));a = clamp(number(a));\n\n m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n m1 = l * 2 - m2;\n\n const rgb = [\n hue(h + 1 / 3) * 255,\n hue(h) * 255,\n hue(h - 1 / 3) * 255\n ];\n a = number(a);\n return new Color(rgb, a, 'hsla');\n }\n catch (e) {}\n },\n\n hsv: function(h, s, v) {\n return colorFunctions.hsva(h, s, v, 1.0);\n },\n\n hsva: function(h, s, v, a) {\n h = ((number(h) % 360) / 360) * 360;\n s = number(s);v = number(v);a = number(a);\n\n let i;\n let f;\n i = Math.floor((h / 60) % 6);\n f = (h / 60) - i;\n\n const vs = [v,\n v * (1 - s),\n v * (1 - f * s),\n v * (1 - (1 - f) * s)];\n const perm = [[0, 3, 1],\n [2, 0, 1],\n [1, 0, 3],\n [1, 2, 0],\n [3, 1, 0],\n [0, 1, 2]];\n\n return colorFunctions.rgba(vs[perm[i][0]] * 255,\n vs[perm[i][1]] * 255,\n vs[perm[i][2]] * 255,\n a);\n },\n\n hue: function (color) {\n return new Dimension(toHSL(color).h);\n },\n saturation: function (color) {\n return new Dimension(toHSL(color).s * 100, '%');\n },\n lightness: function (color) {\n return new Dimension(toHSL(color).l * 100, '%');\n },\n hsvhue: function(color) {\n return new Dimension(toHSV(color).h);\n },\n hsvsaturation: function (color) {\n return new Dimension(toHSV(color).s * 100, '%');\n },\n hsvvalue: function (color) {\n return new Dimension(toHSV(color).v * 100, '%');\n },\n red: function (color) {\n return new Dimension(color.rgb[0]);\n },\n green: function (color) {\n return new Dimension(color.rgb[1]);\n },\n blue: function (color) {\n return new Dimension(color.rgb[2]);\n },\n alpha: function (color) {\n return new Dimension(toHSL(color).a);\n },\n luma: function (color) {\n return new Dimension(color.luma() * color.alpha * 100, '%');\n },\n luminance: function (color) {\n const luminance =\n (0.2126 * color.rgb[0] / 255) +\n (0.7152 * color.rgb[1] / 255) +\n (0.0722 * color.rgb[2] / 255);\n\n return new Dimension(luminance * color.alpha * 100, '%');\n },\n saturate: function (color, amount, method) {\n // filter: saturate(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s += hsl.s * amount.value / 100;\n }\n else {\n hsl.s += amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n desaturate: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s -= hsl.s * amount.value / 100;\n }\n else {\n hsl.s -= amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n lighten: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l += hsl.l * amount.value / 100;\n }\n else {\n hsl.l += amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n darken: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l -= hsl.l * amount.value / 100;\n }\n else {\n hsl.l -= amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n fadein: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a += hsl.a * amount.value / 100;\n }\n else {\n hsl.a += amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fadeout: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a -= hsl.a * amount.value / 100;\n }\n else {\n hsl.a -= amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fade: function (color, amount) {\n const hsl = toHSL(color);\n\n hsl.a = amount.value / 100;\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n spin: function (color, amount) {\n const hsl = toHSL(color);\n const hue = (hsl.h + amount.value) % 360;\n\n hsl.h = hue < 0 ? 360 + hue : hue;\n\n return hsla(color, hsl);\n },\n //\n // Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein\n // http://sass-lang.com\n //\n mix: function (color1, color2, weight) {\n if (!weight) {\n weight = new Dimension(50);\n }\n const p = weight.value / 100.0;\n const w = p * 2 - 1;\n const a = toHSL(color1).a - toHSL(color2).a;\n\n const w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n const w2 = 1 - w1;\n\n const rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,\n color1.rgb[1] * w1 + color2.rgb[1] * w2,\n color1.rgb[2] * w1 + color2.rgb[2] * w2];\n\n const alpha = color1.alpha * p + color2.alpha * (1 - p);\n\n return new Color(rgb, alpha);\n },\n greyscale: function (color) {\n return colorFunctions.desaturate(color, new Dimension(100));\n },\n contrast: function (color, dark, light, threshold) {\n // filter: contrast(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n if (typeof light === 'undefined') {\n light = colorFunctions.rgba(255, 255, 255, 1.0);\n }\n if (typeof dark === 'undefined') {\n dark = colorFunctions.rgba(0, 0, 0, 1.0);\n }\n // Figure out which is actually light and dark:\n if (dark.luma() > light.luma()) {\n const t = light;\n light = dark;\n dark = t;\n }\n if (typeof threshold === 'undefined') {\n threshold = 0.43;\n } else {\n threshold = number(threshold);\n }\n if (color.luma() < threshold) {\n return light;\n } else {\n return dark;\n }\n },\n // Changes made in 2.7.0 - Reverted in 3.0.0\n // contrast: function (color, color1, color2, threshold) {\n // // Return which of `color1` and `color2` has the greatest contrast with `color`\n // // according to the standard WCAG contrast ratio calculation.\n // // http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n // // The threshold param is no longer used, in line with SASS.\n // // filter: contrast(3.2);\n // // should be kept as is, so check for color\n // if (!color.rgb) {\n // return null;\n // }\n // if (typeof color1 === 'undefined') {\n // color1 = colorFunctions.rgba(0, 0, 0, 1.0);\n // }\n // if (typeof color2 === 'undefined') {\n // color2 = colorFunctions.rgba(255, 255, 255, 1.0);\n // }\n // var contrast1, contrast2;\n // var luma = color.luma();\n // var luma1 = color1.luma();\n // var luma2 = color2.luma();\n // // Calculate contrast ratios for each color\n // if (luma > luma1) {\n // contrast1 = (luma + 0.05) / (luma1 + 0.05);\n // } else {\n // contrast1 = (luma1 + 0.05) / (luma + 0.05);\n // }\n // if (luma > luma2) {\n // contrast2 = (luma + 0.05) / (luma2 + 0.05);\n // } else {\n // contrast2 = (luma2 + 0.05) / (luma + 0.05);\n // }\n // if (contrast1 > contrast2) {\n // return color1;\n // } else {\n // return color2;\n // }\n // },\n argb: function (color) {\n return new Anonymous(color.toARGB());\n },\n color: function(c) {\n if ((c instanceof Quoted) &&\n (/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) {\n const val = c.value.slice(1);\n return new Color(val, undefined, `#${val}`);\n }\n if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) {\n c.value = undefined;\n return c;\n }\n throw {\n type: 'Argument',\n message: 'argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF'\n };\n },\n tint: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount);\n },\n shade: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount);\n }\n};\n\nexport default colorFunctions;\n","import Color from '../tree/color';\n\n// Color Blending\n// ref: http://www.w3.org/TR/compositing-1\n\nfunction colorBlend(mode, color1, color2) {\n const ab = color1.alpha; // result\n\n let // backdrop\n cb;\n\n const as = color2.alpha;\n\n let // source\n cs;\n\n let ar;\n let cr;\n const r = [];\n\n ar = as + ab * (1 - as);\n for (let i = 0; i < 3; i++) {\n cb = color1.rgb[i] / 255;\n cs = color2.rgb[i] / 255;\n cr = mode(cb, cs);\n if (ar) {\n cr = (as * cs + ab * (cb -\n as * (cb + cs - cr))) / ar;\n }\n r[i] = cr * 255;\n }\n\n return new Color(r, ar);\n}\n\nconst colorBlendModeFunctions = {\n multiply: function(cb, cs) {\n return cb * cs;\n },\n screen: function(cb, cs) {\n return cb + cs - cb * cs;\n },\n overlay: function(cb, cs) {\n cb *= 2;\n return (cb <= 1) ?\n colorBlendModeFunctions.multiply(cb, cs) :\n colorBlendModeFunctions.screen(cb - 1, cs);\n },\n softlight: function(cb, cs) {\n let d = 1;\n let e = cb;\n if (cs > 0.5) {\n e = 1;\n d = (cb > 0.25) ? Math.sqrt(cb)\n : ((16 * cb - 12) * cb + 4) * cb;\n }\n return cb - (1 - 2 * cs) * e * (d - cb);\n },\n hardlight: function(cb, cs) {\n return colorBlendModeFunctions.overlay(cs, cb);\n },\n difference: function(cb, cs) {\n return Math.abs(cb - cs);\n },\n exclusion: function(cb, cs) {\n return cb + cs - 2 * cb * cs;\n },\n\n // non-w3c functions:\n average: function(cb, cs) {\n return (cb + cs) / 2;\n },\n negation: function(cb, cs) {\n return 1 - Math.abs(cb + cs - 1);\n }\n};\n\nfor (const f in colorBlendModeFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (colorBlendModeFunctions.hasOwnProperty(f)) {\n colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]);\n }\n}\n\nexport default colorBlend;\n","import Comment from '../tree/comment';\nimport Node from '../tree/node';\nimport Dimension from '../tree/dimension';\nimport Declaration from '../tree/declaration';\nimport Expression from '../tree/expression';\nimport Ruleset from '../tree/ruleset';\nimport Selector from '../tree/selector';\nimport Element from '../tree/element';\nimport Quote from '../tree/quoted';\nimport Value from '../tree/value';\n\nconst getItemsFromNode = node => {\n // handle non-array values as an array of length 1\n // return 'undefined' if index is invalid\n const items = Array.isArray(node.value) ?\n node.value : Array(node);\n\n return items;\n};\n\nexport default {\n _SELF: function(n) {\n return n;\n },\n '~': function(...expr) {\n if (expr.length === 1) {\n return expr[0];\n }\n return new Value(expr);\n },\n extract: function(values, index) {\n // (1-based index)\n index = index.value - 1;\n\n return getItemsFromNode(values)[index];\n },\n length: function(values) {\n return new Dimension(getItemsFromNode(values).length);\n },\n /**\n * Creates a Less list of incremental values.\n * Modeled after Lodash's range function, also exists natively in PHP\n * \n * @param {Dimension} [start=1]\n * @param {Dimension} end - e.g. 10 or 10px - unit is added to output\n * @param {Dimension} [step=1] \n */\n range: function(start, end, step) {\n let from;\n let to;\n let stepValue = 1;\n const list = [];\n if (end) {\n to = end;\n from = start.value;\n if (step) {\n stepValue = step.value;\n }\n }\n else {\n from = 1;\n to = start;\n }\n\n for (let i = from; i <= to.value; i += stepValue) {\n list.push(new Dimension(i, to.unit));\n }\n\n return new Expression(list);\n },\n each: function(list, rs) {\n const rules = [];\n let newRules;\n let iterator;\n\n const tryEval = val => {\n if (val instanceof Node) {\n return val.eval(this.context);\n }\n return val;\n };\n\n if (list.value && !(list instanceof Quote)) {\n if (Array.isArray(list.value)) {\n iterator = list.value.map(tryEval);\n } else {\n iterator = [tryEval(list.value)];\n }\n } else if (list.ruleset) {\n iterator = tryEval(list.ruleset).rules;\n } else if (list.rules) {\n iterator = list.rules.map(tryEval);\n } else if (Array.isArray(list)) {\n iterator = list.map(tryEval);\n } else {\n iterator = [tryEval(list)];\n }\n\n let valueName = '@value';\n let keyName = '@key';\n let indexName = '@index';\n\n if (rs.params) {\n valueName = rs.params[0] && rs.params[0].name;\n keyName = rs.params[1] && rs.params[1].name;\n indexName = rs.params[2] && rs.params[2].name;\n rs = rs.rules;\n } else {\n rs = rs.ruleset;\n }\n\n for (let i = 0; i < iterator.length; i++) {\n let key;\n let value;\n const item = iterator[i];\n if (item instanceof Declaration) {\n key = typeof item.name === 'string' ? item.name : item.name[0].value;\n value = item.value;\n } else {\n key = new Dimension(i + 1);\n value = item;\n }\n\n if (item instanceof Comment) {\n continue;\n }\n\n newRules = rs.rules.slice(0);\n if (valueName) {\n newRules.push(new Declaration(valueName,\n value,\n false, false, this.index, this.currentFileInfo));\n }\n if (indexName) {\n newRules.push(new Declaration(indexName,\n new Dimension(i + 1),\n false, false, this.index, this.currentFileInfo));\n }\n if (keyName) {\n newRules.push(new Declaration(keyName,\n key,\n false, false, this.index, this.currentFileInfo));\n }\n\n rules.push(new Ruleset([ new(Selector)([ new Element('', '&') ]) ],\n newRules,\n rs.strictImports,\n rs.visibilityInfo()\n ));\n }\n\n return new Ruleset([ new(Selector)([ new Element('', '&') ]) ],\n rules,\n rs.strictImports,\n rs.visibilityInfo()\n ).eval(this.context);\n }\n};\n","import Dimension from '../tree/dimension';\n\nconst MathHelper = (fn, unit, n) => {\n if (!(n instanceof Dimension)) {\n throw { type: 'Argument', message: 'argument must be a number' };\n }\n if (unit === null) {\n unit = n.unit;\n } else {\n n = n.unify();\n }\n return new Dimension(fn(parseFloat(n.value)), unit);\n};\n\nexport default MathHelper;","import mathHelper from './math-helper.js';\n\nconst mathFunctions = {\n // name, unit\n ceil: null,\n floor: null,\n sqrt: null,\n abs: null,\n tan: '',\n sin: '',\n cos: '',\n atan: 'rad',\n asin: 'rad',\n acos: 'rad'\n};\n\nfor (const f in mathFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (mathFunctions.hasOwnProperty(f)) {\n mathFunctions[f] = mathHelper.bind(null, Math[f], mathFunctions[f]);\n }\n}\n\nmathFunctions.round = (n, f) => {\n const fraction = typeof f === 'undefined' ? 0 : f.value;\n return mathHelper(num => num.toFixed(fraction), null, n);\n};\n\nexport default mathFunctions;\n","import Dimension from '../tree/dimension';\nimport Anonymous from '../tree/anonymous';\nimport mathHelper from './math-helper.js';\n\nconst minMax = function (isMin, args) {\n args = Array.prototype.slice.call(args);\n switch (args.length) {\n case 0: throw { type: 'Argument', message: 'one or more arguments required' };\n }\n let i; // key is the unit.toString() for unified Dimension values,\n let j;\n let current;\n let currentUnified;\n let referenceUnified;\n let unit;\n let unitStatic;\n let unitClone;\n\n const // elems only contains original argument values.\n order = [];\n\n const values = {};\n // value is the index into the order array.\n for (i = 0; i < args.length; i++) {\n current = args[i];\n if (!(current instanceof Dimension)) {\n if (Array.isArray(args[i].value)) {\n Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));\n }\n continue;\n }\n currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();\n unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();\n unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic;\n unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone;\n j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit];\n if (j === undefined) {\n if (unitStatic !== undefined && unit !== unitStatic) {\n throw { type: 'Argument', message: 'incompatible types' };\n }\n values[unit] = order.length;\n order.push(current);\n continue;\n }\n referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify();\n if ( isMin && currentUnified.value < referenceUnified.value ||\n !isMin && currentUnified.value > referenceUnified.value) {\n order[j] = current;\n }\n }\n if (order.length == 1) {\n return order[0];\n }\n args = order.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');\n return new Anonymous(`${isMin ? 'min' : 'max'}(${args})`);\n};\n\nexport default {\n min: function(...args) {\n try {\n return minMax.call(this, true, args);\n } catch (e) {}\n },\n max: function(...args) {\n try {\n return minMax.call(this, false, args);\n } catch (e) {}\n },\n convert: function (val, unit) {\n return val.convertTo(unit.value);\n },\n pi: function () {\n return new Dimension(Math.PI);\n },\n mod: function(a, b) {\n return new Dimension(a.value % b.value, a.unit);\n },\n pow: function(x, y) {\n if (typeof x === 'number' && typeof y === 'number') {\n x = new Dimension(x);\n y = new Dimension(y);\n } else if (!(x instanceof Dimension) || !(y instanceof Dimension)) {\n throw { type: 'Argument', message: 'arguments must be numbers' };\n }\n\n return new Dimension(Math.pow(x.value, y.value), x.unit);\n },\n percentage: function (n) {\n const result = mathHelper(num => num * 100, '%', n);\n\n return result;\n }\n};\n","import Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport JavaScript from '../tree/javascript';\n\nexport default {\n e: function (str) {\n return new Quoted('\"', str instanceof JavaScript ? str.evaluated : str.value, true);\n },\n escape: function (str) {\n return new Anonymous(\n encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B')\n .replace(/\\(/g, '%28').replace(/\\)/g, '%29'));\n },\n replace: function (string, pattern, replacement, flags) {\n let result = string.value;\n replacement = (replacement.type === 'Quoted') ?\n replacement.value : replacement.toCSS();\n result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement);\n return new Quoted(string.quote || '', result, string.escaped);\n },\n '%': function (string /* arg, arg, ... */) {\n const args = Array.prototype.slice.call(arguments, 1);\n let result = string.value;\n\n for (let i = 0; i < args.length; i++) {\n /* jshint loopfunc:true */\n result = result.replace(/%[sda]/i, token => {\n const value = ((args[i].type === 'Quoted') &&\n token.match(/s/i)) ? args[i].value : args[i].toCSS();\n return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;\n });\n }\n result = result.replace(/%%/g, '%');\n return new Quoted(string.quote || '', result, string.escaped);\n }\n};\n","import Keyword from '../tree/keyword';\nimport DetachedRuleset from '../tree/detached-ruleset';\nimport Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport URL from '../tree/url';\nimport Operation from '../tree/operation';\n\nconst isa = (n, Type) => (n instanceof Type) ? Keyword.True : Keyword.False;\nconst isunit = (n, unit) => {\n if (unit === undefined) {\n throw { type: 'Argument', message: 'missing the required second argument to isunit.' };\n }\n unit = typeof unit.value === 'string' ? unit.value : unit;\n if (typeof unit !== 'string') {\n throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' };\n }\n return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False;\n};\n\nexport default {\n isruleset: function (n) {\n return isa(n, DetachedRuleset);\n },\n iscolor: function (n) {\n return isa(n, Color);\n },\n isnumber: function (n) {\n return isa(n, Dimension);\n },\n isstring: function (n) {\n return isa(n, Quoted);\n },\n iskeyword: function (n) {\n return isa(n, Keyword);\n },\n isurl: function (n) {\n return isa(n, URL);\n },\n ispixel: function (n) {\n return isunit(n, 'px');\n },\n ispercentage: function (n) {\n return isunit(n, '%');\n },\n isem: function (n) {\n return isunit(n, 'em');\n },\n isunit,\n unit: function (val, unit) {\n if (!(val instanceof Dimension)) {\n throw { type: 'Argument',\n message: `the first argument to unit must be a number${val instanceof Operation ? '. Have you forgotten parenthesis?' : ''}` };\n }\n if (unit) {\n if (unit instanceof Keyword) {\n unit = unit.value;\n } else {\n unit = unit.toCSS();\n }\n } else {\n unit = '';\n }\n return new Dimension(val.value, unit);\n },\n 'get-unit': function (n) {\n return new Anonymous(n.unit);\n }\n};\n","import functionRegistry from './function-registry';\nimport functionCaller from './function-caller';\n\nimport boolean from './boolean';\nimport defaultFunc from './default';\nimport color from './color';\nimport colorBlending from './color-blending';\nimport dataUri from './data-uri';\nimport list from './list';\nimport math from './math';\nimport number from './number';\nimport string from './string';\nimport svg from './svg';\nimport types from './types';\n\nexport default environment => {\n const functions = { functionRegistry, functionCaller };\n\n // register functions\n functionRegistry.addMultiple(boolean);\n functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc));\n functionRegistry.addMultiple(color);\n functionRegistry.addMultiple(colorBlending);\n functionRegistry.addMultiple(dataUri(environment));\n functionRegistry.addMultiple(list);\n functionRegistry.addMultiple(math);\n functionRegistry.addMultiple(number);\n functionRegistry.addMultiple(string);\n functionRegistry.addMultiple(svg(environment));\n functionRegistry.addMultiple(types);\n\n return functions;\n};\n","import Quoted from '../tree/quoted';\nimport URL from '../tree/url';\nimport * as utils from '../utils';\nimport logger from '../logger';\n\nexport default environment => {\n \n const fallback = (functionThis, node) => new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); \n\n return { 'data-uri': function(mimetypeNode, filePathNode) {\n\n if (!filePathNode) {\n filePathNode = mimetypeNode;\n mimetypeNode = null;\n }\n\n let mimetype = mimetypeNode && mimetypeNode.value;\n let filePath = filePathNode.value;\n const currentFileInfo = this.currentFileInfo;\n const currentDirectory = currentFileInfo.rewriteUrls ?\n currentFileInfo.currentDirectory : currentFileInfo.entryPath;\n\n const fragmentStart = filePath.indexOf('#');\n let fragment = '';\n if (fragmentStart !== -1) {\n fragment = filePath.slice(fragmentStart);\n filePath = filePath.slice(0, fragmentStart);\n }\n const context = utils.clone(this.context);\n context.rawBuffer = true;\n\n const fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true);\n\n if (!fileManager) {\n return fallback(this, filePathNode);\n }\n\n let useBase64 = false;\n\n // detect the mimetype if not given\n if (!mimetypeNode) {\n\n mimetype = environment.mimeLookup(filePath);\n\n if (mimetype === 'image/svg+xml') {\n useBase64 = false;\n } else {\n // use base 64 unless it's an ASCII or UTF-8 format\n const charset = environment.charsetLookup(mimetype);\n useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0;\n }\n if (useBase64) { mimetype += ';base64'; }\n }\n else {\n useBase64 = /;base64$/.test(mimetype);\n }\n\n const fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment);\n if (!fileSync.contents) {\n logger.warn(`Skipped data-uri embedding of ${filePath} because file not found`);\n return fallback(this, filePathNode || mimetypeNode);\n }\n let buf = fileSync.contents;\n if (useBase64 && !environment.encodeBase64) {\n return fallback(this, filePathNode);\n }\n\n buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);\n\n const uri = `data:${mimetype},${buf}${fragment}`;\n\n return new URL(new Quoted(`\"${uri}\"`, uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Expression from '../tree/expression';\nimport Quoted from '../tree/quoted';\nimport URL from '../tree/url';\n\nexport default () => {\n return { 'svg-gradient': function(direction) {\n let stops;\n let gradientDirectionSvg;\n let gradientType = 'linear';\n let rectangleDimension = 'x=\"0\" y=\"0\" width=\"1\" height=\"1\"';\n const renderEnv = {compress: false};\n let returner;\n const directionValue = direction.toCSS(renderEnv);\n let i;\n let color;\n let position;\n let positionValue;\n let alpha;\n\n function throwArgumentDescriptor() {\n throw { type: 'Argument',\n message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' +\n ' end_color [end_position] or direction, color list' };\n }\n\n if (arguments.length == 2) {\n if (arguments[1].value.length < 2) {\n throwArgumentDescriptor();\n }\n stops = arguments[1].value;\n } else if (arguments.length < 3) {\n throwArgumentDescriptor();\n } else {\n stops = Array.prototype.slice.call(arguments, 1);\n }\n\n switch (directionValue) {\n case 'to bottom':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\"';\n break;\n case 'to right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'to bottom right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\"';\n break;\n case 'to top right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"100%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'ellipse':\n case 'ellipse at center':\n gradientType = 'radial';\n gradientDirectionSvg = 'cx=\"50%\" cy=\"50%\" r=\"75%\"';\n rectangleDimension = 'x=\"-50\" y=\"-50\" width=\"101\" height=\"101\"';\n break;\n default:\n throw { type: 'Argument', message: 'svg-gradient direction must be \\'to bottom\\', \\'to right\\',' +\n ' \\'to bottom right\\', \\'to top right\\' or \\'ellipse at center\\'' };\n }\n returner = ``;\n\n returner = encodeURIComponent(returner);\n\n returner = `data:image/svg+xml,${returner}`;\n return new URL(new Quoted(`'${returner}'`, returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import contexts from './contexts';\nimport visitor from './visitors';\nimport tree from './tree';\n\nexport default function(root, options) {\n options = options || {};\n let evaldRoot;\n let variables = options.variables;\n const evalEnv = new contexts.Eval(options);\n\n //\n // Allows setting variables with a hash, so:\n //\n // `{ color: new tree.Color('#f01') }` will become:\n //\n // new tree.Declaration('@color',\n // new tree.Value([\n // new tree.Expression([\n // new tree.Color('#f01')\n // ])\n // ])\n // )\n //\n if (typeof variables === 'object' && !Array.isArray(variables)) {\n variables = Object.keys(variables).map(function (k) {\n let value = variables[k];\n\n if (!(value instanceof tree.Value)) {\n if (!(value instanceof tree.Expression)) {\n value = new tree.Expression([value]);\n }\n value = new tree.Value([value]);\n }\n return new tree.Declaration(`@${k}`, value, false, null, 0);\n });\n evalEnv.frames = [new tree.Ruleset(null, variables)];\n }\n\n const visitors = [\n new visitor.JoinSelectorVisitor(),\n new visitor.MarkVisibleSelectorsVisitor(true),\n new visitor.ExtendVisitor(),\n new visitor.ToCSSVisitor({compress: Boolean(options.compress)})\n ];\n\n const preEvalVisitors = [];\n let v;\n let visitorIterator;\n\n /**\n * first() / get() allows visitors to be added while visiting\n * \n * @todo Add scoping for visitors just like functions for @plugin; right now they're global\n */\n if (options.pluginManager) {\n visitorIterator = options.pluginManager.visitor();\n for (let i = 0; i < 2; i++) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (v.isPreEvalVisitor) {\n if (i === 0 || preEvalVisitors.indexOf(v) === -1) {\n preEvalVisitors.push(v);\n v.run(root);\n }\n }\n else {\n if (i === 0 || visitors.indexOf(v) === -1) {\n if (v.isPreVisitor) {\n visitors.unshift(v);\n }\n else {\n visitors.push(v);\n }\n }\n }\n }\n }\n }\n\n evaldRoot = root.eval(evalEnv);\n\n for (let i = 0; i < visitors.length; i++) {\n visitors[i].run(evaldRoot);\n }\n\n // Run any remaining visitors added after eval pass\n if (options.pluginManager) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (visitors.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) {\n v.run(evaldRoot);\n }\n }\n }\n\n return evaldRoot;\n}\n","/**\n * Plugin Manager\n */\nclass PluginManager {\n constructor(less) {\n this.less = less;\n this.visitors = [];\n this.preProcessors = [];\n this.postProcessors = [];\n this.installedPlugins = [];\n this.fileManagers = [];\n this.iterator = -1;\n this.pluginCache = {};\n this.Loader = new less.PluginLoader(less);\n }\n\n /**\n * Adds all the plugins in the array\n * @param {Array} plugins\n */\n addPlugins(plugins) {\n if (plugins) {\n for (let i = 0; i < plugins.length; i++) {\n this.addPlugin(plugins[i]);\n }\n }\n }\n\n /**\n *\n * @param plugin\n * @param {String} filename\n */\n addPlugin(plugin, filename, functionRegistry) {\n this.installedPlugins.push(plugin);\n if (filename) {\n this.pluginCache[filename] = plugin;\n }\n if (plugin.install) {\n plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry);\n }\n }\n\n /**\n *\n * @param filename\n */\n get(filename) {\n return this.pluginCache[filename];\n }\n\n /**\n * Adds a visitor. The visitor object has options on itself to determine\n * when it should run.\n * @param visitor\n */\n addVisitor(visitor) {\n this.visitors.push(visitor);\n }\n\n /**\n * Adds a pre processor object\n * @param {object} preProcessor\n * @param {number} priority - guidelines 1 = before import, 1000 = import, 2000 = after import\n */\n addPreProcessor(preProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) {\n if (this.preProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.preProcessors.splice(indexToInsertAt, 0, {preProcessor, priority});\n }\n\n /**\n * Adds a post processor object\n * @param {object} postProcessor\n * @param {number} priority - guidelines 1 = before compression, 1000 = compression, 2000 = after compression\n */\n addPostProcessor(postProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) {\n if (this.postProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.postProcessors.splice(indexToInsertAt, 0, {postProcessor, priority});\n }\n\n /**\n *\n * @param manager\n */\n addFileManager(manager) {\n this.fileManagers.push(manager);\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPreProcessors() {\n const preProcessors = [];\n for (let i = 0; i < this.preProcessors.length; i++) {\n preProcessors.push(this.preProcessors[i].preProcessor);\n }\n return preProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPostProcessors() {\n const postProcessors = [];\n for (let i = 0; i < this.postProcessors.length; i++) {\n postProcessors.push(this.postProcessors[i].postProcessor);\n }\n return postProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getVisitors() {\n return this.visitors;\n }\n\n visitor() {\n const self = this;\n return {\n first: function() {\n self.iterator = -1;\n return self.visitors[self.iterator];\n },\n get: function() {\n self.iterator += 1;\n return self.visitors[self.iterator];\n }\n };\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getFileManagers() {\n return this.fileManagers;\n }\n}\n\nlet pm;\n\nconst PluginManagerFactory = function(less, newFactory) {\n if (newFactory || !pm) {\n pm = new PluginManager(less);\n }\n return pm;\n};\n\n//\nexport default PluginManagerFactory;\n","'use strict';\n\nfunction parseNodeVersion(version) {\n var match = version.match(/^v(\\d{1,2})\\.(\\d{1,2})\\.(\\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\\+([0-9A-Za-z-.]+))?$/); // eslint-disable-line max-len\n if (!match) {\n throw new Error('Unable to parse: ' + version);\n }\n\n var res = {\n major: parseInt(match[1], 10),\n minor: parseInt(match[2], 10),\n patch: parseInt(match[3], 10),\n pre: match[4] || '',\n build: match[5] || '',\n };\n\n return res;\n}\n\nmodule.exports = parseNodeVersion;\n","import AbstractFileManager from '../less/environment/abstract-file-manager.js';\n\nlet options;\nlet logger;\nlet fileCache = {};\n\n// TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load\nconst FileManager = function() {}\nFileManager.prototype = Object.assign(new AbstractFileManager(), {\n alwaysMakePathsAbsolute() {\n return true;\n },\n\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return this.extractUrlParts(laterPath, basePath).path;\n },\n\n doXHR(url, type, callback, errback) {\n const xhr = new XMLHttpRequest();\n const async = options.isFileProtocol ? options.fileAsync : true;\n\n if (typeof xhr.overrideMimeType === 'function') {\n xhr.overrideMimeType('text/css');\n }\n logger.debug(`XHR: Getting '${url}'`);\n xhr.open('GET', url, async);\n xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');\n xhr.send(null);\n\n function handleResponse(xhr, callback, errback) {\n if (xhr.status >= 200 && xhr.status < 300) {\n callback(xhr.responseText,\n xhr.getResponseHeader('Last-Modified'));\n } else if (typeof errback === 'function') {\n errback(xhr.status, url);\n }\n }\n\n if (options.isFileProtocol && !options.fileAsync) {\n if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) {\n callback(xhr.responseText);\n } else {\n errback(xhr.status, url);\n }\n } else if (async) {\n xhr.onreadystatechange = () => {\n if (xhr.readyState == 4) {\n handleResponse(xhr, callback, errback);\n }\n };\n } else {\n handleResponse(xhr, callback, errback);\n }\n },\n\n supports() {\n return true;\n },\n\n clearFileCache() {\n fileCache = {};\n },\n\n loadFile(filename, currentDirectory, options) {\n // TODO: Add prefix support like less-node?\n // What about multiple paths?\n\n if (currentDirectory && !this.isPathAbsolute(filename)) {\n filename = currentDirectory + filename;\n }\n\n filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename;\n\n options = options || {};\n\n // sheet may be set to the stylesheet for the initial load or a collection of properties including\n // some context variables for imports\n const hrefParts = this.extractUrlParts(filename, window.location.href);\n const href = hrefParts.url;\n const self = this;\n \n return new Promise((resolve, reject) => {\n if (options.useFileCache && fileCache[href]) {\n try {\n const lessText = fileCache[href];\n return resolve({ contents: lessText, filename: href, webInfo: { lastModified: new Date() }});\n } catch (e) {\n return reject({ filename: href, message: `Error loading file ${href} error was ${e.message}` });\n }\n }\n\n self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) {\n // per file cache\n fileCache[href] = data;\n\n // Use remote copy (re-parse)\n resolve({ contents: data, filename: href, webInfo: { lastModified }});\n }, function doXHRError(status, url) {\n reject({ type: 'File', message: `'${url}' wasn't found (${status})`, href });\n });\n });\n }\n});\n\nexport default (opts, log) => {\n options = opts;\n logger = log;\n return FileManager;\n}\n","import Environment from './environment/environment';\nimport data from './data';\nimport tree from './tree';\nimport AbstractFileManager from './environment/abstract-file-manager';\nimport AbstractPluginLoader from './environment/abstract-plugin-loader';\nimport visitors from './visitors';\nimport Parser from './parser/parser';\nimport functions from './functions';\nimport contexts from './contexts';\nimport LessError from './less-error';\nimport transformTree from './transform-tree';\nimport * as utils from './utils';\nimport PluginManager from './plugin-manager';\nimport logger from './logger';\nimport SourceMapOutput from './source-map-output';\nimport SourceMapBuilder from './source-map-builder';\nimport ParseTree from './parse-tree';\nimport ImportManager from './import-manager';\nimport Parse from './parse';\nimport Render from './render';\nimport { version } from '../../package.json';\nimport parseVersion from 'parse-node-version';\n\nexport default function(environment, fileManagers) {\n let sourceMapOutput, sourceMapBuilder, parseTree, importManager;\n\n environment = new Environment(environment, fileManagers);\n sourceMapOutput = SourceMapOutput(environment);\n sourceMapBuilder = SourceMapBuilder(sourceMapOutput, environment);\n parseTree = ParseTree(sourceMapBuilder);\n importManager = ImportManager(environment);\n\n const render = Render(environment, parseTree, importManager);\n const parse = Parse(environment, parseTree, importManager);\n\n const v = parseVersion(`v${version}`);\n const initial = {\n version: [v.major, v.minor, v.patch],\n data,\n tree,\n Environment,\n AbstractFileManager,\n AbstractPluginLoader,\n environment,\n visitors,\n Parser,\n functions: functions(environment),\n contexts,\n SourceMapOutput: sourceMapOutput,\n SourceMapBuilder: sourceMapBuilder,\n ParseTree: parseTree,\n ImportManager: importManager,\n render,\n parse,\n LessError,\n transformTree,\n utils,\n PluginManager,\n logger\n };\n\n // Create a public API\n\n const ctor = function(t) {\n return function() {\n const obj = Object.create(t.prototype);\n t.apply(obj, Array.prototype.slice.call(arguments, 0));\n return obj;\n };\n };\n let t;\n const api = Object.create(initial);\n for (const n in initial.tree) {\n /* eslint guard-for-in: 0 */\n t = initial.tree[n];\n if (typeof t === 'function') {\n api[n.toLowerCase()] = ctor(t);\n }\n else {\n api[n] = Object.create(null);\n for (const o in t) {\n /* eslint guard-for-in: 0 */\n api[n][o.toLowerCase()] = ctor(t[o]);\n }\n }\n }\n\n /**\n * Some of the functions assume a `this` context of the API object,\n * which causes it to fail when wrapped for ES6 imports.\n * \n * An assumed `this` should be removed in the future.\n */\n initial.parse = initial.parse.bind(api);\n initial.render = initial.render.bind(api);\n\n return api;\n}\n","import LessError from './less-error';\nimport transformTree from './transform-tree';\nimport logger from './logger';\n\nexport default function(SourceMapBuilder) {\n class ParseTree {\n constructor(root, imports) {\n this.root = root;\n this.imports = imports;\n }\n\n toCSS(options) {\n let evaldRoot;\n const result = {};\n let sourceMapBuilder;\n try {\n evaldRoot = transformTree(this.root, options);\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n try {\n const compress = Boolean(options.compress);\n if (compress) {\n logger.warn('The compress option has been deprecated. ' + \n 'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');\n }\n\n const toCSSOptions = {\n compress,\n dumpLineNumbers: options.dumpLineNumbers,\n strictUnits: Boolean(options.strictUnits),\n numPrecision: 8};\n\n if (options.sourceMap) {\n sourceMapBuilder = new SourceMapBuilder(options.sourceMap);\n result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports);\n } else {\n result.css = evaldRoot.toCSS(toCSSOptions);\n }\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n if (options.pluginManager) {\n const postProcessors = options.pluginManager.getPostProcessors();\n for (let i = 0; i < postProcessors.length; i++) {\n result.css = postProcessors[i].process(result.css, { sourceMap: sourceMapBuilder, options, imports: this.imports });\n }\n }\n if (options.sourceMap) {\n result.map = sourceMapBuilder.getExternalSourceMap();\n }\n\n result.imports = [];\n for (const file in this.imports.files) {\n if (Object.prototype.hasOwnProperty.call(this.imports.files, file) && file !== this.imports.rootFilename) {\n result.imports.push(file);\n }\n }\n return result;\n }\n }\n\n return ParseTree;\n}\n","export default function (SourceMapOutput, environment) {\n class SourceMapBuilder {\n constructor(options) {\n this.options = options;\n }\n\n toCSS(rootNode, options, imports) {\n const sourceMapOutput = new SourceMapOutput(\n {\n contentsIgnoredCharsMap: imports.contentsIgnoredChars,\n rootNode,\n contentsMap: imports.contents,\n sourceMapFilename: this.options.sourceMapFilename,\n sourceMapURL: this.options.sourceMapURL,\n outputFilename: this.options.sourceMapOutputFilename,\n sourceMapBasepath: this.options.sourceMapBasepath,\n sourceMapRootpath: this.options.sourceMapRootpath,\n outputSourceFiles: this.options.outputSourceFiles,\n sourceMapGenerator: this.options.sourceMapGenerator,\n sourceMapFileInline: this.options.sourceMapFileInline, \n disableSourcemapAnnotation: this.options.disableSourcemapAnnotation\n });\n\n const css = sourceMapOutput.toCSS(options);\n this.sourceMap = sourceMapOutput.sourceMap;\n this.sourceMapURL = sourceMapOutput.sourceMapURL;\n if (this.options.sourceMapInputFilename) {\n this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename);\n }\n if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) {\n this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL);\n }\n return css + this.getCSSAppendage();\n }\n\n getCSSAppendage() {\n\n let sourceMapURL = this.sourceMapURL;\n if (this.options.sourceMapFileInline) {\n if (this.sourceMap === undefined) {\n return '';\n }\n sourceMapURL = `data:application/json;base64,${environment.encodeBase64(this.sourceMap)}`;\n }\n\n if (this.options.disableSourcemapAnnotation) {\n return '';\n }\n\n if (sourceMapURL) {\n return `/*# sourceMappingURL=${sourceMapURL} */`;\n }\n return '';\n }\n\n getExternalSourceMap() {\n return this.sourceMap;\n }\n\n setExternalSourceMap(sourceMap) {\n this.sourceMap = sourceMap;\n }\n\n isInline() {\n return this.options.sourceMapFileInline;\n }\n\n getSourceMapURL() {\n return this.sourceMapURL;\n }\n\n getOutputFilename() {\n return this.options.sourceMapOutputFilename;\n }\n\n getInputFilename() {\n return this.sourceMapInputFilename;\n }\n }\n\n return SourceMapBuilder;\n}\n","export default function (environment) {\n class SourceMapOutput {\n constructor(options) {\n this._css = [];\n this._rootNode = options.rootNode;\n this._contentsMap = options.contentsMap;\n this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;\n if (options.sourceMapFilename) {\n this._sourceMapFilename = options.sourceMapFilename.replace(/\\\\/g, '/');\n }\n this._outputFilename = options.outputFilename;\n this.sourceMapURL = options.sourceMapURL;\n if (options.sourceMapBasepath) {\n this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\\\/g, '/');\n }\n if (options.sourceMapRootpath) {\n this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\\\/g, '/');\n if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') {\n this._sourceMapRootpath += '/';\n }\n } else {\n this._sourceMapRootpath = '';\n }\n this._outputSourceFiles = options.outputSourceFiles;\n this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();\n\n this._lineNumber = 0;\n this._column = 0;\n }\n\n removeBasepath(path) {\n if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) {\n path = path.substring(this._sourceMapBasepath.length);\n if (path.charAt(0) === '\\\\' || path.charAt(0) === '/') {\n path = path.substring(1);\n }\n }\n\n return path;\n }\n\n normalizeFilename(filename) {\n filename = filename.replace(/\\\\/g, '/');\n filename = this.removeBasepath(filename);\n return (this._sourceMapRootpath || '') + filename;\n }\n\n add(chunk, fileInfo, index, mapLines) {\n\n // ignore adding empty strings\n if (!chunk) {\n return;\n }\n\n let lines, sourceLines, columns, sourceColumns, i;\n\n if (fileInfo && fileInfo.filename) {\n let inputSource = this._contentsMap[fileInfo.filename];\n\n // remove vars/banner added to the top of the file\n if (this._contentsIgnoredCharsMap[fileInfo.filename]) {\n // adjust the index\n index -= this._contentsIgnoredCharsMap[fileInfo.filename];\n if (index < 0) { index = 0; }\n // adjust the source\n inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);\n }\n\n /** \n * ignore empty content, or failsafe\n * if contents map is incorrect\n */\n if (inputSource === undefined) {\n this._css.push(chunk);\n return;\n }\n\n inputSource = inputSource.substring(0, index);\n sourceLines = inputSource.split('\\n');\n sourceColumns = sourceLines[sourceLines.length - 1];\n }\n\n lines = chunk.split('\\n');\n columns = lines[lines.length - 1];\n\n if (fileInfo && fileInfo.filename) {\n if (!mapLines) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column},\n original: { line: sourceLines.length, column: sourceColumns.length},\n source: this.normalizeFilename(fileInfo.filename)});\n } else {\n for (i = 0; i < lines.length; i++) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0},\n original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0},\n source: this.normalizeFilename(fileInfo.filename)});\n }\n }\n }\n\n if (lines.length === 1) {\n this._column += columns.length;\n } else {\n this._lineNumber += lines.length - 1;\n this._column = columns.length;\n }\n\n this._css.push(chunk);\n }\n\n isEmpty() {\n return this._css.length === 0;\n }\n\n toCSS(context) {\n this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });\n\n if (this._outputSourceFiles) {\n for (const filename in this._contentsMap) {\n // eslint-disable-next-line no-prototype-builtins\n if (this._contentsMap.hasOwnProperty(filename)) {\n let source = this._contentsMap[filename];\n if (this._contentsIgnoredCharsMap[filename]) {\n source = source.slice(this._contentsIgnoredCharsMap[filename]);\n }\n this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source);\n }\n }\n }\n\n this._rootNode.genCSS(context, this);\n\n if (this._css.length > 0) {\n let sourceMapURL;\n const sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());\n\n if (this.sourceMapURL) {\n sourceMapURL = this.sourceMapURL;\n } else if (this._sourceMapFilename) {\n sourceMapURL = this._sourceMapFilename;\n }\n this.sourceMapURL = sourceMapURL;\n\n this.sourceMap = sourceMapContent;\n }\n\n return this._css.join('');\n }\n }\n\n return SourceMapOutput;\n}\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport LessError from './less-error';\nimport * as utils from './utils';\nimport logger from './logger';\n\nexport default function(environment) {\n // FileInfo = {\n // 'rewriteUrls' - option - whether to adjust URL's to be relative\n // 'filename' - full resolved filename of current file\n // 'rootpath' - path to append to normal URLs for this node\n // 'currentDirectory' - path to the current file, absolute\n // 'rootFilename' - filename of the base file\n // 'entryPath' - absolute path to the entry file\n // 'reference' - whether the file should not be output and only output parts that are referenced\n\n class ImportManager {\n constructor(less, context, rootFileInfo) {\n this.less = less;\n this.rootFilename = rootFileInfo.filename;\n this.paths = context.paths || []; // Search paths, when importing\n this.contents = {}; // map - filename to contents of all the files\n this.contentsIgnoredChars = {}; // map - filename to lines at the beginning of each file to ignore\n this.mime = context.mime;\n this.error = null;\n this.context = context;\n // Deprecated? Unused outside of here, could be useful.\n this.queue = []; // Files which haven't been imported yet\n this.files = {}; // Holds the imported parse trees.\n }\n\n /**\n * Add an import to be imported\n * @param path - the raw path\n * @param tryAppendExtension - whether to try appending a file extension (.less or .js if the path has no extension)\n * @param currentFileInfo - the current file info (used for instance to work out relative paths)\n * @param importOptions - import options\n * @param callback - callback for when it is imported\n */\n push(path, tryAppendExtension, currentFileInfo, importOptions, callback) {\n const importManager = this, pluginLoader = this.context.pluginManager.Loader;\n\n this.queue.push(path);\n\n const fileParsedFunc = function (e, root, fullPath) {\n importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue\n\n const importedEqualsRoot = fullPath === importManager.rootFilename;\n if (importOptions.optional && e) {\n callback(null, {rules:[]}, false, null);\n logger.info(`The file ${fullPath} was skipped because it was not found and the import was marked optional.`);\n }\n else {\n // Inline imports aren't cached here.\n // If we start to cache them, please make sure they won't conflict with non-inline imports of the\n // same name as they used to do before this comment and the condition below have been added.\n if (!importManager.files[fullPath] && !importOptions.inline) {\n importManager.files[fullPath] = { root, options: importOptions };\n }\n if (e && !importManager.error) { importManager.error = e; }\n callback(e, root, importedEqualsRoot, fullPath);\n }\n };\n\n const newFileInfo = {\n rewriteUrls: this.context.rewriteUrls,\n entryPath: currentFileInfo.entryPath,\n rootpath: currentFileInfo.rootpath,\n rootFilename: currentFileInfo.rootFilename\n };\n\n const fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment);\n\n if (!fileManager) {\n fileParsedFunc({ message: `Could not find a file-manager for ${path}` });\n return;\n }\n\n const loadFileCallback = function(loadedFile) {\n let plugin;\n const resolvedFilename = loadedFile.filename;\n const contents = loadedFile.contents.replace(/^\\uFEFF/, '');\n\n // Pass on an updated rootpath if path of imported file is relative and file\n // is in a (sub|sup) directory\n //\n // Examples:\n // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/',\n // then rootpath should become 'less/module/nav/'\n // - If path of imported file is '../mixins.less' and rootpath is 'less/',\n // then rootpath should become 'less/../'\n newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename);\n if (newFileInfo.rewriteUrls) {\n newFileInfo.rootpath = fileManager.join(\n (importManager.context.rootpath || ''),\n fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath));\n\n if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) {\n newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath);\n }\n }\n newFileInfo.filename = resolvedFilename;\n\n const newEnv = new contexts.Parse(importManager.context);\n\n newEnv.processImports = false;\n importManager.contents[resolvedFilename] = contents;\n\n if (currentFileInfo.reference || importOptions.reference) {\n newFileInfo.reference = true;\n }\n\n if (importOptions.isPlugin) {\n plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo);\n if (plugin instanceof LessError) {\n fileParsedFunc(plugin, null, resolvedFilename);\n }\n else {\n fileParsedFunc(null, plugin, resolvedFilename);\n }\n } else if (importOptions.inline) {\n fileParsedFunc(null, contents, resolvedFilename);\n } else {\n // import (multiple) parse trees apparently get altered and can't be cached.\n // TODO: investigate why this is\n if (importManager.files[resolvedFilename]\n && !importManager.files[resolvedFilename].options.multiple\n && !importOptions.multiple) {\n\n fileParsedFunc(null, importManager.files[resolvedFilename].root, resolvedFilename);\n }\n else {\n new Parser(newEnv, importManager, newFileInfo).parse(contents, function (e, root) {\n fileParsedFunc(e, root, resolvedFilename);\n });\n }\n }\n };\n let loadedFile;\n let promise;\n const context = utils.clone(this.context);\n\n if (tryAppendExtension) {\n context.ext = importOptions.isPlugin ? '.js' : '.less';\n }\n\n if (importOptions.isPlugin) {\n context.mime = 'application/javascript';\n\n if (context.syncImport) {\n loadedFile = pluginLoader.loadPluginSync(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n } else {\n promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n }\n }\n else {\n if (context.syncImport) {\n loadedFile = fileManager.loadFileSync(path, currentFileInfo.currentDirectory, context, environment);\n } else {\n promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment,\n (err, loadedFile) => {\n if (err) {\n fileParsedFunc(err);\n } else {\n loadFileCallback(loadedFile);\n }\n });\n }\n }\n if (loadedFile) {\n if (!loadedFile.filename) {\n fileParsedFunc(loadedFile);\n } else {\n loadFileCallback(loadedFile);\n }\n } else if (promise) {\n promise.then(loadFileCallback, fileParsedFunc);\n }\n }\n }\n\n return ImportManager;\n}\n","import * as utils from './utils';\n\nexport default function(environment, ParseTree) {\n const render = function (input, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise(function (resolve, reject) {\n render.call(self, input, options, function(err, output) {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n this.parse(input, options, function(err, root, imports, options) {\n if (err) { return callback(err); }\n\n let result;\n try {\n const parseTree = new ParseTree(root, imports);\n result = parseTree.toCSS(options);\n }\n catch (err) { return callback(err); }\n\n callback(null, result);\n });\n }\n };\n\n return render;\n}\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport PluginManager from './plugin-manager';\nimport LessError from './less-error';\nimport * as utils from './utils';\n\nexport default function(environment, ParseTree, ImportManager) {\n const parse = function (input, options, callback) {\n\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise(function (resolve, reject) {\n parse.call(self, input, options, function(err, output) {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n let context;\n let rootFileInfo;\n const pluginManager = new PluginManager(this, !options.reUsePluginManager);\n\n options.pluginManager = pluginManager;\n\n context = new contexts.Parse(options);\n\n if (options.rootFileInfo) {\n rootFileInfo = options.rootFileInfo;\n } else {\n const filename = options.filename || 'input';\n const entryPath = filename.replace(/[^/\\\\]*$/, '');\n rootFileInfo = {\n filename,\n rewriteUrls: context.rewriteUrls,\n rootpath: context.rootpath || '',\n currentDirectory: entryPath,\n entryPath,\n rootFilename: filename\n };\n // add in a missing trailing slash\n if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') {\n rootFileInfo.rootpath += '/';\n }\n }\n\n const imports = new ImportManager(this, context, rootFileInfo);\n this.importManager = imports;\n\n // TODO: allow the plugins to be just a list of paths or names\n // Do an async plugin queue like lessc\n\n if (options.plugins) {\n options.plugins.forEach(function(plugin) {\n let evalResult, contents;\n if (plugin.fileContent) {\n contents = plugin.fileContent.replace(/^\\uFEFF/, '');\n evalResult = pluginManager.Loader.evalPlugin(contents, context, imports, plugin.options, plugin.filename);\n if (evalResult instanceof LessError) {\n return callback(evalResult);\n }\n }\n else {\n pluginManager.addPlugin(plugin);\n }\n });\n }\n\n new Parser(context, imports, rootFileInfo)\n .parse(input, function (e, root) {\n if (e) { return callback(e); }\n callback(null, root, imports, options);\n }, options);\n }\n };\n return parse;\n}\n","/**\n * @todo Add tests for browser `@plugin`\n */\nimport AbstractPluginLoader from '../less/environment/abstract-plugin-loader.js';\n\n/**\n * Browser Plugin Loader\n */\nconst PluginLoader = function(less) {\n this.less = less;\n // Should we shim this.require for browser? Probably not?\n};\n\nPluginLoader.prototype = Object.assign(new AbstractPluginLoader(), {\n loadPlugin(filename, basePath, context, environment, fileManager) {\n return new Promise((fulfill, reject) => {\n fileManager.loadFile(filename, basePath, context, environment)\n .then(fulfill).catch(reject);\n });\n }\n});\n\nexport default PluginLoader;\n\n","import * as utils from './utils';\nimport browser from './browser';\n\nexport default (window, less, options) => {\n\n function errorHTML(e, rootHref) {\n const id = `less-error-message:${utils.extractId(rootHref || '')}`;\n const template = '{content}
';\n const elem = window.document.createElement('div');\n let timer;\n let content;\n const errors = [];\n const filename = e.filename || rootHref;\n const filenameNoPath = filename.match(/([^/]+(\\?.*)?)$/)[1];\n\n elem.id = id;\n elem.className = 'less-error-message';\n\n content = `${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'}` + \n `
in ${filenameNoPath} `;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += `on line ${e.line}, column ${e.column + 1}:
`;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `
Stack Trace${e.stack.split('\\n').slice(1).join('
')}`;\n }\n elem.innerHTML = content;\n\n // CSS for error messages\n browser.createCSS(window.document, [\n '.less-error-message ul, .less-error-message li {',\n 'list-style-type: none;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message label {',\n 'font-size: 12px;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'color: #cc7777;',\n '}',\n '.less-error-message pre {',\n 'color: #dd6666;',\n 'padding: 4px 0;',\n 'margin: 0;',\n 'display: inline-block;',\n '}',\n '.less-error-message pre.line {',\n 'color: #ff0000;',\n '}',\n '.less-error-message h3 {',\n 'font-size: 20px;',\n 'font-weight: bold;',\n 'padding: 15px 0 5px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message a {',\n 'color: #10a',\n '}',\n '.less-error-message .error {',\n 'color: red;',\n 'font-weight: bold;',\n 'padding-bottom: 2px;',\n 'border-bottom: 1px dashed red;',\n '}'\n ].join('\\n'), { title: 'error-message' });\n\n elem.style.cssText = [\n 'font-family: Arial, sans-serif',\n 'border: 1px solid #e00',\n 'background-color: #eee',\n 'border-radius: 5px',\n '-webkit-border-radius: 5px',\n '-moz-border-radius: 5px',\n 'color: #e00',\n 'padding: 15px',\n 'margin-bottom: 15px'\n ].join(';');\n\n if (options.env === 'development') {\n timer = setInterval(() => {\n const document = window.document;\n const body = document.body;\n if (body) {\n if (document.getElementById(id)) {\n body.replaceChild(elem, document.getElementById(id));\n } else {\n body.insertBefore(elem, body.firstChild);\n }\n clearInterval(timer);\n }\n }, 10);\n }\n }\n\n function removeErrorHTML(path) {\n const node = window.document.getElementById(`less-error-message:${utils.extractId(path)}`);\n if (node) {\n node.parentNode.removeChild(node);\n }\n }\n\n function removeErrorConsole() {\n // no action\n }\n\n function removeError(path) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n removeErrorHTML(path);\n } else if (options.errorReporting === 'console') {\n removeErrorConsole(path);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('remove', path);\n }\n }\n\n function errorConsole(e, rootHref) {\n const template = '{line} {content}';\n const filename = e.filename || rootHref;\n const errors = [];\n let content = `${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'} in ${filename}`;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += ` on line ${e.line}, column ${e.column + 1}:\\n${errors.join('\\n')}`;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `\\nStack Trace\\n${e.stack}`;\n }\n less.logger.error(content);\n }\n\n function error(e, rootHref) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n errorHTML(e, rootHref);\n } else if (options.errorReporting === 'console') {\n errorConsole(e, rootHref);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('add', e, rootHref);\n }\n }\n\n return {\n add: error,\n remove: removeError\n };\n};\n","/**\n * Kicks off less and compiles any stylesheets\n * used in the browser distributed version of less\n * to kick-start less using the browser api\n */\nimport defaultOptions from '../less/default-options';\nimport addDefaultOptions from './add-default-options';\nimport root from './index';\n\nconst options = defaultOptions();\n\nif (window.less) {\n for (const key in window.less) {\n if (Object.prototype.hasOwnProperty.call(window.less, key)) {\n options[key] = window.less[key];\n }\n }\n}\naddDefaultOptions(window, options);\n\noptions.plugins = options.plugins || [];\n\nif (window.LESS_PLUGINS) {\n options.plugins = options.plugins.concat(window.LESS_PLUGINS);\n}\n\nconst less = root(window, options);\nexport default less;\n\nwindow.less = less;\n\nlet css;\nlet head;\nlet style;\n\n// Always restore page visibility\nfunction resolveOrReject(data) {\n if (data.filename) {\n console.warn(data);\n }\n if (!options.async) {\n head.removeChild(style);\n }\n}\n\nif (options.onReady) {\n if (/!watch/.test(window.location.hash)) {\n less.watch();\n }\n // Simulate synchronous stylesheet loading by hiding page rendering\n if (!options.async) {\n css = 'body { display: none !important }';\n head = document.head || document.getElementsByTagName('head')[0];\n style = document.createElement('style');\n\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n less.registerStylesheetsImmediately();\n less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject);\n}\n","// Export a new default each time\nexport default function() {\n return {\n /* Inline Javascript - @plugin still allowed */\n javascriptEnabled: false,\n\n /* Outputs a makefile import dependency list to stdout. */\n depends: false,\n\n /* (DEPRECATED) Compress using less built-in compression. \n * This does an okay job but does not utilise all the tricks of \n * dedicated css compression. */\n compress: false,\n\n /* Runs the less parser and just reports errors without any output. */\n lint: false,\n\n /* Sets available include paths.\n * If the file in an @import rule does not exist at that exact location, \n * less will look for it at the location(s) passed to this option. \n * You might use this for instance to specify a path to a library which \n * you want to be referenced simply and relatively in the less files. */\n paths: [],\n\n /* color output in the terminal */\n color: true,\n\n /* The strictImports controls whether the compiler will allow an @import inside of either \n * @media blocks or (a later addition) other selector blocks.\n * See: https://github.com/less/less.js/issues/656 */\n strictImports: false,\n\n /* Allow Imports from Insecure HTTPS Hosts */\n insecure: false,\n\n /* Allows you to add a path to every generated import and url in your css. \n * This does not affect less import statements that are processed, just ones \n * that are left in the output css. */\n rootpath: '',\n\n /* By default URLs are kept as-is, so if you import a file in a sub-directory \n * that references an image, exactly the same URL will be output in the css. \n * This option allows you to re-write URL's in imported files so that the \n * URL is always relative to the base imported file */\n rewriteUrls: false,\n\n /* How to process math \n * 0 always - eagerly try to solve all operations\n * 1 parens-division - require parens for division \"/\"\n * 2 parens | strict - require parens for all operations\n * 3 strict-legacy - legacy strict behavior (super-strict)\n */\n math: 1,\n\n /* Without this option, less attempts to guess at the output unit when it does maths. */\n strictUnits: false,\n\n /* Effectively the declaration is put at the top of your base Less file, \n * meaning it can be used but it also can be overridden if this variable \n * is defined in the file. */\n globalVars: null,\n\n /* As opposed to the global variable option, this puts the declaration at the\n * end of your base file, meaning it will override anything defined in your Less file. */\n modifyVars: null,\n\n /* This option allows you to specify a argument to go on to every URL. */\n urlArgs: ''\n }\n}","import {addDataAttr} from './utils';\nimport browser from './browser';\n\nexport default (window, options) => {\n\n // use options from the current script tag data attribues\n addDataAttr(options, browser.currentScript(window));\n\n if (options.isFileProtocol === undefined) {\n options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol);\n }\n\n // Load styles asynchronously (default: false)\n //\n // This is set to `false` by default, so that the body\n // doesn't start loading before the stylesheets are parsed.\n // Setting this to `true` can result in flickering.\n //\n options.async = options.async || false;\n options.fileAsync = options.fileAsync || false;\n\n // Interval between watch polls\n options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500);\n\n options.env = options.env || (window.location.hostname == '127.0.0.1' ||\n window.location.hostname == '0.0.0.0' ||\n window.location.hostname == 'localhost' ||\n (window.location.port &&\n window.location.port.length > 0) ||\n options.isFileProtocol ? 'development'\n : 'production');\n\n const dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash);\n if (dumpLineNumbers) {\n options.dumpLineNumbers = dumpLineNumbers[1];\n }\n\n if (options.useFileCache === undefined) {\n options.useFileCache = true;\n }\n\n if (options.onReady === undefined) {\n options.onReady = true;\n }\n\n if (options.relativeUrls) {\n options.rewriteUrls = 'all';\n }\n};\n","//\n// index.js\n// Should expose the additional browser functions on to the less object\n//\nimport {addDataAttr} from './utils';\nimport lessRoot from '../less';\nimport browser from './browser';\nimport FM from './file-manager';\nimport PluginLoader from './plugin-loader';\nimport LogListener from './log-listener';\nimport ErrorReporting from './error-reporting';\nimport Cache from './cache';\nimport ImageSize from './image-size';\n\nexport default (window, options) => {\n const document = window.document;\n const less = lessRoot();\n\n less.options = options;\n const environment = less.environment;\n const FileManager = FM(options, less.logger);\n const fileManager = new FileManager();\n environment.addFileManager(fileManager);\n less.FileManager = FileManager;\n less.PluginLoader = PluginLoader;\n\n LogListener(less, options);\n const errors = ErrorReporting(window, less, options);\n const cache = less.cache = options.cache || Cache(window, options, less.logger);\n ImageSize(less.environment);\n\n // Setup user functions - Deprecate?\n if (options.functions) {\n less.functions.functionRegistry.addMultiple(options.functions);\n }\n\n const typePattern = /^text\\/(x-)?less$/;\n\n function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n }\n\n // only really needed for phantom\n function bind(func, thisArg) {\n const curryArgs = Array.prototype.slice.call(arguments, 2);\n return function() {\n const args = curryArgs.concat(Array.prototype.slice.call(arguments, 0));\n return func.apply(thisArg, args);\n };\n }\n\n function loadStyles(modifyVars) {\n const styles = document.getElementsByTagName('style');\n let style;\n\n for (let i = 0; i < styles.length; i++) {\n style = styles[i];\n if (style.type.match(typePattern)) {\n const instanceOptions = clone(options);\n instanceOptions.modifyVars = modifyVars;\n const lessText = style.innerHTML || '';\n instanceOptions.filename = document.location.href.replace(/#.*$/, '');\n\n /* jshint loopfunc:true */\n // use closure to store current style\n less.render(lessText, instanceOptions,\n bind((style, e, result) => {\n if (e) {\n errors.add(e, 'inline');\n } else {\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = result.css;\n } else {\n style.innerHTML = result.css;\n }\n }\n }, null, style));\n }\n }\n }\n\n function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {\n\n const instanceOptions = clone(options);\n addDataAttr(instanceOptions, sheet);\n instanceOptions.mime = sheet.type;\n\n if (modifyVars) {\n instanceOptions.modifyVars = modifyVars;\n }\n\n function loadInitialFileCallback(loadedFile) {\n const data = loadedFile.contents;\n const path = loadedFile.filename;\n const webInfo = loadedFile.webInfo;\n\n const newFileInfo = {\n currentDirectory: fileManager.getPath(path),\n filename: path,\n rootFilename: path,\n rewriteUrls: instanceOptions.rewriteUrls\n };\n\n newFileInfo.entryPath = newFileInfo.currentDirectory;\n newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory;\n\n if (webInfo) {\n webInfo.remaining = remaining;\n\n const css = cache.getCSS(path, webInfo, instanceOptions.modifyVars);\n if (!reload && css) {\n webInfo.local = true;\n callback(null, css, data, sheet, webInfo, path);\n return;\n }\n\n }\n\n // TODO add tests around how this behaves when reloading\n errors.remove(path);\n\n instanceOptions.rootFileInfo = newFileInfo;\n less.render(data, instanceOptions, (e, result) => {\n if (e) {\n e.href = path;\n callback(e);\n } else {\n cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css);\n callback(null, result.css, data, sheet, webInfo, path);\n }\n });\n }\n\n fileManager.loadFile(sheet.href, null, instanceOptions, environment)\n .then(loadedFile => {\n loadInitialFileCallback(loadedFile);\n }).catch(err => {\n console.log(err);\n callback(err);\n });\n\n }\n\n function loadStyleSheets(callback, reload, modifyVars) {\n for (let i = 0; i < less.sheets.length; i++) {\n loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1), modifyVars);\n }\n }\n\n function initRunningMode() {\n if (less.env === 'development') {\n less.watchTimer = setInterval(() => {\n if (less.watchMode) {\n fileManager.clearFileCache();\n /**\n * @todo remove when this is typed with JSDoc\n */\n // eslint-disable-next-line no-unused-vars\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n } else if (css) {\n browser.createCSS(window.document, css, sheet);\n }\n });\n }\n }, options.poll);\n }\n }\n\n //\n // Watch mode\n //\n less.watch = function () {\n if (!less.watchMode ) {\n less.env = 'development';\n initRunningMode();\n }\n this.watchMode = true;\n return true;\n };\n\n less.unwatch = function () {clearInterval(less.watchTimer); this.watchMode = false; return false; };\n\n //\n // Synchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\".\n //\n less.registerStylesheetsImmediately = () => {\n const links = document.getElementsByTagName('link');\n less.sheets = [];\n\n for (let i = 0; i < links.length; i++) {\n if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&\n (links[i].type.match(typePattern)))) {\n less.sheets.push(links[i]);\n }\n }\n };\n\n //\n // Asynchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\", returning a Promise.\n //\n less.registerStylesheets = () => new Promise((resolve) => {\n less.registerStylesheetsImmediately();\n resolve();\n });\n\n //\n // With this function, it's possible to alter variables and re-render\n // CSS without reloading less-files\n //\n less.modifyVars = record => less.refresh(true, record, false);\n\n less.refresh = (reload, modifyVars, clearFileCache) => {\n if ((reload || clearFileCache) && clearFileCache !== false) {\n fileManager.clearFileCache();\n }\n return new Promise((resolve, reject) => {\n let startTime;\n let endTime;\n let totalMilliseconds;\n let remainingSheets;\n startTime = endTime = new Date();\n\n // Set counter for remaining unprocessed sheets\n remainingSheets = less.sheets.length;\n\n if (remainingSheets === 0) {\n\n endTime = new Date();\n totalMilliseconds = endTime - startTime;\n less.logger.info('Less has finished and no sheets were loaded.');\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n\n } else {\n // Relies on less.sheets array, callback seems to be guaranteed to be called for every element of the array\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n reject(e);\n return;\n }\n if (webInfo.local) {\n less.logger.info(`Loading ${sheet.href} from cache.`);\n } else {\n less.logger.info(`Rendered ${sheet.href} successfully.`);\n }\n browser.createCSS(window.document, css, sheet);\n less.logger.info(`CSS for ${sheet.href} generated in ${new Date() - endTime}ms`);\n\n // Count completed sheet\n remainingSheets--;\n\n // Check if the last remaining sheet was processed and then call the promise\n if (remainingSheets === 0) {\n totalMilliseconds = new Date() - startTime;\n less.logger.info(`Less has finished. CSS generated in ${totalMilliseconds}ms`);\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n }\n endTime = new Date();\n }, reload, modifyVars);\n }\n\n loadStyles(modifyVars);\n });\n };\n\n less.refreshStyles = loadStyles;\n return less;\n};\n","export default (less, options) => {\n const logLevel_debug = 4;\n const logLevel_info = 3;\n const logLevel_warn = 2;\n const logLevel_error = 1;\n\n // The amount of logging in the javascript console.\n // 3 - Debug, information and errors\n // 2 - Information and errors\n // 1 - Errors\n // 0 - None\n // Defaults to 2\n options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error);\n\n if (!options.loggers) {\n options.loggers = [{\n debug: function(msg) {\n if (options.logLevel >= logLevel_debug) {\n console.log(msg);\n }\n },\n info: function(msg) {\n if (options.logLevel >= logLevel_info) {\n console.log(msg);\n }\n },\n warn: function(msg) {\n if (options.logLevel >= logLevel_warn) {\n console.warn(msg);\n }\n },\n error: function(msg) {\n if (options.logLevel >= logLevel_error) {\n console.error(msg);\n }\n }\n }];\n }\n for (let i = 0; i < options.loggers.length; i++) {\n less.logger.addListener(options.loggers[i]);\n }\n};\n","// Cache system is a bit outdated and could do with work\n\nexport default (window, options, logger) => {\n let cache = null;\n if (options.env !== 'development') {\n try {\n cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage;\n } catch (_) {}\n }\n return {\n setCSS: function(path, lastModified, modifyVars, styles) {\n if (cache) {\n logger.info(`saving ${path} to cache.`);\n try {\n cache.setItem(path, styles);\n cache.setItem(`${path}:timestamp`, lastModified);\n if (modifyVars) {\n cache.setItem(`${path}:vars`, JSON.stringify(modifyVars));\n }\n } catch (e) {\n // TODO - could do with adding more robust error handling\n logger.error(`failed to save \"${path}\" to local storage for caching.`);\n }\n }\n },\n getCSS: function(path, webInfo, modifyVars) {\n const css = cache && cache.getItem(path);\n const timestamp = cache && cache.getItem(`${path}:timestamp`);\n let vars = cache && cache.getItem(`${path}:vars`);\n\n modifyVars = modifyVars || {};\n vars = vars || '{}'; // if not set, treat as the JSON representation of an empty object\n\n if (timestamp && webInfo.lastModified &&\n (new Date(webInfo.lastModified).valueOf() ===\n new Date(timestamp).valueOf()) &&\n JSON.stringify(modifyVars) === vars) {\n // Use local copy\n return css;\n }\n }\n };\n};\n","\nimport functionRegistry from './../less/functions/function-registry';\n\nexport default () => {\n function imageSize() {\n throw {\n type: 'Runtime',\n message: 'Image size functions are not supported in browser version of less'\n };\n }\n\n const imageFunctions = {\n 'image-size': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-width': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-height': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n }\n };\n\n functionRegistry.addMultiple(imageFunctions);\n};\n"],"names":["extractId","href","replace","addDataAttr","options","tag","opt","dataset","Object","prototype","hasOwnProperty","call","JSON","parse","_","document","styles","sheet","id","title","utils.extractId","oldStyleNode","getElementById","keepOldStyleNode","styleNode","createElement","setAttribute","media","styleSheet","appendChild","createTextNode","childNodes","length","firstChild","nodeValue","head","getElementsByTagName","nextEl","nextSibling","parentNode","insertBefore","removeChild","cssText","e","Error","window","scripts","currentScript","error","msg","this","_fireEvent","warn","info","debug","addListener","listener","_listeners","push","removeListener","i_1","splice","type","i_2","logFunction","externalEnvironment","fileManagers","requiredFunctions","functions","concat","propName","environmentFunc","bind","Environment","filename","currentDirectory","environment","isSync","logger","undefined","pluginManager","getFileManagers","fileManager","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","darkgrey","darkgreen","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","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","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","m","cm","mm","in","px","pt","pc","duration","s","ms","angle","rad","Math","PI","deg","grad","turn","colors","unitConversions","parent","visibilityBlocks","nodeVisible","rootNode","parsed","Node","fileInfo","getIndex","nodes","set","node","Array","isArray","forEach","_index","_fileInfo","context","strs","genCSS","add","chunk","index","isEmpty","join","output","value","visitor","visit","op","a","b","precision","numPrecision","Number","toFixed","compare","Color","rgb","originalForm","self","match","map","c","i","parseInt","alpha","split","clamp","v","max","min","toHex","round","toString","assign","luma","r","g","pow","toCSS","doNotCompress","color","colorFunction","compress","args","fround","indexOf","toHSL","h","l","toRGB","splitcolor","operate","other","_operate","d","toHSV","toARGB","x","fromKeyword","keyword","key","toLowerCase","slice","Paren","eval","_noSpaceCombinators"," ","|","Combinator","emptyOrWhitespace","trim","spaceOrEmpty","Element","combinator","isVariable","currentFileInfo","visibilityInfo","copyVisibilityInfo","setParent","accept","clone","firstSelector","charAt","ALWAYS","PARENS_DIVISION","PARENS","RewriteUrls","getType","payload","copy","target","constructor","getPrototypeOf","il","arguments","k","j","jl","__spreadArrays","getOwnPropertyNames","getOwnPropertySymbols","reduce","carry","props","includes","newVal","originalObject","includeNonenumerable","propType","propertyIsEnumerable","defineProperty","enumerable","writable","configurable","assignProp","nonenumerable","getLocation","inputStream","n","line","column","copyArray","arr","obj","cloned","prop","defaults","obj1","obj2","newObj","_defaults","defaults_1","copyOptions","opts","strictMath","math","Constants.Math","relativeUrls","rewriteUrls","Constants.RewriteUrls","flattenArray","result","length_1","isNullOrUndefined","val","anonymousFunc","LessError","fileContentMap","currentFilename","message","stack","input","contents","loc","utils.getLocation","col","callLine","lines","found","func","Function","lineAdjust","callExtract","extract","create","F","stylize","str","errorTxt","substr","_visitArgs","visitDeeper","_hasIndexed","_noop","implementation","_implementation","_visitInCache","_visitOutCache","indexNodeTypes","ticker","child","typeIndex","tree","Visitor","nodeTypeIndex","fnName","impl","funcOut","visitArgs","newNode","isReplacing","cnt","nonReplacing","out","evald","flatten","item","nestedCnt","nestedItem","contexts","copyFromOriginal","original","destination","propertiesToCopy","parseCopyProperties","Parse","paths","evalCopyProperties","isPathRelative","path","test","isPathLocalRelative","Eval","frames","importantScope","enterCalc","calcStack","inCalc","exitCalc","pop","inParenthesis","parensStack","outOfParenthesis","mathOn","isMathOn","pathRequiresRewrite","rewritePath","rootpath","newPath","normalizePath","segment","segments","reverse","onSequencerEmpty","imports","variableImports","_onSequencerEmpty","_currentDepth","ImportSequencer","callback","importSequencer","importItem","isReady","tryRun","apply","variableImport","ImportVisitor","importer","finish","_visitor","_importer","_finish","importCount","onceFileDetectionMap","recursionDetector","_sequencer","run","root","isFinished","visitImport","importNode","inlineCSS","inline","css","utils.copyArray","importParent","isVariableImport","addVariableImport","processImportNode","evaldImportNode","evalForImport","multiple","importMultiple","tryAppendLessExtension","rules","onImported","sequencedOnImported","addImport","getPath","importedAtRoot","fullPath","importVisitor","isPlugin","isOptional","optional","duplicateImport","skip","importedFilename","oldContext","visitDeclaration","declNode","unshift","visitDeclarationOut","shift","visitAtRule","atRuleNode","visitAtRuleOut","visitMixinDefinition","mixinDefinitionNode","visitMixinDefinitionOut","visitRuleset","rulesetNode","visitRulesetOut","visitMedia","mediaNode","visitMediaOut","visible","SetTreeVisibilityVisitor","visitArray","blocksVisibility","ensureVisibility","ensureInvisibility","allExtendsStack","ExtendFinderVisitor","allExtends","extend","extendList","allSelectorsExtendList","ruleCnt","Extend","extendOnEveryPath","selectorPath","selExtendList","allSelectorsExtend","foundExtends","findSelfSelectors","ruleset","firstExtendOnThisSelectorPath","selectors","ProcessExtendsVisitor","extendFinder","extendIndices","doExtendChaining","newRoot","checkExtendsForNonMatched","indices","filter","hasFoundMatches","parent_ids","selector","extendsList","extendsListTarget","iterationCount","extendIndex","targetExtendIndex","matches","newSelector","targetExtend","newExtend","extendsToAdd","extendVisitor","object_id","selfSelectors","findMatch","selfSelector","extendSelector","isVisible","option","extendChainCount","selectorOne","selectorTwo","ruleNode","selectorNode","pathIndex","selectorsToAdd","extendedSelectors","haystackSelectorPath","haystackSelectorIndex","hackstackSelector","hackstackElementIndex","haystackElement","targetCombinator","potentialMatch","needleElements","elements","potentialMatches","allowBefore","matched","initialCombinator","isElementValuesEqual","finished","allowAfter","endPathIndex","endPathElementIndex","elementValue1","elementValue2","Attribute","Selector","replacementSelector","matchIndex","firstElement","newElements","currentSelectorPathIndex","currentSelectorPathElementIndex","currentValue","derived","createDerived","newAllExtends","lastIndex","JoinSelectorVisitor","getIsOutput","joinSelectors","multiMedia","isRooted","_context","CSSVisitorUtils","bodyRules","rule","isSilent","owner","thing","compiledRulesBody","keepOnlyVisibleChilds","removeVisibilityBlock","firstRoot","hasVisibleSelector","ToCSSVisitor","utils","variable","mixinNode","visitExtend","extendNode","visitComment","commentNode","originalRules","resolveVisibility","visitAtRuleWithBody","visitAtRuleWithoutBody","visitAnonymous","anonymousNode","nodeRules","hasFakeRuleset","getBodyRules","_mergeRules","name","charset","debugInfo","comment","Comment","checkValidNodes","isRoot","Declaration","Call","allowRoot","rulesets","_compileRulesetPaths","nodeRuleCnt","_removeDuplicateRules","isVisibleRuleset","p","ruleList","ruleCache","ruleCSS","groups","groupsArr","i_3","merge","group","result_1","space_1","comma_1","Expression","important","Value","MarkVisibleSelectorsVisitor","ExtendVisitor","furthest","furthestPossibleErrorMessage","chunks","current","currentPos","saveStack","parserInput","skipWhitespace","nextChar","oldi","oldj","curr","endIndex","mem","inp","charCodeAt","autoCommentAbsorb","isLineComment","nextNewLine","text","commentStore","nextStarSlash","save","restore","possibleErrorMessage","state","forget","isWhitespace","offset","pos","code","$re","tok","exec","$char","$peekChar","$str","tokLength","$quoted","startChar","currentPosition","$parseUntil","testChar","quote","returnVal","inComment","blockDepth","blockStack","parseGroups","startPos","lastPos","loop","char","expected","peek","peekChar","currentChar","prevChar","getInput","peekNotNumeric","start","chunkInput","failFunction","fail","lastOpening","lastOpeningParen","lastMultiComment","lastMultiCommentEndBrace","chunkerCurrentIndex","currentChunkStartIndex","cc","cc2","len","level","parenLevel","emitFrom","emitChunk","force","String","fromCharCode","chunker","end","furthestReachedEnd","furthestChar","makeRegistry","base","_data","addMultiple","keys","_this","get","getLocalFunctions","inherit","MediaSyntaxOptions","queryInParens","ContainerSyntaxOptions","Parser","currentIndex","parsers","getParserInput","expect","arg","expectChar","getDebugInfo","lineNumber","fileName","parseNode","parseList","returnNodes","parser","additionalData","globalVars","modifyVars","ignored","err","preText","disablePluginRule","plugin","serializeVars","preProcessors","getPreProcessors","process","banner","contentsIgnoredChars","Ruleset","primary","functionRegistry","endInfo","processImports","visitors","mixin","extendRule","definition","declaration","variableCall","entities","atrule","foundSemiColon","mixinLookup","quoted","forceEscaped","isEscaped","customFuncCall","stop","f","ieAlpha","boolean","condition","if","prevArgs","isSemiColonSeparated","argsComma","argsSemiColon","detachedRuleset","assignment","expression","literal","dimension","unicodeDescriptor","entity","url","property","Variable","Property","ch","variableCurly","curly","propertyCurly","colorKeyword","ud","javascript","js","escape","Boolean","parsedName","lookups","inValue","ruleLookups","VariableCall","NamespaceValue","isRule","element","getLookup","hasParens","elem","elemIndex","re","isCall","expressionContainsNamed","nameLoop","expand","returner","variadic","expressions","hasSep","throwAwayComments","cond","params","argInfo","conditions","block","lookupValue","Quoted","attribute","slashedCombinator","isLess","when","cif","content","blockRuleset","Definition","DetachedRuleset","dumpLineNumbers","strictImports","hasDR","ruleProperty","permissiveValue","anonymousValue","untilTokens","done","testCurrentChar","Anonymous","variableRegex","propRegex","import","features","dir","importOptions","mediaFeatures","o","optionName","importOption","mediaFeature","syntaxOptions","rangeP","atomicCondition","rvalue","lvalue","prepareAndGetNestableAtRule","treeType","atRule","nestableAtRule","Media","Container","pluginArgs","nonVendorSpecificName","hasIdentifier","hasExpression","hasUnknown","hasBlock","sub","addition","parens","multiplication","operation","isSpaced","operand","parensInOp","needsParens","logical","next","conditionAnd","negatedCondition","parenthesisCondition","negate","body","me","tryConditionFollowedByParenthesis","preparsedCond","delim","simpleProperty","vars","name_1","evaldCondition","getElements","mixinElements_","utils.isNullOrUndefined","mediaEmpty","els","importManager","createEmptySelectors","el","sels","olen","mixinElements","isJustParentSelector","Keyword","True","False","mapLines","rulesetLike","isRulesetLike","MATH","asComment","ctx","asMediaQuery","filenameWithProtocol","lineSeparator","lastRule","prevMath","evaldValue","mathBypass","evalName","importantResult","makeImportant","isCompressed","defaultFunc","value_","error_","reset","_lookups","_variables","_properties","isRuleset","selCnt","hasVariable","hasOnePassingSelector","toParseSelectors","startingIndex","selectorFileInfo","utils.flattenArray","subRule","originalRuleset","allowImports","globalFunctionRegistry","ctxFrames","ctxSelectors","evalImports","rsRules","evalFirst","mediaBlockCount","mediaBlocks","resetCache","bubbleSelectors","importRules","matchArgs","matchCondition","lastSelector","_rulesets","variables","hash","properties","name_2","decl","parseValue","lastDeclaration","toParse","transformDeclaration","nodes_1","filtRules","prependRule","find","foundMixins","ruleNodes","tabLevel","sep","tabRuleStr","tabSetStr","charsetNodeIndex","importNodeIndex","isCharset","pathCnt","pathSubCnt","currentLastRule","joinSelector","createParenthesis","elementsToPak","originalElement","replacementParen","insideParent","createSelector","containedElement","addReplacementIntoPath","beginningPath","addPath","replacedElement","originalSelector","newSelectorPath","newJoinedSelector","parentEl","restOfPath","addAllReplacementsIntoPath","addPaths","mergeElementsOnToSelectors","sel","deriveSelector","deriveFrom","newPaths","replaceParentSelector","inSelector","currentElements","newSelectors","selectorsMultiplied","maybeSelector","hadParentSelector","nestedSelector","replaced","nestedPaths","replacedNewSelectors","concatenated","AtRule","outputRuleset","mediaPathBackup","mediaBlocksBackup","mediaPath","callEval","Unit","numerator","denominator","backupUnit","sort","strictUnits","returnStr","is","unitString","toUpperCase","isLength","RegExp","isSingular","usedUnits","mapUnit","groupName","atomicUnit","cancel","counter","count","Dimension","unit","parseFloat","isNaN","toColor","strValue","convertTo","unify","numericCompare","conversions","targetUnit","applyUnit","derivedConversions","Operation","operands","__assign","t","noSpacing","returnValue","doubleParen","functionCaller","evalArgs","commentFilter","subNodes","to","from","pack","ar","calc","currentMathContext","funcCaller","FunctionCaller","isValid","columnNumber","evaluating","frame","fun","mergeRules","less","vArr","escaped","containsVariables","that","iterativeReplace","regexp","replacementFnc","evaluatedValue","URL","isEvald","urlArgs","NestableAtRulePrototype","evalTop","evalNested","permute","fragment","rest","Import","pathValue","reference","evalPath","doEval","addVisibilityBlock","registry","newImport","JsEvalNode","evaluateJavaScript","evalContext","javascriptEnabled","jsify","toJS","JavaScript","string","Assignment","Condition","QueryInParens","op2","mvalue","UnicodeDescriptor","Negative","next_id","selectorElements","selfElements","ruleCall","substring","arity","optionalParameters","required","evalParams","mixinEnv","evaldArguments","varargs","isNamedFound","argIndex","argsLength","evalCall","_arguments","mixinFrames","allArgsCnt","requiredArgsCnt","MixinCall","mixins","mixinPath","argValue","isRecursive","isOneFound","candidate","defaultResult","noArgumentsFilter","candidates","conditionResult","calcDefGroup","namespace","MixinDefinition","format","newRules","_setVisibilityToReplacement","replacement","AbstractFileManager","lastIndexOf","ext","tryAppendExtension","basePath","laterPath","baseUrl","urlDirectories","baseUrlDirectories","urlParts","extractUrlParts","baseUrlParts","diff","hostPart","directories","urlPartsRegex","rawDirectories","rawPath","fileUrl","require","AbstractPluginLoader","pluginOptions","pluginObj","localModule","shortname","FileManager","trySetOptions","use","exports","loader","validatePlugin","minVersion","compareVersion","addPlugin","setOptions","version","versionToString","aVersion","bVersion","versionString","plugins","printUsage","If","trueValue","falseValue","isdefined","colorFunctions","hsla","origColor","hsl","number","rgba","size","m1","m2","hue","hsv","hsva","vs","floor","perm","saturation","lightness","hsvhue","hsvsaturation","hsvvalue","luminance","saturate","amount","method","desaturate","lighten","darken","fadein","fadeout","fade","spin","mix","color1","color2","weight","w","w1","w2","greyscale","contrast","dark","light","threshold","argb","tint","shade","colorBlend","mode","cb","cs","cr","ab","as","colorBlendModeFunctions","multiply","screen","overlay","softlight","sqrt","hardlight","difference","abs","exclusion","average","negation","getItemsFromNode","_SELF","~","_i","expr","values","range","step","stepValue","list","each","rs","iterator","tryEval","Quote","valueName","keyName","indexName","MathHelper","fn","mathFunctions","ceil","sin","cos","atan","asin","acos","mathHelper","fraction","num","minMax","isMin","currentUnified","referenceUnified","unitStatic","unitClone","order","convert","pi","mod","y","percentage","evaluated","encodeURI","pattern","flags","%","token","encodeURIComponent","isa","Type","isunit","isruleset","iscolor","isnumber","isstring","iskeyword","isurl","ispixel","ispercentage","isem","get-unit","colorBlending","fallback","functionThis","data-uri","mimetypeNode","filePathNode","mimetype","filePath","entryPath","fragmentStart","utils.clone","rawBuffer","getFileManager","useBase64","mimeLookup","charsetLookup","fileSync","loadFileSync","buf","encodeBase64","uri","dataUri","svg-gradient","direction","stops","gradientDirectionSvg","position","positionValue","gradientType","rectangleDimension","renderEnv","directionValue","throwArgumentDescriptor","types","evaldRoot","evalEnv","visitorIterator","preEvalVisitors","first","isPreEvalVisitor","isPreVisitor","pm","postProcessors","installedPlugins","pluginCache","Loader","PluginLoader","PluginManager","install","preProcessor","priority","indexToInsertAt","postProcessor","manager","PluginManagerFactory","newFactory","major","minor","patch","pre","build","sourceMapOutput","sourceMapBuilder","parseTree","SourceMapBuilder","ParseTree","transformTree","toCSSOptions","sourceMap","getPostProcessors","file_1","getExternalSourceMap","files","rootFilename","SourceMapOutput","contentsIgnoredCharsMap","contentsMap","sourceMapFilename","sourceMapURL","outputFilename","sourceMapOutputFilename","sourceMapBasepath","sourceMapRootpath","outputSourceFiles","sourceMapGenerator","sourceMapFileInline","disableSourcemapAnnotation","sourceMapInputFilename","normalizeFilename","removeBasepath","getCSSAppendage","_css","_rootNode","_contentsMap","_contentsIgnoredCharsMap","_sourceMapFilename","_outputFilename","_sourceMapBasepath","_sourceMapRootpath","_outputSourceFiles","_sourceMapGeneratorConstructor","getSourceMapGenerator","_lineNumber","_column","sourceLines","columns","sourceColumns","inputSource","_sourceMapGenerator","addMapping","generated","source","file","sourceRoot","setSourceContent","sourceMapContent","stringify","toJSON","rootFileInfo","mime","queue","ImportManager","pluginLoader","fileParsedFunc","importedEqualsRoot","newFileInfo","loadedFile","promise","loadFileCallback","resolvedFilename","pathDiff","isPathAbsolute","alwaysMakePathsAbsolute","newEnv","evalPlugin","syncImport","loadPluginSync","loadPlugin","loadFile","then","render","utils.copyOptions","self_1","Promise","resolve","reject","Render","context_1","pluginManager_1","reUsePluginManager","imports_1","evalResult","fileContent","parseVersion","initial","data","ctor","api","fileCache","doXHR","errback","xhr","XMLHttpRequest","async","isFileProtocol","fileAsync","handleResponse","status","responseText","getResponseHeader","overrideMimeType","open","setRequestHeader","send","onreadystatechange","readyState","supports","clearFileCache","location","useFileCache","lessText_1","webInfo","lastModified","Date","log","fulfill","catch","rootHref","errorReporting","errors","errorline","classname","logLevel","errorConsole","timer","filenameNoPath","className","innerHTML","browser","style","env","setInterval","replaceChild","clearInterval","errorHTML","remove","removeErrorHTML","depends","lint","insecure","protocol","poll","hostname","port","onReady","addDefaultOptions","LESS_PLUGINS","lessRoot","FM","addFileManager","loggers","console","LogListener","ErrorReporting","cache","localStorage","setCSS","setItem","getCSS","getItem","timestamp","valueOf","Cache","imageSize","imageFunctions","image-size","image-width","image-height","ImageSize","typePattern","thisArg","curryArgs","loadStyles","instanceOptions","loadStyleSheet","reload","remaining","local","loadInitialFileCallback","loadStyleSheets","sheets","watch","watchMode","watchTimer","unwatch","registerStylesheetsImmediately","links","rel","registerStylesheets","record","refresh","startTime","endTime","totalMilliseconds","remainingSheets","refreshStyles","resolveOrReject","pageLoadFinished"],"mappings":";;;;;;;;;8OACgBA,EAAUC,GACtB,OAAOA,EAAKC,QAAQ,qBAAsB,IACrCA,QAAQ,qBAAsB,IAC9BA,QAAQ,MAAO,IACfA,QAAQ,eAAgB,IACxBA,QAAQ,YAAa,KACrBA,QAAQ,MAAO,cAGRC,EAAYC,EAASC,GACjC,GAAKA,EACL,IAAK,IAAMC,KAAOD,EAAIE,QAClB,GAAIC,OAAOC,UAAUC,eAAeC,KAAKN,EAAIE,QAASD,GAClD,GAAY,QAARA,GAAyB,oBAARA,GAAqC,aAARA,GAA8B,mBAARA,EACpEF,EAAQE,GAAOD,EAAIE,QAAQD,QAE3B,IACIF,EAAQE,GAAOM,KAAKC,MAAMR,EAAIE,QAAQD,IAE1C,MAAOQ,WCjBR,SAAUC,EAAUC,EAAQC,GAEnC,IAAMhB,EAAOgB,EAAMhB,MAAQ,GAGrBiB,EAAK,SAAQD,EAAME,OAASC,EAAgBnB,IAG5CoB,EAAeN,EAASO,eAAeJ,GACzCK,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B,EAAW90B,OAInBgW,EAAKqgB,cAAgBvB,EACd9e,EHrQEjqB,CAAKne,OAAQzC,IAU1B,SAASmrD,GAAgB/G,GACjBA,EAAK9/C,UACLgkD,QAAQtlD,KAAKohD,GAEZpkD,GAAQ4kD,OACT7iD,GAAKM,YAAY2kD,WAZzBvkD,OAAOooC,KAAOA,GAgBV7qC,GAAQ+nD,UACJ,SAASlqC,KAAKpb,OAAOkjD,SAAS1iB,OAC9B4H,GAAKuf,QAGJpqD,GAAQ4kD,QACT1jC,GAAM,oCACNnf,GAAOpB,SAASoB,MAAQpB,SAASqB,qBAAqB,QAAQ,IAC9DglD,GAAQrmD,SAASU,cAAc,UAEzBqC,KAAO,WACTsjD,GAAMxlD,WACNwlD,GAAMxlD,WAAWc,QAAU4e,GAE3B8lC,GAAMvlD,YAAYd,SAASe,eAAewf,KAG9Cnf,GAAKN,YAAYulD,KAErBnc,GAAK2f,iCACL3f,GAAKugB,iBAAmBvgB,GAAKggB,QAAqB,gBAAbhgB,GAAKoc,KAAuB7D,KAAK+H,GAAiBA"}
\ No newline at end of file
diff --git a/packages/less/src/less/parser/parser.js b/packages/less/src/less/parser/parser.js
index 88112396f..28c900873 100644
--- a/packages/less/src/less/parser/parser.js
+++ b/packages/less/src/less/parser/parser.js
@@ -1625,6 +1625,10 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) {
if (e) {
value.push(e);
}
+ if (parserInput.peek(',')) {
+ value.push(new (tree.Anonymous)(',', parserInput.i));
+ parserInput.$char(',');
+ }
} while (e);
done = testCurrentChar();
diff --git a/packages/less/src/less/tree/expression.js b/packages/less/src/less/tree/expression.js
index 957505b87..1b9f33a7b 100644
--- a/packages/less/src/less/tree/expression.js
+++ b/packages/less/src/less/tree/expression.js
@@ -2,6 +2,7 @@ import Node from './node';
import Paren from './paren';
import Comment from './comment';
import Dimension from './dimension';
+import Anonymous from './anonymous';
const Expression = function(value, noSpacing) {
this.value = value;
@@ -56,7 +57,12 @@ Expression.prototype = Object.assign(new Node(), {
for (let i = 0; i < this.value.length; i++) {
this.value[i].genCSS(context, output);
if (!this.noSpacing && i + 1 < this.value.length) {
- output.add(' ');
+ if (!this.noSpacing && i + 1 < this.value.length) {
+ if (i + 1 < this.value.length && !(this.value[i + 1] instanceof Anonymous) ||
+ this.value[i + 1] instanceof Anonymous && this.value[i + 1].value !== ',') {
+ output.add(' ');
+ }
+ }
}
}
},