UNPKG

dbweb-common

Version:

用`yarn add dbweb-common`安装,不要忘记修改`angular.json`里的 `architect\build\options\assets`,加上

1 lines 332 kB
"no use strict";!function(e){function t(e,t){var n=e,r="";while(n){var i=t[n];if(typeof i=="string")return i+r;if(i)return i.location.replace(/\/*$/,"/")+(r||i.main||i.name);if(i===!1)return"";var s=n.lastIndexOf("/");if(s===-1)break;r=n.substr(s)+r,n=n.slice(0,s)}return e}if(typeof e.window!="undefined"&&e.document)return;if(e.require&&e.define)return;e.console||(e.console=function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})},e.console.error=e.console.warn=e.console.log=e.console.trace=e.console),e.window=e,e.ace=e,e.onerror=function(e,t,n,r,i){postMessage({type:"error",data:{message:e,data:i.data,file:t,line:n,col:r,stack:i.stack}})},e.normalizeModule=function(t,n){if(n.indexOf("!")!==-1){var r=n.split("!");return e.normalizeModule(t,r[0])+"!"+e.normalizeModule(t,r[1])}if(n.charAt(0)=="."){var i=t.split("/").slice(0,-1).join("/");n=(i?i+"/":"")+n;while(n.indexOf(".")!==-1&&s!=n){var s=n;n=n.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return n},e.require=function(r,i){i||(i=r,r=null);if(!i.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");i=e.normalizeModule(r,i);var s=e.require.modules[i];if(s)return s.initialized||(s.initialized=!0,s.exports=s.factory().exports),s.exports;if(!e.require.tlns)return console.log("unable to load "+i);var o=t(i,e.require.tlns);return o.slice(-3)!=".js"&&(o+=".js"),e.require.id=i,e.require.modules[i]={},importScripts(o),e.require(r,i)},e.require.modules={},e.require.tlns={},e.define=function(t,n,r){arguments.length==2?(r=n,typeof t!="string"&&(n=t,t=e.require.id)):arguments.length==1&&(r=t,n=[],t=e.require.id);if(typeof r!="function"){e.require.modules[t]={exports:r,initialized:!0};return}n.length||(n=["require","exports","module"]);var i=function(n){return e.require(t,n)};e.require.modules[t]={exports:{},factory:function(){var e=this,t=r.apply(this,n.slice(0,r.length).map(function(t){switch(t){case"require":return i;case"exports":return e.exports;case"module":return e;default:return i(t)}}));return t&&(e.exports=t),e}}},e.define.amd={},require.tlns={},e.initBaseUrls=function(t){for(var n in t)require.tlns[n]=t[n]},e.initSender=function(){var n=e.require("ace/lib/event_emitter").EventEmitter,r=e.require("ace/lib/oop"),i=function(){};return function(){r.implement(this,n),this.callback=function(e,t){postMessage({type:"call",id:t,data:e})},this.emit=function(e,t){postMessage({type:"event",name:e,data:t})}}.call(i.prototype),new i};var n=e.main=null,r=e.sender=null;e.onmessage=function(t){var i=t.data;if(i.event&&r)r._signal(i.event,i.data);else if(i.command)if(n[i.command])n[i.command].apply(n,i.args);else{if(!e[i.command])throw new Error("Unknown command:"+i.command);e[i.command].apply(e,i.args)}else if(i.init){e.initBaseUrls(i.tlns),require("ace/lib/es5-shim"),r=e.sender=e.initSender();var s=require(i.module)[i.classname];n=e.main=new s(r)}}}(this),ace.define("ace/lib/oop",[],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/range",[],function(e,t,n){"use strict";var r=function(e,t){return e.row-t.row||e.column-t.column},i=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?t<this.start.column?-1:t>this.end.column?1:0:e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.row<e)var n={row:e,column:0};if(this.start.row>t)var r={row:t+1,column:0};else if(this.start.row<e)var r={row:e,column:0};return i.fromPoints(r||this.start,n||this.end)},this.extend=function(e,t){var n=this.compare(e,t);if(n==0)return this;if(n==-1)var r={row:e,column:t};else var s={row:e,column:t};return i.fromPoints(r||this.start,s||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return i.fromPoints(this.start,this.end)},this.collapseRows=function(){return this.end.column==0?new i(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new i(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),n=e.documentToScreenPosition(this.end);return new i(t.row,t.column,n.row,n.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(i.prototype),i.fromPoints=function(e,t){return new i(e.row,e.column,t.row,t.column)},i.comparePoints=r,i.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=i}),ace.define("ace/apply_delta",[],function(e,t,n){"use strict";function r(e,t){throw console.log("Invalid Delta:",e),"Invalid Delta: "+t}function i(e,t){return t.row>=0&&t.row<e.length&&t.column>=0&&t.column<=e[t.row].length}function s(e,t){t.action!="insert"&&t.action!="remove"&&r(t,"delta.action must be 'insert' or 'remove'"),t.lines instanceof Array||r(t,"delta.lines must be an Array"),(!t.start||!t.end)&&r(t,"delta.start/end must be an present");var n=t.start;i(e,t.start)||r(t,"delta.start must be contained in document");var s=t.end;t.action=="remove"&&!i(e,s)&&r(t,"delta.end must contained in document for 'remove' actions");var o=s.row-n.row,u=s.column-(o==0?n.column:0);(o!=t.lines.length-1||t.lines[o].length!=u)&&r(t,"delta.range must match delta lines")}t.applyDelta=function(e,t,n){var r=t.start.row,i=t.start.column,s=e[r]||"";switch(t.action){case"insert":var o=t.lines;if(o.length===1)e[r]=s.substring(0,i)+t.lines[0]+s.substring(i);else{var u=[r,1].concat(t.lines);e.splice.apply(e,u),e[r]=s.substring(0,i)+e[r],e[r+t.lines.length-1]+=s.substring(i)}break;case"remove":var a=t.end.column,f=t.end.row;r===f?e[r]=s.substring(0,i)+s.substring(a):e.splice(r,f-r+1,s.substring(0,i)+e[f].substring(a))}}}),ace.define("ace/lib/event_emitter",[],function(e,t,n){"use strict";var r={},i=function(){this.propagationStopped=!0},s=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=s),n=n.slice();for(var o=0;o<n.length;o++){n[o](t,this);if(t.propagationStopped)break}if(r&&!t.defaultPrevented)return r(t,this)},r._signal=function(e,t){var n=(this._eventRegistry||{})[e];if(!n)return;n=n.slice();for(var r=0;r<n.length;r++)n[r](t,this)},r.once=function(e,t){var n=this;this.addEventListener(e,function r(){n.removeEventListener(e,r),t.apply(null,arguments)});if(!t)return new Promise(function(e){t=e})},r.setDefaultHandler=function(e,t){var n=this._defaultHandlers;n||(n=this._defaultHandlers={_disabled_:{}});if(n[e]){var r=n[e],i=n._disabled_[e];i||(n._disabled_[e]=i=[]),i.push(r);var s=i.indexOf(t);s!=-1&&i.splice(s,1)}n[e]=t},r.removeDefaultHandler=function(e,t){var n=this._defaultHandlers;if(!n)return;var r=n._disabled_[e];if(n[e]==t)r&&this.setDefaultHandler(e,r.pop());else if(r){var i=r.indexOf(t);i!=-1&&r.splice(i,1)}},r.on=r.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[e];return r||(r=this._eventRegistry[e]=[]),r.indexOf(t)==-1&&r[n?"unshift":"push"](t),t},r.off=r.removeListener=r.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(!n)return;var r=n.indexOf(t);r!==-1&&n.splice(r,1)},r.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=r}),ace.define("ace/anchor",[],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=t.Anchor=function(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),typeof n=="undefined"?this.setPosition(t.row,t.column):this.setPosition(t,n)};(function(){function e(e,t,n){var r=n?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&r}function t(t,n,r){var i=t.action=="insert",s=(i?1:-1)*(t.end.row-t.start.row),o=(i?1:-1)*(t.end.column-t.start.column),u=t.start,a=i?u:t.end;return e(n,u,r)?{row:n.row,column:n.column}:e(a,n,!r)?{row:n.row+s,column:n.column+(n.row==a.row?o:0)}:{row:u.row,column:u.column}}r.implement(this,i),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){if(e.start.row==e.end.row&&e.start.row!=this.row)return;if(e.start.row>this.row)return;var n=t(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",[],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=e("./anchor").Anchor,a=function(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new u(this,e,t)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e,this._signal("changeNewLineMode")},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();e===undefined?e=n:e<0?e=0:e>=n&&(e=n-1,t=undefined);var r=this.getLine(e);return t==undefined&&(t=r.length),t=Math.min(Math.max(t,0),r.length),{row:e,column:t}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var n=0;e<this.getLength()?(t=t.concat([""]),n=0):(t=[""].concat(t),e--,n=this.$lines[e].length),this.insertMergedLines({row:e,column:n},t)},this.insertMergedLines=function(e,t){var n=this.clippedPos(e.row,e.column),r={row:n.row+t.length-1,column:(t.length==1?n.column:0)+t[t.length-1].length};return this.applyDelta({start:n,end:r,action:"insert",lines:t}),this.clonePos(r)},this.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),n=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:n,action:"remove",lines:this.getLinesForRange({start:t,end:n})}),this.clonePos(t)},this.removeInLine=function(e,t,n){var r=this.clippedPos(e,t),i=this.clippedPos(e,n);return this.applyDelta({start:r,end:i,action:"remove",lines:this.getLinesForRange({start:r,end:i})},!0),this.clonePos(r)},this.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1),t=Math.min(Math.max(0,t),this.getLength()-1);var n=t==this.getLength()-1&&e>0,r=t<this.getLength()-1,i=n?e-1:e,s=n?this.getLine(i).length:0,u=r?t+1:t,a=r?0:this.getLine(u).length,f=new o(i,s,u,a),l=this.$lines.slice(e,t+1);return this.applyDelta({start:f.start,end:f.end,action:"remove",lines:this.getLinesForRange(f)}),l},this.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){e instanceof o||(e=o.fromPoints(e.start,e.end));if(t.length===0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);var n;return t?n=this.insert(e.start,t):n=e.start,n},this.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},this.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n=e.action=="insert";if(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))return;n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e))},this.$splitAndapplyLargeDelta=function(e,t){var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column;for(var o=0,u=0;o<r;o=u){u+=t-1;var a=n.slice(o,u);a.push(""),this.applyDelta({start:this.pos(i+o,s),end:this.pos(i+u,s=0),action:e.action,lines:a},!0)}e.lines=n.slice(o),e.start.row=i+o,e.start.column=s,this.applyDelta(e,!0)},this.revertDelta=function(e){this.applyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:e.action=="insert"?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length;for(var i=t||0,s=n.length;i<s;i++){e-=n[i].length+r;if(e<0)return{row:i,column:e+n[i].length+r}}return{row:s-1,column:e+n[s-1].length+r}},this.positionToIndex=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,i=0,s=Math.min(e.row,n.length);for(var o=t||0;o<s;++o)i+=n[o].length+r;return i+e.column}}).call(a.prototype),t.Document=a}),ace.define("ace/lib/lang",[],function(e,t,n){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){var n="";while(t>0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n<r;n++)e[n]&&typeof e[n]=="object"?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=function s(e){if(typeof e!="object"||!e)return e;var t;if(Array.isArray(e)){t=[];for(var n=0;n<e.length;n++)t[n]=s(e[n]);return t}if(Object.prototype.toString.call(e)!=="[object Object]")return e;t={};for(var n in e)t[n]=s(e[n]);return t},t.arrayToMap=function(e){var t={};for(var n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},r=function(e){return r.cancel(),t=setTimeout(n,e||0),r};return r.schedule=r,r.call=function(){return this.cancel(),e(),r},r.cancel=function(){return clearTimeout(t),t=null,r},r.isPending=function(){return t},r},t.delayedCall=function(e,t){var n=null,r=function(){n=null,e()},i=function(e){n==null&&(n=setTimeout(r,e||t))};return i.delay=function(e){n&&clearTimeout(n),n=setTimeout(r,e||t)},i.schedule=i,i.call=function(){this.cancel(),e()},i.cancel=function(){n&&clearTimeout(n),n=null},i.isPending=function(){return n},i}}),ace.define("ace/worker/mirror",[],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../document").Document,s=e("../lib/lang"),o=t.Mirror=function(e){this.sender=e;var t=this.doc=new i(""),n=this.deferredUpdate=s.delayedCall(this.onUpdate.bind(this)),r=this;e.on("change",function(e){var i=e.data;if(i[0].start)t.applyDeltas(i);else for(var s=0;s<i.length;s+=2){if(Array.isArray(i[s+1]))var o={action:"insert",start:i[s],lines:i[s+1]};else var o={action:"remove",start:i[s],end:i[s+1]};t.applyDelta(o,!0)}if(r.$timeout)return n.schedule(r.$timeout);r.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(e){this.$timeout=e},this.setValue=function(e){this.doc.setValue(e),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(e){this.sender.callback(this.doc.getValue(),e)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(o.prototype)}),ace.define("ace/mode/coffee/coffee",[],function(require,exports,module){function define(e){module.exports=e()}function _toArray(e){return Array.isArray(e)?e:Array.from(e)}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}define.amd={};var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_get=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var s=Object.getPrototypeOf(t);return null===s?void 0:e(s,n,r)}if("value"in i)return i.value;var o=i.get;return void 0===o?void 0:o.call(r)},_slicedToArray=function(){function e(e,t){var n=[],r=!0,i=!1,s=void 0;try{for(var o=e[Symbol.iterator](),u;!(r=(u=o.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){i=!0,s=e}finally{try{!r&&o["return"]&&o["return"]()}finally{if(i)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_createClass=function(){function e(e,t){for(var n=0,r;n<t.length;n++)r=t[n],r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();(function(root){var CoffeeScript=function(){function require(e){return require[e]}var _Mathabs=Math.abs,_StringfromCharCode=String.fromCharCode,_Mathfloor=Math.floor;return require["../../package.json"]=function(){return{name:"coffeescript",description:"Unfancy JavaScript",keywords:["javascript","language","coffeescript","compiler"],author:"Jeremy Ashkenas",version:"2.2.1",license:"MIT",engines:{node:">=6"},directories:{lib:"./lib/coffeescript"},main:"./lib/coffeescript/index",browser:"./lib/coffeescript/browser",bin:{coffee:"./bin/coffee",cake:"./bin/cake"},files:["bin","lib","register.js","repl.js"],scripts:{test:"node ./bin/cake test","test-harmony":"node --harmony ./bin/cake test"},homepage:"http://coffeescript.org",bugs:"https://github.com/jashkenas/coffeescript/issues",repository:{type:"git",url:"git://github.com/jashkenas/coffeescript.git"},devDependencies:{"babel-core":"~6.26.0","babel-preset-babili":"~0.1.4","babel-preset-env":"~1.6.1","babel-preset-minify":"^0.3.0",codemirror:"^5.32.0",docco:"~0.8.0","highlight.js":"~9.12.0",jison:">=0.4.18","markdown-it":"~8.4.0",underscore:"~1.8.3",webpack:"~3.10.0"},dependencies:{}}}(),require["./helpers"]=function(){var e={};return function(){var t,n,r,i,s,o,u,a;e.starts=function(e,t,n){return t===e.substr(n,t.length)},e.ends=function(e,t,n){var r;return r=t.length,t===e.substr(e.length-r-(n||0),r)},e.repeat=u=function(e,t){var n;for(n="";0<t;)1&t&&(n+=e),t>>>=1,e+=e;return n},e.compact=function(e){var t,n,r,i;for(i=[],t=0,r=e.length;t<r;t++)n=e[t],n&&i.push(n);return i},e.count=function(e,t){var n,r;if(n=r=0,!t.length)return 1/0;for(;r=1+e.indexOf(t,r);)n++;return n},e.merge=function(e,t){return i(i({},e),t)},i=e.extend=function(e,t){var n,r;for(n in t)r=t[n],e[n]=r;return e},e.flatten=s=function(t){var n,r,i,o;for(r=[],i=0,o=t.length;i<o;i++)n=t[i],"[object Array]"===Object.prototype.toString.call(n)?r=r.concat(s(n)):r.push(n);return r},e.del=function(e,t){var n;return n=e[t],delete e[t],n},e.some=null==(o=Array.prototype.some)?function(e){var t,n,r,i;for(i=this,n=0,r=i.length;n<r;n++)if(t=i[n],e(t))return!0;return!1}:o,e.invertLiterate=function(e){var t,n,r,i,s,o,u,a,f;for(a=[],t=/^\s*$/,r=/^[\t ]/,u=/^(?:\t?| {0,3})(?:[\*\-\+]|[0-9]{1,9}\.)[ \t]/,i=!1,f=e.split("\n"),n=0,s=f.length;n<s;n++)o=f[n],t.test(o)?(i=!1,a.push(o)):i||u.test(o)?(i=!0,a.push("# "+o)):!i&&r.test(o)?a.push(o):(i=!0,a.push("# "+o));return a.join("\n")},n=function(e,t){return t?{first_line:e.first_line,first_column:e.first_column,last_line:t.last_line,last_column:t.last_column}:e},r=function(e){return e.first_line+"x"+e.first_column+"-"+e.last_line+"x"+e.last_column},e.addDataToNode=function(e,i,s){return function(o){var u,a,f,l,c,h;if(null!=(null==o?void 0:o.updateLocationDataIfMissing)&&null!=i&&o.updateLocationDataIfMissing(n(i,s)),!e.tokenComments)for(e.tokenComments={},l=e.parser.tokens,u=0,a=l.length;u<a;u++)if(c=l[u],!!c.comments)if(h=r(c[2]),null==e.tokenComments[h])e.tokenComments[h]=c.comments;else{var p;(p=e.tokenComments[h]).push.apply(p,_toConsumableArray(c.comments))}return null!=o.locationData&&(f=r(o.locationData),null!=e.tokenComments[f]&&t(e.tokenComments[f],o)),o}},e.attachCommentsToNode=t=function(e,t){var n;if(null!=e&&0!==e.length)return null==t.comments&&(t.comments=[]),(n=t.comments).push.apply(n,_toConsumableArray(e))},e.locationDataToString=function(e){var t;return"2"in e&&"first_line"in e[2]?t=e[2]:"first_line"in e&&(t=e),t?t.first_line+1+":"+(t.first_column+1)+"-"+(t.last_line+1+":"+(t.last_column+1)):"No location data"},e.baseFileName=function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],r,i;return(i=n?/\\|\//:/\//,r=e.split(i),e=r[r.length-1],!(t&&0<=e.indexOf(".")))?e:(r=e.split("."),r.pop(),"coffee"===r[r.length-1]&&1<r.length&&r.pop(),r.join("."))},e.isCoffee=function(e){return/\.((lit)?coffee|coffee\.md)$/.test(e)},e.isLiterate=function(e){return/\.(litcoffee|coffee\.md)$/.test(e)},e.throwSyntaxError=function(e,t){var n;throw n=new SyntaxError(e),n.location=t,n.toString=a,n.stack=n.toString(),n},e.updateSyntaxError=function(e,t,n){return e.toString===a&&(e.code||(e.code=t),e.filename||(e.filename=n),e.stack=e.toString()),e},a=function(){var e,t,n,r,i,s,o,a,f,l,c,h,p,d;if(!this.code||!this.location)return Error.prototype.toString.call(this);var v=this.location;return o=v.first_line,s=v.first_column,f=v.last_line,a=v.last_column,null==f&&(f=o),null==a&&(a=s),i=this.filename||"[stdin]",e=this.code.split("\n")[o],d=s,r=o===f?a+1:e.length,l=e.slice(0,d).replace(/[^\s]/g," ")+u("^",r-d),"undefined"!=typeof process&&null!==process&&(n=(null==(c=process.stdout)?void 0:c.isTTY)&&(null==(h=process.env)||!h.NODE_DISABLE_COLORS)),(null==(p=this.colorful)?n:p)&&(t=function(e){return""+e+""},e=e.slice(0,d)+t(e.slice(d,r))+e.slice(r),l=t(l)),i+":"+(o+1)+":"+(s+1)+": error: "+this.message+"\n"+e+"\n"+l},e.nameWhitespaceCharacter=function(e){return" "===e?"space":"\n"===e?"newline":"\r"===e?"carriage return":" "===e?"tab":e}}.call(this),{exports:e}.exports}(),require["./rewriter"]=function(){var e={};return function(){var t=[].indexOf,n=require("./helpers"),r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N;for(N=n.throwSyntaxError,x=function(e,t){var n,r,i,s,o;if(e.comments){if(t.comments&&0!==t.comments.length){for(o=[],s=e.comments,r=0,i=s.length;r<i;r++)n=s[r],n.unshift?o.push(n):t.comments.push(n);t.comments=o.concat(t.comments)}else t.comments=e.comments;return delete e.comments}},b=function(e,t,n,r){var i;return i=[e,t],i.generated=!0,n&&(i.origin=n),r&&x(r,i),i},e.Rewriter=m=function(){var e=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"rewrite",value:function(t){var n,r,i;return this.tokens=t,("undefined"!=typeof process&&null!==process?null==(n=process.env)?void 0:n.DEBUG_TOKEN_STREAM:void 0)&&(process.env.DEBUG_REWRITTEN_TOKEN_STREAM&&console.log("Initial token stream:"),console.log(function(){var e,t,n,r;for(n=this.tokens,r=[],e=0,t=n.length;e<t;e++)i=n[e],r.push(i[0]+"/"+i[1]+(i.comments?"*":""));return r}.call(this).join(" "))),this.removeLeadingNewlines(),this.closeOpenCalls(),this.closeOpenIndexes(),this.normalizeLines(),this.tagPostfixConditionals(),this.addImplicitBracesAndParens(),this.addParensToChainedDoIife(),this.rescueStowawayComments(),this.addLocationDataToGeneratedTokens(),this.enforceValidCSXAttributes(),this.fixOutdentLocationData(),("undefined"!=typeof process&&null!==process?null==(r=process.env)?void 0:r.DEBUG_REWRITTEN_TOKEN_STREAM:void 0)&&(process.env.DEBUG_TOKEN_STREAM&&console.log("Rewritten token stream:"),console.log(function(){var e,t,n,r;for(n=this.tokens,r=[],e=0,t=n.length;e<t;e++)i=n[e],r.push(i[0]+"/"+i[1]+(i.comments?"*":""));return r}.call(this).join(" "))),this.tokens}},{key:"scanTokens",value:function(t){var n,r,i;for(i=this.tokens,n=0;r=i[n];)n+=t.call(this,r,n,i);return!0}},{key:"detectEnd",value:function(n,r,i){var s=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},o,u,l,c,h;for(h=this.tokens,o=0;c=h[n];){if(0===o&&r.call(this,c,n))return i.call(this,c,n);if((u=c[0],0<=t.call(f,u))?o+=1:(l=c[0],0<=t.call(a,l))&&(o-=1),0>o)return s.returnOnNegativeLevel?void 0:i.call(this,c,n);n+=1}return n-1}},{key:"removeLeadingNewlines",value:function(){var t,n,r,i,s,o,u,a,f;for(u=this.tokens,t=n=0,s=u.length;n<s;t=++n){var l=_slicedToArray(u[t],1);if(f=l[0],"TERMINATOR"!==f)break}if(0!==t){for(a=this.tokens.slice(0,t),r=0,o=a.length;r<o;r++)i=a[r],x(i,this.tokens[t]);return this.tokens.splice(0,t)}}},{key:"closeOpenCalls",value:function(){var t,n;return n=function(e){var t;return")"===(t=e[0])||"CALL_END"===t},t=function(e){return e[0]="CALL_END"},this.scanTokens(function(e,r){return"CALL_START"===e[0]&&this.detectEnd(r+1,n,t),1})}},{key:"closeOpenIndexes",value:function(){var t,n;return n=function(e){var t;return"]"===(t=e[0])||"INDEX_END"===t},t=function(e){return e[0]="INDEX_END"},this.scanTokens(function(e,r){return"INDEX_START"===e[0]&&this.detectEnd(r+1,n,t),1})}},{key:"indexOfTag",value:function(n){var r,i,s,o,u;r=0;for(var a=arguments.length,f=Array(1<a?a-1:0),l=1;l<a;l++)f[l-1]=arguments[l];for(i=s=0,o=f.length;0<=o?0<=s&&s<o:0>=s&&s>o;i=0<=o?++s:--s)if(null!=f[i]&&("string"==typeof f[i]&&(f[i]=[f[i]]),u=this.tag(n+i+r),0>t.call(f[i],u)))return-1;return n+i+r-1}},{key:"looksObjectish",value:function(n){var r,i;return-1!==this.indexOfTag(n,"@",null,":")||-1!==this.indexOfTag(n,null,":")||(i=this.indexOfTag(n,f),-1!==i&&(r=null,this.detectEnd(i+1,function(e){var n;return n=e[0],0<=t.call(a,n)},function(e,t){return r=t}),":"===this.tag(r+1)))}},{key:"findTagsBackwards",value:function(n,r){var i,s,o,u,l,c,h;for(i=[];0<=n&&(i.length||(u=this.tag(n),0>t.call(r,u))&&((l=this.tag(n),0>t.call(f,l))||this.tokens[n].generated)&&(c=this.tag(n),0>t.call(v,c)));)(s=this.tag(n),0<=t.call(a,s))&&i.push(this.tag(n)),(o=this.tag(n),0<=t.call(f,o))&&i.length&&i.pop(),n-=1;return h=this.tag(n),0<=t.call(r,h)}},{key:"addImplicitBracesAndParens",value:function(){var n,r;return n=[],r=null,this.scanTokens(function(e,o,u){var d=this,m=_slicedToArray(e,1),g,y,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q,R,U,z,W,X,V,$,J,K,Q;Q=m[0];var G=B=0<o?u[o-1]:[],Y=_slicedToArray(G,1);H=Y[0];var Z=D=o<u.length-1?u[o+1]:[],et=_slicedToArray(Z,1);if(_=et[0],X=function(){return n[n.length-1]},V=o,w=function(e){return o-V+e},k=function(e){var t;return null==e||null==(t=e[2])?void 0:t.ours},A=function(e){return k(e)&&"{"===(null==e?void 0:e[0])},L=function(e){return k(e)&&"("===(null==e?void 0:e[0])},x=function(){return k(X())},T=function(){return L(X())},C=function(){return A(X())},N=function(){var e;return x()&&"CONTROL"===(null==(e=X())?void 0:e[0])},$=function(t){return n.push(["(",t,{ours:!0}]),u.splice(t,0,b("CALL_START","(",["","implicit function call",e[2]],B))},g=function(){return n.pop(),u.splice(o,0,b("CALL_END",")",["","end of input",e[2]],B)),o+=1},J=function(t){var r=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],i;return n.push(["{",t,{sameLine:!0,startsLine:r,ours:!0}]),i=new String("{"),i.generated=!0,u.splice(t,0,b("{",i,e,B))},y=function(t){return t=null==t?o:t,n.pop(),u.splice(t,0,b("}","}",e,B)),o+=1},E=function(e){var t;return t=null,d.detectEnd(e,function(e){return"TERMINATOR"===e[0]},function(e,n){return t=n},{returnOnNegativeLevel:!0}),null!=t&&d.looksObjectish(t+1)},(T()||C())&&0<=t.call(s,Q)||C()&&":"===H&&"FOR"===Q)return n.push(["CONTROL",o,{ours:!0}]),w(1);if("INDENT"===Q&&x()){if("=>"!==H&&"->"!==H&&"["!==H&&"("!==H&&","!==H&&"{"!==H&&"ELSE"!==H&&"="!==H)for(;T()||C()&&":"!==H;)T()?g():y();return N()&&n.pop(),n.push([Q,o]),w(1)}if(0<=t.call(f,Q))return n.push([Q,o]),w(1);if(0<=t.call(a,Q)){for(;x();)T()?g():C()?y():n.pop();r=n.pop()}if(S=function(){var n,r,i,s;return(i=d.findTagsBackwards(o,["FOR"])&&d.findTagsBackwards(o,["FORIN","FOROF","FORFROM"]),n=i||d.findTagsBackwards(o,["WHILE","UNTIL","LOOP","LEADING_WHEN"]),!!n)&&(r=!1,s=e[2].first_line,d.detectEnd(o,function(e){var n;return n=e[0],0<=t.call(v,n)},function(e,t){var n=u[t-1]||[],i=_slicedToArray(n,3),o;return H=i[0],o=i[2].first_line,r=s===o&&("->"===H||"=>"===H)},{returnOnNegativeLevel:!0}),r)},(0<=t.call(h,Q)&&e.spaced||"?"===Q&&0<o&&!u[o-1].spaced)&&(0<=t.call(l,_)||"..."===_&&(j=this.tag(o+2),0<=t.call(l,j))&&!this.findTagsBackwards(o,["INDEX_START","["])||0<=t.call(p,_)&&!D.spaced&&!D.newLine)&&!S())return"?"===Q&&(Q=e[0]="FUNC_EXIST"),$(o+1),w(2);if(0<=t.call(h,Q)&&-1<this.indexOfTag(o+1,"INDENT")&&this.looksObjectish(o+2)&&!this.findTagsBackwards(o,["CLASS","EXTENDS","IF","CATCH","SWITCH","LEADING_WHEN","FOR","WHILE","UNTIL"]))return $(o+1),n.push(["INDENT",o+2]),w(3);if(":"===Q){if(q=function(){var e;switch(!1){case e=this.tag(o-1),0>t.call(a,e):return r[1];case"@"!==this.tag(o-2):return o-2;default:return o-1}}.call(this),K=0>=q||(F=this.tag(q-1),0<=t.call(v,F))||u[q-1].newLine,X()){var tt=X(),nt=_slicedToArray(tt,2);if(W=nt[0],U=nt[1],("{"===W||"INDENT"===W&&"{"===this.tag(U-1))&&(K||","===this.tag(q-1)||"{"===this.tag(q-1)))return w(1)}return J(q,!!K),w(2)}if(0<=t.call(v,Q))for(O=n.length-1;0<=O&&(z=n[O],!!k(z));O+=-1)A(z)&&(z[2].sameLine=!1);if(M="OUTDENT"===H||B.newLine,0<=t.call(c,Q)||0<=t.call(i,Q)&&M||(".."===Q||"..."===Q)&&this.findTagsBackwards(o,["INDEX_START"]))for(;x();){var rt=X(),it=_slicedToArray(rt,3);W=it[0],U=it[1];var st=it[2];if(R=st.sameLine,K=st.startsLine,T()&&","!==H||","===H&&"TERMINATOR"===Q&&null==_)g();else if(C()&&R&&"TERMINATOR"!==Q&&":"!==H&&("POST_IF"!==Q&&"FOR"!==Q&&"WHILE"!==Q&&"UNTIL"!==Q||!K||!E(o+1)))y();else{if(!C()||"TERMINATOR"!==Q||","===H||!!K&&!!this.looksObjectish(o+1))break;y()}}if(","===Q&&!this.looksObjectish(o+1)&&C()&&"FOROF"!==(I=this.tag(o+2))&&"FORIN"!==I&&("TERMINATOR"!==_||!this.looksObjectish(o+2)))for(P="OUTDENT"===_?1:0;C();)y(o+P);return w(1)})}},{key:"enforceValidCSXAttributes",value:function(){return this.scanTokens(function(e,t,n){var r,i;return e.csxColon&&(r=n[t+1],"STRING_START"!==(i=r[0])&&"STRING"!==i&&"("!==i&&N("expected wrapped or quoted JSX attribute",r[2])),1})}},{key:"rescueStowawayComments",value:function(){var n,r,i;return n=function(e,t,n,r){return"TERMINATOR"!==n[t][0]&&n[r](b("TERMINATOR","\n",n[t])),n[r](b("JS","",n[t],e))},i=function(e,r,i){var s,u,a,f,l,c,h;for(u=r;u!==i.length&&(l=i[u][0],0<=t.call(o,l));)u++;if(u===i.length||(c=i[u][0],0<=t.call(o,c)))return u=i.length-1,n(e,u,i,"push"),1;for(h=e.comments,a=0,f=h.length;a<f;a++)s=h[a],s.unshift=!0;return x(e,i[u]),1},r=function(e,r,i){var s,u,a;for(s=r;-1!==s&&(u=i[s][0],0<=t.call(o,u));)s--;return-1===s||(a=i[s][0],0<=t.call(o,a))?(n(e,0,i,"unshift"),3):(x(e,i[s]),1)},this.scanTokens(function(e,n,s){var u,a,f,l,c;if(!e.comments)return 1;if(c=1,f=e[0],0<=t.call(o,f)){for(u={comments:[]},a=e.comments.length-1;-1!==a;)!1===e.comments[a].newLine&&!1===e.comments[a].here&&(u.comments.unshift(e.comments[a]),e.comments.splice(a,1)),a--;0!==u.comments.length&&(c=r(u,n-1,s)),0!==e.comments.length&&i(e,n,s)}else{for(u={comments:[]},a=e.comments.length-1;-1!==a;)!e.comments[a].newLine||e.comments[a].unshift||"JS"===e[0]&&e.generated||(u.comments.unshift(e.comments[a]),e.comments.splice(a,1)),a--;0!==u.comments.length&&(c=i(u,n+1,s))}return 0===(null==(l=e.comments)?void 0:l.length)&&delete e.comments,c})}},{key:"addLocationDataToGeneratedTokens",value:function(){return this.scanTokens(function(e,t,n){var r,i,s,o,u,a;if(e[2])return 1;if(!e.generated&&!e.explicit)return 1;if("{"===e[0]&&(s=null==(u=n[t+1])?void 0:u[2])){var f=s;i=f.first_line,r=f.first_column}else if(o=null==(a=n[t-1])?void 0:a[2]){var l=o;i=l.last_line,r=l.last_column}else i=r=0;return e[2]={first_line:i,first_column:r,last_line:i,last_column:r},1})}},{key:"fixOutdentLocationData",value:function(){return this.scanTokens(function(e,t,n){var r;return"OUTDENT"===e[0]||e.generated&&"CALL_END"===e[0]||e.generated&&"}"===e[0]?(r=n[t-1][2],e[2]={first_line:r.last_line,first_column:r.last_column,last_line:r.last_line,last_column:r.last_column},1):1})}},{key:"addParensToChainedDoIife",value:function(){var n,r,s;return r=function(e,t){return"OUTDENT"===this.tag(t-1)},n=function(e,n){var r;if(r=e[0],!(0>t.call(i,r)))return this.tokens.splice(s,0,b("(","(",this.tokens[s])),this.tokens.splice(n+1,0,b(")",")",this.tokens[n]))},s=null,this.scanTokens(function(e,t){var i,o;return"do"===e[1]?(s=t,i=t+1,"PARAM_START"===this.tag(t+1)&&(i=null,this.detectEnd(t+1,function(e,t){return"PARAM_END"===this.tag(t-1)},function(e,t){return i=t})),null==i||"->"!==(o=this.tag(i))&&"=>"!==o||"INDENT"!==this.tag(i+1))?1:(this.detectEnd(i+1,r,n),2):1})}},{key:"normalizeLines",value:function(){var n=this,r,s,o,a,f,l,c,h,p;return p=f=h=null,c=null,l=null,a=[],o=function(e,n){var r,s,o,a;return";"!==e[1]&&(r=e[0],0<=t.call(g,r))&&!("TERMINATOR"===e[0]&&(s=this.tag(n+1),0<=t.call(u,s)))&&("ELSE"!==e[0]||"THEN"===p&&!l&&!c)&&("CATCH"!==(o=e[0])&&"FINALLY"!==o||"->"!==p&&"=>"!==p)||(a=e[0],0<=t.call(i,a))&&(this.tokens[n-1].newLine||"OUTDENT"===this.tokens[n-1][0])},r=function(e,t){return"ELSE"===e[0]&&"THEN"===p&&a.pop(),this.tokens.splice(","===this.tag(t-1)?t-1:t,0,h)},s=function(e,t){var r,i,s;if(s=a.length,0<s){r=a.pop();var o=n.indentation(e[r]),u=_slicedToArray(o,2);return i=u[1],i[1]=2*s,e.splice(t,0,i),i[1]=2,e.splice(t+1,0,i),n.detectEnd(t+2,function(e){var t;return"OUTDENT"===(t=e[0])||"TERMINATOR"===t},function(t,n){if("OUTDENT"===this.tag(n)&&"OUTDENT"===this.tag(n+1))return e.splice(n,2)}),t+2}return t},this.scanTokens(function(e,n,i){var d=_slicedToArray(e,1),v,m,g,b,w,E;if(E=d[0],v=("->"===E||"=>"===E)&&this.findTagsBackwards(n,["IF","WHILE","FOR","UNTIL","SWITCH","WHEN","LEADING_WHEN","[","INDEX_START"])&&!this.findTagsBackwards(n,["THEN","..","..."]),"TERMINATOR"===E){if("ELSE"===this.tag(n+1)&&"OUTDENT"!==this.tag(n-1))return i.splice.apply(i,[n,1].concat(_toConsumableArray(this.indentation()))),1;if(b=this.tag(n+1),0<=t.call(u,b))return i.splice(n,1),0}if("CATCH"===E)for(m=g=1;2>=g;m=++g)if("OUTDENT"===(w=this.tag(n+m))||"TERMINATOR"===w||"FINALLY"===w)return i.splice.apply(i,[n+m,0].concat(_toConsumableArray(this.indentation()))),2+m;if("->"!==E&&"=>"!==E||!(","===this.tag(n+1)||"."===this.tag(n+1)&&e.newLine)){if(0<=t.call(y,E)&&"INDENT"!==this.tag(n+1)&&("ELSE"!==E||"IF"!==this.tag(n+1))&&!v){p=E;var T=this.indentation(i[n]),N=_slicedToArray(T,2);return f=N[0],h=N[1],"THEN"===p&&(f.fromThen=!0),"THEN"===E&&(c=this.findTagsBackwards(n,["LEADING_WHEN"])&&"IF"===this.tag(n+1),l=this.findTagsBackwards(n,["IF"])&&"IF"===this.tag(n+1)),"THEN"===E&&this.findTagsBackwards(n,["IF"])&&a.push(n),"ELSE"===E&&"OUTDENT"!==this.tag(n-1)&&(n=s(i,n)),i.splice(n+1,0,f),this.detectEnd(n+2,o,r),"THEN"===E&&i.splice(n,1),1}return 1}var S=this.indentation(i[n]),x=_slicedToArray(S,2);return f=x[0],h=x[1],i.splice(n+1,0,f,h),1})}},{key:"tagPostfixConditionals",value:function(){var n,r,i;return i=null,r=function(e,n){var r=_slicedToArray(e,1),i,s;s=r[0];var o=_slicedToArray(this.tokens[n-1],1);return i=o[0],"TERMINATOR"===s||"INDENT"===s&&0>t.call(y,i)},n=function(e){if("INDENT"!==e[0]||e.generated&&!e.fromThen)return i[0]="POST_"+i[0]},this.scanTokens(function(e,t){return"IF"===e[0]?(i=e,this.detectEnd(t+1,r,n),1):1})}},{key:"indentation",value:function(t){var n,r;return n=["INDENT",2],r=["OUTDENT",2],t?(n.generated=r.generated=!0,n.origin=r.origin=t):n.explicit=r.explicit=!0,[n,r]}},{key:"tag",value:function(t){var n;return null==(n=this.tokens[t])?void 0:n[0]}}]),e}();return e.prototype.generate=b,e}.call(this),r=[["(",")"],["[","]"],["{","}"],["INDENT","OUTDENT"],["CALL_START","CALL_END"],["PARAM_START","PARAM_END"],["INDEX_START","INDEX_END"],["STRING_START","STRING_END"],["REGEX_START","REGEX_END"]],e.INVERSES=d={},f=[],a=[],w=0,S=r.length;w<S;w++){var C=_slicedToArray(r[w],2);E=C[0],T=C[1],f.push(d[T]=E),a.push(d[E]=T)}u=["CATCH","THEN","ELSE","FINALLY"].concat(a),h=["IDENTIFIER","PROPERTY","SUPER",")","CALL_END","]","INDEX_END","@","THIS"],l=["IDENTIFIER","CSX_TAG","PROPERTY","NUMBER","INFINITY","NAN","STRING","STRING_START","REGEX","REGEX_START","JS","NEW","PARAM_START","CLASS","IF","TRY","SWITCH","THIS","UNDEFINED","NULL","BOOL","UNARY","YIELD","AWAIT","UNARY_MATH","SUPER","THROW","@","->","=>","[","(","{","--","++"],p=["+","-"],c=["POST_IF","FOR","WHILE","UNTIL","WHEN","BY","LOOP","TERMINATOR"],y=["ELSE","->","=>","TRY","FINALLY","THEN"],g=["TERMINATOR","CATCH","FINALLY","ELSE","OUTDENT","LEADING_WHEN"],v=["TERMINATOR","INDENT","OUTDENT"],i=[".","?.","::","?::"],s=["IF","TRY","FINALLY","CATCH","CLASS","SWITCH"],o=["(",")","[","]","{","}",".","..","...",",","=","++","--","?","AS","AWAIT","CALL_START","CALL_END","DEFAULT","ELSE","EXTENDS","EXPORT","FORIN","FOROF","FORFROM","IMPORT","INDENT","INDEX_SOAK","LEADING_WHEN","OUTDENT","PARAM_END","REGEX_START","REGEX_END","RETURN","STRING_END","THROW","UNARY","YIELD"].concat(p.concat(c.concat(i.concat(s))))}.call(this),{exports:e}.exports}(),require["./lexer"]=function(){var e={};return function(){var t=[].indexOf,n=[].slice,r=require("./rewriter"),i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q,R,U,z,W,X,V,$,J,K,Q,G,Y,Z,et,tt,nt,rt,it,st,ot,ut,at,ft,lt,ct,ht,pt,dt,vt,mt,gt,yt,bt,wt,Et,St,xt;K=r.Rewriter,O=r.INVERSES;var Tt=require("./helpers");dt=Tt.count,St=Tt.starts,pt=Tt.compact,Et=Tt.repeat,vt=Tt.invertLiterate,wt=Tt.merge,ht=Tt.attachCommentsToNode,bt=Tt.locationDataToString,xt=Tt.throwSyntaxError,e.Lexer=B=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"tokenize",value:function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r,i,s,o;for(this.literate=n.literate,this.indent=0,this.baseIndent=0,this.indebt=0,this.outdebt=0,this.indents=[],this.indentLiteral="",this.ends=[],this.tokens=[],this.seenFor=!1,this.seenImport=!1,this.seenExport=!1,this.importSpecifierList=!1,this.exportSpecifierList=!1,this.csxDepth=0,this.csxObjAttribute={},this.chunkLine=n.line||0,this.chunkColumn=n.column||0,t=this.clean(t),s=0;this.chunk=t.slice(s);){r=this.identifierToken()||this.commentToken()||this.whitespaceToken()||this.lineToken()||this.stringToken()||this.numberToken()||this.csxToken()||this.regexToken()||this.jsToken()||this.literalToken();var u=this.getLineAndColumnFromChunk(r),a=_slicedToArray(u,2);if(this.chunkLine=a[0],this.chunkColumn=a[1],s+=r,n.untilBalanced&&0===this.ends.length)return{tokens:this.tokens,index:s}}return this.closeIndentation(),(i=this.ends.pop())&&this.error("missing "+i.tag,(null==(o=i.origin)?i:o)[2]),!1===n.rewrite?this.tokens:(new K).rewrite(this.tokens)}},{key:"clean",value:function(t){return t.charCodeAt(0)===i&&(t=t.slice(1)),t=t.replace(/\r/g,"").replace(st,""),ct.test(t)&&(t="\n"+t,this.chunkLine--),this.literate&&(t=vt(t)),t}},{key:"identifierToken",value:function(){var n,r,i,s,u,c,h,p,d,m,g,y,b,w,E,S,x,T,N,k,L,A,O,M,D,H,B,j;if(h=this.atCSXTag(),D=h?v:C,!(d=D.exec(this.chunk)))return 0;var F=d,I=_slicedToArray(F,3);if(p=I[0],u=I[1],r=I[2],c=u.length,m=void 0,"own"===u&&"FOR"===this.tag())return this.token("OWN",u),u.length;if("from"===u&&"YIELD"===this.tag())return this.token("FROM",u),u.length;if("as"===u&&this.seenImport){if("*"===this.value())this.tokens[this.tokens.length-1][0]="IMPORT_ALL";else if(b=this.value(!0),0<=t.call(l,b)){g=this.prev();var q=["IDENTIFIER",this.value(!0)];g[0]=q[0],g[1]=q[1]}if("DEFAULT"===(w=this.tag())||"IMPORT_ALL"===w||"IDENTIFIER"===w)return this.token("AS",u),u.length}if("as"===u&&this.seenExport){if("IDENTIFIER"===(S=this.tag())||"DEFAULT"===S)return this.token("AS",u),u.length;if(x=this.value(!0),0<=t.call(l,x)){g=this.prev();var R=["IDENTIFIER",this.value(!0)];return g[0]=R[0],g[1]=R[1],this.token("AS",u),u.length}}if("default"!==u||!this.seenExport||"EXPORT"!==(T=this.tag())&&"AS"!==T){if("do"===u&&(M=/^(\s*super)(?!\(\))/.exec(this.chunk.slice(3)))){this.token("SUPER","super"),this.token("CALL_START","("),this.token("CALL_END",")");var U=M,z=_slicedToArray(U,2);return p=z[0],H=z[1],H.length+3}if(g=this.prev(),B=r||null!=g&&("."===(N=g[0])||"?."===N||"::"===N||"?::"===N||!g.spaced&&"@"===g[0])?"PROPERTY":"IDENTIFIER","IDENTIFIER"===B&&(0<=t.call(_,u)||0<=t.call(l,u))&&!(this.exportSpecifierList&&0<=t.call(l,u))?(B=u.toUpperCase(),"WHEN"===B&&(k=this.tag(),0<=t.call(P,k))?B="LEADING_WHEN":"FOR"===B?this.seenFor=!0:"UNLESS"===B?B="IF":"IMPORT"===B?this.seenImport=!0:"EXPORT"===B?this.seenExport=!0:0<=t.call(ot,B)?B="UNARY":0<=t.call($,B)&&("INSTANCEOF"!==B&&this.seenFor?(B="FOR"+B,this.seenFor=!1):(B="RELATION","!"===this.value()&&(m=this.tokens.pop(),u="!"+u)))):"IDENTIFIER"===B&&this.seenFor&&"from"===u&&mt(g)?(B="FORFROM",this.seenFor=!1):"PROPERTY"===B&&g&&(g.spaced&&(L=g[0],0<=t.call(o,L))&&/^[gs]et$/.test(g[1])&&1<this.tokens.length&&"."!==(A=this.tokens[this.tokens.length-2][0])&&"?."!==A&&"@"!==A?this.error("'"+g[1]+"' cannot be used as a keyword, or as a function call without parentheses",g[2]):2<this.tokens.length&&(y=this.tokens[this.tokens.length-2],("@"===(O=g[0])||"THIS"===O)&&y&&y.spaced&&/^[gs]et$/.test(y[1])&&"."!==(E=this.tokens[this.tokens.length-3][0])&&"?."!==E&&"@"!==E&&this.error("'"+y[1]+"' cannot be used as a keyword, or as a function call without parentheses",y[2]))),"IDENTIFIER"===B&&0<=t.call(J,u)&&this.error("reserved word '"+u+"'",{length:u.length}),"PROPERTY"===B||this.exportSpecifierList||(0<=t.call(a,u)&&(n=u,u=f[u]),B=function(){return"!"===u?"UNARY":"=="===u||"!="===u?"COMPARE":"true"===u||"false"===u?"BOOL":"break"===u||"continue"===u||"debugger"===u?"STATEMENT":"&&"===u||"||"===u?u:B}()),j=this.token(B,u,0,c),n&&(j.origin=[B,n,j[2]]),m){var W=[m[2].first_line,m[2].first_column];j[2].first_line=W[0],j[2].first_column=W[1]}return r&&(i=p.lastIndexOf(h?"=":":"),s=this.token(":",":",i,r.length),h&&(s.csxColon=!0)),h&&"IDENTIFIER"===B&&":"!==g[0]&&this.token(",",",",0,0,j),p.length}return this.token("DEFAULT",u),u.length}},{key:"numberToken",value:function(){var t,n,r,i,s,o;if(!(r=q.exec(this.chunk)))return 0;switch(i=r[0],n=i.length,!1){case!/^0[BOX]/.test(i):this.error("radix prefix in '"+i+"' must be lowercase",{offset:1});break;case!/^(?!0x).*E/.test(i):this.error("exponential notation in '"+i+"' must be indicated with a lowercase 'e'",{offset:i.indexOf("E")});break;case!/^0\d*[89]/.test(i):this.error("decimal literal '"+i+"' must not be prefixed with '0'",{length:n});break;case!/^0\d+/.test(i):this.error("octal literal '"+i+"' must be prefixed with '0o'",{length:n})}return t=function(){switch(i.charAt(1)){case"b":return 2;case"o":return 8;case"x":return 16;default:return null}}(),s=null==t?parseFloat(i):parseInt(i.slice(2),t),o=Infinity===s?"INFINITY":"NUMBER",this.token(o,i,0,n),n}},{key:"stringToken",value:function(){var t=this,n=rt.exec(this.chunk)||[],r=_slicedToArray(n,1),i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b;if(v=r[0],!v)return 0;d=this.prev(),d&&"from"===this.value()&&(this.seenImport||this.seenExport)&&(d[0]="FROM"),g=function(){return"'"===v?nt:'"'===v?Z:"'''"===v?S:'"""'===v?w:void 0}(),f=3===v.length;var x=this.matchWithInterpolations(g,v);if(b=x.tokens,a=x.index,i=b.length-1,o=v.charAt(0),f){for(c=null,u=function(){var e,t,n;for(n=[],l=e=0,t=b.length;e<t;l=++e)y=b[l],"NEOSTRING"===y[0]&&n.push(y[1]);return n}().join("#{}");p=E.exec(u);)s=p[1],(null===c||0<(m=s.length)&&m<c.length)&&(c=s);c&&(h=RegExp("\\n"+c,"g")),this.mergeInterpolationTokens(b,{delimiter:o},function(e,n){return e=t.formatString(e,{delimiter:v}),h&&(e=e.replace(h,"\n")),0===n&&(e=e.replace(D,"")),n===i&&(e=e.replace(it,"")),e})}else this.mergeInterpolationTokens(b,{delimiter:o},function(e,n){return e=t.formatString(e,{delimiter:v}),e=e.replace(G,function(t,r){return 0===n&&0===r||n===i&&r+t.length===e.length?"":" "}),e});return this.atCSXTag()&&this.token(",",",",0,0,this.prev),a}},{key:"commentToken",value:function(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.chunk,r,i,s,o,u,a,f,l,h