181 lines
59 KiB
JavaScript
181 lines
59 KiB
JavaScript
var Q={exports:{}};(function(H,V){ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(f,S,I){var M=f("../lib/oop"),w=f("./text_highlight_rules").TextHighlightRules,C=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},C.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};M.inherits(C,w),C.getTagRule=function(d){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},C.getStartRule=function(d){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:d}},C.getEndRule=function(d){return{token:"comment.doc",regex:"\\*\\/",next:d}},S.DocCommentHighlightRules=C}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(f,S,I){var M=f("../lib/oop"),w=f("./doc_comment_highlight_rules").DocCommentHighlightRules,C=f("./text_highlight_rules").TextHighlightRules,d="[a-zA-Z\\$_\xA1-\uFFFF][a-zA-Z\\d\\$_\xA1-\uFFFF]*",m=function(k){var x=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),o="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",t="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[w.getStartRule("doc-start"),y("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+d+")(\\.)(prototype)(\\.)("+d+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+d+")(\\.)("+d+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+d+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+d+")(\\.)("+d+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+d+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+d+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:`from(?=\\s*('|"))`},{token:"keyword",regex:"(?:"+o+")\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:x,regex:d},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/,next:"start"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+d+")(\\.)("+d+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:d},{regex:"",token:"empty",next:"no_regex"}],start:[w.getStartRule("doc-start"),y("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:d},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:t},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:t},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},(!k||!k.noES6)&&(this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(p,u,h){if(this.next=p=="{"?this.nextState:"",p=="{"&&h.length)h.unshift("start",u);else if(p=="}"&&h.length&&(h.shift(),this.next=h.shift(),this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1))return"paren.quasi.end";return p=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:t},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),(!k||k.jsx!=!1)&&g.call(this)),this.embedRules(w,"doc-",[w.getEndRule("no_regex")]),this.normalizeRules()};M.inherits(m,C);function g(){var k=d.replace("\\d","\\d\\-"),x={onMatch:function(t,p,u){var h=t.charAt(1)=="/"?2:1;return h==1?(p!=this.nextState?u.unshift(this.next,this.nextState,0):u.unshift(this.next),u[2]++):h==2&&p==this.nextState&&(u[1]--,(!u[1]||u[1]<0)&&(u.shift(),u.shift())),[{type:"meta.tag.punctuation."+(h==1?"":"end-")+"tag-open.xml",value:t.slice(0,h)},{type:"meta.tag.tag-name.xml",value:t.substr(h)}]},regex:"</?"+k,next:"jsxAttributes",nextState:"jsx"};this.$rules.start.unshift(x);var o={regex:"{",token:"paren.quasi.start",push:"start"};this.$rules.jsx=[o,x,{include:"reference"},{defaultToken:"string"}],this.$rules.jsxAttributes=[{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",onMatch:function(t,p,u){return p==u[0]&&u.shift(),t.length==2&&(u[0]==this.nextState&&u[1]--,(!u[1]||u[1]<0)&&u.splice(0,2)),this.next=u[0]||"start",[{type:this.token,value:t}]},nextState:"jsx"},o,y("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:k},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},x],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function y(k){return[{token:"comment",regex:/\/\*/,next:[w.getTagRule(),{token:"comment",regex:"\\*\\/",next:k||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[w.getTagRule(),{token:"comment",regex:"$|^",next:k||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}S.JavaScriptHighlightRules=m}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(f,S,I){var M=f("../range").Range,w=function(){};(function(){this.checkOutdent=function(C,d){return/^\s+$/.test(C)?/^\s*\}/.test(d):!1},this.autoOutdent=function(C,d){var m=C.getLine(d),g=m.match(/^(\s*\})/);if(!g)return 0;var y=g[1].length,k=C.findMatchingBracket({row:d,column:y});if(!k||k.row==d)return 0;var x=this.$getIndent(C.getLine(k.row));C.replace(new M(d,0,d,y-1),x)},this.$getIndent=function(C){return C.match(/^\s*/)[0]}}).call(w.prototype),S.MatchingBraceOutdent=w}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(f,S,I){var M=f("../../lib/oop"),w=f("../../range").Range,C=f("./fold_mode").FoldMode,d=S.FoldMode=function(m){m&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+m.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+m.end)))};M.inherits(d,C),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(m,g,y){var k=m.getLine(y);if(this.singleLineBlockCommentRe.test(k)&&!this.startRegionRe.test(k)&&!this.tripleStarBlockCommentRe.test(k))return"";var x=this._getFoldWidgetBase(m,g,y);return!x&&this.startRegionRe.test(k)?"start":x},this.getFoldWidgetRange=function(m,g,y,k){var x=m.getLine(y);if(this.startRegionRe.test(x))return this.getCommentRegionBlock(m,x,y);var p=x.match(this.foldingStartMarker);if(p){var o=p.index;if(p[1])return this.openingBracketBlock(m,p[1],y,o);var t=m.getCommentFoldRange(y,o+p[0].length,1);return t&&!t.isMultiLine()&&(k?t=this.getSectionRange(m,y):g!="all"&&(t=null)),t}if(g!=="markbegin"){var p=x.match(this.foldingStopMarker);if(p){var o=p.index+p[0].length;return p[1]?this.closingBracketBlock(m,p[1],y,o):m.getCommentFoldRange(y,o,-1)}}},this.getSectionRange=function(m,g){var y=m.getLine(g),k=y.search(/\S/),x=g,o=y.length;g=g+1;for(var t=g,p=m.getLength();++g<p;){y=m.getLine(g);var u=y.search(/\S/);if(u!==-1){if(k>u)break;var h=this.getFoldWidgetRange(m,"all",g);if(h){if(h.start.row<=x)break;if(h.isMultiLine())g=h.end.row;else if(k==u)break}t=g}}return new w(x,o,t,m.getLine(t).length)},this.getCommentRegionBlock=function(m,g,y){for(var k=g.search(/\s*$/),x=m.getLength(),o=y,t=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,p=1;++y<x;){g=m.getLine(y);var u=t.exec(g);if(!!u&&(u[1]?p--:p++,!p))break}var h=y;if(h>o)return new w(o,k,h,g.length)}}.call(d.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(f,S,I){var M=f("../lib/oop"),w=f("./text").Mode,C=f("./javascript_highlight_rules").JavaScriptHighlightRules,d=f("./matching_brace_outdent").MatchingBraceOutdent,m=f("../worker/worker_client").WorkerClient,g=f("./behaviour/cstyle").CstyleBehaviour,y=f("./folding/cstyle").FoldMode,k=function(){this.HighlightRules=C,this.$outdent=new d,this.$behaviour=new g,this.foldingRules=new y};M.inherits(k,w),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.getNextLineIndent=function(x,o,t){var p=this.$getIndent(o),u=this.getTokenizer().getLineTokens(o,x),h=u.tokens,A=u.state;if(h.length&&h[h.length-1].type=="comment")return p;if(x=="start"||x=="no_regex"){var L=o.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);L&&(p+=t)}else if(x=="doc-start"){if(A=="start"||A=="no_regex")return"";var L=o.match(/^\s*(\/?)\*/);L&&(L[1]&&(p+=" "),p+="* ")}return p},this.checkOutdent=function(x,o,t){return this.$outdent.checkOutdent(o,t)},this.autoOutdent=function(x,o,t){this.$outdent.autoOutdent(o,t)},this.createWorker=function(x){var o=new m(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return o.attachToDocument(x.getDocument()),o.on("annotate",function(t){x.setAnnotations(t.data)}),o.on("terminate",function(){x.clearAnnotations()}),o},this.$id="ace/mode/javascript",this.snippetFileId="ace/snippets/javascript"}.call(k.prototype),S.Mode=k}),function(){ace.require(["ace/mode/javascript"],function(f){H&&(H.exports=f)})}()})(Q);var q={exports:{}};(function(H,V){ace.define("ace/theme/eclipse.css",["require","exports","module"],function(f,S,I){I.exports=`.ace-eclipse .ace_gutter {
|
|
background: #ebebeb;
|
|
border-right: 1px solid rgb(159, 159, 159);
|
|
color: rgb(136, 136, 136);
|
|
}
|
|
|
|
.ace-eclipse .ace_print-margin {
|
|
width: 1px;
|
|
background: #ebebeb;
|
|
}
|
|
|
|
.ace-eclipse {
|
|
background-color: #FFFFFF;
|
|
color: black;
|
|
}
|
|
|
|
.ace-eclipse .ace_fold {
|
|
background-color: rgb(60, 76, 114);
|
|
}
|
|
|
|
.ace-eclipse .ace_cursor {
|
|
color: black;
|
|
}
|
|
|
|
.ace-eclipse .ace_storage,
|
|
.ace-eclipse .ace_keyword,
|
|
.ace-eclipse .ace_variable {
|
|
color: rgb(127, 0, 85);
|
|
}
|
|
|
|
.ace-eclipse .ace_constant.ace_buildin {
|
|
color: rgb(88, 72, 246);
|
|
}
|
|
|
|
.ace-eclipse .ace_constant.ace_library {
|
|
color: rgb(6, 150, 14);
|
|
}
|
|
|
|
.ace-eclipse .ace_function {
|
|
color: rgb(60, 76, 114);
|
|
}
|
|
|
|
.ace-eclipse .ace_string {
|
|
color: rgb(42, 0, 255);
|
|
}
|
|
|
|
.ace-eclipse .ace_comment {
|
|
color: rgb(113, 150, 130);
|
|
}
|
|
|
|
.ace-eclipse .ace_comment.ace_doc {
|
|
color: rgb(63, 95, 191);
|
|
}
|
|
|
|
.ace-eclipse .ace_comment.ace_doc.ace_tag {
|
|
color: rgb(127, 159, 191);
|
|
}
|
|
|
|
.ace-eclipse .ace_constant.ace_numeric {
|
|
color: darkblue;
|
|
}
|
|
|
|
.ace-eclipse .ace_tag {
|
|
color: rgb(25, 118, 116);
|
|
}
|
|
|
|
.ace-eclipse .ace_type {
|
|
color: rgb(127, 0, 127);
|
|
}
|
|
|
|
.ace-eclipse .ace_xml-pe {
|
|
color: rgb(104, 104, 91);
|
|
}
|
|
|
|
.ace-eclipse .ace_marker-layer .ace_selection {
|
|
background: rgb(181, 213, 255);
|
|
}
|
|
|
|
.ace-eclipse .ace_marker-layer .ace_bracket {
|
|
margin: -1px 0 0 -1px;
|
|
border: 1px solid rgb(192, 192, 192);
|
|
}
|
|
|
|
.ace-eclipse .ace_meta.ace_tag {
|
|
color:rgb(25, 118, 116);
|
|
}
|
|
|
|
.ace-eclipse .ace_invisible {
|
|
color: #ddd;
|
|
}
|
|
|
|
.ace-eclipse .ace_entity.ace_other.ace_attribute-name {
|
|
color:rgb(127, 0, 127);
|
|
}
|
|
.ace-eclipse .ace_marker-layer .ace_step {
|
|
background: rgb(255, 255, 0);
|
|
}
|
|
|
|
.ace-eclipse .ace_active-line {
|
|
background: rgb(232, 242, 254);
|
|
}
|
|
|
|
.ace-eclipse .ace_gutter-active-line {
|
|
background-color : #DADADA;
|
|
}
|
|
|
|
.ace-eclipse .ace_marker-layer .ace_selected-word {
|
|
border: 1px solid rgb(181, 213, 255);
|
|
}
|
|
|
|
.ace-eclipse .ace_indent-guide {
|
|
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
|
|
}
|
|
|
|
.ace-eclipse .ace_indent-guide-active {
|
|
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
|
|
}
|
|
`}),ace.define("ace/theme/eclipse",["require","exports","module","ace/theme/eclipse.css","ace/lib/dom"],function(f,S,I){S.isDark=!1,S.cssText=f("./eclipse.css"),S.cssClass="ace-eclipse";var M=f("../lib/dom");M.importCssString(S.cssText,S.cssClass,!1)}),function(){ace.require(["ace/theme/eclipse"],function(f){H&&(H.exports=f)})}()})(q);var ee={exports:{}};(function(H,V){ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],function(f,S,I){var M=f("./lib/dom"),w=f("./lib/oop"),C=f("./lib/event_emitter").EventEmitter,d=f("./lib/lang"),m=f("./range").Range,g=f("./range_list").RangeList,y=f("./keyboard/hash_handler").HashHandler,k=f("./tokenizer").Tokenizer,x=f("./clipboard"),o={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,i,r){var n=e.session.getTextRange();return r?n.replace(/\n\r?([ \t]*\S)/g,`
|
|
`+r+"$1"):n},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return x.getText&&x.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(e){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){var i=e.session.$mode||{};return i.blockComment&&i.blockComment.start||""},BLOCK_COMMENT_END:function(e){var i=e.session.$mode||{};return i.blockComment&&i.blockComment.end||""},LINE_COMMENT:function(e){var i=e.session.$mode||{};return i.lineCommentStart||""},CURRENT_YEAR:t.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:t.bind(null,{year:"2-digit"}),CURRENT_MONTH:t.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:t.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:t.bind(null,{month:"short"}),CURRENT_DATE:t.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:t.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:t.bind(null,{weekday:"short"}),CURRENT_HOUR:t.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:t.bind(null,{minute:"2-digit"}),CURRENT_SECOND:t.bind(null,{second:"2-digit"})};o.SELECTED_TEXT=o.SELECTION;function t(e){var i=new Date().toLocaleString("en-us",e);return i.length==1?"0"+i:i}var p=function(){this.snippetMap={},this.snippetNameMap={}};(function(){w.implement(this,C),this.getTokenizer=function(){return p.$tokenizer||this.createTokenizer()},this.createTokenizer=function(){function e(n){return n=n.substr(1),/^\d+$/.test(n)?[{tabstopId:parseInt(n,10)}]:[{text:n}]}function i(n){return"(?:[^\\\\"+n+"]|\\\\.)"}var r={regex:"/("+i("/")+"+)/",onMatch:function(n,s,l){var a=l[0];return a.fmtString=!0,a.guard=n.slice(1,-1),a.flag="",""},next:"formatString"};return p.$tokenizer=new k({start:[{regex:/\\./,onMatch:function(n,s,l){var a=n[1];return(a=="}"&&l.length||"`$\\".indexOf(a)!=-1)&&(n=a),[n]}},{regex:/}/,onMatch:function(n,s,l){return[l.length?l.shift():n]}},{regex:/\$(?:\d+|\w+)/,onMatch:e},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(n,s,l){var a=e(n.substr(1));return l.unshift(a[0]),a},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+i("\\|")+"*\\|",onMatch:function(n,s,l){var a=n.slice(1,-1).replace(/\\[,|\\]|,/g,function(b){return b.length==2?b[1]:"\0"}).split("\0").map(function(b){return{value:b}});return l[0].choices=a,[a[0]]},next:"start"},r,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(n,s,l){return l.length&&l[0].expectElse?(l[0].expectElse=!1,l[0].ifEnd={elseEnd:l[0]},[l[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(n,s,l){var a=n[1];return a=="}"&&l.length||"`$\\".indexOf(a)!=-1?n=a:a=="n"?n=`
|
|
`:a=="t"?n=" ":"ulULE".indexOf(a)!=-1&&(n={changeCase:a,local:a>"a"}),[n]}},{regex:"/\\w*}",onMatch:function(n,s,l){var a=l.shift();return a&&(a.flag=n.slice(1,-1)),this.next=a&&a.tabstopId?"start":"",[a||n]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(n,s,l){return[{text:n.slice(1)}]}},{regex:/\${\w+/,onMatch:function(n,s,l){var a={text:n.slice(2)};return l.unshift(a),[a]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(n,s,l){var a=l.shift();return this.next=a&&a.tabstopId?"start":"",[a||n]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(n,s,l){var a=l[0];return a.formatFunction=n.slice(2,-1),[l.shift()]},next:"formatString"},r,{regex:/:[\?\-+]?/,onMatch:function(n,s,l){n[1]=="+"&&(l[0].ifEnd=l[0]),n[1]=="?"&&(l[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),p.$tokenizer},this.tokenizeTmSnippet=function(e,i){return this.getTokenizer().getLineTokens(e,i).tokens.map(function(r){return r.value||r})},this.getVariableValue=function(e,i,r){if(/^\d+$/.test(i))return(this.variables.__||{})[i]||"";if(/^[A-Z]\d+$/.test(i))return(this.variables[i[0]+"__"]||{})[i.substr(1)]||"";if(i=i.replace(/^TM_/,""),!this.variables.hasOwnProperty(i))return"";var n=this.variables[i];return typeof n=="function"&&(n=this.variables[i](e,i,r)),n==null?"":n},this.variables=o,this.tmStrFormat=function(e,i,r){if(!i.fmt)return e;var n=i.flag||"",s=i.guard;s=new RegExp(s,n.replace(/[^gim]/g,""));var l=typeof i.fmt=="string"?this.tokenizeTmSnippet(i.fmt,"formatString"):i.fmt,a=this,b=e.replace(s,function(){var c=a.variables.__;a.variables.__=[].slice.call(arguments);for(var T=a.resolveVariables(l,r),v="E",_=0;_<T.length;_++){var R=T[_];if(typeof R=="object")if(T[_]="",R.changeCase&&R.local){var E=T[_+1];E&&typeof E=="string"&&(R.changeCase=="u"?T[_]=E[0].toUpperCase():T[_]=E[0].toLowerCase(),T[_+1]=E.substr(1))}else R.changeCase&&(v=R.changeCase);else v=="U"?T[_]=R.toUpperCase():v=="L"&&(T[_]=R.toLowerCase())}return a.variables.__=c,T.join("")});return b},this.tmFormatFunction=function(e,i,r){return i.formatFunction=="upcase"?e.toUpperCase():i.formatFunction=="downcase"?e.toLowerCase():e},this.resolveVariables=function(e,i){for(var r=[],n="",s=!0,l=0;l<e.length;l++){var a=e[l];if(typeof a=="string"){r.push(a),a==`
|
|
`?(s=!0,n=""):s&&(n=/^\t*/.exec(a)[0],s=/\S/.test(a));continue}if(!!a){if(s=!1,a.fmtString){var b=e.indexOf(a,l+1);b==-1&&(b=e.length),a.fmt=e.slice(l+1,b),l=b}if(a.text){var c=this.getVariableValue(i,a.text,n)+"";a.fmtString&&(c=this.tmStrFormat(c,a,i)),a.formatFunction&&(c=this.tmFormatFunction(c,a,i)),c&&!a.ifEnd?(r.push(c),T(a)):!c&&a.ifEnd&&T(a.ifEnd)}else a.elseEnd?T(a.elseEnd):(a.tabstopId!=null||a.changeCase!=null)&&r.push(a)}}function T(v){var _=e.indexOf(v,l+1);_!=-1&&(l=_)}return r},this.insertSnippetForSelection=function(e,i){var r=e.getCursorPosition(),n=e.session.getLine(r.row),s=e.session.getTabString(),l=n.match(/^\s*/)[0];r.column<l.length&&(l=l.slice(0,r.column)),i=i.replace(/\r/g,"");var a=this.tokenizeTmSnippet(i);a=this.resolveVariables(a,e),a=a.map(function($){return $==`
|
|
`?$+l:typeof $=="string"?$.replace(/\t/g,s):$});var b=[];a.forEach(function($,F){if(typeof $=="object"){var O=$.tabstopId,N=b[O];if(N||(N=b[O]=[],N.index=O,N.value="",N.parents={}),N.indexOf($)===-1){$.choices&&!N.choices&&(N.choices=$.choices),N.push($);var U=a.indexOf($,F+1);if(U!==-1){var z=a.slice(F+1,U),J=z.some(function(Z){return typeof Z=="object"});J&&!N.value?N.value=z:z.length&&(!N.value||typeof N.value!="string")&&(N.value=z.join(""))}}}}),b.forEach(function($){$.length=0});var c={};function T($){for(var F=[],O=0;O<$.length;O++){var N=$[O];if(typeof N=="object"){if(c[N.tabstopId])continue;var U=$.lastIndexOf(N,O-1);N=F[U]||{tabstopId:N.tabstopId}}F[O]=N}return F}for(var v=0;v<a.length;v++){var _=a[v];if(typeof _=="object"){var R=_.tabstopId,E=b[R],B=a.indexOf(_,v+1);if(c[R]){c[R]===_&&(delete c[R],Object.keys(c).forEach(function($){E.parents[$]=!0}));continue}c[R]=_;var D=E.value;typeof D!="string"?D=T(D):_.fmt&&(D=this.tmStrFormat(D,_,e)),a.splice.apply(a,[v+1,Math.max(0,B-v)].concat(D,_)),E.indexOf(_)===-1&&E.push(_)}}var W=0,P=0,j="";a.forEach(function($){if(typeof $=="string"){var F=$.split(`
|
|
`);F.length>1?(P=F[F.length-1].length,W+=F.length-1):P+=$.length,j+=$}else $&&($.start?$.end={row:W,column:P}:$.start={row:W,column:P})});var Y=e.getSelectionRange(),X=e.session.replace(Y,j),K=new u(e),G=e.inVirtualSelectionMode&&e.selection.index;K.addTabstops(b,Y.start,X,G)},this.insertSnippet=function(e,i){var r=this;if(e.inVirtualSelectionMode)return r.insertSnippetForSelection(e,i);e.forEachSelection(function(){r.insertSnippetForSelection(e,i)},null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},this.$getScope=function(e){var i=e.session.$mode.$id||"";if(i=i.split("/").pop(),i==="html"||i==="php"){i==="php"&&!e.session.$mode.inlinePhp&&(i="html");var r=e.getCursorPosition(),n=e.session.getState(r.row);typeof n=="object"&&(n=n[0]),n.substring&&(n.substring(0,3)=="js-"?i="javascript":n.substring(0,4)=="css-"?i="css":n.substring(0,4)=="php-"&&(i="php"))}return i},this.getActiveScopes=function(e){var i=this.$getScope(e),r=[i],n=this.snippetMap;return n[i]&&n[i].includeScopes&&r.push.apply(r,n[i].includeScopes),r.push("_"),r},this.expandWithTab=function(e,i){var r=this,n=e.forEachSelection(function(){return r.expandSnippetForSelection(e,i)},null,{keepOrder:!0});return n&&e.tabstopManager&&e.tabstopManager.tabNext(),n},this.expandSnippetForSelection=function(e,i){var r=e.getCursorPosition(),n=e.session.getLine(r.row),s=n.substring(0,r.column),l=n.substr(r.column),a=this.snippetMap,b;return this.getActiveScopes(e).some(function(c){var T=a[c];return T&&(b=this.findMatchingSnippet(T,s,l)),!!b},this),b?(i&&i.dryRun||(e.session.doc.removeInLine(r.row,r.column-b.replaceBefore.length,r.column+b.replaceAfter.length),this.variables.M__=b.matchBefore,this.variables.T__=b.matchAfter,this.insertSnippetForSelection(e,b.content),this.variables.M__=this.variables.T__=null),!0):!1},this.findMatchingSnippet=function(e,i,r){for(var n=e.length;n--;){var s=e[n];if(!(s.startRe&&!s.startRe.test(i))&&!(s.endRe&&!s.endRe.test(r))&&!(!s.startRe&&!s.endRe))return s.matchBefore=s.startRe?s.startRe.exec(i):[""],s.matchAfter=s.endRe?s.endRe.exec(r):[""],s.replaceBefore=s.triggerRe?s.triggerRe.exec(i)[0]:"",s.replaceAfter=s.endTriggerRe?s.endTriggerRe.exec(r)[0]:"",s}},this.snippetMap={},this.snippetNameMap={},this.register=function(e,i){var r=this.snippetMap,n=this.snippetNameMap,s=this;e||(e=[]);function l(c){return c&&!/^\^?\(.*\)\$?$|^\\b$/.test(c)&&(c="(?:"+c+")"),c||""}function a(c,T,v){return c=l(c),T=l(T),v?(c=T+c,c&&c[c.length-1]!="$"&&(c=c+"$")):(c=c+T,c&&c[0]!="^"&&(c="^"+c)),new RegExp(c)}function b(c){c.scope||(c.scope=i||"_"),i=c.scope,r[i]||(r[i]=[],n[i]={});var T=n[i];if(c.name){var v=T[c.name];v&&s.unregister(v),T[c.name]=c}r[i].push(c),c.prefix&&(c.tabTrigger=c.prefix),!c.content&&c.body&&(c.content=Array.isArray(c.body)?c.body.join(`
|
|
`):c.body),c.tabTrigger&&!c.trigger&&(!c.guard&&/^\w/.test(c.tabTrigger)&&(c.guard="\\b"),c.trigger=d.escapeRegExp(c.tabTrigger)),!(!c.trigger&&!c.guard&&!c.endTrigger&&!c.endGuard)&&(c.startRe=a(c.trigger,c.guard,!0),c.triggerRe=new RegExp(c.trigger),c.endRe=a(c.endTrigger,c.endGuard,!0),c.endTriggerRe=new RegExp(c.endTrigger))}Array.isArray(e)?e.forEach(b):Object.keys(e).forEach(function(c){b(e[c])}),this._signal("registerSnippets",{scope:i})},this.unregister=function(e,i){var r=this.snippetMap,n=this.snippetNameMap;function s(l){var a=n[l.scope||i];if(a&&a[l.name]){delete a[l.name];var b=r[l.scope||i],c=b&&b.indexOf(l);c>=0&&b.splice(c,1)}}e.content?s(e):Array.isArray(e)&&e.forEach(s)},this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");for(var i=[],r={},n=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,s;s=n.exec(e);){if(s[1])try{r=JSON.parse(s[1]),i.push(r)}catch{}if(s[4])r.content=s[4].replace(/^\t/gm,""),i.push(r),r={};else{var l=s[2],a=s[3];if(l=="regex"){var b=/\/((?:[^\/\\]|\\.)*)|$/g;r.guard=b.exec(a)[1],r.trigger=b.exec(a)[1],r.endTrigger=b.exec(a)[1],r.endGuard=b.exec(a)[1]}else l=="snippet"?(r.tabTrigger=a.match(/^\S*/)[0],r.name||(r.name=a)):l&&(r[l]=a)}}return i},this.getSnippetByName=function(e,i){var r=this.snippetNameMap,n;return this.getActiveScopes(i).some(function(s){var l=r[s];return l&&(n=l[e]),!!n},this),n}}).call(p.prototype);var u=function(e){if(e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=d.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)};(function(){this.attach=function(e){this.index=0,this.ranges=[],this.tabstops=[],this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges=null,this.tabstops=null,this.selectedTabstop=null,this.editor.removeListener("change",this.$onChange),this.editor.removeListener("changeSelection",this.$onChangeSelection),this.editor.removeListener("changeSession",this.$onChangeSession),this.editor.commands.removeListener("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.editor=null},this.onChange=function(e){for(var i=e.action[0]=="r",r=this.selectedTabstop||{},n=r.parents||{},s=(this.tabstops||[]).slice(),l=0;l<s.length;l++){var a=s[l],b=a==r||n[a.index];if(a.rangeList.$bias=b?0:1,e.action=="remove"&&a!==r){var c=a.parents&&a.parents[r.index],T=a.rangeList.pointIndex(e.start,c);T=T<0?-T-1:T+1;var v=a.rangeList.pointIndex(e.end,c);v=v<0?-v-1:v-1;for(var _=a.rangeList.ranges.slice(T,v),R=0;R<_.length;R++)this.removeRange(_[R])}a.rangeList.$onChange(e)}var E=this.editor.session;!this.$inChange&&i&&E.getLength()==1&&!E.getValue()&&this.detach()},this.updateLinkedFields=function(){var e=this.selectedTabstop;if(!(!e||!e.hasLinkedRanges||!e.firstNonLinked)){this.$inChange=!0;for(var i=this.editor.session,r=i.getTextRange(e.firstNonLinked),n=0;n<e.length;n++){var s=e[n];if(!!s.linked){var l=s.original,a=S.snippetManager.tmStrFormat(r,l,this.editor);i.replace(s,a)}}this.$inChange=!1}},this.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},this.onChangeSelection=function(){if(!!this.editor){for(var e=this.editor.selection.lead,i=this.editor.selection.anchor,r=this.editor.selection.isEmpty(),n=0;n<this.ranges.length;n++)if(!this.ranges[n].linked){var s=this.ranges[n].contains(e.row,e.column),l=r||this.ranges[n].contains(i.row,i.column);if(s&&l)return}this.detach()}},this.onChangeSession=function(){this.detach()},this.tabNext=function(e){var i=this.tabstops.length,r=this.index+(e||1);r=Math.min(Math.max(r,1),i),r==i&&(r=0),this.selectTabstop(r),r===0&&this.detach()},this.selectTabstop=function(e){this.$openTabstops=null;var i=this.tabstops[this.index];if(i&&this.addTabstopMarkers(i),this.index=e,i=this.tabstops[this.index],!(!i||!i.length)){this.selectedTabstop=i;var r=i.firstNonLinked||i;if(i.choices&&(r.cursor=r.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(r);else{var n=this.editor.multiSelect;n.toSingleRange(r);for(var s=0;s<i.length;s++)i.hasLinkedRanges&&i[s].linked||n.addRange(i[s].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},this.addTabstops=function(e,i,r){var n=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!e[0]){var s=m.fromPoints(r,r);A(s.start,i),A(s.end,i),e[0]=[s],e[0].index=0}var l=this.index,a=[l+1,0],b=this.ranges;e.forEach(function(c,T){for(var v=this.$openTabstops[T]||c,_=0;_<c.length;_++){var R=c[_],E=m.fromPoints(R.start,R.end||R.start);h(E.start,i),h(E.end,i),E.original=R,E.tabstop=v,b.push(E),v!=c?v.unshift(E):v[_]=E,R.fmtString||v.firstNonLinked&&n?(E.linked=!0,v.hasLinkedRanges=!0):v.firstNonLinked||(v.firstNonLinked=E)}v.firstNonLinked||(v.hasLinkedRanges=!1),v===c&&(a.push(v),this.$openTabstops[T]=v),this.addTabstopMarkers(v),v.rangeList=v.rangeList||new g,v.rangeList.$bias=0,v.rangeList.addList(v)},this),a.length>2&&(this.tabstops.length&&a.push(a.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,a))},this.addTabstopMarkers=function(e){var i=this.editor.session;e.forEach(function(r){r.markerId||(r.markerId=i.addMarker(r,"ace_snippet-marker","text"))})},this.removeTabstopMarkers=function(e){var i=this.editor.session;e.forEach(function(r){i.removeMarker(r.markerId),r.markerId=null})},this.removeRange=function(e){var i=e.tabstop.indexOf(e);i!=-1&&e.tabstop.splice(i,1),i=this.ranges.indexOf(e),i!=-1&&this.ranges.splice(i,1),i=e.tabstop.rangeList.ranges.indexOf(e),i!=-1&&e.tabstop.splice(i,1),this.editor.session.removeMarker(e.markerId),e.tabstop.length||(i=this.tabstops.indexOf(e.tabstop),i!=-1&&this.tabstops.splice(i,1),this.tabstops.length||this.detach())},this.keyboardHandler=new y,this.keyboardHandler.bindKeys({Tab:function(e){S.snippetManager&&S.snippetManager.expandWithTab(e)||(e.tabstopManager.tabNext(1),e.renderer.scrollCursorIntoView())},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1),e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}})}).call(u.prototype);var h=function(e,i){e.row==0&&(e.column+=i.column),e.row+=i.row},A=function(e,i){e.row==i.row&&(e.column-=i.column),e.row-=i.row};M.importCssString(`
|
|
.ace_snippet-marker {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
background: rgba(194, 193, 208, 0.09);
|
|
border: 1px dotted rgba(211, 208, 235, 0.62);
|
|
position: absolute;
|
|
}`,"snippets.css",!1),S.snippetManager=new p;var L=f("./editor").Editor;(function(){this.insertSnippet=function(e,i){return S.snippetManager.insertSnippet(this,e,i)},this.expandSnippet=function(e){return S.snippetManager.expandWithTab(this,e)}}).call(L.prototype)}),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom"],function(f,S,I){var M=f("../virtual_renderer").VirtualRenderer,w=f("../editor").Editor,C=f("../range").Range,d=f("../lib/event"),m=f("../lib/lang"),g=f("../lib/dom"),y=function(x){var o=new M(x);o.$maxLines=4;var t=new w(o);return t.setHighlightActiveLine(!1),t.setShowPrintMargin(!1),t.renderer.setShowGutter(!1),t.renderer.setHighlightGutterLine(!1),t.$mouseHandler.$focusTimeout=0,t.$highlightTagPending=!0,t},k=function(x){var o=g.createElement("div"),t=new y(o);x&&x.appendChild(o),o.style.display="none",t.renderer.content.style.cursor="default",t.renderer.setStyle("ace_autocomplete"),t.setOption("displayIndentGuides",!1),t.setOption("dragDelay",150);var p=function(){};t.focus=p,t.$isFocused=!0,t.renderer.$cursorLayer.restartTimer=p,t.renderer.$cursorLayer.element.style.opacity=0,t.renderer.$maxLines=8,t.renderer.$keepTextAreaAtCursor=!1,t.setHighlightActiveLine(!1),t.session.highlight(""),t.session.$searchHighlight.clazz="ace_highlight-marker",t.on("mousedown",function(r){var n=r.getDocumentPosition();t.selection.moveToPosition(n),A.start.row=A.end.row=n.row,r.stop()});var u,h=new C(-1,0,-1,1/0),A=new C(-1,0,-1,1/0);A.id=t.session.addMarker(A,"ace_active-line","fullLine"),t.setSelectOnHover=function(r){r?h.id&&(t.session.removeMarker(h.id),h.id=null):h.id=t.session.addMarker(h,"ace_line-hover","fullLine")},t.setSelectOnHover(!1),t.on("mousemove",function(r){if(!u){u=r;return}if(!(u.x==r.x&&u.y==r.y)){u=r,u.scrollTop=t.renderer.scrollTop;var n=u.getDocumentPosition().row;h.start.row!=n&&(h.id||t.setRow(n),e(n))}}),t.renderer.on("beforeRender",function(){if(u&&h.start.row!=-1){u.$pos=null;var r=u.getDocumentPosition().row;h.id||t.setRow(r),e(r,!0)}}),t.renderer.on("afterRender",function(){var r=t.getRow(),n=t.renderer.$textLayer,s=n.element.childNodes[r-n.config.firstRow];s!==n.selectedNode&&n.selectedNode&&g.removeCssClass(n.selectedNode,"ace_selected"),n.selectedNode=s,s&&g.addCssClass(s,"ace_selected")});var L=function(){e(-1)},e=function(r,n){r!==h.start.row&&(h.start.row=h.end.row=r,n||t.session._emit("changeBackMarker"),t._emit("changeHoverMarker"))};t.getHoveredRow=function(){return h.start.row},d.addListener(t.container,"mouseout",L),t.on("hide",L),t.on("changeSelection",L),t.session.doc.getLength=function(){return t.data.length},t.session.doc.getLine=function(r){var n=t.data[r];return typeof n=="string"?n:n&&n.value||""};var i=t.session.bgTokenizer;return i.$tokenizeRow=function(r){var n=t.data[r],s=[];if(!n)return s;typeof n=="string"&&(n={value:n});var l=n.caption||n.value||n.name;function a(B,D){B&&s.push({type:(n.className||"")+(D||""),value:B})}for(var b=l.toLowerCase(),c=(t.filterText||"").toLowerCase(),T=0,v=0,_=0;_<=c.length;_++)if(_!=v&&(n.matchMask&1<<_||_==c.length)){var R=c.slice(v,_);v=_;var E=b.indexOf(R,T);if(E==-1)continue;a(l.slice(T,E),""),T=E+R.length,a(l.slice(E,T),"completion-highlight")}return a(l.slice(T,l.length),""),n.meta&&s.push({type:"completion-meta",value:n.meta}),n.message&&s.push({type:"completion-message",value:n.message}),s},i.$updateOnChange=p,i.start=p,t.session.$computeWidth=function(){return this.screenWidth=0},t.isOpen=!1,t.isTopdown=!1,t.autoSelect=!0,t.filterText="",t.data=[],t.setData=function(r,n){t.filterText=n||"",t.setValue(m.stringRepeat(`
|
|
`,r.length),-1),t.data=r||[],t.setRow(0)},t.getData=function(r){return t.data[r]},t.getRow=function(){return A.start.row},t.setRow=function(r){r=Math.max(this.autoSelect?0:-1,Math.min(this.data.length,r)),A.start.row!=r&&(t.selection.clearSelection(),A.start.row=A.end.row=r||0,t.session._emit("changeBackMarker"),t.moveCursorTo(r||0,0),t.isOpen&&t._signal("select"))},t.on("changeSelection",function(){t.isOpen&&t.setRow(t.selection.lead.row),t.renderer.scrollCursorIntoView()}),t.hide=function(){this.container.style.display="none",this._signal("hide"),t.isOpen=!1},t.show=function(r,n,s){var l=this.container,a=window.innerHeight,b=window.innerWidth,c=this.renderer,T=c.$maxLines*n*1.4,v=r.top+this.$borderSize,_=v>a/2&&!s;_&&v+n+T>a?(c.$maxPixelHeight=v-2*this.$borderSize,l.style.top="",l.style.bottom=a-v+"px",t.isTopdown=!1):(v+=n,c.$maxPixelHeight=a-v-.2*n,l.style.top=v+"px",l.style.bottom="",t.isTopdown=!0),l.style.display="";var R=r.left;R+l.offsetWidth>b&&(R=b-l.offsetWidth),l.style.left=R+"px",this._signal("show"),u=null,t.isOpen=!0},t.goTo=function(r){var n=this.getRow(),s=this.session.getLength()-1;switch(r){case"up":n=n<=0?s:n-1;break;case"down":n=n>=s?-1:n+1;break;case"start":n=0;break;case"end":n=s;break}this.setRow(n)},t.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},t.$imageSize=0,t.$borderSize=1,t};g.importCssString(`
|
|
.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
|
|
background-color: #CAD6FA;
|
|
z-index: 1;
|
|
}
|
|
.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
|
|
background-color: #3a674e;
|
|
}
|
|
.ace_editor.ace_autocomplete .ace_line-hover {
|
|
border: 1px solid #abbffe;
|
|
margin-top: -1px;
|
|
background: rgba(233,233,253,0.4);
|
|
position: absolute;
|
|
z-index: 2;
|
|
}
|
|
.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {
|
|
border: 1px solid rgba(109, 150, 13, 0.8);
|
|
background: rgba(58, 103, 78, 0.62);
|
|
}
|
|
.ace_completion-meta {
|
|
opacity: 0.5;
|
|
margin: 0.9em;
|
|
}
|
|
.ace_completion-message {
|
|
color: blue;
|
|
}
|
|
.ace_editor.ace_autocomplete .ace_completion-highlight{
|
|
color: #2d69c7;
|
|
}
|
|
.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{
|
|
color: #93ca12;
|
|
}
|
|
.ace_editor.ace_autocomplete {
|
|
width: 300px;
|
|
z-index: 200000;
|
|
border: 1px lightgray solid;
|
|
position: fixed;
|
|
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
line-height: 1.4;
|
|
background: #fefefe;
|
|
color: #111;
|
|
}
|
|
.ace_dark.ace_editor.ace_autocomplete {
|
|
border: 1px #484747 solid;
|
|
box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);
|
|
line-height: 1.4;
|
|
background: #25282c;
|
|
color: #c1c1c1;
|
|
}`,"autocompletion.css",!1),S.AcePopup=k,S.$singleLineEditor=y}),ace.define("ace/autocomplete/util",["require","exports","module"],function(f,S,I){S.parForEach=function(w,C,d){var m=0,g=w.length;g===0&&d();for(var y=0;y<g;y++)C(w[y],function(k,x){m++,m===g&&d(k,x)})};var M=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;S.retrievePrecedingIdentifier=function(w,C,d){d=d||M;for(var m=[],g=C-1;g>=0&&d.test(w[g]);g--)m.push(w[g]);return m.reverse().join("")},S.retrieveFollowingIdentifier=function(w,C,d){d=d||M;for(var m=[],g=C;g<w.length&&d.test(w[g]);g++)m.push(w[g]);return m},S.getCompletionPrefix=function(w){var C=w.getCursorPosition(),d=w.session.getLine(C.row),m;return w.completers.forEach(function(g){g.identifierRegexps&&g.identifierRegexps.forEach(function(y){!m&&y&&(m=this.retrievePrecedingIdentifier(d,C.column,y))}.bind(this))}.bind(this)),m||this.retrievePrecedingIdentifier(d,C.column)}}),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"],function(f,S,I){var M=f("./keyboard/hash_handler").HashHandler,w=f("./autocomplete/popup").AcePopup,C=f("./autocomplete/util"),d=f("./lib/lang"),m=f("./lib/dom"),g=f("./snippets").snippetManager,y=f("./config"),k=function(){this.autoInsert=!1,this.autoSelect=!0,this.exactMatch=!1,this.gatherCompletionsId=0,this.keyboardHandler=new M,this.keyboardHandler.bindKeys(this.commands),this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.changeTimer=d.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=d.delayedCall(this.updateDocTooltip.bind(this),50)};(function(){this.$init=function(){return this.popup=new w(document.body||document.documentElement),this.popup.on("click",function(o){this.insertMatch(),o.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.tooltipTimer.bind(null,null)),this.popup.on("select",this.tooltipTimer.bind(null,null)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup},this.getPopup=function(){return this.popup||this.$init()},this.openPopup=function(o,t,p){this.popup||this.$init(),this.popup.autoSelect=this.autoSelect,this.popup.setData(this.completions.filtered,this.completions.filterText),o.keyBinding.addKeyboardHandler(this.keyboardHandler);var u=o.renderer;if(this.popup.setRow(this.autoSelect?0:-1),p)p&&!t&&this.detach();else{this.popup.setTheme(o.getTheme()),this.popup.setFontSize(o.getFontSize());var h=u.layerConfig.lineHeight,A=u.$cursorLayer.getPixelPosition(this.base,!0);A.left-=this.popup.getTextLeftOffset();var L=o.container.getBoundingClientRect();A.top+=L.top-u.layerConfig.offset,A.left+=L.left-o.renderer.scrollLeft,A.left+=u.gutterWidth,this.popup.show(A,h)}this.changeTimer.cancel()},this.detach=function(){this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener),this.changeTimer.cancel(),this.hideDocTooltip(),this.gatherCompletionsId+=1,this.popup&&this.popup.isOpen&&this.popup.hide(),this.base&&this.base.detach(),this.activated=!1,this.completions=this.base=null},this.changeListener=function(o){var t=this.editor.selection.lead;(t.row!=this.base.row||t.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},this.blurListener=function(o){var t=document.activeElement,p=this.editor.textInput.getElement(),u=o.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(o.relatedTarget),h=this.popup&&this.popup.container;t!=p&&t.parentNode!=h&&!u&&t!=this.tooltipNode&&o.relatedTarget!=p&&this.detach()},this.mousedownListener=function(o){this.detach()},this.mousewheelListener=function(o){this.detach()},this.goTo=function(o){this.popup.goTo(o)},this.insertMatch=function(o,t){if(o||(o=this.popup.getData(this.popup.getRow())),!o)return!1;var p=this.completions;if(this.editor.startOperation({command:{name:"insertMatch"}}),o.completer&&o.completer.insertMatch)o.completer.insertMatch(this.editor,o);else{if(!p)return!1;if(p.filterText)for(var u=this.editor.selection.getAllRanges(),h=0,A;A=u[h];h++)A.start.column-=p.filterText.length,this.editor.session.remove(A);o.snippet?g.insertSnippet(this.editor,o.snippet):this.editor.execCommand("insertstring",o.value||o)}this.completions==p&&this.detach(),this.editor.endOperation()},this.commands={Up:function(o){o.completer.goTo("up")},Down:function(o){o.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(o){o.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(o){o.completer.goTo("end")},Esc:function(o){o.completer.detach()},Return:function(o){return o.completer.insertMatch()},"Shift-Return":function(o){o.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(o){var t=o.completer.insertMatch();if(!t&&!o.tabstopManager)o.completer.goTo("down");else return t},PageUp:function(o){o.completer.popup.gotoPageUp()},PageDown:function(o){o.completer.popup.gotoPageDown()}},this.gatherCompletions=function(o,t){var p=o.getSession(),u=o.getCursorPosition(),h=C.getCompletionPrefix(o);this.base=p.doc.createAnchor(u.row,u.column-h.length),this.base.$insertRight=!0;var A=[],L=o.completers.length;return o.completers.forEach(function(e,i){e.getCompletions(o,p,u,h,function(r,n){!r&&n&&(A=A.concat(n)),t(null,{prefix:C.getCompletionPrefix(o),matches:A,finished:--L===0})})}),!0},this.showPopup=function(o,t){this.editor&&this.detach(),this.activated=!0,this.editor=o,o.completer!=this&&(o.completer&&o.completer.detach(),o.completer=this),o.on("changeSelection",this.changeListener),o.on("blur",this.blurListener),o.on("mousedown",this.mousedownListener),o.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,t)},this.updateCompletions=function(o,t){if(o&&this.base&&this.completions){var p=this.editor.getCursorPosition(),u=this.editor.session.getTextRange({start:this.base,end:p});if(u==this.completions.filterText)return;if(this.completions.setFilter(u),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==u&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,u,o);return}if(t&&t.matches){var p=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(p.row,p.column),this.base.$insertRight=!0,this.completions=new x(t.matches),this.openPopup(this.editor,"",o)}var h=this.gatherCompletionsId,A=function(n){if(!!n.finished)return this.detach()}.bind(this),L=function(n){var s=n.prefix,l=n.matches;this.completions=new x(l),this.exactMatch&&(this.completions.exactMatch=!0),this.completions.setFilter(s);var a=this.completions.filtered;if(!a.length||a.length==1&&a[0].value==s&&!a[0].snippet)return A(n);if(this.autoInsert&&a.length==1&&n.finished)return this.insertMatch(a[0]);this.openPopup(this.editor,s,o)}.bind(this),e=!0,i=null;if(this.gatherCompletions(this.editor,function(n,s){var l=s.prefix,a=s&&s.matches;if(!a||!a.length)return A(s);if(!(l.indexOf(s.prefix)!==0||h!=this.gatherCompletionsId)){if(e){i=s;return}L(s)}}.bind(this)),e=!1,i){var r=i;i=null,L(r)}},this.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},this.updateDocTooltip=function(){var o=this.popup,t=o.data,p=t&&(t[o.getHoveredRow()]||t[o.getRow()]),u=null;if(!p||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();if(this.editor.completers.some(function(h){return h.getDocTooltip&&(u=h.getDocTooltip(p)),u}),!u&&typeof p!="string"&&(u=p),typeof u=="string"&&(u={docText:u}),!u||!(u.docHTML||u.docText))return this.hideDocTooltip();this.showDocTooltip(u)},this.showDocTooltip=function(o){this.tooltipNode||(this.tooltipNode=m.createElement("div"),this.tooltipNode.className="ace_tooltip ace_doc-tooltip",this.tooltipNode.style.margin=0,this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this));var t=this.tooltipNode;o.docHTML?t.innerHTML=o.docHTML:o.docText&&(t.textContent=o.docText),t.parentNode||document.body.appendChild(t);var p=this.popup,u=p.container.getBoundingClientRect();t.style.top=p.container.style.top,t.style.bottom=p.container.style.bottom,t.style.display="block",window.innerWidth-u.right<320?u.left<320?p.isTopdown?(t.style.top=u.bottom+"px",t.style.left=u.left+"px",t.style.right="",t.style.bottom=""):(t.style.top=p.container.offsetTop-t.offsetHeight+"px",t.style.left=u.left+"px",t.style.right="",t.style.bottom=""):(t.style.right=window.innerWidth-u.left+"px",t.style.left=""):(t.style.left=u.right+1+"px",t.style.right="")},this.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var o=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==o&&this.editor.focus(),this.tooltipNode=null,o.parentNode&&o.parentNode.removeChild(o)}},this.onTooltipClick=function(o){for(var t=o.target;t&&t!=this.tooltipNode;){if(t.nodeName=="A"&&t.href){t.rel="noreferrer",t.target="_blank";break}t=t.parentNode}},this.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var o=this.popup.container;o&&o.parentNode&&o.parentNode.removeChild(o)}this.editor&&this.editor.completer==this&&this.editor.completer==null,this.popup=null}}).call(k.prototype),k.for=function(o){return o.completer||(y.get("sharedPopups")?(k.$shared||(k.$sharedInstance=new k),o.completer=k.$sharedInstance):(o.completer=new k,o.once("destroy",function(t,p){p.completer.destroy()}))),o.completer},k.startCommand={name:"startAutocomplete",exec:function(o,t){var p=k.for(o);p.autoInsert=!1,p.autoSelect=!0,p.showPopup(o,t),p.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var x=function(o,t){this.all=o,this.filtered=o,this.filterText=t||"",this.exactMatch=!1};(function(){this.setFilter=function(o){if(o.length>this.filterText&&o.lastIndexOf(this.filterText,0)===0)var t=this.filtered;else var t=this.all;this.filterText=o,t=this.filterCompletions(t,this.filterText),t=t.sort(function(u,h){return h.exactMatch-u.exactMatch||h.$score-u.$score||(u.caption||u.value).localeCompare(h.caption||h.value)});var p=null;t=t.filter(function(u){var h=u.snippet||u.caption||u.value;return h===p?!1:(p=h,!0)}),this.filtered=t},this.filterCompletions=function(o,t){var p=[],u=t.toUpperCase(),h=t.toLowerCase();e:for(var A=0,L;L=o[A];A++){var e=L.caption||L.value||L.snippet;if(!!e){var i=-1,r=0,n=0,s,l;if(this.exactMatch){if(t!==e.substr(0,t.length))continue e}else{var a=e.toLowerCase().indexOf(h);if(a>-1)n=a;else for(var b=0;b<t.length;b++){var c=e.indexOf(h[b],i+1),T=e.indexOf(u[b],i+1);if(s=c>=0&&(T<0||c<T)?c:T,s<0)continue e;l=s-i-1,l>0&&(i===-1&&(n+=10),n+=l,r=r|1<<b),i=s}}L.matchMask=r,L.exactMatch=n?0:1,L.$score=(L.score||0)-n,p.push(L)}}return p}}).call(x.prototype),S.Autocomplete=k,S.FilteredList=x}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(f,S,I){var M=f("../range").Range,w=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function C(m,g){var y=m.getTextRange(M.fromPoints({row:0,column:0},g));return y.split(w).length-1}function d(m,g){var y=C(m,g),k=m.getValue().split(w),x=Object.create(null),o=k[y];return k.forEach(function(t,p){if(!(!t||t===o)){var u=Math.abs(y-p),h=k.length-u;x[t]?x[t]=Math.max(h,x[t]):x[t]=h}}),x}S.getCompletions=function(m,g,y,k,x){var o=d(g,y),t=Object.keys(o);x(null,t.map(function(p){return{caption:p,value:p,score:o[p],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(f,S,I){var M=f("../snippets").snippetManager,w=f("../autocomplete").Autocomplete,C=f("../config"),d=f("../lib/lang"),m=f("../autocomplete/util"),g=f("../autocomplete/text_completer"),y={getCompletions:function(e,i,r,n,s){if(i.$mode.completer)return i.$mode.completer.getCompletions(e,i,r,n,s);var l=e.session.getState(r.row),a=i.$mode.getCompletions(l,i,r,n);s(null,a)}},k=function(e){var i={};return e.replace(/\${(\d+)(:(.*?))?}/g,function(r,n,s,l){return i[n]=l||""}).replace(/\$(\d+?)/g,function(r,n){return i[n]})},x={getCompletions:function(e,i,r,n,s){var l=[],a=i.getTokenAt(r.row,r.column);a&&a.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?l.push("html-tag"):l=M.getActiveScopes(e);var b=M.snippetMap,c=[];l.forEach(function(T){for(var v=b[T]||[],_=v.length;_--;){var R=v[_],E=R.name||R.tabTrigger;!E||c.push({caption:E,snippet:R.content,meta:R.tabTrigger&&!R.name?R.tabTrigger+"\u21E5 ":"snippet",type:"snippet"})}},this),s(null,c)},getDocTooltip:function(e){e.type=="snippet"&&!e.docHTML&&(e.docHTML=["<b>",d.escapeHTML(e.caption),"</b>","<hr></hr>",d.escapeHTML(k(e.snippet))].join(""))}},o=[x,g,y];S.setCompleters=function(e){o.length=0,e&&o.push.apply(o,e)},S.addCompleter=function(e){o.push(e)},S.textCompleter=g,S.keyWordCompleter=y,S.snippetCompleter=x;var t={name:"expandSnippet",exec:function(e){return M.expandWithTab(e)},bindKey:"Tab"},p=function(e,i){u(i.session.$mode)},u=function(e){typeof e=="string"&&(e=C.$modes[e]),e&&(M.files||(M.files={}),h(e.$id,e.snippetFileId),e.modes&&e.modes.forEach(u))},h=function(e,i){!i||!e||M.files[e]||(M.files[e]={},C.loadModule(i,function(r){!r||(M.files[e]=r,!r.snippets&&r.snippetText&&(r.snippets=M.parseSnippetFile(r.snippetText)),M.register(r.snippets||[],r.scope),r.includeScopes&&(M.snippetMap[r.scope].includeScopes=r.includeScopes,r.includeScopes.forEach(function(n){u("ace/mode/"+n)})))}))},A=function(e){var i=e.editor,r=i.completer&&i.completer.activated;if(e.command.name==="backspace")r&&!m.getCompletionPrefix(i)&&i.completer.detach();else if(e.command.name==="insertstring"){var n=m.getCompletionPrefix(i);if(n&&!r){var s=w.for(i);s.autoInsert=!1,s.showPopup(i)}}},L=f("../editor").Editor;f("../config").defineOptions(L.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:o),this.commands.addCommand(w.startCommand)):this.commands.removeCommand(w.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:o),this.commands.on("afterExec",A)):this.commands.removeListener("afterExec",A)},value:!1},enableSnippets:{set:function(e){e?(this.commands.addCommand(t),this.on("changeMode",p),p(null,this)):(this.commands.removeCommand(t),this.off("changeMode",p))},value:!1}})}),function(){ace.require(["ace/ext/language_tools"],function(f){H&&(H.exports=f)})}()})(ee);
|