src/pyams_skin/resources/js/ext/ace/worker-lua.min.js
changeset 504 fb5a531cddbe
parent 501 2f0eb9a77324
equal deleted inserted replaced
503:a50637baf022 504:fb5a531cddbe
     1 "no use strict";!function(e){function t(e,t){for(var n=e,r="";n;){var i=t[n];if("string"==typeof i)return i+r;if(i)return i.location.replace(/\/*$/,"/")+(r||i.main||i.name);if(!1===i)return"";var o=n.lastIndexOf("/");if(-1===o)break;r=n.substr(o)+r,n=n.slice(0,o)}return e}if(!(void 0!==e.window&&e.document||e.require&&e.define)){e.console||(e.console=function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})},e.console.error=e.console.warn=e.console.log=e.console.trace=e.console),e.window=e,e.ace=e,e.onerror=function(e,t,n,r,i){postMessage({type:"error",data:{message:e,data:i.data,file:t,line:n,col:r,stack:i.stack}})},e.normalizeModule=function(t,n){if(-1!==n.indexOf("!")){var r=n.split("!");return e.normalizeModule(t,r[0])+"!"+e.normalizeModule(t,r[1])}if("."==n.charAt(0)){var i=t.split("/").slice(0,-1).join("/");for(n=(i?i+"/":"")+n;-1!==n.indexOf(".")&&o!=n;){var o=n;n=n.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return n},e.require=function(n,r){if(r||(r=n,n=null),!r.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");r=e.normalizeModule(n,r);var i=e.require.modules[r];if(i)return i.initialized||(i.initialized=!0,i.exports=i.factory().exports),i.exports;if(!e.require.tlns)return console.log("unable to load "+r);var o=t(r,e.require.tlns);return".js"!=o.slice(-3)&&(o+=".js"),e.require.id=r,e.require.modules[r]={},importScripts(o),e.require(n,r)},e.require.modules={},e.require.tlns={},e.define=function(t,n,r){if(2==arguments.length?(r=n,"string"!=typeof t&&(n=t,t=e.require.id)):1==arguments.length&&(r=t,n=[],t=e.require.id),"function"==typeof r){n.length||(n=["require","exports","module"]);var i=function(n){return e.require(t,n)};e.require.modules[t]={exports:{},factory:function(){var e=this,t=r.apply(this,n.slice(0,r.length).map(function(t){switch(t){case"require":return i;case"exports":return e.exports;case"module":return e;default:return i(t)}}));return t&&(e.exports=t),e}}}else e.require.modules[t]={exports:r,initialized:!0}},e.define.amd={},require.tlns={},e.initBaseUrls=function(e){for(var t in e)require.tlns[t]=e[t]},e.initSender=function(){var t=e.require("ace/lib/event_emitter").EventEmitter,n=e.require("ace/lib/oop"),r=function(){};return function(){n.implement(this,t),this.callback=function(e,t){postMessage({type:"call",id:t,data:e})},this.emit=function(e,t){postMessage({type:"event",name:e,data:t})}}.call(r.prototype),new r};var n=e.main=null,r=e.sender=null;e.onmessage=function(t){var i=t.data;if(i.event&&r)r._signal(i.event,i.data);else if(i.command)if(n[i.command])n[i.command].apply(n,i.args);else{if(!e[i.command])throw new Error("Unknown command:"+i.command);e[i.command].apply(e,i.args)}else if(i.init){e.initBaseUrls(i.tlns),require("ace/lib/es5-shim"),r=e.sender=e.initSender();var o=require(i.module)[i.classname];n=e.main=new o(r)}}}}(this),ace.define("ace/lib/oop",[],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/range",[],function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&(!this.isEnd(e,t)&&!this.isStart(e,t))},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:t<this.start.column?-1:t>this.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)n={row:t+1,column:0};else if(this.end.row<e)var n={row:e,column:0};if(this.start.row>t)i={row:t+1,column:0};else if(this.start.row<e)var i={row:e,column:0};return r.fromPoints(i||this.start,n||this.end)},this.extend=function(e,t){var n=this.compare(e,t);if(0==n)return this;if(-1==n)var i={row:e,column:t};else var o={row:e,column:t};return r.fromPoints(i||this.start,o||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return r.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new r(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new r(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),n=e.documentToScreenPosition(this.end);return new r(t.row,t.column,n.row,n.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(r.prototype),r.fromPoints=function(e,t){return new r(e.row,e.column,t.row,t.column)},r.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},r.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=r}),ace.define("ace/apply_delta",[],function(e,t,n){"use strict";function r(e,t){throw console.log("Invalid Delta:",e),"Invalid Delta: "+t}function i(e,t){return t.row>=0&&t.row<e.length&&t.column>=0&&t.column<=e[t.row].length}t.applyDelta=function(e,t,n){var r=t.start.row,i=t.start.column,o=e[r]||"";switch(t.action){case"insert":if(1===t.lines.length)e[r]=o.substring(0,i)+t.lines[0]+o.substring(i);else{var s=[r,1].concat(t.lines);e.splice.apply(e,s),e[r]=o.substring(0,i)+e[r],e[r+t.lines.length-1]+=o.substring(i)}break;case"remove":var a=t.end.column,c=t.end.row;r===c?e[r]=o.substring(0,i)+o.substring(a):e.splice(r,c-r+1,o.substring(0,i)+e[c].substring(a))}}}),ace.define("ace/lib/event_emitter",[],function(e,t,n){"use strict";var r={},i=function(){this.propagationStopped=!0},o=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(n.length||r){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=o),n=n.slice();for(var s=0;s<n.length&&(n[s](t,this),!t.propagationStopped);s++);return r&&!t.defaultPrevented?r(t,this):void 0}},r._signal=function(e,t){var n=(this._eventRegistry||{})[e];if(n){n=n.slice();for(var r=0;r<n.length;r++)n[r](t,this)}},r.once=function(e,t){var n=this;if(this.addEventListener(e,function r(){n.removeEventListener(e,r),t.apply(null,arguments)}),!t)return new Promise(function(e){t=e})},r.setDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n||(n=this._defaultHandlers={_disabled_:{}}),n[e]){var r=n[e],i=n._disabled_[e];i||(n._disabled_[e]=i=[]),i.push(r);var o=i.indexOf(t);-1!=o&&i.splice(o,1)}n[e]=t},r.removeDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n){var r=n._disabled_[e];if(n[e]==t)r&&this.setDefaultHandler(e,r.pop());else if(r){var i=r.indexOf(t);-1!=i&&r.splice(i,1)}}},r.on=r.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[e];return r||(r=this._eventRegistry[e]=[]),-1==r.indexOf(t)&&r[n?"unshift":"push"](t),t},r.off=r.removeListener=r.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}},r.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=r}),ace.define("ace/anchor",[],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,o=t.Anchor=function(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===n?this.setPosition(t.row,t.column):this.setPosition(t,n)};(function(){function e(e,t,n){var r=n?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&r}function t(t,n,r){var i="insert"==t.action,o=(i?1:-1)*(t.end.row-t.start.row),s=(i?1:-1)*(t.end.column-t.start.column),a=t.start,c=i?a:t.end;return e(n,a,r)?{row:n.row,column:n.column}:e(c,n,!r)?{row:n.row+o,column:n.column+(n.row==c.row?s:0)}:{row:a.row,column:a.column}}r.implement(this,i),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){if(!(e.start.row==e.end.row&&e.start.row!=this.row||e.start.row>this.row)){var n=t(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(o.prototype)}),ace.define("ace/document",[],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,o=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,a=e("./anchor").Anchor,c=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,o),this.setValue=function(e){var t=this.getLength()-1;this.remove(new s(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return void 0==t&&(t=r.length),t=Math.min(Math.max(t,0),r.length),{row:e,column:t}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))<this.getLength()?(t=t.concat([""]),n=0):(t=[""].concat(t),e--,n=this.$lines[e].length),this.insertMergedLines({row:e,column:n},t)},this.insertMergedLines=function(e,t){var n=this.clippedPos(e.row,e.column),r={row:n.row+t.length-1,column:(1==t.length?n.column:0)+t[t.length-1].length};return this.applyDelta({start:n,end:r,action:"insert",lines:t}),this.clonePos(r)},this.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),n=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:n,action:"remove",lines:this.getLinesForRange({start:t,end:n})}),this.clonePos(t)},this.removeInLine=function(e,t,n){var r=this.clippedPos(e,t),i=this.clippedPos(e,n);return this.applyDelta({start:r,end:i,action:"remove",lines:this.getLinesForRange({start:r,end:i})},!0),this.clonePos(r)},this.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);var n=(t=Math.min(Math.max(0,t),this.getLength()-1))==this.getLength()-1&&e>0,r=t<this.getLength()-1,i=n?e-1:e,o=n?this.getLine(i).length:0,a=r?t+1:t,c=r?0:this.getLine(a).length,u=new s(i,o,a,c),l=this.$lines.slice(e,t+1);return this.applyDelta({start:u.start,end:u.end,action:"remove",lines:this.getLinesForRange(u)}),l},this.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){if(e instanceof s||(e=s.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);return t?this.insert(e.start,t):e.start},this.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},this.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!s.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,o=e.start.column,s=0,a=0;s<r;s=a){a+=t-1;var c=n.slice(s,a);c.push(""),this.applyDelta({start:this.pos(i+s,o),end:this.pos(i+a,o=0),action:e.action,lines:c},!0)}e.lines=n.slice(s),e.start.row=i+s,e.start.column=o,this.applyDelta(e,!0)},this.revertDelta=function(e){this.applyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,t){for(var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,i=t||0,o=n.length;i<o;i++)if((e-=n[i].length+r)<0)return{row:i,column:e+n[i].length+r};return{row:o-1,column:e+n[o-1].length+r}},this.positionToIndex=function(e,t){for(var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,i=0,o=Math.min(e.row,n.length),s=t||0;s<o;++s)i+=n[s].length+r;return i+e.column}}).call(c.prototype),t.Document=c}),ace.define("ace/lib/lang",[],function(e,t,n){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var n="";t>0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;n<r;n++)e[n]&&"object"==typeof e[n]?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;var n;if(Array.isArray(t)){n=[];for(r=0;r<t.length;r++)n[r]=e(t[r]);return n}if("[object Object]"!==Object.prototype.toString.call(t))return t;n={};for(var r in t)n[r]=e(t[r]);return n},t.arrayToMap=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},r=function(e){return r.cancel(),t=setTimeout(n,e||0),r};return r.schedule=r,r.call=function(){return this.cancel(),e(),r},r.cancel=function(){return clearTimeout(t),t=null,r},r.isPending=function(){return t},r},t.delayedCall=function(e,t){var n=null,r=function(){n=null,e()},i=function(e){null==n&&(n=setTimeout(r,e||t))};return i.delay=function(e){n&&clearTimeout(n),n=setTimeout(r,e||t)},i.schedule=i,i.call=function(){this.cancel(),e()},i.cancel=function(){n&&clearTimeout(n),n=null},i.isPending=function(){return n},i}}),ace.define("ace/worker/mirror",[],function(e,t,n){"use strict";e("../range").Range;var r=e("../document").Document,i=e("../lib/lang"),o=t.Mirror=function(e){this.sender=e;var t=this.doc=new r(""),n=this.deferredUpdate=i.delayedCall(this.onUpdate.bind(this)),o=this;e.on("change",function(e){var r=e.data;if(r[0].start)t.applyDeltas(r);else for(var i=0;i<r.length;i+=2){if(Array.isArray(r[i+1]))s={action:"insert",start:r[i],lines:r[i+1]};else var s={action:"remove",start:r[i],end:r[i+1]};t.applyDelta(s,!0)}if(o.$timeout)return n.schedule(o.$timeout);o.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(e){this.$timeout=e},this.setValue=function(e){this.doc.setValue(e),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(e){this.sender.callback(this.doc.getValue(),e)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(o.prototype)}),ace.define("ace/mode/lua/luaparse",[],function(e,t,n){!function(e,n,r){r(t)}(0,0,function(e){"use strict";function t(e){if(Be){var t=Ge.pop();t.complete(),ye.locations&&(e.loc=t.loc),ye.ranges&&(e.range=t.range)}return e}function n(e,t,n){for(var r=0,i=e.length;r<i;r++)if(e[r][t]===n)return r;return-1}function r(e){var t=Ie.call(arguments,1);return e=e.replace(/%(\d)/g,function(e,n){return""+t[n-1]||""})}function i(){for(var e,t,n=Ie.call(arguments),r={},i=0,o=n.length;i<o;i++){e=n[i];for(t in e)e.hasOwnProperty(t)&&(r[t]=e[t])}return r}function o(e){var t,n,i=r.apply(null,Ie.call(arguments,1));throw void 0!==e.line?(n=e.range[0]-e.lineStart,t=new SyntaxError(r("[%1:%2] %3",e.line,n,i)),t.line=e.line,t.index=e.range[0],t.column=n):(n=Ce-Ne+1,t=new SyntaxError(r("[%1:%2] %3",De,n,i)),t.index=Ce,t.line=De,t.column=n),t}function s(e,t){o(t,Fe.expectedToken,e,t.value)}function a(e,t){if(void 0===t&&(t=Te.value),void 0!==e.type){var n;switch(e.type){case Le:n="string";break;case _e:n="keyword";break;case Se:n="identifier";break;case Ae:n="number";break;case Ee:n="symbol";break;case je:n="boolean";break;case Oe:return o(e,Fe.unexpected,"symbol","nil",t)}return o(e,Fe.unexpected,n,e.value,t)}return o(e,Fe.unexpected,"symbol",e,t)}function c(){for(u();45===ve.charCodeAt(Ce)&&45===ve.charCodeAt(Ce+1);)w(),u();if(Ce>=we)return{type:xe,value:"<eof>",line:De,lineStart:Ne,range:[Ce,Ce]};var e=ve.charCodeAt(Ce),t=ve.charCodeAt(Ce+1);if($e=Ce,O(e))return l();switch(e){case 39:case 34:return p();case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return m();case 46:return E(t)?m():46===t?46===ve.charCodeAt(Ce+2)?f():h(".."):h(".");case 61:return h(61===t?"==":"=");case 62:return h(61===t?">=":">");case 60:return h(61===t?"<=":"<");case 126:return h(61===t?"~=":"~");case 58:return h(58===t?"::":":");case 91:return 91===t||61===t?d():h("[");case 42:case 47:case 94:case 37:case 44:case 123:case 125:case 93:case 40:case 41:case 59:case 35:case 45:case 43:case 38:case 124:return h(ve.charAt(Ce))}return a(ve.charAt(Ce))}function u(){for(;Ce<we;){var e=ve.charCodeAt(Ce);if(S(e))Ce++;else{if(!A(e))break;De++,Ne=++Ce}}}function l(){for(var e,t;P(ve.charCodeAt(++Ce)););return e=ve.slice($e,Ce),C(e)?t=_e:"true"===e||"false"===e?(t=je,e="true"===e):"nil"===e?(t=Oe,e=null):t=Se,{type:t,value:e,line:De,lineStart:Ne,range:[$e,Ce]}}function h(e){return Ce+=e.length,{type:Ee,value:e,line:De,lineStart:Ne,range:[$e,Ce]}}function f(){return Ce+=3,{type:Pe,value:"...",line:De,lineStart:Ne,range:[$e,Ce]}}function p(){for(var e,t=ve.charCodeAt(Ce++),n=Ce,r="";Ce<we&&(e=ve.charCodeAt(Ce++),t!==e);)92===e?(r+=ve.slice(n,Ce-1)+y(),n=Ce):(Ce>=we||A(e))&&(r+=ve.slice(n,Ce-1),o({},Fe.unfinishedString,r+String.fromCharCode(e)));return r+=ve.slice(n,Ce-1),{type:Le,value:r,line:De,lineStart:Ne,range:[$e,Ce]}}function d(){var e=b();return!1===e&&o(Me,Fe.expected,"[",Me.value),{type:Le,value:e,line:De,lineStart:Ne,range:[$e,Ce]}}function m(){var e=ve.charAt(Ce),t=ve.charAt(Ce+1),n="0"===e&&"xX".indexOf(t||null)>=0?g():v();return{type:Ae,value:n,line:De,lineStart:Ne,range:[$e,Ce]}}function g(){var e,t,n,r,i=0,s=1,a=1;for(r=Ce+=2,j(ve.charCodeAt(Ce))||o({},Fe.malformedNumber,ve.slice($e,Ce));j(ve.charCodeAt(Ce));)Ce++;if(e=parseInt(ve.slice(r,Ce),16),"."===ve.charAt(Ce)){for(t=++Ce;j(ve.charCodeAt(Ce));)Ce++;i=ve.slice(t,Ce),i=t===Ce?0:parseInt(i,16)/Math.pow(16,Ce-t)}if("pP".indexOf(ve.charAt(Ce)||null)>=0){for(Ce++,"+-".indexOf(ve.charAt(Ce)||null)>=0&&(a="+"===ve.charAt(Ce++)?1:-1),n=Ce,E(ve.charCodeAt(Ce))||o({},Fe.malformedNumber,ve.slice($e,Ce));E(ve.charCodeAt(Ce));)Ce++;s=ve.slice(n,Ce),s=Math.pow(2,s*a)}return(e+i)*s}function v(){for(;E(ve.charCodeAt(Ce));)Ce++;if("."===ve.charAt(Ce))for(Ce++;E(ve.charCodeAt(Ce));)Ce++;if("eE".indexOf(ve.charAt(Ce)||null)>=0)for(Ce++,"+-".indexOf(ve.charAt(Ce)||null)>=0&&Ce++,E(ve.charCodeAt(Ce))||o({},Fe.malformedNumber,ve.slice($e,Ce));E(ve.charCodeAt(Ce));)Ce++;return parseFloat(ve.slice($e,Ce))}function y(){var e=Ce;switch(ve.charAt(Ce)){case"n":return Ce++,"\n";case"r":return Ce++,"\r";case"t":return Ce++,"\t";case"v":return Ce++,"\v";case"b":return Ce++,"\b";case"f":return Ce++,"\f";case"z":return Ce++,u(),"";case"x":return j(ve.charCodeAt(Ce+1))&&j(ve.charCodeAt(Ce+2))?(Ce+=3,"\\"+ve.slice(e,Ce)):"\\"+ve.charAt(Ce++);default:if(E(ve.charCodeAt(Ce))){for(;E(ve.charCodeAt(++Ce)););return"\\"+ve.slice(e,Ce)}return ve.charAt(Ce++)}}function w(){$e=Ce,Ce+=2;var e=ve.charAt(Ce),t="",n=!1,r=Ce,i=Ne,o=De;if("["===e&&(!1===(t=b())?t=e:n=!0),!n){for(;Ce<we&&!A(ve.charCodeAt(Ce));)Ce++;ye.comments&&(t=ve.slice(r,Ce))}if(ye.comments){var s=qe.comment(t,ve.slice($e,Ce));ye.locations&&(s.loc={start:{line:o,column:$e-i},end:{line:De,column:Ce-Ne}}),ye.ranges&&(s.range=[$e,Ce]),Re.push(s)}}function b(){var e,t,n=0,r="",i=!1;for(Ce++;"="===ve.charAt(Ce+n);)n++;if("["!==ve.charAt(Ce+n))return!1;for(Ce+=n+1,A(ve.charCodeAt(Ce))&&(De++,Ne=Ce++),t=Ce;Ce<we;){if(e=ve.charAt(Ce++),A(e.charCodeAt(0))&&(De++,Ne=Ce),"]"===e){i=!0;for(var o=0;o<n;o++)"="!==ve.charAt(Ce+o)&&(i=!1);"]"!==ve.charAt(Ce+n)&&(i=!1)}if(i)break}return r+=ve.slice(t,Ce-1),Ce+=n+1,r}function x(){ke=Me,Me=Te,Te=c()}function L(e){return e===Me.value&&(x(),!0)}function _(e){e===Me.value?x():o(Me,Fe.expected,e,Me.value)}function S(e){return 9===e||32===e||11===e||12===e}function A(e){return 10===e||13===e}function E(e){return e>=48&&e<=57}function j(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function O(e){return e>=65&&e<=90||e>=97&&e<=122||95===e}function P(e){return e>=65&&e<=90||e>=97&&e<=122||95===e||e>=48&&e<=57}function C(e){switch(e.length){case 2:return"do"===e||"if"===e||"in"===e||"or"===e;case 3:return"and"===e||"end"===e||"for"===e||"not"===e;case 4:return"else"===e||"goto"===e||"then"===e;case 5:return"break"===e||"local"===e||"until"===e||"while"===e;case 6:return"elseif"===e||"repeat"===e||"return"===e;case 8:return"function"===e}return!1}function M(e){return Ee===e.type?"#-~".indexOf(e.value)>=0:_e===e.type&&"not"===e.value}function k(e){switch(e.type){case"CallExpression":case"TableCallExpression":case"StringCallExpression":return!0}return!1}function T(e){if(xe===e.type)return!0;if(_e!==e.type)return!1;switch(e.value){case"else":case"elseif":case"end":case"until":return!0;default:return!1}}function R(){ze.push(Array.apply(null,ze[Ve++]))}function $(){ze.pop(),Ve--}function D(e){-1===Ue(ze[Ve],e)&&ze[Ve].push(e)}function N(e){D(e.name),F(e,!0)}function F(e,t){!t&&-1===n(He,"name",e.name)&&He.push(e),e.isLocal=t}function q(e){return-1!==Ue(ze[Ve],e)}function I(){return new U(Me)}function U(e){ye.locations&&(this.loc={start:{line:e.line,column:e.range[0]-e.lineStart},end:{line:0,column:0}}),ye.ranges&&(this.range=[e.range[0],0])}function z(){Be&&Ge.push(I())}function V(e){Be&&Ge.push(e)}function H(){x(),z();var e=B();return xe!==Me.type&&a(Me),Be&&!e.length&&(ke=Me),t(qe.chunk(e))}function B(e){var t,n=[];for(ye.scope&&R();!T(Me);){if("return"===Me.value){n.push(G());break}(t=G())&&n.push(t)}return ye.scope&&$(),n}function G(){if(z(),_e===Me.type)switch(Me.value){case"local":return x(),ne();case"if":return x(),ee();case"return":return x(),Z();case"function":return x(),oe(se());case"while":return x(),Q();case"for":return x(),te();case"repeat":return x(),Y();case"break":return x(),X();case"do":return x(),J();case"goto":return x(),W()}return Ee===Me.type&&L("::")?K():(Be&&Ge.pop(),L(";")?void 0:re())}function K(){var e=Me.value,n=ie();return ye.scope&&(D("::"+e+"::"),F(n,!0)),_("::"),t(qe.labelStatement(n))}function X(){return t(qe.breakStatement())}function W(){var e=Me.value,n=ie();return ye.scope&&(n.isLabel=q("::"+e+"::")),t(qe.gotoStatement(n))}function J(){var e=B();return _("end"),t(qe.doStatement(e))}function Q(){var e=ue();_("do");var n=B();return _("end"),t(qe.whileStatement(e,n))}function Y(){var e=B();_("until");var n=ue();return t(qe.repeatStatement(n,e))}function Z(){var e=[];if("end"!==Me.value){var n=ce();for(null!=n&&e.push(n);L(",");)n=ue(),e.push(n);L(";")}return t(qe.returnStatement(e))}function ee(){var e,n,r,i=[];for(Be&&(r=Ge[Ge.length-1],Ge.push(r)),e=ue(),_("then"),n=B(),i.push(t(qe.ifClause(e,n))),Be&&(r=I());L("elseif");)V(r),e=ue(),_("then"),n=B(),i.push(t(qe.elseifClause(e,n))),Be&&(r=I());return L("else")&&(Be&&(r=new U(ke),Ge.push(r)),n=B(),i.push(t(qe.elseClause(n)))),_("end"),t(qe.ifStatement(i))}function te(){var e,n=ie();if(ye.scope&&N(n),L("=")){var r=ue();_(",");var i=ue(),o=L(",")?ue():null;return _("do"),e=B(),_("end"),t(qe.forNumericStatement(n,r,i,o,e))}for(var s=[n];L(",");)n=ie(),ye.scope&&N(n),s.push(n);_("in");var a=[];do{var c=ue();a.push(c)}while(L(","));return _("do"),e=B(),_("end"),t(qe.forGenericStatement(s,a,e))}function ne(){var e;if(Se===Me.type){var n=[],r=[];do{e=ie(),n.push(e)}while(L(","));if(L("="))do{var i=ue();r.push(i)}while(L(","));if(ye.scope)for(var o=0,a=n.length;o<a;o++)N(n[o]);return t(qe.localStatement(n,r))}if(L("function"))return e=ie(),ye.scope&&N(e),oe(e,!0);s("<name>",Me)}function re(){var e,n,r=Me;if(Be&&(n=I()),null==(e=fe()))return a(Me);if(",=".indexOf(Me.value)>=0){for(var i,o=[e],c=[];L(",");)null==(i=fe())&&s("<expression>",Me),o.push(i);_("=");do{i=ue(),c.push(i)}while(L(","));return V(n),t(qe.assignmentStatement(o,c))}return k(e)?(V(n),t(qe.callStatement(e))):a(r)}function ie(){z();var e=Me.value;return Se!==Me.type&&s("<name>",Me),x(),t(qe.identifier(e))}function oe(e,n){var r=[];if(_("("),!L(")"))for(;;)if(Se===Me.type){var i=ie();if(ye.scope&&N(i),r.push(i),L(","))continue;if(L(")"))break}else{if(Pe===Me.type){r.push(de()),_(")");break}s("<name> or '...'",Me)}var o=B();return _("end"),n=n||!1,t(qe.functionStatement(e,r,n,o))}function se(){var e,n,r;for(Be&&(r=I()),e=ie(),ye.scope&&F(e,!1);L(".");)V(r),n=ie(),ye.scope&&F(n,!1),e=t(qe.memberExpression(e,".",n));return L(":")&&(V(r),n=ie(),ye.scope&&F(n,!1),e=t(qe.memberExpression(e,":",n))),e}function ae(){for(var e,n,r=[];;){if(z(),Ee===Me.type&&L("["))e=ue(),_("]"),_("="),n=ue(),r.push(t(qe.tableKey(e,n)));else if(Se===Me.type)e=ue(),L("=")?(n=ue(),r.push(t(qe.tableKeyString(e,n)))):r.push(t(qe.tableValue(e)));else{if(null==(n=ce())){Ge.pop();break}r.push(t(qe.tableValue(n)))}if(",;".indexOf(Me.value)>=0)x();else if("}"===Me.value)break}return _("}"),t(qe.tableConstructorExpression(r))}function ce(){return he(0)}function ue(){var e=ce();if(null!=e)return e;s("<expression>",Me)}function le(e){var t=e.charCodeAt(0),n=e.length;if(1===n)switch(t){case 94:return 10;case 42:case 47:case 37:return 7;case 43:case 45:return 6;case 60:case 62:return 3;case 38:case 124:return 7}else if(2===n)switch(t){case 46:return 5;case 60:case 62:case 61:case 126:return 3;case 111:return 1}else if(97===t&&"and"===e)return 2;return 0}function he(e){var n,r,i=Me.value;if(Be&&(r=I()),M(Me)){z(),x();var o=he(8);null==o&&s("<expression>",Me),n=t(qe.unaryExpression(i,o))}if(null==n&&null==(n=de())&&(n=fe()),null==n)return null;for(var a;i=Me.value,!(0===(a=Ee===Me.type||_e===Me.type?le(i):0)||a<=e);){("^"===i||".."===i)&&a--,x();var c=he(a);null==c&&s("<expression>",Me),Be&&Ge.push(r),n=t(qe.binaryExpression(i,n,c))}return n}function fe(){var e,n,r,i;if(Be&&(r=I()),Se===Me.type)n=Me.value,e=ie(),ye.scope&&F(e,i=q(n));else{if(!L("("))return null;e=ue(),_(")"),ye.scope&&(i=e.isLocal)}for(var o,s;;)if(Ee===Me.type)switch(Me.value){case"[":V(r),x(),o=ue(),e=t(qe.indexExpression(e,o)),_("]");break;case".":V(r),x(),s=ie(),ye.scope&&F(s,i),e=t(qe.memberExpression(e,".",s));break;case":":V(r),x(),s=ie(),ye.scope&&F(s,i),e=t(qe.memberExpression(e,":",s)),V(r),e=pe(e);break;case"(":case"{":V(r),e=pe(e);break;default:return e}else{if(Le!==Me.type)break;V(r),e=pe(e)}return e}function pe(e){if(Ee===Me.type)switch(Me.value){case"(":x();var n=[],r=ce();for(null!=r&&n.push(r);L(",");)r=ue(),n.push(r);return _(")"),t(qe.callExpression(e,n));case"{":z(),x();var i=ae();return t(qe.tableCallExpression(e,i))}else if(Le===Me.type)return t(qe.stringCallExpression(e,de()));s("function arguments",Me)}function de(){var e,n=Le|Ae|je|Oe|Pe,r=Me.value,i=Me.type;if(Be&&(e=I()),i&n){V(e);var o=ve.slice(Me.range[0],Me.range[1]);return x(),t(qe.literal(i,r,o))}return _e===i&&"function"===r?(V(e),x(),oe(null)):L("{")?(V(e),ae()):void 0}function me(t){return ve+=String(t),we=ve.length,e}function ge(e){void 0!==e&&me(e),we=ve.length,Be=ye.locations||ye.ranges,Te=c();var t=H();if(ye.comments&&(t.comments=Re),ye.scope&&(t.globals=He),Ge.length>0)throw new Error("Location tracking failed. This is most likely a bug in luaparse");return t}e.version="0.1.4";var ve,ye,we,be=e.defaultOptions={wait:!1,comments:!0,scope:!1,locations:!1,ranges:!1},xe=1,Le=2,_e=4,Se=8,Ae=16,Ee=32,je=64,Oe=128,Pe=256;e.tokenTypes={EOF:xe,StringLiteral:Le,Keyword:_e,Identifier:Se,NumericLiteral:Ae,Punctuator:Ee,BooleanLiteral:je,NilLiteral:Oe,VarargLiteral:Pe};var Ce,Me,ke,Te,Re,$e,De,Ne,Fe=e.errors={unexpected:"Unexpected %1 '%2' near '%3'",expected:"'%1' expected near '%2'",expectedToken:"%1 expected near '%2'",unfinishedString:"unfinished string near '%1'",malformedNumber:"malformed number near '%1'"},qe=e.ast={labelStatement:function(e){return{type:"LabelStatement",label:e}},breakStatement:function(){return{type:"BreakStatement"}},gotoStatement:function(e){return{type:"GotoStatement",label:e}},returnStatement:function(e){return{type:"ReturnStatement",arguments:e}},ifStatement:function(e){return{type:"IfStatement",clauses:e}},ifClause:function(e,t){return{type:"IfClause",condition:e,body:t}},elseifClause:function(e,t){return{type:"ElseifClause",condition:e,body:t}},elseClause:function(e){return{type:"ElseClause",body:e}},whileStatement:function(e,t){return{type:"WhileStatement",condition:e,body:t}},doStatement:function(e){return{type:"DoStatement",body:e}},repeatStatement:function(e,t){return{type:"RepeatStatement",condition:e,body:t}},localStatement:function(e,t){return{type:"LocalStatement",variables:e,init:t}},assignmentStatement:function(e,t){return{type:"AssignmentStatement",variables:e,init:t}},callStatement:function(e){return{type:"CallStatement",expression:e}},functionStatement:function(e,t,n,r){return{type:"FunctionDeclaration",identifier:e,isLocal:n,parameters:t,body:r}},forNumericStatement:function(e,t,n,r,i){return{type:"ForNumericStatement",variable:e,start:t,end:n,step:r,body:i}},forGenericStatement:function(e,t,n){return{type:"ForGenericStatement",variables:e,iterators:t,body:n}},chunk:function(e){return{type:"Chunk",body:e}},identifier:function(e){return{type:"Identifier",name:e}},literal:function(e,t,n){return e=e===Le?"StringLiteral":e===Ae?"NumericLiteral":e===je?"BooleanLiteral":e===Oe?"NilLiteral":"VarargLiteral",{type:e,value:t,raw:n}},tableKey:function(e,t){return{type:"TableKey",key:e,value:t}},tableKeyString:function(e,t){return{type:"TableKeyString",key:e,value:t}},tableValue:function(e){return{type:"TableValue",value:e}},tableConstructorExpression:function(e){return{type:"TableConstructorExpression",fields:e}},binaryExpression:function(e,t,n){return{type:"and"===e||"or"===e?"LogicalExpression":"BinaryExpression",operator:e,left:t,right:n}},unaryExpression:function(e,t){return{type:"UnaryExpression",operator:e,argument:t}},memberExpression:function(e,t,n){return{type:"MemberExpression",indexer:t,identifier:n,base:e}},indexExpression:function(e,t){return{type:"IndexExpression",base:e,index:t}},callExpression:function(e,t){return{type:"CallExpression",base:e,arguments:t}},tableCallExpression:function(e,t){return{type:"TableCallExpression",base:e,arguments:t}},stringCallExpression:function(e,t){return{type:"StringCallExpression",base:e,argument:t}},comment:function(e,t){return{type:"Comment",value:e,raw:t}}},Ie=Array.prototype.slice,Ue=(Object.prototype.toString,function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1});e.lex=c;var ze,Ve,He,Be,Ge=[];U.prototype.complete=function(){ye.locations&&(this.loc.end.line=ke.line,this.loc.end.column=ke.range[1]-ke.lineStart),ye.ranges&&(this.range[1]=ke.range[1])},e.parse=function(t,n){return void 0===n&&"object"==typeof t&&(n=t,t=void 0),n||(n={}),ve=t||"",ye=i(be,n),Ce=0,De=1,Ne=0,we=ve.length,ze=[[]],Ve=0,He=[],Ge=[],ye.comments&&(Re=[]),ye.wait?e:ge()},e.write=me,e.end=ge})}),ace.define("ace/mode/lua_worker",[],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../worker/mirror").Mirror,o=e("../mode/lua/luaparse"),s=t.Worker=function(e){i.call(this,e),this.setTimeout(500)};r.inherits(s,i),function(){this.onUpdate=function(){var e=this.doc.getValue(),t=[];try{o.parse(e)}catch(e){e instanceof SyntaxError&&t.push({row:e.line-1,column:e.column,text:e.message,type:"error"})}this.sender.emit("annotate",t)}}.call(s.prototype)}),ace.define("ace/lib/es5-shim",[],function(e,t,n){function r(){}function i(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(e){}}function o(e){return(e=+e)!==e?e=0:0!==e&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=d.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(d.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(d.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var s,a,c,u,l,h=Function.prototype.call,f=Array.prototype,p=Object.prototype,d=f.slice,m=h.bind(p.toString),g=h.bind(p.hasOwnProperty);if((l=g(p,"__defineGetter__"))&&(s=h.bind(p.__defineGetter__),a=h.bind(p.__defineSetter__),c=h.bind(p.__lookupGetter__),u=h.bind(p.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var v=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?v.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):void 0==e?e=0:e<0&&(e=Math.max(n+e,0)),e+t<n||(t=n-e);var r=this.slice(e,e+t),i=d.call(arguments,2),o=i.length;if(e===n)o&&this.push.apply(this,i);else{var s=Math.min(t,n-e),a=e+s,c=a+o-s,u=n-a,l=n-s;if(c<a)for(var h=0;h<u;++h)this[c+h]=this[a+h];else if(c>a)for(h=u;h--;)this[c+h]=this[a+h];if(o&&e===l)this.length=l,this.push.apply(this,i);else for(this.length=l+o,h=0;h<o;++h)this[e+h]=i[h]}return r};Array.isArray||(Array.isArray=function(e){return"[object Array]"==m(e)});var y=Object("a"),w="a"!=y[0]||!(0 in y);if(Array.prototype.forEach||(Array.prototype.forEach=function(e){var t=M(this),n=w&&"[object String]"==m(this)?this.split(""):t,r=arguments[1],i=-1,o=n.length>>>0;if("[object Function]"!=m(e))throw new TypeError;for(;++i<o;)i in n&&e.call(r,n[i],i,t)}),Array.prototype.map||(Array.prototype.map=function(e){var t=M(this),n=w&&"[object String]"==m(this)?this.split(""):t,r=n.length>>>0,i=Array(r),o=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var s=0;s<r;s++)s in n&&(i[s]=e.call(o,n[s],s,t));return i}),Array.prototype.filter||(Array.prototype.filter=function(e){var t,n=M(this),r=w&&"[object String]"==m(this)?this.split(""):n,i=r.length>>>0,o=[],s=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var a=0;a<i;a++)a in r&&(t=r[a],e.call(s,t,a,n)&&o.push(t));return o}),Array.prototype.every||(Array.prototype.every=function(e){var t=M(this),n=w&&"[object String]"==m(this)?this.split(""):t,r=n.length>>>0,i=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var o=0;o<r;o++)if(o in n&&!e.call(i,n[o],o,t))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(e){var t=M(this),n=w&&"[object String]"==m(this)?this.split(""):t,r=n.length>>>0,i=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var o=0;o<r;o++)if(o in n&&e.call(i,n[o],o,t))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(e){var t=M(this),n=w&&"[object String]"==m(this)?this.split(""):t,r=n.length>>>0;if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,o=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(o in n){i=n[o++];break}if(++o>=r)throw new TypeError("reduce of empty array with no initial value")}for(;o<r;o++)o in n&&(i=e.call(void 0,i,n[o],o,t));return i}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(e){var t=M(this),n=w&&"[object String]"==m(this)?this.split(""):t,r=n.length>>>0;if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,o=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(o in n){i=n[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}do{o in this&&(i=e.call(void 0,i,n[o],o,t))}while(o--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=w&&"[object String]"==m(this)?this.split(""):M(this),n=t.length>>>0;if(!n)return-1;var r=0;for(arguments.length>1&&(r=o(arguments[1])),r=r>=0?r:Math.max(0,n+r);r<n;r++)if(r in t&&t[r]===e)return r;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(e){var t=w&&"[object String]"==m(this)?this.split(""):M(this),n=t.length>>>0;if(!n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,o(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:p)}),!Object.getOwnPropertyDescriptor){Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(g(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=p;var i=c(e,t),o=u(e,t);if(e.__proto__=r,i||o)return i&&(n.get=i),o&&(n.set=o),n}return n.value=e[t],n}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),!Object.create){var b;b=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=b();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}}if(Object.defineProperty){var x=i({}),L="undefined"==typeof document||i(document.createElement("div"));if(!x||!L)var _=Object.defineProperty}if(!Object.defineProperty||_){Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(_)try{return _.call(Object,e,t,n)}catch(e){}if(g(n,"value"))if(l&&(c(e,t)||u(e,t))){var r=e.__proto__;e.__proto__=p,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");g(n,"get")&&s(e,t,n.get),g(n,"set")&&a(e,t,n.set)}return e}}Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)g(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=function(e){return function(t){return"function"==typeof t?t:e(t)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";g(e,t);)t+="?";e[t]=!0;var n=g(e,t);return delete e[t],n}),!Object.keys){var S=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],E=A.length;for(var j in{toString:null})S=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)g(e,n)&&t.push(n);if(S)for(var r=0,i=E;r<i;r++){var o=A[r];g(e,o)&&t.push(o)}return t}}Date.now||(Date.now=function(){return(new Date).getTime()});var O="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff";if(!String.prototype.trim||O.trim()){O="["+O+"]";var P=new RegExp("^"+O+O+"*"),C=new RegExp(O+O+"*$");String.prototype.trim=function(){return String(this).replace(P,"").replace(C,"")}}var M=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}});
     1 "no use strict";!function(o){if(!(void 0!==o.window&&o.document||o.require&&o.define)){o.console||(o.console=function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})},o.console.error=o.console.warn=o.console.log=o.console.trace=o.console),((o.window=o).ace=o).onerror=function(e,t,n,r,i){postMessage({type:"error",data:{message:e,data:i.data,file:t,line:n,col:r,stack:i.stack}})},o.normalizeModule=function(e,t){if(-1!==t.indexOf("!")){var n=t.split("!");return o.normalizeModule(e,n[0])+"!"+o.normalizeModule(e,n[1])}if("."==t.charAt(0)){var r=e.split("/").slice(0,-1).join("/");for(t=(r?r+"/":"")+t;-1!==t.indexOf(".")&&i!=t;){var i=t;t=t.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t},o.require=function(e,t){if(t||(t=e,e=null),!t.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");t=o.normalizeModule(e,t);var n=o.require.modules[t];if(n)return n.initialized||(n.initialized=!0,n.exports=n.factory().exports),n.exports;if(!o.require.tlns)return console.log("unable to load "+t);var r=function(e,t){for(var n=e,r="";n;){var i=t[n];if("string"==typeof i)return i+r;if(i)return i.location.replace(/\/*$/,"/")+(r||i.main||i.name);if(!1===i)return"";var o=n.lastIndexOf("/");if(-1===o)break;r=n.substr(o)+r,n=n.slice(0,o)}return e}(t,o.require.tlns);return".js"!=r.slice(-3)&&(r+=".js"),o.require.id=t,o.require.modules[t]={},importScripts(r),o.require(e,t)},o.require.modules={},o.require.tlns={},o.define=function(t,n,r){if(2==arguments.length?(r=n,"string"!=typeof t&&(n=t,t=o.require.id)):1==arguments.length&&(r=t,n=[],t=o.require.id),"function"==typeof r){n.length||(n=["require","exports","module"]);var i=function(e){return o.require(t,e)};o.require.modules[t]={exports:{},factory:function(){var t=this,e=r.apply(this,n.slice(0,r.length).map(function(e){switch(e){case"require":return i;case"exports":return t.exports;case"module":return t;default:return i(e)}}));return e&&(t.exports=e),t}}}else o.require.modules[t]={exports:r,initialized:!0}},o.define.amd={},require.tlns={},o.initBaseUrls=function(e){for(var t in e)require.tlns[t]=e[t]},o.initSender=function(){var e=o.require("ace/lib/event_emitter").EventEmitter,t=o.require("ace/lib/oop"),n=function(){};return function(){t.implement(this,e),this.callback=function(e,t){postMessage({type:"call",id:t,data:e})},this.emit=function(e,t){postMessage({type:"event",name:e,data:t})}}.call(n.prototype),new n};var r=o.main=null,i=o.sender=null;o.onmessage=function(e){var t=e.data;if(t.event&&i)i._signal(t.event,t.data);else if(t.command)if(r[t.command])r[t.command].apply(r,t.args);else{if(!o[t.command])throw new Error("Unknown command:"+t.command);o[t.command].apply(o,t.args)}else if(t.init){o.initBaseUrls(t.tlns),require("ace/lib/es5-shim"),i=o.sender=o.initSender();var n=require(t.module)[t.classname];r=o.main=new n(i)}}}}(this),ace.define("ace/lib/oop",[],function(e,n,t){"use strict";n.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},n.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},n.implement=function(e,t){n.mixin(e,t)}}),ace.define("ace/range",[],function(e,t,n){"use strict";var o=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&(!this.isEnd(e,t)&&!this.isStart(e,t))},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:t<this.start.column?-1:t>this.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.row<e)n={row:e,column:0};if(this.start.row>t)var r={row:t+1,column:0};else if(this.start.row<e)r={row:e,column:0};return o.fromPoints(r||this.start,n||this.end)},this.extend=function(e,t){var n=this.compare(e,t);if(0==n)return this;if(-1==n)var r={row:e,column:t};else var i={row:e,column:t};return o.fromPoints(r||this.start,i||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return o.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new o(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new o(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),n=e.documentToScreenPosition(this.end);return new o(t.row,t.column,n.row,n.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(o.prototype),o.fromPoints=function(e,t){return new o(e.row,e.column,t.row,t.column)},o.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},o.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=o}),ace.define("ace/apply_delta",[],function(e,t,n){"use strict";t.applyDelta=function(e,t,n){var r=t.start.row,i=t.start.column,o=e[r]||"";switch(t.action){case"insert":if(1===t.lines.length)e[r]=o.substring(0,i)+t.lines[0]+o.substring(i);else{var s=[r,1].concat(t.lines);e.splice.apply(e,s),e[r]=o.substring(0,i)+e[r],e[r+t.lines.length-1]+=o.substring(i)}break;case"remove":var a=t.end.column,c=t.end.row;r===c?e[r]=o.substring(0,i)+o.substring(a):e.splice(r,c-r+1,o.substring(0,i)+e[c].substring(a))}}}),ace.define("ace/lib/event_emitter",[],function(e,t,n){"use strict";var r={},o=function(){this.propagationStopped=!0},s=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(n.length||r){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=o),t.preventDefault||(t.preventDefault=s),n=n.slice();for(var i=0;i<n.length&&(n[i](t,this),!t.propagationStopped);i++);return r&&!t.defaultPrevented?r(t,this):void 0}},r._signal=function(e,t){var n=(this._eventRegistry||{})[e];if(n){n=n.slice();for(var r=0;r<n.length;r++)n[r](t,this)}},r.once=function(t,n){var r=this;if(this.addEventListener(t,function e(){r.removeEventListener(t,e),n.apply(null,arguments)}),!n)return new Promise(function(e){n=e})},r.setDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n||(n=this._defaultHandlers={_disabled_:{}}),n[e]){var r=n[e],i=n._disabled_[e];i||(n._disabled_[e]=i=[]),i.push(r);var o=i.indexOf(t);-1!=o&&i.splice(o,1)}n[e]=t},r.removeDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n){var r=n._disabled_[e];if(n[e]==t)r&&this.setDefaultHandler(e,r.pop());else if(r){var i=r.indexOf(t);-1!=i&&r.splice(i,1)}}},r.on=r.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[e];return r||(r=this._eventRegistry[e]=[]),-1==r.indexOf(t)&&r[n?"unshift":"push"](t),t},r.off=r.removeListener=r.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}},r.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=r}),ace.define("ace/anchor",[],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,o=t.Anchor=function(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===n?this.setPosition(t.row,t.column):this.setPosition(t,n)};(function(){function l(e,t,n){var r=n?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&r}r.implement(this,i),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){if(!(e.start.row==e.end.row&&e.start.row!=this.row||e.start.row>this.row)){var t,n,r,i,o,s,a,c,u=(t=e,n={row:this.row,column:this.column},r=this.$insertRight,i="insert"==t.action,o=(i?1:-1)*(t.end.row-t.start.row),s=(i?1:-1)*(t.end.column-t.start.column),a=t.start,c=i?a:t.end,l(n,a,r)?{row:n.row,column:n.column}:l(c,n,!r)?{row:n.row+o,column:n.column+(n.row==c.row?s:0)}:{row:a.row,column:a.column});this.setPosition(u.row,u.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(o.prototype)}),ace.define("ace/document",[],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,o=e("./lib/event_emitter").EventEmitter,l=e("./range").Range,s=e("./anchor").Anchor,a=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,o),this.setValue=function(e){var t=this.getLength()-1;this.remove(new l(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new s(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:n<=e&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))<this.getLength()?(t=t.concat([""]),n=0):(t=[""].concat(t),e--,n=this.$lines[e].length),this.insertMergedLines({row:e,column:n},t)},this.insertMergedLines=function(e,t){var n=this.clippedPos(e.row,e.column),r={row:n.row+t.length-1,column:(1==t.length?n.column:0)+t[t.length-1].length};return this.applyDelta({start:n,end:r,action:"insert",lines:t}),this.clonePos(r)},this.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),n=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:n,action:"remove",lines:this.getLinesForRange({start:t,end:n})}),this.clonePos(t)},this.removeInLine=function(e,t,n){var r=this.clippedPos(e,t),i=this.clippedPos(e,n);return this.applyDelta({start:r,end:i,action:"remove",lines:this.getLinesForRange({start:r,end:i})},!0),this.clonePos(r)},this.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);var n=(t=Math.min(Math.max(0,t),this.getLength()-1))==this.getLength()-1&&0<e,r=t<this.getLength()-1,i=n?e-1:e,o=n?this.getLine(i).length:0,s=r?t+1:t,a=r?0:this.getLine(s).length,c=new l(i,o,s,a),u=this.$lines.slice(e,t+1);return this.applyDelta({start:c.start,end:c.end,action:"remove",lines:this.getLinesForRange(c)}),u},this.removeNewLine=function(e){e<this.getLength()-1&&0<=e&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof l||(e=l.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},this.revertDeltas=function(e){for(var t=e.length-1;0<=t;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!l.comparePoints(e.start,e.end))||(n&&2e4<e.lines.length?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,o=e.start.column,s=0,a=0;s<r;s=a){a+=t-1;var c=n.slice(s,a);c.push(""),this.applyDelta({start:this.pos(i+s,o),end:this.pos(i+a,o=0),action:e.action,lines:c},!0)}e.lines=n.slice(s),e.start.row=i+s,e.start.column=o,this.applyDelta(e,!0)},this.revertDelta=function(e){this.applyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,t){for(var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,i=t||0,o=n.length;i<o;i++)if((e-=n[i].length+r)<0)return{row:i,column:e+n[i].length+r};return{row:o-1,column:e+n[o-1].length+r}},this.positionToIndex=function(e,t){for(var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,i=0,o=Math.min(e.row,n.length),s=t||0;s<o;++s)i+=n[s].length+r;return i+e.column}}).call(a.prototype),t.Document=a}),ace.define("ace/lib/lang",[],function(e,t,n){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var n="";0<t;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;n<r;n++)e[n]&&"object"==typeof e[n]?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;var n;if(Array.isArray(t)){n=[];for(var r=0;r<t.length;r++)n[r]=e(t[r]);return n}if("[object Object]"!==Object.prototype.toString.call(t))return t;for(var r in n={},t)n[r]=e(t[r]);return n},t.arrayToMap=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},r=function(e){return r.cancel(),t=setTimeout(n,e||0),r};return(r.schedule=r).call=function(){return this.cancel(),e(),r},r.cancel=function(){return clearTimeout(t),t=null,r},r.isPending=function(){return t},r},t.delayedCall=function(e,t){var n=null,r=function(){n=null,e()},i=function(e){null==n&&(n=setTimeout(r,e||t))};return i.delay=function(e){n&&clearTimeout(n),n=setTimeout(r,e||t)},(i.schedule=i).call=function(){this.cancel(),e()},i.cancel=function(){n&&clearTimeout(n),n=null},i.isPending=function(){return n},i}}),ace.define("ace/worker/mirror",[],function(e,t,n){"use strict";e("../range").Range;var r=e("../document").Document,a=e("../lib/lang"),i=t.Mirror=function(e){this.sender=e;var i=this.doc=new r(""),o=this.deferredUpdate=a.delayedCall(this.onUpdate.bind(this)),s=this;e.on("change",function(e){var t=e.data;if(t[0].start)i.applyDeltas(t);else for(var n=0;n<t.length;n+=2){if(Array.isArray(t[n+1]))var r={action:"insert",start:t[n],lines:t[n+1]};else r={action:"remove",start:t[n],end:t[n+1]};i.applyDelta(r,!0)}if(s.$timeout)return o.schedule(s.$timeout);s.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(e){this.$timeout=e},this.setValue=function(e){this.doc.setValue(e),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(e){this.sender.callback(this.doc.getValue(),e)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(i.prototype)}),ace.define("ace/mode/lua/luaparse",[],function(e,t,n){!function(n){"use strict";function u(e){if(ge){var t=ve.pop();t.complete(),H.locations&&(e.loc=t.loc),H.ranges&&(e.range=t.range)}return e}function i(e){var n=fe.call(arguments,1);return e=e.replace(/%(\d)/g,function(e,t){return""+n[t-1]||""})}function a(e){var t,n,r=i.apply(null,fe.call(arguments,1));throw void 0!==e.line?(n=e.range[0]-e.lineStart,(t=new SyntaxError(i("[%1:%2] %3",e.line,n,r))).line=e.line,t.index=e.range[0]):(n=ne-ue+1,(t=new SyntaxError(i("[%1:%2] %3",ce,n,r))).index=ne,t.line=ce),t.column=n,t}function l(e,t){a(t,le.expectedToken,e,t.value)}function s(e,t){if(void 0===t&&(t=oe.value),void 0!==e.type){var n;switch(e.type){case X:n="string";break;case W:n="keyword";break;case J:n="identifier";break;case Q:n="number";break;case Y:n="symbol";break;case Z:n="boolean";break;case ee:return a(e,le.unexpected,"symbol","nil",t)}return a(e,le.unexpected,n,e.value,t)}return a(e,le.unexpected,"symbol",e,t)}function r(){for(o();45===V.charCodeAt(ne)&&45===V.charCodeAt(ne+1);)p(),o();if(B<=ne)return{type:K,value:"<eof>",line:ce,lineStart:ue,range:[ne,ne]};var e,t,n=V.charCodeAt(ne),r=V.charCodeAt(ne+1);if(ae=ne,65<=(e=n)&&e<=90||97<=e&&e<=122||95===e)return function(){for(var e,t,n;65<=(n=V.charCodeAt(++ne))&&n<=90||97<=n&&n<=122||95===n||48<=n&&n<=57;);return function(e){switch(e.length){case 2:return"do"===e||"if"===e||"in"===e||"or"===e;case 3:return"and"===e||"end"===e||"for"===e||"not"===e;case 4:return"else"===e||"goto"===e||"then"===e;case 5:return"break"===e||"local"===e||"until"===e||"while"===e;case 6:return"elseif"===e||"repeat"===e||"return"===e;case 8:return"function"===e}return!1}(e=V.slice(ae,ne))?t=W:"true"===e||"false"===e?(t=Z,e="true"===e):"nil"===e?(t=ee,e=null):t=J,{type:t,value:e,line:ce,lineStart:ue,range:[ae,ne]}}();switch(n){case 39:case 34:return function(){for(var e,t=V.charCodeAt(ne++),n=ne,r="";ne<B&&(e=V.charCodeAt(ne++),t!==e);)92===e?(r+=V.slice(n,ne-1)+f(),n=ne):(B<=ne||y(e))&&(r+=V.slice(n,ne-1),a({},le.unfinishedString,r+String.fromCharCode(e)));return r+=V.slice(n,ne-1),{type:X,value:r,line:ce,lineStart:ue,range:[ae,ne]}}();case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return h();case 46:return w(r)?h():46===r?46===V.charCodeAt(ne+2)?{type:te,value:"...",line:ce,lineStart:ue,range:[ae,ne+=3]}:c(".."):c(".");case 61:return c(61===r?"==":"=");case 62:return c(61===r?">=":">");case 60:return c(61===r?"<=":"<");case 126:return c(61===r?"~=":"~");case 58:return c(58===r?"::":":");case 91:return 91===r||61===r?(!1===(t=d())&&a(re,le.expected,"[",re.value),{type:X,value:t,line:ce,lineStart:ue,range:[ae,ne]}):c("[");case 42:case 47:case 94:case 37:case 44:case 123:case 125:case 93:case 40:case 41:case 59:case 35:case 45:case 43:case 38:case 124:return c(V.charAt(ne))}return s(V.charAt(ne))}function o(){for(;ne<B;){var e=V.charCodeAt(ne);if(9===(t=e)||32===t||11===t||12===t)ne++;else{if(!y(e))break;ce++,ue=++ne}}var t}function c(e){return ne+=e.length,{type:Y,value:e,line:ce,lineStart:ue,range:[ae,ne]}}function h(){var e=V.charAt(ne),t=V.charAt(ne+1),n="0"===e&&0<="xX".indexOf(t||null)?function(){var e,t,n,r,i=0,o=1,s=1;for(r=ne+=2,b(V.charCodeAt(ne))||a({},le.malformedNumber,V.slice(ae,ne));b(V.charCodeAt(ne));)ne++;if(e=parseInt(V.slice(r,ne),16),"."===V.charAt(ne)){for(t=++ne;b(V.charCodeAt(ne));)ne++;i=V.slice(t,ne),i=t===ne?0:parseInt(i,16)/Math.pow(16,ne-t)}if(0<="pP".indexOf(V.charAt(ne)||null)){for(ne++,0<="+-".indexOf(V.charAt(ne)||null)&&(s="+"===V.charAt(ne++)?1:-1),n=ne,w(V.charCodeAt(ne))||a({},le.malformedNumber,V.slice(ae,ne));w(V.charCodeAt(ne));)ne++;o=V.slice(n,ne),o=Math.pow(2,o*s)}return(e+i)*o}():function(){for(;w(V.charCodeAt(ne));)ne++;if("."===V.charAt(ne))for(ne++;w(V.charCodeAt(ne));)ne++;if(0<="eE".indexOf(V.charAt(ne)||null))for(ne++,0<="+-".indexOf(V.charAt(ne)||null)&&ne++,w(V.charCodeAt(ne))||a({},le.malformedNumber,V.slice(ae,ne));w(V.charCodeAt(ne));)ne++;return parseFloat(V.slice(ae,ne))}();return{type:Q,value:n,line:ce,lineStart:ue,range:[ae,ne]}}function f(){var e=ne;switch(V.charAt(ne)){case"n":return ne++,"\n";case"r":return ne++,"\r";case"t":return ne++,"\t";case"v":return ne++,"\v";case"b":return ne++,"\b";case"f":return ne++,"\f";case"z":return ne++,o(),"";case"x":return b(V.charCodeAt(ne+1))&&b(V.charCodeAt(ne+2))?(ne+=3,"\\"+V.slice(e,ne)):"\\"+V.charAt(ne++);default:if(w(V.charCodeAt(ne))){for(;w(V.charCodeAt(++ne)););return"\\"+V.slice(e,ne)}return V.charAt(ne++)}}function p(){ae=ne,ne+=2;var e=V.charAt(ne),t="",n=!1,r=ne,i=ue,o=ce;if("["===e&&(!1===(t=d())?t=e:n=!0),!n){for(;ne<B&&!y(V.charCodeAt(ne));)ne++;H.comments&&(t=V.slice(r,ne))}if(H.comments){var s=he.comment(t,V.slice(ae,ne));H.locations&&(s.loc={start:{line:o,column:ae-i},end:{line:ce,column:ne-ue}}),H.ranges&&(s.range=[ae,ne]),se.push(s)}}function d(){var e,t,n=0,r="",i=!1;for(ne++;"="===V.charAt(ne+n);)n++;if("["!==V.charAt(ne+n))return!1;for(ne+=n+1,y(V.charCodeAt(ne))&&(ce++,ue=ne++),t=ne;ne<B;){if(y((e=V.charAt(ne++)).charCodeAt(0))&&(ce++,ue=ne),"]"===e){i=!0;for(var o=0;o<n;o++)"="!==V.charAt(ne+o)&&(i=!1);"]"!==V.charAt(ne+n)&&(i=!1)}if(i)break}return r+=V.slice(t,ne-1),ne+=n+1,r}function m(){ie=re,re=oe,oe=r()}function g(e){return e===re.value&&(m(),!0)}function v(e){e===re.value?m():a(re,le.expected,e,re.value)}function y(e){return 10===e||13===e}function w(e){return 48<=e&&e<=57}function b(e){return 48<=e&&e<=57||97<=e&&e<=102||65<=e&&e<=70}function x(e){if(K===e.type)return!0;if(W!==e.type)return!1;switch(e.value){case"else":case"elseif":case"end":case"until":return!0;default:return!1}}function L(e){-1===t(pe[de],e)&&pe[de].push(e)}function _(e){L(e.name),S(e,!0)}function S(e,t){!t&&-1===function(e,t,n){for(var r=0,i=e.length;r<i;r++)if(e[r][t]===n)return r;return-1}(me,"name",e.name)&&me.push(e),e.isLocal=t}function A(e){return-1!==t(pe[de],e)}function E(){return new j(re)}function j(e){H.locations&&(this.loc={start:{line:e.line,column:e.range[0]-e.lineStart},end:{line:0,column:0}}),H.ranges&&(this.range=[e.range[0],0])}function O(){ge&&ve.push(E())}function P(e){ge&&ve.push(e)}function C(e){var t,n=[];for(H.scope&&pe.push(Array.apply(null,pe[de++]));!x(re);){if("return"===re.value){n.push(M());break}(t=M())&&n.push(t)}return H.scope&&(pe.pop(),de--),n}function M(){if(O(),W===re.type)switch(re.value){case"local":return m(),function(){var e;if(J===re.type){for(var t=[],n=[];e=k(),t.push(e),g(","););if(g("="))do{var r=D();n.push(r)}while(g(","));if(H.scope)for(var i=0,o=t.length;i<o;i++)_(t[i]);return u(he.localStatement(t,n))}if(g("function"))return e=k(),H.scope&&_(e),T(e,!0);l("<name>",re)}();case"if":return m(),function(){var e,t,n,r=[];for(ge&&(n=ve[ve.length-1],ve.push(n)),e=D(),v("then"),t=C(),r.push(u(he.ifClause(e,t))),ge&&(n=E());g("elseif");)P(n),e=D(),v("then"),t=C(),r.push(u(he.elseifClause(e,t))),ge&&(n=E());return g("else")&&(ge&&(n=new j(ie),ve.push(n)),t=C(),r.push(u(he.elseClause(t)))),v("end"),u(he.ifStatement(r))}();case"return":return m(),function(){var e=[];if("end"!==re.value){var t=$();for(null!=t&&e.push(t);g(",");)t=D(),e.push(t);g(";")}return u(he.returnStatement(e))}();case"function":m();var e=function(){var e,t,n;for(ge&&(n=E()),e=k(),H.scope&&S(e,!1);g(".");)P(n),t=k(),H.scope&&S(t,!1),e=u(he.memberExpression(e,".",t));return g(":")&&(P(n),t=k(),H.scope&&S(t,!1),e=u(he.memberExpression(e,":",t))),e}();return T(e);case"while":return m(),function(){var e=D();v("do");var t=C();return v("end"),u(he.whileStatement(e,t))}();case"for":return m(),function(){var e,t=k();if(H.scope&&_(t),g("=")){var n=D();v(",");var r=D(),i=g(",")?D():null;return v("do"),e=C(),v("end"),u(he.forNumericStatement(t,n,r,i,e))}for(var o=[t];g(",");)t=k(),H.scope&&_(t),o.push(t);v("in");var s=[];do{var a=D();s.push(a)}while(g(","));return v("do"),e=C(),v("end"),u(he.forGenericStatement(o,s,e))}();case"repeat":return m(),function(){var e=C();v("until");var t=D();return u(he.repeatStatement(t,e))}();case"break":return m(),u(he.breakStatement());case"do":return m(),r=C(),v("end"),u(he.doStatement(r));case"goto":return m(),t=re.value,n=k(),H.scope&&(n.isLabel=A("::"+t+"::")),u(he.gotoStatement(n))}var t,n,r,i,o;return Y===re.type&&g("::")?(i=re.value,o=k(),H.scope&&(L("::"+i+"::"),S(o,!0)),v("::"),u(he.labelStatement(o))):(ge&&ve.pop(),g(";")?void 0:function(){var e,t,n=re;if(ge&&(t=E()),null==(e=F()))return s(re);if(0<=",=".indexOf(re.value)){for(var r,i=[e],o=[];g(",");)null==(r=F())&&l("<expression>",re),i.push(r);for(v("=");r=D(),o.push(r),g(","););return P(t),u(he.assignmentStatement(i,o))}return function(e){switch(e.type){case"CallExpression":case"TableCallExpression":case"StringCallExpression":return!0}return!1}(e)?(P(t),u(he.callStatement(e))):s(n)}())}function k(){O();var e=re.value;return J!==re.type&&l("<name>",re),m(),u(he.identifier(e))}function T(e,t){var n=[];if(v("("),!g(")"))for(;;)if(J===re.type){var r=k();if(H.scope&&_(r),n.push(r),g(","))continue;if(g(")"))break}else{if(te===re.type){n.push(I()),v(")");break}l("<name> or '...'",re)}var i=C();return v("end"),t=t||!1,u(he.functionStatement(e,n,t,i))}function R(){for(var e,t,n=[];;){if(O(),Y===re.type&&g("["))e=D(),v("]"),v("="),t=D(),n.push(u(he.tableKey(e,t)));else if(J===re.type)e=D(),g("=")?(t=D(),n.push(u(he.tableKeyString(e,t)))):n.push(u(he.tableValue(e)));else{if(null==(t=$())){ve.pop();break}n.push(u(he.tableValue(t)))}if(0<=",;".indexOf(re.value))m();else if("}"===re.value)break}return v("}"),u(he.tableConstructorExpression(n))}function $(){var e=function e(t){var n,r,i,o,s=re.value;if(ge&&(r=E()),Y===(i=re).type?0<="#-~".indexOf(i.value):W===i.type&&"not"===i.value){O(),m();var a=e(8);null==a&&l("<expression>",re),n=u(he.unaryExpression(s,a))}if(null==n&&(null==(n=I())&&(n=F())),null==n)return null;for(;s=re.value,!(0===(o=Y===re.type||W===re.type?N(s):0)||o<=t);){("^"===s||".."===s)&&o--,m();var c=e(o);null==c&&l("<expression>",re),ge&&ve.push(r),n=u(he.binaryExpression(s,n,c))}return n}(0);return e}function D(){var e=$();if(null!=e)return e;l("<expression>",re)}function N(e){var t=e.charCodeAt(0),n=e.length;if(1===n)switch(t){case 94:return 10;case 42:case 47:case 37:return 7;case 43:case 45:return 6;case 60:case 62:return 3;case 38:case 124:return 7}else if(2===n)switch(t){case 46:return 5;case 60:case 62:case 61:case 126:return 3;case 111:return 1}else if(97===t&&"and"===e)return 2;return 0}function F(){var e,t,n,r,i,o;if(ge&&(n=E()),J===re.type)t=re.value,e=k(),H.scope&&S(e,r=A(t));else{if(!g("("))return null;e=D(),v(")"),H.scope&&(r=e.isLocal)}for(;;)if(Y===re.type)switch(re.value){case"[":P(n),m(),i=D(),e=u(he.indexExpression(e,i)),v("]");break;case".":P(n),m(),o=k(),H.scope&&S(o,r),e=u(he.memberExpression(e,".",o));break;case":":P(n),m(),o=k(),H.scope&&S(o,r),e=u(he.memberExpression(e,":",o)),P(n),e=q(e);break;case"(":case"{":P(n),e=q(e);break;default:return e}else{if(X!==re.type)break;P(n),e=q(e)}return e}function q(e){if(Y===re.type)switch(re.value){case"(":m();var t=[],n=$();for(null!=n&&t.push(n);g(",");)n=D(),t.push(n);return v(")"),u(he.callExpression(e,t));case"{":O(),m();var r=R();return u(he.tableCallExpression(e,r))}else if(X===re.type)return u(he.stringCallExpression(e,I()));l("function arguments",re)}function I(){var e,t=X|Q|Z|ee|te,n=re.value,r=re.type;if(ge&&(e=E()),r&t){P(e);var i=V.slice(re.range[0],re.range[1]);return m(),u(he.literal(r,n,i))}return W===r&&"function"===n?(P(e),m(),T(null)):g("{")?(P(e),R()):void 0}function U(e){return V+=String(e),B=V.length,n}function z(e){void 0!==e&&U(e),B=V.length,ge=H.locations||H.ranges,oe=r();var t=function(){m(),O();var e=C();return K!==re.type&&s(re),ge&&!e.length&&(ie=re),u(he.chunk(e))}();if(H.comments&&(t.comments=se),H.scope&&(t.globals=me),0<ve.length)throw new Error("Location tracking failed. This is most likely a bug in luaparse");return t}n.version="0.1.4";var V,H,B,G=n.defaultOptions={wait:!1,comments:!0,scope:!1,locations:!1,ranges:!1},K=1,X=2,W=4,J=8,Q=16,Y=32,Z=64,ee=128,te=256;n.tokenTypes={EOF:K,StringLiteral:X,Keyword:W,Identifier:J,NumericLiteral:Q,Punctuator:Y,BooleanLiteral:Z,NilLiteral:ee,VarargLiteral:te};var ne,re,ie,oe,se,ae,ce,ue,le=n.errors={unexpected:"Unexpected %1 '%2' near '%3'",expected:"'%1' expected near '%2'",expectedToken:"%1 expected near '%2'",unfinishedString:"unfinished string near '%1'",malformedNumber:"malformed number near '%1'"},he=n.ast={labelStatement:function(e){return{type:"LabelStatement",label:e}},breakStatement:function(){return{type:"BreakStatement"}},gotoStatement:function(e){return{type:"GotoStatement",label:e}},returnStatement:function(e){return{type:"ReturnStatement",arguments:e}},ifStatement:function(e){return{type:"IfStatement",clauses:e}},ifClause:function(e,t){return{type:"IfClause",condition:e,body:t}},elseifClause:function(e,t){return{type:"ElseifClause",condition:e,body:t}},elseClause:function(e){return{type:"ElseClause",body:e}},whileStatement:function(e,t){return{type:"WhileStatement",condition:e,body:t}},doStatement:function(e){return{type:"DoStatement",body:e}},repeatStatement:function(e,t){return{type:"RepeatStatement",condition:e,body:t}},localStatement:function(e,t){return{type:"LocalStatement",variables:e,init:t}},assignmentStatement:function(e,t){return{type:"AssignmentStatement",variables:e,init:t}},callStatement:function(e){return{type:"CallStatement",expression:e}},functionStatement:function(e,t,n,r){return{type:"FunctionDeclaration",identifier:e,isLocal:n,parameters:t,body:r}},forNumericStatement:function(e,t,n,r,i){return{type:"ForNumericStatement",variable:e,start:t,end:n,step:r,body:i}},forGenericStatement:function(e,t,n){return{type:"ForGenericStatement",variables:e,iterators:t,body:n}},chunk:function(e){return{type:"Chunk",body:e}},identifier:function(e){return{type:"Identifier",name:e}},literal:function(e,t,n){return{type:e=e===X?"StringLiteral":e===Q?"NumericLiteral":e===Z?"BooleanLiteral":e===ee?"NilLiteral":"VarargLiteral",value:t,raw:n}},tableKey:function(e,t){return{type:"TableKey",key:e,value:t}},tableKeyString:function(e,t){return{type:"TableKeyString",key:e,value:t}},tableValue:function(e){return{type:"TableValue",value:e}},tableConstructorExpression:function(e){return{type:"TableConstructorExpression",fields:e}},binaryExpression:function(e,t,n){var r="and"===e||"or"===e?"LogicalExpression":"BinaryExpression";return{type:r,operator:e,left:t,right:n}},unaryExpression:function(e,t){return{type:"UnaryExpression",operator:e,argument:t}},memberExpression:function(e,t,n){return{type:"MemberExpression",indexer:t,identifier:n,base:e}},indexExpression:function(e,t){return{type:"IndexExpression",base:e,index:t}},callExpression:function(e,t){return{type:"CallExpression",base:e,arguments:t}},tableCallExpression:function(e,t){return{type:"TableCallExpression",base:e,arguments:t}},stringCallExpression:function(e,t){return{type:"StringCallExpression",base:e,argument:t}},comment:function(e,t){return{type:"Comment",value:e,raw:t}}},fe=Array.prototype.slice,t=(Object.prototype.toString,function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1});n.lex=r;var pe,de,me,ge,ve=[];j.prototype.complete=function(){H.locations&&(this.loc.end.line=ie.line,this.loc.end.column=ie.range[1]-ie.lineStart),H.ranges&&(this.range[1]=ie.range[1])},n.parse=function(e,t){return void 0===t&&"object"==typeof e&&(t=e,e=void 0),t||(t={}),V=e||"",H=function(){for(var e,t,n=fe.call(arguments),r={},i=0,o=n.length;i<o;i++)for(t in e=n[i])e.hasOwnProperty(t)&&(r[t]=e[t]);return r}(G,t),ce=1,ue=ne=0,B=V.length,pe=[[]],de=0,me=[],ve=[],H.comments&&(se=[]),H.wait?n:z()},n.write=U,n.end=z}(t)}),ace.define("ace/mode/lua_worker",[],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../worker/mirror").Mirror,o=e("../mode/lua/luaparse"),s=t.Worker=function(e){i.call(this,e),this.setTimeout(500)};r.inherits(s,i),function(){this.onUpdate=function(){var e=this.doc.getValue(),t=[];try{o.parse(e)}catch(e){e instanceof SyntaxError&&t.push({row:e.line-1,column:e.column,text:e.message,type:"error"})}this.sender.emit("annotate",t)}}.call(s.prototype)}),ace.define("ace/lib/es5-shim",[],function(e,t,n){function o(){}function r(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(e){}}function i(e){return(e=+e)!=e?e=0:0!==e&&e!==1/0&&e!==-1/0&&(e=(0<e||-1)*Math.floor(Math.abs(e))),e}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if("function"!=typeof n)throw new TypeError("Function.prototype.bind called on incompatible "+n);var r=d.call(arguments,1),i=function(){if(this instanceof i){var e=n.apply(this,r.concat(d.call(arguments)));return Object(e)===e?e:this}return n.apply(t,r.concat(d.call(arguments)))};return n.prototype&&(o.prototype=n.prototype,i.prototype=new o,o.prototype=null),i});var s,a,c,u,l,h=Function.prototype.call,f=Array.prototype,p=Object.prototype,d=f.slice,m=h.bind(p.toString),g=h.bind(p.hasOwnProperty);if((l=g(p,"__defineGetter__"))&&(s=h.bind(p.__defineGetter__),a=h.bind(p.__defineSetter__),c=h.bind(p.__lookupGetter__),u=h.bind(p.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var v=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?v.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;0<e?n<e&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+t<n||(t=n-e);var r=this.slice(e,e+t),i=d.call(arguments,2),o=i.length;if(e===n)o&&this.push.apply(this,i);else{var s=Math.min(t,n-e),a=e+s,c=a+o-s,u=n-a,l=n-s;if(c<a)for(var h=0;h<u;++h)this[c+h]=this[a+h];else if(a<c)for(h=u;h--;)this[c+h]=this[a+h];if(o&&e===l)this.length=l,this.push.apply(this,i);else for(this.length=l+o,h=0;h<o;++h)this[e+h]=i[h]}return r};Array.isArray||(Array.isArray=function(e){return"[object Array]"==m(e)});var y,w,b=Object("a"),x="a"!=b[0]||!(0 in b);if(Array.prototype.forEach||(Array.prototype.forEach=function(e){var t=k(this),n=x&&"[object String]"==m(this)?this.split(""):t,r=arguments[1],i=-1,o=n.length>>>0;if("[object Function]"!=m(e))throw new TypeError;for(;++i<o;)i in n&&e.call(r,n[i],i,t)}),Array.prototype.map||(Array.prototype.map=function(e){var t=k(this),n=x&&"[object String]"==m(this)?this.split(""):t,r=n.length>>>0,i=Array(r),o=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var s=0;s<r;s++)s in n&&(i[s]=e.call(o,n[s],s,t));return i}),Array.prototype.filter||(Array.prototype.filter=function(e){var t,n=k(this),r=x&&"[object String]"==m(this)?this.split(""):n,i=r.length>>>0,o=[],s=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var a=0;a<i;a++)a in r&&(t=r[a],e.call(s,t,a,n)&&o.push(t));return o}),Array.prototype.every||(Array.prototype.every=function(e){var t=k(this),n=x&&"[object String]"==m(this)?this.split(""):t,r=n.length>>>0,i=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var o=0;o<r;o++)if(o in n&&!e.call(i,n[o],o,t))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(e){var t=k(this),n=x&&"[object String]"==m(this)?this.split(""):t,r=n.length>>>0,i=arguments[1];if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");for(var o=0;o<r;o++)if(o in n&&e.call(i,n[o],o,t))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(e){var t=k(this),n=x&&"[object String]"==m(this)?this.split(""):t,r=n.length>>>0;if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,o=0;if(2<=arguments.length)i=arguments[1];else for(;;){if(o in n){i=n[o++];break}if(++o>=r)throw new TypeError("reduce of empty array with no initial value")}for(;o<r;o++)o in n&&(i=e.call(void 0,i,n[o],o,t));return i}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(e){var t=k(this),n=x&&"[object String]"==m(this)?this.split(""):t,r=n.length>>>0;if("[object Function]"!=m(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,o=r-1;if(2<=arguments.length)i=arguments[1];else for(;;){if(o in n){i=n[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}for(;o in this&&(i=e.call(void 0,i,n[o],o,t)),o--;);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=x&&"[object String]"==m(this)?this.split(""):k(this),n=t.length>>>0;if(!n)return-1;var r=0;for(1<arguments.length&&(r=i(arguments[1])),r=0<=r?r:Math.max(0,n+r);r<n;r++)if(r in t&&t[r]===e)return r;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(e){var t=x&&"[object String]"==m(this)?this.split(""):k(this),n=t.length>>>0;if(!n)return-1;var r=n-1;for(1<arguments.length&&(r=Math.min(r,i(arguments[1]))),r=0<=r?r:n-Math.abs(r);0<=r;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:p)}),!Object.getOwnPropertyDescriptor){Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(g(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=p;var i=c(e,t),o=u(e,t);if(e.__proto__=r,i||o)return i&&(n.get=i),o&&(n.set=o),n}return n.value=e[t],n}}}(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create)||(y=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=y();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n});if(Object.defineProperty){var L=r({}),_="undefined"==typeof document||r(document.createElement("div"));if(!L||!_)var S=Object.defineProperty}if(!Object.defineProperty||S){Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(S)try{return S.call(Object,e,t,n)}catch(e){}if(g(n,"value"))if(l&&(c(e,t)||u(e,t))){var r=e.__proto__;e.__proto__=p,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");g(n,"get")&&s(e,t,n.get),g(n,"set")&&a(e,t,n.set)}return e}}Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)g(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(w=Object.freeze,function(e){return"function"==typeof e?e:w(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";g(e,t);)t+="?";e[t]=!0;var n=g(e,t);return delete e[t],n}),!Object.keys){var A=!0,E=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],j=E.length;for(var O in{toString:null})A=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)g(e,n)&&t.push(n);if(A)for(var r=0,i=j;r<i;r++){var o=E[r];g(e,o)&&t.push(o)}return t}}Date.now||(Date.now=function(){return(new Date).getTime()});var P="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff";if(!String.prototype.trim||P.trim()){P="["+P+"]";var C=new RegExp("^"+P+P+"*"),M=new RegExp(P+P+"*$");String.prototype.trim=function(){return String(this).replace(C,"").replace(M,"")}}var k=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}});