UNPKG

js2coffee

Version:

JavaScript to CoffeeScript compiler

2 lines 235 kB
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.js2coffee=e()}}(function(){var e,t,n;return function r(e,t,n){function i(a,s){if(!t[a]){if(!e[a]){var u=typeof require=="function"&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=t[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,r,e,t,n)}return t[a].exports}var o=typeof require=="function"&&require;for(var a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,n){var r,i,o,a,s;o=e("./lib/transforms/base");i=e("./lib/builder/base");r=e("./lib/builder");a=e("./lib/helpers").buildError;t.exports=s=function(e,t){return s.build(e,t).code};s.build=function(e,t){var n,r,i,o,a,u;if(t==null){t={}}if(t.filename==null){t.filename="input.js"}if(t.indent==null){t.indent=2}t.source=e;n=s.parseJS(e,t);a=s.transform(n,t),n=a.ast,o=a.warnings;u=s.generate(n,t),r=u.code,i=u.map;return{code:r,ast:n,map:i,warnings:o}};s.parseJS=function(t,n){var r,i;if(n==null){n={}}try{r=e("esprima-fb");return r.parse(t,{loc:true,range:true,comment:true})}catch(o){i=o;throw a(i,t,n.filename)}};s.transform=function(t,n){var r,i,a;if(n==null){n={}}i={};a=function(e){return o.run(t,n,e,i)};r=!(n.comments===false);if(r){a([e("./lib/transforms/comments")])}a([e("./lib/transforms/functions")]);a([e("./lib/transforms/exponents"),e("./lib/transforms/ifs"),e("./lib/transforms/iife"),e("./lib/transforms/literals"),e("./lib/transforms/loops"),e("./lib/transforms/members"),e("./lib/transforms/objects"),e("./lib/transforms/binary"),e("./lib/transforms/empty_statements"),e("./lib/transforms/others"),e("./lib/transforms/precedence"),e("./lib/transforms/returns"),e("./lib/transforms/switches"),e("./lib/transforms/unsupported")]);a([e("./lib/transforms/blocks")]);return{ast:t,warnings:i.warnings}};s.generate=function(e,t){if(t==null){t={}}return new r(e,t).get()};s.version=e("./package.json").version},{"./lib/builder":3,"./lib/builder/base":2,"./lib/helpers":5,"./lib/transforms/base":6,"./lib/transforms/binary":7,"./lib/transforms/blocks":8,"./lib/transforms/comments":9,"./lib/transforms/empty_statements":10,"./lib/transforms/exponents":11,"./lib/transforms/functions":12,"./lib/transforms/ifs":13,"./lib/transforms/iife":14,"./lib/transforms/literals":15,"./lib/transforms/loops":16,"./lib/transforms/members":17,"./lib/transforms/objects":18,"./lib/transforms/others":19,"./lib/transforms/precedence":20,"./lib/transforms/returns":21,"./lib/transforms/switches":22,"./lib/transforms/unsupported":23,"./package.json":58,"esprima-fb":46}],2:[function(e,t,n){var r,i,o=function(e,t){return function(){return e.apply(t,arguments)}};i=e("./strip_spaces");r=function(){function t(e,t){this.root=e;this.options=t!=null?t:{};this.walk=o(this.walk,this);this.path=[]}t.prototype.run=function(){return this.walk(this.root)};t.prototype.walk=function(e,t){var n,r,i;r=this.path.length;this.path.push(e);if(typeof t!=="string"){t=void 0}t||(t=e.type);this.ctx={path:this.path,type:t,parent:this.path[this.path.length-2]};n=this[t];if(n){i=n.call(this,e,this.ctx);if(this.decorator!=null){i=this.decorator(e,i)}}else{i=this.onUnknownNode(e,this.ctx)}this.path.splice(r);return i};t.prototype.get=function(){var e;e=this.run();e=i(e);return e.toStringWithSourceMap()};t.prototype.decorator=function(t,n){var r,i,o,a,s;r=e("source-map").SourceNode;return new r(t!=null?(i=t.loc)!=null?(o=i.start)!=null?o.line:void 0:void 0:void 0,t!=null?(a=t.loc)!=null?(s=a.start)!=null?s.column:void 0:void 0:void 0,this.options.filename,n)};return t}();t.exports=r},{"./strip_spaces":4,"source-map":48}],3:[function(e,t,n){var r,i,o,a,s,u,l,c,f,p,h,d,m={}.hasOwnProperty,y=function(e,t){for(var n in t){if(m.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};d=e("../helpers"),c=d.prependAll,f=d.quote,l=d.newline,p=d.space,s=d.delimit,a=d.commaDelimit,h=d.toIndent,u=d.joinLines;o=e("../transforms/base");i=e("./base");t.exports=r=function(e){y(t,e);function t(e,n){if(n==null){n={}}t.__super__.constructor.apply(this,arguments);this._indent=0}t.prototype.Program=function(e){this.comments=e.comments;return this.BlockStatement(e)};t.prototype.ExpressionStatement=function(e){return l(this.walk(e.expression))};t.prototype.AssignmentExpression=function(e){var t;t=this.paren(p([this.walk(e.left),e.operator,this.walk(e.right)]));if(e.right.type==="FunctionExpression"){t=["\n",this.indent(),t,"\n"]}return t};t.prototype.Identifier=function(e){return[e.name]};t.prototype.UnaryExpression=function(e){var t,n;t=function(){return e.argument.type==="UnaryExpression"};n=function(){return/^[a-z]+$/i.test(e.operator)};if(t()||n()){return this.paren([e.operator," ",this.walk(e.argument)])}else{return this.paren([e.operator,this.walk(e.argument)])}};t.prototype.BinaryExpression=function(e){return this.paren(p([this.walk(e.left),e.operator,this.walk(e.right)]))};t.prototype.Literal=function(e){if(typeof e.value==="string"){return[f(e.value)]}else{return[e.raw]}};t.prototype.MemberExpression=function(e){var t;t=e.computed?["[",this.walk(e.property),"]"]:e._prefixed?[this.walk(e.property)]:[".",this.walk(e.property)];return this.paren([this.walk(e.object),t])};t.prototype.LogicalExpression=function(e){var t,n;n={"||":"or","&&":"and"};t=n[e.operator];return this.paren([this.walk(e.left)," ",t," ",this.walk(e.right)])};t.prototype.ThisExpression=function(e){if(e._prefix){return["@"]}else{return["this"]}};t.prototype.CallExpression=function(e,t){var n,r,i;n=this.walk(e.callee);i=this.makeSequence(e["arguments"]);e._isStatement=t.parent.type==="ExpressionStatement";r=i.length>0;if(e._isStatement&&r){return p([n,i])}else{return[n,this.paren(i,true)]}};t.prototype.IfStatement=function(e){var t,n;t=e.alternate;if((t!=null?t.type:void 0)==="IfStatement"){n=this.indent(["else ",this.walk(e.alternate,"IfStatement")])}else if((t!=null?t.type:void 0)==="BlockStatement"){n=this.indent(function(t){return function(n){return[n,"else","\n",t.walk(e.alternate)]}}(this))}else if(t!=null){n=this.indent(function(t){return function(n){return[n,"else","\n",t.indent(t.walk(e.alternate))]}}(this))}else{n=[]}return this.indent(function(t){return function(r){var i,o,a;o=t.walk(e.test);i=t.walk(e.consequent);if(e.consequent.type!=="BlockStatement"){i=t.indent(i)}a=e._negative?"unless":"if";return[a," ",o,"\n",i,n]}}(this))};t.prototype.BlockStatement=function(e){return this.makeStatements(e,e.body)};t.prototype.makeStatements=function(e,t){return c(t.map(this.walk),this.indent())};t.prototype.LineComment=function(e){return["#",e.value,"\n"]};t.prototype.BlockComment=function(e){var t,n;t=("###"+e.value+"###").split("\n");n=[s(t,["\n",this.indent()]),"\n"];return["\n",this.indent(),n,"\n"]};t.prototype.ReturnStatement=function(e){if(e.argument){return p(["return",[this.walk(e.argument),"\n"]])}else{return["return","\n"]}};t.prototype.ArrayExpression=function(e){var t,n;n=e.elements.length;t=n===1;if(n===0){return["[]"]}else if(t){return p(["[",e.elements.map(this.walk),"]"])}else{return this.indent(function(t){return function(n){var r,i;i=e.elements.map(function(e){return l(t.walk(e))});r=c(i,t.indent());return["[","\n",r,n,"]"]}}(this))}};t.prototype.ObjectExpression=function(e,t){var n,r;r=e.properties.length;n=e._braced;if(r===0){return["{}"]}else if(r===1){r=e.properties.map(this.walk);if(n){return this.paren(p(["{",r,"}"]))}else{return this.paren([r])}}else if(e._last){r=e.properties.map(this.walk);return s(r,["\n",this.indent()])}else{r=this.indent(function(t){return function(){r=e.properties.map(t.walk);return["\n",u(r,t.indent())]}}(this));if(n){return this.paren(["{",r,"\n",this.indent(),"}"])}else{return this.paren([r])}}};t.prototype.Property=function(e){if(e.kind!=="init"){throw new Error("Property: not sure about kind "+e.kind)}return p([[this.walk(e.key),":"],this.walk(e.value)])};t.prototype.VariableDeclaration=function(e){var t;t=e.declarations.map(this.walk);return s(t,this.indent())};t.prototype.VariableDeclarator=function(e){var t;t=[this.walk(e.id)," = ",l(this.walk(e.init))];if(e.init.type==="FunctionExpression"){t=["\n",this.indent(),t,"\n"]}return t};t.prototype.FunctionExpression=function(e,t){var n,r;r=this.makeParams(e.params,e.defaults);n=this.indent(function(t){return function(n){return[r,"->","\n",t.walk(e.body)]}}(this));if(e._parenthesized){return["(",n,this.indent(),")"]}else{return n}};t.prototype.EmptyStatement=function(e){return[]};t.prototype.SequenceExpression=function(e){var t;t=e.expressions.map(function(e){return function(t){return[e.walk(t),"\n"]}}(this));return s(t,this.indent())};t.prototype.NewExpression=function(e){var t,n,r,i;n=((r=e.callee)!=null?r.type:void 0)==="Identifier"?[this.walk(e.callee)]:["(",this.walk(e.callee),")"];t=((i=e["arguments"])!=null?i.length:void 0)?["(",this.makeSequence(e["arguments"]),")"]:[];return this.paren(["new ",n,t])};t.prototype.WhileStatement=function(e){return["while ",this.walk(e.test),"\n",this.makeLoopBody(e.body)]};t.prototype.CoffeeLoopStatement=function(e){return["loop","\n",this.makeLoopBody(e.body)]};t.prototype.BreakStatement=function(e){return["break","\n"]};t.prototype.ContinueStatement=function(e){return["continue","\n"]};t.prototype.DebuggerStatement=function(e){return["debugger","\n"]};t.prototype.TryStatement=function(e){var t,n,r;r=this.indent(function(t){return function(){return["try","\n",t.walk(e.block)]}}(this));t=c(e.handlers.map(this.walk),this.indent());n=e.finalizer!=null?this.indent(function(t){return function(n){return[n,"finally","\n",t.walk(e.finalizer)]}}(this)):[];return[r,t,n]};t.prototype.CatchClause=function(e){return this.indent(function(t){return function(){return["catch ",t.walk(e.param),"\n",t.walk(e.body)]}}(this))};t.prototype.ThrowStatement=function(e){return["throw ",this.walk(e.argument),"\n"]};t.prototype.ConditionalExpression=function(e){return this.paren(p(["if",this.walk(e.test),"then",this.walk(e.consequent),"else",this.walk(e.alternate)]))};t.prototype.UpdateExpression=function(e){if(e.prefix){return[e.operator,this.walk(e.argument)]}else{return[this.walk(e.argument),e.operator]}};t.prototype.SwitchStatement=function(e){var t,n;t=this.indent(function(t){return function(){return t.makeStatements(e,e.cases)}}(this));n=this.walk(e.discriminant);if(e.discriminant.type==="ConditionalExpression"){n=["(",n,")"]}return["switch ",n,"\n",t]};t.prototype.CoffeeListExpression=function(e){return this.makeSequence(e.expressions)};t.prototype.SwitchCase=function(e){var t,n;t=e.test?["when ",this.walk(e.test)]:["else"];n=this.indent(function(t){return function(){return t.makeStatements(e,e.consequent)}}(this));return[t,"\n",n]};t.prototype.ForInStatement=function(e){var t,n,r;if(e.left.type!=="VariableDeclaration"){n=this.walk(e.left);r={type:"ExpressionStatement",expression:{type:"CoffeeEscapedExpression",raw:""+n+" = "+n}};e.body.body=[r].concat(e.body.body)}else{n=this.walk(e.left.declarations[0].id)}t=this.makeLoopBody(e.body);return["for ",n," of ",this.walk(e.right),"\n",t]};t.prototype.makeLoopBody=function(e){var t;t=(e!=null?e.type:void 0)==="BlockStatement";if(!e||t&&e.body.length===0){return this.indent(function(e){return function(){return[e.indent(),"continue","\n"]}}(this))}else if(t){return this.indent(function(t){return function(){return t.walk(e)}}(this))}else{return this.indent(function(t){return function(){return[t.indent(),t.walk(e)]}}(this))}};t.prototype.CoffeeEscapedExpression=function(e){if(e._parenthesized){return["(`",e.raw,"`)"]}else{return["`",e.raw,"`"]}};t.prototype.CoffeePrototypeExpression=function(e){if(e.computed){return[this.walk(e.object),"::[",this.walk(e.property),"]"]}else{return[this.walk(e.object),"::",this.walk(e.property)]}};t.prototype.CoffeeDoExpression=function(e){return p(["do",this.walk(e["function"])])};t.prototype.makeSequence=function(e){var t,n,r,i,o;for(n=i=0,o=e.length;i<o;n=++i){t=e[n];r=n===e.length-1;if(!r){if(t.type==="FunctionExpression"){t._parenthesized=true}else if(t.type==="ObjectExpression"){t._braced=true}}}return a(e.map(this.walk))};t.prototype.makeParams=function(e,t){var n,r,i,o,a,u;i=[];for(r=a=0,u=e.length;a<u;r=++a){o=e[r];if(t[r]){n=this.walk(t[r]);i.push([this.walk(o)," = ",n])}else{i.push(this.walk(o))}}if(e.length){return["(",s(i,", "),") "]}else{return[]}};t.prototype.parenthesizeArguments=function(e){var t,n,r,i,o,a,s;a=e["arguments"];s=[];for(n=i=0,o=a.length;i<o;n=++i){t=a[n];r=n===e["arguments"].length-1;if(t.type==="FunctionExpression"){if(!r){s.push(t._parenthesized=true)}else{s.push(void 0)}}else{s.push(void 0)}}return s};t.prototype.indent=function(e){var t,n,r;if(typeof e==="function"){t=this.indent();this._indent+=1;n=e(t);this._indent-=1;return n}else if(e){return[this.indent(),e]}else{r=h(this.options.indent);return Array(this._indent+1).join(r)}};t.prototype.paren=function(e,t){var n,r;if(t==null){t=(r=this.path[this.path.length-1])!=null?r._parenthesized:void 0}n=e.toString().match(/\n$/);if(t){if(n){return["(",e,this.indent(),")"]}else{return["(",e,")"]}}else{return e}};t.prototype.onUnknownNode=function(e,t){return this.syntaxError(e,""+e.type+" is not supported")};t.prototype.syntaxError=o.prototype.syntaxError;return t}(i)},{"../helpers":5,"../transforms/base":6,"./base":2}],4:[function(e,t,n){var r,i,o,a,s,u,l;r=/^\s*\n+\s*$/;l=function(e){e=u(e);e=s(e);e=a(e);e=o(e);return e};o=function(e){var t,n;n=0;t=null;return i(e,{},function(e){if(n===0||n===1&&e.match(r)){n=1;return e}else if(n===1&&e.match(/^[ \t]+$/)){t=e;n=2;return""}else if(n===2){n=1;if(e.match(r)){return e}else{return t+e}}else{n=0;return e}})};u=function(e){return i(e,{},function(e){if(e.match(r)){return""}else{this["break"]();return e}})};s=function(e){return i(e,{reverse:true},function(e){if(e.match(r)){return""}else{this["break"]();return""+e+"\n"}})};a=function(e){var t;t=0;return i(e,{},function(e){if(e==="\n"){t+=1}else if(e.match(/^\s*$/)){}else{t=0}if(t>=3){return""}else{return e}})};i=function(e,t,n){var r,i,o;if(t==null){t={}}r=false;i={"break":function(e){return r=true}};o=function(e,t,n){var a,s,u,l,c,f,p,h,d,m,y,g;if(t==null){t={}}l=t.reverse?function(){y=[];for(var t=d=e.children.length-1;d<=0?t<=0:t>=0;d<=0?t++:t--){y.push(t)}return y}.apply(this):function(){g=[];for(var t=0,n=e.children.length;0<=n?t<n:t>n;0<=n?t++:t--){g.push(t)}return g}.apply(this);for(p=0,h=l.length;p<h;p++){s=l[p];if(r){return e}a=e.children[s];if(!a){}else if(a.children){o(a,t,n)}else if(a!==""){u=n.call(i,a);e.children[s]=u}}return e};return o.call(i,e,t,n)};t.exports=l},{}],5:[function(e,t,n){n.delimit=function(e,t){var n,r,i,o,a;i=[];for(n=o=0,a=e.length;o<a;n=++o){r=e[n];if(n>0){i.push(t)}i.push(r)}return i};n.commaDelimit=function(e){var t,n,r,i,o;r=[];for(t=i=0,o=e.length;i<o;t=++i){n=e[t];if(t>0){if(/^\n/.test(n.toString())){r.push(",")}else{r.push(", ")}}r.push(n)}return r};n.prependAll=function(e,t){var n,r,i,o,a;i=[];for(n=o=0,a=e.length;o<a;n=++o){r=e[n];i.push(t);i.push(r)}return i};n.buildError=function(e,t,n){var r,i,o,a,s,u,l,c,f,p,h,d,m,y,g,v,S;if(n==null){n=""}if(e.js2coffee){return e}i=e.description;u=(m=(y=e.start)!=null?y.line:void 0)!=null?m:e.lineNumber;r=(g=(v=(S=e.start)!=null?S.column:void 0)!=null?v:e.column&&e.column-1)!=null?g:0;a=""+n+":"+u+":"+r+": "+i;l=t.split("\n");p=Math.max(u-3,0);c=u-1;o=c.toString().length;s=1;if(e.end){s=Math.max(e.end.column-e.start.column,1)}h=function(e){return Array(1+o-e.toString().length).join(" ")+e};t=l.slice(p,+c+1||9e9).map(function(e,t){return""+h(1+t+p)+" "+e});t.push(Array(o+3).join(" ")+Array(r+1).join(" ")+Array(s+1).join("^"));t=t.join("\n");f=a+"\n\n"+t;d=e;e=new Error(f);e.filename=n;e.description=d.description;e.start={line:u,column:r};e.end=d.end;e.sourcePreview=t;e.js2coffee=true;return e};n.space=function(e){return e.reduce(function(e,t,n){if(n===0){return e.concat([t])}else if(t.toString().substr(0,1)==="\n"){return e.concat([t])}else{return e.concat([" ",t])}},[])};n.newline=function(e){if(/\n$/.test(e.toString())){return e}else{return[e,"\n"]}};n.inspect=function(t){return"~~~~\n"+e("util").inspect(t,{depth:1e3,colors:true})+"\n~~~~"};n.replace=function(e,t){t.range=e.range;t.loc=e.loc;return t};n.clone=function(e){return JSON.parse(JSON.stringify(e))};n.quote=function(e){var t;if(typeof e==="string"){t=e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/\n/g,"\\n").replace(/[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g,function(e){return"\\u"+e.charCodeAt(0).toString(16)});return"'"+t+"'"}else{return JSON.stringify(e)}};n.getPrecedence=function(e){var t,n,r,i;i=e.type;n=function(t){return t.indexOf(e.operator)>-1};t={"**":17,"*":14,"/":14,"%":14,"+":13,"-":13,"<<":12,">>":12,">>>":12,"<":11,">":11,"<=":11,">=":11,"in":11,"instanceof":11,"==":10,"===":10,"!=":10,"!==":10,"&":9,"^":8,"|":7};r={"&&":6,"||":5};switch(i){case"Literal":case"Identifier":return 99;case"MemberExpression":case"CallExpression":return 18;case"NewExpression":if(e["arguments"].length===0){return 17}else{return 18}break;case"UpdateExpression":if(e.prefix){return 15}else{return 16}break;case"UnaryExpression":return 15;case"BinaryExpression":return t[e.operator];case"LogicalExpression":return r[e.operator];case"ConditionalExpression":return 4;case"AssignmentExpression":return 3;case"SequenceExpression":return 0;default:return-1}};n.lastStatement=function(e){var t,r,i,o;for(t=i=o=e.length-1;o<=0?i<=0:i>=0;t=o<=0?++i:--i){r=e[t];if(!r){continue}if(!n.isComment(r)){return r}}};n.getReturnStatements=function(e){var t,r,i,o,a;i=n.getReturnStatements,o=n.lastStatement;if(!e){return}else if(e.length){a=o(e)}else{a=e}if(!a){return[]}else if(a.type==="ReturnStatement"){return[a]}else if(a.type==="BlockStatement"){return i(a.body)}else if(a.type==="IfStatement"&&a.consequent&&a.alternate){r=i(a.consequent);t=i(a.alternate);if(r.length>0&&t.length>0){return r.concat(t)}else{return[]}}else{return[]}};n.joinLines=function(e,t){var n,r,i,o,a,s;o=[];for(n=a=0,s=e.length;a<s;n=++a){i=e[n];o.push(t);o.push(i);r=n!==e.length-1;if(!i.toString().match(/\n$/)&&r){o.push("\n")}}return o};n.reserved={keywords:["then","unless","until","loop","of","by","when"],reserved:["case","default","function","var","void","with","const","let","enum","export","import","native","__hasProp","__extends","__slice","__bind","__indexOf","implements","interface","package","private","protected","public","static","yield"],aliases:["and","or","is","isnt","not","yes","no","on","off"]};n.reservedWords=n.reserved.keywords.concat(n.reserved.reserved.concat(n.reserved.aliases));n.nextUntil=function(e,t,n){var r,i,o,a,s,u;i=e.indexOf(t);for(r=a=s=i+1,u=e.length;s<=u?a<=u:a>=u;r=s<=u?++a:--a){o=e[r];if((o!=null?o.type:void 0)&&n(o)){return o}}};n.nextNonComment=function(e,t){return n.nextUntil(e,t,function(e){return e.type!=="BlockComment"&&e.type!=="LineComment"})};n.isLoop=function(e){return e.test==null||n.isTruthy(e.test)};n.isTruthy=function(e){return e.type==="Literal"&&e.value};n.escapeJs=function(t){return n.replace(t,{type:"CoffeeEscapedExpression",raw:e("escodegen").generate(t)})};n.nonComments=function(e){return e.filter(function(e){return!n.isComment(e)})};n.isComment=function(e){return e.type==="LineComment"||e.type==="BlockComment"};n.toIndent=function(e){if(e==="tab"||e==="t"){return" "}else if(typeof e==="string"&&""+ +e!==e){return e}else{return Array(+e+1).join(" ")}}},{escodegen:29,util:28}],6:[function(e,t,n){var r,i,o,a,s,u,l,c,f={}.hasOwnProperty,p=function(e,t){for(var n in t){if(f.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e},h=[].slice;c=e("../helpers"),i=c.buildError,a=c.clone,s=c.replace,l=c.toIndent;t.exports=r=function(){t.run=function(e,n,r,i){var o,a,s;o=function(e){p(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}return t}(t);u(o,r);s=new o(e,n);a=s.run();if(i.warnings==null){i.warnings=[]}i.warnings=i.warnings.concat(s.warnings);return a};function t(e,t){this.ast=e;this.options=t;this.scopes=[];this.ctx={vars:[]};this.warnings=[]}t.prototype.run=function(){return this.recurse(this.ast)};t.prototype.recurse=function(e){var t,n;n=this;this.depth=0;t=function(e){return function(t,n,r){var i,o,a,s;e.node=n;e.depth+=t==="Enter"?+1:-1;i=t==="Enter"?""+n.type:""+n.type+"Exit";if(typeof e[a="onBefore"+t]==="function"){e[a](n,r)}o=typeof e[i]==="function"?e[i](n,r):void 0;if(typeof e[s="on"+t]==="function"){e[s](n,r)}return o}}(this);this.estraverse().replace(e,{enter:function(e,r){n.controller=this;return t("Enter",e,r)},leave:function(e,n){return t("Exit",e,n)}});return e};t.prototype.skip=function(){var e;return(e=this.controller)!=null?e.skip():void 0};t.prototype.remove=function(){var e;return(e=this.controller)!=null?e.remove():void 0};t.prototype.estraverse=function(){return this._estraverse!=null?this._estraverse:this._estraverse=function(){var t;t=e("estraverse");t.VisitorKeys.CoffeeEscapedExpression=[];t.VisitorKeys.CoffeeListExpression=["test","body"];t.VisitorKeys.CoffeePrototypeExpression=["object","property","computed"];t.VisitorKeys.CoffeeLoopStatement=["body"];t.VisitorKeys.CoffeeDoExpression=["function"];t.VisitorKeys.BlockComment=[];t.VisitorKeys.LineComment=[];return t}()};t.prototype.pushStack=function(e){var t,n,r;r=[this.scope,this.ctx],n=r[0],t=r[1];this.scopes.push([e,this.ctx]);this.ctx=a(this.ctx);this.scope=e;return typeof this.onScopeEnter==="function"?this.onScopeEnter(this.scope,this.ctx,n,t):void 0};t.prototype.popStack=function(){var e,t,n,r;n=[this.scope,this.ctx],t=n[0],e=n[1];r=this.scopes.pop(),this.scope=r[0],this.ctx=r[1];return typeof this.onScopeExit==="function"?this.onScopeExit(this.scope,this.ctx,t,e):void 0};t.prototype.syntaxError=function(e,t){var n,r,o;n=i({start:(r=e.loc)!=null?r.start:void 0,end:(o=e.loc)!=null?o.end:void 0,description:t},this.options.source,this.options.filename);throw n};t.prototype.warn=function(e,t){var n,r;return this.warnings.push({start:(n=e.loc)!=null?n.start:void 0,end:(r=e.loc)!=null?r.end:void 0,filename:this.options.filename,description:t})};t.prototype.Program=function(e){this.pushStack(e);return e};t.prototype.ProgramExit=function(e){this.popStack();return e};t.prototype.FunctionExpression=function(e){this.pushStack(e.body);return e};t.prototype.FunctionExpressionExit=function(e){this.popStack();return e};t.prototype.escapeJs=function(t,n){if(n==null){n={}}return s(t,{type:"CoffeeEscapedExpression",_parenthesized:n.parenthesized,raw:e("escodegen").generate(t,{format:{indent:{style:l(this.options.indent)}}})})};return t}();u=function(e,t){var n;n={};t.forEach(function(t){var r,i,a,s;a=t.prototype;s=[];for(i in a){r=a[i];if(t.prototype.hasOwnProperty(i)){if(n[i]&&i!=="constructor"){e.prototype[i]=o(e.prototype[i],r)}else{e.prototype[i]=r}s.push(n[i]=true)}else{s.push(void 0)}}return s});return e};o=function(e,t){return function(){var n,r,i,o;r=arguments[0],n=2<=arguments.length?h.call(arguments,1):[];o=r.type;i=e.bind(this).apply(null,[r].concat(h.call(n)));if(i.type===o){i=t.bind(this).apply(null,[i].concat(h.call(n)))}return i}}},{"../helpers":5,escodegen:29,estraverse:47}],7:[function(e,t,n){var r,i={}.hasOwnProperty,o=function(e,t){for(var n in t){if(i.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};r=e("./base");t.exports=function(e){o(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.BinaryExpression=function(e){this.warnAboutEquals(e);this.updateEquals(e);return this.escapeEqualsForCompatibility(e)};t.prototype.updateEquals=function(e){var t,n;t={"===":"==","!==":"!="};n=e.operator;if(t[n]){e.operator=t[n]}return e};t.prototype.escapeEqualsForCompatibility=function(e){var t;t=e.operator==="=="||e.operator==="!=";if(this.options.compat&&t){return this.escapeJs(e)}else{return e}};t.prototype.warnAboutEquals=function(e){var t,n,r;t=e.operator;r={"==":"===","!=":"!=="};if(t==="=="||t==="!="){n=r[t];this.warn(e,"Operator '"+t+"' is not supported in CoffeeScript, "+("use '"+n+"' instead"))}return e};return t}(r)},{"./base":6}],8:[function(e,t,n){var r,i,o={}.hasOwnProperty,a=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e},s=[].slice;i=e("./base");t.exports=r=function(e){a(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.BlockStatement=function(e,t){return this.consolidateBlockIntoParent(e,t)};t.prototype.consolidateBlockIntoParent=function(e,t){var n,r;r=false;n=function(n){return function(n,i){var o,a,u;if(t.type===n&&((a=t[i])!=null?a.indexOf:void 0)){o=t[i].indexOf(e);if(t[i]&&~o){(u=t[i]).splice.apply(u,[o,1].concat(s.call(e.body)));r=true;return true}}}}(this);n("BlockStatement","body")||n("SwitchCase","consequent")||n("IfStatement","consequent")||n("IfStatement","alternate");if(r){return this.skip()}else{return e}};return t}(i)},{"./base":6}],9:[function(e,t,n){var r,i={}.hasOwnProperty,o=function(e,t){for(var n in t){if(i.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};r=e("./base");t.exports=function(e){o(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.ProgramExit=null;t.prototype.FunctionExpression=null;t.prototype.FunctionExpressionExit=null;t.prototype.Program=function(e){this.comments=e.comments;this.updateCommentTypes();e.body=this.addCommentsToList([0,Infinity],e.body);return e};t.prototype.BlockStatement=function(e){return this.injectComments(e,"body")};t.prototype.SwitchStatement=function(e){return this.injectComments(e,"cases")};t.prototype.SwitchCase=function(e){return this.injectComments(e,"consequent")};t.prototype.BlockComment=function(e){return this.convertCommentPrefixes(e)};t.prototype.updateCommentTypes=function(){var e,t,n,r,i;r=this.comments;i=[];for(t=0,n=r.length;t<n;t++){e=r[t];switch(e.type){case"Block":i.push(e.type="BlockComment");break;case"Line":i.push(e.type="LineComment");break;default:i.push(void 0)}}return i};t.prototype.injectComments=function(e,t){if(t==null){t="body"}e[t]=this.addCommentsToList(e.range,e[t]);return e};t.prototype.addCommentsToList=function(e,t){var n,r,i,o,a,s,u,l,c;if(e==null){return t}a=[];o=e[0];u=e[1];n=function(e){return function(t,n){return e.comments.filter(function(e){return e.range[0]>=t&&e.range[1]<=n})}}(this);if(t.length>0){for(r=l=0,c=t.length;l<c;r=++l){i=t[r];if(i.range){s=n(o,i.range[0]);a=a.concat(s)}a.push(i);if(i.range){o=i.range[1]}}}s=n(o,u);a=a.concat(s);return a};t.prototype.convertCommentPrefixes=function(e){var t,n;n=e.value.split("\n");t=e.loc.start.column;n=n.map(function(e,r){var i,o,a;o=r===n.length-1&&e.match(/^\s*$/);i=r===0&&n.length===1;a=e.substr(0,t);if(a.match(/^\s+$/)){e=e.substr(t)}if(o){return""}else if(i){return e}else{e=e.replace(/^ \*/,"#");return e+"\n"}});e.value=n.join("");return e};return t}(r)},{"./base":6}],10:[function(e,t,n){var r,i={}.hasOwnProperty,o=function(e,t){for(var n in t){if(i.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};r=e("./base");t.exports=function(e){o(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.BlockStatementExit=function(e){return this.removeEmptyStatementsFromBody(e)};t.prototype.SwitchCaseExit=function(e){return this.removeEmptyStatementsFromBody(e,"consequent")};t.prototype.SwitchStatementExit=function(e){return this.removeEmptyStatementsFromBody(e,"cases")};t.prototype.ProgramExit=function(e){return this.removeEmptyStatementsFromBody(e,"body")};t.prototype.removeEmptyStatementsFromBody=function(e,t){if(t==null){t="body"}e[t]=e[t].filter(function(e){return e.type!=="EmptyStatement"});return e};return t}(r)},{"./base":6}],11:[function(e,t,n){var r,i,o={}.hasOwnProperty,a=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};i=e("../helpers").replace;r=e("./base");t.exports=function(e){a(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.CallExpression=function(e){var t,n,r,o,a,s,u,l,c,f,p;t=((n=e.callee)!=null?n.type:void 0)==="MemberExpression"&&((r=e.callee)!=null?(o=r.object)!=null?o.type:void 0:void 0)==="Identifier"&&((a=e.callee)!=null?(s=a.object)!=null?s.name:void 0:void 0)==="Math"&&((u=e.callee)!=null?(l=u.property)!=null?l.type:void 0:void 0)==="Identifier"&&((c=e.callee)!=null?(f=c.property)!=null?f.name:void 0:void 0)==="pow"&&((p=e["arguments"])!=null?p.length:void 0)===2;if(!t){return e}return i(e,{type:"BinaryExpression",left:e["arguments"][0],operator:"**",right:e["arguments"][1]})};return t}(r)},{"../helpers":5,"./base":6}],12:[function(e,t,n){var r,i,o,a,s,u,l={}.hasOwnProperty,c=function(e,t){for(var n in t){if(l.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e},f=[].slice;u=e("../helpers"),o=u.isComment,a=u.nextNonComment,s=u.replace;r=e("./base");t.exports=function(e){c(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.onScopeEnter=function(e,t){return t.prebody=[]};t.prototype.onScopeExit=function(e,t,n,r){if(r.prebody.length){return this.prependIntoBody(e.body,r.prebody)}};t.prototype.prependIntoBody=function(e,t){var n;n=i(e);return e.splice.apply(e,[n,0].concat(f.call(t)))};t.prototype.FunctionDeclaration=function(e){this.ctx.prebody.push(this.buildFunctionDeclaration(e));this.pushStack(e.body)};t.prototype.FunctionDeclarationExit=function(e){this.popStack(e);return this.remove()};t.prototype.LineComment=function(e,t){return this.moveFunctionComments(e,t)};t.prototype.BlockComment=function(e,t){return this.moveFunctionComments(e,t)};t.prototype.FunctionExpression=function(e){this.pushStack(e.body)};t.prototype.FunctionExpressionExit=function(e){this.popStack();if(e.id){if(this.options.compat){return this.escapeJs(e,{parenthesized:true})}else{this.warn(e,"Named function expressions are not supported in CoffeeScript");return e}}else{return e}};t.prototype.moveFunctionComments=function(e,t){var n,r;if(!t.body){return}r=a(t.body,e);if(!r){return}n=r.type==="FunctionExpression"&&r.id;n||(n=r.type==="FunctionDeclaration");if(n){this.ctx.prebody.push(e);return this.remove()}};t.prototype.buildFunctionDeclaration=function(e){return s(e,{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:e.id,init:{type:"FunctionExpression",params:e.params,defaults:e.defaults,body:e.body}}]})};return t}(r);i=function(e){var t,n,r,i;t=0;for(t=r=0,i=e.length;r<i;t=++r){n=e[t];if(n.type!=="VariableDeclaration"&&!o(n)){return t}}return t}},{"../helpers":5,"./base":6}],13:[function(e,t,n){var r,i,o,a,s={}.hasOwnProperty,u=function(e,t){for(var n in t){if(s.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};a=e("../helpers").nonComments;r=e("./base");t.exports=function(e){u(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.IfStatement=function(e){this.handleBlankIfs(e);this.parenthesizeConditionals(e.test);return e};t.prototype.ConditionalExpression=function(e,t){return this.parenthesizeFunctions(e,t)};t.prototype.parenthesizeFunctions=function(e,t){this.estraverse().traverse(e,{enter:function(e,t){var n;n=e.type==="FunctionDeclaration"||e.type==="FunctionExpression";if(n){return e._parenthesized=true}}});return e};t.prototype.parenthesizeConditionals=function(e){var t;t=["ConditionalExpression","FunctionExpression"]; return this.estraverse().traverse(e,{enter:function(e,n){if(~t.indexOf(e.type)){return e._parenthesized=true}}})};t.prototype.handleBlankIfs=function(e){if(o(e)||i(e)&&!e.alternate){e.alternate={type:"BlockStatement",body:[]}}return e};return t}(r);o=function(e){return!e.consequent};i=function(e){var t,n;t=e.consequent;return n=t&&t.type==="BlockStatement"&&a(t.body).length===0}},{"../helpers":5,"./base":6}],14:[function(e,t,n){var r,i,o,a,s,u={}.hasOwnProperty,l=function(e,t){for(var n in t){if(u.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};a=e("../helpers").replace;r=e("./base");t.exports=function(e){l(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.CallExpression=function(e){var t;t=o(e)&&i(e["arguments"])&&s(e.callee.params,e["arguments"]);if(!t){return e}return a(e,{type:"CoffeeDoExpression","function":e.callee,arguments:e["arguments"]})};return t}(r);i=function(e){var t,n,r;for(n=0,r=e.length;n<r;n++){t=e[n];if(t.type!=="Identifier"){return false}}return true};o=function(e){var t,n;return((t=e.callee)!=null?t.type:void 0)==="FunctionExpression"&&((n=e.callee)!=null?n.id:void 0)===null};s=function(e,t){return e.map(function(e){return e.name}).join("/")===t.map(function(e){return e.name}).join("/")}},{"../helpers":5,"./base":6}],15:[function(e,t,n){var r,i,o,a,s={}.hasOwnProperty,u=function(e,t){for(var n in t){if(s.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};a=e("../helpers"),o=a.replace,i=a.quote;r=e("./base");t.exports=function(e){u(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.Literal=function(e){return this.unpackRegexpIfNeeded(e)};t.prototype.unpackRegexpIfNeeded=function(e){var t;if(!(e.value instanceof RegExp)){return}t=e.value.toString().match(/^\/([\s\=].*)\/([a-z]*)$/);if(t){e=o(e,{type:"CallExpression",callee:{type:"Identifier",name:"RegExp"},arguments:[{type:"Literal",value:t[1],raw:i(t[1])}]});if(t[2]){e["arguments"].push({type:"Literal",value:t[2],raw:i(t[2])})}return e}};return t}(r)},{"../helpers":5,"./base":6}],16:[function(e,t,n){var r,i,o,a,s={}.hasOwnProperty,u=function(e,t){for(var n in t){if(s.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};a=e("../helpers"),o=a.replace,i=a.isLoop;r=e("./base");t.exports=function(e){u(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.ForStatement=function(e){if(this._for==null){this._for=[]}this._for.push(e);this.injectUpdateIntoBody(e);return this.convertForToWhile(e)};t.prototype.ForStatementExit=function(e){var t;t=this._for.pop();delete t._update;return e};t.prototype.ForInStatement=function(e){return this.warnIfNoVar(e)};t.prototype.WhileStatement=function(e){return this.convertWhileToLoop(e)};t.prototype.DoWhileStatement=function(e){return this.convertDoWhileToLoop(e)};t.prototype.ContinueStatement=function(e,t){return this.injectUpdateIntoContinue(e,t)};t.prototype.injectUpdateIntoContinue=function(e,t){var n,r;n=(r=this._for)!=null?r[this._for.length-1]:void 0;if(!(n!=null?n._update:void 0)){return e}this.skip();return{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:n._update},e]}};t.prototype.convertDoWhileToLoop=function(e){var t,n;t=e.body;n=t.body;n.push(o(e.test,{type:"IfStatement",_negative:true,test:e.test,consequent:{type:"BreakStatement"}}));return o(e,{type:"CoffeeLoopStatement",body:t})};t.prototype.warnIfNoVar=function(e){if(e.left.type!=="VariableDeclaration"){this.warn(e,"Using 'for..in' loops without "+"'var' can produce unexpected results")}return e};t.prototype.convertForToWhile=function(e){e.type=i(e)?"CoffeeLoopStatement":"WhileStatement";if(e.init!=null){return{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:e.init},e]}}else{return e}};t.prototype.convertWhileToLoop=function(e){if(i(e)){return o(e,{type:"CoffeeLoopStatement",body:e.body})}else{return e}};t.prototype.injectUpdateIntoBody=function(e){var t,n;if(e.update){n={type:"ExpressionStatement",expression:e.update};if(e.body==null){if(e.body==null){e.body={type:"BlockStatement",body:[]}}}else if(e.body.type!=="BlockStatement"){t=e.body;e.body={type:"BlockStatement",body:[t]}}e.body.body=e.body.body.concat([n]);e._update=e.update;delete e.update}return e};return t}(r)},{"../helpers":5,"./base":6}],17:[function(e,t,n){var r,i,o={}.hasOwnProperty,a=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};i=e("../helpers").replace;r=e("./base");t.exports=function(e){a(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.MemberExpression=function(e){this.transformThisToAtSign(e);this.braceObjectOnLeft(e);return this.replaceWithPrototype(e)||this.parenthesizeObjectIfFunction(e)};t.prototype.CoffeePrototypeExpression=function(e){return this.transformThisToAtSign(e)};t.prototype.transformThisToAtSign=function(e){if(e.object.type==="ThisExpression"){e._prefixed=true;e.object._prefix=true}return e};t.prototype.braceObjectOnLeft=function(e){if(e.object.type==="ObjectExpression"){e.object._braced=true}};t.prototype.replaceWithPrototype=function(e){var t;t=e.computed===false&&e.object.type==="MemberExpression"&&e.object.property.type==="Identifier"&&e.object.property.name==="prototype";if(t){return this.recurse(i(e,{type:"CoffeePrototypeExpression",object:e.object.object,property:e.property}))}};t.prototype.parenthesizeObjectIfFunction=function(e){if(e.object.type==="FunctionExpression"){e.object._parenthesized=true}return e};return t}(r)},{"../helpers":5,"./base":6}],18:[function(e,t,n){var r,i,o={}.hasOwnProperty,a=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};r=e("./base");t.exports=function(e){a(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.ArrayExpression=function(e){this.braceObjectsInElements(e);return this.catchEmptyArraySlots(e)};t.prototype.ObjectExpression=function(e,t){return this.braceObjectInExpression(e,t)};t.prototype.braceObjectInExpression=function(e,t){var n,r,i;if(t.type==="ExpressionStatement"){n=((r=this.scope.body)!=null?r[((i=this.scope.body)!=null?i.length:void 0)-1]:void 0)===t;if(n){e._last=true}else{e._braced=true}}};t.prototype.braceObjectsInElements=function(e){var t,n,r,i;i=e.elements;for(n=0,r=i.length;n<r;n++){t=i[n];if((t!=null?t.type:void 0)==="ObjectExpression"){t._braced=true}}return e};t.prototype.catchEmptyArraySlots=function(e){if(i(e.elements)){if(this.options.compat){return this.escapeJs(e)}else{return this.syntaxError(e,"Empty array slots are not supported in CoffeeScript")}}};return t}(r);i=function(e){var t,n,r;for(n=0,r=e.length;n<r;n++){t=e[n];if(t===null){return true}}return false}},{"./base":6}],19:[function(e,t,n){var r,i,o,a,s,u={}.hasOwnProperty,l=function(e,t){for(var n in t){if(u.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};s=e("../helpers"),a=s.reservedWords,o=s.replace,i=s.quote;r=e("./base");t.exports=function(e){l(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.FunctionExpression=function(e,n){t.__super__.FunctionExpression.call(this,e);e.params.forEach(function(e){return function(t){if(t.type==="Identifier"){e.ctx.vars.push(t.name)}return e.preventReservedWords(t)}}(this));this.preventReservedWords(e.id);return this.removeUndefinedParameter(e)};t.prototype.CallExpression=function(e){return this.parenthesizeCallee(e)};t.prototype.Identifier=function(e){return this.escapeUndefined(e)};t.prototype.UnaryExpression=function(e){this.braceObjectBesideUnary(e);return this.updateVoidToUndefined(e)};t.prototype.VariableDeclarator=function(e){this.preventReservedWords(e.id);this.addShadowingIfNeeded(e);return this.addExplicitUndefinedInitializer(e)};t.prototype.AssignmentExpression=function(e){if(this.isReservedIdentifier(e.left)){if(this.options.compat){return this.escapeJs(e)}else{return this.preventReservedWords(e.left)}}else if(e.left.type==="Identifier"&&this.ctx.vars.indexOf(e.left.name)===-1){if(this.options.compat){return this.escapeJs(e)}else{this.warn(e,"Assignment of global variable '"+e.left.name+"'");return e}}else{return e}};t.prototype.ReturnStatement=function(e){return this.parenthesizeObjectsInArgument(e)};t.prototype.braceObjectBesideUnary=function(e){if(e.argument.type==="ObjectExpression"){e.argument._braced=true}};t.prototype.preventReservedWords=function(e){if(this.isReservedIdentifier(e)){return this.syntaxError(e,"'"+e.name+"' is a reserved CoffeeScript keyword")}};t.prototype.isReservedIdentifier=function(e){var t;t=e!=null?e.name:void 0;return t&&~a.indexOf(t)};t.prototype.parenthesizeObjectsInArgument=function(e){if(e.argument){if(e.argument.type==="ObjectExpression"){e.argument._braced=true}}return e};t.prototype.addShadowingIfNeeded=function(e){var t,n;t=e.id.name;if(~this.ctx.vars.indexOf(t)){this.warn(e,"Variable shadowing ('"+t+"') is not fully supported in CoffeeScript");n=o(e,{type:"ExpressionStatement",expression:{type:"CoffeeEscapedExpression",raw:"var "+t}});return this.scope.body=[n].concat(this.scope.body)}else{return this.ctx.vars.push(t)}};t.prototype.addExplicitUndefinedInitializer=function(e){if(e.init==null){e.init={type:"Identifier",name:"undefined"};this.skip()}return e};t.prototype.updateVoidToUndefined=function(e){if(e.operator==="void"){return o(e,{type:"Identifier",name:"undefined"})}else{return e}};t.prototype.escapeUndefined=function(e){if(e.name==="undefined"&&this.options.compat){return o(e,{type:"CoffeeEscapedExpression",raw:"undefined"})}else{return e}};t.prototype.removeUndefinedParameter=function(e){var t,n,r,i,o,a,s;if(e.params){s=e.params;for(t=o=0,a=s.length;o<a;t=++o){i=s[t];n=t===e.params.length-1;r=i.type==="Identifier"&&i.name==="undefined";if(r){if(n){e.params.pop()}else{this.syntaxError(i,"'undefined' is not allowed in function parameters")}}}}return e};t.prototype.parenthesizeCallee=function(e){if(e.callee.type==="FunctionExpression"){e.callee._parenthesized=true;return e}};return t}(r)},{"../helpers":5,"./base":6}],20:[function(e,t,n){var r,i,o,a,s,u,l={}.hasOwnProperty,c=function(e,t){for(var n in t){if(l.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};i=e("../helpers").getPrecedence;r=e("./base");t.exports=function(e){c(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.onEnter=function(e,t){var n,r,s;if(!t){return}s=t.type;if(s==="CallExpression"&&t["arguments"].indexOf(e)>-1){return}if(s==="NewExpression"&&t["arguments"].indexOf(e)>-1){return}if(s==="MemberExpression"&&t.property===e){return}r=i(e);if(r===-1){return}n=a(t,e)||o(t,e)||u(t,e)||r<i(t);if(n){return e._parenthesized=true}};return t}(r);a=function(e,t){return s(e,"-")&&s(t,"-")&&e.right===t};o=function(e,t){return s(e,"/")&&(s(t,"/")||s(t,"*"))&&e.right===t};s=function(e,t){return e.type==="BinaryExpression"&&e.operator===t};u=function(e,t){return e.type==="ConditionalExpression"&&t.type==="ConditionalExpression"&&e.alternate!==t}},{"../helpers":5,"./base":6}],21:[function(e,t,n){var r,i,o={}.hasOwnProperty,a=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};i=e("../helpers").getReturnStatements;r=e("./base");t.exports=function(e){a(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.onScopeExit=function(e,t,n,r){return this.unreturnify(e)};t.prototype.unreturnify=function(e,t){var n;if(t==null){t="body"}if(e[t].length>0){n=i(e[t]);if(n.length===0){e[t].push({type:"ReturnStatement"})}else{n.forEach(function(e){if(e.argument){e.type="ExpressionStatement";return e.expression=e.argument}})}}};return t}(r)},{"../helpers":5,"./base":6}],22:[function(e,t,n){var r,i={}.hasOwnProperty,o=function(e,t){for(var n in t){if(i.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};r=e("./base.coffee");t.exports=function(e){o(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.SwitchStatement=function(e){this.consolidateCases(e);return this.ensureLastCaseIsDefault(e)};t.prototype.SwitchCase=function(e){return this.removeBreaksFromConsequents(e)};t.prototype.ensureLastCaseIsDefault=function(e){var t,n,r,i,o,a,s,u;t=e.cases.filter(function(e){return e.type==="SwitchCase"});a=t.length;for(n=s=0,u=t.length;s<u;n=++s){o=t[n];i=n===a-1;r=o.test==null;if(r&&!i){this.syntaxError(o,"default cases only allowed at the end")}}return e};t.prototype.consolidateCases=function(e){var t,n,r,i,o,a,s;r=[];i=[];s=e.cases;for(t=o=0,a=s.length;o<a;t=++o){n=s[t];if(n.type==="SwitchCase"){if(n.test){i.push(n.test)}if(n.consequent.length>0){if(n.test){n.test={type:"CoffeeListExpression",expressions:i}}i=[];r.push(n)}}else{r.push(n)}}e.cases=r;return e};t.prototype.removeBreaksFromConsequents=function(e){var t,n;if(e.test){t=e.consequent.length-1;n=e.consequent[t];if((n!=null?n.type:void 0)==="BreakStatement"){delete e.consequent[t];e.consequent.length-=1}else if((n!=null?n.type:void 0)==="ContinueStatement"){}else if((n!=null?n.type:void 0)!=="ReturnStatement"){this.syntaxError(e,"No break or return statement found in a case")}return e}};return t}(r)},{"./base.coffee":6}],23:[function(e,t,n){var r,i={}.hasOwnProperty,o=function(e,t){for(var n in t){if(i.call(t,n))e[n]=t[n]}function r(){this.constructor=e}r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};r=e("./base");t.exports=function(e){o(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.LabeledStatement=function(e,t){return this.syntaxError(e,"Labeled statements are not supported in CoffeeScirpt")};t.prototype.WithStatement=function(e){return this.syntaxError(e,"'with' is not supported in CoffeeScript")};return t}(r)},{"./base":6}],24:[function(e,t,n){if(typeof Object.create==="function"){t.exports=function r(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype;e.prototype=new n;e.prototype.constructor=e}}},{}],25:[function(e,t,n){(function(e){function t(e,t){var n=0;for(var r=e.length-1;r>=0;r--){var i=e[r];if(i==="."){e.splice(r,1)}else if(i===".."){e.splice(r,1);n++}else if(n){e.splice(r,1);n--}}if(t){for(;n--;n){e.unshift("..")}}return e}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var i=function(e){return r.exec(e).slice(1)};n.resolve=function(){var n="",r=false;for(var i=arguments.length-1;i>=-1&&!r;i--){var a=i>=0?arguments[i]:e.cwd();if(typeof a!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!a){continue}n=a+"/"+n;r=a.charAt(0)==="/"}n=t(o(n.split("/"),function(e){return!!e}),!r).join("/");return(r?"/":"")+n||"."};n.normalize=function(e){var r=n.isAbsolute(e),i=a(e,-1)==="/";e=t(o(e.split("/"),function(e){return!!e}),!r).join("/");if(!e&&!r){e="."}if(e&&i){e+="/"}return(r?"/":"")+e};n.isAbsolute=function(e){return e.charAt(0)==="/"};n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(o(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};n.relative=function(e,t){e=n.resolve(e).substr(1);t=n.resolve(t).substr(1);function r(e){var t=0;for(;t<e.length;t++){if(e[t]!=="")break}var n=e.length-1;for(;n>=0;n--){if(e[n]!=="")break}if(t>n)return[];return e.slice(t,n-t+1)}var i=r(e.split("/"));var o=r(t.split("/"));var a=Math.min(i.length,o.length);var s=a;for(var u=0;u<a;u++){if(i[u]!==o[u]){s=u;break}}var l=[];for(var u=s;u<i.length;u++){l.push("..")}l=l.concat(o.slice(s));return l.join("/")};n.sep="/";n.delimiter=":";n.dirname=function(e){var t=i(e),n=t[0],r=t[1];if(!n&&!r){return"."}if(r){r=r.substr(0,r.length-1)}return n+r};n.basename=function(e,t){var n=i(e)[2];if(t&&n.substr(-1*t.length)===t){n=n.substr(0,n.length-t.length)}return n};n.extname=function(e){return i(e)[3]};function o(e,t){if(e.filter)return e.filter(t);var n=[];for(var r=0;r<e.length;r++){if(t(e[r],r,e))n.push(e[r])}return n}var a="ab".substr(-1)==="b"?function(e,t,n){return e.substr(t,n)}:function(e,t,n){if(t<0)t=e.length+t;return e.substr(t,n)}}).call(this,e("_process"))},{_process:26}],26:[function(e,t,n){var r=t.exports={};r.nextTick=function(){var e=typeof window!=="undefined"&&window.setImmediate;var t=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(e){return function(e){return window.setImmediate(e)}}if(t){var n=[];window.addEventListener("message",function(e){var t=e.source;if((t===window||t===null)&&e.data==="process-tick"){e.stopPropagation();if(n.length>0){var r=n.shift();r()}}},true);return function r(e){n.push(e);window.postMessage("process-tick","*")}}return function i(e){setTimeout(e,0)}}();r.title="browser";r.browser=true;r.env={};r.argv=[];function i(){}r.on=i;r.addListener=i;r.once=i;r.off=i;r.removeListener=i;r.removeAllListeners=i;r.emit=i;r.binding=function(e){throw new Error("process.binding is not supported")};r.cwd=function(){return"/"};r.chdir=function(e){throw new Error("process.chdir is not supported")}},{}],27:[function(e,t,n){t.exports=function r(e){return e&&typeof e==="object"&&typeof e.copy==="function"&&typeof e.fill==="function"&&typeof e.readUInt8==="function"}},{}],28:[function(e,t,n){(function(t,r){var i=/%[sdj%]/g;n.format=function(e){if(!E(e)){var t=[];for(var n=0;n<