UNPKG

chocolate

Version:

A full stack Node.js web framework built using Coffeescript

2 lines 243 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,u;return function n(e,t,u){function r(o,s){if(!t[o]){if(!e[o]){var a=typeof require=="function"&&require;if(!s&&a)return a(o,!0);if(i)return i(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var f=t[o]={exports:{}};e[o][0].call(f.exports,function(t){var u=e[o][1][t];return r(u?u:t)},f,f.exports,n,e,t,u)}return t[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<u.length;o++)r(u[o]);return r}({1:[function(e,t,u){var n,r,i,o,s;i=e("./lib/transforms/base");r=e("./lib/builder/base");n=e("./lib/builder");o=e("./lib/helpers").buildError;t.exports=s=function(e,t){return s.build(e,t).code};s.build=function(e,t){var u,n,r,i,o,a;if(t==null){t={}}if(t.filename==null){t.filename="input.js"}if(t.indent==null){t.indent=2}t.source=e;u=s.parseJS(e,t);i=s.transform(u,t),u=i.ast,a=i.warnings;o=s.generate(u,t),n=o.code,r=o.map;return{code:n,ast:u,map:r,warnings:a}};s.parseJS=function(t,u){var n,r,i;if(u==null){u={}}try{n=e("esprima");return n.parse(t,{loc:true,range:true,comment:true})}catch(i){r=i;throw o(r,t,u.filename)}};s.transform=function(t,u){var n,r,o;if(u==null){u={}}r={};o=function(e){return i.run(t,u,e,r)};n=!(u.comments===false);if(n){o([e("./lib/transforms/comments")])}o([e("./lib/transforms/functions")]);o([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")]);o([e("./lib/transforms/blocks")]);return{ast:t,warnings:r.warnings}};s.generate=function(e,t){if(t==null){t={}}return new n(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":61,esprima:48}],2:[function(e,t,u){var n,r,i=function(e,t){return function(){return e.apply(t,arguments)}};r=e("./strip_spaces");n=function(){function t(e,t){this.root=e;this.options=t!=null?t:{};this.walk=i(this.walk,this);this.path=[]}t.prototype.run=function(){return this.walk(this.root)};t.prototype.walk=function(e,t){var u,n,r;n=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]};u=this[t];if(u){r=u.call(this,e,this.ctx);if(this.decorator!=null){r=this.decorator(e,r)}}else{r=this.onUnknownNode(e,this.ctx)}this.path.splice(n);return r};t.prototype.get=function(){var e;e=this.run();e=r(e);return e.toStringWithSourceMap()};t.prototype.decorator=function(t,u){var n,r,i,o,s;n=e("source-map").SourceNode;return new n(t!=null?(r=t.loc)!=null?(i=r.start)!=null?i.line:void 0:void 0:void 0,t!=null?(o=t.loc)!=null?(s=o.start)!=null?s.column:void 0:void 0:void 0,this.options.filename,u)};return t}();t.exports=n},{"./strip_spaces":4,"source-map":50}],3:[function(e,t,u){var n,r,i,o,s,a,l,f,c,p,D,h,m=function(e,t){for(var u in t){if(d.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},d={}.hasOwnProperty;p=e("../helpers"),f=p.prependAll,c=p.quote,l=p.newline,D=p.space,s=p.delimit,o=p.commaDelimit,h=p.toIndent,a=p.joinLines;i=e("../transforms/base");r=e("./base");t.exports=n=function(e){m(t,e);function t(e,u){if(u==null){u={}}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(D([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,u;t=function(){return e.argument.type==="UnaryExpression"};u=function(){return/^[a-z]+$/i.test(e.operator)};if(t()||u()){return this.paren([e.operator," ",this.walk(e.argument)])}else{return this.paren([e.operator,this.walk(e.argument)])}};t.prototype.BinaryExpression=function(e){var t;t=e.operator;if(t==="in"){t="of"}return this.paren(D([this.walk(e.left),t,this.walk(e.right)]))};t.prototype.Literal=function(e){if(typeof e.value==="string"){return[c(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,u;u={"||":"or","&&":"and"};t=u[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 u,n,r;u=this.walk(e.callee);r=this.makeSequence(e["arguments"]);e._isStatement=t.parent.type==="ExpressionStatement";n=r.length>0;if(e._isStatement&&n){return D([u,r])}else{return[u,this.paren(r,true)]}};t.prototype.IfStatement=function(e){var t,u;t=e.alternate;if((t!=null?t.type:void 0)==="IfStatement"){u=this.indent(["else ",this.walk(e.alternate,"IfStatement")])}else if((t!=null?t.type:void 0)==="BlockStatement"){u=this.indent(function(t){return function(u){return[u,"else","\n",t.walk(e.alternate)]}}(this))}else if(t!=null){u=this.indent(function(t){return function(u){return[u,"else","\n",t.indent(t.walk(e.alternate))]}}(this))}else{u=[]}return this.indent(function(t){return function(n){var r,i,o;i=t.walk(e.test);r=t.walk(e.consequent);if(e.consequent.type!=="BlockStatement"){r=t.indent(r)}o=e._negative?"unless":"if";return[o," ",i,"\n",r,u]}}(this))};t.prototype.BlockStatement=function(e){return this.makeStatements(e,e.body)};t.prototype.makeStatements=function(e,t){var u,n,r,i,o,s;s=t.map(this.walk);o=[];for(u=r=0,i=s.length;r<i;u=++r){n=s[u];if(t[u].type!=="BlockStatement"){o.push(this.indent())}o.push(n)}return o};t.prototype.LineComment=function(e){return["#",e.value,"\n"]};t.prototype.BlockComment=function(e){var t,u;t=("###"+e.value+"###").split("\n");u=[s(t,["\n",this.indent()]),"\n"];return["\n",this.indent(),u,"\n"]};t.prototype.ReturnStatement=function(e){if(e.argument){return D(["return",[this.walk(e.argument),"\n"]])}else{return["return","\n"]}};t.prototype.ArrayExpression=function(e){var t,u;u=e.elements.length;t=u===1;if(u===0){return["[]"]}else if(t){return D(["[",e.elements.map(this.walk),"]"])}else{return this.indent(function(t){return function(u){var n,r;r=e.elements.map(function(e){return l(t.walk(e))});n=f(r,t.indent());return["[","\n",n,u,"]"]}}(this))}};t.prototype.ObjectExpression=function(e,t){var u,n;n=e.properties.length;u=e._braced;if(n===0){return["{}"]}else if(n===1){n=e.properties.map(this.walk);if(u){return this.paren(D(["{",n,"}"]))}else{return this.paren([n])}}else if(e._last){n=e.properties.map(this.walk);return s(n,["\n",this.indent()])}else{n=this.indent(function(t){return function(){n=e.properties.map(t.walk);return["\n",a(n,t.indent())]}}(this));if(u){return this.paren(["{",n,"\n",this.indent(),"}"])}else{return this.paren([n])}}};t.prototype.Property=function(e){if(e.kind!=="init"){throw new Error("Property: not sure about kind "+e.kind)}return D([[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 u,n;n=this.makeParams(e.params,e.defaults);u=this.indent(function(t){return function(u){return[n,"->","\n",t.walk(e.body)]}}(this));if(e._parenthesized){return["(",u,this.indent(),")"]}else{return u}};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,u,n,r;u=((n=e.callee)!=null?n.type:void 0)==="Identifier"?[this.walk(e.callee)]:["(",this.walk(e.callee),")"];t=((r=e["arguments"])!=null?r.length:void 0)?["(",this.makeSequence(e["arguments"]),")"]:[];return this.paren(["new ",u,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,u,n;n=this.indent(function(t){return function(){return["try","\n",t.walk(e.block)]}}(this));t=this.indent(function(t){return function(u){return[u,t.walk(e.handler)]}}(this));u=e.finalizer!=null?this.indent(function(t){return function(u){return[u,"finally","\n",t.walk(e.finalizer)]}}(this)):[];return[n,t,u]};t.prototype.CatchClause=function(e){return["catch ",this.walk(e.param),"\n",this.walk(e.body)]};t.prototype.ThrowStatement=function(e){return["throw ",this.walk(e.argument),"\n"]};t.prototype.ConditionalExpression=function(e){return this.paren(D(["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,u;t=this.indent(function(t){return function(){return t.makeStatements(e,e.cases)}}(this));u=this.walk(e.discriminant);if(e.discriminant.type==="ConditionalExpression"){u=["(",u,")"]}return["switch ",u,"\n",t]};t.prototype.CoffeeListExpression=function(e){return this.makeSequence(e.expressions)};t.prototype.SwitchCase=function(e){var t,u;t=e.test?["when ",this.walk(e.test)]:["else"];u=this.indent(function(t){return function(){return t.makeStatements(e,e.consequent)}}(this));return[t,"\n",u]};t.prototype.ForInStatement=function(e){var t,u,n;if(e.left.type!=="VariableDeclaration"){u=this.walk(e.left);n={type:"ExpressionStatement",expression:{type:"CoffeeEscapedExpression",raw:u+" = "+u}};e.body.body=[n].concat(e.body.body)}else{u=this.walk(e.left.declarations[0].id)}t=this.makeLoopBody(e.body);return["for ",u," 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 D(["do",this.walk(e["function"])])};t.prototype.makeSequence=function(e){var t,u,n,r,i;for(u=r=0,i=e.length;r<i;u=++r){t=e[u];n=u===e.length-1;if(!n){if(t.type==="FunctionExpression"){t._parenthesized=true}else if(t.type==="ObjectExpression"){t._braced=true}}}return o(e.map(this.walk))};t.prototype.makeParams=function(e,t){var u,n,r,i,o,a;o=[];for(n=r=0,i=e.length;r<i;n=++r){a=e[n];if(t[n]){u=this.walk(t[n]);o.push([this.walk(a)," = ",u])}else{o.push(this.walk(a))}}if(e.length){return["(",s(o,", "),") "]}else{return[]}};t.prototype.parenthesizeArguments=function(e){var t,u,n,r,i,o,s;o=e["arguments"];s=[];for(u=r=0,i=o.length;r<i;u=++r){t=o[u];n=u===e["arguments"].length-1;if(t.type==="FunctionExpression"){if(!n){s.push(t._parenthesized=true)}else{s.push(void 0)}}else{s.push(void 0)}}return s};t.prototype.indent=function(e){var t,u,n;if(typeof e==="function"){t=this.indent();this._indent+=1;u=e(t);this._indent-=1;return u}else if(e){return[this.indent(),e]}else{n=h(this.options.indent);return Array(this._indent+1).join(n)}};t.prototype.paren=function(e,t){var u,n;if(t==null){t=(n=this.path[this.path.length-1])!=null?n._parenthesized:void 0}u=e.toString().match(/\n$/);if(t){if(u){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=i.prototype.syntaxError;return t}(r)},{"../helpers":5,"../transforms/base":6,"./base":2}],4:[function(e,t,u){var n,r,i,o,s,a,l;n=/^\s*\n+\s*$/;l=function(e){e=a(e);e=s(e);e=o(e);e=i(e);return e};i=function(e){var t,u;u=0;t=null;return r(e,{},function(e){if(u===0||u===1&&e.match(n)){u=1;return e}else if(u===1&&e.match(/^[ \t]+$/)){t=e;u=2;return""}else if(u===2){u=1;if(e.match(n)){return e}else{return t+e}}else{u=0;return e}})};a=function(e){return r(e,{},function(e){if(e.match(n)){return""}else{this["break"]();return e}})};s=function(e){return r(e,{reverse:true},function(e){if(e.match(n)){return""}else{this["break"]();return e+"\n"}})};o=function(e){var t;t=0;return r(e,{},function(e){if(e==="\n"){t+=1}else if(e.match(/^\s*$/)){}else{t=0}if(t>=3){return""}else{return e}})};r=function(e,t,u){var n,r,i;if(t==null){t={}}n=false;r={"break":function(e){return n=true}};i=function(e,t,u){var o,s,a,l,f,c,p,D,h,m,d,A;if(t==null){t={}}D=t.reverse?function(){d=[];for(var t=h=e.children.length-1;h<=0?t<=0:t>=0;h<=0?t++:t--){d.push(t)}return d}.apply(this):function(){A=[];for(var t=0,u=e.children.length;0<=u?t<u:t>u;0<=u?t++:t--){A.push(t)}return A}.apply(this);for(f=0,c=D.length;f<c;f++){s=D[f];if(n){return e}o=e.children[s];if(!o){}else if(o.children){i(o,t,u)}else if(o!==""){p=u.call(r,o);e.children[s]=p}}return e};return i.call(r,e,t,u)};t.exports=l},{}],5:[function(e,t,u){u.delimit=function(e,t){var u,n,r,i,o;o=[];for(u=r=0,i=e.length;r<i;u=++r){n=e[u];if(u>0){o.push(t)}o.push(n)}return o};u.commaDelimit=function(e){var t,u,n,r,i;i=[];for(t=n=0,r=e.length;n<r;t=++n){u=e[t];if(t>0){if(/^\n/.test(u.toString())){i.push(",")}else{i.push(", ")}}i.push(u)}return i};u.prependAll=function(e,t){var u,n,r,i,o;o=[];for(u=r=0,i=e.length;r<i;u=++r){n=e[u];o.push(t);o.push(n)}return o};u.buildError=function(e,t,u){var n,r,i,o,s,a,l,f,c,p,D,h,m,d,A,C,E;if(u==null){u=""}if(e.js2coffee){return e}i=e.description;l=(m=(d=e.start)!=null?d.line:void 0)!=null?m:e.lineNumber;r=(A=(C=(E=e.start)!=null?E.column:void 0)!=null?C:e.column&&e.column-1)!=null?A:0;s=u+":"+l+":"+r+": "+i;f=t.split("\n");D=Math.max(l-3,0);c=l-1;o=c.toString().length;a=1;if(e.end){a=Math.max(e.end.column-e.start.column,1)}h=function(e){return Array(1+o-e.toString().length).join(" ")+e};t=f.slice(D,+c+1||9e9).map(function(e,t){return h(1+t+D)+" "+e});t.push(Array(o+3).join(" ")+Array(r+1).join(" ")+Array(a+1).join("^"));t=t.join("\n");p=s+"\n\n"+t;n=e;e=new Error(p);e.filename=u;e.description=n.description;e.start={line:l,column:r};e.end=n.end;e.sourcePreview=t;e.js2coffee=true;return e};u.space=function(e){return e.reduce(function(e,t,u){if(u===0){return e.concat([t])}else if(t.toString().substr(0,1)==="\n"){return e.concat([t])}else{return e.concat([" ",t])}},[])};u.newline=function(e){if(/\n$/.test(e.toString())){return e}else{return[e,"\n"]}};u.inspect=function(t){return"~~~~\n"+e("util").inspect(t,{depth:1e3,colors:true})+"\n~~~~"};u.replace=function(e,t){t.range=e.range;t.loc=e.loc;return t};u.clone=function(e){return JSON.parse(JSON.stringify(e))};u.quote=function(e){var t,u;if(typeof e==="string"){t=function(e){var t;t=e.charCodeAt(0).toString(16);t=function(){var e,u,n;n=[];for(e=0,u=4-t.length;0<=u?e<u:e>u;0<=u?e++:e--){n.push("0")}return n}().join("")+t;return"\\u"+t};u=e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/\n/g,"\\n").replace(/[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g,t);return"'"+u+"'"}else{return JSON.stringify(e)}};u.getPrecedence=function(e){var t,u,n,r;r=e.type;u=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};n={"&&":6,"||":5};switch(r){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 n[e.operator];case"ConditionalExpression":return 4;case"AssignmentExpression":return 3;case"SequenceExpression":return 0;default:return-1}};u.lastStatement=function(e){var t,n,r,i;for(t=n=i=e.length-1;i<=0?n<=0:n>=0;t=i<=0?++n:--n){r=e[t];if(!r){continue}if(!u.isComment(r)){return r}}};u.getReturnStatements=function(e){var t,n,r,i,o;r=u.getReturnStatements,i=u.lastStatement;if(!e){return}else if(e.length){o=i(e)}else{o=e}if(!o){return[]}else if(o.type==="ReturnStatement"){return[o]}else if(o.type==="BlockStatement"){return r(o.body)}else if(o.type==="IfStatement"&&o.consequent&&o.alternate){n=r(o.consequent);t=r(o.alternate);if(n.length>0&&t.length>0){return n.concat(t)}else{return[]}}else{return[]}};u.joinLines=function(e,t){var u,n,r,i,o,s;s=[];for(u=i=0,o=e.length;i<o;u=++i){r=e[u];s.push(t);s.push(r);n=u!==e.length-1;if(!r.toString().match(/\n$/)&&n){s.push("\n")}}return s};u.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"]};u.reservedWords=u.reserved.keywords.concat(u.reserved.reserved.concat(u.reserved.aliases));u.nextUntil=function(e,t,u){var n,r,i,o,s,a;r=e.indexOf(t);for(n=i=s=r+1,a=e.length;s<=a?i<=a:i>=a;n=s<=a?++i:--i){o=e[n];if((o!=null?o.type:void 0)&&u(o)){return o}}};u.nextNonComment=function(e,t){return u.nextUntil(e,t,function(e){return e.type!=="BlockComment"&&e.type!=="LineComment"})};u.isLoop=function(e){return e.test==null||u.isTruthy(e.test)};u.isTruthy=function(e){return e.type==="Literal"&&e.value};u.escapeJs=function(t){return u.replace(t,{type:"CoffeeEscapedExpression",raw:e("escodegen").generate(t)})};u.nonComments=function(e){return e.filter(function(e){return!u.isComment(e)})};u.isComment=function(e){return e.type==="LineComment"||e.type==="BlockComment"};u.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,u){var n,r,i,o,s,a,l,f,c=function(e,t){for(var u in t){if(p.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},p={}.hasOwnProperty,D=[].slice;s=e("../helpers"),r=s.buildError,o=s.clone,a=s.replace,f=s.toIndent;t.exports=n=function(){t.run=function(e,u,n,r){var i,o,s;i=function(e){c(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}return t}(t);l(i,n);s=new i(e,u);o=s.run();if(r.warnings==null){r.warnings=[]}r.warnings=r.warnings.concat(s.warnings);return o};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,u;u=this;this.depth=0;t=function(e){return function(t,u,n){var r,i,o,s;e.node=u;e.depth+=t==="Enter"?+1:-1;r=t==="Enter"?""+u.type:u.type+"Exit";if(typeof e[i="onBefore"+t]==="function"){e[i](u,n)}s=typeof e[r]==="function"?e[r](u,n):void 0;if(typeof e[o="on"+t]==="function"){e[o](u,n)}return s}}(this);this.estraverse().replace(e,{enter:function(e,n){u.controller=this;return t("Enter",e,n)},leave:function(e,u){return t("Exit",e,u)}});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,u,n;n=[this.scope,this.ctx],u=n[0],t=n[1];this.scopes.push([this.scope,this.ctx]);this.ctx=o(this.ctx);this.scope=e;return typeof this.onScopeEnter==="function"?this.onScopeEnter(this.scope,this.ctx,u,t):void 0};t.prototype.popStack=function(){var e,t,u,n;u=[this.scope,this.ctx],t=u[0],e=u[1];n=this.scopes.pop(),this.scope=n[0],this.ctx=n[1];return typeof this.onScopeExit==="function"?this.onScopeExit(this.scope,this.ctx,t,e):void 0};t.prototype.syntaxError=function(e,t){var u,n,i;u=r({start:(n=e.loc)!=null?n.start:void 0,end:(i=e.loc)!=null?i.end:void 0,description:t},this.options.source,this.options.filename);throw u};t.prototype.warn=function(e,t){var u,n;return this.warnings.push({start:(u=e.loc)!=null?u.start:void 0,end:(n=e.loc)!=null?n.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,u){if(u==null){u={}}return a(t,{type:"CoffeeEscapedExpression",_parenthesized:u.parenthesized,raw:e("escodegen").generate(t,{format:{indent:{style:f(this.options.indent)}}})})};return t}();l=function(e,t){var u;u={};t.forEach(function(t){var n,r,o,s;o=t.prototype;s=[];for(r in o){n=o[r];if(t.prototype.hasOwnProperty(r)){if(u[r]&&r!=="constructor"){e.prototype[r]=i(e.prototype[r],n)}else{e.prototype[r]=n}s.push(u[r]=true)}else{s.push(void 0)}}return s});return e};i=function(e,t){return function(){var u,n,r,i;n=arguments[0],u=2<=arguments.length?D.call(arguments,1):[];i=n.type;r=e.bind(this).apply(null,[n].concat(D.call(u)));if(r.type===i){r=t.bind(this).apply(null,[r].concat(D.call(u)))}return r}}},{"../helpers":5,escodegen:29,estraverse:49}],7:[function(e,t,u){var n,r=function(e,t){for(var u in t){if(i.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},i={}.hasOwnProperty;n=e("./base");t.exports=function(e){r(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,u;t={"===":"==","!==":"!="};u=e.operator;if(t[u]){e.operator=t[u]}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,u,n;t=e.operator;n={"==":"===","!=":"!=="};if(t==="=="||t==="!="){u=n[t];this.warn(e,"Operator '"+t+"' is not supported in CoffeeScript, "+("use '"+u+"' instead"))}return e};return t}(n)},{"./base":6}],8:[function(e,t,u){var n,r,i=function(e,t){for(var u in t){if(o.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},o={}.hasOwnProperty,s=[].slice;r=e("./base");t.exports=n=function(e){i(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 u,n;n=false;u=function(u){return function(u,r){var i,o,a;if(t.type===u&&((o=t[r])!=null?o.indexOf:void 0)){i=t[r].indexOf(e);if(t[r]&&~i){(a=t[r]).splice.apply(a,[i,1].concat(s.call(e.body)));n=true;return true}}}}(this);u("BlockStatement","body")||u("SwitchCase","consequent")||u("IfStatement","consequent")||u("IfStatement","alternate");if(n){return this.skip()}else{return e}};return t}(r)},{"./base":6}],9:[function(e,t,u){var n,r=function(e,t){for(var u in t){if(i.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},i={}.hasOwnProperty;n=e("./base");t.exports=function(e){r(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,u,n,r;n=this.comments;r=[];for(t=0,u=n.length;t<u;t++){e=n[t];switch(e.type){case"Block":r.push(e.type="BlockComment");break;case"Line":r.push(e.type="LineComment");break;default:r.push(void 0)}}return r};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 u,n,r,i,o,s,a,l,f;if(e==null){return t}a=[];o=e[0];f=e[1];u=function(e){return function(t,u){return e.comments.filter(function(e){return e.range[0]>=t&&e.range[1]<=u})}}(this);if(t.length>0){for(n=i=0,s=t.length;i<s;n=++i){r=t[n];if(r.range){l=u(o,r.range[0]);a=a.concat(l)}a.push(r);if(r.range){o=r.range[1]}}}l=u(o,f);a=a.concat(l);return a};t.prototype.convertCommentPrefixes=function(e){var t,u;u=e.value.split("\n");t=e.loc.start.column;u=u.map(function(e,n){var r,i,o;i=n===u.length-1&&e.match(/^\s*$/);r=n===0&&u.length===1;o=e.substr(0,t);if(o.match(/^\s+$/)){e=e.substr(t)}if(i){return""}else if(r){return e}else{e=e.replace(/^ \*/,"#");return e+"\n"}});e.value=u.join("");return e};return t}(n)},{"./base":6}],10:[function(e,t,u){var n,r=function(e,t){for(var u in t){if(i.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},i={}.hasOwnProperty;n=e("./base");t.exports=function(e){r(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}(n)},{"./base":6}],11:[function(e,t,u){var n,r,i=function(e,t){for(var u in t){if(o.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},o={}.hasOwnProperty;r=e("../helpers").replace;n=e("./base");t.exports=function(e){i(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.CallExpression=function(e){var t,u,n,i,o,s,a,l,f,c,p;t=((u=e.callee)!=null?u.type:void 0)==="MemberExpression"&&((n=e.callee)!=null?(i=n.object)!=null?i.type:void 0:void 0)==="Identifier"&&((o=e.callee)!=null?(s=o.object)!=null?s.name:void 0:void 0)==="Math"&&((a=e.callee)!=null?(l=a.property)!=null?l.type:void 0:void 0)==="Identifier"&&((f=e.callee)!=null?(c=f.property)!=null?c.name:void 0:void 0)==="pow"&&((p=e["arguments"])!=null?p.length:void 0)===2;if(!t){return e}return r(e,{type:"BinaryExpression",left:e["arguments"][0],operator:"**",right:e["arguments"][1]})};return t}(n)},{"../helpers":5,"./base":6}],12:[function(e,t,u){var n,r,i,o,s,a,l=function(e,t){for(var u in t){if(f.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},f={}.hasOwnProperty,c=[].slice;s=e("../helpers"),i=s.isComment,o=s.nextNonComment,a=s.replace;n=e("./base");t.exports=function(e){l(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,u,n){if(n.prebody.length){return this.prependIntoBody(u.body,n.prebody)}};t.prototype.prependIntoBody=function(e,t){var u;u=r(e);return e.splice.apply(e,[u,0].concat(c.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 u,n;if(!t.body){return}n=o(t.body,e);if(!n){return}u=n.type==="FunctionExpression"&&n.id;u||(u=n.type==="FunctionDeclaration");if(u){this.ctx.prebody.push(e);return this.remove()}};t.prototype.buildFunctionDeclaration=function(e){return a(e,{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:e.id,init:{type:"FunctionExpression",params:e.params,defaults:e.defaults,body:e.body}}]})};return t}(n);r=function(e){var t,u,n,r;t=0;for(t=u=0,n=e.length;u<n;t=++u){r=e[t];if(r.type!=="VariableDeclaration"&&!i(r)){return t}}return t}},{"../helpers":5,"./base":6}],13:[function(e,t,u){var n,r,i,o,s=function(e,t){for(var u in t){if(a.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},a={}.hasOwnProperty;o=e("../helpers").nonComments;n=e("./base");t.exports=function(e){s(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 u;u=e.type==="FunctionDeclaration"||e.type==="FunctionExpression";if(u){return e._parenthesized=true}}});return e};t.prototype.parenthesizeConditionals=function(e){var t;t=["ConditionalExpression","FunctionExpression"];return this.estraverse().traverse(e,{enter:function(e,u){if(~t.indexOf(e.type)){return e._parenthesized=true}}})};t.prototype.handleBlankIfs=function(e){if(i(e)||r(e)&&!e.alternate){e.alternate={type:"BlockStatement",body:[]}}return e};return t}(n);i=function(e){return!e.consequent};r=function(e){var t,u;t=e.consequent;return u=t&&t.type==="BlockStatement"&&o(t.body).length===0}},{"../helpers":5,"./base":6}],14:[function(e,t,u){var n,r,i,o,s,a=function(e,t){for(var u in t){if(l.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},l={}.hasOwnProperty;o=e("../helpers").replace;n=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;t=i(e)&&r(e["arguments"])&&s(e.callee.params,e["arguments"]);if(!t){return e}return o(e,{type:"CoffeeDoExpression","function":e.callee,arguments:e["arguments"]})};return t}(n);r=function(e){var t,u,n;for(u=0,n=e.length;u<n;u++){t=e[u];if(t.type!=="Identifier"){return false}}return true};i=function(e){var t,u;return((t=e.callee)!=null?t.type:void 0)==="FunctionExpression"&&((u=e.callee)!=null?u.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,u){var n,r,i,o,s=function(e,t){for(var u in t){if(a.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},a={}.hasOwnProperty;i=e("../helpers"),o=i.replace,r=i.quote;n=e("./base");t.exports=function(e){s(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:r(t[1])}]});if(t[2]){e["arguments"].push({type:"Literal",value:t[2],raw:r(t[2])})}return e}};return t}(n)},{"../helpers":5,"./base":6}],16:[function(e,t,u){var n,r,i,o,s=function(e,t){for(var u in t){if(a.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},a={}.hasOwnProperty;i=e("../helpers"),o=i.replace,r=i.isLoop;n=e("./base");t.exports=function(e){s(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 u,n;u=(n=this._for)!=null?n[this._for.length-1]:void 0;if(!(u!=null?u._update:void 0)){return e}this.skip();return{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:u._update},e]}};t.prototype.convertDoWhileToLoop=function(e){var t,u;t=e.body;u=t.body;u.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){var t;e.type=r(e)?"CoffeeLoopStatement":"WhileStatement";t=e.init;delete e.init;if(t!=null){return{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:t},e]}}else{return e}};t.prototype.convertWhileToLoop=function(e){if(r(e)){return o(e,{type:"CoffeeLoopStatement",body:e.body})}else{return e}};t.prototype.injectUpdateIntoBody=function(e){var t,u;if(e.update){u={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([u]);e._update=e.update;delete e.update}return e};return t}(n)},{"../helpers":5,"./base":6}],17:[function(e,t,u){var n,r,i=function(e,t){for(var u in t){if(o.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},o={}.hasOwnProperty;r=e("../helpers").replace;n=e("./base");t.exports=function(e){i(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(r(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}(n)},{"../helpers":5,"./base":6}],18:[function(e,t,u){var n,r,i=function(e,t){for(var u in t){if(o.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},o={}.hasOwnProperty;n=e("./base");t.exports=function(e){i(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 u,n,r;if(t.type==="ExpressionStatement"){u=((n=this.scope.body)!=null?n[((r=this.scope.body)!=null?r.length:void 0)-1]:void 0)===t;if(u){e._last=true}else{e._braced=true}}};t.prototype.braceObjectsInElements=function(e){var t,u,n,r;r=e.elements;for(t=0,n=r.length;t<n;t++){u=r[t];if((u!=null?u.type:void 0)==="ObjectExpression"){u._braced=true}}return e};t.prototype.catchEmptyArraySlots=function(e){if(r(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}(n);r=function(e){var t,u,n;for(t=0,u=e.length;t<u;t++){n=e[t];if(n===null){return true}}return false}},{"./base":6}],19:[function(e,t,u){var n,r,i,o,s,a=function(e,t){for(var u in t){if(l.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},l={}.hasOwnProperty,f=[].slice;i=e("../helpers"),s=i.reservedWords,o=i.replace,r=i.quote;n=e("./base");t.exports=function(e){a(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.FunctionExpression=function(e,u){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.FunctionExpressionExit=function(e){var u,n;t.__super__.FunctionExpressionExit.call(this,e);(n=e.body.body).splice.apply(n,[0,0].concat(f.call((u=e.body.shadows)!=null?u:[])));return 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&&~s.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,u,n;u=e.id.name;if(~this.ctx.vars.indexOf(u)){this.warn(e,"Variable shadowing ('"+u+"') is not fully supported in CoffeeScript");n=o(e,{type:"ExpressionStatement",expression:{type:"CoffeeEscapedExpression",raw:"var "+u}});if((t=this.scope).shadows==null){t.shadows=[]}return this.scope.shadows.push(n)}else{return this.ctx.vars.push(u)}};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,u,n,r,i,o,s;if(e.params){s=e.params;for(t=r=0,i=s.length;r<i;t=++r){o=s[t];u=t===e.params.length-1;n=o.type==="Identifier"&&o.name==="undefined";if(n){if(u){e.params.pop()}else{this.syntaxError(o,"'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}(n)},{"../helpers":5,"./base":6}],20:[function(e,t,u){var n,r,i,o,s,a,l=function(e,t){for(var u in t){if(f.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},f={}.hasOwnProperty;r=e("../helpers").getPrecedence;n=e("./base");t.exports=function(e){l(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.onEnter=function(e,t){var u,n,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}n=r(e);if(n===-1){return}u=o(t,e)||i(t,e)||a(t,e)||n<r(t);if(u){return e._parenthesized=true}};return t}(n);o=function(e,t){return s(e,"-")&&e.right===t};i=function(e,t){return s(e,"/")&&(s(t,"/")||s(t,"*"))&&e.right===t};s=function(e,t){return e.type==="BinaryExpression"&&e.operator===t};a=function(e,t){return e.type==="ConditionalExpression"&&t.type==="ConditionalExpression"&&e.alternate!==t}},{"../helpers":5,"./base":6}],21:[function(e,t,u){var n,r,i=function(e,t){for(var u in t){if(o.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},o={}.hasOwnProperty;r=e("../helpers").getReturnStatements;n=e("./base");t.exports=function(e){i(t,e);function t(){return t.__super__.constructor.apply(this,arguments)}t.prototype.onScopeExit=function(e,t,u,n){return this.unreturnify(u)};t.prototype.unreturnify=function(e,t){var u;if(t==null){t="body"}if(e[t].length>0){u=r(e[t]);if(u.length===0){e[t].push({type:"ReturnStatement"})}else{u.forEach(function(e){if(e.argument){e.type="ExpressionStatement";return e.expression=e.argument}})}}};return t}(n)},{"../helpers":5,"./base":6}],22:[function(e,t,u){var n,r=function(e,t){for(var u in t){if(i.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},i={}.hasOwnProperty;n=e("./base.coffee");t.exports=function(e){r(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,u,n,r,i,o,s,a;t=e.cases.filter(function(e){return e.type==="SwitchCase"});s=t.length;for(u=i=0,a=t.length;i<a;u=++i){o=t[u];r=u===s-1;n=o.test==null;if(n&&!r){this.syntaxError(o,"default cases only allowed at the end")}}return e};t.prototype.consolidateCases=function(e){var t,u,n,r,i,o,s;i=[];s=[];o=e.cases;for(t=u=0,r=o.length;u<r;t=++u){n=o[t];if(n.type==="SwitchCase"){if(n.test){s.push(n.test)}if(n.consequent.length>0){if(n.test){n.test={type:"CoffeeListExpression",expressions:s}}s=[];i.push(n)}}else{i.push(n)}}e.cases=i;return e};t.prototype.removeBreaksFromConsequents=function(e){var t,u;if(e.test){t=e.consequent.length-1;u=e.consequent[t];if((u!=null?u.type:void 0)==="BreakStatement"){delete e.consequent[t];e.consequent.length-=1}else if((u!=null?u.type:void 0)==="ContinueStatement"){}else if((u!=null?u.type:void 0)!=="ReturnStatement"){this.syntaxError(e,"No break or return statement found in a case")}return e}};return t}(n)},{"./base.coffee":6}],23:[function(e,t,u){var n,r=function(e,t){for(var u in t){if(i.call(t,u))e[u]=t[u]}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super__=t.prototype;return e},i={}.hasOwnProperty;n=e("./base");t.exports=function(e){r(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}(n)},{"./base":6}],24:[function(e,t,u){if(typeof Object.create==="function"){t.exports=function n(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function r(e,t){e.super_=t;var u=function(){};u.prototype=t.prototype;e.prototype=new u;e.prototype.constructor=e}}},{}],25:[function(e,t,u){(function(e){function t(e,t){var u=0;for(var n=e.length-1;n>=0;n--){var r=e[n];if(r==="."){e.splice(n,1)}else if(r===".."){e.splice(n,1);u++}else if(u){e.splice(n,1);u--}}if(t){for(;u--;u){e.unshift("..")}}return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var r=function(e){return n.exec(e).slice(1)};u.resolve=function(){var u="",n=false;for(var r=arguments.length-1;r>=-1&&!n;r--){var o=r>=0?arguments[r]:e.cwd();if(typeof o!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!o){continue}u=o+"/"+u;n=o.charAt(0)==="/"}u=t(i(u.split("/"),function(e){return!!e}),!n).join("/");return(n?"/":"")+u||"."};u.normalize=function(e){var n=u.isAbsolute(e),r=o(e,-1)==="/";e=t(i(e.split("/"),function(e){return!!e}),!n).join("/");if(!e&&!n){e="."}if(e&&r){e+="/"}return(n?"/":"")+e};u.isAbsolute=function(e){return e.charAt(0)==="/"};u.join=function(){var e=Array.prototype.slice.call(arguments,0);return u.normalize(i(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};u.relative=function(e,t){e=u.resolve(e).substr(1);t=u.resolve(t).substr(1);function n(e){var t=0;for(;t<e.length;t++){if(e[t]!=="")break}var u=e.length-1;for(;u>=0;u--){if(e[u]!=="")break}if(t>u)return[];return e.slice(t,u-t+1)}var r=n(e.split("/"));var i=n(t.split("/"));var o=Math.min(r.length,i.length);var s=o;for(var a=0;a<o;a++){if(r[a]!==i[a]){s=a;break}}var l=[];for(var a=s;a<r.length;a++){l.push("..")}l=l.concat(i.slice(s));return l.join("/")};u.sep="/";u.delimiter=":";u.dirname=function(e){var t=r(e),u=t[0],n=t[1];if(!u&&!n){return"."}if(n){n=n.substr(0,n.length-1)}return u+n};u.basename=function(e,t){var u=r(e)[2];if(t&&u.substr(-1*t.length)===t){u=u.substr(0,u.length-t.length)}return u};u.extname=function(e){return r(e)[3]};function i(e,t){if(e.filter)return e.filter(t);var u=[];for(var n=0;n<e.length;n++){if(t(e[n],n,e))u.push(e[n])}return u}var o="ab".substr(-1)==="b"?function(e,t,u){return e.substr(t,u)}:function(e,t,u){if(t<0)t=e.length+t;return e.substr(t,u)}}).call(this,e("_process"))},{_process:26}],26:[function(e,t,u){var n=t.exports={};n.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 u=[];window.addEventListener("message",function(e){var t=e.source;if((t===window||t===null)&&e.data==="process-tick"){e.stopPropagation();if(u.length>0){var n=u.shift();n()}}},true);return function n(e){u.push(e);window.postMessage("process-tick","*")}}return function r(e){setTimeout(e,0)}}();n.title="browser";n.browser=true;n.env={};n.argv=[];function r(){}n.on=r;n.addListener=r;n.once=r;n.off=r;n.removeListener