a.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g)},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment(),f=this;this.tokenizer.getTokens(b,c,function(g){for(var h=b;h<=c;h++){var i=document.createElement("div");i.className="ace_line";var j=i.style;j.height=f.$characterSize.height+"px",j.width=a.width+"px";var k=[];f.$renderLine(k,h,g[h-b].tokens),i.innerHTML=k.join(""),e.appendChild(i)}d(e)})},this.update=function(a){this.$computeTabString(),this.config=a;var b=[],c=this;this.tokenizer.getTokens(a.firstRow,a.lastRow,function(d){for(var e=a.firstRow;e<=a.lastRow;e++)b.push(""),c.$renderLine(b,e,d[e-a.firstRow].tokens),b.push("
");c.element.innerHTML=b.join("")})},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderLine=function(a,b,c){var d=/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g,e=" ";for(var f=0;f",h,"")}}this.$showInvisibles&&(b!==this.doc.getLength()-1?a.push(""+this.EOL_CHAR+""):a.push(""+this.EOF_CHAR+""))}}).call(h.prototype),b.Text=h}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f}),define("ace/mode/javascript",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules,g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f,b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|")),c=e.arrayToMap("null|Infinity|NaN|undefined".split("|")),d=e.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(a){return a=="this"?"variable.language":b[a]?"keyword":c[a]?"constant.language":d[a]?"invalid.illegal":a=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(JavaScriptHighlightRules,g),b.JavaScriptHighlightRules=JavaScriptHighlightRules}),define("ace/mode/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return!1;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h);return h.length-(f-1)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/text",function(a,b,c){var d=a("ace/tokenizer").Tokenizer,e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$tokenizer=new d((new e).getRules())};(function(){this.getTokenizer=function(){return this.$tokenizer},this.toggleCommentLines=function(a,b,c,d){return 0},this.getNextLineIndent=function(a,b,c){return""},this.checkOutdent=function(a,b,c){return!1},this.autoOutdent=function(a,b,c){},this.$getIndent=function(a){var b=a.match(/^(\s+)/);if(b)return b[1];return""}}).call(f.prototype),b.Mode=f}),define("ace/mode/text_highlight_rules",function(a,b,c){var d=function(){this.$rules={start:[{token:"text",regex:".+"}]}};(function(){this.addRules=function(a,b){for(var c in a){var d=a[c];for(var e=0;ew)v.shiftObject();b._dispatchEvent("output",{requests:v,request:this})},x.prototype.doneWithError=function(a){this.error=true,this.done(a)},x.prototype.async=function(){this._begunOutput||this._beginOutput()},x.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this._dispatchEvent("output",{});return this},x.prototype.done=function(a){this.completed=true,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this._dispatchEvent("output",{})},b.Request=x}),define("pilot/catalog",function(a,b,c){var d={};b.addExtensionSpec=function(a){d[a.name]=a},b.removeExtensionSpec=function(a){typeof a==="string"?delete d[a]:delete d[a.name]},b.getExtensionSpec=function(a){return d[a]},b.getExtensionSpecs=function(){return Object.keys(d)}}),define("pilot/commands/basic",function(require,exports,module){var checks=require("pilot/typecheck");var canon=require("pilot/canon");var helpMessages={plainPrefix:"Welcome to Skywriter - Code in the Cloud
",plainSuffix:"For more information, see the Skywriter Wiki."};var helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[];var e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=false;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("Sub-Commands of "+e.name+"
"),d.push(""+e.description+"
")):b.search?(b.search=="hidden"&&(b.search="",f=true),d.push("Commands starting with '"+b.search+"':
")):d.push("Available Commands:
");var g=canon.getCommandNames();g.sort(),d.push("");for(var h=0;h"),d.push("| "+e.name+" | "),d.push(""+e.description+" | "),d.push("")}d.push("
"),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}};var evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:true,exec:function(env,args,request){var result;var javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="";var type="";var x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g,"
").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[];var value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+"