diff --git a/build/ace-uncompressed.js b/build/ace-uncompressed.js
index 0e4e8d73..d0177628 100644
--- a/build/ace-uncompressed.js
+++ b/build/ace-uncompressed.js
@@ -11966,8 +11966,7 @@ var deps = [ "pilot/fixoldbrowsers", "pilot/plugin_manager", "pilot/settings",
require(deps, function() {
var catalog = require("pilot/plugin_manager").catalog;
- catalog.registerPlugins([ "pilot/index" ]).then(function() {
- });
+ catalog.registerPlugins([ "pilot/index" ]);
});
var ace = {
diff --git a/build/ace.js b/build/ace.js
index 91a0b567..e41b52a4 100644
--- a/build/ace.js
+++ b/build/ace.js
@@ -1 +1 @@
-function require(a,b){if(Array.isArray(a)){var c=[];a.forEach(function(a){c.push(require.modules[a])},this),b&&b.apply(null,c)}if(typeof a==="string"){var d=require.modules[a];var e=a;d==null&&console.error("Missing module: "+a);if(typeof d==="function"){var f={};var a={id:"",uri:""};d(require,f,a),d=f,require.modules[e]=d}b&&b();return d}}require.modules={};function define(a,b){typeof a!=="string"?(console.error("dropping module because define wasn't munged."),console.trace()):(console.log("defining module: "+a+" as a "+typeof b),require.modules[a]=b)}define("pilot/canon",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=a("pilot/oop");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i=a("pilot/types").Status;var j=a("pilot/types");var k=a("pilot/lang");var l={name:"command",description:"A command is a bit of functionality with optional typed arguments which can do something small like moving the cursor around the screen, or large like cloning a project from VCS.",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(l)},b.shutdown=function(a,b){h.removeExtensionSpec(l)};var m={name:"thing",description:"thing is an example command",params:[{name:"param1",description:"an example parameter",type:"text",defaultValue:null}],exec:function(a,b,c){thing()}};var n={};var o=[];function p(a){if(!a.name)throw new Error("All registered commands must have a name");a.params==null&&(a.params=[]);if(!Array.isArray(a.params))throw new Error("command.params must be an array in "+a.name);a.params.forEach(function(b){if(!b.name)throw new Error("In "+a.name+": all params must have a name");q(a.name,b)},this),n[a.name]=a,o.push(a.name),o.sort()}function q(a,b){var c=b.type;b.type=j.getType(c);if(b.type==null)throw new Error("In "+a+"/"+b.name+": can't find type for: "+JSON.stringify(c))}function r(a){var b=typeof a==="string"?a:a.name;delete n[b],k.arrayRemove(o,b)}function s(a){return n[a]}function t(){return o}function u(a,b,c,d){typeof a==="string"&&(a=n[a]);if(!a)return false;var e=new x({command:a,args:c,typed:d});a.exec(b,c||{},e);return true}b.removeCommand=r,b.addCommand=p,b.getCommand=s,b.getCommandNames=t,b.exec=u,b.upgradeType=q,f.implement(b,g);var v=[];var w=100;function x(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=false,this.start=new Date,this.end=null,this.completed=false,this.error=false}f.implement(x.prototype,g),x.prototype._beginOutput=function(){this._begunOutput=true,this.outputs=[],v.push(this);while(v.length>w)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+": "+items[x].value+"
"}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):
"+msg)}};var versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:true,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}};var skywriterCommandSpec={name:"skywriter",hidden:true,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}};var messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."];var canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:true,isKeyUp:true},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}};var e={name:"historyNext",predicates:{isCommandLine:true,isKeyUp:true},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push("| "+d+" | "),c.push(""+a.typed+" | "),c.push("
"),d++}),c.push(""),b.done(c.join(""))}};var g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b);var e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=""+c.name+" = "+c.value+"
"})}c.done(d)}};var e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}};var f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){};var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments);var c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(true){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div");var c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c===null||c===undefined||c===""||(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){var d=a("pilot/settings").settings;function e(){return{settings:d}}b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,false);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,false);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return false},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=true},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=false},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function e(a){c(a);return b.stopPropagation(a)}function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function d(a){b(a),a.stopPropagation()}function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,true),document.removeEventListener("mouseup",e,true),a.stopPropagation()}document.addEventListener("mousemove",d,true),document.addEventListener("mouseup",e,true)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0;var i,j;var k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!(!c||!c.length)){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return false}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return true;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return true}if(f(a))return g(a);return true},false),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return true;return g(a)},false)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status!=this.STARTED||(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=-1;var g=0;var h=1;var i=0;var j=false;var k=[];var l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=true,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise;var c=[];var d=0;var e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c);var f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(!skywriter.proxy||!skywriter.proxy.xhr){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(!(g.readyState!==4)){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}else skywriter.proxy.xhr.call(this,a,b,c,e,f);return f},b.Worker=function(a){return!skywriter.proxy||!skywriter.proxy.worker?new Worker(a):new skywriter.proxy.worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end;var d={row:b.row,col:b.col};var e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c);var g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift();var j=b.comparePositions(h.start,i.start);var k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){var d=a("pilot/console");var e=a("pilot/oop");var f=a("pilot/types");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)};function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}j.prototype={get:function(){return this.value},set:function(a){this.value===a||(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g);function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k;function l(){}l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/console");var f=function(){return d.isGecko?"firefox":d.isOpera?"opera":"other"}();function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=b.length-1;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=0;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?true:false}});function l(a){if(typeof a.defer!=="function")throw new Error("Instances of DeferredType need typeSpec.defer to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l;function m(a){if(a instanceof e)this.subtype=a;else if(typeof a==="string"){this.subtype=d.getType(a);if(this.subtype==null)throw new Error("Unknown array subtype: "+a)}else throw new Error("Can' handle array subtype")}m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon");var e=a("pilot/types/basic").SelectionType;var f=a("pilot/types");var g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType;var e=a("pilot/types/basic").DeferredType;var f=a("pilot/types");var g=a("pilot/settings").settings;var h;var i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}});var j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=false;while(true){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=true}c&&a.predictions.push(b)}}return a}});var k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d;function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}b.Conversion=e;function f(){}f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object")if(a instanceof f){if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else throw new Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}else throw new Error("Unknown type: "+a)},b.deregisterType=function(a){delete g[a.name]};function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();var e=navigator.userAgent;var f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+"\u000b1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event_emitter").EventEmitter;var f=function(a,b){this.running=false,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date;var d=c.currentLine;var e=c.textLines;var f=0;var g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=true);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d);var d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("pilot/event_emitter").EventEmitter;var g=a("ace/selection").Selection;var h=a("ace/mode/text").Mode;var i=a("ace/range").Range;var j=function(a,b){this.modified=true,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=true,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=true,this.setUseSoftTabs=function(a){this.$useSoftTabs===a||(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){isNaN(a)||this.$tabSize===a||(this.modified=true,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe;var f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e);var d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a];var d=b.column;var e=b.row;var f=1;var g=this.getLine(e);var h=this.getLength();while(true){while(d=h)break;var g=this.getLine(e);var d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(!(b.length==0)){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=true,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"";var g=e.substring(0,a.column)+d[0];var h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],true),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),true);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=true;var d=a.start.row;var e=a.end.row;var f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,true),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,true),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a);var b=this.$clipRowToDocument(b);var c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;g=h+c)e-=h+c,d+=h+1;else{if(e>h){d+=h;break}d+=e;break}}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event");var f=a("pilot/lang");var g=a("ace/textinput").TextInput;var h=a("ace/keybinding").KeyBinding;var i=a("ace/document").Document;var j=a("ace/search").Search;var k=a("ace/background_tokenizer").BackgroundTokenizer;var l=a("ace/range").Range;var m=a("pilot/event_emitter").EventEmitter;var n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=false,this.$search=(new j).set({wrap:true}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(!(this.doc==a)){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=true,setTimeout(function(){a.$highlightPending=false;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition();var b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange();var b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(!(this.mode==a)){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a);var c=e.getDocumentY(a);var d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this;var g,h;var i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)};var j=function(){clearInterval(l),f.$clickSelection=null};var k=function(){if(!(g===undefined||h===undefined)){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a);var f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString());var h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=false,this.setOverwrite=function(a){this.$overwrite==a||(this.$overwrite=a,this.$blockScrolling=true,this.onCursorChange(),this.$blockScrolling=false,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle==a||(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=true,this.setHighlightActiveLine=function(a){this.$highlightActiveLine==a||(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()==a||this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=false,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow();var b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow();var b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=true,this.moveCursorTo(a-1,b||0),this.$blockScrolling=false,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a);var b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=false),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=true),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/event");var f=a("ace/conf/keybindings/default_mac").bindings;var g=a("ace/conf/keybindings/default_win").bindings;var h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode];var i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()];var j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){this.keyMods={ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},this.keyNames={8:"Backspace",9:"Tab",13:"Enter",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12"};function a(a,b,c,d){return(d&&a.toLowerCase()||a).replace(/(?:^\s+|\n|\s+$)/g,"").split(new RegExp("[\\s ]*"+b+"[\\s ]*","g"),c||999)}function b(b,c,d){var e,f=0,g=a(b,"\\-",null,true),h=0,i=g.length;for(;h",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range;var e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c];var e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row;var g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row;var g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight;var f=Math.round(b.end.column*d.characterWidth);a.push("");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(!(e<0)){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc);var e=d.lineHeight;var f=Math.round((b.end.column-b.start.column)*d.characterWidth);var g=(b.start.row-d.firstRow)*d.lineHeight;var h=Math.round(b.start.column*d.characterWidth);a.push("")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/dom");var f=a("pilot/lang");var g=a("pilot/event_emitter").EventEmitter;var h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div");var c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=false,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+(new Array(Math.floor(b))).join(" ")+this.TAB_CHAR+(new Array(Math.ceil(b)+1)).join(" ")+""}else this.$tabString=(new Array(a+1)).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow);var e=Math.min(c,a.lastRow);var f=this.element.childNodes;var g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){var b=this;this.$computeTabString();var c=this.config;this.config=a;if(!c||c.lastRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g);function f(e){a.firstRowc.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment();var 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=[];var 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:true,rparen:true,lparen:true},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;var 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/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h];var j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return true}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=a.getSelection().getCursor();var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}return{forEach:function(a){var b=d.row;var c=j(b);var g=d.column;var k=false;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=true),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=b?c.end:c.start;var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;return{forEach:function(g){var j=d.row;var k=a.getLine(j).substring(0,d.column);var l=0;var m=false;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead;var b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=false;this.selectionAnchor||(b=true,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=true;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead;var b=a.column;var c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc;var b=a.getTabSize();var c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=b?this.moveCursorTo(a,0):this.moveCursorTo(a,d[0].length)},this.moveCursorLineEnd=function(){this.moveCursorTo(this.selectionLead.row,this.doc.getLine(this.selectionLead.row).length)},this.moveCursorFileEnd=function(){var a=this.doc.getLength()-1;var b=this.doc.getLine(a).length;this.moveCursorTo(a,b)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorWordRight=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=c.substring(b);var e;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==c.length)this.moveCursorRight();else{if(e=this.doc.nonTokenRe.exec(d))b+=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(e=this.doc.tokenRe.exec(d))b+=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorWordLeft=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=e.stringReverse(c.substring(0,b));var f;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==0)this.moveCursorLeft();else{if(f=this.doc.nonTokenRe.exec(d))b-=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(f=this.doc.tokenRe.exec(d))b-=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorBy=function(a,b){this.moveCursorTo(this.selectionLead.row+a,this.selectionLead.column+b)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b){var c=this.$clipPositionToDocument(a,b);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)this.selectionLead=c,this._dispatchEvent("changeCursor",{data:this.getCursor()})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.$clipPositionToDocument=function(a,b){var c={};a>=this.doc.getLength()?(c.row=Math.max(0,this.doc.getLength()-1),c.column=this.doc.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.doc.getLine(c.row).length,Math.max(0,b)));return c},this.$clone=function(a){return{row:a.row,column:a.column}}}).call(h.prototype),b.Selection=h}),define("ace/textinput",function(a,b,c){var d=a("pilot/event");var e=function(a,b){var c=document.createElement("textarea");var e=c.style;e.position="absolute",e.left="-10000px",e.top="-10000px",a.appendChild(c);var f=String.fromCharCode(0);i();var g=false;var h=false;function i(){if(!h){var a=c.value;a&&(a.charCodeAt(a.length-1)==f.charCodeAt(0)?(a=a.slice(0,-1),a&&b.onTextInput(a)):b.onTextInput(a))}h=false,c.value=f,c.select()}var j=function(a){setTimeout(function(){g||i()},0)};var k=function(a){g=true,i(),c.value="",b.onCompositionStart(),setTimeout(l,0)};var l=function(){b.onCompositionUpdate(c.value)};var m=function(){g=false,b.onCompositionEnd(),j()};var n=function(){h=true,c.value=b.getCopyText(),c.select(),h=true,setTimeout(i,0)};var o=function(){h=true,c.value=b.getCopyText(),b.onCut(),c.select(),setTimeout(i,0)};d.addListener(c,"keypress",j),d.addListener(c,"textInput",j),d.addListener(c,"paste",j),d.addListener(c,"propertychange",j),d.addListener(c,"copy",n),d.addListener(c,"cut",o),d.addListener(c,"compositionstart",k),d.addListener(c,"compositionupdate",l),d.addListener(c,"compositionend",m),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),c.select()}),this.focus=function(){b.onFocus(),c.select(),c.focus()},this.blur=function(){c.blur()}};b.TextInput=e}),define("ace/tokenizer",function(a,b,c){var d=function(a){this.rules=a,this.regExps={};for(var b in this.rules){var c=this.rules[b];var d=[];for(var e=0;ea&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)){if(bc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\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/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("ace/mode/text_highlight_rules").TextHighlightRules;var 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/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range;var e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return false;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b);var e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length;var 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/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;var g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f;var 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("|"));var c=e.arrayToMap("null|Infinity|NaN|undefined".split("|"));var 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("text!ace/css/editor.css",".ace_editor { position: absolute; overflow: hidden; font-family: \"Menlo\", \"Monaco\", \"Courier New\", monospace; font-size: 12px; }.ace_scroller { position: absolute; overflow-x: scroll; overflow-y: hidden; }.ace_gutter { position: absolute; overflow-x: hidden; overflow-y: hidden; height: 100%;}.ace_editor .ace_sb { position: absolute; overflow-x: hidden; overflow-y: scroll; right: 0;}.ace_editor .ace_sb div { position: absolute; width: 1px; left: 0px;}.ace_editor .ace_printMargin { position: absolute; height: 100%;}.ace_layer { z-index: 0; position: absolute; overflow: hidden; white-space: nowrap; height: 100%;}.ace_text-layer { font-family: Monaco, \"Courier New\", monospace; color: black;}.ace_cursor-layer { cursor: text;}.ace_cursor { z-index: 3; position: absolute;}.ace_line { white-space: nowrap;}.ace_marker-layer {}.ace_marker-layer .ace_step { position: absolute; z-index: 2;}.ace_marker-layer .ace_selection { position: absolute; z-index: 3;}.ace_marker-layer .ace_bracket { position: absolute; z-index: 4;}.ace_marker-layer .ace_active_line { position: absolute; z-index: 1;}"),define("text!ace/theme/tm.css",".ace-tm .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tm .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tm .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tm .ace_gutter-layer { width: 100%; text-align: right;}.ace-tm .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tm .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-tm .ace_text-layer { cursor: text;}.ace-tm .ace_cursor { border-left: 2px solid black;}.ace-tm .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid black;} .ace-tm .ace_line .ace_invisible { color: rgb(191, 191, 191);}.ace-tm .ace_line .ace_keyword { color: blue;}.ace-tm .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-tm .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246);}.ace-tm .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_invalid { background-color: rgb(153, 0, 0); color: white;}.ace-tm .ace_line .ace_support.ace_function { color: rgb(60, 76, 114);}.ace-tm .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_support.ace_type,.ace-tm .ace_line .ace_support.ace_class { color: rgb(109, 121, 222);}.ace-tm .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135);}.ace-tm .ace_line .ace_string { color: rgb(3, 106, 7);}.ace-tm .ace_line .ace_comment { color: rgb(76, 136, 107);}.ace-tm .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255);}.ace-tm .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191);}.ace-tm .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205);}.ace-tm .ace_line .ace_variable { color: rgb(49, 132, 149);}.ace-tm .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-tm .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-tm .ace_marker-layer .ace_step { background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack { background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}.ace-tm .ace_string.ace_regex { color: rgb(255, 0, 0) }");var deps=["pilot/fixoldbrowsers","pilot/plugin_manager","pilot/settings","pilot/environment","demo_startup"];require(deps,function(){var a=require("pilot/plugin_manager").catalog;a.registerPlugins(["pilot/index"]).then(function(){})});var ace={edit:function(a){typeof a=="string"&&(a=document.getElementById(a));var b=require("pilot/environment").create();var c=require("pilot/plugin_manager").catalog;c.startupPlugins({env:b}).then(function(){var c=require("ace/document").Document;var d=require("ace/mode/javascript").Mode;var e=require("ace/undomanager").UndoManager;var f=require("ace/editor").Editor;var g=require("ace/virtual_renderer").VirtualRenderer;var h=require("ace/theme/textmate");var i=new c(a.innerHTML);a.innerHTML="",i.setMode(new d),i.setUndoManager(new e),b.editor=new f(new g(a,h)),b.editor.setDocument(i),b.editor.resize(),window.addEventListener("resize",function(){b.editor.resize()},false)})}}
\ No newline at end of file
+function require(a,b){if(Array.isArray(a)){var c=[];a.forEach(function(a){c.push(require.modules[a])},this),b&&b.apply(null,c)}if(typeof a==="string"){var d=require.modules[a];var e=a;d==null&&console.error("Missing module: "+a);if(typeof d==="function"){var f={};var a={id:"",uri:""};d(require,f,a),d=f,require.modules[e]=d}b&&b();return d}}require.modules={};function define(a,b){typeof a!=="string"?(console.error("dropping module because define wasn't munged."),console.trace()):(console.log("defining module: "+a+" as a "+typeof b),require.modules[a]=b)}define("pilot/canon",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=a("pilot/oop");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i=a("pilot/types").Status;var j=a("pilot/types");var k=a("pilot/lang");var l={name:"command",description:"A command is a bit of functionality with optional typed arguments which can do something small like moving the cursor around the screen, or large like cloning a project from VCS.",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(l)},b.shutdown=function(a,b){h.removeExtensionSpec(l)};var m={name:"thing",description:"thing is an example command",params:[{name:"param1",description:"an example parameter",type:"text",defaultValue:null}],exec:function(a,b,c){thing()}};var n={};var o=[];function p(a){if(!a.name)throw new Error("All registered commands must have a name");a.params==null&&(a.params=[]);if(!Array.isArray(a.params))throw new Error("command.params must be an array in "+a.name);a.params.forEach(function(b){if(!b.name)throw new Error("In "+a.name+": all params must have a name");q(a.name,b)},this),n[a.name]=a,o.push(a.name),o.sort()}function q(a,b){var c=b.type;b.type=j.getType(c);if(b.type==null)throw new Error("In "+a+"/"+b.name+": can't find type for: "+JSON.stringify(c))}function r(a){var b=typeof a==="string"?a:a.name;delete n[b],k.arrayRemove(o,b)}function s(a){return n[a]}function t(){return o}function u(a,b,c,d){typeof a==="string"&&(a=n[a]);if(!a)return false;var e=new x({command:a,args:c,typed:d});a.exec(b,c||{},e);return true}b.removeCommand=r,b.addCommand=p,b.getCommand=s,b.getCommandNames=t,b.exec=u,b.upgradeType=q,f.implement(b,g);var v=[];var w=100;function x(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=false,this.start=new Date,this.end=null,this.completed=false,this.error=false}f.implement(x.prototype,g),x.prototype._beginOutput=function(){this._begunOutput=true,this.outputs=[],v.push(this);while(v.length>w)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+": "+items[x].value+"
"}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):
"+msg)}};var versionCommandSpec={name:"version",description:"show the Skywriter version",hidden:true,exec:function(a,b,c){var d="Skywriter "+skywriter.versionNumber+" ("+skywriter.versionCodename+")";c.done(d)}};var skywriterCommandSpec={name:"skywriter",hidden:true,exec:function(a,b,c){var d=Math.floor(Math.random()*messages.length);c.done("Skywriter "+messages[d])}};var messages=["really wants you to trick it out in some way.","is your Web editor.","would love to be like Emacs on the Web.","is written on the Web platform, so you can tweak it."];var canon=require("pilot/canon");exports.startup=function(a,b){canon.addCommand(helpCommandSpec),canon.addCommand(evalCommandSpec),canon.addCommand(skywriterCommandSpec)},exports.shutdown=function(a,b){canon.removeCommand(helpCommandSpec),canon.removeCommand(evalCommandSpec),canon.removeCommand(skywriterCommandSpec)}}),define("pilot/commands/history",function(a,b,c){var d={name:"historyPrevious",predicates:{isCommandLine:true,isKeyUp:true},key:"up",exec:function(a,b){g>0&&g--;var c=history.requests[g].typed;env.commandLine.setInput(c)}};var e={name:"historyNext",predicates:{isCommandLine:true,isKeyUp:true},key:"down",exec:function(a,b){g");var d=1;history.requests.forEach(function(a){c.push(""),c.push("| "+d+" | "),c.push(""+a.typed+" | "),c.push("
"),d++}),c.push(""),b.done(c.join(""))}};var g=0;b.addedRequestOutput=function(){g=history.requests.length}}),define("pilot/commands/settings",function(a,b,c){var d={name:"set",params:[{name:"setting",type:"setting",description:"The name of the setting to display or alter",defaultValue:null},{name:"value",type:"settingValue",description:"The new value for the chosen setting",defaultValue:null}],description:"define and show settings",exec:function(a,b,c){var d;if(b.setting)b.value===undefined?d=""+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b);var e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=""+c.name+" = "+c.value+"
"})}c.done(d)}};var e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}};var f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/console",function(a,b,c){var d=function(){};var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments);var c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/dom",function(a,b,c){b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);while(true){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.importCssString=function(a,b){b=b||document;if(b.createStyleSheet){var c=b.createStyleSheet();c.cssText=a}else{var d=b.createElement("style");d.appendChild(b.createTextNode(a)),b.getElementsByTagName("head")[0].appendChild(d)}},b.getInnerWidth=function(a){return parseInt(b.computedStyle(a,"paddingLeft"))+parseInt(b.computedStyle(a,"paddingRight"))+a.clientWidth},b.getInnerHeight=function(a){return parseInt(b.computedStyle(a,"paddingTop"))+parseInt(b.computedStyle(a,"paddingBottom"))+a.clientHeight},b.computedStyle=function(a,b){return window.getComputedStyle?(window.getComputedStyle(a,"")||{})[b]||"":a.currentStyle[b]},b.scrollbarWidth=function(){var a=document.createElement("p");a.style.width="100%",a.style.height="200px";var b=document.createElement("div");var c=b.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.height="150px",b.appendChild(a),document.body.appendChild(b);var d=a.offsetWidth;c.overflow="scroll";var e=a.offsetWidth;d==e&&(e=b.clientWidth),document.body.removeChild(b);return d-e}}),define("pilot/domtemplate",function(require,exports,module){function Templater(){this.scope=[]}Templater.prototype.processNode=function(a,b){typeof a==="string"&&(a=document.getElementById(a));if(b===null||b===undefined)b={};this.scope.push(a.nodeName+(a.id?"#"+a.id:""));try{if(a.attributes&&a.attributes.length){if(a.hasAttribute("foreach")){this.processForEach(a,b);return}if(a.hasAttribute("if"))if(!this.processIf(a,b))return;b.__element=a;var c=Array.prototype.slice.call(a.attributes);for(var d=0;d1&&(d.forEach(function(c){c===null||c===undefined||c===""||(c.charAt(0)==="$"&&(c=this.envEval(c.slice(1),b,a.data)),c===null&&(c="null"),c===undefined&&(c="undefined"),typeof c.cloneNode!=="function"&&(c=a.ownerDocument.createTextNode(c.toString())),a.parentNode.insertBefore(c,a))},this),a.parentNode.removeChild(a))},Templater.prototype.stripBraces=function(a){if(!a.match(/\$\{.*\}/g)){this.handleError("Expected "+a+" to match ${...}");return a}return a.slice(2,-1)},Templater.prototype.property=function(a,b,c){this.scope.push(a);try{typeof a==="string"&&(a=a.split("."));var d=b[a[0]];if(a.length===1){c!==undefined&&(b[a[0]]=c);if(typeof d==="function")return function(){return d.apply(b,arguments)};return d}if(!d){this.handleError("Can't find path="+a);return null}return this.property(a.slice(1),d,c)}finally{this.scope.pop()}},Templater.prototype.envEval=function(script,env,context){with(env)try{this.scope.push(context);return eval(script)}catch(ex){this.handleError("Template error evaluating '"+script+"'",ex);return script}finally{this.scope.pop()}},Templater.prototype.handleError=function(a,b){this.logError(a),this.logError("In: "+this.scope.join(" > ")),b&&this.logError(b)},Templater.prototype.logError=function(a){console.log(a)},exports.Templater=Templater}),define("pilot/environment",function(a,b,c){var d=a("pilot/settings").settings;function e(){return{settings:d}}b.create=e}),define("pilot/event",function(a,b,c){var d=a("pilot/useragent");b.addListener=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,false);if(a.attachEvent){var d=function(){c(window.event)};c._wrapper=d,a.attachEvent("on"+b,d)}},b.removeListener=function(a,b,c){if(a.removeEventListener)return a.removeEventListener(b,c,false);a.detachEvent&&a.detachEvent("on"+b,c._wrapper||c)},b.stopEvent=function(a){b.stopPropagation(a),b.preventDefault(a);return false},b.stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=true},b.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=false},b.getDocumentX=function(a){if(a.clientX){var b=document.documentElement.scrollLeft||document.body.scrollLeft;return a.clientX+b}return a.pageX},b.getDocumentY=function(a){if(a.clientY){var b=document.documentElement.scrollTop||document.body.scrollTop;return a.clientY+b}return a.pageX},b.getButton=function(a){return a.preventDefault?a.button:Math.max(a.button-1,2)},document.documentElement.setCapture?b.capture=function(a,c,d){function e(a){c(a);return b.stopPropagation(a)}function f(e){c&&c(e),d&&d(),b.removeListener(a,"mousemove",c),b.removeListener(a,"mouseup",f),b.removeListener(a,"losecapture",f),a.releaseCapture()}b.addListener(a,"mousemove",c),b.addListener(a,"mouseup",f),b.addListener(a,"losecapture",f),a.setCapture()}:b.capture=function(a,b,c){function d(a){b(a),a.stopPropagation()}function e(a){b&&b(a),c&&c(),document.removeEventListener("mousemove",d,true),document.removeEventListener("mouseup",e,true),a.stopPropagation()}document.addEventListener("mousemove",d,true),document.addEventListener("mouseup",e,true)},b.addMouseWheelListener=function(a,c){var d=function(a){a.wheelDelta!==undefined?a.wheelDeltaX!==undefined?(a.wheelX=-a.wheelDeltaX/8,a.wheelY=-a.wheelDeltaY/8):(a.wheelX=0,a.wheelY=-a.wheelDelta/8):a.axis&&a.axis==a.HORIZONTAL_AXIS?(a.wheelX=(a.detail||0)*5,a.wheelY=0):(a.wheelX=0,a.wheelY=(a.detail||0)*5),c(a)};b.addListener(a,"DOMMouseScroll",d),b.addListener(a,"mousewheel",d)},b.addMultiMouseDownListener=function(a,c,e,f,g){var h=0;var i,j;var k=function(a){h+=1,h==1&&(i=a.clientX,j=a.clientY,setTimeout(function(){h=0},f||600));if(b.getButton(a)!=c||Math.abs(a.clientX-i)>5||Math.abs(a.clientY-j)>5)h=0;h==e&&(h=0,g(a));return b.preventDefault(a)};b.addListener(a,"mousedown",k),d.isIE&&b.addListener(a,"dblclick",k)},b.addKeyListener=function(a,c){var e=null;b.addListener(a,"keydown",function(a){e=a.keyIdentifier||a.keyCode;return c(a)}),d.isMac&&(d.isGecko||d.isOpera)&&b.addListener(a,"keypress",function(a){var b=a.keyIdentifier||a.keyCode;if(e!==b)return c(a);e=null})}}),define("pilot/event_emitter",function(a,b,c){var d={};d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(!(!c||!c.length)){var b=b||{};b.type=a;for(var d=0;d>>0;if(c===0)return-1;var d=0;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;var e=d>=0?d:Math.max(c-Math.abs(d),0);for(;e>>0;if(typeof a!=="function")throw new TypeError;var d=arguments[1];for(var e=0;e47&&d<58&&(j=a.altKey));if(f)a.altKey&&(h+="alt_"),a.ctrlKey&&(h+="ctrl_"),a.metaKey&&(h+="meta_");else if(a.ctrlKey||a.metaKey)return false}f||(d=a.which,g=f=String.fromCharCode(d),i=f.toLowerCase(),a.metaKey?(h="meta_",f=i):f=null),a.shiftKey&&f&&j&&(h+="shift_"),f&&(f=h+f),!c&&f&&(f=f.replace(/ctrl_meta|meta/,"ctrl"));return[f,g]},b.addKeyDownListener=function(a,c){var g=function(a){var b=c(a);b&&d.stopEvent(a);return b};a.addEventListener("keydown",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return true;if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS[a.keyCode])return true}if(f(a))return g(a);return true},false),a.addEventListener("keypress",function(a){if(e.isGecko){if(b.KeyHelper.FUNCTION_KEYS[a.keyCode])return g(a);if((a.ctrlKey||a.metaKey)&&b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode]){a._keyCode=b.KeyHelper.PRINTABLE_KEYS_CHARCODE[a.charCode],a._charCode=0;return g(a)}}if(a.charCode!==undefined&&a.charCode===0)return true;return g(a)},false)}}),define("pilot/lang",function(a,b,c){b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.arrayToMap=function(a){var b={};for(var c=0;cthis.NEW){e.resolve(this);return e}a([this.name],function(a){a.install&&a.install(b,c),this.status=this.INSTALLED,e.resolve(this)}.bind(this));return e},register:function(b,c){var e=new d;if(this.status!=this.INSTALLED){e.resolve(this);return e}a([this.name],function(a){a.register&&a.register(b,c),this.status=this.REGISTERED,e.resolve(this)}.bind(this));return e},startup:function(c,e){e=e||b.REASONS.APP_STARTUP;var f=new d;if(this.status!=this.REGISTERED){f.resolve(this);return f}a([this.name],function(a){a.startup&&a.startup(c,e),this.status=this.STARTED,f.resolve(this)}.bind(this));return f},shutdown:function(b,c){this.status!=this.STARTED||(pluginModule=a(this.name),pluginModule.shutdown&&pluginModule.shutdown(b,c))}},b.PluginCatalog=function(){this.plugins={}},b.PluginCatalog.prototype={registerPlugins:function(a,c,e){var f=[];a.forEach(function(a){var d=this.plugins[a];d===undefined&&(d=new b.Plugin(a),this.plugins[a]=d,f.push(d.register(c,e)))}.bind(this));return d.group(f)},startupPlugins:function(a,b){var c=[];for(var e in this.plugins){var f=this.plugins[e];c.push(f.startup(a,b))}return d.group(c)}},b.catalog=new b.PluginCatalog}),define("pilot/promise",function(a,b,c){var d=a("pilot/console");var e=a("pilot/stacktrace").Trace;var f=-1;var g=0;var h=1;var i=0;var j=false;var k=[];var l=[];Promise=function(){this._status=g,this._value=undefined,this._onSuccessHandlers=[],this._onErrorHandlers=[],this._id=i++,k[this._id]=this},Promise.prototype.isPromise=true,Promise.prototype.isComplete=function(){return this._status!=g},Promise.prototype.isResolved=function(){return this._status==h},Promise.prototype.isRejected=function(){return this._status==f},Promise.prototype.then=function(a,b){typeof a==="function"&&(this._status===h?a.call(null,this._value):this._status===g&&this._onSuccessHandlers.push(a)),typeof b==="function"&&(this._status===f?b.call(null,this._value):this._status===g&&this._onErrorHandlers.push(b));return this},Promise.prototype.chainPromise=function(a){var b=new Promise;b._chainedFrom=this,this.then(function(c){try{b.resolve(a(c))}catch(d){b.reject(d)}},function(a){b.reject(a)});return b},Promise.prototype.resolve=function(a){return this._complete(this._onSuccessHandlers,h,a,"resolve")},Promise.prototype.reject=function(a){return this._complete(this._onErrorHandlers,f,a,"reject")},Promise.prototype._complete=function(a,b,c,f){if(this._status!=g){d.group("Promise already closed"),d.error("Attempted "+f+"() with ",c),d.error("Previous status = ",this._status,", previous value = ",this._value),d.trace(),this._completeTrace&&(d.error("Trace of previous completion:"),this._completeTrace.log(5)),d.groupEnd();return this}j&&(this._completeTrace=new e(new Error)),this._status=b,this._value=c,a.forEach(function(a){a.call(null,this._value)},this),this._onSuccessHandlers.length=0,this._onErrorHandlers.length=0,delete k[this._id],l.push(this);while(l.length>20)l.shift();return this},Promise.group=function(a){a instanceof Array||(a=Array.prototype.slice.call(arguments));if(a.length===0)return(new Promise).resolve([]);var b=new Promise;var c=[];var d=0;var e=function(e){return function(g){c[e]=g,d++,b._status!==f&&(d===a.length&&b.resolve(c))}};a.forEach(function(a,c){var d=e(c);var f=b.reject.bind(b);a.then(d,f)});return b},b.Promise=Promise,b._outstanding=k,b._recent=l}),define("pilot/proxy",function(a,b,c){var d=a("pilot/promise").Promise;b.xhr=function(a,b,c,e){var f=new d;if(!skywriter.proxy||!skywriter.proxy.xhr){var g=new XMLHttpRequest;g.onreadystatechange=function(){if(!(g.readyState!==4)){var a=g.status;if(a!==0&&a!==200){var b=new Error(g.responseText+" (Status "+g.status+")");b.xhr=g,f.reject(b);return}f.resolve(g.responseText)}}.bind(this),g.open("GET",b,c),e&&e(g),g.send()}else skywriter.proxy.xhr.call(this,a,b,c,e,f);return f},b.Worker=function(a){return!skywriter.proxy||!skywriter.proxy.worker?new Worker(a):new skywriter.proxy.worker(a)}}),define("pilot/rangeutils",function(a,b,c){var d=a("util/util");b.addPositions=function(a,b){return{row:a.row+b.row,col:a.col+b.col}},b.cloneRange=function(a){var b=a.start,c=a.end;var d={row:b.row,col:b.col};var e={row:c.row,col:c.col};return{start:d,end:e}},b.comparePositions=function(a,b){var c=a.row-b.row;return c===0?a.col-b.col:c},b.equal=function(a,c){return b.comparePositions(a.start,c.start)===0&&b.comparePositions(a.end,c.end)===0},b.extendRange=function(a,b){var c=a.end;return{start:a.start,end:{row:c.row+b.row,col:c.col+b.col}}},b.intersectRangeSets=function(a,c){var e=d.clone(a),f=d.clone(c);var g=[];while(e.length>0&&f.length>0){var h=e.shift(),i=f.shift();var j=b.comparePositions(h.start,i.start);var k=b.comparePositions(h.end,i.end);b.comparePositions(h.end,i.start)<0?(g.push(h),f.unshift(i)):b.comparePositions(i.end,h.start)<0?(g.push(i),e.unshift(h)):j<0?(g.push({start:h.start,end:i.start}),e.unshift({start:i.start,end:h.end}),f.unshift(i)):j===0?k<0?f.unshift({start:h.end,end:i.end}):k>0&&e.unshift({start:i.end,end:h.end}):j>0&&(g.push({start:i.start,end:h.start}),e.unshift(h),f.unshift({start:h.start,end:i.end}))}return g.concat(e,f)},b.isZeroLength=function(a){return a.start.row===a.end.row&&a.start.col===a.end.col},b.maxPosition=function(a,c){return b.comparePositions(a,c)>0?a:c},b.normalizeRange=function(a){return this.comparePositions(a.start,a.end)<0?a:{start:a.end,end:a.start}},b.rangeSetBoundaries=function(a){return{start:a[0].start,end:a[a.length-1].end}},b.toString=function(a){var b=a.start,c=a.end;return"[ "+b.row+", "+b.col+" "+c.row+","+ +c.col+" ]"},b.unionRanges=function(a,b){return{start:a.start.rowb.end.row||a.end.row===b.end.row&&a.end.col>b.end.col?a.end:b.end}},b.isPosition=function(a){return!d.none(a)&&!d.none(a.row)&&!d.none(a.col)},b.isRange=function(a){return!d.none(a)&&b.isPosition(a.start)&&b.isPosition(a.end)}}),define("pilot/settings/canon",function(a,b,c){var d={name:"historyLength",description:"How many typed commands do we recall for reference?",type:"number",defaultValue:50};b.startup=function(a,b){a.env.settings.addSetting(d)},b.shutdown=function(a,b){a.env.settings.removeSetting(d)}}),define("pilot/settings",function(a,b,c){var d=a("pilot/console");var e=a("pilot/oop");var f=a("pilot/types");var g=a("pilot/event_emitter").EventEmitter;var h=a("pilot/catalog");var i={name:"setting",description:"A setting is something that the application offers as a way to customize how it works",register:"env.settings.addSetting",indexOn:"name"};b.startup=function(a,b){h.addExtensionSpec(i)},b.shutdown=function(a,b){h.removeExtensionSpec(i)};function j(a,b){this._settings=b,Object.keys(a).forEach(function(b){this[b]=a[b]},this),this.type=f.getType(this.type);if(this.type==null)throw new Error("In "+this.name+": can't find type for: "+JSON.stringify(a.type));if(!this.name)throw new Error("Setting.name == undefined. Ignoring.",this);if(!this.defaultValue===undefined)throw new Error("Setting.defaultValue == undefined",this);this.value=this.defaultValue}j.prototype={get:function(){return this.value},set:function(a){this.value===a||(this.value=a,this._settings.persister&&this._settings.persister.persistValue(this._settings,this.name,a),this._dispatchEvent("change",{setting:this,value:a}))},resetValue:function(){this.set(this.defaultValue)}},e.implement(j.prototype,g);function k(a){this._deactivated={},this._settings={},this._settingNames=[],a&&this.setPersister(a)}k.prototype={addSetting:function(a){var b=new j(a,this);this._settings[b.name]=b,this._settingNames.push(b.name),this._settingNames.sort()},removeSetting:function(a){var b=typeof a==="string"?a:a.name;delete this._settings[b],util.arrayRemove(this._settingNames,b)},getSettingNames:function(){return this._settingNames},getSetting:function(a){return this._settings[a]},setPersister:function(a){this._persister=a,a&&a.loadInitialValues(this)},resetAll:function(){this.getSettingNames().forEach(function(a){this.resetValue(a)},this)},_list:function(){var a=[];this.getSettingNames().forEach(function(b){a.push({key:b,value:this.getSetting(b).get()})},this);return a},_loadDefaultValues:function(){this._loadFromObject(this._getDefaultValues())},_loadFromObject:function(a){for(var b in a)if(a.hasOwnProperty(b)){var c=this._settings[b];if(c){var d=c.type.parse(a[b]);this.set(b,d)}else this.set(b,a[b])}},_saveToObject:function(){return this.getSettingNames().map(function(a){return this._settings[a].type.stringify(this.get(a))}.bind(this))},_getDefaultValues:function(){return this.getSettingNames().map(function(a){return this._settings[a].spec.defaultValue}.bind(this))}},b.settings=new k;function l(){}l.prototype={loadInitialValues:function(a){a._loadDefaultValues();var b=cookie.get("settings");a._loadFromObject(JSON.parse(b))},persistValue:function(a,b,c){try{var e=JSON.stringify(a._saveToObject());cookie.set("settings",e)}catch(f){d.error("Unable to JSONify the settings! "+f);return}}},b.CookiePersister=l}),define("pilot/stacktrace",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/console");var f=function(){return d.isGecko?"firefox":d.isOpera?"opera":"other"}();function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=b.length-1;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data;var c;if(a==null)c=0;else{var d=this.stringify(a);var c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?true:false}});function l(a){if(typeof a.defer!=="function")throw new Error("Instances of DeferredType need typeSpec.defer to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l;function m(a){if(a instanceof e)this.subtype=a;else if(typeof a==="string"){this.subtype=d.getType(a);if(this.subtype==null)throw new Error("Unknown array subtype: "+a)}else throw new Error("Can' handle array subtype")}m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array",b.startup=function(){d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m)},b.shutdown=function(){d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types/command",function(a,b,c){var d=a("pilot/canon");var e=a("pilot/types/basic").SelectionType;var f=a("pilot/types");var g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/types/settings",function(a,b,c){var d=a("pilot/types/basic").SelectionType;var e=a("pilot/types/basic").DeferredType;var f=a("pilot/types");var g=a("pilot/settings").settings;var h;var i=new d({name:"setting",data:function(){return k.settings.getSettingNames()},stringify:function(a){h=a;return a.name},fromString:function(a){h=g.getSetting(a);return h},noMatch:function(){h=null}});var j=new e({name:"settingValue",defer:function(){return h?h.type:f.getType("text")},getDefault:function(){var a=this.parse("");if(h){var b=h.get();if(a.predictions.length===0)a.predictions.push(b);else{var c=false;while(true){var d=a.predictions.indexOf(b);if(d===-1)break;a.predictions.splice(d,1),c=true}c&&a.predictions.push(b)}}return a}});var k;b.startup=function(a,b){k=a.env,f.registerType(i),f.registerType(j)},b.shutdown=function(a,b){f.unregisterType(i),f.unregisterType(j)}}),define("pilot/types",function(a,b,c){var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb&&(b=arguments[c]);return b}};b.Status=d;function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}b.Conversion=e;function f(){}f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object")if(a instanceof f){if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else throw new Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}else throw new Error("Unknown type: "+a)},b.deregisterType=function(a){delete g[a.name]};function h(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}b.getType=function(a){if(typeof a==="string")return h(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return h(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/useragent",function(a,b,c){var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();var e=navigator.userAgent;var f=navigator.appVersion;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=!+"\u000b1",b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/background_tokenizer",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event_emitter").EventEmitter;var f=function(a,b){this.running=false,this.textLines=[],this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(c.running){var a=new Date;var d=c.currentLine;var e=c.textLines;var f=0;var g=b.getLastVisibleRow();while(c.currentLine20){c.fireUpdateEvent(d,c.currentLine-1);var h=c.currentLine0&&this.lines[a-1]&&(d=this.lines[a-1].state,e=true);for(var f=a;f<=b;f++)if(this.lines[f]){var g=this.lines[f];d=g.state,c.push(g)}else{var g=this.tokenizer.getLineTokens(this.textLines[f]||"",d);var d=g.state;c.push(g),e&&(this.lines[f]=g)}return c}}).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/commands/default_commands",function(a,b,c){var d=a("pilot/canon");d.addCommand({name:"selectall",exec:function(a,b,c){a.editor.getSelection().selectAll()}}),d.addCommand({name:"removeline",exec:function(a,b,c){a.editor.removeLines()}}),d.addCommand({name:"gotoline",exec:function(a,b,c){var d=parseInt(prompt("Enter line number:"));isNaN(d)||a.editor.gotoLine(d)}}),d.addCommand({name:"togglecomment",exec:function(a,b,c){a.editor.toggleCommentLines()}}),d.addCommand({name:"findnext",exec:function(a,b,c){a.editor.findNext()}}),d.addCommand({name:"findprevious",exec:function(a,b,c){a.editor.findPrevious()}}),d.addCommand({name:"find",exec:function(a,b,c){var d=prompt("Find:");a.editor.find(d)}}),d.addCommand({name:"undo",exec:function(a,b,c){a.editor.undo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"redo",exec:function(a,b,c){a.editor.redo()}}),d.addCommand({name:"overwrite",exec:function(a,b,c){a.editor.toggleOverwrite()}}),d.addCommand({name:"copylinesup",exec:function(a,b,c){a.editor.copyLinesUp()}}),d.addCommand({name:"movelinesup",exec:function(a,b,c){a.editor.moveLinesUp()}}),d.addCommand({name:"selecttostart",exec:function(a,b,c){a.editor.getSelection().selectFileStart()}}),d.addCommand({name:"gotostart",exec:function(a,b,c){a.editor.navigateFileStart()}}),d.addCommand({name:"selectup",exec:function(a,b,c){a.editor.getSelection().selectUp()}}),d.addCommand({name:"golineup",exec:function(a,b,c){a.editor.navigateUp()}}),d.addCommand({name:"copylinesdown",exec:function(a,b,c){a.editor.copyLinesDown()}}),d.addCommand({name:"movelinesdown",exec:function(a,b,c){a.editor.moveLinesDown()}}),d.addCommand({name:"selecttoend",exec:function(a,b,c){a.editor.getSelection().selectFileEnd()}}),d.addCommand({name:"gotoend",exec:function(a,b,c){a.editor.navigateFileEnd()}}),d.addCommand({name:"selectdown",exec:function(a,b,c){a.editor.getSelection().selectDown()}}),d.addCommand({name:"godown",exec:function(a,b,c){a.editor.navigateDown()}}),d.addCommand({name:"selectwordleft",exec:function(a,b,c){a.editor.getSelection().selectWordLeft()}}),d.addCommand({name:"gotowordleft",exec:function(a,b,c){a.editor.navigateWordLeft()}}),d.addCommand({name:"selecttolinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectleft",exec:function(a,b,c){a.editor.getSelection().selectLeft()}}),d.addCommand({name:"gotoleft",exec:function(a,b,c){a.editor.navigateLeft()}}),d.addCommand({name:"selectwordright",exec:function(a,b,c){a.editor.getSelection().selectWordRight()}}),d.addCommand({name:"gotowordright",exec:function(a,b,c){a.editor.navigateWordRight()}}),d.addCommand({name:"selecttolineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"selectright",exec:function(a,b,c){a.editor.getSelection().selectRight()}}),d.addCommand({name:"gotoright",exec:function(a,b,c){a.editor.navigateRight()}}),d.addCommand({name:"selectpagedown",exec:function(a,b,c){a.editor.selectPageDown()}}),d.addCommand({name:"pagedown",exec:function(a,b,c){a.editor.scrollPageDown()}}),d.addCommand({name:"gotopagedown",exec:function(a,b,c){a.editor.gotoPageDown()}}),d.addCommand({name:"selectpageup",exec:function(a,b,c){a.editor.selectPageUp()}}),d.addCommand({name:"pageup",exec:function(a,b,c){a.editor.scrollPageUp()}}),d.addCommand({name:"gotopageup",exec:function(a,b,c){a.editor.gotoPageUp()}}),d.addCommand({name:"selectlinestart",exec:function(a,b,c){a.editor.getSelection().selectLineStart()}}),d.addCommand({name:"gotolinestart",exec:function(a,b,c){a.editor.navigateLineStart()}}),d.addCommand({name:"selectlineend",exec:function(a,b,c){a.editor.getSelection().selectLineEnd()}}),d.addCommand({name:"gotolineend",exec:function(a,b,c){a.editor.navigateLineEnd()}}),d.addCommand({name:"del",exec:function(a,b,c){a.editor.removeRight()}}),d.addCommand({name:"backspace",exec:function(a,b,c){a.editor.removeLeft()}}),d.addCommand({name:"outdent",exec:function(a,b,c){a.editor.blockOutdent()}}),d.addCommand({name:"indent",exec:function(a,b,c){a.editor.indent()}})}),define("ace/conf/keybindings/default_mac",function(a,b,c){b.bindings={selectall:"Command-A",removeline:"Command-D",gotoline:"Command-L",togglecomment:"Command-7",findnext:"Command-K",findprevious:"Command-Shift-K",find:"Command-F",replace:"Command-R",undo:"Command-Z",redo:"Command-Shift-Z|Command-Y",overwrite:"Insert",copylinesup:"Command-Option-Up",movelinesup:"Option-Up",selecttostart:"Command-Shift-Up",gotostart:"Command-Home|Command-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Command-Option-Down",movelinesdown:"Option-Down",selecttoend:"Command-Shift-Down",gotoend:"Command-End|Command-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Option-Shift-Left",gotowordleft:"Option-Left",selecttolinestart:"Command-Shift-Left",gotolinestart:"Command-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Option-Shift-Right",gotowordright:"Option-Right",selecttolineend:"Command-Shift-Right",gotolineend:"Command-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/conf/keybindings/default_win",function(a,b,c){b.bindings={selectall:"Ctrl-A",removeline:"Ctrl-D",gotoline:"Ctrl-L",togglecomment:"Ctrl-7",findnext:"Ctrl-K",findprevious:"Ctrl-Shift-K",find:"Ctrl-F",replace:"Ctrl-R",undo:"Ctrl-Z",redo:"Ctrl-Shift-Z|Ctrl-Y",overwrite:"Insert",copylinesup:"Ctrl-Alt-Up",movelinesup:"Alt-Up",selecttostart:"Alt-Shift-Up",gotostart:"Ctrl-Home|Ctrl-Up",selectup:"Shift-Up",golineup:"Up",copylinesdown:"Ctrl-Alt-Down",movelinesdown:"Alt-Down",selecttoend:"Alt-Shift-Down",gotoend:"Ctrl-End|Ctrl-Down",selectdown:"Shift-Down",godown:"Down",selectwordleft:"Ctrl-Shift-Left",gotowordleft:"Ctrl-Left",selecttolinestart:"Alt-Shift-Left",gotolinestart:"Alt-Left|Home",selectleft:"Shift-Left",gotoleft:"Left",selectwordright:"Ctrl-Shift-Right",gotowordright:"Ctrl-Right",selecttolineend:"Alt-Shift-Right",gotolineend:"Alt-Right|End",selectright:"Shift-Right",gotoright:"Right",selectpagedown:"Shift-PageDown",pagedown:"PageDown",selectpageup:"Shift-PageUp",pageup:"PageUp",selectlinestart:"Shift-Home",selectlineend:"Shift-End",del:"Delete",backspace:"Backspace",outdent:"Shift-Tab",indent:"Tab"}}),define("ace/document",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("pilot/event_emitter").EventEmitter;var g=a("ace/selection").Selection;var h=a("ace/mode/text").Mode;var i=a("ace/range").Range;var j=function(a,b){this.modified=true,this.lines=[],this.selection=new g(this),this.$breakpoints=[],this.listeners=[],b&&this.setMode(b),Array.isArray(a)?this.$insertLines(0,a):this.$insert({row:0,column:0},a)};(function(){d.implement(this,f),this.$undoManager=null,this.$split=function(a){return a.split(/\r\n|\r|\n/)},this.setValue=function(a){var b=[0,this.lines.length];b.push.apply(b,this.$split(a)),this.lines.splice.apply(this.lines,b),this.modified=true,this.fireChangeEvent(0)},this.toString=function(){return this.lines.join(this.$getNewLineCharacter())},this.getSelection=function(){return this.selection},this.fireChangeEvent=function(a,b){var c={firstRow:a,lastRow:b};this._dispatchEvent("change",{data:c})},this.setUndoManager=function(a){this.$undoManager=a,this.$deltas=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$informUndoManager=e.deferredCall(function(){b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]})}},this.$defaultUndoManager={undo:function(){},redo:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=true,this.setUseSoftTabs=function(a){this.$useSoftTabs===a||(this.$useSoftTabs=a)},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){isNaN(a)||this.$tabSize===a||(this.modified=true,this.$tabSize=a,this._dispatchEvent("changeTabSize"))},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe;var f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=0){var h=g.charAt(d);if(h==c){f-=1;if(f==0)return{row:e,column:d}}else h==a&&(f+=1);d-=1}e-=1;if(e<0)break;var g=this.getLine(e);var d=g.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a];var d=b.column;var e=b.row;var f=1;var g=this.getLine(e);var h=this.getLength();while(true){while(d=h)break;var g=this.getLine(e);var d=0}return null},this.insert=function(a,b,c){var d=this.$insert(a,b,c);this.fireChangeEvent(a.row,a.row==d.row?a.row:undefined);return d},this.$insertLines=function(a,b,c){if(!(b.length==0)){var d=[a,0];d.push.apply(d,b),this.lines.splice.apply(this.lines,d);if(!c&&this.$undoManager){var e=this.$getNewLineCharacter();this.$deltas.push({action:"insertText",range:new i(a,0,a+b.length,0),text:b.join(e)+e}),this.$informUndoManager.schedule()}}},this.$insert=function(a,b,c){if(b.length==0)return a;this.modified=true,this.lines.length<=1&&this.$detectNewLine(b);var d=this.$split(b);if(this.$isNewLine(b)){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column),this.lines.splice(a.row+1,0,e.substring(a.column));var f={row:a.row+1,column:0}}else if(d.length==1){var e=this.lines[a.row]||"";this.lines[a.row]=e.substring(0,a.column)+b+e.substring(a.column);var f={row:a.row,column:a.column+b.length}}else{var e=this.lines[a.row]||"";var g=e.substring(0,a.column)+d[0];var h=d[d.length-1]+e.substring(a.column);this.lines[a.row]=g,this.$insertLines(a.row+1,[h],true),d.length>2&&this.$insertLines(a.row+1,d.slice(1,-1),true);var f={row:a.row+d.length-1,column:d[d.length-1].length}}!c&&this.$undoManager&&(this.$deltas.push({action:"insertText",range:i.fromPoints(a,f),text:b}),this.$informUndoManager.schedule());return f},this.$isNewLine=function(a){return a=="\r\n"||a=="\r"||a=="\n"},this.remove=function(a,b){if(a.isEmpty())return a.start;this.$remove(a,b),this.fireChangeEvent(a.start.row,a.isMultiLine()?undefined:a.start.row);return a.start},this.$remove=function(a,b){if(!a.isEmpty()){if(!b&&this.$undoManager){var c=this.$getNewLineCharacter();this.$deltas.push({action:"removeText",range:a.clone(),text:this.getTextRange(a)}),this.$informUndoManager.schedule()}this.modified=true;var d=a.start.row;var e=a.end.row;var f=this.getLine(d).substring(0,a.start.column)+this.getLine(e).substring(a.end.column);f!=""?this.lines.splice(d,e-d+1,f):this.lines.splice(d,e-d+1,"");return a.start}},this.undoChanges=function(a){this.selection.clearSelection();for(var b=a.length-1;b>=0;b--){var c=a[b];c.action=="insertText"?(this.remove(c.range,true),this.selection.moveCursorToPosition(c.range.start)):(this.insert(c.range.start,c.text,true),this.selection.clearSelection())}},this.redoChanges=function(a){this.selection.clearSelection();for(var b=0;b=this.lines.length-1)return 0;var c=this.lines.slice(a,b+1);this.$remove(new i(a,0,b+1,0)),this.$insertLines(a+1,c),this.fireChangeEvent(a,b+1);return 1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a);var b=this.$clipRowToDocument(b);var c=this.getLines(a,b);this.$insertLines(a,c);var d=b-a+1;this.fireChangeEvent(a);return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.lines.length-1))},this.documentToScreenColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;gh)e-=h+1,d+=h+c;else{d+=e;break}}return d},this.screenToDocumentColumn=function(a,b){var c=this.getTabSize();var d=0;var e=b;var f=this.getLine(a).split("\t");for(var g=0;g=h+c)e-=h+c,d+=h+1;else{if(e>h){d+=h;break}d+=e;break}}return d}}).call(j.prototype),b.Document=j}),define("ace/editor",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/event");var f=a("pilot/lang");var g=a("ace/textinput").TextInput;var h=a("ace/keybinding").KeyBinding;var i=a("ace/document").Document;var j=a("ace/search").Search;var k=a("ace/background_tokenizer").BackgroundTokenizer;var l=a("ace/range").Range;var m=a("pilot/event_emitter").EventEmitter;var n=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(c,this),this.keyBinding=new h(c,this);var d=this;e.addListener(c,"mousedown",function(a){setTimeout(function(){d.focus()});return e.preventDefault(a)}),e.addListener(c,"selectstart",function(a){return e.preventDefault(a)});var f=a.getMouseEventTarget();e.addListener(f,"mousedown",this.onMouseDown.bind(this)),e.addMultiMouseDownListener(f,0,2,500,this.onMouseDoubleClick.bind(this)),e.addMultiMouseDownListener(f,0,3,600,this.onMouseTripleClick.bind(this)),e.addMouseWheelListener(f,this.onMouseWheel.bind(this)),this.$selectionMarker=null,this.$highlightLineMarker=null,this.$blockScrolling=false,this.$search=(new j).set({wrap:true}),this.setDocument(b||new i("")),this.focus()};(function(){d.implement(this,m),this.$forwardEvents={gutterclick:1,gutterdblclick:1},this.$originalAddEventListener=this.addEventListener,this.$originalRemoveEventListener=this.removeEventListener,this.addEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.addEventListener(a,b):this.$originalAddEventListener(a,b)},this.removeEventListener=function(a,b){return this.$forwardEvents[a]?this.renderer.removeEventListener(a,b):this.$originalRemoveEventListener(a,b)},this.setDocument=function(a){if(!(this.doc==a)){if(this.doc){this.doc.removeEventListener("change",this.$onDocumentChange),this.doc.removeEventListener("changeMode",this.$onDocumentModeChange),this.doc.removeEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.doc.removeEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint);var b=this.doc.getSelection();b.removeEventListener("changeCursor",this.$onCursorChange),b.removeEventListener("changeSelection",this.$onSelectionChange),this.doc.setScrollTopRow(this.renderer.getScrollTopRow())}this.doc=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setDocument(a),this.$onDocumentModeChange=this.onDocumentModeChange.bind(this),a.addEventListener("changeMode",this.$onDocumentModeChange),this.$onDocumentChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onDocumentChangeTabSize),this.$onDocumentChangeBreakpoint=this.onDocumentChangeBreakpoint.bind(this),this.doc.addEventListener("changeBreakpoint",this.$onDocumentChangeBreakpoint),this.selection=a.getSelection(),this.$desiredColumn=0,this.$onCursorChange=this.onCursorChange.bind(this),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onDocumentModeChange(),this.bgTokenizer.setLines(this.doc.lines),this.bgTokenizer.start(0),this.onCursorChange(),this.onSelectionChange(),this.onDocumentChangeBreakpoint(),this.renderer.scrollToRow(a.getScrollTopRow()),this.renderer.updateFull()}},this.getDocument=function(){return this.doc},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.$highlightBrackets=function(){this.$bracketHighlight&&(this.renderer.removeMarker(this.$bracketHighlight),this.$bracketHighlight=null);if(!this.$highlightPending){var a=this;this.$highlightPending=true,setTimeout(function(){a.$highlightPending=false;var b=a.doc.findMatchingBracket(a.getCursorPosition());if(b){var c=new l(b.row,b.column,b.row,b.column+1);a.$bracketHighlight=a.renderer.addMarker(c,"ace_bracket")}},10)}},this.focus=function(){this.textInput.focus()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus()},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur()},this.onDocumentChange=function(a){var b=a.data;this.bgTokenizer.start(b.firstRow),this.renderer.updateLines(b.firstRow,b.lastRow),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite)},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onCursorChange=function(){this.$highlightBrackets(),this.renderer.updateCursor(this.getCursorPosition(),this.$overwrite),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){this.$highlightLineMarker&&this.renderer.removeMarker(this.$highlightLineMarker),this.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var a=this.getCursorPosition();var b=new l(a.row,0,a.row+1,0);this.$highlightLineMarker=this.renderer.addMarker(b,"ace_active_line","line")}},this.onSelectionChange=function(){this.$selectionMarker&&this.renderer.removeMarker(this.$selectionMarker),this.$selectionMarker=null;if(!this.selection.isEmpty()){var a=this.selection.getRange();var b=this.getSelectionStyle();this.$selectionMarker=this.renderer.addMarker(a,"ace_selection",b)}this.onCursorChange()},this.onDocumentChangeBreakpoint=function(){this.renderer.setBreakpoints(this.doc.getBreakpoints())},this.onDocumentModeChange=function(){var a=this.doc.getMode();if(!(this.mode==a)){this.mode=a;var b=a.getTokenizer();if(this.bgTokenizer)this.bgTokenizer.setTokenizer(b);else{var c=this.onTokenizerUpdate.bind(this);this.bgTokenizer=new k(b,this),this.bgTokenizer.addEventListener("update",c)}this.renderer.setTokenizer(this.bgTokenizer)}},this.onMouseDown=function(a){var b=e.getDocumentX(a);var c=e.getDocumentY(a);var d=this.renderer.screenToTextCoordinates(b,c);d.row=Math.max(0,Math.min(d.row,this.doc.getLength()-1));if(e.getButton(a)!=0)this.selection.isEmpty()&&this.moveCursorToPosition(d);else{a.shiftKey?this.selection.selectToPosition(d):(this.moveCursorToPosition(d),this.$clickSelection||this.selection.clearSelection(d.row,d.column)),this.renderer.scrollCursorIntoView();var f=this;var g,h;var i=function(a){g=e.getDocumentX(a),h=e.getDocumentY(a)};var j=function(){clearInterval(l),f.$clickSelection=null};var k=function(){if(!(g===undefined||h===undefined)){var a=f.renderer.screenToTextCoordinates(g,h);a.row=Math.max(0,Math.min(a.row,f.doc.getLength()-1));if(f.$clickSelection)if(f.$clickSelection.contains(a.row,a.column))f.selection.setSelectionRange(f.$clickSelection);else{if(f.$clickSelection.compare(a.row,a.column)==-1)var b=f.$clickSelection.end;else var b=f.$clickSelection.start;f.selection.setSelectionAnchor(b.row,b.column),f.selection.selectToPosition(a)}else f.selection.selectToPosition(a);f.renderer.scrollCursorIntoView()}};e.capture(this.container,i,j);var l=setInterval(k,20);return e.preventDefault(a)}},this.onMouseDoubleClick=function(a){this.selection.selectWord(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseTripleClick=function(a){this.selection.selectLine(),this.$clickSelection=this.getSelectionRange(),this.$updateDesiredColumn()},this.onMouseWheel=function(a){var b=this.$scrollSpeed*2;this.renderer.scrollBy(a.wheelX*b,a.wheelY*b);return e.preventDefault(a)},this.getCopyText=function(){return this.selection.isEmpty()?"":this.doc.getTextRange(this.getSelectionRange())},this.onCut=function(){this.$readOnly||(this.selection.isEmpty()||(this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection()))},this.onTextInput=function(a){if(!this.$readOnly){var b=this.getCursorPosition();a=a.replace("\t",this.doc.getTabString());if(this.selection.isEmpty()){if(this.$overwrite){var c=new l.fromPoints(b,b);c.end.column+=a.length,this.doc.remove(c)}}else{var b=this.doc.remove(this.getSelectionRange());this.clearSelection()}this.clearSelection();var d=this;this.bgTokenizer.getState(b.row,function(c){var e=d.mode.checkOutdent(c,d.doc.getLine(b.row),a);var f=d.doc.getLine(b.row),g=d.mode.getNextLineIndent(c,f.slice(0,b.column),d.doc.getTabString());var h=d.doc.insert(b,a);d.bgTokenizer.getState(b.row,function(a){if(b.row!==h.row){var c=d.doc.getTabSize(),i=Number.MAX_VALUE;for(var j=b.row+1;j<=h.row;++j){var k=0;f=d.doc.getLine(j);for(var m=0;m0;++m)f.charAt(m)=="\t"?n-=c:f.charAt(m)==" "&&(n-=1);d.doc.replace(new l(j,0,j,f.length),f.substr(m))}h.column+=d.doc.indentRows(b.row+1,h.row,g)}else e&&(h.column+=d.mode.autoOutdent(a,d.doc,b.row));d.moveCursorToPosition(h),d.renderer.scrollCursorIntoView()})})}},this.$overwrite=false,this.setOverwrite=function(a){this.$overwrite==a||(this.$overwrite=a,this.$blockScrolling=true,this.onCursorChange(),this.$blockScrolling=false,this._dispatchEvent("changeOverwrite",{data:a}))},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.$selectionStyle="line",this.setSelectionStyle=function(a){this.$selectionStyle==a||(this.$selectionStyle=a,this.onSelectionChange(),this._dispatchEvent("changeSelectionStyle",{data:a}))},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=true,this.setHighlightActiveLine=function(a){this.$highlightActiveLine==a||(this.$highlightActiveLine=a,this.$updateHighlightActiveLine())},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.setShowInvisibles=function(a){this.getShowInvisibles()==a||this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=false,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.removeRight=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectRight(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.removeLeft=function(){this.$readOnly||(this.selection.isEmpty()&&this.selection.selectLeft(),this.moveCursorToPosition(this.doc.remove(this.getSelectionRange())),this.clearSelection())},this.indent=function(){if(!this.$readOnly){var a=this.doc,b=this.getSelectionRange();if(b.start.row=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.getVisibleRowCount=function(){return this.getLastVisibleRow()-this.getFirstVisibleRow()+1},this.getPageDownRow=function(){return this.renderer.getLastVisibleRow()-1},this.getPageUpRow=function(){var a=this.renderer.getFirstVisibleRow();var b=this.renderer.getLastVisibleRow();return a-(b-a)+1},this.selectPageDown=function(){var a=this.getPageDownRow()+Math.floor(this.getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection();b.$moveSelection(function(){b.moveCursorTo(a,b.getSelectionLead().column)})},this.selectPageUp=function(){var a=this.getLastVisibleRow()-this.getFirstVisibleRow();var b=this.getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection();c.$moveSelection(function(){c.moveCursorTo(b,c.getSelectionLead().column)})},this.gotoPageDown=function(){var a=this.getPageDownRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.gotoPageUp=function(){var a=this.getPageUpRow(),b=Math.min(this.getCursorPosition().column,this.doc.getLine(a).length);this.scrollToRow(a),this.getSelection().moveCursorTo(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getSelectionRange=function(){return this.selection.getRange()},this.clearSelection=function(){this.selection.clearSelection(),this.$updateDesiredColumn()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b),this.$updateDesiredColumn()},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a),this.$updateDesiredColumn()},this.gotoLine=function(a,b){this.selection.clearSelection(),this.$blockScrolling=true,this.moveCursorTo(a-1,b||0),this.$blockScrolling=false,this.isRowVisible(this.getCursorPosition().row)||this.scrollToRow(a-1-Math.floor(this.getVisibleRowCount()/2))},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b),this.$updateDesiredColumn(b)},this.navigateUp=function(){this.selection.clearSelection(),this.selection.moveCursorBy(-1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.navigateDown=function(){this.selection.clearSelection(),this.selection.moveCursorBy(1,0);if(this.$desiredColumn){var a=this.getCursorPosition();var b=this.doc.screenToDocumentColumn(a.row,this.$desiredColumn);this.selection.moveCursorTo(a.row,b)}},this.$updateDesiredColumn=function(){var a=this.getCursorPosition();this.$desiredColumn=this.doc.documentToScreenColumn(a.row,a.column)},this.navigateLeft=function(){if(this.selection.isEmpty())this.selection.moveCursorLeft();else{var a=this.getSelectionRange().start;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateRight=function(){if(this.selection.isEmpty())this.selection.moveCursorRight();else{var a=this.getSelectionRange().end;this.moveCursorToPosition(a)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.doc);this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c),this.$updateDesiredColumn()},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.doc);if(c.length){this.clearSelection(),this.selection.moveCursorTo(0,0);for(var d=c.length-1;d>=0;--d)this.$tryReplace(c[d],a);c[0]!==null&&this.selection.setSelectionRange(c[0]),this.$updateDesiredColumn()}},this.$tryReplace=function(a,b){var c=this.doc.getTextRange(a);var b=this.$search.replace(c,b);if(b!==null){a.end=this.doc.replace(a,b);return a}return null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=false),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=true),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.doc.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.doc);b&&(this.gotoLine(b.end.row+1,b.end.column),this.$updateDesiredColumn(),this.selection.setSelectionRange(b))},this.undo=function(){this.doc.getUndoManager().undo()},this.redo=function(){this.doc.getUndoManager().redo()}}).call(n.prototype),b.Editor=n}),define("ace/keybinding",function(a,b,c){var d=a("pilot/useragent");var e=a("pilot/event");var f=a("ace/conf/keybindings/default_mac").bindings;var g=a("ace/conf/keybindings/default_win").bindings;var h=a("pilot/canon");a("ace/commands/default_commands");var i=function(a,b,c){this.setConfig(c);var f=this;e.addKeyListener(a,function(a){if(d.isOpera&&d.isMac)var c=0|(a.metaKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.ctrlKey?8:0);else var c=0|(a.ctrlKey?1:0)|(a.altKey?2:0)|(a.shiftKey?4:0)|(a.metaKey?8:0);var g=f.keyNames[a.keyCode];var i=(f.config.reverse[c]||{})[(g||String.fromCharCode(a.keyCode)).toLowerCase()];var j=h.exec(i,{editor:b});if(j)return e.stopEvent(a)})};(function(){this.keyMods={ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},this.keyNames={8:"Backspace",9:"Tab",13:"Enter",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",107:"+",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12"};function a(a,b,c,d){return(d&&a.toLowerCase()||a).replace(/(?:^\s+|\n|\s+$)/g,"").split(new RegExp("[\\s ]*"+b+"[\\s ]*","g"),c||999)}function b(b,c,d){var e,f=0,g=a(b,"\\-",null,true),h=0,i=g.length;for(;h",c+1,""),b.push("");this.element.innerHTML=b.join(""),this.element.style.height=a.minHeight+"px"}}).call(d.prototype),b.Gutter=d}),define("ace/layer/marker",function(a,b,c){var d=a("ace/range").Range;var e=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_marker-layer",a.appendChild(this.element),this.markers={},this.$markerId=1};(function(){this.setDocument=function(a){this.doc=a},this.addMarker=function(a,b,c){var d=this.$markerId++;this.markers[d]={range:a,type:c||"line",clazz:b};return d},this.removeMarker=function(a){var b=this.markers[a];b&&delete this.markers[a]},this.update=function(a){var a=a||this.config;if(a){this.config=a;var b=[];for(var c in this.markers){var d=this.markers[c];var e=d.range.clipRows(a.firstRow,a.lastRow);if(e.isEmpty())continue;e.isMultiLine()?d.type=="text"?this.drawTextMarker(b,e,d.clazz,a):this.drawMultiLineMarker(b,e,d.clazz,a):this.drawSingleLineMarker(b,e,d.clazz,a)}this.element.innerHTML=b.join("")}},this.drawTextMarker=function(a,b,c,e){var f=b.start.row;var g=new d(f,b.start.column,f,this.doc.getLine(f).length);this.drawSingleLineMarker(a,g,c,e);var f=b.end.row;var g=new d(f,0,f,b.end.column);this.drawSingleLineMarker(a,g,c,e);for(var f=b.start.row+1;f");var g=(b.end.row-d.firstRow)*d.lineHeight;var f=Math.round(b.end.column*d.characterWidth);a.push("");var e=(b.end.row-b.start.row-1)*d.lineHeight;if(!(e<0)){var g=(b.start.row+1-d.firstRow)*d.lineHeight;a.push("")}},this.drawSingleLineMarker=function(a,b,c,d){var b=b.toScreenRange(this.doc);var e=d.lineHeight;var f=Math.round((b.end.column-b.start.column)*d.characterWidth);var g=(b.start.row-d.firstRow)*d.lineHeight;var h=Math.round(b.start.column*d.characterWidth);a.push("")}}).call(e.prototype),b.Marker=e}),define("ace/layer/text",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/dom");var f=a("pilot/lang");var g=a("pilot/event_emitter").EventEmitter;var h=function(a){this.element=document.createElement("div"),this.element.className="ace_layer ace_text-layer",a.appendChild(this.element),this.$characterSize=this.$measureSizes(),this.$pollSizeChanges()};(function(){d.implement(this,g),this.EOF_CHAR="¶",this.EOL_CHAR="¬",this.TAB_CHAR="→",this.SPACE_CHAR="·",this.setTokenizer=function(a){this.tokenizer=a},this.getLineHeight=function(){return this.$characterSize.height||1},this.getCharacterWidth=function(){return this.$characterSize.width||1},this.$pollSizeChanges=function(){var a=this;setInterval(function(){var b=a.$measureSizes();if(a.$characterSize.width!==b.width||a.$characterSize.height!==b.height)a.$characterSize=b,a._dispatchEvent("changeCharaterSize",{data:b})},500)},this.$fontStyles={fontFamily:1,fontSize:1,fontWeight:1,fontStyle:1,lineHeight:1},this.$measureSizes=function(){var a=1e3;if(!this.$measureNode){var b=this.$measureNode=document.createElement("div");var c=b.style;c.width=c.height="auto",c.left=c.top="-1000px",c.visibility="hidden",c.position="absolute",c.overflow="visible",c.whiteSpace="nowrap",b.innerHTML=f.stringRepeat("Xy",a),document.body.insertBefore(b,document.body.firstChild)}var c=this.$measureNode.style;for(var d in this.$fontStyles){var g=e.computedStyle(this.element,d);c[d]=g}var h={height:this.$measureNode.offsetHeight,width:this.$measureNode.offsetWidth/(a*2)};return h},this.setDocument=function(a){this.doc=a},this.$showInvisibles=false,this.setShowInvisibles=function(a){this.$showInvisibles=a},this.$computeTabString=function(){var a=this.doc.getTabSize();if(this.$showInvisibles){var b=a/2;this.$tabString=""+(new Array(Math.floor(b))).join(" ")+this.TAB_CHAR+(new Array(Math.ceil(b)+1)).join(" ")+""}else this.$tabString=(new Array(a+1)).join(" ")},this.updateLines=function(a,b,c){this.$computeTabString(),this.config=a;var d=Math.max(b,a.firstRow);var e=Math.min(c,a.lastRow);var f=this.element.childNodes;var g=this;this.tokenizer.getTokens(d,e,function(b){for(var c=d;c<=e;c++){var h=f[c-a.firstRow];if(!h)continue;var i=[];g.$renderLine(i,c,b[c-d].tokens),h.innerHTML=i.join("")}})},this.scrollLines=function(a){var b=this;this.$computeTabString();var c=this.config;this.config=a;if(!c||c.lastRowa.lastRow)for(var e=a.lastRow+1;e<=c.lastRow;e++)d.removeChild(d.lastChild);f(g);function f(e){a.firstRowc.lastRow&&b.$renderLinesFragment(a,c.lastRow+1,a.lastRow,function(a){d.appendChild(a)})}},this.$renderLinesFragment=function(a,b,c,d){var e=document.createDocumentFragment();var 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=[];var 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:true,rparen:true,lparen:true},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;var 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/range",function(a,b,c){var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};(function(){this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compare=function(a,b){if(!this.isMultiLine())if(a===this.start.row)return bthis.end.column?1:0;if(athis.end.row)return 1;if(this.start.row===a)return b>=this.start.column?0:-1;if(this.end.row===a)return b<=this.end.column?0:1;return 0},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0;h--){var i=g[h];var j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return true}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=a.getSelection().getCursor();var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;function j(d){var e=a.getLine(d);b&&d==c.end.row&&(e=e.substring(0,c.end.column));return e}return{forEach:function(a){var b=d.row;var c=j(b);var g=d.column;var k=false;while(!a(c,g,b)){if(k)return;b++,g=0;if(b>h)if(i)b=e,g=f;else return;b==d.row&&(k=true),c=j(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION;var c=a.getSelection().getRange();var d=b?c.end:c.start;var e=b?c.start.row:0;var f=b?c.start.column:0;var h=b?c.end.row:a.getLength()-1;var i=this.$options.wrap;return{forEach:function(g){var j=d.row;var k=a.getLine(j).substring(0,d.column);var l=0;var m=false;while(!g(k,l,j)){if(m)return;j--,l=0;if(jb.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor||this.selectionLead;var b=this.selectionLead;return this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.selectionAnchor&&(this.selectionAnchor=null,this._dispatchEvent("changeSelection",{}))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.$moveSelection(function(){this.moveCursorTo(0,0)})},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column))},this.$moveSelection=function(a){var b=false;this.selectionAnchor||(b=true,this.selectionAnchor=this.$clone(this.selectionLead));var c=this.$clone(this.selectionLead);a.call(this);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)b=true;b&&this._dispatchEvent("changeSelection",{})},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.selectionLead;var b=a.column;var c=this.doc.getWordRange(a.row,b);this.setSelectionRange(c)},this.selectLine=function(){this.setSelectionAnchor(this.selectionLead.row,0),this.$moveSelection(function(){this.moveCursorTo(this.selectionLead.row+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){if(this.selectionLead.column==0)this.selectionLead.row>0&&this.moveCursorTo(this.selectionLead.row-1,this.doc.getLine(this.selectionLead.row-1).length);else{var a=this.doc;var b=a.getTabSize();var c=this.selectionLead;a.isTabStop(c)&&a.getLine(c.row).slice(c.column-b,c.column).split(" ").length-1==b?this.moveCursorBy(0,-b):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=b?this.moveCursorTo(a,0):this.moveCursorTo(a,d[0].length)},this.moveCursorLineEnd=function(){this.moveCursorTo(this.selectionLead.row,this.doc.getLine(this.selectionLead.row).length)},this.moveCursorFileEnd=function(){var a=this.doc.getLength()-1;var b=this.doc.getLine(a).length;this.moveCursorTo(a,b)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorWordRight=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=c.substring(b);var e;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==c.length)this.moveCursorRight();else{if(e=this.doc.nonTokenRe.exec(d))b+=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(e=this.doc.tokenRe.exec(d))b+=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorWordLeft=function(){var a=this.selectionLead.row;var b=this.selectionLead.column;var c=this.doc.getLine(a);var d=e.stringReverse(c.substring(0,b));var f;this.doc.nonTokenRe.lastIndex=0,this.doc.tokenRe.lastIndex=0;if(b==0)this.moveCursorLeft();else{if(f=this.doc.nonTokenRe.exec(d))b-=this.doc.nonTokenRe.lastIndex,this.doc.nonTokenRe.lastIndex=0;else if(f=this.doc.tokenRe.exec(d))b-=this.doc.tokenRe.lastIndex,this.doc.tokenRe.lastIndex=0;this.moveCursorTo(a,b)}},this.moveCursorBy=function(a,b){this.moveCursorTo(this.selectionLead.row+a,this.selectionLead.column+b)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b){var c=this.$clipPositionToDocument(a,b);if(c.row!==this.selectionLead.row||c.column!==this.selectionLead.column)this.selectionLead=c,this._dispatchEvent("changeCursor",{data:this.getCursor()})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.$clipPositionToDocument=function(a,b){var c={};a>=this.doc.getLength()?(c.row=Math.max(0,this.doc.getLength()-1),c.column=this.doc.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.doc.getLine(c.row).length,Math.max(0,b)));return c},this.$clone=function(a){return{row:a.row,column:a.column}}}).call(h.prototype),b.Selection=h}),define("ace/textinput",function(a,b,c){var d=a("pilot/event");var e=function(a,b){var c=document.createElement("textarea");var e=c.style;e.position="absolute",e.left="-10000px",e.top="-10000px",a.appendChild(c);var f=String.fromCharCode(0);i();var g=false;var h=false;function i(){if(!h){var a=c.value;a&&(a.charCodeAt(a.length-1)==f.charCodeAt(0)?(a=a.slice(0,-1),a&&b.onTextInput(a)):b.onTextInput(a))}h=false,c.value=f,c.select()}var j=function(a){setTimeout(function(){g||i()},0)};var k=function(a){g=true,i(),c.value="",b.onCompositionStart(),setTimeout(l,0)};var l=function(){b.onCompositionUpdate(c.value)};var m=function(){g=false,b.onCompositionEnd(),j()};var n=function(){h=true,c.value=b.getCopyText(),c.select(),h=true,setTimeout(i,0)};var o=function(){h=true,c.value=b.getCopyText(),b.onCut(),c.select(),setTimeout(i,0)};d.addListener(c,"keypress",j),d.addListener(c,"textInput",j),d.addListener(c,"paste",j),d.addListener(c,"propertychange",j),d.addListener(c,"copy",n),d.addListener(c,"cut",o),d.addListener(c,"compositionstart",k),d.addListener(c,"compositionupdate",l),d.addListener(c,"compositionend",m),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),c.select()}),this.focus=function(){b.onFocus(),c.select(),c.focus()},this.blur=function(){c.blur()}};b.TextInput=e}),define("ace/tokenizer",function(a,b,c){var d=function(a){this.rules=a,this.regExps={};for(var b in this.rules){var c=this.rules[b];var d=[];for(var e=0;ea&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)){if(bc&&this.scrollToY(c),this.getScrollTop()+this.$size.scrollerHeightb&&this.scrollToX(b),this.scroller.scrollLeft+this.$size.scrollerWidth=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\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/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("ace/mode/text_highlight_rules").TextHighlightRules;var 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/matching_brace_outdent",function(a,b,c){var d=a("ace/range").Range;var e=function(){};(function(){this.checkOutdent=function(a,b){if(!/^\s+$/.test(a))return false;return/^\s*\}/.test(b)},this.autoOutdent=function(a,b){var c=a.getLine(b);var e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length;var 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/javascript_highlight_rules",function(a,b,c){var d=a("pilot/oop");var e=a("pilot/lang");var f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;var g=a("ace/mode/text_highlight_rules").TextHighlightRules;JavaScriptHighlightRules=function(){var a=new f;var 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("|"));var c=e.arrayToMap("null|Infinity|NaN|undefined".split("|"));var 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("text!ace/css/editor.css",".ace_editor { position: absolute; overflow: hidden; font-family: \"Menlo\", \"Monaco\", \"Courier New\", monospace; font-size: 12px; }.ace_scroller { position: absolute; overflow-x: scroll; overflow-y: hidden; }.ace_gutter { position: absolute; overflow-x: hidden; overflow-y: hidden; height: 100%;}.ace_editor .ace_sb { position: absolute; overflow-x: hidden; overflow-y: scroll; right: 0;}.ace_editor .ace_sb div { position: absolute; width: 1px; left: 0px;}.ace_editor .ace_printMargin { position: absolute; height: 100%;}.ace_layer { z-index: 0; position: absolute; overflow: hidden; white-space: nowrap; height: 100%;}.ace_text-layer { font-family: Monaco, \"Courier New\", monospace; color: black;}.ace_cursor-layer { cursor: text;}.ace_cursor { z-index: 3; position: absolute;}.ace_line { white-space: nowrap;}.ace_marker-layer {}.ace_marker-layer .ace_step { position: absolute; z-index: 2;}.ace_marker-layer .ace_selection { position: absolute; z-index: 3;}.ace_marker-layer .ace_bracket { position: absolute; z-index: 4;}.ace_marker-layer .ace_active_line { position: absolute; z-index: 1;}"),define("text!ace/theme/tm.css",".ace-tm .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-tm .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-tm .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-tm .ace_gutter-layer { width: 100%; text-align: right;}.ace-tm .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-tm .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-tm .ace_text-layer { cursor: text;}.ace-tm .ace_cursor { border-left: 2px solid black;}.ace-tm .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid black;} .ace-tm .ace_line .ace_invisible { color: rgb(191, 191, 191);}.ace-tm .ace_line .ace_keyword { color: blue;}.ace-tm .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246);}.ace-tm .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246);}.ace-tm .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_invalid { background-color: rgb(153, 0, 0); color: white;}.ace-tm .ace_line .ace_support.ace_function { color: rgb(60, 76, 114);}.ace-tm .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14);}.ace-tm .ace_line .ace_support.ace_type,.ace-tm .ace_line .ace_support.ace_class { color: rgb(109, 121, 222);}.ace-tm .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135);}.ace-tm .ace_line .ace_string { color: rgb(3, 106, 7);}.ace-tm .ace_line .ace_comment { color: rgb(76, 136, 107);}.ace-tm .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255);}.ace-tm .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191);}.ace-tm .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205);}.ace-tm .ace_line .ace_variable { color: rgb(49, 132, 149);}.ace-tm .ace_line .ace_xml_pe { color: rgb(104, 104, 91);}.ace-tm .ace_marker-layer .ace_selection { background: rgb(181, 213, 255);}.ace-tm .ace_marker-layer .ace_step { background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack { background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254);}.ace-tm .ace_string.ace_regex { color: rgb(255, 0, 0) }");var deps=["pilot/fixoldbrowsers","pilot/plugin_manager","pilot/settings","pilot/environment","demo_startup"];require(deps,function(){var a=require("pilot/plugin_manager").catalog;a.registerPlugins(["pilot/index"])});var ace={edit:function(a){typeof a=="string"&&(a=document.getElementById(a));var b=require("pilot/environment").create();var c=require("pilot/plugin_manager").catalog;c.startupPlugins({env:b}).then(function(){var c=require("ace/document").Document;var d=require("ace/mode/javascript").Mode;var e=require("ace/undomanager").UndoManager;var f=require("ace/editor").Editor;var g=require("ace/virtual_renderer").VirtualRenderer;var h=require("ace/theme/textmate");var i=new c(a.innerHTML);a.innerHTML="",i.setMode(new d),i.setUndoManager(new e),b.editor=new f(new g(a,h)),b.editor.setDocument(i),b.editor.resize(),window.addEventListener("resize",function(){b.editor.resize()},false)})}}
\ No newline at end of file