@liascript/editor
Version:
An extended Markdown interpreter for the creation of interactive online courses.
1 lines • 77.8 kB
JavaScript
!function(t){if(!(void 0!==t.window&&t.document||t.require&&t.define)){t.console||(t.console=function(){var t=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:t})},t.console.error=t.console.warn=t.console.log=t.console.trace=t.console),t.window=t,t.ace=t,t.onerror=function(t,e,n,r,s){postMessage({type:"error",data:{message:t,data:s&&s.data,file:e,line:n,col:r,stack:s&&s.stack}})},t.normalizeModule=function(e,n){if(-1!==n.indexOf("!")){var r=n.split("!");return t.normalizeModule(e,r[0])+"!"+t.normalizeModule(e,r[1])}if("."==n.charAt(0)){var s=e.split("/").slice(0,-1).join("/");for(n=(s?s+"/":"")+n;-1!==n.indexOf(".")&&o!=n;){var o=n;n=n.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return n},t.require=function(e,n){if(n||(n=e,e=null),!n.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");n=t.normalizeModule(e,n);var r=t.require.modules[n];if(r)return r.initialized||(r.initialized=!0,r.exports=r.factory().exports),r.exports;if(!t.require.tlns)return console.log("unable to load "+n);var s=function(t,e){for(var n=t,r="";n;){var s=e[n];if("string"==typeof s)return s+r;if(s)return s.location.replace(/\/*$/,"/")+(r||s.main||s.name);if(!1===s)return"";var o=n.lastIndexOf("/");if(-1===o)break;r=n.substr(o)+r,n=n.slice(0,o)}return t}(n,t.require.tlns);return".js"!=s.slice(-3)&&(s+=".js"),t.require.id=n,t.require.modules[n]={},importScripts(s),t.require(e,n)},t.require.modules={},t.require.tlns={},t.define=function(e,n,r){if(2==arguments.length?(r=n,"string"!=typeof e&&(n=e,e=t.require.id)):1==arguments.length&&(r=e,n=[],e=t.require.id),"function"==typeof r){n.length||(n=["require","exports","module"]);var s=function(n){return t.require(e,n)};t.require.modules[e]={exports:{},factory:function(){var t=this,e=r.apply(this,n.slice(0,r.length).map((function(e){switch(e){case"require":return s;case"exports":return t.exports;case"module":return t;default:return s(e)}})));return e&&(t.exports=e),t}}}else t.require.modules[e]={exports:r,initialized:!0}},t.define.amd={},t.require.tlns={},t.initBaseUrls=function(t){for(var e in t)this.require.tlns[e]=t[e]},t.initSender=function(){var e=t.require("ace/lib/event_emitter").EventEmitter,n=t.require("ace/lib/oop"),r=function(){};return function(){n.implement(this,e),this.callback=function(t,e){postMessage({type:"call",id:e,data:t})},this.emit=function(t,e){postMessage({type:"event",name:t,data:e})}}.call(r.prototype),new r};var e=t.main=null,n=t.sender=null;t.onmessage=function(r){var s=r.data;if(s.event&&n)n._signal(s.event,s.data);else if(s.command)if(e[s.command])e[s.command].apply(e,s.args);else{if(!t[s.command])throw new Error("Unknown command:"+s.command);t[s.command].apply(t,s.args)}else if(s.init){t.initBaseUrls(s.tlns),n=t.sender=t.initSender();var o=this.require(s.module)[s.classname];e=t.main=new o(n)}}}}(this),ace.define("ace/lib/oop",[],(function(t,e,n){"use strict";e.inherits=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})},e.mixin=function(t,e){for(var n in e)t[n]=e[n];return t},e.implement=function(t,n){e.mixin(t,n)}})),ace.define("ace/apply_delta",[],(function(t,e,n){"use strict";e.applyDelta=function(t,e,n){var r=e.start.row,s=e.start.column,o=t[r]||"";switch(e.action){case"insert":if(1===e.lines.length)t[r]=o.substring(0,s)+e.lines[0]+o.substring(s);else{var a=[r,1].concat(e.lines);t.splice.apply(t,a),t[r]=o.substring(0,s)+t[r],t[r+e.lines.length-1]+=o.substring(s)}break;case"remove":var i=e.end.column,_=e.end.row;r===_?t[r]=o.substring(0,s)+o.substring(i):t.splice(r,_-r+1,o.substring(0,s)+t[_].substring(i))}}})),ace.define("ace/lib/event_emitter",[],(function(t,e,n){"use strict";var r={},s=function(){this.propagationStopped=!0},o=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(t,e){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[t]||[],r=this._defaultHandlers[t];if(n.length||r){"object"==typeof e&&e||(e={}),e.type||(e.type=t),e.stopPropagation||(e.stopPropagation=s),e.preventDefault||(e.preventDefault=o),n=n.slice();for(var a=0;a<n.length&&(n[a](e,this),!e.propagationStopped);a++);return r&&!e.defaultPrevented?r(e,this):void 0}},r._signal=function(t,e){var n=(this._eventRegistry||{})[t];if(n){n=n.slice();for(var r=0;r<n.length;r++)n[r](e,this)}},r.once=function(t,e){var n=this;if(this.on(t,(function r(){n.off(t,r),e.apply(null,arguments)})),!e)return new Promise((function(t){e=t}))},r.setDefaultHandler=function(t,e){var n=this._defaultHandlers;if(n||(n=this._defaultHandlers={_disabled_:{}}),n[t]){var r=n[t],s=n._disabled_[t];s||(n._disabled_[t]=s=[]),s.push(r);var o=s.indexOf(e);-1!=o&&s.splice(o,1)}n[t]=e},r.removeDefaultHandler=function(t,e){var n=this._defaultHandlers;if(n){var r=n._disabled_[t];if(n[t]==e)r&&this.setDefaultHandler(t,r.pop());else if(r){var s=r.indexOf(e);-1!=s&&r.splice(s,1)}}},r.on=r.addEventListener=function(t,e,n){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[t];return r||(r=this._eventRegistry[t]=[]),-1==r.indexOf(e)&&r[n?"unshift":"push"](e),e},r.off=r.removeListener=r.removeEventListener=function(t,e){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[t];if(n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}},r.removeAllListeners=function(t){t||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[t]=void 0),this._defaultHandlers&&(this._defaultHandlers[t]=void 0)},e.EventEmitter=r})),ace.define("ace/range",[],(function(t,e,n){"use strict";var r=function(){function t(t,e,n,r){this.start={row:t,column:e},this.end={row:n,column:r}}return t.prototype.isEqual=function(t){return this.start.row===t.start.row&&this.end.row===t.end.row&&this.start.column===t.start.column&&this.end.column===t.end.column},t.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},t.prototype.contains=function(t,e){return 0==this.compare(t,e)},t.prototype.compareRange=function(t){var e,n=t.end,r=t.start;return 1==(e=this.compare(n.row,n.column))?1==(e=this.compare(r.row,r.column))?2:0==e?1:0:-1==e?-2:-1==(e=this.compare(r.row,r.column))?-1:1==e?42:0},t.prototype.comparePoint=function(t){return this.compare(t.row,t.column)},t.prototype.containsRange=function(t){return 0==this.comparePoint(t.start)&&0==this.comparePoint(t.end)},t.prototype.intersects=function(t){var e=this.compareRange(t);return-1==e||0==e||1==e},t.prototype.isEnd=function(t,e){return this.end.row==t&&this.end.column==e},t.prototype.isStart=function(t,e){return this.start.row==t&&this.start.column==e},t.prototype.setStart=function(t,e){"object"==typeof t?(this.start.column=t.column,this.start.row=t.row):(this.start.row=t,this.start.column=e)},t.prototype.setEnd=function(t,e){"object"==typeof t?(this.end.column=t.column,this.end.row=t.row):(this.end.row=t,this.end.column=e)},t.prototype.inside=function(t,e){return 0==this.compare(t,e)&&(!this.isEnd(t,e)&&!this.isStart(t,e))},t.prototype.insideStart=function(t,e){return 0==this.compare(t,e)&&!this.isEnd(t,e)},t.prototype.insideEnd=function(t,e){return 0==this.compare(t,e)&&!this.isStart(t,e)},t.prototype.compare=function(t,e){return this.isMultiLine()||t!==this.start.row?t<this.start.row?-1:t>this.end.row?1:this.start.row===t?e>=this.start.column?0:-1:this.end.row===t?e<=this.end.column?0:1:0:e<this.start.column?-1:e>this.end.column?1:0},t.prototype.compareStart=function(t,e){return this.start.row==t&&this.start.column==e?-1:this.compare(t,e)},t.prototype.compareEnd=function(t,e){return this.end.row==t&&this.end.column==e?1:this.compare(t,e)},t.prototype.compareInside=function(t,e){return this.end.row==t&&this.end.column==e?1:this.start.row==t&&this.start.column==e?-1:this.compare(t,e)},t.prototype.clipRows=function(e,n){if(this.end.row>n)var r={row:n+1,column:0};else if(this.end.row<e)r={row:e,column:0};if(this.start.row>n)var s={row:n+1,column:0};else if(this.start.row<e)s={row:e,column:0};return t.fromPoints(s||this.start,r||this.end)},t.prototype.extend=function(e,n){var r=this.compare(e,n);if(0==r)return this;if(-1==r)var s={row:e,column:n};else var o={row:e,column:n};return t.fromPoints(s||this.start,o||this.end)},t.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},t.prototype.isMultiLine=function(){return this.start.row!==this.end.row},t.prototype.clone=function(){return t.fromPoints(this.start,this.end)},t.prototype.collapseRows=function(){return 0==this.end.column?new t(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new t(this.start.row,0,this.end.row,0)},t.prototype.toScreenRange=function(e){var n=e.documentToScreenPosition(this.start),r=e.documentToScreenPosition(this.end);return new t(n.row,n.column,r.row,r.column)},t.prototype.moveBy=function(t,e){this.start.row+=t,this.start.column+=e,this.end.row+=t,this.end.column+=e},t}();r.fromPoints=function(t,e){return new r(t.row,t.column,e.row,e.column)},r.comparePoints=function(t,e){return t.row-e.row||t.column-e.column},e.Range=r})),ace.define("ace/anchor",[],(function(t,e,n){"use strict";function r(t,e,n){var r=n?t.column<=e.column:t.column<e.column;return t.row<e.row||t.row==e.row&&r}var s=t("./lib/oop"),o=t("./lib/event_emitter").EventEmitter,a=function(){function t(t,e,n){this.$onChange=this.onChange.bind(this),this.attach(t),"number"!=typeof e?this.setPosition(e.row,e.column):this.setPosition(e,n)}return t.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},t.prototype.getDocument=function(){return this.document},t.prototype.onChange=function(t){if(!(t.start.row==t.end.row&&t.start.row!=this.row||t.start.row>this.row)){var e=function(t,e,n){var s="insert"==t.action,o=(s?1:-1)*(t.end.row-t.start.row),a=(s?1:-1)*(t.end.column-t.start.column),i=t.start,_=s?i:t.end;return r(e,i,n)?{row:e.row,column:e.column}:r(_,e,!n)?{row:e.row+o,column:e.column+(e.row==_.row?a:0)}:{row:i.row,column:i.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(e.row,e.column,!0)}},t.prototype.setPosition=function(t,e,n){var r;if(r=n?{row:t,column:e}:this.$clipPositionToDocument(t,e),this.row!=r.row||this.column!=r.column){var s={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:s,value:r})}},t.prototype.detach=function(){this.document.off("change",this.$onChange)},t.prototype.attach=function(t){this.document=t||this.document,this.document.on("change",this.$onChange)},t.prototype.$clipPositionToDocument=function(t,e){var n={};return t>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):t<0?(n.row=0,n.column=0):(n.row=t,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,e))),e<0&&(n.column=0),n},t}();a.prototype.$insertRight=!1,s.implement(a.prototype,o),e.Anchor=a})),ace.define("ace/document",[],(function(t,e,n){"use strict";var r=t("./lib/oop"),s=t("./apply_delta").applyDelta,o=t("./lib/event_emitter").EventEmitter,a=t("./range").Range,i=t("./anchor").Anchor,_=function(){function t(t){this.$lines=[""],0===t.length?this.$lines=[""]:Array.isArray(t)?this.insertMergedLines({row:0,column:0},t):this.insert({row:0,column:0},t)}return t.prototype.setValue=function(t){var e=this.getLength()-1;this.remove(new a(0,0,e,this.getLine(e).length)),this.insert({row:0,column:0},t||"")},t.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},t.prototype.createAnchor=function(t,e){return new i(this,t,e)},t.prototype.$detectNewLine=function(t){var e=t.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=e?e[1]:"\n",this._signal("changeNewLineMode")},t.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},t.prototype.setNewLineMode=function(t){this.$newLineMode!==t&&(this.$newLineMode=t,this._signal("changeNewLineMode"))},t.prototype.getNewLineMode=function(){return this.$newLineMode},t.prototype.isNewLine=function(t){return"\r\n"==t||"\r"==t||"\n"==t},t.prototype.getLine=function(t){return this.$lines[t]||""},t.prototype.getLines=function(t,e){return this.$lines.slice(t,e+1)},t.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},t.prototype.getLength=function(){return this.$lines.length},t.prototype.getTextRange=function(t){return this.getLinesForRange(t).join(this.getNewLineCharacter())},t.prototype.getLinesForRange=function(t){var e;if(t.start.row===t.end.row)e=[this.getLine(t.start.row).substring(t.start.column,t.end.column)];else{(e=this.getLines(t.start.row,t.end.row))[0]=(e[0]||"").substring(t.start.column);var n=e.length-1;t.end.row-t.start.row==n&&(e[n]=e[n].substring(0,t.end.column))}return e},t.prototype.insertLines=function(t,e){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(t,e)},t.prototype.removeLines=function(t,e){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(t,e)},t.prototype.insertNewLine=function(t){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(t,["",""])},t.prototype.insert=function(t,e){return this.getLength()<=1&&this.$detectNewLine(e),this.insertMergedLines(t,this.$split(e))},t.prototype.insertInLine=function(t,e){var n=this.clippedPos(t.row,t.column),r=this.pos(t.row,t.column+e.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[e]},!0),this.clonePos(r)},t.prototype.clippedPos=function(t,e){var n=this.getLength();void 0===t?t=n:t<0?t=0:t>=n&&(t=n-1,e=void 0);var r=this.getLine(t);return null==e&&(e=r.length),{row:t,column:e=Math.min(Math.max(e,0),r.length)}},t.prototype.clonePos=function(t){return{row:t.row,column:t.column}},t.prototype.pos=function(t,e){return{row:t,column:e}},t.prototype.$clipPosition=function(t){var e=this.getLength();return t.row>=e?(t.row=Math.max(0,e-1),t.column=this.getLine(e-1).length):(t.row=Math.max(0,t.row),t.column=Math.min(Math.max(t.column,0),this.getLine(t.row).length)),t},t.prototype.insertFullLines=function(t,e){var n=0;(t=Math.min(Math.max(t,0),this.getLength()))<this.getLength()?(e=e.concat([""]),n=0):(e=[""].concat(e),t--,n=this.$lines[t].length),this.insertMergedLines({row:t,column:n},e)},t.prototype.insertMergedLines=function(t,e){var n=this.clippedPos(t.row,t.column),r={row:n.row+e.length-1,column:(1==e.length?n.column:0)+e[e.length-1].length};return this.applyDelta({start:n,end:r,action:"insert",lines:e}),this.clonePos(r)},t.prototype.remove=function(t){var e=this.clippedPos(t.start.row,t.start.column),n=this.clippedPos(t.end.row,t.end.column);return this.applyDelta({start:e,end:n,action:"remove",lines:this.getLinesForRange({start:e,end:n})}),this.clonePos(e)},t.prototype.removeInLine=function(t,e,n){var r=this.clippedPos(t,e),s=this.clippedPos(t,n);return this.applyDelta({start:r,end:s,action:"remove",lines:this.getLinesForRange({start:r,end:s})},!0),this.clonePos(r)},t.prototype.removeFullLines=function(t,e){t=Math.min(Math.max(0,t),this.getLength()-1);var n=(e=Math.min(Math.max(0,e),this.getLength()-1))==this.getLength()-1&&t>0,r=e<this.getLength()-1,s=n?t-1:t,o=n?this.getLine(s).length:0,i=r?e+1:e,_=r?0:this.getLine(i).length,T=new a(s,o,i,_),u=this.$lines.slice(t,e+1);return this.applyDelta({start:T.start,end:T.end,action:"remove",lines:this.getLinesForRange(T)}),u},t.prototype.removeNewLine=function(t){t<this.getLength()-1&&t>=0&&this.applyDelta({start:this.pos(t,this.getLine(t).length),end:this.pos(t+1,0),action:"remove",lines:["",""]})},t.prototype.replace=function(t,e){return t instanceof a||(t=a.fromPoints(t.start,t.end)),0===e.length&&t.isEmpty()?t.start:e==this.getTextRange(t)?t.end:(this.remove(t),e?this.insert(t.start,e):t.start)},t.prototype.applyDeltas=function(t){for(var e=0;e<t.length;e++)this.applyDelta(t[e])},t.prototype.revertDeltas=function(t){for(var e=t.length-1;e>=0;e--)this.revertDelta(t[e])},t.prototype.applyDelta=function(t,e){var n="insert"==t.action;(n?t.lines.length<=1&&!t.lines[0]:!a.comparePoints(t.start,t.end))||(n&&t.lines.length>2e4?this.$splitAndapplyLargeDelta(t,2e4):(s(this.$lines,t,e),this._signal("change",t)))},t.prototype.$safeApplyDelta=function(t){var e=this.$lines.length;("remove"==t.action&&t.start.row<e&&t.end.row<e||"insert"==t.action&&t.start.row<=e)&&this.applyDelta(t)},t.prototype.$splitAndapplyLargeDelta=function(t,e){for(var n=t.lines,r=n.length-e+1,s=t.start.row,o=t.start.column,a=0,i=0;a<r;a=i){i+=e-1;var _=n.slice(a,i);_.push(""),this.applyDelta({start:this.pos(s+a,o),end:this.pos(s+i,o=0),action:t.action,lines:_},!0)}t.lines=n.slice(a),t.start.row=s+a,t.start.column=o,this.applyDelta(t,!0)},t.prototype.revertDelta=function(t){this.$safeApplyDelta({start:this.clonePos(t.start),end:this.clonePos(t.end),action:"insert"==t.action?"remove":"insert",lines:t.lines.slice()})},t.prototype.indexToPosition=function(t,e){for(var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,s=e||0,o=n.length;s<o;s++)if((t-=n[s].length+r)<0)return{row:s,column:t+n[s].length+r};return{row:o-1,column:t+n[o-1].length+r}},t.prototype.positionToIndex=function(t,e){for(var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,s=0,o=Math.min(t.row,n.length),a=e||0;a<o;++a)s+=n[a].length+r;return s+t.column},t.prototype.$split=function(t){return t.split(/\r\n|\r|\n/)},t}();_.prototype.$autoNewLine="",_.prototype.$newLineMode="auto",r.implement(_.prototype,o),e.Document=_})),ace.define("ace/lib/deep_copy",[],(function(t,e,n){e.deepCopy=function t(e){if("object"!=typeof e||!e)return e;var n;if(Array.isArray(e)){n=[];for(var r=0;r<e.length;r++)n[r]=t(e[r]);return n}if("[object Object]"!==Object.prototype.toString.call(e))return e;for(var r in n={},e)n[r]=t(e[r]);return n}})),ace.define("ace/lib/lang",[],(function(t,e,n){"use strict";e.last=function(t){return t[t.length-1]},e.stringReverse=function(t){return t.split("").reverse().join("")},e.stringRepeat=function(t,e){for(var n="";e>0;)1&e&&(n+=t),(e>>=1)&&(t+=t);return n};var r=/^\s\s*/,s=/\s\s*$/;e.stringTrimLeft=function(t){return t.replace(r,"")},e.stringTrimRight=function(t){return t.replace(s,"")},e.copyObject=function(t){var e={};for(var n in t)e[n]=t[n];return e},e.copyArray=function(t){for(var e=[],n=0,r=t.length;n<r;n++)t[n]&&"object"==typeof t[n]?e[n]=this.copyObject(t[n]):e[n]=t[n];return e},e.deepCopy=t("./deep_copy").deepCopy,e.arrayToMap=function(t){for(var e={},n=0;n<t.length;n++)e[t[n]]=1;return e},e.createMap=function(t){var e=Object.create(null);for(var n in t)e[n]=t[n];return e},e.arrayRemove=function(t,e){for(var n=0;n<=t.length;n++)e===t[n]&&t.splice(n,1)},e.escapeRegExp=function(t){return t.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},e.escapeHTML=function(t){return(""+t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},e.getMatchOffsets=function(t,e){var n=[];return t.replace(e,(function(t){n.push({offset:arguments[arguments.length-2],length:t.length})})),n},e.deferredCall=function(t){var e=null,n=function(){e=null,t()},r=function(t){return r.cancel(),e=setTimeout(n,t||0),r};return r.schedule=r,r.call=function(){return this.cancel(),t(),r},r.cancel=function(){return clearTimeout(e),e=null,r},r.isPending=function(){return e},r},e.delayedCall=function(t,e){var n=null,r=function(){n=null,t()},s=function(t){null==n&&(n=setTimeout(r,t||e))};return s.delay=function(t){n&&clearTimeout(n),n=setTimeout(r,t||e)},s.schedule=s,s.call=function(){this.cancel(),t()},s.cancel=function(){n&&clearTimeout(n),n=null},s.isPending=function(){return n},s},e.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch(t){return!1}return!0},e.skipEmptyMatch=function(t,e,n){return n&&t.codePointAt(e)>65535?2:1}})),ace.define("ace/worker/mirror",[],(function(t,e,n){"use strict";var r=t("../document").Document,s=t("../lib/lang"),o=e.Mirror=function(t){this.sender=t;var e=this.doc=new r(""),n=this.deferredUpdate=s.delayedCall(this.onUpdate.bind(this)),o=this;t.on("change",(function(t){var r=t.data;if(r[0].start)e.applyDeltas(r);else for(var s=0;s<r.length;s+=2){var a,i;if(("insert"==(a=Array.isArray(r[s+1])?{action:"insert",start:r[s],lines:r[s+1]}:{action:"remove",start:r[s],end:r[s+1]}).action?a.start:a.end).row>=e.$lines.length)throw(i=new Error("Invalid delta")).data={path:o.$path,linesLength:e.$lines.length,start:a.start,end:a.end},i;e.applyDelta(a,!0)}if(o.$timeout)return n.schedule(o.$timeout);o.onUpdate()}))};(function(){this.$timeout=500,this.setTimeout=function(t){this.$timeout=t},this.setValue=function(t){this.doc.setValue(t),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(t){this.sender.callback(this.doc.getValue(),t)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(o.prototype)})),ace.define("ace/mode/php/php",[],(function(t,e,n){var r={Constants:{}};r.Constants.T_THROW=317,r.Constants.T_INCLUDE=272,r.Constants.T_INCLUDE_ONCE=273,r.Constants.T_EVAL=274,r.Constants.T_REQUIRE=275,r.Constants.T_REQUIRE_ONCE=276,r.Constants.T_LOGICAL_OR=277,r.Constants.T_LOGICAL_XOR=278,r.Constants.T_LOGICAL_AND=279,r.Constants.T_PRINT=280,r.Constants.T_YIELD=281,r.Constants.T_DOUBLE_ARROW=386,r.Constants.T_YIELD_FROM=282,r.Constants.T_PLUS_EQUAL=352,r.Constants.T_MINUS_EQUAL=353,r.Constants.T_MUL_EQUAL=354,r.Constants.T_DIV_EQUAL=355,r.Constants.T_CONCAT_EQUAL=356,r.Constants.T_MOD_EQUAL=357,r.Constants.T_AND_EQUAL=358,r.Constants.T_OR_EQUAL=359,r.Constants.T_XOR_EQUAL=360,r.Constants.T_SL_EQUAL=361,r.Constants.T_SR_EQUAL=362,r.Constants.T_POW_EQUAL=402,r.Constants.T_COALESCE_EQUAL=363,r.Constants.T_COALESCE=400,r.Constants.T_BOOLEAN_OR=364,r.Constants.T_BOOLEAN_AND=365,r.Constants.T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG=404,r.Constants.T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG=403,r.Constants.T_IS_EQUAL=366,r.Constants.T_IS_NOT_EQUAL=367,r.Constants.T_IS_IDENTICAL=368,r.Constants.T_IS_NOT_IDENTICAL=369,r.Constants.T_SPACESHIP=372,r.Constants.T_IS_SMALLER_OR_EQUAL=370,r.Constants.T_IS_GREATER_OR_EQUAL=371,r.Constants.T_SL=373,r.Constants.T_SR=374,r.Constants.T_INSTANCEOF=283,r.Constants.T_INC=375,r.Constants.T_DEC=376,r.Constants.T_INT_CAST=377,r.Constants.T_DOUBLE_CAST=378,r.Constants.T_STRING_CAST=379,r.Constants.T_ARRAY_CAST=380,r.Constants.T_OBJECT_CAST=381,r.Constants.T_BOOL_CAST=382,r.Constants.T_UNSET_CAST=383,r.Constants.T_POW=401,r.Constants.T_NEW=284,r.Constants.T_CLONE=285,r.Constants.T_EXIT=286,r.Constants.T_IF=287,r.Constants.T_ELSEIF=288,r.Constants.T_ELSE=289,r.Constants.T_ENDIF=290,r.Constants.T_LNUMBER=260,r.Constants.T_DNUMBER=261,r.Constants.T_STRING=262,r.Constants.T_STRING_VARNAME=270,r.Constants.T_VARIABLE=266,r.Constants.T_NUM_STRING=271,r.Constants.T_INLINE_HTML=267,r.Constants.T_ENCAPSED_AND_WHITESPACE=268,r.Constants.T_CONSTANT_ENCAPSED_STRING=269,r.Constants.T_ECHO=291,r.Constants.T_DO=292,r.Constants.T_WHILE=293,r.Constants.T_ENDWHILE=294,r.Constants.T_FOR=295,r.Constants.T_ENDFOR=296,r.Constants.T_FOREACH=297,r.Constants.T_ENDFOREACH=298,r.Constants.T_DECLARE=299,r.Constants.T_ENDDECLARE=300,r.Constants.T_AS=301,r.Constants.T_SWITCH=302,r.Constants.T_MATCH=306,r.Constants.T_ENDSWITCH=303,r.Constants.T_CASE=304,r.Constants.T_DEFAULT=305,r.Constants.T_BREAK=307,r.Constants.T_CONTINUE=308,r.Constants.T_GOTO=309,r.Constants.T_FUNCTION=310,r.Constants.T_FN=311,r.Constants.T_CONST=312,r.Constants.T_RETURN=313,r.Constants.T_TRY=314,r.Constants.T_CATCH=315,r.Constants.T_FINALLY=316,r.Constants.T_THROW=317,r.Constants.T_USE=318,r.Constants.T_INSTEADOF=319,r.Constants.T_GLOBAL=320,r.Constants.T_STATIC=321,r.Constants.T_ABSTRACT=322,r.Constants.T_FINAL=323,r.Constants.T_PRIVATE=324,r.Constants.T_PROTECTED=325,r.Constants.T_PUBLIC=326,r.Constants.T_READONLY=327,r.Constants.T_VAR=328,r.Constants.T_UNSET=329,r.Constants.T_ISSET=330,r.Constants.T_EMPTY=331,r.Constants.T_HALT_COMPILER=332,r.Constants.T_CLASS=333,r.Constants.T_TRAIT=334,r.Constants.T_INTERFACE=335,r.Constants.T_ENUM=336,r.Constants.T_EXTENDS=337,r.Constants.T_IMPLEMENTS=338,r.Constants.T_OBJECT_OPERATOR=384,r.Constants.T_NULLSAFE_OBJECT_OPERATOR=385,r.Constants.T_DOUBLE_ARROW=386,r.Constants.T_LIST=340,r.Constants.T_ARRAY=341,r.Constants.T_CALLABLE=342,r.Constants.T_CLASS_C=346,r.Constants.T_TRAIT_C=347,r.Constants.T_METHOD_C=348,r.Constants.T_FUNC_C=349,r.Constants.T_LINE=343,r.Constants.T_FILE=344,r.Constants.T_START_HEREDOC=393,r.Constants.T_END_HEREDOC=394,r.Constants.T_DOLLAR_OPEN_CURLY_BRACES=395,r.Constants.T_CURLY_OPEN=396,r.Constants.T_PAAMAYIM_NEKUDOTAYIM=397,r.Constants.T_NAMESPACE=339,r.Constants.T_NS_C=350,r.Constants.T_DIR=345,r.Constants.T_NS_SEPARATOR=398,r.Constants.T_ELLIPSIS=399,r.Constants.T_NAME_FULLY_QUALIFIED=263,r.Constants.T_NAME_QUALIFIED=265,r.Constants.T_NAME_RELATIVE=264,r.Constants.T_ATTRIBUTE=351,r.Constants.T_ENUM=336,r.Constants.T_BAD_CHARACTER=405,r.Constants.T_COMMENT=387,r.Constants.T_DOC_COMMENT=388,r.Constants.T_OPEN_TAG=389,r.Constants.T_OPEN_TAG_WITH_ECHO=390,r.Constants.T_CLOSE_TAG=391,r.Constants.T_WHITESPACE=392,r.Lexer=function(t,e){var n,s,o=["INITIAL"],a=0,i=function(t){o[a]=t},_=function(t){o[++a]=t},T=function(){--a},u=void 0===e||/^(on|true|1)$/i.test(e.short_open_tag),E=u?/^(\<\?php(?:\r\n|[ \t\r\n])|<\?|\<script language\=('|")?php('|")?\>)/i:/^(\<\?php(?:\r\n|[ \t\r\n])|\<script language\=('|")?php('|")?\>)/i,p=u?/[^<]*(?:<(?!\?|script language\=('|")?php('|")?\>)[^<]*)*/i:/[^<]*(?:<(?!\?=|\?php[ \t\r\n]|script language\=('|")?php('|")?\>)[^<]*)*/i,l="[a-zA-Z_\\x7f-\\uffff][a-zA-Z0-9_\\x7f-\\uffff]*",C=function(t){return"[^"+t+"\\\\${]*(?:(?:\\\\[\\s\\S]|\\$(?!\\{|[a-zA-Z_\\x7f-\\uffff])|\\{(?!\\$))[^"+t+"\\\\${]*)*"},A=[{value:r.Constants.T_VARIABLE,re:new RegExp("^\\$"+l+"(?=\\[)"),func:function(){_("VAR_OFFSET")}},{value:r.Constants.T_VARIABLE,re:new RegExp("^\\$"+l+"(?=->"+l+")"),func:function(){_("LOOKING_FOR_PROPERTY")}},{value:r.Constants.T_DOLLAR_OPEN_CURLY_BRACES,re:new RegExp("^\\$\\{(?="+l+"[\\[}])"),func:function(){_("LOOKING_FOR_VARNAME")}},{value:r.Constants.T_VARIABLE,re:new RegExp("^\\$"+l)},{value:r.Constants.T_DOLLAR_OPEN_CURLY_BRACES,re:/^\$\{/,func:function(){_("IN_SCRIPTING")}},{value:r.Constants.T_CURLY_OPEN,re:/^\{(?=\$)/,func:function(){_("IN_SCRIPTING")}}],c={INITIAL:[{value:r.Constants.T_OPEN_TAG_WITH_ECHO,re:/^<\?=/i,func:function(){i("IN_SCRIPTING")}},{value:r.Constants.T_OPEN_TAG,re:E,func:function(){i("IN_SCRIPTING")}},{value:r.Constants.T_INLINE_HTML,re:p}],IN_SCRIPTING:[{value:r.Constants.T_WHITESPACE,re:/^[ \n\r\t]+/},{value:r.Constants.T_ABSTRACT,re:/^abstract\b/i},{value:r.Constants.T_LOGICAL_AND,re:/^and\b/i},{value:r.Constants.T_ARRAY,re:/^array\b/i},{value:r.Constants.T_AS,re:/^as\b/i},{value:r.Constants.T_BREAK,re:/^break\b/i},{value:r.Constants.T_CALLABLE,re:/^callable\b/i},{value:r.Constants.T_CASE,re:/^case\b/i},{value:r.Constants.T_CATCH,re:/^catch\b/i},{value:r.Constants.T_CLASS,re:/^class\b/i},{value:r.Constants.T_CLONE,re:/^clone\b/i},{value:r.Constants.T_CONST,re:/^const\b/i},{value:r.Constants.T_CONTINUE,re:/^continue\b/i},{value:r.Constants.T_DECLARE,re:/^declare\b/i},{value:r.Constants.T_DEFAULT,re:/^default\b/i},{value:r.Constants.T_DO,re:/^do\b/i},{value:r.Constants.T_ECHO,re:/^echo\b/i},{value:r.Constants.T_ELSE,re:/^else\b/i},{value:r.Constants.T_ELSEIF,re:/^elseif\b/i},{value:r.Constants.T_ENUM,re:/^enum\b/i},{value:r.Constants.T_ENDDECLARE,re:/^enddeclare\b/i},{value:r.Constants.T_ENDFOR,re:/^endfor\b/i},{value:r.Constants.T_ENDFOREACH,re:/^endforeach\b/i},{value:r.Constants.T_ENDIF,re:/^endif\b/i},{value:r.Constants.T_ENDSWITCH,re:/^endswitch\b/i},{value:r.Constants.T_ENDWHILE,re:/^endwhile\b/i},{value:r.Constants.T_ENUM,re:/^enum\b/i},{value:r.Constants.T_EMPTY,re:/^empty\b/i},{value:r.Constants.T_EVAL,re:/^eval\b/i},{value:r.Constants.T_EXIT,re:/^(?:exit|die)\b/i},{value:r.Constants.T_EXTENDS,re:/^extends\b/i},{value:r.Constants.T_FINAL,re:/^final\b/i},{value:r.Constants.T_FINALLY,re:/^finally\b/i},{value:r.Constants.T_FN,re:/^fn\b/i},{value:r.Constants.T_FOR,re:/^for\b/i},{value:r.Constants.T_FOREACH,re:/^foreach\b/i},{value:r.Constants.T_FUNCTION,re:/^function\b/i},{value:r.Constants.T_GLOBAL,re:/^global\b/i},{value:r.Constants.T_GOTO,re:/^goto\b/i},{value:r.Constants.T_IF,re:/^if\b/i},{value:r.Constants.T_IMPLEMENTS,re:/^implements\b/i},{value:r.Constants.T_INCLUDE,re:/^include\b/i},{value:r.Constants.T_INCLUDE_ONCE,re:/^include_once\b/i},{value:r.Constants.T_INSTANCEOF,re:/^instanceof\b/i},{value:r.Constants.T_INSTEADOF,re:/^insteadof\b/i},{value:r.Constants.T_INTERFACE,re:/^interface\b/i},{value:r.Constants.T_ISSET,re:/^isset\b/i},{value:r.Constants.T_LIST,re:/^list\b/i},{value:r.Constants.T_MATCH,re:/^match\b/i},{value:r.Constants.T_NEW,re:/^new\b/i},{value:r.Constants.T_LOGICAL_OR,re:/^or\b/i},{value:r.Constants.T_PRINT,re:/^print\b/i},{value:r.Constants.T_PRIVATE,re:/^private\b/i},{value:r.Constants.T_PROTECTED,re:/^protected\b/i},{value:r.Constants.T_PUBLIC,re:/^public\b/i},{value:r.Constants.T_READONLY,re:/^readonly\b/i},{value:r.Constants.T_REQUIRE,re:/^require\b/i},{value:r.Constants.T_REQUIRE_ONCE,re:/^require_once\b/i},{value:r.Constants.T_STATIC,re:/^static\b/i},{value:r.Constants.T_SWITCH,re:/^switch\b/i},{value:r.Constants.T_THROW,re:/^throw\b/i},{value:r.Constants.T_TRAIT,re:/^trait\b/i},{value:r.Constants.T_TRY,re:/^try\b/i},{value:r.Constants.T_UNSET,re:/^unset\b/i},{value:r.Constants.T_USE,re:/^use\b/i},{value:r.Constants.T_VAR,re:/^var\b/i},{value:r.Constants.T_WHILE,re:/^while\b/i},{value:r.Constants.T_LOGICAL_XOR,re:/^xor\b/i},{value:r.Constants.T_YIELD_FROM,re:/^yield\s+from\b/i},{value:r.Constants.T_YIELD,re:/^yield\b/i},{value:r.Constants.T_RETURN,re:/^return\b/i},{value:r.Constants.T_METHOD_C,re:/^__METHOD__\b/i},{value:r.Constants.T_LINE,re:/^__LINE__\b/i},{value:r.Constants.T_FILE,re:/^__FILE__\b/i},{value:r.Constants.T_FUNC_C,re:/^__FUNCTION__\b/i},{value:r.Constants.T_NS_C,re:/^__NAMESPACE__\b/i},{value:r.Constants.T_TRAIT_C,re:/^__TRAIT__\b/i},{value:r.Constants.T_DIR,re:/^__DIR__\b/i},{value:r.Constants.T_CLASS_C,re:/^__CLASS__\b/i},{value:r.Constants.T_AND_EQUAL,re:/^&=/},{value:r.Constants.T_ARRAY_CAST,re:/^\([ \t]*array[ \t]*\)/i},{value:r.Constants.T_BOOL_CAST,re:/^\([ \t]*(?:bool|boolean)[ \t]*\)/i},{value:r.Constants.T_DOUBLE_CAST,re:/^\([ \t]*(?:real|float|double)[ \t]*\)/i},{value:r.Constants.T_INT_CAST,re:/^\([ \t]*(?:int|integer)[ \t]*\)/i},{value:r.Constants.T_OBJECT_CAST,re:/^\([ \t]*object[ \t]*\)/i},{value:r.Constants.T_STRING_CAST,re:/^\([ \t]*(?:binary|string)[ \t]*\)/i},{value:r.Constants.T_UNSET_CAST,re:/^\([ \t]*unset[ \t]*\)/i},{value:r.Constants.T_BOOLEAN_AND,re:/^&&/},{value:r.Constants.T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG,re:/^&(?=[$])/},{value:r.Constants.T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG,re:/^(&)(?=[^\$|^&])/},{value:r.Constants.T_BOOLEAN_OR,re:/^\|\|/},{value:r.Constants.T_CLOSE_TAG,re:/^(?:\?>|<\/script>)(\r\n|\r|\n)?/i,func:function(){i("INITIAL")}},{value:r.Constants.T_DOUBLE_ARROW,re:/^=>/},{value:r.Constants.T_PAAMAYIM_NEKUDOTAYIM,re:/^::/},{value:r.Constants.T_INC,re:/^\+\+/},{value:r.Constants.T_DEC,re:/^--/},{value:r.Constants.T_CONCAT_EQUAL,re:/^\.=/},{value:r.Constants.T_DIV_EQUAL,re:/^\/=/},{value:r.Constants.T_XOR_EQUAL,re:/^\^=/},{value:r.Constants.T_MUL_EQUAL,re:/^\*=/},{value:r.Constants.T_MOD_EQUAL,re:/^%=/},{value:r.Constants.T_SL_EQUAL,re:/^<<=/},{value:r.Constants.T_START_HEREDOC,re:new RegExp("^[bB]?<<<[ \\t]*'("+l+")'(?:\\r\\n|\\r|\\n)"),func:function(t){n=t[1],i("NOWDOC")}},{value:r.Constants.T_START_HEREDOC,re:new RegExp('^[bB]?<<<[ \\t]*("?)('+l+")\\1(?:\\r\\n|\\r|\\n)"),func:function(t){n=t[2],s=!0,i("HEREDOC")}},{value:r.Constants.T_SL,re:/^<</},{value:r.Constants.T_SPACESHIP,re:/^<=>/},{value:r.Constants.T_IS_SMALLER_OR_EQUAL,re:/^<=/},{value:r.Constants.T_SR_EQUAL,re:/^>>=/},{value:r.Constants.T_SR,re:/^>>/},{value:r.Constants.T_IS_GREATER_OR_EQUAL,re:/^>=/},{value:r.Constants.T_OR_EQUAL,re:/^\|=/},{value:r.Constants.T_PLUS_EQUAL,re:/^\+=/},{value:r.Constants.T_MINUS_EQUAL,re:/^-=/},{value:r.Constants.T_OBJECT_OPERATOR,re:new RegExp("^->(?=[ \n\r\t]*"+l+")"),func:function(){_("LOOKING_FOR_PROPERTY")}},{value:r.Constants.T_OBJECT_OPERATOR,re:/^->/i},{value:r.Constants.T_ELLIPSIS,re:/^\.\.\./},{value:r.Constants.T_POW_EQUAL,re:/^\*\*=/},{value:r.Constants.T_POW,re:/^\*\*/},{value:r.Constants.T_COALESCE_EQUAL,re:/^\?\?=/},{value:r.Constants.T_COALESCE,re:/^\?\?/},{value:r.Constants.T_NULLSAFE_OBJECT_OPERATOR,re:/^\?->/},{value:r.Constants.T_NAME_FULLY_QUALIFIED,re:/^\\\w+(?:\\\w+)*/},{value:r.Constants.T_NAME_QUALIFIED,re:/^\w+\\\w+(?:\\\w+)*/},{value:r.Constants.T_NAME_RELATIVE,re:/^namespace\\\w+(?:\\\w+)*/},{value:r.Constants.T_NAMESPACE,re:/^namespace\b/i},{value:r.Constants.T_ATTRIBUTE,re:/^#\[([\S\s]*?)]/},{value:r.Constants.T_COMMENT,re:/^\/\*([\S\s]*?)(?:\*\/|$)/},{value:r.Constants.T_COMMENT,re:/^(?:\/\/|#)[^\r\n?]*(?:\?(?!>)[^\r\n?]*)*(?:\r\n|\r|\n)?/},{value:r.Constants.T_IS_IDENTICAL,re:/^===/},{value:r.Constants.T_IS_EQUAL,re:/^==/},{value:r.Constants.T_IS_NOT_IDENTICAL,re:/^!==/},{value:r.Constants.T_IS_NOT_EQUAL,re:/^(!=|<>)/},{value:r.Constants.T_DNUMBER,re:/^(?:[0-9]+\.[0-9]*|\.[0-9]+)(?:[eE][+-]?[0-9]+)?/},{value:r.Constants.T_DNUMBER,re:/^[0-9]+[eE][+-]?[0-9]+/},{value:r.Constants.T_LNUMBER,re:/^(?:0x[0-9A-F]+|0b[01]+|[0-9]+)/i},{value:r.Constants.T_VARIABLE,re:new RegExp("^\\$"+l)},{value:r.Constants.T_CONSTANT_ENCAPSED_STRING,re:/^[bB]?'[^'\\]*(?:\\[\s\S][^'\\]*)*'/},{value:r.Constants.T_CONSTANT_ENCAPSED_STRING,re:new RegExp('^[bB]?"'+C('"')+'"')},{value:-1,re:/^[bB]?"/,func:function(){i("DOUBLE_QUOTES")}},{value:-1,re:/^`/,func:function(){i("BACKTICKS")}},{value:r.Constants.T_NS_SEPARATOR,re:/^\\/},{value:r.Constants.T_STRING,re:/^[a-zA-Z_\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*/},{value:-1,re:/^\{/,func:function(){_("IN_SCRIPTING")}},{value:-1,re:/^\}/,func:function(){a>0&&T()}},{value:-1,re:/^[\[\];:?()!.,><=+-/*|&@^%"'$~]/}],DOUBLE_QUOTES:A.concat([{value:-1,re:/^"/,func:function(){i("IN_SCRIPTING")}},{value:r.Constants.T_ENCAPSED_AND_WHITESPACE,re:new RegExp("^"+C('"'))}]),BACKTICKS:A.concat([{value:-1,re:/^`/,func:function(){i("IN_SCRIPTING")}},{value:r.Constants.T_ENCAPSED_AND_WHITESPACE,re:new RegExp("^"+C("`"))}]),VAR_OFFSET:[{value:-1,re:/^\]/,func:function(){T()}},{value:r.Constants.T_NUM_STRING,re:/^(?:0x[0-9A-F]+|0b[01]+|[0-9]+)/i},{value:r.Constants.T_VARIABLE,re:new RegExp("^\\$"+l)},{value:r.Constants.T_STRING,re:new RegExp("^"+l)},{value:-1,re:/^[;:,.\[()|^&+-/*=%!~$<>?@{}"`]/}],LOOKING_FOR_PROPERTY:[{value:r.Constants.T_OBJECT_OPERATOR,re:/^->/},{value:r.Constants.T_STRING,re:new RegExp("^"+l),func:function(){T()}},{value:r.Constants.T_WHITESPACE,re:/^[ \n\r\t]+/}],LOOKING_FOR_VARNAME:[{value:r.Constants.T_STRING_VARNAME,re:new RegExp("^"+l+"(?=[\\[}])"),func:function(){i("IN_SCRIPTING")}}],NOWDOC:[{value:r.Constants.T_END_HEREDOC,matchFunc:function(t){var e=new RegExp("^"+n+"(?=;?[\\r\\n])");return t.match(e)?[t.substr(0,n.length)]:null},func:function(){i("IN_SCRIPTING")}},{value:r.Constants.T_ENCAPSED_AND_WHITESPACE,matchFunc:function(t){var e=new RegExp("[\\r\\n]"+n+"(?=;?[\\r\\n])").exec(t),r=e?e.index+1:t.length;return[t.substring(0,r)]}}],HEREDOC:A.concat([{value:r.Constants.T_END_HEREDOC,matchFunc:function(t){if(!s)return null;var e=new RegExp("^"+n+"(?=;?[\\r\\n])");return t.match(e)?[t.substr(0,n.length)]:null},func:function(){i("IN_SCRIPTING")}},{value:r.Constants.T_ENCAPSED_AND_WHITESPACE,matchFunc:function(t){var e=t.length,r=new RegExp("^"+C("")),o=r.exec(t);return o&&(e=o[0].length),(o=(r=new RegExp("([\\r\\n])"+n+"(?=;?[\\r\\n])")).exec(t.substring(0,e)))?(e=o.index+1,s=!0):s=!1,0==e?null:[t.substring(0,e)]}}])},h=[],L=1,N=!0;if(null===t)return h;for("string"!=typeof t&&(t=t.toString());t.length>0&&!0===N;){N=c[o[a]].some((function(e){var n=void 0!==e.matchFunc?e.matchFunc(t):t.match(e.re);if(null!==n){if(0==n[0].length)throw new Error("empty match");if(void 0!==e.func&&e.func(n),-1===e.value)h.push(n[0]);else{var r=n[0];h.push([parseInt(e.value,10),r,L]),L+=r.split("\n").length-1}return t=t.substring(n[0].length),!0}return!1}))}return h},r.Parser=function(t,e){var n=this.yybase,s=this.yydefault,o=this.yycheck,a=this.yyaction,i=this.yylen,_=this.yygbase,T=this.yygcheck,u=this.yyp,E=this.yygoto,p=this.yylhs,l=this.terminals,C=this.translate,A=this.yygdefault;this.pos=-1,this.line=1,this.tokenMap=this.createTokenMap(),this.dropTokens={},this.dropTokens[r.Constants.T_WHITESPACE]=1,this.dropTokens[r.Constants.T_OPEN_TAG]=1;var c=[];t.forEach((function(t,e){"object"==typeof t&&t[0]===r.Constants.T_OPEN_TAG_WITH_ECHO?(c.push([r.Constants.T_OPEN_TAG,t[1],t[2]]),c.push([r.Constants.T_ECHO,t[1],t[2]])):c.push(t)})),this.tokens=c;var h=this.TOKEN_NONE;this.startAttributes={startLine:1},this.endAttributes={};var L,N,R=[this.startAttributes],O=0,f=[O];for(this.yyastk=[],this.stackPos=0;;){if(0===n[O])L=s[O];else if(h===this.TOKEN_NONE&&(h=(N=this.getNextToken())>=0&&N<this.TOKEN_MAP_SIZE?C[N]:this.TOKEN_INVALID,R[this.stackPos]=this.startAttributes),((L=n[O]+h)>=0&&L<this.YYLAST&&o[L]===h||O<this.YY2TBLSTATE&&(L=n[O+this.YYNLSTATES]+h)>=0&&L<this.YYLAST&&o[L]===h)&&(L=a[L])!==this.YYDEFAULT)if(L>0){if(++this.stackPos,f[this.stackPos]=O=L,this.yyastk[this.stackPos]=this.tokenValue,R[this.stackPos]=this.startAttributes,h=this.TOKEN_NONE,L<this.YYNLSTATES)continue;L-=this.YYNLSTATES}else L=-L;else L=s[O];for(;;){if(0===L)return this.yyval;if(L===this.YYUNEXPECTED){if(!0!==e){for(var I=[],S=0;S<this.TOKEN_MAP_SIZE;++S)if(((L=n[O]+S)>=0&&L<this.YYLAST&&o[L]==S||O<this.YY2TBLSTATE&&(L=n[O+this.YYNLSTATES]+S)&&L<this.YYLAST&&o[L]==S)&&a[L]!=this.YYUNEXPECTED){if(4==I.length){I=[];break}I.push(this.terminals[S])}var P="";throw I.length&&(P=", expecting "+I.join(" or ")),new r.ParseError("syntax error, unexpected "+l[h]+P,this.startAttributes.startLine)}return this.startAttributes.startLine}for(var y in this.endAttributes)R[this.stackPos-i[L]][y]=this.endAttributes[y];if(this.stackPos-=i[L],O=(u=_[L=p[L]]+f[this.stackPos])>=0&&u<this.YYGLAST&&T[u]===L?E[u]:A[L],++this.stackPos,f[this.stackPos]=O,this.yyastk[this.stackPos]=this.yyval,R[this.stackPos]=this.startAttributes,O<this.YYNLSTATES)break;L=O-this.YYNLSTATES}}},r.ParseError=function(t,e){this.message=t,this.line=e},r.Parser.prototype.getNextToken=function(){var t,e;for(this.startAttributes={},this.endAttributes={};void 0!==this.tokens[++this.pos];){if("string"==typeof(t=this.tokens[this.pos]))return this.startAttributes.startLine=this.line,this.endAttributes.endLine=this.line,'b"'===t?(this.tokenValue='b"','"'.charCodeAt(0)):(this.tokenValue=t,t.charCodeAt(0));if(this.line+=null===(e=t[1].match(/\n/g))?0:e.length,r.Constants.T_COMMENT===t[0])Array.isArray(this.startAttributes.comments)||(this.startAttributes.comments=[]),this.startAttributes.comments.push({type:"comment",comment:t[1],line:t[2]});else if(r.Constants.T_ATTRIBUTE===t[0])this.tokenValue=t[1],this.startAttributes.startLine=t[2],this.endAttributes.endLine=this.line;else if(r.Constants.T_DOC_COMMENT===t[0])this.startAttributes.comments.push(new PHPParser_Comment_Doc(t[1],t[2]));else if(void 0===this.dropTokens[t[0]])return this.tokenValue=t[1],this.startAttributes.startLine=t[2],this.endAttributes.endLine=this.line,this.tokenMap[t[0]]}return this.startAttributes.startLine=this.line,0},r.Parser.prototype.tokenName=function(t){var e="UNKNOWN";return["T_THROW","T_INCLUDE","T_INCLUDE_ONCE","T_EVAL","T_REQUIRE","T_REQUIRE_ONCE","T_LOGICAL_OR","T_LOGICAL_XOR","T_LOGICAL_AND","T_PRINT","T_YIELD","T_DOUBLE_ARROW","T_YIELD_FROM","T_PLUS_EQUAL","T_MINUS_EQUAL","T_MUL_EQUAL","T_DIV_EQUAL","T_CONCAT_EQUAL","T_MOD_EQUAL","T_AND_EQUAL","T_OR_EQUAL","T_XOR_EQUAL","T_SL_EQUAL","T_SR_EQUAL","T_POW_EQUAL","T_COALESCE_EQUAL","T_COALESCE","T_BOOLEAN_OR","T_BOOLEAN_AND","T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG","T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG","T_IS_EQUAL","T_IS_NOT_EQUAL","T_IS_IDENTICAL","T_IS_NOT_IDENTICAL","T_SPACESHIP","T_IS_SMALLER_OR_EQUAL","T_IS_GREATER_OR_EQUAL","T_SL","T_SR","T_INSTANCEOF","T_INC","T_DEC","T_INT_CAST","T_DOUBLE_CAST","T_STRING_CAST","T_ARRAY_CAST","T_OBJECT_CAST","T_BOOL_CAST","T_UNSET_CAST","T_POW","T_NEW","T_CLONE","T_EXIT","T_IF","T_ELSEIF","T_ELSE","T_ENDIF","T_LNUMBER","T_DNUMBER","T_STRING","T_STRING_VARNAME","T_VARIABLE","T_NUM_STRING","T_INLINE_HTML","T_ENCAPSED_AND_WHITESPACE","T_CONSTANT_ENCAPSED_STRING","T_ECHO","T_DO","T_WHILE","T_ENDWHILE","T_FOR","T_ENDFOR","T_FOREACH","T_ENDFOREACH","T_DECLARE","T_ENDDECLARE","T_AS","T_SWITCH","T_MATCH","T_ENDSWITCH","T_CASE","T_DEFAULT","T_BREAK","T_CONTINUE","T_GOTO","T_FUNCTION","T_FN","T_CONST","T_RETURN","T_TRY","T_CATCH","T_FINALLY","T_THROW","T_USE","T_INSTEADOF","T_GLOBAL","T_STATIC","T_ABSTRACT","T_FINAL","T_PRIVATE","T_PROTECTED","T_PUBLIC","T_READONLY","T_VAR","T_UNSET","T_ISSET","T_EMPTY","T_HALT_COMPILER","T_CLASS","T_TRAIT","T_INTERFACE","T_ENUM","T_EXTENDS","T_IMPLEMENTS","T_OBJECT_OPERATOR","T_NULLSAFE_OBJECT_OPERATOR","T_DOUBLE_ARROW","T_LIST","T_ARRAY","T_CALLABLE","T_CLASS_C","T_TRAIT_C","T_METHOD_C","T_FUNC_C","T_LINE","T_FILE","T_START_HEREDOC","T_END_HEREDOC","T_DOLLAR_OPEN_CURLY_BRACES","T_CURLY_OPEN","T_PAAMAYIM_NEKUDOTAYIM","T_NAMESPACE","T_NS_C","T_DIR","T_NS_SEPARATOR","T_ELLIPSIS","T_NAME_FULLY_QUALIFIED","T_NAME_QUALIFIED","T_NAME_RELATIVE","T_ATTRIBUTE","T_ENUM","T_BAD_CHARACTER","T_COMMENT","T_DOC_COMMENT","T_OPEN_TAG","T_OPEN_TAG_WITH_ECHO","T_CLOSE_TAG","T_WHITESPACE"].some((function(n){return r.Constants[n]===t&&(e=n,!0)})),e},r.Parser.prototype.createTokenMap=function(){var t,e,n={};for(e=256;e<1e3;++e)r.Constants.T_OPEN_TAG_WITH_ECHO===e?n[e]=r.Constants.T_ECHO:r.Constants.T_CLOSE_TAG===e?n[e]=59:"UNKNOWN"!==(t=this.tokenName(e))&&(n[e]=this[t]);return n},r.Parser.prototype.TOKEN_NONE=-1,r.Parser.prototype.TOKEN_INVALID=175,r.Parser.prototype.TOKEN_MAP_SIZE=403,r.Parser.prototype.YYLAST=1196,r.Parser.prototype.YY2TBLSTATE=420,r.Parser.prototype.YYGLAST=545,r.Parser.prototype.YYNLSTATES=710,r.Parser.prototype.YYUNEXPECTED=32767,r.Parser.prototype.YYDEFAULT=-32766,r.Parser.prototype.YYERRTOK=256,r.Parser.prototype.T_THROW=257,r.Parser.prototype.T_INCLUDE=258,r.Parser.prototype.T_INCLUDE_ONCE=259,r.Parser.prototype.T_EVAL=260,r.Parser.prototype.T_REQUIRE=261,r.Parser.prototype.T_REQUIRE_ONCE=262,r.Parser.prototype.T_LOGICAL_OR=263,r.Parser.prototype.T_LOGICAL_XOR=264,r.Parser.prototype.T_LOGICAL_AND=265,r.Parser.prototype.T_PRINT=266,r.Parser.prototype.T_YIELD=267,r.Parser.prototype.T_DOUBLE_ARROW=268,r.Parser.prototype.T_YIELD_FROM=269,r.Parser.prototype.T_PLUS_EQUAL=270,r.Parser.prototype.T_MINUS_EQUAL=271,r.Parser.prototype.T_MUL_EQUAL=272,r.Parser.prototype.T_DIV_EQUAL=273,r.Parser.prototype.T_CONCAT_EQUAL=274,r.Parser.prototype.T_MOD_EQUAL=275,r.Parser.prototype.T_AND_EQUAL=276,r.Parser.prototype.T_OR_EQUAL=277,r.Parser.prototype.T_XOR_EQUAL=278,r.Parser.prototype.T_SL_EQUAL=279,r.Parser.prototype.T_SR_EQUAL=280,r.Parser.prototype.T_POW_EQUAL=281,r.Parser.prototype.T_COALESCE_EQUAL=282,r.Parser.prototype.T_COALESCE=283,r.Parser.prototype.T_BOOLEAN_OR=284,r.Parser.prototype.T_BOOLEAN_AND=285,r.Parser.prototype.T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG=286,r.Parser.prototype.T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG=287,r.Parser.prototype.T_IS_EQUAL=288,r.Parser.prototype.T_IS_NOT_EQUAL=289,r.Parser.prototype.T_IS_IDENTICAL=290,r.Parser.prototype.T_IS_NOT_IDENTICAL=291,r.Parser.prototype.T_SPACESHIP=292,r.Parser.prototype.T_IS_SMALLER_OR_EQUAL=293,r.Parser.prototype.T_IS_GREATER_OR_EQUAL=294,r.Parser.prototype.T_SL=295,r.Parser.prototype.T_SR=296,r.Parser.prototype.T_INSTANCEOF=297,r.Parser.prototype.T_INC=298,r.Parser.prototype.T_DEC=299,r.Parser.prototype.T_INT_CAST=300,r.Parser.prototype.T_DOUBLE_CAST=301,r.Parser.prototype.T_STRING_CAST=302,r.Parser.prototype.T_ARRAY_CAST=303,r.Parser.prototype.T_OBJECT_CAST=304,r.Parser.prototype.T_BOOL_CAST=305,r.Parser.prototype.T_UNSET_CAST=306,r.Parser.prototype.T_POW=307,r.Parser.prototype.T_NEW=308,r.Parser.prototype.T_CLONE=309,r.Parser.prototype.T_EXIT=310,r.Parser.prototype.T_IF=311,r.Parser.prototype.T_ELSEIF=312,r.Parser.prototype.T_ELSE=313,r.Parser.prototype.T_ENDIF=314,r.Parser.prototype.T_LNUMBER=315,r.Parser.prototype.T_DNUMBER=316,r.Parser.prototype.T_STRING=317,r.Parser.prototype.T_STRING_VARNAME=318,r.Parser.prototype.T_VARIABLE=319,r.Parser.prototype.T_NUM_STRING=320,r.Parser.prototype.T_INLINE_HTML=321,r.Parser.prototype.T_ENCAPSED_AND_WHITESPACE=322,r.Parser.prototype.T_CONSTANT_ENCAPSED_STRING=323,r.Parser.prototype.T_ECHO=324,r.Parser.prototype.T_DO=325,r.Parser.prototype.T_WHILE=326,r.Parser.prototype.T_ENDWHILE=327,r.Parser.prototype.T_FOR=328,r.Parser.prototype.T_ENDFOR=329,r.Parser.prototype.T_FOREACH=330,r.Parser.prototype.T_ENDFOREACH=331,r.Parser.prototype.T_DECLARE=332,r.Parser.prototype.T_ENDDECLARE=333,r.Parser.prototype.T_AS=334,r.Parser.prototype.T_SWITCH=335,r.Parser.prototype.T_MATCH=336,r.Parser.prototype.T_ENDSWITCH=337,r.Parser.prototype.T_CASE=338,r.Parser.prototype.T_DEFAULT=339,r.Parser.prototype.T_BREAK=340,r.Parser.prototype.T_CONTINUE=341,r.Parser.prototype.T_GOTO=342,r.Parser.prototype.T_FUNCTION=343,r.Parser.prototype.T_FN=344,r.Parser.prototype.T_CONST=345,r.Parser.prototype.T_RETURN=346,r.Parser.prototype.T_TRY=347,r.Parser.prototype.T_CATCH=348,r.Parser.prototype.T_FINALLY=349,r.Parser.prototype.T_USE=350,r.Parser.prototype.T_INSTEADOF=351,r.Parser.prototype.T_GLOBAL=352,r.Parser.prototype.T_STATIC=353,r.Parser.prototype.T_ABSTRACT=354,r.Parser.prototype.T_FINAL=355,r.Parser.prototype.T_PRIVATE=356,r.Parser.prototype.T_PROTECTED=357,r.Parser.prototype.T_PUBLIC=358,r.Parser.prototype.T_READONLY=359,r.Parser.prototype.T_VAR=360,r.Parser.prototype.T_UNSET=361,r.Parser.prototype.T_ISSET=362,r.Parser.prototype.T_EMPTY=363,r.Parser.prototype.T_HALT_COMPILER=364,r.Parser.prototype.T_CLASS=365,r.Parser.prototype.T_TRAIT=366,r.Parser.prototype.T_INTERFACE=367,r.Parser.prototype.T_ENUM=368,r.Parser.prototype.T_EXTENDS=369,r.Parser.prototype.T_IMPLEMENTS=370,r.Parser.prototype.T_OBJECT_OPERATOR=371,r.Parser.prototype.T_NULLSAFE_OBJECT_OPERATOR=372,r.Parser.prototype.T_LIST=373,r.Parser.prototype.T_ARRAY=374,r.Parser.prototype.T_CALLABLE=375,r.Parser.prototype.T_CLASS_C=376,r.Parser.prototype.T_TRAIT_C=377,r.Parser.prototype.T_METHOD_C=378,r.Parser.prototype.T_FUNC_C=379,r.Parser.prototype.T_LINE=380,r.Parser.prototype.T_FILE=381,r.Parser.prototype.T_START_HEREDOC=382,r.Parser.prototype.T_END_HEREDOC=383,r.Parser.prototype.T_DOLLAR_OPEN_CURLY_BRACES=384,r.Parser.prototype.T_CURLY_OPEN=385,r.Parser.prototype.T_PAAMAYIM_NEKUDOTAYIM=386,r.Parser.prototype.T_NAMESPACE=387,r.Parser.prototype.T_NS_C=388,r.Parser.prototype.T_DIR=389,r.Parser.prototype.T_NS_SEPARATOR=390,r.Parser.prototype.T_ELLIPSIS=391,r.Parser.prototype.T_NAME_FULLY_QUALIFIED=392,r.Parser.prototype.T_NAME_QUALIFIED=393,r.Parser.prototype.T_NAME_RELATIVE=394,r.Parser.prototype.T_ATTRIBUTE=395,r.Parser.prototype.T_BAD_CHARACTER=396,r.Parser.prototype.T_COMMENT=397,r.Parser.prototype.T_DOC_COMMENT=398,r.Parser.prototype.T_OPEN_TAG=399,r.Parser.prototype.T_OPEN_TAG_WITH_ECHO=400,r.Parser.prototype.T_CLOSE_TAG=401,r.Parser.prototype.T_WHITESPACE=402,r.Parser.prototype.terminals=["EOF","error","T_THROW","T_INCLUDE","T_INCLUDE_ONCE","T_EVAL","T_REQUIRE","T_REQUIRE_ONCE","','","T_LOGICAL_OR","T_LOGICAL_XOR","T_LOGICAL_AND","T_PRINT","T_YIELD","T_DOUBLE_ARROW","T_YIELD_FROM","'='","T_PLUS_EQUAL","T_MINUS_EQUAL","T_MUL_EQUAL","T_DIV_EQUAL","T_CONCAT_EQUAL","T_MOD_EQUAL","T_AND_EQUAL","T_OR_EQUAL","T_XOR_EQUAL","T_SL_EQUAL","T_SR_EQUAL","T_POW_EQUAL","T_COALESCE_EQUAL","'?'","':'","T_COALESCE","T_BOOLEAN_OR","T_BOOLEAN_AND","'|'","'^'","T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG","T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG","T_IS_EQUAL","T_IS_NOT_EQUAL","T_IS_IDENTICAL","T_IS_NOT_IDENTICAL","T_SPACESHIP","'<'","T_IS_SMALLER_OR_EQUAL","'>'","T_IS_GREATER_OR_EQUAL","T_SL","T_SR","'+'","'-'","'.'","'*'","'/'","'%'","'!'","T_INSTANCEOF","'~'","T_INC","T_DEC","T_INT_CAST","T_DOUBLE_CAST","T_STRING_CAST","T_ARRAY_CAST","T_OBJECT_CAST","T_BOOL_CAST","T_UNSET_CAST","'@'","T_POW","'['","T_NEW","T_CLONE","T_EXIT","T_IF","T_ELSEIF","T_ELSE","T_ENDIF","T_LNUMBER","T_DNUMBER","T_STRING","T_STRING_VARNAME","T_VARIABLE","T_NUM_STRING","T_INLINE_HTML","T_ENCAPSED_AND_WHITESPACE","T_CONSTANT_ENCAPSED_STRING","T_ECHO","T_DO","T_WHILE","T_ENDWHILE","T_FOR","T_ENDFOR","T_FOREACH","T_ENDFOREACH","T_DECLARE","T_ENDDECLARE","T_AS","T_SWITCH","T_MATCH","T_ENDSWITCH","T_CASE","T_DEFAULT","T_BREAK","T_CONTINUE","T_GOTO","T_FUNCTION","T_FN","T_CONST","T_RETURN","T_TRY","T_CATCH","T_FINALLY","T_USE","T_INSTEADOF","T_GLOBAL","T_STATIC","T_ABSTRACT","T_FINAL","T_PRIVATE","T_PROTECTED","T_PUBLIC","T_READONLY","T_VAR","T_UNSET","T_ISSET","T_EMPTY","T_HALT_COMPILER","T_CLASS","T_TRAIT","T_INTERFACE","T_ENUM","T_EXTENDS","T_IMPLEMENTS","T_OBJECT_OPERATOR","T_NULLSAFE_OBJECT_OPERATOR","T_LIST","T_ARRAY","T_CALLABLE","T_CLASS_C","T_TRAIT_C","T_METHOD_C","T_FUNC_C","T_LINE","T_FILE","T_START_HEREDOC","T_END_HEREDOC","T_DOLLAR_OPEN_CURLY_BRACES","T_CURLY_OPEN","T_PAAMAYIM_NEKUDOTAYIM","T_NAMESPACE","T_NS_C","T_DIR","T_NS_SEPARATOR","T_ELLIPSIS","T_NAME_FULLY_QUALIFIED","T_NAME_QUALIFIED","T_NAME_RELATIVE","T_ATTRIBUTE","';'","']'","'{'","'}'","'('","')'","'`'","'\"'","'$'","T_BAD_CHARACTER","T_COMMENT","T_DOC_COMMENT","T_OPEN_TAG","T_OPEN_TAG_WITH_ECHO","T_CLOSE_TAG","T_WHITESPACE","???"],r.Parser.prototype.translate=[0,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,56,166,175,167,55,175,175,163,164,53,50,8,51,52,54,175,175,175,175,175,175,175,175,175,175,31,159,44,16,46,30,68,175,175,175,175,175,175,175,175,175,175,175,175,175,175,